←back to thread

389 points kurinikku | 2 comments | | HN request time: 0.415s | source
Show context
emmanueloga_ ◴[] No.42168787[source]
Warning: Diving into SCIP/Lisp/Scheme can transform how you think about programming... food for thought is always welcomed! But applying those ideas wholesale to OOP codebases often backfires or gets pushback from teammates. Languages handle paradigms differently, and going against the grain usually leads to worse code.

Example: After Lisp, you might replace every for loop with forEach or chain everything through map/reduce. But unless you’re working in a language that fully embraces functional programming, this approach can hurt both readability and performance.

At the end of the day, it’s grounding to remember there’s mutable memory and a CPU processing the code. These days, I find data-oriented design and “mechanical sympathy” (aligning code with hardware realities) more practical day-to-day than more abstract concepts like Church numerals.

replies(3): >>42169778 #>>42169977 #>>42170173 #
llm_trw ◴[] No.42169977[source]
>At the end of the day, it’s grounding to remember there’s mutable memory and a CPU processing the code.

And yet goto is even less popular than Lisp despite being the only way that CPUs implement control flow.

What's even more bizarre is that despite caches being the only way to get any performance out of modern CPUs we still don't have a language that treats the memory hierarchy as a first class citizen. The closest is Linux flavored c with a sea of underscores.

replies(2): >>42170094 #>>42177519 #
1. renox ◴[] No.42177519[source]
I don't find it bizarre: even assembly language don't have much control over the memory hierarchy, there's prefetch load and nothing else...
replies(1): >>42179094 #
2. llm_trw ◴[] No.42179094[source]
So much the worse for assembly language.

Lest we forget that modern x86 machine code is an assembly language and the machine code, or microinstructions in newspeak, is completely hidden from view.