Pharen: A lisp that compiles to PHP
11–20 of 43 posts
Re: Pharen: A lisp that compiles to PHP
#12Hey Scriptor, neat project! What are the major differences between Pharen and Lisphp? (covered here:) http://news.ycombinator.com/item?id=1488160
Pharen generates regular PHP source files that you can then throw wherever PHP works.
Re: Pharen: A lisp that compiles to PHP
#13Hey Scriptor, neat project! What are the major differences between Pharen and Lisphp? (covered here:) http://news.ycombinator.com/item?id=1488160
The big one is that Lisphp is an interpreter while Pharen is a compiler. Lisphp takes source code and just runs it, which means that it's lisp code running on Lisphp, which in turn is running on the PHP interpreter. Pharen generates regular PHP source files that you can then throw wherever PHP works.
Re: Pharen: A lisp that compiles to PHP
#14Hi everyone, I'm the creator of Pharen. Feel free to ask me questions or remind me why this is a terrible idea. :) Yes there are a lot of issues with cross-language compilers. That said, Coffeescript: http://coffeescript.org , which compiles its own language to Javascript has had a lot of success and is being used in production. So it's at least possible to use languages like this. The extra layer of abstraction is a…
Re: Pharen: A lisp that compiles to PHP
#15This actually doesn't suck. I was expecting something much much worse, but I was pleasantly surprised. If the author just focuses on a few primitives and how to make them as efficient as possible (i.e. closure efficiency, tail-calls, macros, efficient list representation, etc), if he just gets those right, others can always use it as a target and develop more comfortable lisp substrates on top of it. Cheers!
Efficient sequences are what I'm working on right now, particularly trying to make persistent versions of the major data structures in PHP.
Tail calls are another thing, though with PHP 5.3's gotos they could be done (who'd have thought that feature would ever be useful?) Could you elaborate on how I could improve efficiency for macros?
Re: Pharen: A lisp that compiles to PHP
#16Earlier quoted context omitted.
The big one is that Lisphp is an interpreter while Pharen is a compiler. Lisphp takes source code and just runs it, which means that it's lisp code running on Lisphp, which in turn is running on the PHP interpreter. Pharen generates regular PHP source files that you can then throw wherever PHP works.
How do they compare performance wise? I've tried some 'toy' lisp programs in Lisphp and was pretty disappointed at the speed, does Pharen fare better in this respect?
Re: Pharen: A lisp that compiles to PHP
#17Hi everyone, I'm the creator of Pharen. Feel free to ask me questions or remind me why this is a terrible idea. :) Yes there are a lot of issues with cross-language compilers. That said, Coffeescript: http://coffeescript.org , which compiles its own language to Javascript has had a lot of success and is being used in production. So it's at least possible to use languages like this. The extra layer of abstraction is a…
Does this only work on the newest version of PHP? Compilation of closures, I presume, requires that PHP support closures, right?
Re: Pharen: A lisp that compiles to PHP
#18Earlier quoted context omitted.
Does this only work on the newest version of PHP? Compilation of closures, I presume, requires that PHP support closures, right?
Nope, it should work for PHP 5.2 as well. Closures are implemented using a static member on a class that handles all the lexically scoped variables, not PHP 5.3's native closures.
Re: Pharen: A lisp that compiles to PHP
#19This actually doesn't suck. I was expecting something much much worse, but I was pleasantly surprised. If the author just focuses on a few primitives and how to make them as efficient as possible (i.e. closure efficiency, tail-calls, macros, efficient list representation, etc), if he just gets those right, others can always use it as a target and develop more comfortable lisp substrates on top of it. Cheers!
Thanks Mahmud :) Efficient sequences are what I'm working on right now, particularly trying to make persistent versions of the major data structures in PHP. Tail calls are another thing, though with PHP 5.3's gotos they could be done (who'd have thought that feature would ever be useful?) Could you elaborate on how I could improve efficiency for macros?