Hacker News new | ask | show | jobs
by raoulj 556 days ago
Flipped through the language overview on the website and noticed that matrices are limited in how large they can be because they're stack allocated [1]. Ergonomics of the language otherwise look solid but for my use case that would be fairly constraining

[1] https://odin-lang.org/docs/overview/#technical-information-o...

2 comments

Looks like this is implemented with LLVM's builtin matrix type, also available as a Clang extension: https://clang.llvm.org/docs/MatrixTypes.html
Actually we implement it manually ourselves the exact same way that the extensions work. This is because we have to support multiple different versions of LLVM which don't have those extensions.
Thanks for clarifying!
Matrices, like any other primitive data type, are stack-allocated. Do you want matrices to be allocated on the heap? If you're looking to do Pandas-style data science, you'd have to write your own implementation, where you could adjust for exactly how you want to do the multiplication. The builtin matrices are typically pretty small (~4x4 or 3x3), a very common use case in graphics or games programming.