Re: Computer Algebra Algorithms lisp vs. C.



bernard parisse wrote:
> I disagree again. There are much more chances that code written
> in a non-standard language like maple language might not work
> with a future release of Maple than C++ (or Lisp, or any
> standard language) code.

Interestingly, I just tried exactly this: running some Mathematica and some
C++ code that I wrote about 5 years ago. The Mathematica code ran out-of-
the-box, much faster than before and produced the correct answer.

In contrast, it took me 3 days to alter the C++ code to be compliant with
the current "standard". The result is no faster but now lacks a significant
amount of functionality because I couldn't figure out how to reimplement it
in time. I can post specifics if you want...

> Moreover, people using standard
> language tend to use powerful development environment not
> available in non-standard language, there are more chances
> that they comment their code appropriately.

Mathematica code is much more succinct (orders of magnitude, in my
experience) than C++. More importantly, the development environment of
Mathematica is vastly more powerful. For example, you can comment your code
with typeset mathematical expressions. This is obviously hugely relevant
and useful.

> > Just supply the external program with a string.
>
> That means parsing and printing each time you want to call a CAS
> function which is fairly inefficient. Imagine you do that with
> multivariate polynomials which tend to print to 1Mb size of text
> even with a few variables.

A premature optimisation.

> > > The host language is for me mainly a scripting language.
> > I don't think that statement means anything.
>
> I think it is clear for everyone administring a Unix station.

Ok, I administer several Unix workstations and I have no idea what you're
talking about. For me, a scripting language is something like Perl,
something you write disposable code in. I can't see how Maple, Mathematica
etc. can be put into this category.

> You do not expect the same thing from a scripting language
> than from a language like C.

Again, without a definition of "scripting language", I can't get anything
out of this statement.

> You did not give any argument that support this claim. I claim that
> there is no "most appropriate language", it will depend
> on other factors and C++ is an appropriate language, I support my
> claim by the existing C++ CAS libraries (e.g. my giac/xcas project).
> Of course Lisp, Ocaml, etc. are certainly appropriate languages too,
> there are CAS system written in Lisp, I don't know
> of any Ocaml CAS system

ML variants, including OCaml, were specifically designed for this purpose
(symbolic manipulation). Consequently, there are many such programs out
there (mainly theorem provers and compilers) as well as reams of
theoretical work.

> (I mean comparable to maxima, axiom or xcas),
> maybe someone will develop one, we'll see...

One of the ones I wrote would be a good example here. :-)

There are no open-source ones though, AFAIK.

> OK, I think I've lost enough time on this thread, I will most probably
> not convince people who are absolutely certain that C++ is not
> a good language for CAS algorithms. I hope that people who know
> C++ will just try C++ CAS libraries and make their opinion on
> the code, not on unsupported claims.

The only support I have is my experience: I used to be a C++ bit-twiddler
but, now that I've seen the forest for the trees, I write in OCaml. Armed
with this knowledge, I'm saying that symbolic computations are the
strongest point of OCaml, not a strong point of Java, a weak point of C++
and the weakest point of Fortran. Thus, I'm advocating the use of modern
functional programming languages, like OCaml, in this context.

I'm sorry that I have failed to convince you. I can but try.

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



Relevant Pages

  • Re: OCaml
    ... I use Maple for symbolic math. ... OCaml also has the advantage of being free. ... learning the language goes hand-in-hand with the requirement to complete ...
    (comp.sys.mac.scitech)
  • Re: Computer Algebra Algorithms lisp vs. C.
    ... >>> Unlike maple language which is only used by maple, ... >>> by mupad, mathematica language by mathematica, etc. ... Axiom is a CAS that uses a variant of Aldor to ...
    (sci.math.symbolic)
  • Re: Very poor Lisp performance / about Mathematica
    ... >> You cannot predict what such an OCaml program will do. ... Not using them is considered an abuse of the language. ... I wouldn't apply any of that theory to Mathematica directly. ...
    (comp.lang.lisp)
  • Re: About alternatives to Matlab
    ... lifting scheme, while yours is a classic convolution based approach. ... I've done both in OCaml. ... Using a compiled language ... We are talking about this Python implementation, ...
    (comp.lang.python)
  • Re: Verbose functional languages?
    ... They are both working around deficiencies in the language using functors. ... Users of languages like SML and OCaml should not have ...
    (comp.lang.functional)

Loading