From: David B. <dh...@gm...> - 2008-08-09 16:50:06
|
On Sat, Aug 9, 2008 at 5:11 AM, Albert Graef <Dr....@t-...> wrote: > David Baird wrote: >> Excellent, thanks! I finally got your suggestion to work in Pure. > > Great. :) Are you writing a CAS in Pure? There's already some nice stuff > by Rob Hubbard to deal with rationals and polynomials, it only needs to > be ported over (currently it's written in Q). Well, not a CAS exactly but probably very related. I'll definitely keep checking out Q. I originally tried cracking open the source code to Maxima and then realized that was going to be more than just an hour of effort (partly because I don't have enough Lisp experience yet). Then I discovered Q and was very impressed by the conciseness of Q (and then discovered Pure). What I'm kinda playing around with is compilers and also just systems integration in general. As far as compilers though, I've mentally broken them down like this: 1. Parsing 2. Term rewriting for doing AST manipulation (Q seemed a good match here). Mostly, I was interested in taking an expression and normalizing it to a sum-of-products format. 3. (maybe something else goes in the middle here?) 4. Optimization to try to ensure that pipelines in a CPU are kept full or that processing latency is minimized (using Prolog, integer linear programming, ...) 5. Writing out the results I'm trying to use declarative tools to achieve these goals. Also, I don't really have much experience with compilers so I am just goofing around really. Some of my coworkers have also been doing great work by using high level tools such as OCaml and Prolog. I'm actually kinda confused about why people insist on using C to write compilers when there are such great higher level tools available? I'm also investigating the possibility of implementing an expression representation system (probably a thin layer around sexps) in Python. The idea is that I can then layer term rewriters on top of this (this is how I discovered Q in the first place), and also be able to provide nearly seamless integration between Python and constrained optimization tools (like CVXOPT, GLPK, LP_SOLVE), and probably other tools too (like ODE solvers?). *phew* Hope that description wasn't too long. Sometimes I enjoy talking too much. -David |