KBD

Keith Devens .com

Saturday, July 5, 2008 Flag waving
ALL YOUR BASE ARE BELONG TO US. – Zero Wing
← Compiling Little Languages in PythonRFC 4287 (Atom) →

Daily link icon Tuesday, December 6, 2005

reddit just rewrote their app in Python

reddit just rewrote their site in Python. It was originally written in Lisp.

Lisp is an amazing language. After spending the entire summer working entirely in Lisp, it's nearly impossible to work in another language and not say to myself, "If only this were Lisp..." Lisp has many goodies that make programming in it a joy: the REPL, macros and the lack of syntax are some. I won't go into the details, but rest assured, it's cool. People become Lisp zealots for a reason.

So why Python?

We were already familiar with Python. It's fast, development in Python is fast, and the code is clear. In most cases, the Lisp code translated very easily into Python. Lots of people have written web applications in Python, and there's plenty of code from which to learn. It's been fun so far, so we'll see where it takes us... I'm very pleased at the way [the rewrite] turned out... The entire task took less than a week, with 80% of the code written in a single weekend.

I liked what Paul Graham (Lisp guru, and one of the founders of Y Combinator, the VC firm that funded reddit) said about the rewrite in Python.

← Compiling Little Languages in PythonRFC 4287 (Atom) →

Comments XML gif

Elling wrote:

Lisp? That's for masochists... Here's some, if you desire:

(defun read-line-lstream (ls)
  "Read a line's worth of characters"
  (let ((s    (read-line (lstream-stream ls) nil '*eof*))
        (line (incf (lstream-line ls)))
        (col  0))
    (if (eq s '*eof*)
        (setf (lstream-eof ls) t)
        (setf (lstream-buf ls)
              (nconc (lstream-buf ls)
                     (mapcar #'(lambda (x) `(,x ,line ,(incf col)))
                             (coerce s 'list))
                     `((#\newline ,line ,(incf col))))))))
∴ Elling | 7-Dec-2005 5:42pm est | #8810

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

Girls, please don't get breast implants

> And no, you will not be receiving​a picture.

:-(...

Keith: Jul 2, 6:05am

Javascript clone function

This is a clever way to clone an​object if you are using YAHOO UI.​Same tec...

Antonio: Jul 1, 12:47pm

I hate Norton Antivirus

Oh just one other thing norton is​great at keeping people out of your​compu...

kevin.sands: Jul 1, 12:50am

Terminator 3 was awful

I think the biggest reason why T3​totally blew was because Edward​Furlong g...

76.167.172.64: Jun 29, 3:06am

Generated in about 0.105s.

(Used 8 db queries)

mobile phone