5 ms·
I tried Graal/Truffle last year, to make a toy language of my own. Unfortunately the state of documentation and tutorials was simply not good enough and I had t
by rishav_sharan 4y ago
I tried Graal/Truffle last year, to make a toy language of my own. Unfortunately the state of documentation and tutorials was simply not good enough and I had to give up on it. I think for someone who is a Java/Graal enthusiast, Truffle documentation may be enough, but for someone like me who knows just the basics of Java and its ecosystem, the Truffle language implementation docs seemed woefully inadequate.
Its a shame though, for what I did understand of Truffle seemed very interesting. I do plan on trying truffle yet again in a few years, when hopefully the community size and the state of the documentation have improved.
- fniephaus 4y agoDo you have any feedback on how we could improve the docs? If so, please let us know. I believe the easiest way to start a new Truffle language implementation is to fork SimpleLanguage [1] and turn it into your language. Did you try to do that? [1] https://github.com/graalvm/simplelanguage https://github.com/graalvm/simplelanguage
- rishav_sharan 4y agoYes please. My major blockers were - 1. Starting post ast generation was an abrupt start. An end to end tutorial - from parsing to working compiler for a tiny language like Lua, Lox, Wren etc would be very helpful. You need not deep dive into the parsing part - just give enough that we can follow along. Another option can be to continue an existing tutorial series like Lox from "crafting interpreters". That way you don't have to focus on parts which are not Truffle specific, yet users can follow along. 2. Just going through existing Java code of the Simple Language was extremely difficult for a newbie to Java, like me. I would much prefer a readable tutorial which explains all concepts in more details 3. More language examples please. As I said before, if possible do add a couple more languages like Lua. I believe Lua is already a Truffle language. Just an accompanying tutorial is missing. I remember when I tried to read through the codes of Ruby, Lua and simple language, they all started off very differently and I just got lost.
- deleted 4y ago[deleted]
- rishav_sharan 4y agoAdding 2 more points - 4. More tutorials. Outside of the main docs, I found only 1 comprehensive tutorial. I think it will be great if the key members make it a priority to add smalllish tutorials on things like forth, brainfuck etc in other blogs and articles. 5. Tutorials in Kotlin! I am new to the jvm, but I am digging Kotlin as a saner alternative. I think having some tuts in Kotlin would be a great help.
- mike_hearn 4y agoI think the issue here is that the Truffle docs: a. Point people to the papers to understand how the 'magic' happens. b. Are really intended for people who already know how to build language VMs from scratch. If you've never implemented a language interpreter at all, then you're going to struggle. Arguably not Truffle's fault, but hey, you can't drop the cost of making SOTA language runtimes by a couple orders of magnitude and then be surprised when a whole lot of newbies show up wanting to try their hand at it :)
- grashalm 4y agoI am sorry to hear you did not succeed in building your own language. I have to admit it is quite a steep learning curve. If you decide to retry do not hesitate to hit us up with questions on the community slack. We are a helpful bunch. Also I will drop my truffle seminar shamelessly here for you to watch: https://youtu.be/pksRrON5XfU https://youtu.be/pksRrON5XfU
- gosukiwi 4y agoI was in a similar place. I tried implementing a toy language with it but it felt like I had to be very comfortable in Java-land to be able to use it, I just didn't have the desire to put that much effort :P But I'm sure it's a great technology and with time the docs will get better and better.
- chrisseaton 4y agoDid you join the Slack group? People there will give you all the time and help you need.
- rishav_sharan 4y agoI did and to be fair the people there were very helpful. It's just that I needed more hand holding than the average person (as I was new to Java as well)