String-first programming languages seem to be a really interesting and underexplored design space. I want something halfway between JSX and Scribble, but not MDX.
-
Show this thread
-
Requirements: * No quotes or escapes -- strings are the default, not the exception. * Allow transition between string and code dialects with as few characters as possible, and with arbitrary nesting. * Should be easy to define non-string data structures: lists, classes, lambdas
1 reply 0 retweets 4 likesShow this thread -
Scribble is by far the best example of this design, but I've found it hard to directly translate its concepts into JS / React. Eg sometimes you want to generate a string (say to pass to KaTeX or Penrose), sometimes you want to generate a React element.
2 replies 0 retweets 2 likesShow this thread -
Replying to @wcrichton
Can you expand on this a little? Isn't sometimes having a string and sometimes having an expression what Scribble does? Or is this about how it translates to JS-like syntax?
2 replies 0 retweets 3 likes -
Replying to @wcrichton @samth
I need three different sigils for function calls (#), React elements (@), and statements (%). In search of a simpler design, but this is currently what I have. Definitely more complex than Scribble, both bc domain reasons (React vs string) and lang reasons (stmt != expr).
2 replies 0 retweets 0 likes -
Replying to @wcrichton
The stmt/expr distinction doesn't seem like it requires the notation distinction -- it's more that in Scribble everything can be done with function-call syntax b/c parentheses.
2 replies 0 retweets 0 likes -
Replying to @samth @wcrichton
Wanting a specific short reader abbreviation for React.createElement is an interesting constraint, which seems like it might be applicable in a lot of contexts. Perhaps different because the elements don't always have names (eg div or p).
1 reply 0 retweets 0 likes
Will Crichton Retweeted Will Crichton
Yes, and it's also tricky due to the calling convention differences.https://mobile.twitter.com/wcrichton/status/1465392517336211457 …
Will Crichton added,
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
cognitive psychology. PhD