When is it reasonable to create the own programming language

dslprogramming-languages

Are there types of killer applications, classes of algorithmic problems, etc., where it is better, in the long run, to create my own language?

PS: Just to be sure, I mean a new programming language and a compiler, not a new compiler for an existing language.

EDIT: Thank you for the answers. Can you provide some examples, where it is absolutly unnecessary to create a DSL or cases in which a DSL might be a good idea?

Best Answer

It certainly is relevant for a person to write their own language for educational purposes. To learn about programming language design and about compiler design. But real-world uses are few and far between.

In writing your own language you are:

  • Adding a tremendous amount of complexity to your problem
  • Adding a significant amount of work in writing and maintaining the new language and compiler

So, if you plan to write your own language for your project then the features that it provides that other languages don't have need to offset the above costs.

Take games development for example. They often need mini-languages within their games or scripting languages. They use these languages to script out a huge amount of the in-game events that happen. However, even in this case, they almost always choose existing scripting languages and tailor them to their needs.

Related Topic