Re: [pure-lang-users] Swapping Symbols and Integers
Status: Beta
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2008-08-09 20:48:28
|
David Baird wrote: > Well, not a CAS exactly but probably very related. I'll definitely > keep checking out Q. Note that Q will eventually be replaced by Pure, so it's a good idea to already check out the latter, even if it's still a bit rough around the edges here and there. I hope that the forthcoming 0.5 release will be bug-free and feature-complete enough to be useful for some real programming. (Thanks also to the work of other people here who already started porting modules from Q to Pure.) > 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). LOL. Yeah, CAS's are big monsters. :) > 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. There's a software named Stratego specifically designed for that purpose (http://www.program-transformation.org/Stratego/). It uses some kind of programmed rewriting systems which look like they are quite a bit more complicated to program than Pure/Q. Probably worth a look, though. > 3. (maybe something else goes in the middle here?) Something like... code generation? :) > 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, ...) For items 3 and 4, LLVM (which Pure uses as its backend) is definitely worth a look. It's a C++ framework, though. It would be nice to have LLVM bindings for Pure. Then we could write compiler backends directly in Pure, which also provides an easy path to make Pure self-hosting at some point. > I'm actually > kinda confused about why people insist on using C to write compilers > when there are such great higher level tools available? C/C++ is what most programmers know, and has a huge amount of libraries available. Also, besides the usual problems to break away from the imperative mindset, languages like ML, Haskell and even Lisp are often perceived as requiring at lot of esoteric math/cs knowledge to be able to use them successfully. That's not completely undeserved. I think that there's a need for a functional language which is as easy to use as, say, Python. Obviously, Pure tries to fill that niche, but we're not quite there yet. ;-) > 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?). There are plans to add interfaces to the GNU Scientific Library and some other solvers to Pure, so these kinds of applications will hopefully be well supported in the future. Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |