-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I didn't have a chance to look at my mail all week (work and technical problems with my mail service), and just waded throught that long thread. I would like to share a rather insane idea I had some time ago concerning MediaWiki rewrite/different languages.
Setting database/filesystem/etc. storage issues aside, we basically want * a nice fast parser, maybe in C++ * a MediaWiki that runs on most platforms, which likely would mean PHP * keep the work we put in the current version
These points are somehow excluding each other :-)
But, we could have *some* of it if we had a way to automatically convert PHP to, say, C++. As far as I know, there is no such thing, and even if it were, it would either break on PHP things like "$a=$$b", or become slow again.
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?
Magnus
Le 14 mai 05 à 11:58, Magnus Manske a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I didn't have a chance to look at my mail all week (work and technical problems with my mail service), and just waded throught that long thread. I would like to share a rather insane idea I had some time ago concerning MediaWiki rewrite/different languages.
Setting database/filesystem/etc. storage issues aside, we basically want
- a nice fast parser, maybe in C++
- a MediaWiki that runs on most platforms, which likely would mean PHP
- keep the work we put in the current version
These points are somehow excluding each other :-)
But, we could have *some* of it if we had a way to automatically convert PHP to, say, C++. As far as I know, there is no such thing, and even if it were, it would either break on PHP things like "$a=$$b", or become slow again.
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 :-(
Such a thing exists. MetaL is an open-source project and lives at http://www.meta-language.net. You code in XML, and the compiler (written in PHP, surprisingly enough) can output Java, PHP and Perl (support for more languages is planned, as far as I know). There're some samples at http://www.meta-language.net/sample.html.
To be honest, though, using XML as a programming language seems like a bad joke.
I'm not sure about your third point ("keep the work we put in the current version"): would you intend to convert the existing PHP codebase into this über language as a starting point?
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 MediaWiki have (or should it have) any obligation to support small sites, like internal wikis? To the extend that it would dictate, or at least impact, our choice of language?
Patrick
Does anyone have information about such a really-high-level language?
Magnus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFChdm4CZKBJbEFcz0RAmFvAJ9+GRtuQ/tXmQQ8ETUe0ZIuBMak0ACfSu+Q p54nQmwbugI1iqKiYPgpx8I= =Iefi -----END PGP SIGNATURE----- _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
On Sat, May 14, 2005 at 03:10:50PM +0300, Yaroslav Fedevych wrote:
Hmmm, think Lisp macros...
Actually, if I had to pick a language to use as an ur-language (I always thought the term was "ur", not "er"), I'd probably go with either Perl or some Lisp variant. I'm not the world's greatest programmer (yet), though, so I might think this for all the wrong reasons.
I sure as heck wouldn't do it in XML, though.
It seems to me that a problem with using some meta-language like this for writing code that can be exported/translated to many languages would be that you could only effectively produce a limited subset of each of those other languages. The characteristics of various languages are different enough from one another that you'd never have enough time to write any kind of translation routines to produce the full range of possible code in other languages. If, by some miracle, you actually DID manage to do such a thing, the resulting meta-language would be better used as a primary language itself: write stuff in that language, then compile or interpret it as needed, and skip the intermediate step of translating into some other programming language.
. . . and we arrive back at the question of how to create the "perfect" programming language, which most reasonable people seem to have discarded as a useless debate. Feel free to prove me wrong, though. If you can create such an all-powerful meta-language that will allow writing code in C, Perl, PHP, Python, and Smalltalk, all without knowing any of those languages, I really think you should. I'd love to see such a thing, and would happily learn it, especially if it means people will stop trying to convince me to learn Python.
Of course, for our purposes, a meta-language might not need to do that much. I guess the trick would be in figuring out what we actually DO need it to do.
-- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]
Le 14 mai 05 à 14:47, Chad Perrin a écrit :
On Sat, May 14, 2005 at 03:10:50PM +0300, Yaroslav Fedevych wrote:
Hmmm, think Lisp macros...
Actually, if I had to pick a language to use as an ur-language (I always thought the term was "ur", not "er"), I'd probably go with either Perl or some Lisp variant.
There's quite a bit of interesting web-development work happening in the Smalltalk[1] and Lisp[2] camps at the moment.
[1] http://www.cincomsmalltalk.com/userblogs/mls/blogView? showComments=true&entry=3261069762 [2] http://www.paulgraham.com/avg.html, http://common-lisp.net/ project/ucw/
On Sat, May 14, 2005 at 03:55:36PM +0100, Patrick Collison wrote:
There's quite a bit of interesting web-development work happening in the Smalltalk[1] and Lisp[2] camps at the moment.
Maybe Smalltalk will become something use(d|ful) as more than a toy, finally.
-- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]
On Sat, May 14, 2005 at 06:18:15PM -0400, Chad Perrin wrote:
On Sat, May 14, 2005 at 03:55:36PM +0100, Patrick Collison wrote:
There's quite a bit of interesting web-development work happening in the Smalltalk[1] and Lisp[2] camps at the moment.
Maybe Smalltalk will become something use(d|ful) as more than a toy, finally.
Smalltalk is used in web development, except that it's called Ruby ;-) and it's put on rails. Check http://del.icio.us/tag/rails
On Sun, May 15, 2005 at 02:20:38PM +0200, Tomasz Wegrzanowski wrote:
On Sat, May 14, 2005 at 06:18:15PM -0400, Chad Perrin wrote:
On Sat, May 14, 2005 at 03:55:36PM +0100, Patrick Collison wrote:
There's quite a bit of interesting web-development work happening in the Smalltalk[1] and Lisp[2] camps at the moment.
Maybe Smalltalk will become something use(d|ful) as more than a toy, finally.
Smalltalk is used in web development, except that it's called Ruby ;-) and it's put on rails. Check http://del.icio.us/tag/rails
If I was going to equate Smalltalk derivatives with Smalltalk itself, I might have mentioned that Smalltalk is used in application development, except that it's called Objective-C. Unfortunately, derivatives and their antecedents are not equal.
-- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]
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/
On Sat, 14 May 2005, Magnus Manske wrote:
- a nice fast parser, maybe in C++
- a MediaWiki that runs on most platforms, which likely would mean PHP
- keep the work we put in the current version
One option would be to implement the functionality you want done in C (C++ not an option to my knowledge) as a PHP extension, which basically makes the functions written in C directly available to your PHP code. For more info, check out: http://www.zend.com/php/internals/extension-writing1.php
--jeremy
wikitech-l@lists.wikimedia.org