Live data from Hacker News

Reddit 1.0 source code

github.com

81–90 of 117 posts

Re: Reddit 1.0 source code

#81

Why Reddit has been rewritten in python: https://redditblog.com/2005/12/05/on-lisp/ http://www.aaronsw.com/weblog/rewritingreddit

What is it like maintaining a large project in such a dynamic language? I guess if you have proper unit tests and good coverage, you could quickly find any runtime bugs that you may unintentionally introduce with refactors/changes.

When in JavaScript, I'd always lean on TypeScript. Is there something similar for Python?

Re: Reddit 1.0 source code

#82

Is Reddit 2.0 the one in Python? Was slightly confused and expecting Python when opening up the github repo.

Reddit was lisp, then python, then python, then React (and some other stuff).

There UI doesn't look like it is using React. Maybe they are still working on it?

Re: Reddit 1.0 source code

#83
post #6

Earlier quoted context omitted.

It goes both ways, being open-source can also make your product more secure, as it's out in the open and a lot more eyeballs look at the code.

Tell that to OpenSSL

Open source allows for the possibility of 'many eyes making all bugs shallow', but I think the open source community assumed that was a guarantee, at least in the case of mission critical software - it's important so obviously it's being scrutinized, right?

On the other hand, with closed source, people are presumably being paid to study the code, potentially fewer but a still fixed number of eyes on the code, as it were. But then, since it's closed source, no one really knows what's going on outside the company.

Moral arguments aside, neither system is perfect.

Re: Reddit 1.0 source code

#84
post #81

Why Reddit has been rewritten in python: https://redditblog.com/2005/12/05/on-lisp/ http://www.aaronsw.com/weblog/rewritingreddit

What is it like maintaining a large project in such a dynamic language? I guess if you have proper unit tests and good coverage, you could quickly find any runtime bugs that you may unintentionally introduce with refactors/changes. When in JavaScript, I'd always lean on TypeScript. Is there something similar for Python?

Python 3.6 has typing/type annotations. It's opt in but seems to work fairly sanely.

https://medium.com/@ageitgey/learn-how-to-use-static-type-ch...

Re: Reddit 1.0 source code

#85
post #28

What kind of Lisp system was used to run this? Would it work with any Common Lisp? What other things are required, like libraries or a database etc.? I'm guessing reddit.asd lists some: :tbnl (a toolkit for building dynamic websites) :cl-ppcre (a regex library) :trivial-http (a HTTP client) :cl-who (a library for using S-expressions as HTML markup templates) :clsql (a SQL database interface and ORM) :clsql-postgresql…

CMUCL on FreeBSD [https://redditblog.com/2005/12/05/on-lisp/]

Re: Reddit 1.0 source code

#86
post #82

Earlier quoted context omitted.

Reddit was lisp, then python, then python, then React (and some other stuff).

There UI doesn't look like it is using React. Maybe they are still working on it?

It's still in development. Available at alpha.reddit.com, but it may not be available to all yet.

Re: Reddit 1.0 source code

#87

I chuckled over this bit of lines [1]. Fortunately (for Reddit) this name is being consistently used throughout the code. Can't guess why. (email :type string :accessor user-emai) [1] https://github.com/reddit-archive/reddit1.0/blob/bb4fbdb5871...

Heh. If you see [1], they define a function called "user-email" (spelled correctly). The lisp convention here would be to define the accessor as something like "%user-email." While the code isn't too bad, these little things betray a lack of knowledge of lisp lore. Perhaps another reason for the rewrite was that the team actually didn't have much experience writing lisp code.

[1] https://github.com/reddit-archive/reddit1.0/blob/bb4fbdb5871...

Re: Reddit 1.0 source code

#88
post #87

I chuckled over this bit of lines [1]. Fortunately (for Reddit) this name is being consistently used throughout the code. Can't guess why. (email :type string :accessor user-emai) [1] https://github.com/reddit-archive/reddit1.0/blob/bb4fbdb5871...

Heh. If you see [1], they define a function called "user-email" (spelled correctly). The lisp convention here would be to define the accessor as something like "%user-email." While the code isn't too bad, these little things betray a lack of knowledge of lisp lore. Perhaps another reason for the rewrite was that the team actually didn't have much experience writing lisp code. [1] https://github.com/reddit-archive/red…

https://github.com/Clozure/ccl/blob/master/lib/case-error.li...

%assertion-failure doesn't look like an accessor.

http://clhs.lisp.se/Body/f_car_c.htm

car described as "accessor", not named %car. No public function in CL is named this way. In fact, the character % doesn't make an appearance at all:

http://www.lispworks.com/documentation/lw50/CLHS/Front/X_Per...

I've never named a function or macro %something in 18 years of Lisp.

Re: Reddit 1.0 source code

#89
Is this really all the source code? It seems to be missing the database schema, which is pretty critical to using it.

Beyond that, this is actually fascinating to look at. It's small enough that you can actually understand it, but it's more complete than a simple 'toy' application. I'm also fascinated to see how SQL constructs are expressed in LISP. I don't know LISP at all, but it's pretty obvious how the queries in the language map directly to SQL.

Re: Reddit 1.0 source code

#90
post #87

Earlier quoted context omitted.

Heh. If you see [1], they define a function called "user-email" (spelled correctly). The lisp convention here would be to define the accessor as something like "%user-email." While the code isn't too bad, these little things betray a lack of knowledge of lisp lore. Perhaps another reason for the rewrite was that the team actually didn't have much experience writing lisp code. [1] https://github.com/reddit-archive/red…

https://github.com/Clozure/ccl/blob/master/lib/case-error.li... %assertion-failure doesn't look like an accessor. http://clhs.lisp.se/Body/f_car_c.htm car described as "accessor", not named %car . No public function in CL is named this way. In fact, the character % doesn't make an appearance at all: http://www.lispworks.com/documentation/lw50/CLHS/Front/X_Per... I've never named a function or macro %something in 18 y…

Sure, sure. But while it's definitely not in the standard, I do see it all over, and it's something I picked up from reading a lot of other people's lisp. SBCL internals, for example. You might not like the convention and chose not to follow along with it, but I would be surprised if, after 18 years of lisp, you had never seen it before, and would choose to misspell an accessor to prevent a clash instead of naming it differently.

Edit: ah, I think I understand. I don't mean to imply that all accessors should be named in this way. That would be gross.

Post reply on HN