Pascal to JavaScript: A Report lazarus / 62-General ---------------------------------------------------------------------- Phil · 2017-07-30 23:24 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 · 2017-07-31 06:50 Quote from: Phil on July 31, 2017, 01:24:47 amI 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. 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. 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"?  It is simply not finished. (or polished, to satisfy my Polish friends) at 5.: relevance is in a) type safety b) using current knowledge. ---------------------------------------------------------------------- Phil · 2017-07-31 18:31 Quote from: Thaddy on July 31, 2017, 08:50:52 amActually, 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') Sorry, I don't understand what you're referring to here. Quote from: Thaddy on July 31, 2017, 08:50:52 amAlso note the pas2js utility is currently broken and should be considered dead code (disabled in make) . 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 amat 4.: was it "write once, compile anywhere" or "write once, document mañana"?  It is simply not finished. (or polished, to satisfy my Polish friends) 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 amat 5.: relevance is in a) type safety b) using current knowledge. Maybe. We'll see if those things matter. ---------------------------------------------------------------------- Thaddy · 2017-07-31 19:45 Quote from: Phil on July 31, 2017, 08:31:10 pmStrikes me as very odd that they don't want to tell the world about it. That's why trunk is trunk: it is not a playground but to mature things. QuoteQuote from: Thaddy on July 31, 2017, 08:50:52 amat 5.: relevance is in a) type safety b) using current knowledge. Maybe. We'll see if those things matter. Of course that matters.... That's frankly a no-brainer...