Abacas

the Advanced Beginners All-purpose Computer Algebra System

Strategy

  1. finish MTBRegister CPP port... easy. Just finish it.
  2. get MPFR wrapper to a reasonable state so I don’t go crazy and maybe I can even use this on the Haskell/server version
  3. Web based prototype (new! either in C or in Haskell, doesn’t matter... what matters is that I can make breaking changes and leave the code alone that deals with AE’s Frink DB, so I can really just make something elegant and better, more usable)
    1. make a new parser that basically supports everything the current calculator does but trimming out some of the grime, make it flexible in terms of precedence
    2. when to add Symbolic?
      1. Right away! (when I do the new parser)
    3. write a console version in C(?) that does everything I currently do, using SQLite for the unit DB
    4. make a CGI web version very like the one I currently have up, but this runs (only) in Safari, at 320 pixels wide; get it working as a Web App on the iPhone
    5. add nice interface enhancements like make Previous entries (expression as one link and answer as another link) clickable to insert text for you (JavaScript).
      1. other idea: if a result is enormous (Z, Q or R) just show part of it and let if be clicked to expand. e.g. 2 to the 1024 shows the 1.79... X 10 to the 3XX and then if you click that it shows the whole thing (without x 10 to the) nicely formatted
  4. then port that to C
  5. and make it a native App on the iPhone
  6. add graphing only when I’m using C (for obvious reasons... Graphing will be suicide in Haskell)

finish MPFR bindings and get it onto hackage

  • MPFR Haskell bindings
    • X compile mpfr on updike.org/FreeBSD
    • X link existing mpfp code into calc.cgi and see that it works as a drop in replacement for Double (once it links this part is trivial!)
      • X not trivial ! weird exceptions are occurring!
      • X pure C Code using my my_mpfr.h and my_mpfr.c wrappers works
      • try using the lowest level Haskell wrappers to do a Haskell factorial much like the working pure C one.
        • If it works, then I have some evil in unsafePerformIO and finalizers.
        • X If that does not work, then the evil is in Ptr types and maybe the finalizers.
          • X it crashes after roughly the same number of allocs/multiplies. I’m not using the Ptrs but the ForeignPtrs. That’s what’s going wrong. (Which is to say, I need to test the rawest, most literal C translation and make sure that does or does not work:)
            • If just Ptr MPFR does work then I’m not wrapping the finalizers/ForeignPtrs right
            • If Ptr MPFR does not work then I’m using the FFI wrong and I need to get the literal C translation to work correctly (since said C code works correctly even without calling my_destroy on any mpfr_t STARs) before I have a hope of getting the rest of the Haskell stuff working
    • cleanup, CABAL package it up, post to Haskell mailing list

CAS

Haskell wikibook

  • Bison/C parser for current grammar (half of it lives in current Parser for calc.cgi, half of it is in my head)
  • Parsec parser for said grammar
  • Can’t use Bison (can use Flex, however) because I need to be able to parse in POUND-SIGN infxl 5 specifiers as I parse ...
    • Wait... I can use Bison if I do a simple pre-parse pass to get Parse time POUND-SIGN lines to get all the precedences/associativities.

resources:

more

  • make better rules for complex numbers and trig identities
    • deal with products of x and (y to the negative z)
    • make the parser support i (add to Expr) and make convert change x pow(-y,1/(2z)) to use i in expr
  • test out various integrals and make a rudimentary integral table using old syntax (which is subset of my Parsec parser syntax)
  • test on lots more input and document everything: make a test file with expected input and output to document all cases and whether they succeed or fail (also works as a sort of tutorial or usefulness barometer)
  • ...
  • replace Parse with a (working) Parsec version, probably based on the Parser / lexer from math.cgi since it is more intuitive and gives better error messages
  • replace the pretty printer with three different pretty printers: a 2D text one (easy and a fun challenge), a nice HTML one (with divs for fractions), and later a mathml one
  • ...
  • integral table! using new syntax
  • ...