Live data from Hacker News

Reddit 1.0 source code

github.com

51–60 of 117 posts

Re: Reddit 1.0 source code

#51
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…

SBCL

Re: Reddit 1.0 source code

#52
It's fun to look at the ASDF system definition: https://github.com/reddit-archive/reddit1.0/blob/master/redd...

Some Ediware in the dependencies (CL-PPCRE, CL-WHO and Hunchentoot from back when it was called TBNL). I guess they used CL-SQL rather than Postmodern because the latter didn't exist back then.

Should be reasonably easy to get it running on a modern CL.

Re: Reddit 1.0 source code

#53
post #41

Earlier quoted context omitted.

Maybe having it be open source would represent a security risk? https://github.com/reddit-archive/reddit1.0/blob/master/data...

I mean, it shouldn't. Humanity is perfectly capable of building secure web services without having to keep the way it works a secret. You don't publish your encryption keys with your source code, which is what your security should be depending on. And what's more, Reddit themselves did not even use that excuse in their official statement for it, even though to me their excuse felt even less logical. Basically, they d…

In theory it shouldn't, but in practice people don't make perfect code that doesn't have vulnerabilities. But a lot of people would argue that by having many reviewers, you're reducing vulnerabilities. Thus, my stance is that "it depends on the situation"

Re: Reddit 1.0 source code

#54

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

Embedding templates in code is actually quite nice. I used to think like you, but then I gave React a try and it completely won me over.

Even without the transpilation step for JSX support, I find hyperscript [0] and friends [1] a notable improvement over other templating tools. Instead of having to jump to a separate file which magically inherits a bunch of implicit globals, you just call a function. If the system supports a component abstraction you can import them and compose views using the same programming constructs you use everywhere else.

An error in the template can be caught by your linter or compiler, since it's just regular code. I'd say it's actually safer, since you typically won't have to worry about escaping values manually. And along the way you can validate the input in order to confirm you only ever generate valid HTML.

Check out elm-css [2] as well, which lets you define your stylesheets with elm. This lets you take advantage of the their type system to make sure all class names are referenced correctly. A typo or accidental deletion would would cause it to fail to compile, allowing you to catch problems early.

[0] https://github.com/hyperhype/hyperscript

[1] https://github.com/developit/vhtml

[2] https://github.com/rtfeldman/elm-css

Re: Reddit 1.0 source code

#55

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

I'll take sexps over sgml any time. Why do you think this is worse than the corresponding HTML code? You don't have the madness of the closing tag having to repeat the name of the element, the odd idiosyncrasies with self-closing tags, the arbitrary division and restrictions between attribute and children nodes...

And of course in the context of writing lisp code it means that you have a uniform syntax instead of having some parts of the file as HTML and others in an other language (which is often a pain with code editors in my experience).

It still baffles me that SGML and its descendants are so popular. They're quirky, terribly noisy for markup, incredibly large and slow for serialization and of course every variation introduces and removes arbitrary limitations.

Re: Reddit 1.0 source code

#56
post #41

Earlier quoted context omitted.

Maybe having it be open source would represent a security risk? https://github.com/reddit-archive/reddit1.0/blob/master/data...

I mean, it shouldn't. Humanity is perfectly capable of building secure web services without having to keep the way it works a secret. You don't publish your encryption keys with your source code, which is what your security should be depending on. And what's more, Reddit themselves did not even use that excuse in their official statement for it, even though to me their excuse felt even less logical. Basically, they d…

> Humanity is perfectly capable of building secure web services without having to keep the way it works a secret.

That's the same as saying that humanity is capable of building a large system without bugs, in an economically viable way.

Re: Reddit 1.0 source code

#57

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

It's less verbose than writing it as HTML (sexps > SGML markup for such uses). Moreover, it's the right way to go about it, because it treats HTML documents as the trees they are, instead of running free and wild with string substitution, creating both points of breakage and potential security vulnerabilities everywhere.

RE designer thing, I guess it depends on how you work. Frankly, Reddit to this day doesn't look like anything that has ever met a designer (and that's a good thing in its case). Still, if you want, you can just stick to the designer that does mockups in Photoshop, and skip the other designer that converts those into HTML.

Re: Reddit 1.0 source code

#58

It's unfortunate that Reddit silently went closed-source before being forced to admit it. Certainly a betrayal of trust with their long-standing userbase.

Maybe having it be open source would represent a security risk? https://github.com/reddit-archive/reddit1.0/blob/master/data...

A lot of bad developers like to use this excuse but it doesn’t hold water. Open source has a history of producing better security results.

Re: Reddit 1.0 source code

#59
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

Where's your flawless closed source SSL implementation?

Re: Reddit 1.0 source code

#60

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

It depends and is a matter of taste. I'm very much a Common Lisp afficionado but I've come to dislike embedding HTML in code like this (also due to experiences in other languages).

It's not error prone maybe even less so since it can be checked by the compiler.

My preference is to use templating because it matches the final output closer and is, like you said, easier to show to other people / designers. However, even templating is sometimes turned into an enterprise confusing mess where it becomes very complex and hard to know where values come from.

Post reply on HN