5 ms·
One thing I particularly like about Lobster is its memory management. It uses rust-like borrowing rules automatically under the hood to make one of the fastest
by verdagon 4y ago
One thing I particularly like about Lobster is its memory management. It uses rust-like borrowing rules automatically under the hood to make one of the fastest RC implementations ever seen.
I think this is the direction languages should head in: embrace shared mutability for the flexibility benefits, and blend it with borrow checking for the speed benefits.
- beagle3 4y agoThis is what modern (arc/orc) Nim versions do as well.
- IshKebab 4y agoVale and Koka do the same thing as far as I understand it. I think Koka looks the most interesting of the three - its effects system seems like it lets you have purity without the annoying "can't I just add a liiiittle printf debugging here without rewriting my entire program?"
- cb321 4y agoIt may be only "little" not "liiiittle" :-), but Nim lets you explicitly bypass the effects system locally for cases like this: {.cast(noSideEffect).}: echo "GOT TO THIS LOGIC with a=", a
- renox 4y agoSerious question which language doesn't have this 'escape hatch'? AFAIK even Haskell has unsafePerformIO to allow this..
- wk_end 4y agoMost languages don't encode purity in the type system, so they don't need an "escape hatch" - there's nothing to escape from. Unlike `unsafePerformIO`, Koka's approach isn't really an "escape hatch" - effects are a safe, principled part of the language. And, if I understand them correctly, even though they're more ergonomic than monads, they also come with friction of their own (maybe needless to say, otherwise they couldn't be enforcing anything) - adding logging to a function will add the `console` effect to the function's type, which bubbles up to callers and might cause issues if any callers are declared as `total` (and indeed, that's the default for function type annotations). But at least, unlike Haskell, you wouldn't need to add `return` and `lift`s everywhere to fix things; and the changes you'll need to make to your signatures are usually quite a bit more straightforward I think.