Playground for the quasi strawmen

# Mike Samuel (15 years ago)

I put together a playground so you can interactively experiment with the quasi strawman syntax while I update the draft spec.

Take a look at js-quasis-libraries-and-repl.googlecode.com/svn/trunk/index.html

It's a REPL derived from the squarefree shell which desugars the input before eval-ing it.

You can get started with some canned example code available from a drop-down at the top right.

There's a few quasi-handlers built in:

safehtml - this does contextual auto-escaping of dynamic value in HTML

msg - this implements quite a bit of Shanjian's String.format proposal, but on top of quasis.

html_msg - this demonstrates that it is possible to write quasi handlers that compose using a simple shim, so quasis do not force you to choose between having composed content be secure or i18n-able.

raw - a simple quasi handler that gets python style raw strings.

cheers, mike

(I debugged this on a number of browsers, but I haven't had a change to try a lot of older, smaller, mobile, or OS-specific browsers.)

# Mike Samuel (14 years ago)

I updated the quasi strawman and quasi playground based on feedback from the last meeting.

Strawman strawman:quasis Playground js-quasis-libraries-and-repl.googlecode.com/svn/trunk/index.html

Changes: (1) No thunking of substitutions. Link to thunking proposal that could be used instead. (2) No currying in the desugaring. Link to currying proposal that could be used instead. (3) Added a link to a proposal for specifying the quasi tag as a MemberExpression that could be used instead of the current QuasiTag ::== Identifier (4) Made the QuasiTag optional and added semantics for no QuasiTag as suggested by Brendan. (5) Substitution body grammar defined in terms of PrimaryExpression. Linked to alternative definitions. (6) Reworked grammar to simplify how substitution boundaries are defined. (7) Fleshed out text L10N use case based on discussions with cira and markdavis