BASIC and mathematical extensions
Steve Drain (222) 1620 posts |
Following on here from Gavin’s post in the ‘FP support’ topic:
That goes for many other operations, too. One keyword can encompass a lot of very efficent processing, as long as it does just what you want. It is one of the motivations behind Basalt.
I cannot comment on your particular selection, but I have played around with some matrix operation code and its implementation from Basalt, but it has a low priority.
I think I have a copy of MATROM somewhere, but I never really got very far with it then. I do remember my first a acquaintance with a micro, an HP that had extensive matrix operations. The ARM BASIC has a few useful array operations, and I have done some interesting matrix/vector programming with it. My aim would be to get efficient determinant and inverse operations first. Transpose is trivial.
Basalt offers hyperbolic functions and their inverses; ATN2 (arctan2); factorials, permutations and combinations. Other suggestions are always welcome. For the Float module I have had a great time researching and implementing Chebeshev polynomials, but that is rather specialist. ;-)
Not I. ;-) |
GavinWraith (26) 1563 posts |
Thanks Steve. It did need a separate topic. I guess one suggestion for an extended BASIC at the back of my mind was that it could learn from Lua about organizing extensions by libraries (each with its own namespace) and from MatLab about providing compiled libraries of high level mathematical functions. I am not suggesting that BASIC should be reinventing wheels, but I think these maths packages have lots of good stuff in them (though I hate the way that MatLab conflates names of functions with names of the files that hold their implementation). Anything that calculates things also needs to display its results. In MatLab you can display results in a separate window with a single command. BASIC also needs such higher level display facilities IMHO. Joe Taylor’s DrawBasic was striking out in those directions. |
Steve Drain (222) 1620 posts |
I think MatLab is aiming rather high.;-) Extending BASIC with libraries has also been suggested by David F, but I have not been able to see how it could be done, even in Basalt. I do understand how valuable it could be. BASIC is over 25 years old and its code is not organsed for extensions. ;-(
In my mind that would be through the Toolbox.
I have made my own DrawIt library, principally to get to grips with Draw. I keep returning to the problem of incorporating Draw into Basalt, but I have not got any further than some specifications. |
jim lesurf (2082) 1438 posts |
No idea if it is of any use/relevance, but the source code for my !DrawGen is ABC Basic. Wrote it decades ago, so I’ve long since forgotten all the details, but should have the source code. Jim |
Steve Drain (222) 1620 posts |
Thanks, Jim I looked at DrawGen as well as DrawBasic and others, but my motivation was to understand, not find a suitable tool. I wanted to take the watch apart, not tell the time. ;-) |