Closed Zezombye closed 7 years ago
I doubt wolfram alpha can run with such memory constraints! Giac requires more flash, it could run if the calc hardware is upgraded to 8M of flash or more.
Just so you know, the wolfram package for the rPI (probably made from the embedded wolfram engine thing), which uses some kind of light version apparently, is around 450 MB (see https://gist.github.com/kylemanna/7abe99c1e0516f4b0d24). Even a 0.25% of that is too big for the NumWorks. And I won't even tell you about the RAM usage. Sure, there's probably quite a lot of things we wouldn't need (all the GUI, image resources, lots of features etc.), but even if you get rid of half or even 3/4 of it, it's still way too big. So, please research things a bit further before proposing preposterous ideas... ;) (also, not only is it not open-source (at all), but getting a license for such usages is probably not very cheap either)
Giac comes much closer but would need a bit more flash and possibly RAM, as already stated here and everywhere else several times. It would have been good if giac was completely modular so that we could hand pick just a few modules to start with (let's say, expression simplification, at first, and maybe derivatives), but I don't believe it is.
This is a frequent request, but it is not worth the effort, because the basic infrastructure with mandatory common routines would take about 2/3 or more. You can desactivate compilation of the differential equation solver for example, but it would save perhaps 1%. The reason is that math is much more interconnected than most people think (perhaps because math teaching does some artificial theme distinctions), for example if you want to implement symbolic integration, you will need arithmetic, linear algebra, limits, derivation, simplifications... and diff equation solving!
for example if you want to implement symbolic integration, you will need arithmetic, linear algebra, limits, derivation, simplifications... and diff equation solving!
I precisely didn't choose symbolic integration :D Having read stuff in the past about Risch's algorithm and "everything" it involves (which is very interesting, by the way), it requires quite a bit of stuff from everywhere. but I'm pretty sure some more "lower level" things could be modularized much more easily than integration.
Also I don't really believe the "2/3 size" issue is a really good excuse. Sure you may not have the will or time to do it, and that's perfectly understandable, but no matter that cost, refactoring to make things much cleaner/modularized definitely increases the readability and thus long-term maintainability... and it would have been useful in projects such as this one here :)
(I've had this exact issue/opportunity for TI-Planet's project builder, which was a big monolithic piece of code at first, but I then spent just a few days (maybe 40-50 hours over 72...) refactoring the whole codebase to be pretty much 100% modular. It greatly improved the architecture and basically everything for the future.)
This perfectly illustrates "life is short and ROM is full". Believe me or not, math is fully interconnected: the example of integration is caricatural but there are many other connections. I'm working in this area since more than 20 years, giac is now about 200k lines of code. Trying to save 1/3 (or maybe 1/2 if I'm wrong) of 5M of ROM is pure non sense, because it would take a lot of time, introduce a zillion bugs, downgrade the functionnalities, and you would never recover this cost by the 0.5$ or 1$ you can save in hardware.
around 450 MB
I didn't expect that big of a size. Well, I think it's impossible then (unless there is an SD card, but then wouldn't it get slower because of lower speeds?)
Go for GIAC then, and obviously increase flash/ram.
Giac is now about 200k lines of code
Yes, I know it would have been something to be done from the beginning, rather. But nowadays at this point, I agree it would be a huge task.
But a professional C(++) programmer would have done that from the start - I suppose that as a professional "math guy" (I'm not finding a correct word, you see what I mean), you simply didn't have this in mind at the time, which is now getting annoying (you're saying it yourself, it's "a frequent request"), whether we're talking about a numworks integration without a big enough flash, or not.
Giac is somewhat modular. For example, in version 1.4.9, there are 2 new self-contained files written by someone else that implement optimization functions. If the object files are linked in, then the functions are available, otherwise they are not (that is the functions auto-register themselves in the lexer). Or you can enable or disable some optimizations with defines. The point is that in order to have a CAS you must provide a lot of basic infrastructure, and standard functions building over that do not require much space. The 5M of ARM code required is already about half what you get if you compile for ARM with optimizations, self-registering, ... and there is also code to spare RAM as much as possible (most objects can be compiled to be in ROM at a fixed address for example). So let my clarify: I said that it's frequent that some people ask for giac say without linear algebra and hope that they will spare code and I answer I can't. But I'm not annoyed, because I don't think I made it wrong. Perhaps someone with more coding experience would have made it more modular, who knows ... but life is short and don't forget that coding a CAS requires advanced maths and CS knowledge.
Like @adriweb explained, this is not even remotely possible for quite a lot of reasons. We'll have to close this issue.
According to https://www.wolfram.com/engine/ there is an embedded version of the Wolfram Engine (which, I think, includes Mathematica which is used in Wolfram Alpha). Though there is no link, so I don't know if it does include the calculation engine.
That way the calculator would include a CAS, which at the current price would be a bargain. Also, the development could be shifted on other things such as the Python interpreter, since the calculation engine would already be finished. You could also use other CAS such as GIAC.