Live data from Hacker News

I’ve Consed Every Pair

medium.com

131–140 of 228 posts

Re: I’ve Consed Every Pair

#132

Can someone explain what this means? What is this "consed" he is talking about? I'm a c++ programmer, "consed every pair" means nothing to me.

Cons cells are the traditional Lisp data structure making up the nodes of a linked list. It comes from the cons function which is short for "construct".

Ironically, Clojure doesn't use cons cells, although it does have a cons function.

Re: I’ve Consed Every Pair

#133

In the genre of Lisp songs, I love “God wrote in Lisp”, by Julia Ecklar. Touted as a parody, but it actually has beautiful lyrics. https://www.gnu.org/fun/jokes/eternal-flame.html

>I love “God wrote in Lisp”, by Julia Ecklar. Would bet to be HolyC or "I might be wrong"

https://xkcd.com/224/

Re: I’ve Consed Every Pair

#135

I'll admit I don't think I've really noticed the presence of lisp online other than when people want to talk about lisp. Can someone share some practical examples of where lisp is being used? Maybe a popular open source project I never realised was written in a lisp family language?

Hello,

Some Common Lisp success stories: https://lisp-lang.org/success/

pgloader was rewritten from Python to CL: https://tapoueh.org/blog/2014/05/why-is-pgloader-so-much-fas...

Some companies still pick and use CL: Rigetti Computing (quantum computing), 3E (realtime aggregation and alerting engine of sustainable energy systems), OpusModus, an award-winning music composition software, ScoreCloud, an impressive speach-to-text music notation software, RavenPack (big data analytics provider for financial services), SISCOG (underground systems of many european capitals), Genworks (knowledge-based engineering),…

a community curated list: https://github.com/azzamsa/awesome-lisp-companies

I have also just deployed a website to a client last week: it reads an existing DB and shows products to the user. Simple, effective. I can hot-reload it if I want, it's built-in (I just use the REPL, I can even install new dependencies without a restart).

CL allows cool things like live-extending your browser: https://github.com/atlas-engineer/next

Re: I’ve Consed Every Pair

#137
post #84

Earlier quoted context omitted.

Since this is getting a surprising amount of interest, let me sum up the technique here. It's really not hard to implement it in Javascript using Express. 1. inside of your express endpoint, create a closure that captures some state. For example, the user's IP address. (This is a dumb example, but the point is that you can capture whatever state you want . Some cases are mentioned here: http://paulgraham.com/road.htm…

This is really funny; Back in the warcraft 3 days, we used to do the same thing inside its scripting language --- to attach some data to a timer, we would exploit the fact that a timer is in fact just a 'void *' underneath: so the pointer address gave us the unique ID. We would stash data associated with the timer in a global hash table. Then, in the callback of the timer, we would read the data back from the global…

H2I was such a cool function.

I completely forgot how terrible of a language JASS actually was. Have mostly fond memories. But oh my is it verbose

Re: I’ve Consed Every Pair

#139
Peter Norvig is the most inspiring genius in my coding world. I met(virtually) him via AI course in Udacity and since that time I enjoy all reading/watching from him.

His book AI programming(Lisp version) is a gem that I enjoy reading. I've finish a book a few times already - but every time I read I find something new that I missed previous time.

Re: I’ve Consed Every Pair

#140

cons lists are kind of slow because they don't play well with CPU caches. Are there any ideas how to adapt Lisp (or LISP) so that it plays well with current CPU architectures?

> cons lists are kind of slow because they don't play well with CPU caches. Cons lists were slow on the IBM 704 too. Good thing that didn't stop anyone, right? > Are there any ideas how to adapt Lisp (or LISP) so that it plays well with current CPU architectures? An ARRAY feature was described in the 1960 Lisp manual. That's probably because it was recognized that linked lists weren't the be-all data structure even o…

> Cons lists were slow on the IBM 704 too. Good thing that didn't stop anyone, right?

The IBM 704 didn't have a cache hierarchy. The problem that the person you're replying to is talking about didn't exist on that architecture.

Accessing any memory location on an IBM 704 took the same time, so it doesn't matter if your values are consecutive in memory as in an array, or somewhere far away as possibly in a linked list.

But on a modern architecture reading a value far away can cause a cache miss.

What do you think the time penalty is for a full cache miss? Something small? Maybe a couple of times slower? No, the difference between a level 1 hit as often in an array, and a cache miss, as often in a linked list, is around two orders of magnitude.

It's literally multiple orders of magnitude worse relatively than it was on the 704.

Ideally modern Lisp implementations would use some kind of variant of the storage strategies pattern, as used for languages like JavaScript, to give the same semantics as a cons cell but actually using a cache-friendly implementation, but I think this is an unsolved research problem.

Post reply on HN