|
|
|
|
|
by millstone
4439 days ago
|
|
When I look at that sample, what strikes me is how much the "custom syntax" still looks like a bunch of S-expressions. How much flexibility does LISP really give you here? For example, say I wanted my DSL to use Python-style significant whitespace instead of brackets. Does LISP make that easy, or is my DSL restricted to using stuff that looks like S-expressions? |
|
Consider this example of the experimental "2d" syntax:
Yes, that big ascii-art graph is actually part of the code, not some sort of comment. The 2d syntax allows you to create ascii art truth tables which contain in them code (in this case, in the traditional paren'd style.)(See http://docs.racket-lang.org/unstable/2d.html for a better explanation and more examples.)
Alternatively, here is an example of typed racket using sweet expressions:
(https://github.com/takikawa/sweet-racket)*