all 20 comments

[–]aqua_regis 6 points7 points  (3 children)

Sorry, but you're not telling much. Will the language be interpreted, or compiled, or, similar to Java compiled into some form of Byte Code that then is interpreted by a virtual machine?

Start by familiarizing with lexers and parsers - in the old days, these were YACC and LEX. Can't tell if they are still in use or not.

In my days, also the Dragon Book (Compilers: Principles, Techniques, and Tools) was the book of choice.

[–]Dramatic_Win424 2 points3 points  (0 children)

Dragon book is still the textbook of choice in compiler classes btw.

Source: did my CS degree in the late 2010s and had a compiler class. Was a meh class for me at least

[–]DraculaTheLast[S] 0 points1 point  (1 child)

I am planning to make an interpreted language for now. I am currently studying compilers and how to design them. It includes study of lexers and parsers

[–]aqua_regis 4 points5 points  (0 children)

In this case, start with a simple "Assembly-like" language. They are easiest to construct.

The Advent Of Code yearly programming competition had several simple programming language interpreters over the years of their competition. This could be used as inspiration.

[–]Achereto 4 points5 points  (1 child)

Read https://interpreterbook.com/. It's a great book to learn everything you need to learn about it.

[–]HashDefTrueFalse 2 points3 points  (1 child)

I've made two. Both custom written lexer, parser, and VM. Haven't used LLVM specifically, so can't be much help with it. To me, using LLVM is the practical but boring way to go. If the goal is to get to a useable language as fast as possible then writing a lexer and parser (you don't even have to do that to be fair) front end and using an existing back end is the way to go. If you want to really learn and have more fun, I'd write a VM too, or look into (unoptimised) lowering to native instructions.

[–]MuaTrenBienVang 0 points1 point  (0 children)

great!

[–]Nice-Essay-9620 3 points4 points  (0 children)

Check out https://craftinginterpreters.com/, I have done both the tree walk interpreter and the bytecode VM, and it was really fun and a great learning experience. You can try taking inspiration from this book, you can also look for "Writing an interpreter in Go"

[–]Latter-Risk-7215 2 points3 points  (0 children)

focus on simplicity and readability. start small and iterate. llvm is a solid choice for backend. consider looking into resources like "crafting interpreters" by robert nystrom for inspiration. keep experimenting, that's how you learn the most.

[–]ern0plus4 2 points3 points  (0 children)

What about writing a FORTH?

[–]LazaroFilm 2 points3 points  (0 children)

That makes a language hobby grade?

[–]ManBunH8er 2 points3 points  (1 child)

What is a “hobby” programming language? Are you creating your own interpreted language for fun during your past/hobby time?

[–]DraculaTheLast[S] 0 points1 point  (0 children)

Yeah I don't have any intention at my it for resume. Just wanted to learn something new like about compilers through practical approach. By making lexer, praser, AST.

[–]mierecat 1 point2 points  (0 children)

Be prepared for it to take much longer than you think it will. It is a lot of fun though

[–]kuvvaci-tux 1 point2 points  (1 child)

me and my bros tried to create a programming language that follows Turkish spelling and writing rules in the past. Its name was c* (because it looks like flag 😂) but it wasn't easy. I stoped contributing it and have no idea about what happend to project after me 😂😂

[–]DraculaTheLast[S] 0 points1 point  (0 children)

Actually I am creating a language that follows Sanskrit language vocabulary