News for hackers. Stuff that matters.

skrishnamurthi

Re:Your Inbox Is a Bandit on Wednesday December 24, 2025 @04:41PM (#46379557)
Proof-of-work was originally proposed precisely for email (specifically spam), by Dwork and Naor back in 1993!

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

Re:Your Inbox Is a Bandit on Wednesday December 24, 2025 @04:37PM (#46379520)
Author here. That's not true.

GTD asks you to figure out now the action for each thing, think about how long that will take, figure out if it will take more than 2 (or N) minutes, and if ≤ that, do it now. The "do it now"s can add up to a lot of time and distraction. DBTC is the sorting step but without the "figure out the action" step or (most critically) the "do it now" step. And there's no reflection step, either.

So it's not "literally reinvented", not even "almost".

Re:Your Inbox Is a Bandit on Wednesday December 24, 2025 @04:33PM (#46379474)
I'm the author of the original article, I'm a tenured professor, and none of these things is optional for me. Indeed, I wrote this article several years into being a full professor, because my obligations had only grown, not reduced, by virtue of all the promotions. Of course different people have different senses of how "obliged" they are or should be.
Re:Anonymous Recursive Functions in Racket on Monday September 08, 2025 @10:42AM (#45168937)
Ah, I didn't know there was a HOPL paper! Some day I will have time to run a course reading HOPL papers. Some day I will have the time to read HOPL papers myself (-:. Thanks for the pointer.
Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @04:47PM (#45161973)
Thanks for the pointers. Trampolining is an old idea for obtaining tail-calls. It's a kind of folk-wisdom that has been rediscovered many times, as the related work here shows:

https://dl.acm.org/doi/pdf/10.1145/317636.317779

Usually the trampoline is implemented automatically by the language rather than forcing the author to confront it, though I can see why Clojure might have chosen to put the burden on the user.

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @03:37PM (#45161445)
It's not the same thing. `recur` in Clojure must be in tail-position. This program

https://news.ycombinator.com/item?id=45154253

would therefore not work.

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @03:33PM (#45161417)
Tails calls are especially useful in languages with macros. You don't know what context you are in, you just generate the call that makes sense. If the call happens to be in tail-position, you get the benefit of it.

Moreover, you can design cooperating macros that induce and take advantage of tail-position calls.

Here's a simple example that motivates tail-calls that are not tail-recursive:

https://cs.brown.edu/~sk/Publications/Papers/Published/sk-au...

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @11:43AM (#45159172)
Thanks for the suggestion to replace the reference to MzLib with SRFI-31. I've done that now.

https://github.com/shriram/anonymous-recursive-function/comm...

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @11:09AM (#45158858)
The correlation is likely causal in both directions.

They're niche because they're doing weird, interesting things. Like creating their own VMs to support funky features. So nobody wants to depend on them: low bus-factor.

They can do weird, interesting things because they don't have a large user-base that will yell at them about how they're breaking prod.

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @10:52AM (#45158685)
Aaah, thanks Neil!
Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @10:51AM (#45158679)
This isn't the Y-combinator.
Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @10:49AM (#45158655)
1. This isn't the same. `rec` names the function. This does not name the function. The point is to illustrate how the name-capture works.

2. The README literally says "Don't Use This Macro!" and references `rec` to use instead:

https://github.com/shriram/anonymous-recursive-function?tab=...

Re:Anonymous Recursive Functions in Racket on Sunday September 07, 2025 @10:43AM (#45158598)
Neat! Will see if I can make it (though I'll probably have to be dealing with OOPSLA stuff at the same time )-:).
Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:46PM (#45154273)
These are great questions!

Yes, what you're describing is the "extreme" version of LOP. Of course you don't have to do it that aggressively to get working code.

Two references I like to point to:

https://www.hashcollision.org/brainfudge/

https://beautifulracket.com/

They will give you a sense of how one uses LOP productively.

You do not need to write a "web server language"! To the contrary, the Web server provides several languages to give you a trade-off between ease and power in writing server-side Web applications. So you can just write regular Racket code and serve it through the server. The server also comes with some really neat, powerful primitives (orthogonal to LOP) — like `send/suspend` — that make it much easier to write server-based code.

Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:42PM (#45154253)
This isn't meant to be a good programming mechanism, it's meant to be an illustration of how to use the macro system.

But also, if you're processing non-linear data, you're going to want to do with a recursive function anyway. E.g., when dealing with a tree. Code below; can't seem to get multi-line code-formatting so it looks hideous:

#lang racket

(require "anon-rec.rkt") (require rackunit)

(struct mt ()) (struct node (v l r))

(define sum-tree (lam/anon (t) (cond [(mt? t) 0] [(node? t) (+ (node-v t) ($MyInvocation (node-l t)) ($MyInvocation (node-r t)))])))

(define t (node 5 (node 3 (mt) (mt)) (node 7 (node 9 (mt) (mt)) (mt))))

(check-equal? (sum-tree t) 24)

Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:36PM (#45154218)
Wow — scheme-rs is such a neat project! Hadn't heard of it before!
Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:22PM (#45154128)
Racket is a rich and powerful language, but it is also designed with certain specific ideas in mind. You can learn more about the "zen" of Racket here:

https://cs.brown.edu/~sk/Publications/Papers/Published/fffkb...

That might help you decide whether Racket will help you with what you're trying to brush up on.

Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:17PM (#45154100)
Don't see Y-combinator mentioned anywhere on that page.
Re:Anonymous Recursive Functions in Racket on Saturday September 06, 2025 @08:17PM (#45154096)
If it helps, you will find the Y-combinator described (indeed, derived) in the first edition (https://cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-0...) of the author's programming languages book (https://www.plai.org/). (Page 228, if that helps, though the derivation begins on page 223.)

For added fun, the day he teaches it in class, he wears a t-shirt from Y-combinator the startup accelerator (and explains what its name means).

Now that we've gotten that out of the way, it remains unclear what is surprising or unpleasantly surprising about the code.

Re:C++ to Rust Phrasebook on Saturday May 31, 2025 @07:28AM (#44143533)
It's definitely written from the perspective of someone who "knows C++". But I put that in quotes because there are (at least) two interpretations of that phrase. There's the person who doesn't know any C++ at all, and for that person, this is useless. But there's the person who knows a baseline of C++ but doesn't know modern C++, and they can use this as a way to modernize their C++ code while ignoring the Rust bits. But either way, yes, it doesn't warn you about C++ footguns (other than pointing you towards Rust <-;).
Re:Systems Correctness Practices at Amazon Web Services on Saturday May 31, 2025 @07:09AM (#44143464)
There are two DIFFERENT gaps here. You're talking about the gap where what you have verified is a model, and the actual code and the model may diverge. But there is another, subtler gap: how good are you at coming up with properties? Because your verification is only as good as the properties you come up with, and the average programmer is not great at coming up with properties. (Before people attack me, I should make clear I've been working in formal methods for 3 decades now.)
Re:Bicameral, Not Homoiconic on Monday December 02, 2024 @11:25AM (#42297707)
No, this isn't what the article says. I have not bothered saying anything about the "semantic pass", which is downstream from getting an AST. What the article talks about is not what "ancient IBM FORTRAN compilers" did.
Re:Bicameral, Not Homoiconic on Monday December 02, 2024 @11:24AM (#42297692)
Author here. Yes, very close. #4 is not a bit strong: there is value to doing this even if you don't have macros, for instance, because of other benefits (e.g., decent support from editors). But of course it also makes macros relatively easy and very powerful.
Re:You too can write a book on Sunday November 10, 2024 @10:25PM (#42104380)
Most of these reasons appear to be tied to commercial publishers. But there is no need to involve a commercial publisher.
Re:You too can write a book on Sunday November 10, 2024 @09:47AM (#42100520)
It has indeed been used by many people to re-appropriate/confuse/normalize. But none of that was the intent here — sometimes a parenthesis is just a … parenthesis, especially since there's no name inside the parens. But this isn't the kind of thing one usefully "discusses"; given that I am indeed not trying to send any messages, I've changed the logo.
Re:You too can write a book on Sunday November 10, 2024 @09:41AM (#42100498)
That was (obviously) not the intent; it had never occurred to me that it could be read that way, since the bits inside the parentheses are not a proper name. But, to avoid any doubts, I have modified the masthead image to get rid of two pairs of parens.
Re:You too can write a book on Sunday November 10, 2024 @09:41AM (#42100495)
Thanks for the PS. That was (obvioulsy) not the intent; it had never occurred to me that it could be read that way, since the bits inside the parentheses are not a proper name. But, to avoid any doubts, I have modified the masthead image to get rid of two pairs of parens.

And yes, that same person.

Re:You too can write a book on Sunday November 10, 2024 @09:16AM (#42100334)
For people missing the point: The person who made the above remark is the author.
Re:You too can write a book on Saturday November 09, 2024 @07:31PM (#42097794)
That would be nice. Problem is rather more simple: the author can't proof-read.
You are not at all alone in having this confusion. In fact, you are farther along than many learners in having gotten this far and being able to articulate your confusion so clearly.

The problem is with the statement `return a`. It should be read not as it's written, but rather as `return the value of a`. Once you realize that, much of your confusion will be resolved.

Over the past several years, my research group has studied and documented these kinds of programming misconceptions. We have abstracted them into a set of key issues we find people getting confused about in the basics of programming semantics that cut across languages like Python, JavaScript, OCaml, Racket, etc. — what I call "SMoL", the Standard Model of Languages.

My PhD student Kuang-Chen Lu has created an excellent SMoL Tutor that is a self-guided tool for learning these concepts clearly and addressing misconceptions. Please go to https://www.plai.org/ and pick either of the version 3.2.2 books, and in there go to page number 14/PDF page 15, "Teach Yourself SMoL". It provides links to all the tutors in order. Based on past student experience, you will need about 20 minutes per module. That's why they are broken down into several modules; so each one is relatively quick and you don't have to spend hours at one sitting.

We welcome feedback on the Tutor after people have done it.

Older »