top | item 42388387

(no title)

raoulj | 1 year 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...

discuss

order

fuhsnn|1 year ago

Looks like this is implemented with LLVM's builtin matrix type, also available as a Clang extension: https://clang.llvm.org/docs/MatrixTypes.html

gingerBill|1 year ago

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.

amjoshuamichael|1 year ago

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.