开发者

What features are desirable for a programming language? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, argume开发者_Python百科nts, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

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.


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)


Multiple Inheritance would be nice...though it's not available in any current languages.


At present, I'm yearning for a language feature like JavaScript eval, with the additional power that it would execute the eval'ed instruction sequence:

execute_THIS( a += b; c = myfunc(a); if c < 0 exit(); );

That is, the language run-time could interpret and execute statements written in the language.

-- p


The most powerful one:

  • Dynamic Types
  • Language that don't hide anything
  • Functions as first class citizens. (which allow to use functional programming)
  • Runtime introspection
  • Language allow to overdrive default functions and object.
  • Meta programming
  • Dynamic Code generation
  • Extending Language in this language (only lisp have this)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜