Or even better, `map[string][]map[string]int`. In typescript that would be `Record[]>`

Reply to this note

Please Login to reply.

Discussion

No. Rust is better

rust is just C++ with a better build system than Cmake and an extra, super complicated syntax for memory management

isn't it?

There is not syntax for memory management. Memory is managed by the types themselves, in "unsafe" code, that is allowed to do pointer stuff. A String handles the heap allocations and frees in the drop method/destructor. Memory is no different to other resources, a File closes the file in it's drop method, a mutex guard unlocks in it's drop method, etc.

A term I've heard, that stuck with me, was it's type system is "pragmatic", because of the fact, that there is no syntax for memory management. If you need to manage memory, then it is a low level task, just the same as reading some CPU registers.

How could a type system not just infer what the type is…

Because you still need to name the type sometimes.

I'm using the long form for arrays in TS, because of same argument you're making. `Array` instead of `number[]`

Or even more apparent for complex types like your example: `Record>>` instead of `Record[]>`