Search code examples
compiler-constructionprogramming-languageslanguage-designlanguage-featurescompilation

What features are desirable for a programming language?


Recently my university has set large projects for its undergraduates. One of these projects is to create a new programming language with all of the most desirable parts of other languages. Now, I know that many things would be pretty infeasible for me to implement efficiently (or even closely) - making the language very close to natural language for example.

There are some neat features that would be nice, like high order functions and an operator for swapping the value of two variables. However I am struggling to think of very many, so some suggestions would be very much appreciated - the best one gets marked as the answer. I am only looking for ideas here though, not methods for how to implement them.


Solution

  • Features I like:

    • associative arrays so I can do things like price["apple"] := 0.99
    • for-each loops so I don't have to worry about indexing non-existant elements of a collection
    • the := operator for assignment, instead of = ;)
    • switch-case statements that allow for things other than numeric values, eg: case "apple": price := 0.99.
    • ranges of numbers/dates as a valid datatype.
    • functions having named parameters and default values
    • native support for regex operations (like Perl)