Hacker News new | past | comments | ask | show | jobs | submit login
Lisphp: A Lisp Dialect Written in PHP (github.com)
35 points by yareally on Oct 20, 2013 | hide | past | favorite | 44 comments

A genuine question which looks like hate but isn't: why are people still innovating on PHP? I can understand why it may still be in use, but why nurture the ecosystem?

The only people I know that care for PHP enough to be into this kind of thing are people who have never written anything but PHP, and that's a small number of people...and the number of those competent enough to write a LISP in PHP is precisely nil. Only my experiences, sure, but I'm sure I'm not that off the mark.

PHP has huge potential and it has grown in a lot of positive ways in recent years thanks to the nurtured ecosystem. Frameworks like Laravel and Symfony are really evolving the language into something that can compete with things like Rails. Sure there's still a huge mess of legacy code out there and there are a lot of poor quality applications that a generic PHP dev may encounter, but if you make an effort to write good code and use only good tools you can definitely avoid the PHP pain that a lot of people remember from <2010.

Here are some books that will introduce you to Laravel (http://laravel.com/), it's nothing like the PHP of <2010. https://leanpub.com/codebright https://leanpub.com/laravel https://leanpub.com/implementinglaravel https://leanpub.com/laravel-testing-decoded

Ok, I can believe that's true. I'm definitely talking pre-2010 here.

But you speak of competing and avoiding pain - my point is why not just use something that was decent from the get-go? I still don't get it.

Ruby/Clojure/Python/Javascript/Scala guys will wax lyrical about why they're awesome - ever seen Rich Hickey talk? That man has an ideology and a fiery passion for it. I never see anything remotely like this come out of the PHP world, just vague pseudo-defensive statements.

PHP is ubiquitous. Not many people can walk into a company and convince their bosses to dump their entire stack, retrain all of their developers and then migrate to a new platform. If someone is programming for fun it may make sense to work with a platform that is more developer friendly (although as I mentioned, PHP is heading that way already so it's no longer the case that obviously PHP is terrible for everyone) but most developers don't get to choose to work in their favourite environment and fortunately a lot of people that had to work in PHP decided to make the most of it and work towards improving the ecosystem. All that matters is the people working with PHP build stuff, whether they do it with a skip in their step or they go to events and tell people how great PHP is doesn't matter, what matters is that they write code and a lot of people work in PHP because a lot of websites use PHP. There are currently 2000 jobs open on freelancer.com for PHP, for Rails there is 20.

I never doubted it's ubiquity. If necessity and inertia are the answer to my query then I suppose I get that. I'd still be the guy in the room pushing for a piecemeal rewrite though.

It's a fine language with various pros and cons versus ruby/perl/python/lisp/clojure/java/c/go/javascript etc.

I can imagine many handy reasons to have a lisp interpreter in PHP.

Also, for your information, I've written code in many languages. I've written thousands of lines in lisp. Typically, if I'm aggravated at a project, it's because of the project itself, and not the language. It's odd to me when people find the language to be so significant for a language that is fairly mature.

The reason is simple: PHP is getting better. It took a long time, but people owe it to others and themselves to help PHP thrive because it can only get better with the help of others. Frameworks like Laravel are somewhat responsible for the resurgence in PHP development, it's becoming an exciting language to use again, the quirks and issues the language had are slowly but surely being fixed in versions post 5.3 that's for sure.

You have to remember that no other language has really been able to beat PHP in terms of ease of use and setup. Every shared host in the world has PHP installed. There's no server to start, no scripts to run, you just upload your files to the server and they work. Django/Rails and all of those other languages don't just run on most shared hosts. PHP is easy and that's part of its appeal and the reason why it won't be dying any time soon.

Every language has quirks, not just PHP. If you want to talk languages that were too, once horrible and in some ways still are, look no further than Javascript. That didn't stop it becoming the most widely used scripting language on the web.

There are lots and lots of people who are using JavaScript under duress because we have no real choice. I for one don't like it, but I get on with it.

I agree with you on the JS thing, and it's interesting to note from this thread that PHP may actually be on the up this time.

> the number of those competent enough to write a LISP in PHP is precisely nil.

There are many people competent enough to write a lisp in PHP, but most are working for companies that still work with PHP (of which there are many, including some pretty high-profile companies)

This might also sound like hate (and it isn't, I'm really curious), but how much work (and what kind) did you actually do in php, before you realized that it's not worthy and should be killed off?

Webapps, unsurprisingly. Enough to know that I was using the wrong tool when I burst out of my little bubble and opened my eyes. I've since written/played in more languages and problem domains than I can be arsed to type, and not once I have I said to myself "You know what I need for this job? PHP."

Edit: I totally lied, there was an occasion where I had that thought. A friend of a friend wanted the year in her otherwise static site's copyright notice to auto-update. So I emailed her a snippet to paste and told her to change the file extension.

The problem is this. Most bods either hammering out PHP or deploying popular PHP apps such as WordPress, Magento or Drupal are deploying to shared hosters.

Until such time the Rails/DJango/Flask/Sinatra/Node/etc folks come up with a compelling shared hosting story for the likes of 1&1, Fasthosts, GoDaddy etc then PHP will continue to be hugely popular. Like it or not PHP has virtually no friction, technically or cost-wise, when building and deploying your first apps. Add to that we now have some nice dev tools such as PHP Storm and VS.PHP which grease the wheels of PHP somewhat more.

Yes I know there's the Herokus of the world out there, but your average mort agency developer has never heard of these things, or possibly may not have the skills.

Trust me, I work for a webhoster, and despite asking myself the same questions, I do understand firsthand why PHP is hugely popular, despite my own misgivings about the language.

I like that presentation! It's engagingly shameless about not being able to say anything better for today's PHP than that it's roughly where Perl was ten years ago.

That presentation was interesting, definitely some stuff I don't recognise.

You realize PHP powers well over 70% of websites around the world?

Why wouldn't people use it, and create new things in it?

Sorry you had horrible experiences with it, but seriously, get off your high horse.

Don't make it personal - I'm trying not to insult PHP here, and certainly not you.

I'm not on a high horse, I just don't get it! Fine, sometimes we have to work with things we don't like. I get that - am I going to do anything beyond what's necessary and start writing libraries for it? Not on your nelly...

I can't be that wrong because for all PHP's ubiquity, it still doesn't have a ubiquitous package manager (that works) for sharing these creations.

Here's the thing - you're talking about something it's fairly obvious you don't know well at all.

"still doesn't have a ubiquitous package manager"? http://getcomposer.org

Ok I concede this might be less niche than I thought, it wasn't around when I last wrote PHP. Research error on my part.

What else have I failed to realise? I'm entirely willing to believe that I'm wrong, I have a vested interest in learning, not being right - I almost want to be proven that I'm wrong about PHP.

I think you may have failed to realize (as a lot of people have) that the language has evolved both in structure and in practice since you probably dropped it. Most of what people hate about PHP can be dealt with using a proper framework, autoloading and PDO (no more inline SQL queries ever), and most of the rest can be maneuvered around as with the gotchas of any language. Check out the Laravel community and look at Composer and take a look at what it's become if you're serious and it will become apparent that, while PHP still has its warts, it is entirely possible and practicable to use it and enjoy it, or at least not hate it.

I don't know how much exposure has to count for "experience" since i'm still a student but i've written code in perl, python, c++, java and php and so far I find things to like and things I can't stand about each of them.

Not everyone who works with PHP dislikes it. For some it's just a language which has some weird and unruly aspects which can be dealt with.

That's what you don't seem to be getting... people work with it, even people who work with other languages, and find that it happens to fit into a particular niche for them. They write libraries for it and expand it because they find the language useful and expect it to continue to be useful for the forseeable future. And it doesn't suck as badly as it used to.


You're responding to a troll. Probably best to not to give him the satisfaction.

I most certainly am not trolling. I want some insight into why people decide to sit down and write PHP libraries like this, that's it. I want to understand the thought process.

So far I've got necessity, and maybe that's the whole story, maybe not.

I'd really like somebody to say "because I like to" - that's the conversation I really want to have. I would love to know why someone would say that, and not because I'm a troll, but because I do not like PHP at all and I have genuinely have no way of answering that question on my own.

I spent about a year writing PHP, and I thought it was a fun language. You can write very compact code in it, I could write it fast, and I seldom had to do any difficult debugging.

I saw some really bad PHP written by other people. But that shows how easy it is to write. Even people who are terrible at programming can figure it out, sort of.

Have a look at the linked repository, under src/ and see if it looks anything like what your expectations of PHP are.

Why not?

Personally? Because I'm not a sadist?

I just wrote a toy lisp interpreter in C++. It's kind of amazing how easy it is to interpret lisp. Hard part is writing the GC and tail call optimization. Not trying to diminish the post at all, I just think Lisp is a cool language :)

no link to the repo :(

Someone took my favorite language theoretically, (meaning I love everything about it but I don't get to use it much) and combined it with my least favorite language theoretically (meaning a language I am forced to use a lot, so I'm really good at it but feel dirty every time I use it).

Should I feel good or bad?

I don't know how you should feel but I find it hilarious.

Now you can put lisp code in your PHP. Be sure to test this out with your coworkers or you might get tar'ed and gzip'ed.

this was posted 3 years ago as well. It's interesting to compare the comments. https://www.hnsearch.com/search#request/all&q=Lisphp

It's so easy to troll HN - just mention PHP

But why?

>> It was created to be embedded in web services or to be distributed within web applications.

This is the worst thing that ever happened

>"This is the worst thing that ever happened"

Self-referential comments are not encouraged on HN.

Instead of criticizing your own comment, consider saying something constructive or interesting about the OP.

so HN comments aren't hoisted ?

I don't know man, I'd rather see stuff like this than the umpteenth JavaScript project.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact