4 ms·
I'd like to see a better programming language. All of the existing languages involve accepting certain trade-offs. Of course maybe no "perfect" language can e
by tgflynn 16y ago
I'd like to see a better programming language. All of the existing languages involve accepting certain trade-offs. Of course maybe no "perfect" language can exist but until someone proves that there's always hope.
For me the ideal language would :
- Support OO, imperative and functional paradigms
- Compile to fully optimized machine code with efficiency comparable to that of C
- Provide language support for numerical multidimensional arrays and linear algebra with a syntax comparable to Matlab
- Support list comprehensions
- Provide map,list and set types similar to those of Python
- Support dynamic typing
- Support optional static typing, and contracts
- Provide standard libraries with breadth of functionality comparable to those of Java but simpler API's (more like Python)
- Provide a mechanism for efficient compile-time parametrization of algorithms, like C++ templates
- Support free-form (ie. whitespace independent) syntax
- Provide a high quality cross-platform GUI toolkit with support for OpenGL
- Provide an interactive graphical environment for experimentation and data analysis
- Provide a dataset abstraction similar to R data frames
- Be supported by a high-quality IDE and debugger
Of course that's a lot to ask for, but it would be nice to be able to do everything with a single unified syntax and environment.
- jamii 16y agoOcaml hits most of the points on your list, if you can bring yourself to use a statically typed language. > Support OO, imperative and functional paradigms Yep. Objects aren't used all that often but they are fully supported and can do some things that are difficult in Java or C++ eg http://caml.inria.fr/pub/docs/manual-ocaml/manual007.html#toc39 http://caml.inria.fr/pub/docs/manual-ocaml/manual007.html#to... > Compile to fully optimized machine code with efficiency comparable to that of C Not quite, but ocamlopt generates pretty damn fast code and, more importantly, has very predictable performance. Ocaml makes a pretty good systems language as demonstrated by the recent Mirage paper: http://anil.recoil.org/papers/2010-hotcloud-lamp.pdf http://anil.recoil.org/papers/2010-hotcloud-lamp.pdf > Provide language support for numerical multidimensional arrays and linear algebra with a syntax comparable to Matlab No, but this would make a good Jane Street summer project. Ocaml has extensible syntax via camlp4 and bindings to R, GSL and Matlab (no octave bindings for some reason). > Support list comprehensions Yes, as a syntax extension. http://batteries.forge.ocamlcore.org/doc.preview:batteries-beta1/html/extensions.html#Comprehension http://batteries.forge.ocamlcore.org/doc.preview:batteries-b... > Provide map,list and set types similar to those of Python The syntax is not as nice but apart from that: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Map.Make.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/Map.Make.h... http://caml.inria.fr/pub/docs/manual-ocaml/libref/Hashtbl.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/Hashtbl.ht... http://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.S.html http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.S.html > Support dynamic typing Nope. You can circumvent the type system using Obj but its generally not advisable. > Support optional static typing, and contracts Static typing - yes. Contracts - see eg http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.157.5372&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.157... http://perso.eleves.bretagne.ens-cachan.fr/~dagand/opis/opis_presentation.pdf http://perso.eleves.bretagne.ens-cachan.fr/~dagand/opis/opis... > Provide standard libraries with breadth of functionality comparable to those of Java but simpler API's (more like Python) No. Ocaml Batteries is a start but nowhere near as broad as Python or Java. > Provide a mechanism for efficient compile-time parametrization of algorithms, like C++ templates Not just compile time specialization but multi-stage compilation via MetaOcaml. See eg http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.2541&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.... > Support free-form (ie. whitespace independent) syntax Yep, although there are some issues with the syntax eg dangling-else-like problems with nested matches. > Provide a high quality cross-platform GUI toolkit with support for OpenGL Well tested bingdings to Tk, Gtk and OpenGL. > Provide an interactive graphical environment for experimentation and data analysis None that I know of. I tend to use matplotlib and opengl interactively from the repl but its not up to the standards of mathematica etc. > Provide a dataset abstraction similar to R data frames I dont think so. I haven't used R much so I don't know exactly what features are missing. > Be supported by a high-quality IDE and debugger There are a couple of IDEs but none of them seem to be very well polished. Ocaml-mode and emacs is generally the way to go. The time-travelling ocaml debugger is pretty amazing. You can also compile with support for gdb for low level debugging.