News for hackers. Stuff that matters.
Re:I'm Betting on Call-by-Push-Value by dmux on Saturday March 09, 2024 @06:52PM (#39655590)
I’m not familiar with the theoretical aspects, but what you’re describing reminds me of Tcl: arguments to procedures can be passed unevaluated (quoted, using Tcl terms) and the procedure itself can alter the caller’s environment via uplevel.
Re:I'm Betting on Call-by-Push-Value by bradrn on Saturday March 09, 2024 @07:13PM (#39655670)
It’s also extremely similar to R and Rebol.

(In fact, R isn’t just ‘extremely similar’: it does use fexprs, though without mentioning the term.)

Re:I'm Betting on Call-by-Push-Value by Tyr42 on Saturday March 09, 2024 @09:30PM (#39656289)
It's what let's the tidy data tools take arguments like .x where x is a column name, not a local varia le that's in scope.
Re:I'm Betting on Call-by-Push-Value by nerdponx on Saturday March 09, 2024 @10:00PM (#39656394)
R is even more wild because you can access the entire definition of a function from the function object itself. You can literally make a new function that's a copy of an existing function with some lines of code injected.
Re:I'm Betting on Call-by-Push-Value by bch on Saturday March 09, 2024 @10:36PM (#39656539)
Re:I'm Betting on Call-by-Push-Value by hobs on Saturday March 09, 2024 @11:40PM (#39656754)
Powershell lets you do this too.
Re:I'm Betting on Call-by-Push-Value by FridgeSeal on Sunday March 10, 2024 @04:09AM (#39657533)
“Wow this is fun and amazingly useful”

8 months later.

“I regret this decision, and a thousand curses on anyone who chooses to use this in a code base I have to work on”

I’ve been at the receiving end of this particular “feature” and it was awful. Your logic is splayed all over the place, and you’ll often get mystery errors, because someone else’s code makes some undocumented, un-typed assumption about the availability of some magically named variables. This is not a feature, this is bugs and misery in disguise.

Re:I'm Betting on Call-by-Push-Value by Certhas on Sunday March 10, 2024 @08:55AM (#39658672)
Isn't that a feature/problem of every dynamic language?
Re:I'm Betting on Call-by-Push-Value by bsder on Sunday March 10, 2024 @01:11AM (#39657077)
In Kernel, the environments are completely reified--they exist as a thing and you can pass them around.

However, if you don't get an environment passed in, you can't get access to it. In addition, the environments in many ways are append-only, you can change what you see as "car" but you can't change what previous callers see as "car" unless you get a handle to their environment but that won't change previous calls.

It's really quite tricky. It's doubly tricky because there are some environment mutations that you need to do as the system that you need to prevent as the user once everything is bootstrapped.

I really wish Shutt had implemented a version in C/C++/Ada/anything systems language and not just a metacircular scheme implementation. The metacircularity obscures the management of the environments that is key to the implementation. It also obscures just how much garbage Kernel cons-es up in order to maintain all of the necessary housekeeping to pass all this stuff around.

Alas, he is no longer with us to request anything of. RIP.