HN user

harryposner

66 karma
Posts0
Comments22
View on HN
No posts found.

Clojure has two options:

The version with a threading macro, will create a lazy-sequence for each step in the pipeline. It will not instantiate the entire list, so it's O(1) memory overhead in terms of peak memory, but it churns O(N) extra garbage.

    (->> things
         (map model/find-thing)
         (filter some?))
And the version with transducers, which will not create any intermediate sequences:
    (sequence (comp (map model/find-thing)
                    (filter some?))
              things)
It looks like there's a Common Lisp transducers library, but I have no idea how widely it's used.

https://github.com/fosskers/transducers

But I haven't had a need to add any kind of plugin, and it's easy enough to fork a shell for an external process if needed.

For me, coming from writing Clojure with Neovim + vim-sexp + vim-fireplace, I would need Paredit and REPL integration.

Paredit is doable with Treesitter, and I'm actually really excited about Helix's Treesitter integration--- every time I write a non-Lisp language, I miss structural editing, so it'll be nice for other languages catch up to Lisp on that front. It doesn't really look like it's quite there yet, though. The built-operations that use Treesitter are spare [0], and while you could implement operations like promote, slurp, and barf with them, you'd have to clobber some register. I don't see at all how you could implement splice without an actual language, since you would need a way to select all siblings of the current node.

REPL integration absolutely needs a plugin language. Unlike the LSP, there isn't a standard protocol for communicating with a REPL, so each language requires its own REPL client. Unless they want to ship a REPL client for every language under the sun, they'll have to provide some way for users to implement their own clients. That said, every time I look at Conjure, they've added REPL clients for more and more languages [1], so maybe it is feasible to have it built into the editor.

[0] https://docs.helix-editor.com/keymap.html

[1] https://github.com/Olical/conjure/

From the beginning of SICP [0]:

A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this:

* primitive expressions, which represent the simplest entities the language is concerned with,

* means of combination, by which compound elements are built from simpler ones, and

* means of abstraction, by which compound elements can be named and manipulated as units.

Brainfuck is missing any sort of means of abstraction. The primitives are instructions, and the only means of combination is writing instructions in sequence, but there's no way in the language to refer to any sequence of instructions --- no functions, no subroutines, not even labels. This makes it utterly useless as a way to organize your thoughts on how to compute something.

[0] http://sarabander.github.io/sicp/html/1_002e1.xhtml#g_t1_002...

I’m not familiar with Erlang, but unless it has some really funky syntactic sugar, the Erlang examples aren’t tail-recursive. In all three, the continuation of the recursive call is the multiplication operation and not the conditional.

An ascending price auction is strategically different from a second price auction when the bidders each have a noisy estimate of some underlying true value. With a second price auction, the only information you can incorporate into your bid is your own signal. With an ascending price auction, you can look at the prices at which the other bidders drop out (except the second highest bidder) and incorporate that information into the price at which you're willing to drop out. This also means that an ascending price auction raises more revenue than a second price auction, by the linkage principle.

https://en.wikipedia.org/wiki/Linkage_principle

Lichess’s cheat detection is open source (like everything else on the site) [0]. The training dataset isn’t public, though, and it’s practically undocumented. If you look in the `modules/game` directory, though, you’ll get an idea of what sort of data that goes into the model. Besides the engine analyses, it also looks at the time spent on each move (the `Emt` type is short for elapsed move time).

[0] https://github.com/clarkerubber/irwin

My favorite part of the paper that used field experiments to demonstrate that rice in Hunan is a Giffen good for the poorest consumers [0] is the cheeky inclusion of this quote from George Stigler:

Perhaps as persuasive a proof [of the “Law of Demand”] as is readily summarized is this: if an economist were to demonstrate its failure in a particular market at a particular time, he would be assured of immortality, professionally speaking, and rapid promotion while still alive. Since most economists would not dislike either reward, we may assume that the total absence of exceptions is not from lack of trying to find them.

[0] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2964162/

I don't think he's right that you could implement a bagel mode on that toaster by just running the center heating element. Both heating elements are necessary for the toaster to function (which he mentions!). You need to run the center element to drive the bread lifter, but you also need to run the outer element to heat the side of the bread facing the bimetallic strip. You can't put the bimetallic strip on the center side of the bread, since it needs direct exposure to the heat radiating off the bread, and the coiled center heating element would get in the way.

In Russian, the verb that means discover or recognize also contains the verb to know.

The English very nearly does as well. The "gn" in "recognize" has the same etymological root [1] as the "kn" in "know"---and as the "зн" in "сознать" (recognize) and "знать" (know). It's not quite as obvious as in the Russian, but "acknowledge" means nearly the same thing as "recognize" and includes "know" as a substring.

[1] https://en.wiktionary.org/wiki/Reconstruction:Proto-Indo-Eur...