News for hackers. Stuff that matters.
Re:Single-Assignment C by Animats on Thursday December 26, 2019 @09:01PM (#21888515)
That's what I thought, too.

There's a lot to be said for real single-assignment programming. It provides many of the advantages of functional programming. The code is more readable, because the intermediate variables have names. When you need to do something imperative, you don't have to jump through hoops to do it. Go and Rust both encourage that style - the default is to create a new variable, not assign to an old one. (The semantics of multiple := assignment in Go, where some variables are assigned and others are created, though...)

One of the historical headaches of C is that function parameters are non-const by-value by default. That's backwards. The default should be const ref. If you need a local mutable copy, or the parameter is an "in-out", as Ada calls it, you should have to specify that. Those are the less likely cases and the ones that cause trouble if missed. Passing small const ref values by value is a compiler optimization; the programmer shouldn't have to worry about it, especially since whether it's a win varies with the target machine.

The language in the article seems more like a variant of Matlab, not C.

Re:Single-Assignment C by wirrbel on Friday December 27, 2019 @08:32AM (#21891216)
Single assignment style has structural similarities to continuation-passing style in FP iirc.
Re:Single-Assignment C by johnthescott on Saturday December 28, 2019 @11:06AM (#21899550)
i recall a micro language built around the infamous brainfuck that has a non destructive read for function arguments. seems like a bigger concept exists. let the caller determine what the called can modify.