3 ms·
Last year I tried to build a language and I wholeheartedly agree - it's amazing how much it teaches you. My particular language was merely meant to be transpile
by danielvaughn 2y ago
Last year I tried to build a language and I wholeheartedly agree - it's amazing how much it teaches you. My particular language was merely meant to be transpiled to other languages, so I didn't get into the runtime or compilation stuff. But I quickly learned why braces and ignoring whitespace is so important. I also had to think extremely hard and carefully about the exact syntax and what each token meant. It's a very rewarding intellectual activity.
One thing I'd like to add is that even though you can totally write your own parser, it's an absolute joy to use Tree-sitter:
https://tree-sitter.github.io/tree-sitter https://tree-sitter.github.io/tree-sitter
I plug it every time I get a chance. It makes refactoring your grammar incredibly easy, and lets you just focus on your syntax.