Live data from Hacker News

Pharen: A lisp that compiles to PHP

scriptor.github.com

41–43 of 43 posts

Re: Pharen: A lisp that compiles to PHP

#41
post #2

Hi 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…

This is really cool and for the most part the syntax seems to make sense. One thing I don't understand is why there is special unnatural-looking syntax for dictionaries. It is inconsistent that comma=whitespace everywhere else. Perhaps something like: (array "a"=>1 "b"=>2) Note that this currently compiles to array("a", =>1, "b", =>2)

The current dictionary syntax is actually typical for lisps, particularly this is exactly what Clojure does. It's just a series of elements except in this case it's designed to look at every two elements as a pair.

What do you mean by it's inconsistent? Commas are the same both in dictionaries and anywhere else, they're completely optional.

Re: Pharen: A lisp that compiles to PHP

#42
post #31
post #8

Earlier quoted context omitted.

Both really, since interop with PHP is pretty easy so you can use those native features in a lispy way.

Do you believe there are or will be good reasons to choose Pharen over Scheme, Common Lisp or Clojure in a situation where one isn't forced in to using a PHP backend? With Clojure, for example, I consider the baked-in concurrency models and data structures very valuable, but haven't had much cause to care that it runs on the JVM.

That's a really good question. The main case I can see is if someone is already familiar with PHP and its deployment and doesn't want to learn another language/platform. It might also be useable for basic scripting tasks (the compiler has an --executable flag that adds a PHP hashbang to the top of a script).

Other than that Pharen is still pretty new and nowhere near the same level as mature lisps. Making debugging and interop with 3rd party libraries easier are the main long-term goals, so maybe after that it'll be at least a little viable.

Re: Pharen: A lisp that compiles to PHP

#43

Earlier quoted context omitted.

This is really cool and for the most part the syntax seems to make sense. One thing I don't understand is why there is special unnatural-looking syntax for dictionaries. It is inconsistent that comma=whitespace everywhere else. Perhaps something like: (array "a"=>1 "b"=>2) Note that this currently compiles to array("a", =>1, "b", =>2)

The current dictionary syntax is actually typical for lisps, particularly this is exactly what Clojure does. It's just a series of elements except in this case it's designed to look at every two elements as a pair. What do you mean by it's inconsistent? Commas are the same both in dictionaries and anywhere else, they're completely optional.

I take that back. I had no idea that {"a" 1 "b" 2} works when I made that comment.
Post reply on HN