4 ms·
You can already write programs in this style in Ruby quite successfully, but there are advantages to having it baked into the language. It forces consistency an
by DanWaterworth 11y ago
You can already write programs in this style in Ruby quite successfully, but there are advantages to having it baked into the language. It forces consistency and also opens up opportunities for tooling.
Unfortunately, I don't think it's something that can be bolted on after the fact.
- danmaz74 11y agoYes the checks were exactly what I was thinking about; that way you can be sure that you don't inadvertently do mistakes there. But probably Ruby (or javascript), with their ability of monkey patching, would make that almost impossible. Maybe some Javascript "transpiler" could do it... it would be really interesting.
- DanWaterworth 11y agoIt's not just monkey patching that causes problems, though it certainly doesn't help. The advantage of going with some sort of transpiler is that you can have two kinds of code within the same process whilst you make a gradual transition. I feel like, it could be made to work, but the boundary would have to be quite heavy-weight. Think less gradual typing and more FFI. Edit: actually, in depends on which side is doing the calling. Going from checked to unchecked code is a minefield, but if it's unchecked code calling into checked code, it could work quite well as long as the arguments are immutable and don't have methods that can do IO.