7 ms·
Paul Graham: Lisp in Web-Based Applications (2001)
- helium 17y agoCounterpoint: Use any language you want, as long as you keep in mind that you might have to re-write libraries that are available to you in more mainstream languages or use inferior or incomplete alternatives. On many projects this isn't as much of a problem, but I think it's dangerous to assume that one can easily use 'any language' when developing web-based software.
- plinkplonk 17y ago"you might have to re-write libraries that are available to you in more mainstream languages or use inferior or incomplete alternatives." Use (something like) Clojure (or a dot net equivalent)and you can have the best of both - a lisp and lots of libraries. The (minor) price is some grunginess at the interface of the lisp and the libraries, but this is paid only once.
- yummyfajitas 17y agoTry clojure. I'm only getting started with it, but I'm amazed at how clean the interface between lisp and the JVM is.
- jimbokun 17y agoI am commonly using clojure now to interactively test methods in my Java code.
- axod 17y agoRewriting libraries can work out really well. As well as a great way to learn, you may often end up with something better than the existing libraries - giving you another edge. I'm not saying you should write everything yourself, just the bits that matter :)
- helium 17y agoStartups often don't have the time or resources available to them to re-write everything. Many open source libraries have been developed by dozens of very smart people over many years, do you really think your solution will be better?
- axod 17y agoIn specialized spaces that matter 100% to my startup, yes.
- davidw 17y agoThat's sort of the point, though, isn't it? You should be concentrating on that stuff, not replicating (or writing from scratch!) N other libraries that you do need, but that aren't the core of your business.
- helium 17y agoWell sometimes it's a case of gluing together the right components and quickly getting it out there. Not everyone has to be the next Google.
- axod 17y agoOTOH though, a lot of things aren't rocket science. For example, if you want to roll your own webserver/framework for good reasons, definitely do it. But I agree. It's a matter of deciding when it matters, and when it doesn't.
- helium 17y agoSure. On some projects your advantage is on a technical level. But on others it's time to market. Or an unique idea that's never been tried before. In these cases it's to your advantage to use the mainstream tools because there are so many resources available to you.
- tsally 17y agoRemember that libraries licensed under the GPL don't count, as far as startups go. You'd be surprised at how many of the libraries you use in hacked up code on a daily basis are ones you can't release with a closed source product.
- dchest 17y agoThis is not a counterpoint. Actually, I think it's a point of the article: use any language that better suits your needs. If your web app needs a library that's not available in language A, use language B. Or mix languages -- write feature X in language A, and feature Y in language B. The point is -- you can do whatever you want, as you control the environment, unlike with desktop apps. See, for example, my comment in this thread: http://news.ycombinator.com/item?id=595513 http://news.ycombinator.com/item?id=595513
- helium 17y agoThe point of the article is that you can use more powerful, but less used languages when developing web based apps. That hasn't always been feasible when writing software targeting the desktop. Which of course is true, but could have implications of it's own.
- Retric 17y agoNote the 2001. I think his point had more to do with a lack of library's making any powerful language useful. Ruby on rails vs Lisp is not really in favor of lisp, but there is a reason nobody has good C web frameworks. PS: Which is something to think about, if you are spending as much money on HW as Google it might be a good idea to use C or other fast but hard to write language for some of your core functions.
- wheels 17y agoWell, in 2001 the hot web languages were Perl and PHP and CPAN was already riding high. I think this argument in some ways hinges on how far from the tree you're falling. If you're doing essentially a variation on a common theme, you'll be the fastest by picking a language where the bulk of the work is already done for you in a variety of reusable modules. It'd have to be a really poor language for its badness to outweigh having most of the work done for you up front. If, however, you're starting from scratch on something relatively novel, e.g. where Viaweb was in 1996 (and not so much in 2001), then it's true, you should write in the language that fits the bill rather than following the course of momentum. One proviso I would add there though is that Lisp is in the position of being fairly mature and non-traditional, unlike many flavor-of-the-weeks. There are many pains to be found in using tools which haven't stabilized yet, even if they do have a gee-whiz-bang factor. As to your postscript, Google does also extensively use C++; I think that's still fairly common in high-performance stuff at the lower levels.
- ken 17y agoDoes it often happen that higher-level languages have "inferior or incomplete" versions of libraries? My experience has been the exact opposite: in Common Lisp, for example, when there's a native library, it's invariably more flexible and powerful than in any other language I've used.
- 10ren 17y agoBy looking at the way these users modified our built-in templates, we knew what we needed to add to them. Big companies outsource their R&D like this too, letting startups detect problems and solve them. Then the big corp. buys that startup (or copies it), and absorbs the solution into the platform, so the platform is constantly improving. It's a great thing for users.
- JabavuAdams 17y agoContinuation passing style: "Do this, then go here".
- pmarin 17y agoIf you have curiosity, many of these ideas are implemented in Arc: Macros for generating HTML: http://arcfn.com/doc/html.html http://arcfn.com/doc/html.html Closures Simulate Subroutines: http://arcfn.com/doc/srv.html http://arcfn.com/doc/srv.html
- vegashacker 17y agoDoes someone know offhand why these HTML generators are macros and not just functions? If I need to RTFSC that's fine, but thought I'd ask in case it's a quick answer.
- pmarin 17y agoJust try to imitate the behaviour of this library in your favorite language. I tried in Tcl, simulating macros with upvar, uplevel and even with sugar and is not easy to get the same result. http://tverdeforge.googlepages.com/ahtml.tcl.txt http://tverdeforge.googlepages.com/ahtml.tcl.txt
- vegashacker 17y agoNot sure I buy it. My favorite language is Scheme (specifically, PLT Scheme). You'll find no macros below: (define (whitepage . content) `(html (body ,@content))) (define (para) `(p)) (define (link prose url) `(a ((href ,url)) ,prose)) (define (prbold text) `(strong ,text)) So the example from the Arc link (whitepage "Hello world!" (para) (link "Click here" "http://news.ycombinator.com") "for" (prbold "more stuff")) yields (html (body "Hello world!" (p) (a ((href "http://news.ycombinator.com")) "Click here") "for" (strong "more stuff"))) which is a valid expression that PLT's web server will render as a web page.
- gms 17y agoJudging by the HTML macros he talks about in ANSI Common Lisp, they had to be macros since they output HTML to file using a bunch of FORMAT calls. Since side-effects were involved and the calls had to be evaluated at specific points before and after other such calls, they had to be macros.
- stonemetal 17y agoI find the argument rather faulty. If you found your own company where does this "strong bias" to write software in the same language as the OS come from(just about every language out there has FFI to C so system libraries should be accessible)? If I am now writing Web software, I am now writing an application that runs on an OS that is primarily written in C so why does this "strong bias" magically disappear?
- jerf 17y ago"(just about every language out there has FFI to C so system libraries should be accessible)" Just about every language NOW has a good FFI to C. Subtract several years for when that essay was written, then subtract ten years for when the statement is set in, and you'll encounter a different world. Today there's no great reason not to write your desktop app in PyQT or Clojure or on top of XULRunner. (Although I'd point out that surprisingly few people have noticed this!) ViaWeb was born into a different world. I didn't do much desktop programming in the 1996 timeframe, but you did not have many choices, especially if you were a student that couldn't drop ~$1000 2009-dollars into a programming language environment. (Now my new supercomputer-laptop costs less than that and superior environments are free. Vive la progress!) A couple that weren't C and, as it turns out, all doomed to be unsupported within a few years anyhow, like Delphi. I talk about 1996 because it's when I got into the game; the essay is a talk given in 2001 which means "ten years ago" is 1991.
- bad_user 17y agoSystem libraries are accessible, but bindings are still hard to write and maintain. Even when it comes to open-source communities that offer help for writing such bindings, the effort is still big ... try writing a GTK+ application in Haskell or CLisp ... yes, bindings for those two exist, but you're in for some pain. Another reason is documentation. You'll have an easier time finding documentation/examples for the main language of the OS. Another reason: having dependencies that aren't available on the target OS does impose additional development costs (if you don't want to give the user the burden of installing those dependencies). And if the distribution is over the Internet, it also means a bigger download size and extra harddisk space. These things may or may not matter, but imagine a simple feedreader that requires a 30MB download and 200MB of free disk space. The main language of the OS doesn't necessarily have to be C/C++. It's the language that's best supported and encouraged by the company/community that maintains the OS (although it's currently not possible to write system drivers in C# on Windows, work is being done to lift some device drivers in user mode, which would make a good fit for .NET)
- Zarathu 17y agoPG is a Lisp fanboy. And before you down-vote this... well, I suppose I deserve it. Carry on.