How to create your own programming language

Recently I read about Google’s new open source programming language called Go.

For more details check out Golang.org

With so many programming languages to choose from such as C / C++, Python, Java; Google developed Go with an intention for the language to be FAST, about a a few seconds to build a large executable on a single computer!

During my programming days, I can still remember that it took so long to compile our program that I could go make myself a cup of coffee, come back and it’s still processing.

Of course these days, most languages support incremental compilers which have improved compiling times tremendously especially with the help of faster and more efficient computer processors.

Here is a video made by Google Go’s team on the Go programming language:

From the responses that I’ve read, some think that we have way too many languages to deal with already while some hard core developers really enjoy the new programming styles, syntaxes and benefits a new language brings.

If you’re a hard core developer, have you ever thought of creating your very own programming language for your own usage as well as for others to benefit from?

Think about it! Once you’re done creating your own programming language, you could give it a really cool name like:

There are several reason why people would want create their own programming languages:

  • Fewer codes to read and write.
  • Improve and extend the capability of existing languages.
  • Impress your employer and peers with a resume that says: I created my own programming language!

Besides impressing others, the first point is particularly useful for developers who are in the business of developing their own applications.

With your own language, you can define how certain functions work to your liking. For example, which is better to look at?

This?

Or this simple 2 liner of your very own code which translates to the above?

The scripts above are the outcome of CoffeeScript as developed by Jeremy Ashkenas.

If you too would like to be able to create your very own programming language, then I would highly recommend that you read this ebook – How to create your own freaking awesome ebook by Marc-André Cournoyer.

The eBook will walk you through the steps on language building.

Some of the key subjects which are covered includes:

  • Lexer, with Python style indentation
  • Parser, using Racc
  • Runtime, bootstrapping and self hosting
  • Compilation using LLVM
  • and much more.

Once you’re on the CreateYourProgLang.com, you can also download the full table of contents and a sample chapter.

Hey, if you do read the book and end up creating your very own programming language, feel free to share with the rest of us here.

Till then, happy programming!

Thanks for reading! Read more articles by :)



Related software