[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New very simple methodology to create a m-file compiler.

From: GoSim
Subject: New very simple methodology to create a m-file compiler.
Date: Sun, 5 May 2019 11:15:20 -0500 (CDT)

If the user wants to compile the code force the user to write code where the
variable types are static. The syntax is still m-code syntax. Use your
interpreter and check if any variable changes type and then display an error

"Variable x changes type from ? to ? at line ?, please restructure your code
so that variables never change type to use the Octave compiler"

Now just take the compiled segments and put them after eachother, declare
the variables at the top or just before they are used in the m-file.

This is very user friendly, much easier than your current oct-file method
and would attract more users and it is also very simple to implement.
Restricting the m-file to not allow variable type changes is no challenge
for most scripters, and for the performance gain it's a nobrainer. 

So with this method there is no need to automatically make the m-file only
have static types or to hack the compiled code. This effort is put on the
scripter and it is not much of an effort. 

C code is considered to be 7 times faster than java. I consider java to be
5-20 faster than m-code.....you have to implement this.

Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]