Viaweb manipulated s-expressions at runtime and called compile on them. One literally could not write it in C, short of writing a Lisp interpreter in C, which is what Yahoo had to do when they ported it to C++ after I left.
Did they preserve the s-expr structures in the C++ version?
PostgreSQL was once a collection of C modules called from Common Lisp. Debugging the cross-language implementation proved too difficult so it was ported entirely to C using tools which mostly moved the parens around. Some lisp structures live on inside it to this day.
Yes, in the C++ version the s-expressions are stored on disk exactly as they were before. The C++ version literally reads a file of Lisp code and executes it. As an instance of Greenspun's tenth rule, it's hard to beat.
The original Lisp version was actually running till last fall. When they introduced the C++ version you had to explicitly choose to "upgrade." There were some users, including me, who hadn't. Finally last fall they called me and told me they were going to move us to the C++ version. It's barely different.
They lack a lot of features one has come to expect from modern web frameworks. Could be that some turn out to be unnecessary, but still. I think I have found good online references for learning the basics of Scheme, but for now, I still don't know if writing full blown web applications is really feasible.
Thanks - so brl is following the ASP style approach to html generation (mix code and HTML)? Similar to PHP and JSP?
I like that better than creating the whole HTML in S-Expressions, but at the moment I wonder if the best approach would not be the one I know from XMLC: just operate on the dom-tree of the web page, and then serialize the dom?
Where are good places on the web to discuss such things?
The subtle difference between JSP and BRL is that in JSP %>string<% becomes a statement that outputs the string to a web page, while in BRL ]string[ is simply a string expression. This makes the same handy syntax available for putting any static/dynamic elements together, whether in web pages, emails, or SQL. This would be hard to replicate in a non-sexpr language. Hacking is quick and easy, and centralizing similar code from individual pages is straightforward and natural. BRL doesn't stay messy as PHP tends to.
Other features of BRL could be implemented in a non-sexpr language. It just seems nobody cares to make languages truly suitable for database-driven web apps. PHP could have done something like define-input to solve their register_globals problem while retaining a lot of the convenience it had become famous for. A ResultSet object in any language could be extended to have a very useful subset of the functionality in BRL's sql-repeat.
Anyway, I'm not sure the best place for discussion. Most lispers and schemers don't seem interested in web development. Maybe you could discuss it here on news.yc.
pg: do you think that using a fairly obscure language lowered your valuation in yahoo's eyes because they knew they'd have to rewrite it, or raised it because they knew the hackers they were buying were top-notch?
Viaweb was a cash strapped startup in a competitive market, who succeeded against odds because of their speed and agility. They were running on fumes when they were acquired. A longer development period would have certainly meant the death of the company.
Wow, that was a cool comment. I don't think I've ever agreed with and wanted to argue with a comment so much as that one. I sat there for about 30 seconds deciding whether to vote it up or down. Kudos! (note - that was totally sincere)
At first I thought you were leaving out their smarts and technology, but speed and agility were because of the smarts and tech. Then I thought I remembered pg saying they were going to close another round of funding when they got bought instead.
The theory says that for any two programming languages there is a constant c such that any given program can be translated from one to the other with only a c difference in size.
That's just an elaborate way of saying that you can write an interpreter (of size c) for one language in another.
Nevertheless, I have a hard time believing that viaweb could not be written in C short of writing a Lisp interpreter. For that to be true, the runtime compilation of s-expressions would have to be essential to the application; there would have to be no other way to write it.
Do you think I would have done something as heavy-handed as compile s-expressions at runtime if it weren't necessary?
We had a page description language called RTML that was Lisp underneath. Users created templates in it, which we then executed to generate their pages. It is these page templates that are still stored on disk as s-expressions in the C++ version.
> Do you think I would have done something as heavy-handed as compile s-expressions at runtime if it weren't necessary?
Why not, if the language makes it simple? I am not claiming that Lisp does not have more powerful abstractions than C, just that they are not usually essential to any given feature in the application.
If Lisp is actually part of the user interface, then clearly there is no way to avoid having a Lisp interpreter. This is begging the question though.