Re: Prothon in Prothon (blue sky :-)
"Mark Hahn" <[email protected]> Tue, 4 May 2004 09:30:52 -0700
| Newsgroups | gmane.comp.lang.prothon.devel |
|---|---|
| Message-ID | <[email protected]> |
Joe Knapka wrote: > You know what would *really* rock? A practical Prothon compiler in > Prothon. Being self-hosting seems to be a fundamental characteristic > of "system" languages vs "scripting" languages (along with low-level > bit-twiddling facilities). If Prothon could compile to a sufficiently > efficient form that a fast Prothon compiler could be hosted on the > Prothon runtime, we would have a nice high-level system/scripting > language. Java is the only other example of such a thing I can think > of -- and who the heck wants to use Java? (I'm not even certain that > Java compilers are generally implemented in Java, but I assume at > least some are.) Compilers for interpreted languages are a bit fake. The nature of an interpreted language requires that some core engine be present for garbage collection, and other housekeeping, plus overloaded method calling and other operarations are such expensive operations (especially in prototype languages) that it is almost always prudent to factor it and other code out into common code. You can call that common code an interperter or something else. An application can be self-hosting by just having a small footprint interpreter. Prothon so far is 240 KB in win32 and that is with all of Python's methods. This is a big feature that comes from simplicity. The real goal of a compiler should be speed. Recently though, interpreters have been faster than C code. I can't remember the name of it, but there is a project in Python that processes your python app and runs it faster than an equivalent C code, all in the python interpreter. People are saying it works so well that they will quit using C modules for speed. If possible I'd like to build this same speed-up trick into the Prothon interpreter for every program it runs. I'm not going to be working on speed until late summer though.