Is this how you do Fin in peasant languages?
No, not at all. It’s a joke post, abusing the in-memory representation of the
Optiontype to construct numbers. When nesting theOptiontype, it turns into a densely packed bit vector…And if I understand the purpose of
Fincorrectly, you’re picking on the one ‘peasant language’ that actually has something like that built-in.
In Rust, you can specify the type of an array as e.g[]. Which is an array containing values of typeu8(unsigned 8-bit integer) with a fixed, compile-time-guaranteed length of3. So,[]could be used to represent an RGB color, for example.
It is an array, not a set, but well, close enough.Finis a type of finite oridinals bounded by a nat. For example theWTFtype in there is the same type asFin 8.Of course every language can have
Finwith a fixed integer, like the post suggest, by just stacking options.However for a properly defined
Fintype, the input number is dynamic, serves as a bound for the element of the type. For example, Adga was able to type the fact thatnth fibonacci number is a finite ordinal bounded by a function ofn. Which I believe is not typable in rust?
If you think that’s good, then you’re gonna love this “simplified” real code posted as a real issue on one of my Github repos.
Edit: updated link to address the stack-trace comment
That’s not actual code though, it looks like some kind of trace. Notice the filenames at the end of each line.
The actual solution the issue opener there might be looking for is to disable C++ parsing, since it’s not actually C++ code, it’s just some text they pasted into VSCode and they’re wondering why their editor can’t handle it.


