Reddit 1.0 was written in Lisp
github.com
github.com
I didn't say the are *no* shoulders to stand on. There are
just fewer.
Without a doubt, Edi Weitz single-handedly made reddit
possible. He's an army-of-one producing good Lisp
libraries. The issues that made it really hard to stick
with Lisp weren't particularily Lispy.
The biggest trouble that plagued us was that we could never
quite get Lisp reddit stable enough to sleep at night.
There were weird threading issues that would bring the site
to its knees a couple times a day and required constant
monitoring.
Another comment, from Paul Graham: > One can argue that they betrayed the worth of a
> philosophy merely for cheap money.
Ye gods, enough with the conspiracy theories already. Y
Combinator didn't know Reddit was going to use Lisp when
we funded them. And the reason they switched (or at least,
the last straw) was all too mundane: some thread bug in
CMUCL that made the site keep crashing.
1. http://lemonodor.com/archives/001301.html Require:
CommonLisp (tested on SBCL)
PostgreSQL
memcached
smtp server
CL-USER> (reddit:startup-reddit)
#<HUNCHENTOOT:EASY-ACCEPTOR (host *, port 8000)>
Writing a CL web app today is definitely doable. You won't find a framework with bells and whistles (yet), but all the required building blocks: web servers (Hunchentoot or Clack, like WSGI for Python), choice in templating engines (Djula is Django-like and I like it a lot), etc.To replace JS a maximum I use HTMX which is language and framework agnostic, life is beautiful.
In the end, you can build a static binary with all the static assets, send it to your server and run it.
- https://github.com/fukamachi/clack
For example, one thing we were told when choosing to write in a lisp was that we’d have problems finding developers. It turned out to be true in that we received fewer applications, but compared to the same process with a more mainstream language, I’d say the applicants were on average of higher quality. So by the final step, we were approximately considering the same number of résumés in both cases.
But in the end, the language is not what has made the biggest impact. It’s been other, more universally applicable things, such as team dynamics and communication, clarity of vision and consistency in execution, process and planning, and a ton of other things where the particular language is not a factor.
1) Developers who like Lisp tend to be really smart, well-read, and well-educated.
2) Lisp streamlines these developers' thought processes, allowing them to get more done with less, fast.
For example, the early Naughty Dog games written in GOOL/GOAL take clever advantage of asset data to produce effects close to the very edge of what the PlayStation/PlayStation 2 can do. No feature in these Lisp languages made this possible where C or C++ could not, but working in Lisp enabled the developers to iterate quickly, experiment, and arrive at interesting innovative solutions within the required time frame.
You just described key Lisp features that aren't in C++. It's almost the entire point of using Lisp.
I asked the dev who made the engine why lisp.
"I had a month to build a new scripting engine. Lisp is the easiest to implement in c/c++ or in assembly and I had done it in college. So I made a compiler /emulator in like a week. If I had more time I would have made a dumbed down python with parallelism"
The parallelism was cool because you could have multiple conditions running at once like 5 ai walking 5 simple action loops until one of 3 conditioned collapsed them all into attack mode. Easy to model as threads with joins in this language. Could have been done with other languages but harder to do the memory management.
So not really cause it was a lisp
I can echo this statement with Rust. Same story. Our comparison was Python to Rust. Same app. Big leap, i know.
In all of my career, it’s not those who know who have been good. It’s those who know how to learn new things fast that are good. It’s people who problem solve that make good engineers.
In the inverse. If somebody has a negative reaction to lisp, it’s a sign of a poor engineer.
that said a language can push you to the moon or help you crash faster, team culture and fit will matter more IMO
That myth came from a few posts by a person who was a huge proponent of Lisp, in an era were web (front and backend) development was much easier, and web-related libraries were lacking in all languages (so it wasn't like Lisp's smaller popularity would hurt you there).
It's an example of one.
If they didn't get lucky and Yahoo! bought some other company in the same domain in their place (they already have a few competitors) the whole "Lisp as a secret weapon" would be moot.
Statistically speaking, 99.9% of succesful startups were written not in any Lisp, and 0.1% of them in Lisp. Not the biggest 0.1% either, more towards the bottom, in the context of web company deals during the ramp up to the dot-com bust. Viaweb was sold for $50 million. For context, Yahoo! bought Broadcast.com a year later for 5 billion and doc.com startups of the era routinely raising and burning $50-$100 million for fun - heck, Razorfish (a design consultancy) built websites for clients like Levis, Sony, Mercedes Benz, etc. for $20-$40 million (and that's late-90s era websites, nothing especially fancy).
Of course all that's irrelevant to whether Viaweb was written in Lisp. Which is my point, exactly. What's more, Yahoo! even scrapped all their Lisp code soon after.
Now, writing your startup code in a productive language, that doesn't slow down the development team, allows for easy+quality hires, and so on - even if it's not the best for when you get huge, is a benefit. That hardly requires Lisp.
I think the point that PG was making wasn't that P(lisp|success) > P(blub|success) is what's key but that P(success|lisp) > P(success|blub)
> What's more, Yahoo! even scrapped all their Lisp code soon after.
I'm hardly a PG fanboy, but I have to say this is exactly what's expected in PG's original post on the subject[0]. It's precisely because big companies will only stick to blub languages that Lisp becomes an advantage for a startup.
The point of "Beating the Averages" isn't that you must use Lisp but that small groups of elite hackers can use more powerful tools than larger organizations can't get away with because they generally have lower skilled, only comfortable with blub, programmers.
The reason we don't see many startups following this advice now isn't because it's wrong (necessarily), but because since that essay was written, the vast majority of the startup ecosystem has come to resemble large companies. We've had a pipeline churning out devs for many years now. The ones that are great at leetcode and playing the game go to FAANG, the ones that aren't go to startups. It's not even about where the higher skilled devs are because that hasn't played a factor in most companies success in a long time.
With rare exceptions, startups are no longer created by brilliant hackers looking to change how things are, but by business minded people looking to take advantage of the easy VC money in the last decade. Interviewing at startups used to be exciting, now the vast majority feel like they're run by people who couldn't manage to get a director role at a FAANG.
Perhaps, but that was handwaving from an example of one.
Would Lisp startups dominate if more people did Lisp startups?
I seriously doubt so, but in any case, the examples we see are people not doing Lisp startups and succeeding just fine - with the language used hardly being a serious factor (compared to timing, feature set, user adoption, VC interest, and mere dumb luck).
>Interviewing at startups used to be exciting, now the vast majority feel like they're run by people who couldn't manage to get a director role at a FAANG.
Isn't the latter true for most real hacker types?
What about companies with a technology department that aren’t FAANG or a startup? Isn’t that where most devs go?
So it is funny to see this now popping up as a news item. Shows, how long this is in the past and how much reddit has grown in size.
The first Reddit drama was when Paul Graham was caught having a sock puppet account to defend his arguments :)
Do you have a link to this thread?
I was going to make snarky comment about how between spez and PG, Lisp must actually be extended-release brain poison for people in executive management positions; now I wonder if spez just knows PG personally and takes his advice.
Too obscure and weird for me, but quite interesting. :)
Anyone got any insight into why python was chosen?.
Well, given complaints how much 3rd party apps cost them, they’d better off optimize their crap first.
Initial release of NodeJS was May 27, 2009; 14 years ago.
Swartz was involved in the development of Reddit until he departed from the company in 2007.
And we know that parts of the Python code for Reddit was written by Swartz.
This is about the “scripting niche” I was talking about: in 2008 every Linux distro included Python and lots of build scripts were written in Python 2, but Python for the back-end was really rare back then.
Python was definitely around, had a very strong community, and a number of very significant programs written in it. (Among them: the first versions of BitTorrent and Google.) However, if you were a random dev applying for a random job, you would most likely have to work in C++, Java, or C#. It was relatively difficult getting a job where you would write the majority of your code in Python. Certainly they existed, and many jobs would have you write small one-off scripts in Python, but the actual core product would usually be one of Java/C#/C++.
Remember that in 2009, Google had 20K employees while IBM (which was a major booster of Java) had 400K. And at Google, Python wasn't really allowed for major projects (Search had been rewritten from Python to C++ when it got big in 2000), so you'd be using Java or C++ anyway. Data science wasn't really a thing, and if you did machine learning you used frameworks like Weka or home-grown stuff.
The internal tooling we built was mostly in Python.
Baby boomers always tell me about seeing The Doors live in dive bar in NYC. I can say I used Reddit when it was written in Lisp. :-)
Even years after, when I had stopped posting on those PHP powered smaller forums I resisted creating a reddit account just because it was "reddit".
I would say, the smaller forums sites were a more tightly knitted group that I attended several meetups with. Reddit just never felt the same.
https://web.archive.org/web/20060206185841/http://reddit.com...
Why they moved away from CL:
"If Lisp is so great, why did we stop using it? One of the biggest issues was the lack of widely used and tested libraries. Sure, there is a CL library for basically any task, but there is rarely more than one, and often the libraries are not widely used or well documented. Since we're building a site largely by standing on the shoulders of others, this made things a little tougher. There just aren't as many shoulders on which to stand."
And why Python was chosen:
"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."
So, basically, they were happy with CL except for lack of libraries, and because they also knew Python already, and they knew there were more libraries for Python, they picked it. Simple as that.
Visual noise is like inflation. A constant tax on what you do. But you barely notice it. But it accumulates because it is constantly leading to slightly worse and more complex code. Since it is harder to focus on a noisy something in front of you, you make slightly worse decisions. Over time this accumulates. And similar to how Warren Buffet noticed that a Dollar of his youth is not even worth a penny these days, over time, exponentially more effort is needed to develop the more and more complex system.
So over a longer timeframe, a visually more elegant language wins by a long shot.
Python is the visually most elegant language.
I just took a look at the 4 latest Show HNs which are written in Python. None of them uses types.
Usually someone will pop up showing crazy meta programming template code and use it a straw man to declare cpp=bad.
And I say that as someone doing C++ for a living, and occasionally engaging in said crazy template metaprogramming stuff. Occasionally, because people tend to frown at it during code review; apparently, metaprogramming is reserved only to library authors...
For a company complaining about infrastructure costs for a product that has been cloned many times over, and which is large enough to hire offshore devs, the cost equation favours rewriting in something like Go, Rust or even Java. These are quite tailored towards Reddit’s current use case and many companies including Twitter did that rewrite.
Making better decisions on a daily basis compounds. You evolve towards a better architecture. Which can make the code multiple orders of magnitude faster.
One of many examples: In a complex system, developers often have a blurry vision of what can be cached, in which situations it can be cached, and how cache invalidation should be done. While in a more elegant system, the borders between different approaches to caching are clearer. Leading to the more elegant system being multiple orders of magnitude faster as it can leverage the different caching layers (in memory cache, on disk cache, the CDN ...) more effectively.
Having program login buried in a nauseating amount of boilerplate doesn’t feel very “visually elegant” :-P
The performance critical part is the database, and that at least used to be written in Java (cassandra db).
Writing the bit of glue code between your high performance database and your fronted in cpp would introduce all kinds of really bad potential bugs, scary remote code execution bugs.
CPU usage of that glue code might take up 10% of your hardware budget worst case, even with a "slow" language. It's just not a concern.
But I contributed a tiny bit of code to reddit back when it was open source and chatted with reddit engineers on IRC, so I do know the official justification (as of 2010ish) for reddit sticking with python:
Websites are mostly IO bound anyway. The hot parts like markdown formatting and templating are already c modules. So the performances gain for rewriting in a compiled language aren't large enough to justify it.
On top of it being slow and brittle, dependencies break, needlessly destabilizing stuff.
Worse, the python team ends up having the hardest job, due to self-inflicted problems, so it either ends up with junior devs that don’t know better, or bitter senior devs that could be 10x more productive doing something else.
As always, it varies from company to company, but this is what I saw on four teams out of four at multiple companies.
You can abuse dependencies in every language. This doesn't sound like a Python problem but a bad tech management problem (i.e. who signed off on allowing 'randomguy69/left-pad' as a dependency).
done a few services and CLIs and never had updating deps break anything unless you count newer linters complain about new things.
so i would be surprised if a server written in python could saturate the network, for a reddit-style workload, which i imagine would be similar.
any1 have relecent experiences to share?
With the "new" reddit they replaced most of the frontend with javascript and it really shows. That's not to say I like sites that use too much javascript but python is slow enough just parsing and filling html templates, seemingly.
"We took a wrong turn w/ software."
... apparently.
Save your energy and check out the repo instead.
I don't totally blame the guy though. If you want to play the stupid Twitter game, you have to add a trite but provocative hot take to every post you make, lest your writings languish in obscurity. The only way to win is not to play, truly.
The first non reddit team submissions were some very dry comp sci papers and tech manuals .. the cats came not long after.
Those were more interesting and especially more vibrant times when it came to the web. Granted, the money was not as abundant as it is now.
Most of the information about columns and tables could be recovered from data.lisp and view-defs.lisp. Maybe also old.lisp
I found the old tbnl versions in the wayback machine. One of the snapshots: https://web.archive.org/web/20080131152054/http://www.weitz....
Most likely adapting to the current hunchentoot would not be difficult too.
Hope they changed that password!
And why does that matter? Whatever turns one on.
Nothing is wrong with this. There are crapload of languages and very little benefit from a practical standpoint for a single person to use them all. They're just tools. Some are better, some are worse and some are highly specialized. What is being built is important, not how.