Search code examples
programming-languages

Guidelines for creating a programming-language enjoyable to write programs in?


I'm currently working on the topic of programming-languages and interpreter-design. I have already created several programming languages but couldn't reach my goal so far:

Create a programming-language which focuses on giving the programmer a good feeling when writing code in it. It should just be fun and/or interesting and in no case annoying to write something in it.

I get this feeling when writing code in Python. I sometimes get the opposite with PHP and in rare cases when having to reinvent some wheel in C++.

So I've tried to figure out some syntactical features to make programming in my new language fun, but I just can't find any.

  • Which concrete features, maybe mainly in terms of syntax, do/could make programming in a language fun?

Examples:

I find it enjoyable to program in Ruby because of it's use of code blocks.

  • It would be nice if you could include exactly one example in your answer
  • Those features do not have to already exist in any language!

I'm doing this because I have experienced extreme rises in (my own) productivity when programming in languages I love (because of particular features).


Solution

  • You mentioned Ruby in your question. AFAIK, Ruby is the only programming language, for which Joy is an actual, stated, explicit design goal. (In fact, it is the only design goal.)

    The reason that Yukihiro Matsumoto was able to design Ruby this way, is that he already knew and used tons of programming languages before he started designing Ruby and learned tons more in order to design Ruby. (Interestingly, he didn't know Python, and has said that he probably wouldn't have created Ruby if he did.)

    Here's just a tiny fraction of the languages that matz has either used himself, or looked at for inspiration (or in some cases for inspiration what not to do):

    • CLU
    • Sather
    • Lisp
    • Scheme
    • Smalltalk
    • Perl
    • Python
    • Haskell
    • Scala
    • PHP
    • C
    • C++
    • Java
    • C#
    • Objective-C
    • Erlang

    And I believe that this is one way that good programming languages can be designed (what Larry Wall calls postmodernist language design): Throw away everything that didn't work in the past, take everything that worked and combine that tastefully.

    Of course, this requires that you actually know all those languages from which you want to "steal" and in particular, it requires that you know lots of very different languages with different paradigms, different concepts and different "feels", otherwise the idea pool from which you steal is rather small and inbred.