I was looking at this benchmark: https://github.com/frol/completely-unscientific-benchmarks/blob/master/nim/main_manual.nim#L21

what is the "create" being used on line 21? to me, it looks like a keyword to allocate the memory for an object, because I don't see a create proc defined anywhere or imported.

2018-05-15 21:14:10

It's in the system module so it doesn't have to be imported.


It's basically the equivalent of new but returns a ptr (manual memory management) instead of ref (GC'ed), and hence needs to be explicitly freed.

2018-05-16 00:11:19