From: "Martin Stjernholm, Roxen IS @ Pike developers forum"
To: pike-devel@lists.lysator.liu.se Subject: Can I get detailed documents about Pike languages design Date: Thu, 13 Nov 2003 05:30:01 +0100 (CET)
Nice to hear. Unfortunately there isn't much in the way of core docs, so you're pretty much left with investigating the source and the commentary in it. I have at least added a manifest for the files in the src directory now (in 7.5 - please check it out from the anonymous cvs) so that you'll get a little help in finding your way there.
Anyway, the compiler is fairly straightforward in principle (two pass, lexer, LALR parser, abstract syntax tree, tree optimizer, opcode generator, peephole optimizer) so provided you know standard compiler theory it's mostly a matter of learning where the stuff is and what it's called. The exceptions to that are mainly how the resolver works and what's done in the different passes, I suspect. You can always ask questions here; at least I will do my best to answer.
Do you have anything specific in mind that you want to do?
/ Martin Stjernholm, Roxen IS
Thank you very much. I have not special idea about Pike design yet, because I am not familiar with the design principle of Pike, which is my current task to be done. In the furture, I hope to do some optimization on Pike. I did some interprocedural analysis and optimization for academic research. But I think this method is not adapt to Pike, which is complex, results in lower compiling effeciency, and mainly applied to compiled languages. Maybe from other open interpreted languages, we can get some inspiration to do it.
David
_________________________________________________________________ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
Thank you very much. I have not special idea about Pike design yet, because I am not familiar with the design principle of Pike, which is my current task to be done.
If you happen to write a bit of doc about it along the way it'd be very appreciated. ;)
In the furture, I hope to do some optimization on Pike. I did some interprocedural analysis and optimization for academic research. But I think this method is not adapt to Pike, which is complex, results in lower compiling effeciency, and mainly applied to compiled languages.
It could be useful together with dumped programs. In that case it's not a problem that it takes a lot of time. But there are more basic things to be done, like live range analysis and subexpression elimination locally inside methods.
There's some work in that direction with the SHARED_NODES stuff; the idea is that common subexpressions in the node tree actually are shared so that they can be found simply by comparing the node pointers. That's currently defeated, however, since it messes up the line number info which can never be shared.
You should also know that Henrik Grubbström is working on a new compiler, so eventually the current one will be thrown out. If I'm not mistaken, his work is mainly in the earlier parts, in the steps from parsing to construction of the syntax tree (it will support metaprograms etc). So if you contribute in the later parts it will not be thrown away (Grubba better correct me if I'm wrong).
/ Martin Stjernholm, Roxen IS
Previous text:
2003-11-14 04:58: Subject: Re: Can I get detailed documents about Pike languages design
From: "Martin Stjernholm, Roxen IS @ Pike developers forum"
To: pike-devel@lists.lysator.liu.se Subject: Can I get detailed documents about Pike languages design Date: Thu, 13 Nov 2003 05:30:01 +0100 (CET)
Nice to hear. Unfortunately there isn't much in the way of core docs, so you're pretty much left with investigating the source and the commentary in it. I have at least added a manifest for the files in the src directory now (in 7.5 - please check it out from the anonymous cvs) so that you'll get a little help in finding your way there.
Anyway, the compiler is fairly straightforward in principle (two pass, lexer, LALR parser, abstract syntax tree, tree optimizer, opcode generator, peephole optimizer) so provided you know standard compiler theory it's mostly a matter of learning where the stuff is and what it's called. The exceptions to that are mainly how the resolver works and what's done in the different passes, I suspect. You can always ask questions here; at least I will do my best to answer.
Do you have anything specific in mind that you want to do?
/ Martin Stjernholm, Roxen IS
Thank you very much. I have not special idea about Pike design yet, because I am not familiar with the design principle of Pike, which is my current task to be done. In the furture, I hope to do some optimization on Pike. I did some interprocedural analysis and optimization for academic research. But I think this method is not adapt to Pike, which is complex, results in lower compiling effeciency, and mainly applied to compiled languages. Maybe from other open interpreted languages, we can get some inspiration to do it.
David
ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger: http://messenger.msn.com/cn
/ Brevbäraren
pike-devel@lists.lysator.liu.se