News for hackers. Stuff that matters.

harryposner

Re:Tether: iMessage, SMS, etc. on Linux on Saturday August 29, 2026 @03:01PM (#49492374)
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...

Re:Lisp's Influence on Ruby on Sunday June 14, 2026 @05:38PM (#48533060)
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

Re:What Does "With Continuation" Mean? on Friday February 09, 2024 @10:55AM (#39316088)
> 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

Re:What Does "With Continuation" Mean? on Friday February 09, 2024 @10:51AM (#39316024)
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
Re:The way airlines are central banks on Monday July 31, 2023 @02:50PM (#36947144)
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...

Re:Inflation Is Falling Much Faster Than Most People Know on Saturday December 24, 2022 @02:28PM (#34120244)
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

Re:Helix: A Neovim inspired editor, written in Rust on Monday October 10, 2022 @11:41AM (#33152812)
> 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/

Re:Show HN: Lisp with GC in 436 Bytes on Monday December 20, 2021 @11:56PM (#29634046)
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...

Re:The Recurse of Factorial on Wednesday September 08, 2021 @11:58AM (#28458963)
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.
Re:Writing Small CLI Programs in Common Lisp on Thursday March 18, 2021 @10:35AM (#26503131)

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

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

  user=> (nth '(3 . 4) 2)
  4
Re:The auction that set off the race for AI supremacy on Tuesday March 16, 2021 @10:02PM (#26485647)
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

Re:Why did I leave Google or, why did I stay so long? on Wednesday February 17, 2021 @11:23AM (#26168140)
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.
Re:The neural network of the Stockfish chess engine on Wednesday January 13, 2021 @11:27AM (#25764192)
> 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

Re:R adds native pipe and lambda syntax on Saturday December 05, 2020 @11:14PM (#25320973)
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...

Re:Chess tactics explained on Monday November 30, 2020 @10:31AM (#25254760)
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

Re:The Nobel Prize in Physics 2020 on Tuesday October 06, 2020 @10:20AM (#24697894)
A Nobel Prize is about a million dollars cash.
Re:Ideas That Changed My Life on Sunday June 07, 2020 @09:49PM (#23452803)
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/

Re:Lisp Programming in Vim with Slimv or Vlime on Sunday December 08, 2019 @11:04AM (#21736531)
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.
Re:An Antique Toaster That's Better Than Today’s [video] on Saturday October 05, 2019 @11:19AM (#21165990)
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.
Re:The Shield of Achilles (1952) on Saturday May 25, 2019 @10:55AM (#20009389)
For comparison, the relevant excerpt from the Iliad (Fagles translation): https://home.ubalt.edu/ntygfit/ai_01_pursuing_fame/ai_01_tel...
Re:How do we know when we’ve fallen in love? (2016) on Sunday April 28, 2019 @10:49AM (#19771372)
> 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...

Re:Sci-Hub and Alexandra Basic Information on Wednesday April 03, 2019 @09:03AM (#19562934)
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

Re:I Win My European Unemployment Bet on Friday March 08, 2019 @02:15PM (#19341099)
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