3 ms·
Could you explain the annotations? I feel like there might be something interesting here, but I can’t read your notation.
by Filligree 3y ago
Could you explain the annotations? I feel like there might be something interesting here, but I can’t read your notation.
- mjburgess 3y ago`tidy` is similar to python context managers, or an automatic `defer`. So any resources within the function have their `.close`s run. `heap` is a semantics of `new`: allocate to the global heap `temp` likewise means allocate to a smaller temporary arena `pure` means no allocations and no resources $vars are compile-time where $lowercase are integers, $UPPERCASE are types. The type int*10 is a static array, so $T*$i is a compile-time variable but run-time static array. The `api` keyword is for interface types, it's a syntax transform to a compile-time variable, ie., `fn($T) generic(x: $T)` with a compile-time constraint on $T