4 ms·
I wonder if they could have used Smallvec, it sounds like the best of both worlds for performance: stack allocated up to a size. Off-topic but the JVM will be
by The_rationalist 6y ago
I wonder if they could have used Smallvec, it sounds like the best of both worlds for performance: stack allocated up to a size.
Off-topic but the JVM will be the second platform to get const generics support ->
https://www.reddit.com/r/java/comments/m2dfb5/parametric_jvm_pdf_how_generic_specialization/ https://www.reddit.com/r/java/comments/m2dfb5/parametric_jvm...
Are there other languages than rust that supports it?
- nsajko 6y ago> Are there other languages than rust that supports it? I'm no expert on the terminology, but C++ templates can take values as template arguments (I think this is what is called "const generics" in Rust), and languages such as Julia are even more powerful.
- mhh__ 6y agoUnless you mean strictly generics, D has had the ability to do this and a lot more (e.g. accept user defined types as parameters) since at least 2014 or so
- fish45 6y ago> Are there other languages than rust that supports it? Const generics are essentially a really small subset of fully dependent types, which are implemented in Idris 2 and other research languages.
- lenkite 6y agoC++ has supported non-type template parameters for a very long time now. Since C++ 20, it also supports class literals to be used as non-type template parameters