So did I, until I realised that this was actually a really REALLY bad idea. (It’s not the same language if any two programs can have completely different syntax and behaviour, it’s a family of languages - and none of them will be particularly good.) Though I don’t regret having done it. It was a good exercise, planning out a language like that, and in the process, learning what’s actually important. There was never an interpreter or even parser for it, just a specification, and that was enough for me to permanently shelve it ![]()
Yeah, that IS an option. IMO it sucks though. Precedence is a huge benefit. In my one, every user-defined operator had a precedence/associativity number, higher numbers have higher precedence, and odd/even determining left/right associative. And it still sucked ![]()
Designing a DSL from scratch is actually a lot of fun. It’s really fascinating which parts are easy and which parts are hard. I designed a DSL for my Twitch channel bot in 50 lines of LR(1) grammar… and then to make the “else” clause optional on an “if” statement took another 47 lines of grammar. xkcd: Tasks