Disclaimer: I only know web frontend/backend and mobile development with several teams. So everything I say needs to be seen in this context.
In beginning of the 90s I was writing internet code in C directly using TCP/IP as an ‘abstraction’ layer. Bugs were plenty and development was a pain. Then Java arrived and made development much more pleasant. Java with exceptions created nicer to read exception stack traces than C did with core dumps and also prevented many common C bugs. Continue reading The Case for a New Programming Language
I’m late to the game, reviewing ‘How to Create Your Own Programming Language’ (HTCYOPL) but with my renewed interest in creating programming languages I thought I’d give it a go.
First it looks rather thin on content, with quite some pages but huge fonts and not a lot of content on each page. But don’t let yourself fooled, there is a lot of content and it is sufficient.
HTCYOPL is not only a book explaining the basics of creating a programming language. It does so by using an example language called ‘Awesome’ and another one called ‘Mio’. This makes the book much more interesting compared to standard compiler builder books. It also makes it easy to start your own language with ‘Awesome’ as a starting point. All of the book is accessible to the average reader.
The books starts with an overview of components of a compiler chain and then goes into Lexer (creates tokens from source code), Parser (creates an AST from the tokens), Runtime Model and Interpreter (executing the AST). My university days where I’ve learned about compilers are long over, so basically with no knowledge I’ve cruised through this parts and had several enlightening moments. Although the book could stop there, as you now have all you need for your language, it dives into more intersting topics like virtual machines and compiling your language with LLVM.
HTCYOPL helped me tremendously to understand the different parts of a programming language and how they interact to compile from source code to byte code. With HTCYOPL in my hands I’ve started to look into Kotlin internals and – I could read and understand parts with tokens, parsers and ASTs. So for me the book was a win and I’d recommend the book to everyone who wants to dabble into programming languages and like me has no clue. Write the next Ruby!
Some years ago I’ve written about never to use String in Java.
“Never, never, never use (unwrapped) String or long or int. Why? Those primitive types have no semantic meaning. They are hard to understand, hard to maintain, and hard to extend.”
Now it is time to revisit this post and see what I’ve learned since then.
Continue reading Never, never, never use String in Java – 7 years later