4 ms·
I’m on the verge of trying Racket to write my own DSLs. I wonder if Janet is better for this task?
by behnamoh 4y ago
I’m on the verge of trying Racket to write my own DSLs. I wonder if Janet is better for this task?
- soulbadguy 4y agohttps://www.jetbrains.com/mps/ https://www.jetbrains.com/mps/
- ianthehenry 4y agoDepending on what you're doing, Janet might be a great fit! I wrote a DSL for [expressing and shading 3D shapes](https://bauble.studio https://bauble.studio), and it was pretty easy. Depending on exactly what you're trying to do, the ease of embedding the Janet interpreter inside of other programs might be a big point in its favor.
- behnamoh 4y agoEnjoyed reading the post! I think the difference between Racket and Janet DSLs is that with Racket, you can avoid using s-exp altogether. https://beautifulracket.com/stacker/intro.html https://beautifulracket.com/stacker/intro.html
- ianthehenry 4y agoThis is actually true of Janet as well, although it is not as nicely supported as it is in Racket. You can "bring your own parser," but still leverage the Janet bytecode compiler and runtime. Sort of... an advanced topic, though. The Racket path is much better trodden :)
- behnamoh 4y agoWow good to know! I wish there was an easy way to do it in Janet. It’s a much simpler language compared to Racket. And since it started as someone’s hobby project, I think unlike Racket, it isn’t under much pressure from academia. Academic languages tend to be less suitable for production (Haskell, Racket, Julia, etc.)
- elcritch 4y agoNim's great for writing DSLs as well, plus you can make it statically typed. It ends up being a sort of "yaml-expressions" rather than "s-expressions ". Creating DSLs is quite satisfying in general.