3 ms·
In substance: easily make a DSL targeted specifically at your problem. This proposition is often criticized by software engineers for resulting in code that is
by rscho 6y ago
In substance: easily make a DSL targeted specifically at your problem.
This proposition is often criticized by software engineers for resulting in code that is potentially inscrutable to anyone but the writer. IMO, this misses the forest for the tree. Sure, one-off DSLs probably aren't suited to entreprise codebases you'd use Java for. But what the critics miss is that this truly enables domain experts. In that way, it's a bit like the MS Excel value proposition cast into a (very well-designed) programming language. Which makes it ideal for solo devs, scientists, small teams, etc. (as most lisps). That's what makes Racket interesting to me, at least.
- iainctduncan 6y agoMy job is to doing due diligence on tech companies during major investments and acquisitions, and one of the most successful (and interesting) I've seen was doing exactly what you describe. It wasn't Racket, but the code base was an engine with a very sophisticated DSL enabling all their in-house domain experts to work hyper-productively. Their work was split into an engine, which their low level super-senior hackers worked on, and the assets, which were the things customers bought and were made in a DSL by highly educated domain experts. It was really impressive, and they are doing very well. I've long been convinced that this is the logical highest level of "onion/hexagonal/ports and adapters" architecture, and seeing what they had done was really cool.
- The_rationalist 6y agoGeneral purposes programming languages that enable to easily and expressivelly build readable DSLs are useful. But what does Racket bring over say Kotlin DSLs? https://kotlinlang.org/docs/type-safe-builders.html https://kotlinlang.org/docs/type-safe-builders.html For building DSLs the following features are useful: Infix/postfix functions, Operator overloading, Varargs/spread operator, Scope controling what is allowed. Other features??
- rscho 6y agoI'm not a Kotlin expert, but I expect that it enables easily interpreted DSLs. Racket enables easy compiled DSLs through its macro system. So, no interpretative overhead. Also you can really, really change both syntax and semantics: https://docs.racket-lang.org/2d/ https://docs.racket-lang.org/2d/ Although not similar technically speaking, Graal/Truffle is a better comparison in spirit, IMO. But Graal/Truffle is hugely complex, with many many man-hours in it. Classic example and discussion: https://www.reddit.com/r/programming/comments/i1slm/comment/c20a8ov https://www.reddit.com/r/programming/comments/i1slm/comment/... https://www.hashcollision.org/brainfudge/index.html https://www.hashcollision.org/brainfudge/index.html
- The_rationalist 6y agoI think the DSL logic is at compile time, the Kotlin annotation generate source code at compile time just like a macro and enable compile time type safety. Also the performance is expected to be order of magnitude better given the JVM. Also you can really, really change both syntax and semantics: https://docs.racket-lang.org/2d/ https://docs.racket-lang.org/2d/ Exactly, racket give you much more freedom because of this, I don't know the use cases but it's indeed more powerful. A comparison with Truffle would be great! I wonder if a higher level/simpler but less powerful abstraction on top of Truffle could bridge the difficulty gap.