Recent

Author Topic: Pascal to JavaScript: Part 2  (Read 3059 times)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Pascal to JavaScript: Part 2
« on: August 07, 2017, 07:08:15 pm »
I've finished converting the example BoxCast JavaScript Web app to 100% Pascal. The first part of this effort is described here: https://macpgmr.github.io/MacXPlatform/PascalToJavaScript_AReport.html.

Source for everything is here:

https://macpgmr.github.io/MacXPlatform/pnj-src.zip

I've included source for a simple console app that converts Pascal to JavaScript. This is suitable for creating small Pascal Web apps. Note that the supplied interface units to DOM, HTML, Mapbox, etc. are rudimentary, but can be added to as needed.

You'll need a recent trunk FPC compiler to compile the converter app. The deployment files for BoxCast are included if you're unable to compile the converter but want to look at the converted JS or test the app.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Pascal to JavaScript: Part 2
« Reply #1 on: August 19, 2017, 12:34:10 pm »
Is there already something for the other way? Even only partial?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Pascal to JavaScript: Part 2
« Reply #2 on: August 19, 2017, 09:52:38 pm »
Is there already something for the other way? Even only partial?

Do you mean JavaScript to Pascal? As in creating Pascal interface units for JavaScript libraries automatically?

Sorry, I don't know anything about that. I did the Mapbox interface unit manually, although certainly even a partial converter would be a more foolproof way to start. But surely it would be a huge amount of work to create a converter like that.

 

TinyPortal © 2005-2018