3 ms·
The comparison of Nim to Ada seems appropriate. I've never used Ada but wrote a paper on it in school and found the concepts intruiging. Pretty interesting that
by elcritch 5y ago
The comparison of Nim to Ada seems appropriate. I've never used Ada but wrote a paper on it in school and found the concepts intruiging. Pretty interesting that a design by committee language had such rich integer types.
Nim looks like Python but really it reminds me more of a nicer looking Pascal. It's been great having ranged integers in Nim, especially when doing embedded work, without having the verbosity of Ada.
- nine_k 5y agoSimple Pascal is capable of having different integer types that do not mix, or have controlled ranges, etc. To compare with Ada, I'd like to see Controlled and Limited types :)
- elcritch 5y agoAh I didn’t recal ranged types in pascal. Granted my pascal experience was back in high school. I’m not too familiar with controlled or limited types, but it seems the primary goal is control of resources. Nim’s compiler includes copy, sink, and destroy procedures for types [1]. The new ARC GC is deterministic, so you can ensure that once an object leaves the current scope it’s destructor will be invoked. It’s handy to cleanup C structs that are manually allocated by wrapping them in a Nim type. Makes C apis so much safer to use with minimal extra overhead. 1: https://nim-lang.org/docs/destructors.html https://nim-lang.org/docs/destructors.html