You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/_posts/2018-06-13-accessible-scala.md
+49-20Lines changed: 49 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5,42 +5,71 @@ by: Guillaume Massé
5
5
title: Introducing Accessible Scala
6
6
---
7
7
8
-
Have you found yourself where you had to verbally describe code? For example, while pair-programming
9
-
or talking about work during lunch. Verbally describing code is not an easy task, fortunately for you the
10
-
Scala Center is working on this. [SCP-016]: Accessible Scala, was submitted to provide industry-leading support
11
-
for blind and partially-sighted developers. It's also an opportunity to formalize a spoken Scala. For example,
12
-
how do you pronounce: `Map[K, V]`? Perhaps `Map of K V`, or maybe `Map taking K and V`.
13
-
14
-
Reading Scala out loud make some of its syntactic elements less intimidating for beginners. When we read the
15
-
following expression: `class S[+T]` as `class S parameterized with covariant T`, we don't need to mentally
16
-
associate the syntax `+T` with its concept `co-variant`.
17
-
18
-
One of the goals of the proposal is to remove the noise introduced by various delimiters. Notice how the type
19
-
parameter delimiters: `[` and `]` are absent from the verbal description. However, with more complex expressions,
20
-
this can make the audible form ambiguous, for example, with nested types: `Either[Wobble[T], Option[Wobble[S]]]`
21
-
becomes: `Either applied to types Wobble of T, Option of Wobble of S`.
22
-
8
+
Scala is proudly a welcoming environment for all. The Scala Center is demonstrating this by supporting
9
+
the development of Accessible Scala, a tool for blind and partially-sighted developers (see [SCP-016]).
10
+
One of its goals is to remove the noise introduced by various delimiters. For example, we could read the
11
+
following expression: `class S[+T]` as `class S parameterized with covariant T`. Since there is more than one way
12
+
to pronounce Scala source code, we are open to the community proposition. You can find an extensive test case
13
+
here: [DescribeTest.scala]. If you find that descriptions could be improved, send us a pull request with the
14
+
expected form.
15
+
16
+
Reading Scala out loud make some of its syntactic elements less intimidating for beginners. There is no more
17
+
need to mentally associate the syntax `+T` with its concept `co-variant`. Notice on the example above, how the type parameter delimiters: `[` and `]` are absent from the verbal description. It call also help sighted developers to describe Scala orally, for example in the context of pair programming. However, when expressions get more complex, the audible form can become ambiguous or difficult to decypher.
18
+
23
19
To overcome the limitation of verbal description, we created a technique called the Cursor. The idea is simple:
24
20
from your cursor location, you can navigate the abstract syntax tree of the source code. From a node, you can
25
21
navigate to the parent node, to the siblings (left or right) or the first child. As you navigate the code,
26
-
it's described and selected. We created an online demo (adjust your volume!) to let you try the cursor
22
+
it's described verbally and selected. Here is an illustrated example, the arrows (→ exp ←) repesents the highlighted text and <kbd>Alt</kbd> + <kbd>Arrow</kbd> the keyboard shorcut applied to navigate.
23
+
24
+
```
25
+
26
+
→ private ← class A { // speaks: "private"
27
+
val a = 1
28
+
}
29
+
```
30
+
31
+
<kbd>Alt</kbd> + <kbd>Right</kbd>
32
+
33
+
```
34
+
private class → A ← { // speaks: "A"
35
+
val a = 1
36
+
}
37
+
```
38
+
39
+
<kbd>Alt</kbd> + <kbd>Down</kbd>
40
+
41
+
```
42
+
private class A {
43
+
→ val a = 1 ← // speaks: "val a equals 1"
44
+
}
45
+
```
46
+
47
+
We created an online demo (adjust your volume!) to let you try the cursor
27
48
technique and hear the descriptions.
28
49
29
50
# Want to try it?
30
51
31
52
We created an [online demo]. You can try it now! (Tip: It works best on google-chrome! )
32
53
33
-
We also created a [vscode extension] so you can try on your project. Search for `Accessible Scala` in the
54
+
We also created a [vscode extension], so you can try on your project. Search for `Accessible Scala` in the
0 commit comments