So, I asked this question in the comments section of somebody else's post. Then I realized, if I turn my question into a post it may reach a lar...
For further actions, you may consider blocking this person and/or reporting abuse
This isn't necessarily your own language but it might be good to get you started: buildyourownlisp.com/
It'll certainly be a good introduction to all the required parts and doubtless you could adapt and extend it once you've got a handle on it. Plus, Lisps are super cool.
WOW! That looks borderline perfect actually! Thankyou
Good. You are on the right path mate. I have my own toy language too: github.com/david-szabo97/DevLang
You might take a look at it how it works.
You can find comments,tests and examples in the Main.java
You get started by doing some Google searches. Keywords: interpeter, compiler, parser, lexer, opcode, virtual machine.
I used to read a blog series to put together my own language.
Maybe this one: aosabook.org/en/500L/a-python-inte...
But I am not sure anymore. It was 2 year ago :)
Good luck!
I also have some special feature in my toy lanuage: (I have no idea how I did it, my lang contains some secrets.)
for (i = 0; i < 5; for (j = 0; j < 5; j = j+1) {print('j')} i=i+1) {print('i')}
Yes, that's a for in a for.
Thanks! The link to the python interpreter is great actually! Also appreciate the keywords list
Maybe I should write up my experiences with various languages, the ones that built to Leaf. Get some final value out of that project of mine.
Seems legit. I for one would appreciate it. And I'm sure a ton of other up and coming devs would too.
I just started down this road myself! There's some great links and advice here already, I'll definitely be following along for more!
I've started my journey in writing compilers by first understanding how to write a good parser. I'm writing it all in Kotlin as a combinatorial Recursive Descent Parser (inspired by Haskell's Parsec, and some work I did in college), and have the parser and base functionality of evaluating an AST complete. My next step is parsing complex expressions, and then putting it all together into a toy language.
copper-leaf / kudzu
A monadic (I think...) recursive-descent parser written in Kotlin
Kudzu
Kudzu is a recursive-descent parser written in Kotlin, with the goal of immutability and simplicity. It is mostly an exercise for me to learn more about parsing algorithms, but should work reasonably-well enough to be used for small non-trivial parsers.
Why did I write it?
I've got several projects which require custom parsing, and after looking around at the various options available in Java and Kotlin, I've decided that I would just rather write my own. Most of the ones I found either require Java 8 (a deal-breaker if I want to use it on Android), or I found them to be very complex to use, being intended for writing full-blown, high-performance compilers. I needed something simple, and I also wanted to learn how parsers work, so I decided to make my own.
This library is a parser combinator like…
I collected some links here metak4ml.blogspot.com/2017/06/how-...
That is a really useful collection! Will take some time to read through but looks super helpful for what I need. I appreciate it!
I'm really impressed with how helpful everyone has been on this. I went from not knowing where to start to having almost too much good info to sort through just from 3 responses! Thank you everyone for you help!
It really should ping @mortoray right when the post is embedded. If only someone would have written that feature. 🤔