Re: Computer Algebra Algorithms lisp vs. C.



bernard parisse wrote:
> Printing does not require too much time, but parsing does.

That depends entirely on what you're parsing, of course. If you use a simple
format then parsing will take very little time.

> There is an interpreter in giac, mainly for interactive
> user session, each function on the user side calls a
> C++ function of the library that a C++ programmer can call directly.
> That's why I said there is no kernel/user language approach,
> since CAS like maple or mupad have many built-in functions
> programmed in the user language (and kernel function access is not
> provided, at least in the standard distributions).

Can I just clarify: Is it or is it not possible to write arbitrary programs
in giac's language?

> From my experience, it is not much harder to implement CAS algorithms
> directly in C++ than in say maple,

If you could design and implement your own language, specifically created to
let you describe the specialised set of algorithms that you're
implementing, do you not think it would be much better for representing
those algorithms than C++?

> and I find debugging much easier.

I can understand that, although I'd say that code in C++ is more error-prone
than in Mathematica (and, I assume, Maple). OCaml is much more robust than
both C++ and Mathematica and it also has better debugging facilities.

> And the resulting function is sometimes significantly faster.

If you don't have control over the language, then yes. But if you're also
developer the interpreter then you can simply improve its optimiser. If you
do this, you're likely to end up with faster code overall.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: Cosmos vs Sandwalk
    ... you probably mean to create "new algorithms". ... used by a computer for they can be used by boys. ... reasoning as a subset of language; a rather difficult one once you stray ... a mountain", this is a glass of red wine". ...
    (talk.origins)
  • Re: A question for the implementers
    ... algorithms would never have been discovered if it had? ... the risk of complicating user's understanding of the language. ... that, in the extreme, an error-free language would be unusable. ... arg, then the error is caught when the function is invoked as in ...
    (comp.lang.apl)
  • Re: Parsing the start of a source line
    ... compiler to begin parsing. ... for the programmer to tell which type of statement a line was until reading ... But, by redesigning a language, this can be mitigated. ... you meant something other than grammar please say. ...
    (comp.lang.misc)
  • Re: why learn C?
    ... i think programming is different from Software Engineering. ... then I can find other algorithms I have needed which are ... *not* part of which ever language you choose to select. ... and you will have done at least some algorithm development whether you ...
    (comp.lang.c)
  • Re: Parsing the start of a source line
    ... compiler to begin parsing. ... have any thoughts on the how a language should be designed to ... for the programmer to tell which type of statement a line was until reading ... you meant something other than grammar please say. ...
    (comp.lang.misc)