Live data from Hacker News

I’ve Consed Every Pair

medium.com

201–210 of 228 posts

Re: I’ve Consed Every Pair

#201

Earlier quoted context omitted.

If I may ask, what references would you recommend to someone interested in something like Lisp, but who has never touched a functional language before?

Not OP, but Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside. Mutation is common, don’t think Lisp will be a language like Haskell. For resources, I would recommend Practical Common Lisp[0] and PAIP[1]. For some modern development practices, the Common Lisp Cookbook[2] is great. [0]: http://www.gigamonkeys.com/book/ [1]: https://github.com/norvig/paip-lisp [2]…

Sigh. Immutability is a relatively recent addition to the long list of features that defines a language as "functional."

In the beginning, "functional" meant functions were first-class objects and there was little--if any--global state. Lisp passes this test. Lisp invented this test (especially Scheme which introduced lexical scoping and closures).

If you want to write code with immutable data, you can certainly do so with Lisp; it just doesn't force you to. For the most part Lisp creates a brand new data structure when you "modify" an old one. You have to work a bit harder to actually mutate things.

Where e.g. Haskell is "more" functional than Lisp is more about automatic currying than immutability. Plus the static type system that allows monadic programming, which is much more difficult in Lisp because of Lisp's dynamic typing.

Re: I’ve Consed Every Pair

#202
post #167

Peter tech-reviewed the second edition of my Java AI book and made the comment that Java was half as good as Common Lisp for AI and that was probably good enough (we had both written Common Lisp books). He then went to Google and I had lunch with him; I was surprised that he was using Python. I like his poem in the article! A little off topic, but I retired (that is a bit of a joke) and at the age of 69, this year I…

If I may ask, what are the benefits of building this app in LispWorks instead of any other implementation (sbcl or else)?

Lispworks has a capable IDE. It looks like a 1995 Geocities page but it works well enough. Their editor is Hemlock which is a Common Lisp clone of emacs, so most of the key bindings are the same as emacs and you can rebind them if you wish. Or you can use Lispworks without the IDE and drive it with (real) emacs and SLIME.

Personally I prefer the CCL IDE but it only works on the Mac.

Re: I’ve Consed Every Pair

#204

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…

If I can elaborate just a bit on kazinator's comment: While it's still possible to use cons cells as one's sole data structure in Lisp, no Lisp programmer with any experience does that. Making cons cells faster would be like forcing horses to drink Red Bull so they could pull chariots as fast as cars. It's a solved problem -- just use a car (npi) -- and there's no need to abuse any horses.

Re: I’ve Consed Every Pair

#206
post #203
post #123

I feel like there were other things like this that people like Guy Steele wrote in the heyday of things like this. More serious people with better memories will be able to say.

Guy Steele's "Tree" poem: http://prl.ccs.neu.edu/img/gls-trees-poem-1979.pdf

Thanks! And you reminded me of https://news.ycombinator.com/item?id=10785349

Re: I’ve Consed Every Pair

#207

Earlier quoted context omitted.

Not OP, but Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside. Mutation is common, don’t think Lisp will be a language like Haskell. For resources, I would recommend Practical Common Lisp[0] and PAIP[1]. For some modern development practices, the Common Lisp Cookbook[2] is great. [0]: http://www.gigamonkeys.com/book/ [1]: https://github.com/norvig/paip-lisp [2]…

> Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside. The idea that "functional language" means "purity" is something that was retconned onto functional programming in the 90s decades after Lisp had defined functional programming to mean programming in terms of expressions that produce values. I like the ML/Miranda/Haskell lineage of languages a lot, but it real…

There's no true scotch, man.

Re: I’ve Consed Every Pair

#208

Earlier quoted context omitted.

Nah, most country on the radio just doesn't have the same kinda honesty that Johnny Cash or Willie Nelson had. Nor do they have the kind of intensity that a man like Cash had. It just isn't the same. Fellow metalhead who likes ska, btw.

If you like them, you should also consider Ray Wylie Hubbard. Slightly different style, but in the same vein of truth.

Hey thanks, just googled and found this concert - and yes, it's my thing - https://www.youtube.com/watch?v=y9_xBIuV9nE - wonder why country is not like this... then again even modern metal is not to my liking - so I maybe just old :)

That to be said, recently discovered Ho99o9 and love them.

Re: I’ve Consed Every Pair

#209

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…

I mean, I can tell you right now why I'm not using it circa 2020, nor do I expect I shall in future. For sure, it's clever and it's elegant, a brilliant hack - but it's not durable , and in my line of work that counts for more. On the one hand, as you note, this can't scale horizontally without the load balancer knowing where to route a request based on the fnid, which means my load balancer now has to know things it…

The vast majority of websites don't need to scale beyond what a single computer can do, especially with an efficient runtime. You're right that if you're building Wikipedia or Amazon you need to scale horizontally. But most sites aren't Wikipedia or Amazon.

It's true that JS systems like Node aren't really designed for this kind of thing, although they could have been. Arc is.

Post reply on HN