5 ms·
As someone who has been studying type theory and developing strongly typed programming languages, that is a very strange take to me. It isn't untyped, it has a
by LightMachine 3y ago
As someone who has been studying type theory and developing strongly typed programming languages, that is a very strange take to me. It isn't untyped, it has a type: the GeometricAlgebra type, which just happens to have a very rich structure. Complaining about that is like complaining that Int isn't split into two types because it has negative and positive values. That makes no sense at all.
- chpatrick 3y agoThe fact is thay in real world linear algebra code there are distinct mathematical objects that you do want to keep separate and not mix up. It's already too easy to add the wrong vectors or forget to invert something without also making it possible to do nonsense operations. That being said I can't see why you can't make newtypes over the one geometric algebra type. But at that point, what's the advantage over plain old vectors and matrices?
- Nevermark 3y ago1) Sub-typing a clean general type for all kinds of special purposes. vs. 2) Having to create or acquire lots of separate types for all the specialized types you (or others) need, along with all their operations, probably in inconsistent ways, and leaving potential types missing, including not having the general type. Also, the separate type path does not help you cognitively understand the real relationships between the separately crafted types. A really easy example is the convenience of having a big (unlimited size) integer type that can be parameterized to any size subtype you want. You get all the arithmetic operations across all those fixed sizes for free, because those algorithms are just easily auto optimized versions of the general operations. A good system could even auto optimize for an operation that took two integers of different fixed sizes. Clean concrete closed general types are the powerhouse wonders of the mathematical world. They are just as great for algorithm use. As long as you can subtype.
- chpatrick 3y agoI can certainly see the mathematical appeal but as an end user I'm still not convinced. If you're still dealing with rotations, points lines etc as subtypes, do you care whether they're all implemented internally the same way or as they are now with vectors quaternions matrices etc? Is geometric algebra even more efficient than these or is it purely aesthetic? What I'm saying is, if my code is strongly typed and deals with these various geometric objects, what benefit do I get if they're internally implemented with geometric algebra as opposed to how they are now?
- Nevermark 3y agoIf you have the general form, and subtyping, then you have everything in a simpler interface. And you get all the subtype to subtype operations for free, bug free, since they are all just subtype operations themselves. If you haven’t played around with geometric algebra, you should try it. It is consistent across any. N dimensions. And when you are using it in an application, it’s easier to see why things are related the way they are. You have fewer equations.
- chpatrick 3y agoOK but I already have the subtype to subtype operations available bug-free today. Why do I care if they're implemented in geometric algebra or not, especially if it's less efficient?
- Nevermark 3y agoIf you have what you need, then you have what you need. If you were starting greenfield, geometric algebra probably simplifies more than you would guess, and represents more. When anything gets simpler, more consistent, and more powerful, most of us start having ideas that would never have occurred to us before. Same story as any other significant language and/or notation improvements. It is a mystery to me why it has taken so long to catch on and replace disparate less capable notations. Inertia I guess. Hard to change geometry across education all at once, but piecemeal would be very messy. I don’t know any reason it would be less efficient.
- nextaccountic 3y agoUntyped in this case means unityped, that is, everything has a single type! The purpose of static types is to catch type errors at compile time. If everything has a single type and all operations receive and return objects of this type, no type error is caught at compile time. Other people mentioned that you can, indeed, implement geometric algebra operations with a family of types (for example, a type for lines, a type for planes, etc) rather than having a single type. And thus, operations like adding a scalar to a <something> return a type that isn't neither scalar nor <something>. Which will lead to a type error somewhere, hopefully!