5 ms·
I must admit I am curious about his statement that 25% of viaweb code would have been very difficult to do in other languages. I would like to hear examples of
by utnick 19y ago
I must admit I am curious about his statement that 25% of viaweb code would have been very difficult to do in other languages.
I would like to hear examples of that.
My feeling is that the success of viaweb development had much less to do with lisp than it had to with PG and friends being really good hackers.
- pg 19y agoWhat a weird situation. I keep trying to tell people Lisp is great, and they say, no, no, you guys were just really good programmers. But if I'm such a good programmer, why don't they believe me?
- whacked_new 19y agoTo nitpick this remark, Suppose: 1, cperciva is a really good programmer, 2, writing a Viaweb is within his ability. Given: cperciva intends to write a Viaweb. Result: Viaweb in C. http://news.ycombinator.com/item?id=96431 http://news.ycombinator.com/item?id=96431 (I know, the logic is flawed. I'm being half-facetious)
- pg 19y agoViaweb 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.
- mooneater 19y agoI believe it could be very ugly in C, but not that it could not be written in C.
- marcus 19y agoEver heard of the concept of Turing Completeness, Google it...
- HiddenBek 19y agoViaweb 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. So, no, they could not have written it in C.
- pchristensen 19y agoWow, 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. But I totally agree with your main point.
- mooneater 19y agoMakes sense from that perspective.
- emfle 19y agoThe 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.
- pg 19y ago
- deleted 19y ago[deleted]
- mojuba 19y agohttp://news.ycombinator.com/item?id=99171 http://news.ycombinator.com/item?id=99171 Why not, Paul?
- reitzensteinm 19y agoThat's a {def (on n) (on (+ n 1))} wonderful {(on 1)} idea.
- mojuba 19y agoEvaluates to: That's a wonderful stack overflow idea. It works, haha!
- bayareaguy 19y agoDid 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.
- pg 19y agoYes, 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.
- Tichy 19y agoThat doesn't sound like something a "normal" programmer would come up with. It would be nice to have some "cookbooks" for typical applications in LISP or Scheme. Searching for "scheme web development" turns up just one or two hits, all very basic (like this one http://www.scheme.dk/blog/2007/08/introduction-to-web-development-with.html http://www.scheme.dk/blog/2007/08/introduction-to-web-develo...) 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.
- brlewis 19y agoScheme web development: http://brl.codesimply.net/ http://brl.codesimply.net/ Full-blown web application: http://ourdoings.com/ http://ourdoings.com/
- Tichy 19y agoThanks - 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?
- brlewis 19y agoThe 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.
- plusbryan 19y agopg: 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?
- pg 19y agoI don't think it made that much difference either way. They liked us simply because we were the leader in our market.
- brlewis 19y agoThat's a really perplexing question, isn't it? I gave up trying to answer it after your "Beating the Averages" essay didn't make the world-changing impact it rightly should have. I suppose the good news is that Lisp hackers today don't have to feel the fear you felt during Viaweb, that the competition would figure out you were using Lisp, start using Lisp themselves, and beat you. Now we know that kind of thing just doesn't happen. Now you can shout it from the rooftops and know they'll only fear you, since you must be some amazing braniac to be productive in so difficult a language.