5 ms·
Tarsnap is the classic example of a C program whose reliability almost defies belief. Its codebase is large; it solves a very hard problem; and it manages to h
by sillysaurus2 13y ago
Tarsnap is the classic example of a C program whose reliability almost defies belief. Its codebase is large; it solves a very hard problem; and it manages to handle almost every cornercase flawlessly. (As of the latest version, it seems to handle every cornercase flawlessly, as far as I know.)
But I've always wondered: if Colin were as experienced with Python as he is with C, would Tarsnap be better served by writing it in Python? It seems like the codebase would be half as large.
In other words, is C the reason why Tarsnap is good, or is it because of Colin? Or is it both?
Example: Lisp, along with PG, is the reason why HN is good. Many of HN's features simply wouldn't be easily accomplished without it, so they wouldn't ever have been implemented. But I'm not sure the same could be said of Tarsnap.
But let's be honest - in how many languages can one retrospectively add a garbage collector?
Many. Lisp in particular. HN's links like /x?fnid=KxPuWC6qnkl4nxcUTDh4xs are an example of this.
- stinkypete 13y ago/x?fnid=KxPuWC6qnkl4nxcUTDh4xs resolves to "unknown or expired link". Do you have a full URL?
- zb 13y agoIt got garbage-collected. That's the point.
- stinkypete 13y agoGotcha. The parent comment made it seem like that was a link to information about retrospectively adding GC to other languages, especially given that Lisp already has GC as nearly an assumption at the language level. But I can see what he was trying to get at.
- elwell 13y agohaha, exactly
- nilkn 13y ago> E.g. Lisp, along with PG, is the reason why HN is good. Many of HN's features simply wouldn't be easily accomplished without it Could you expand/elaborate on this? I've never viewed HN as particularly complex, just tastefully designed with a good community.
- recuter 13y agoI never read the Arc source but I bet what he means is how comments are laid out in memory which you can see is reflected with direct links: https://news.ycombinator.com/item?id=6857138 https://news.ycombinator.com/item?id=6857138 I'm not sure why that would be impossible in a none-lisp, just less elegant.
- mikeash 13y agoWait, HN is good? The community is interesting, but I've never been particularly impressed by the implementation. In particular, the "feature" where "More" links and such randomly expire after a while just screams "shoddy implementation" to me.
- AceJohnny2 13y agoThe thing is, the "more" links are specific to each user and generated page. They're not just "page 3 at the time you click on the link", but the actual next 30 links following the 30 it's previously shown you. As a result, it needs to store state for each of these links it's created (IIRC, the fnid is a reference to the closure containing that state). For obvious memory management purposes, these need to be expired after some time. I agree that it's an odd implementation choice though. I guess it made sense when HN was smaller and it could grant more ressources to each user. Nowadays, Reddit's simpler system (with risks of duplicates or missing rising links as you go deeper) would probably make more sense.
- mikeash 13y agoI understand that it's a tough problem and can totally understand solving it by just making the links quit working like that. But that sort of thing doesn't strike me as "good", even if it is highly pragmatic.
- pkolaczk 13y agoAnd why not store that state on the client? 30 serialized ids is not that much.
- aryastark 13y agoYeah, I really can't believe that hasn't been fixed by now. Not only that, but it's impossible to follow discussions here. You have to go through your comment history to find threads you reply to.
- elwell 13y agoThe UI is in some way (i think) intentionally poor. For example, when you want to reply to a comment it takes you to a new page, and then you still have to click on the textarea to focus it. I think they don't want people to be able to comment quickly.
- RyanZAG 13y agoIt's rarely the language that has any actual effect on the end result. The language is just a side show - the main story is about how well the developer understood the problem space and how well the abstractions and solutions he generated work to solve the problem. Language can help a bit in making it clearer and giving the programmer more time to work on the important parts - but this actually goes both ways. Not having to worry about memory is a definite plus, but it can also be a big minus when you need to do something specific with that memory. For example, mutating in place is very easy in C when its required, but trying to mutate in place in some of the newer languages is very difficult. Also it's doubtful if Tarsnap would be better if it was in Python. It might (or might not, depending on optimizations) have been quicker to write it originally in Python - but nobody would trade an already created C tarsnap for a Python tarsnap because the Python one would use more ram and run slower.
- rbanffy 13y ago> It's rarely the language that has any actual effect on the end result. Implementing HN in APL is left as an exercise for the reader.
- zurn 13y agoThe traditional argument for high level languages is that you can try many more things in the same time, and that you can focus more of your cognitive faculties on the business problem at hand. But C guides you to simplify, and gives you control. Combined with the right certain amount of taste this can lead to exceptionally good outcomes. See also qmail, plan 9, etc.
- byroot 13y ago> the reason why HN is good I don't get this. I would chose reddit over HN any given day technically / ergonomically speaking. Actually if https://news.ycombinator.com https://news.ycombinator.com was returning a 301 to https://reddit.com/r/hackernews https://reddit.com/r/hackernews I would be very happy.
- qznc 13y agoIs /r/hackernews officially restricted by Reddit or what is going on there?