Skip to content

Introducing Accessible Scala blog post #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions _sass/base/media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,23 @@ picture {
margin: 0;
max-width: 100%;
}

// site design / logo © 2015 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required
// stackexchange.com
kbd {
padding: .1em .6em;
border: 1px solid #ccc;
font-size: 11px;
font-family: Arial,Helvetica,sans-serif;
background-color: #f7f7f7;
color: #333;
-moz-box-shadow: 0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
box-shadow: 0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
border-radius: 3px;
display: inline-block;
margin: 0 .1em;
text-shadow: 0 1px 0 #fff;
line-height: 1.4;
white-space: nowrap
}
110 changes: 110 additions & 0 deletions blog/_posts/2018-06-13-accessible-scala.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
layout: blog-detail
post-type: blog
by: Guillaume Massé
title: Introducing Accessible Scala
---

Scala is proudly a welcoming environment for all. The Scala Center is demonstrating this by supporting
the development of Accessible Scala, a tool for blind and partially-sighted developers (see [SCP-016]).
One of its goals is to remove the noise introduced by various delimiters. The current solution with
text-to-speech engine, would read

```scala
def foo[A: Wibble](s: String, b: Wobble[A]): Int = ...
```

as

```bash
def space foo open square bracket capital s colon space
wibble close square bracket open bracket a colon space
string comma space b colon space wobble open square bracket
capital a close square bracket close bracket colon
space Int space equals space ...
```

Indeed such a description is necessary to enable precision editing.

However, the following would convey the same information more efficiently:

```bash
def foo parameterized with: A context bounded by: Wibble. s String, b Wobble of A returns: Int
```

Since there is more than one way to pronounce Scala source code, we are open to the community proposition. You can find an extensive test case
here: [DescribeTest.scala]. If you find that descriptions could be improved, send us a pull request with the
expected form.

Reading Scala out loud make some of its syntactic elements makes it less intimidating for beginners. There is no more
need to mentally associate the syntax `+T` with its concept `co-variant`. Notice in the example above, how the type parameter delimiters: `[` and `]` are absent from the verbal description. It can 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 decipher.

To overcome the limitation of verbal description, we created a technique called the Cursor. The idea is simple:
from your cursor location, you can navigate the abstract syntax tree of the source code. From a node, you can
navigate to the parent node, to the siblings (left or right) or the first child. As you navigate the code,
it's described verbally and selected. Here is an illustrated example, the arrows (→ exp ←) represents the highlighted text and <kbd>Alt</kbd> + <kbd>Arrow</kbd> the keyboard shortcut applied to navigate.

```

→ private ← class A { // speaks: "private"
val a = 1
}
```

<kbd>Alt</kbd> + <kbd>Right</kbd>

```
private class → A ← { // speaks: "A"
val a = 1
}
```

<kbd>Alt</kbd> + <kbd>Down</kbd>

```
private class A {
→ val a = 1 ← // speaks: "val a equals 1"
}
```

We created an online demo (adjust your volume!) to let you try the cursor
technique and hear the descriptions.

# Want to try it?

We created an [online demo]. You can try it now! (Tip: It works best on Google Chrome! )

We also created a [vscode extension], so you can try on your project. Search for `Accessible Scala` in the
extension manager

<div style="margin: 20px auto; width: 560px;">
<iframe style="margin: 20px auto; display: block;" width="560" height="315" src="https://www.youtube.com/embed/Y7xz0-KkBOU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

<i>Hello world demo</i>

<iframe style="margin: 20px auto; display: block;" width="560" height="315" src="https://www.youtube.com/embed/Up2ytnrsX6s" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

<i>Coverage demo</i>
</div>


# What's next?

We hope you are excited as we are by the online demo. We would like to hear your feedback on the verbal
descriptions. We would like to invite the Scala community to improve the quality of the project and join the
effort. Another area where we would need help
is to create an integration with [Emacspeak]. It's an emacs plugin widely used by blind developers. If you
know emacs lisp well and want to participate, please reach out to us!

# Talk to us!

Thoughts or opinions about Accessible Scala? Join us over on [Scala Contributors] to contribute to the discussion.
We also have a [gitter] channel.

[SCP-016]: https://github.com/scalacenter/advisoryboard/blob/master/proposals/016-verbal-descriptions.md
[vscode extension]: https://marketplace.visualstudio.com/items?itemName=scala-center.accessible-scala
[online demo]: https://scalacenter.github.io/accessible-scala-demo/
[DescribeTest.scala]: https://github.com/scalacenter/accessible-scala/blob/master/tests/unit/src/test/scala/ch.epfl.scala.accessible/DescribeTest.scala
[Emacspeak]: https://github.com/tvraman/emacspeak
[gitter]: https://gitter.im/scalacenter/accessible-scala
[Scala Contributors]: https://contributors.scala-lang.org/TBD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MasseGuillaume can you please open this thread of discussion and make a new PR with the correct link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.