Post Reply 
HP Prime Beta Firmware Version 2.2 Revision 15008
08-26-2024, 11:18 AM (This post was last modified: 08-26-2024 11:18 AM by parisse.)
Post: #98
RE: HP Prime Beta Firmware Version 2.2 Revision 15008
(08-26-2024 07:38 AM)CheshireChris Wrote:  
(08-26-2024 07:27 AM)parisse Wrote:  This just make more confusion for newbies. Most interpreters will parse the whole source code and some will write bytecode, but that's not compilation like C or Julia does, at the end of the process you do not have native code that can be run by the CPU once loaded, bytecode can not be run without the help of a VM (virtual machine), and it will therefore be slower than native code (2* to 10* or more).

A compiler doesn't have to emit machine code in order to be a compiler. The process of converting a high-level language to bytecode is still compilation, and that does appear to be what's happening with Python on the Prime, which is the reason that it runs so much faster than PPL.
I disagree with your definition of compilation (and indeed when I speak of compiled vs interpreted language, compilation includes the linking step). Many (most?) interpreters are converting a string to some kind of bytecode. For example TI calculators are parsing to tokenized expressions, that can later be evaled like bytecode is run by a VM. Symbolic RPN expressions on the HP48/49/50 are also bytecode, produced by the parser, e.g. the fraction '1/2' is translated to sysRPL as :: %1 %2 x/ ; (5*2.5 bytes unless I make a mistake) and evaluated ("run") to 0.5, and any RPL program is also translated to sysRPL "bytecode" (:: x<< ... x>> ; ). Would you say that RPL is a compiled language?
I did not make comparisons with PPL, but I'm surprised when you say it's "much faster" than PPL, it probably depends on the kind of code you are running. Native code *is* much faster than MicroPython or PPL, for sure (e.g. displaying a Mandelbrot fractal on a calc will take 1mn in MicroPython vs a few seconds native code). And on a PC, native compiled code is much faster than Python code (unless you can really compile Python code using e.g. Cython). Expect a factor 10 or more with Python on scientific computations.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime Beta Firmware Version 2.2 Revision 15008 - parisse - 08-26-2024 11:18 AM



User(s) browsing this thread: 5 Guest(s)