5,995 karma · joined February 13, 2017
Plus it forces you out of whatever lazy/streaming paradigm you had going on. If your foldr produces a list, downstream can start consuming it in constant memory as long as you let it do its thing.
As soon as you consider retrying a network failure, you immediately need to start thinking about distributed systems failures, idempotency, and all that good stuff.
As soon as you start thinking about the above, it becomes immediately obvious that low-level calls should not be able to decide to re-run themselves.
You might be reading too much into the union example. The checker just doesn't know if the middle block ran, so maybe it remained an int, or maybe it became a string.
You could parse a source language with shadowed variables into an AST, and then one of your earliest AST transforms could be a 'de-shadowing' pass. The resulting AST would only see variables assigned only once.
Then a type-inference pass, where your AST expressions would gain type info.
(Then a bunch more passes, e.g. closure conversion if you have them)
Then towards the end you could lower your typed AST into a typed instruction list (having the SSA property - but nothing to do with allowing variables and their types to shadow earlier in the pipeline)
I was trying to see what was special about Crystal in this regard.
It seems like if you took any ML or Haskell-like, you'd have type inference.
Then you could allow shadowing (Rust-style) meaning the same symbol in the source code would be one variable now, and a different variable later.
Then your compiler would need to distinguish x into x1 and x2 so it could track them separately.
So yeah, kind of an SSA I guess!
Type inference/checking happens early in the pipeline.
SSA is a way of laying out assembly instructions for an abstract machine. I say abstract because real machines re-assign values to the same addresses over time (which is precisely what 'single' static assignment prescribes against). Once you know which registers your real machine has (and instructions), you could take your SSA and turn it into real assembly.
Also, "single-pass SSA"? Not to be too pedantic, but SSA is the destination, not the journey. You could take a single pass to transform from some expressions or statements into SSA, or perhaps from SSA into something else. What's the paper?
https://www.aljazeera.com/news/2026/1/13/a-timeline-of-crise...
It doesn't look like foreign conquest is part of their MO.
> GitHub has done too many great things over the years, so I hope it remains, but there is obviously an earthquake going on.
Is the 'earthquake' referring to the frequent outages over the last couple of years, and if so are those outages because Microsoft can't keep up with the demand?
It's closer to 'too relevant' than it is to 'no longer relevant'.
https://www.cs.columbia.edu/~sedwards/classes/2021/4115-fall...
https://github.com/kkysen/cstar
And to sibling comments: I care. Non-mainstream languages are talking points. I don't want to get 15 minutes into a "you should have effects like Koka" argument and then find out the other person is talking about a different Koka.
I have a type capable of some behavior, e.g ToString. I also want to write general code operating on such objects (highlighting, obfuscating passwords, escaping, etc.).
But I have zero desire to throw away its static type information. If it gets stored in an Escaped<T>, the compiler ought to know T is still my type.
If for some reason your services can't speak an already common language, I think it's on you to add those shims into your own project.
It doesn't show how to place, cancel, or execute an order.
It's even worse than just leaving this core functionality as an exercise for the reader. Because the first thing the reader would do is try to track the null/non-null orders, which the article says not to do.
Maybe maintaining an array of NULL-orders satisfies the letter of the "no dynamic allocation" law, but I'm not convinced it satisfies the spirit.
Haven't you just written a buffer of NULL-orders, which you proceed to loan out to callers (i.e. "allocate" and "reallocate"?).
Someone else's battle-hardened allocator might be slow or buggy, so you write your own as part of the business logic implementation?
The "behaviours" being modelled here were data access. Writing .name() instead of .name.
You can save yourself the time of manually packing these structs by writing out a constructor in full. Which the article called "automatic".
(You don't even need to write out the constructor for a struct in C99. Probably any other modern language too)