News for hackers. Stuff that matters.
Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by adwf on Thursday November 15, 2012 @08:10AM (#4788339)
I'm using CL-WHO at the moment and I admit it's not necessarily the easiest way to generate html. But I did spot an alternative the other day called Spinneret: https://github.com/ruricolist/spinneret

I haven't got round to testing it, but it sounds good so I might try writing my next project with it. Having said that, CL-WHO has had some updates recently to add basic support for HTML5. Hunchentoot is also getting fairly consistent updates, I think there is even a websocket extension for it now.

I think Quicklisp has been responsible for a resurgence recently in Common Lisp. It used to be quite a pain for new people to get libraries up and running, which of course affected how much they get used/tested; so a common refrain was "Not happy? Just write your own". Now it's much easier to share and use libraries, and I'm seeing a fair bit of interesting development.

My favourite example at the moment is cl-parallel: http://lparallel.org/ Clean documentation, nice looking abstractions for seamlessly parallelizing code, I'm looking forward to trying it out next.

Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by codewright on Thursday November 15, 2012 @11:50AM (#4789404)
Dude, spinneret makes the same goddamn mistake.

I don't want my HTML templates in my Common Lisp code!

Most of my projects have a separate frontend guy who needs to be able to write the templates himself without touching or knowing the backend code. Django, Rails, Flask, Sinatra et al understand and respect this.

For some reason, most Clojure and Common Lisp libraries fail to grok this. I don't know why.

I want plain HTML files with some simple (mustache or Django/Jinja-style) tokens for injecting data provided by a hash-map/dictionary/assoc-list.

That's. It.

Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by adwf on Thursday November 15, 2012 @12:41PM (#4789717)
Good point. Maybe it's something to do with the fact that Lispers are so used to the whole "Code is Data, Data is Code" concept that you get within the Lisp family of languages? I guess I don't really see too much difference anymore between: <head>foo</head><body>bar</body> and (:head foo(:body bar)) Except that the 2nd I consider far more flexible for my personal needs. YMMV

The way I separate it out (and keep it sane!) is by trying to stick to a fairly strict MVC style and keep the backend code in separate functions away from the frontend cl-who templates. But this does still require some initial work in translating the initial html templates to my lisp templates, so I'll agree with you there.

And yes, it certainly does make it more difficult when dealing with 3rd party designers. I have to translate all their basic html templates into lisp/cl-who syntax. But I don't find that too much of a hardship tbh and the tradeoffs are worth it.

Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by codewright on Thursday November 15, 2012 @04:45PM (#4790935)
>I have to translate all their basic html templates into lisp/cl-who syntax. But I don't find that too much of a hardship tbh and the tradeoffs are worth it.

That would not work for more complicated projects at all.

Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by jonathlee on Thursday November 15, 2012 @12:29PM (#4789647)
I think the templating library you are looking for is cl-mustache. I am using it currently for a SQL template engine in one of my internal work projects.
Re:Mocl: Common Lisp for iPhone/iOS, Android, and other mobi... by codewright on Thursday November 15, 2012 @12:52PM (#4789777)
First one that's shown promise.