HNHacker News
TopNewBestAskShowJobs

harryposner

72 karma · joined February 20, 2019

submissionscomments
harryposner··on Tether: iMessage, SMS, etc. on Linux
The linked blueferry doc is excellent. Back in 2020, inspired by a comment on HN, I looked into writing a proxy to send and receive iMessages on Linux through an iPhone connected with Bluetooth Message Access Profile (MAP). I was able to send and receive messages, but I ran into the problem mentioned in the doc in the "Group metadata side channel" section: the bMessages in the inbox included the message originator, but didn't include the recipients, even though the MAP standard says that it "shall" be included (see page 22). I didn't know about ANCS, so it didn't occur to me to use that channel, and without any way to tell what context a message was sent in, I couldn't do threading, so I decided it wasn't worth pursuing.

The group messages were the biggest problem, and that's what made me give up, but there were some other issues:

- Shared links showed up as "Website: Short description (example.com)" and didn't include the URL

- Images weren't shown at all

I might take a look and see how blueferry handled those limitations.

[blueferry doc] https://github.com/erikwb/blueferry/blob/main/PROTOCOL.md

[inspiration] https://news.ycombinator.com/item?id=23411520#23413394

[Bluetooth MAP standard] https://www.bluetooth.com/specifications/specs/message-acces...

harryposner··on Lisp's Influence on Ruby
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

harryposner··on What Does "With Continuation" Mean? (2020)
> This would imply that you can jump into the same stack frame multiple times, or do other weird things.

Yep— this is how you can implement the `amb` operator with call/cc: https://ds26gte.github.io/tyscheme/index-Z-H-16.html

harryposner··on What Does "With Continuation" Mean? (2020)
So the particular example here isn’t too different from exceptions. You’re unwinding the stack up to a predefined point— here, the callsite of foo, where with exceptions it would be up to the surrounding try/catch. Scala actually implements non-local returns (the only practical use I’ve had for call/cc) using exceptions: https://tpolecat.github.io/2014/05/09/return.html
harryposner··on Airlines are a lot like central banks (2020)
You joke, and yet [Lucas 1988] uses an amusement park as a toy model to demonstrate how monetary shocks can affect real economic activity. The key difference between this and Chuck E. Cheese, though, is that Chuck E. Cheese is the only merchant that accepts their tokens for any sort of payment.

[Lucas 1988] https://home.uchicago.edu/~vlima/courses/econ203/fall01/Luca...

harryposner··on Inflation is falling much faster than most people know
They do not exclude gas prices. The Consumer Price Index, which is what most people pay attention to and to which this article refers, currently weights gasoline at 3.7% of the basket of goods it tracks.

https://www.bls.gov/cpi/tables/relative-importance/2021.htm

harryposner··on Helix: A Neovim inspired editor, written in Rust
> 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/

harryposner··on Show HN: Lisp with GC in 436 Bytes
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...

harryposner··on The Recurse of Factorial
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.
harryposner··on Writing Small CLI Programs in Common Lisp

  user=> (rest '(3 . 4))
  (. 4)

  user=> (second '(3 . 4))
  .

  user=> (nth '(3 . 4) 2)
  4
harryposner··on The auction that set off the race for AI supremacy
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

harryposner··on Why did I leave Google or, why did I stay so long?
I didn’t read it as firing old people, but rather firing people for the plain old reason that they’re not doing a good job.
harryposner··on The neural network of the Stockfish chess engine
> there's no, say, "fivefold repetition" draw that could be enforced despite the players' will

There is exactly such a rule. See the FIDE Laws of Chess [0], rule 9.6.1.

[0] https://handbook.fide.com/chapter/E012018

harryposner··on R adds native pipe and lambda syntax
Pandas does have the .pipe() method [0], which allows you to put an arbitrary callable in a method chain, but it is a bit more cumbersome than in R.

[0] https://pandas.pydata.org/pandas-docs/stable/reference/api/p...

harryposner··on Chess tactics explained
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

harryposner··on The Nobel Prize in Physics 2020
A Nobel Prize is about a million dollars cash.
harryposner··on Ideas That Changed My Life
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/

harryposner··on Lisp Programming in Vim with Slimv or Vlime
A slight correction: C-x C-e and fc open $EDITOR, which is vim by default on most machines. You can change it to anything, though.
harryposner··on An Antique Toaster That's Better Than Today’s [video]
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.
harryposner··on The Shield of Achilles (1952)
For comparison, the relevant excerpt from the Iliad (Fagles translation): https://home.ubalt.edu/ntygfit/ai_01_pursuing_fame/ai_01_tel...
harryposner··on How do we know when we’ve fallen in love? (2016)
> 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...

harryposner··on Sci-Hub and Alexandra Basic Information
I've used Ghostscript to shrink scanned PDFs for emailing, although I don't know how lossy the compression is.

[0] https://askubuntu.com/a/256449

harryposner··on I Win My European Unemployment Bet
Prisoners aren't counted at all---not even as "not in the labor force" [0]. The employment statistics are based on the civilian non-institutional population, and prisoners are institutionalized.

[0] https://www.bls.gov/cps/cps_htgm.htm#concepts