On Sat, May 14, 2005 at 12:58:00PM +0200, Magnus Manske wrote:
But, what about some "Über-language"? A rather abstract code that can be automatically converted to C++, PHP, Python, Java and-what-not.
That would
- solve the speed problem
- give a PHP version to the poor souls who need it
- give everyone else nice C++ and Java classes, Python modules, etc.
- keep them all in sync with each new version
The slight problem is, I'm not sure such a language exists :-(
Also, it it would exists, I am aware that it would not generate the most efficient code around. But, the generated code doesn't need to be human-readable, and I believe a PHP version would do for small sites (internal wikis, for example), while the larger sites surely can find a way to get the C++ version running.
Does anyone have information about such a really-high-level language?
Converting something Pascal-ish (lobotomized common subset of all high level languages) to all other languages is almost trivial, but you wouldn't want to program in it.
I haven't used it for anything non-toyish, so it's possible that I'm leading you astray, but check OpenC++ - it's a toolkit for writing parsers for C++-like languages. This way we can: * With OpenC++ add language-level support for things like regular expressions, hashtables etc. to something that's mostly C++ * Use only easily convertible subset of C++ (no templates abuse or non-trivial memory management) and these magic constructs we just defined. This won't be an ideal language, but it should be reasonable. * Write OpenC++ converters from parse tree to a few common languages. Because what you get is mostly Pascal-level stuff + things you defined, that shouldn't be too difficult.
OpenC++ seems reasonably powerful, things like closures and for-X-in-Y loops are in standard documentations.
Package: openc++ Description: extensible C++ compiler OpenC++ is a tool for source-code translation for C++. Programmers can easily implement various kinds of translation so that they can define new syntax, new annotation, and new object behavior. . http://opencxx.sf.net/