HP Forums
An HPPL compiler question... - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: An HPPL compiler question... (/thread-8558.html)



An HPPL compiler question... - webmasterpdx - 06-24-2017 11:50 AM

Various documents say that programs are compiled when created. My question is whether the HPPL compiler compiles to some kind of p-code like java bytecodes (the CPU is Jazelle compatible and handles Java bytecodes in hardware/firmware).....or does it compile to ARM assembler with library calls? Then if it compiles to machine language, does it get optimized or is it very basic assembly language constructs with library calls?
Thanks
-Donald


RE: An HPPL compiler question... - cyrille de brébisson - 06-26-2017 05:34 AM

Hello,

Nope, not that complex.
PPL programs are transformed into a tree representation of the program/expressions, with a program being a list of user functions, user functions being themselves lists of expressions or objects (like lists numbers, matrices...), expression having a standard tree structure.

The execution of a program is the sequential execution of these lists and expression trees.

The code is non-recursive (even if the program is), to allow deep recursive program execution (like a factorial).

It is not very memory efficient, but it is quite fast and relatively simple to implement.

Cyrille


RE: An HPPL compiler question... - webmasterpdx - 06-26-2017 10:40 PM

So, to clarify, sounds like a parser. So, the original code is parsed and stored in a parsed tree. Then this tree is traversed and interpreted during execution. Right?
Thx
-D


RE: An HPPL compiler question... - cyrille de brébisson - 06-27-2017 04:31 AM

Hello,

yep, that is about correct.

Cyrille