8

Would it make sense to use LLVM (with its full-fledged JIT and optimizers) to run an interpreted language code like Matlab?

What are the concrete parts of execution that could be enhanced, by using an abstract compiler-optimizer instead of Matlab's current modus operandi? (I understand it probably has a simple LLVM-like optimizer, but I don't believe it is as powerful as LLVM itself)

The reason I thought of this is because using the runtime information a typical Matlab calculation has (size of arguments etc.) I think a full-fledged optimizer could increase execution speed in very simple scenarios where a Matlab program now needs to take special measures to ensure optimal performance (like explicit preallocation of variables etc.)

I understand there is currently no support for any of this at all, but I'm just wondering what the impact of such an interpreter would be.

8
  • I'm voting to close this as ”not constructive” (it seems very open-ended and discussion-based), but I do think it's an interesting question.
    – You
    Jul 21, 2011 at 15:30
  • 1
    Three years ago I asked why not MATLAB using JVM, see here the response by MATLAB OO program manager Dave Foti: blogs.mathworks.com/loren/2008/03/04/release-r2008a-available/… Jul 21, 2011 at 16:22
  • 1
    I am against closing this question, it is open-ended but I hear it asked really often, for example by a coworker of mine just two days ago. Jul 21, 2011 at 16:25
  • 2
    The response is probably Yes, it would make sense to use LLVM. So why it is not being implemented yet? I think that most MATLAB revenue is made with users for which its current performance is OK (MATLAB is very slow with loops, function dispatch and GC but has also very fast parts like matrix operations). I also think that the fastest growing business for MathWorks is Simulink and code generation from it because it is being used by industry which has money (unlike universities). So I suspect that improving MATLAB performance is not on the top of MathWorks priorities. Jul 22, 2011 at 10:12
  • 1
    here is someone who actually implemented this as part of their master's thesis: McVM. For a more real-world solution, check out the Julia language (read this initial announcement when v1.0 was released)
    – Amro
    Jul 11, 2013 at 0:26

0

Browse other questions tagged or ask your own question.