Forum > General

Pascal to JavaScript: A Report

(1/1)

Phil:
I spent some time over the weekend looking into FPC trunk's Pascal-to-JavaScript converter. Here are some notes I worked up about what I discovered:

https://macpgmr.github.io/MacXPlatform/PascalToJavaScript_AReport.html

Some clever and interesting stuff in the converter. Worth poking around in.

Thaddy:

--- Quote from: Phil on July 31, 2017, 01:24:47 am ---I spent some time over the weekend looking into FPC trunk's Pascal-to-JavaScript converter. Here are some notes I worked up about what I discovered:

https://macpgmr.github.io/MacXPlatform/PascalToJavaScript_AReport.html

Some clever and interesting stuff in the converter. Worth poking around in.

--- End quote ---

Actually, the mappings are in the test suite for fppas2js and comes up with *way* better code than you found.
(It is also the only test that currently seems to fail, but I found that is because of the assumption for the test is currently wrong: it should map to 'E', not 'G')
Furthermore note that * a lot of work * is currently being done in trunk by several people. Getting better all the time..

Also note the pas2js utility is currently broken and should be considered dead code (disabled in make) . I filed a bug against it.

--- Quote --- Worth poking around in.
--- End quote ---
Indeed..... especially if you use trunk and see al the updates flying about... Or are interested in source to source compilers or webassembly, asm.js and the likes..

[edit]
at 4.: was it "write once, compile anywhere" or "write once, document mañana"?  ;D It is simply not finished. (or polished, to satisfy my Polish friends) 8-)
at 5.: relevance is in a) type safety b) using current knowledge.

Phil:

--- Quote from: Thaddy on July 31, 2017, 08:50:52 am ---Actually, the mappings are in the test suite for fppas2js and comes up with *way* better code than you found.
(It is also the only test that currently seems to fail, but I found that is because of the assumption for the test is currently wrong: it should map to 'E', not 'G')

--- End quote ---

Sorry, I don't understand what you're referring to here.


--- Quote from: Thaddy on July 31, 2017, 08:50:52 am ---Also note the pas2js utility is currently broken and should be considered dead code (disabled in make) .

--- End quote ---

Right, I started by rewriting pas2js so it would compile, but never could get it to convert more than very simple things, so I moved on to testpas2js.


--- Quote from: Thaddy on July 31, 2017, 08:50:52 am ---at 4.: was it "write once, compile anywhere" or "write once, document mañana"?  ;D It is simply not finished. (or polished, to satisfy my Polish friends) 8-)

--- End quote ---

Strikes me as very odd that they don't want to tell the world about it.


--- Quote from: Thaddy on July 31, 2017, 08:50:52 am ---at 5.: relevance is in a) type safety b) using current knowledge.

--- End quote ---

Maybe. We'll see if those things matter.

Thaddy:

--- Quote from: Phil on July 31, 2017, 08:31:10 pm ---Strikes me as very odd that they don't want to tell the world about it.

--- End quote ---
That's why trunk is trunk: it is not a playground but to mature things.

--- Quote ---
--- Quote from: Thaddy on July 31, 2017, 08:50:52 am ---at 5.: relevance is in a) type safety b) using current knowledge.

--- End quote ---
Maybe. We'll see if those things matter.

--- End quote ---
Of course that matters.... That's frankly a no-brainer...

Navigation

[0] Message Index

Go to full version