Live data from Hacker News

I’ve Consed Every Pair

medium.com

11–20 of 228 posts

Re: I’ve Consed Every Pair

#11

Earlier quoted context omitted.

My account was reset. I've been around since day two. :) You're right, it has some downfalls. But a lot of the time it simply doesn't matter. All the links at https://www.tensorfork.com/tpus are dynamic, and the speed you gain by being able to whip up a feature in 10 minutes is worth the pain of an occasional dead link. On the other hand, I did some work for "deduplicating fnids": http://arclanguage.com/item?id=20996…

Are fnids anything like Fnords? https://en.wikipedia.org/wiki/Fnord Or are they more like Vermicious Knids? https://roalddahl.fandom.com/wiki/Vermicious_Knids

It's short for function ID. If you want to route requests to specific closures, you have to have some sort of ID that you can send down to the user. Arc stores closures in a hash table keyed by random ID, but we use lexical structure plus lexical values (like username) to make the key deterministic. It greatly cut down on the number of closures that needed to be stored.

Basically, if you have a closure that does a certain action – e.g. editing a comment – Arc generates new a closure every page refresh. That was the root reason for the "dead link problem" during the early days of HN. I reworked it to make the closure IDs deterministic.

If you walk the source code from the point of the closure up to the root, and then you stick all the local variables in a list and use that as a key, then hash that, along with the actual source code, you end up with something that (a) has a very low probability of collision, and (b) is deterministic each time the page refreshes, unless the variables' values change. (E.g. if you store the current time in a local variable, the value changes, so the fnid will change as well, since that value is captured by the closure and therefore the closure has to do something different by definition.)

Re: I’ve Consed Every Pair

#12

Arc is underrated as an information management tool. There's something to be said for having a web framework that works out of the box. Rails is probably the only other framework that makes it as easy to "just make some forms that pass data around and run some code on that data." But not quite -- I haven't seen arc's closure-storing technique used in any other web framework. The main issue that arc solves is that it…

Some arc code I wrote back in the day, for generating textual descriptions from structured data using a web frontend, is still in production at a previous company of mine (as far as I know). It was indeed a useful tool.

It's a shame arc didn't have persistent data structures (besides alists :-) and a native hashmap type though.

For those confused, we're talking about this: http://www.paulgraham.com/arc.html

Re: I’ve Consed Every Pair

#14
The most important thing I ever learned from Professor Norvig was how to not get fat at Google. He said, "Never take a tray. If it won't fit on one plate, it's too much".

A wise man.

I mean I suppose some of the stuff I learned from his textbook was pretty useful too.

Re: I’ve Consed Every Pair

#15

Arc is underrated as an information management tool. There's something to be said for having a web framework that works out of the box. Rails is probably the only other framework that makes it as easy to "just make some forms that pass data around and run some code on that data." But not quite -- I haven't seen arc's closure-storing technique used in any other web framework. The main issue that arc solves is that it…

You haven't been around long enough, at least under the same name, to remember when there was an implicit time limit on the comment reply page, inflicted by those stored closures silently timing out. Having long comments so often eaten that way was actually the specific thing that annoyed me into first installing It's All Text. It's an interesting approach, as attempts to force statefulness on a stateless-by-design p…

I think Seaside had the same issues with scaling.

Re: I’ve Consed Every Pair

#16
post #14

The most important thing I ever learned from Professor Norvig was how to not get fat at Google. He said, "Never take a tray. If it won't fit on one plate, it's too much". A wise man. I mean I suppose some of the stuff I learned from his textbook was pretty useful too.

Well, he does also rides his bike to work more often than he drives.

Re: I’ve Consed Every Pair

#17
Professor steps one level up in awesomeness :) .

Skip here comments regarding AI online courses, questions related to AIMA and PAIP books. It's not quite a good opportunity to inquire about finer points of JScheme or even ask clarifications along last September interview with Lex Fridman. The art of maintaining approachability for beginners and reference level of usefulness for advanced is not easy, but it's demonstrated - and here is flipped on another human side. Peter, thank you for your works for all of us.

Re: I’ve Consed Every Pair

#18

I remember reading something someplace that was something like ... the problem with being old and full of wisdom is it's hard to share that wisdom with the people that need it most without sounding like an old condescending jerk. Plus, they won't listen anyways. The best you can hope for is that when they are old and full of wisdom they'll remember you and think "hey that old guy was right" . I know when I was 25 I w…

> I know when I was 25 I was damn sure I knew better than anyone twice my age.

This is why I've long believed voting systems should restrict the voting age to 16-28. After all, whom would you rather have voting: people wracked with doubt and who fear their own ignorance, or people who know everything?

Re: I’ve Consed Every Pair

#20

I tried writing some of my own verses for this song, but I couldn't think of anything that rhymed with RPLACA and CDADAADR. Speaking of consing every pair, here's a previous discussion about "The Origin of CAR and CDR in Lisp (2005) (iwriteiam.nl)": https://news.ycombinator.com/item?id=16008239 http://www.iwriteiam.nl/HaCAR_CDR.html

Alpaca, Mattered
Post reply on HN