Releases: wordplaydev/wordplay
Structure value fixes
Two bug fixes this week:
- Property refinements are simple ways to clone a structure value with a new input (e.g.,
structure.a: 5
), but they weren't properly updating functions and properties when evaluated. They are now! - All bindings in structures, not just inputs, are included in rendered output
Bug fixes!
Lots of bug fixes this week:
- Improvements to the
Chat
stream - Improvements to examples in documentation for lists
- Improved conflict messages for unused binds
- Improved parsing for structure refinements to avoid conflicts with list spreads
- Improved robustness of type inference on documented bindings
We also decided to disable automatic pretty printing. It was just too jumpy and confusing to be usable. Pretty printing is still available on demand whenever you want to invoke it with a keyboard shortcut or toolbar button.
v0.9.34-beta
This week we made one tiny improvement to login feedback and one major language feature addition: matches!
You might be familiar with switch statements in C, Java, and JavaScript; match expressions are similar, but purely functional ways of comparing a value against zero or more expressions and evaluating an expression for the match, with a default. For example, imagine you wanted to map a number onto a number suffix, like converting 1 to 1st
. Doing that with a basic conditional would require repeating the same expression multiple times and uses a lot of ?
's:
number = 1 ? '1st'
number = 2 ? '2nd'
number = 3 ? '3rd'
'\number\th'
Matches make this a lot simpler and easier to read:
number ???
1: '1st'
2: '2nd'
3: '3rd'
'\number\th'
The syntax is also a visual pun: ???
suggests that there are many questions. Note that it is possible to do the above with a map literal too, combined with an otherwise ??
expression to handle the ø
value, but that's pretty unpleasant:
{
1: '1st'
2: '2nd'
3: '3rd'
}{number} ?? '\number\th'
It does have the nice feature of mirroring the same syntax though, reusing the same convention of the bind symbol :
always representing a mapping from one thing to another.
Bug fixes!
Today we released several bug fixes, including:
- Improvements to gallery creation
- Better feedback on login failures after repeated attempts
- More consistent names for list functions
- Improvements to font rendering in Safari
Bug fixes and minor feature additions
It's been a while since we tagged a release, but there have been enough additions that it's worth highlighting a few of them!
-
Wordplay now supports eliding expressions. In other programming languages, comment syntax is often used for this, as well as documentation, but Wordplay splits these into two different formats. Documentation goes in ` ` blocks before declarations and expressions. But to elide something, wrap it in
*
. For example, here's an expression elided from a list:[1 2 *3* 4 5]
. -
When there's a syntax error, Wordplay will now try to make basic inferences about what you might have intended. It's not super intelligent (yet), but it will catch many basic typos and offer to fix them for you.
-
It's now possible to generate file output using
Source
. Just give it a name and a value, and it will serialize that value in a source file of the name of your choosing. This is a great way to use Wordplay as a basic database to store data on the web, using a project to modify it. One limitation is that only people with permissions to edit a project can run the project, since it requires write permissions. If you share a project, other creators can copy your project to use it for their own purposes. -
There's a new
Scene
stream, which will take a list of outputs and animate through them, automatically managing when animations complete to move on to the next element. It's also possible to block movement between parts of a scene based on dynamic boolean values, enabling the creation of interactive stories. -
Projects now detect many kinds of personally identifiable information and will not save online until you indicate whether the data is PII.
-
We've added text formatting controls in the output palette.
-
We improved type guard support for list and map accesses, and type inference from evaluation statements on structure creations.
-
We added coalescing on none values. For example, if
a
were a non-ø value, the expressiona ?? 1
would evaluate toa
's value. Ifa
wereø
it would evaluate to1
.
There are still lots of details to polish before we reach 1.0, but the Wordplaypen community of UW undergraduates and other contributors are making steady progress.
Wordplay beta
We're excited to announce a beta release of Wordplay, a new programming language for creating interactive typography! Learn more about Wordplay at Wordplay.dev, or at this blog post:
This beta release has several known issues and likely several unknown issues:
- The Spanish tutorial is not yet complete
- The Chinese localization is partial, and pending, and so not yet live
- There are numerous new features pending for the output APIs that we believe are key to 1.0.
We're excited to hear your feedback, and of any bugs you find, and work towards a stable 1.0 with the community.