ideas for compiler project
Jay Cox
sqrtofone@yahoo.com
Sun, 17 Feb 2002 13:59:43 -0600 (CST)
On Sat, 16 Feb 2002, Dylan Thurston wrote:
> On Thu, Jan 24, 2002 at 03:38:59PM +0100, Bjorn Lisper wrote:
> > I think MATLAB's matrix language provides about the right level of
> > abstraction for a high-level matrix language. You can for instance write
> > things like
> >
> > Y = inv(A)*B
> >
> > to assign to Y the solution of Ax = B. ...
>
> Just a comment on a long post... I am personally found of MetaFont's
> approach, where you write
>
> Ax = B
>
> to find the solution to Ax = B. When working with transformations and
> such, being able to write all your equations "forwards" makes it much
> easier to keep everything straight; plus, if you have several equations
> for a variable, you don't have to figure out how to gather them
> together. Can anyone see a way to implement something like this in
> Haskell? Or is it better to make a small interpreted language?
>
> Best,
> Dylan Thurston
>
why not write some software that does something like
let y = ((Matrix A) :*: (Vector X)) := (Matrix B))
data MatrixExp = ...
data Sym = A | B | C ...
data Unknown = X | Y ...
solve :: MatrixExp -> Maybe (Vector Sym)
...
?
Jay Cox