Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is explicit "compilation" allowed in a scripting language like Mma? #76

Open
PoeticExposition opened this issue Sep 29, 2023 · 2 comments

Comments

@PoeticExposition
Copy link

In perf.nb, several Mathematica functions are compiled using Compile, but in perf.m, none of MatLab code is compiled into .mex files (or other formats). Since one can also compile a MatLab program (see, for example, use MATLAB Compiler (SDK) or MATLAB Coder to deploy MATLAB programs) and than call it, is this comparison fair?
If explicit "compilation" is allowed, now that there has been a newer FunctionCompile functionality, one will have to make two versions of Mathematica. And if not, when writing a recursive function, will a function that remembers values it has found be allowable (because this does follow the way that an experienced user would write it)? (Incidentally, the Wolfram Language source file should be named as "perf.wl" (rather than "perf.nb")).

@StefanKarpinski
Copy link
Sponsor Member

Compiling is fine so long as the behavior of the code isn't changed. Do you know if it is? Memoizing values is not allowed since that very much changes the algorithm.

@PoeticExposition
Copy link
Author

Compiling is fine so long as the behavior of the code isn't changed. Do you know if it is? Memoizing values is not allowed since that very much changes the algorithm.

Thanks. But what about other issues described above?

  1. If compilation optimization is allowed, why does Mma's code make use of compilation while MatLab's does not (cf. codegen, fiaccel, and mcc)?
  2. Why does Mma's code only use System`Compile and ignore the System`FunctionCompile when there are indeed two parallel implementations?
  3. And according to What is the difference between a .wl package and a .m package?, shouldn't the Wolfram Language source file be named as "perf.wl" (instead of "perf.nb")?
  4. Besides, in accordance with Integer matrix multiplication - Benchmarks, Julia's built-in * is both slower than the analogue in Python (???) and slower than the analogue in Pari/GP, which is not included in this micro-benchmarks; does there exist to extend the range of script languages used here? For instance, there are so-called “3M” mathematical software: MatLab, Mma, and Maple (alternatively, Magma), so what is the status of Maple's performance in the Microbenchmarks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants