Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Igor Wiedler:
Evolving syntax
Jul 31, 2013 @ 16:44:07

In a new post to his site Igor Wiedler looks forward and suggests some alternate syntax for PHP based around the idea of macros from Lisp. These macros would be parsed at runtime and handled directly as code, compiled down from their custom format.

A very common problem that many software projects have is lack of adoption of new versions. Browsers are an excellent example of this, But it exists on the server as well. [...] This leads to this recursive problem of hosting companies not upgrading because they don't have to, and software not requiring newer versions of their programming language, because they don't want to lose their users. The longer your dependency chain is, the more you suffer from this.

He points out that the easier it is to update these lower level pieces, the simpler it is to introduce new things into your system. He suggest that macro-like functionality for PHP could aid in this goal. He talks some about backporting features and how these marcos could make it easier to upgrade just the things we wanted (or all of them) without having to upgrade PHP itself. He even went so far as to create a tool (galapagos) that does this kind of parsing. His examples implement the 5.4 features of short arrays, $this in closures, function array dereferencing and callable typehinting.

Being able to invent your own syntax is very useful, which instantly becomes apparent when you look at the past. Features get added to languages all the time. What if you could do that easily, within minutes instead of months?
tagged: evolve syntax lisp macro feature galapagos parse ast language

Link: https://igor.io/2013/07/26/evolving-syntax.html

Github.com:
Lisphp - Lisp in PHP
Jul 07, 2010 @ 15:55:55

From the "just because you can" category today Lunant has created a port of the Lisp language via an interpreter in PHP - Lisphp.

Lisphp is a Lisp dialect written in PHP. It was created to be embedded in web services or to be distributed within web applications. For that reason, it implements sandbox environment for security issues and multiple environment instances.

You can grab the latest code from the github page for the project as well as check out some of the tutorials and details about using the interpreter features like use/from, custom functions and custom macros.

tagged: lisp interpreter dialect github

Link:

LispCast.com:
PHP vs. Lisp
Oct 03, 2008 @ 14:32:12

On the LispCast blog there's this recent post comparing (surprise) Lisp and PHP and the latter's popularity in the online development communities.

My question is this: how did PHP get so many libraries, get installed on so many computers, and attract so much developer attention in the first place? [...] To summarize: Lisp is marketing itself poorly. Lisp either needs to get competitive on the ease of use and productivity front, or lose programmers to other languages.

He mentions this post from Brian Carper and this response as two places bringing up good points about Lisp and its community.

That's one of the things that PHP has going for it over Lisp - the community. PHP's community is constantly pushing, reaching out to the developers with simple tutorials and (usually) useful libraries. He makes a call to the Lisp developers out there, though:

The day will come when Lisp won't be cast aside as a quaint relic of bygone days. On that day, Lisp will be seen as equal to the big languages. And it will learn from and share with them as peers.
tagged: lisp programming language community library tutorial

Link:

LispCast.com:
An interesting analysis of why PHP is so popular
Sep 26, 2008 @ 14:36:08

New from the LispCast blog, there's an interesting post that looks at some of the reasons why PHP is so popular among web development circles (but maybe shouldn't be?) after reading this article.

For site like Flickr, Wikipedia, and Facebook - all of whom deal with enormous availability problems - to have stuck with PHP, well, that means something profound. While previously I respected PHP programmers, I always felt that they must not understand much about actual computer science. They were stuck in a procedural world, and a glimpse of what "more advanced" languages could show them would "enlighten" them.

He suggests that PHP scripts, especially the "large libraries" some developers create do some very routine tasks that could be accomplished much simpler. He points out, though, that PHP does have something going for it and that, despite a difference in functionality offered, Lisp could learn something from PHP.

tagged: replace popular analysis lisp library

Link:


Trending Topics: