sstur / js2php

JavaScript to PHP source transformation
151 stars 27 forks source link

Use js2php to transpile itself to create a PHP-only version of it #14

Open imme64 opened 2 years ago

imme64 commented 2 years ago

As a Proof Of Concept we could use js2php to transpile itself (including its dependencies) to pure PHP so that it can be used even if no NodeJS is available.

This would

  1. show that js2php can transpile a seriously complex application.
  2. make js2php usable in pure PHP environments.

Achieving this would need some effort because we need to implement for example require(). But if we would succeed, we would push the project from a pure prototype to a really usable application.

imme64 commented 2 years ago

Hi @sstur,

I was able to create a version of the project which is 100% PHP: js2php-implemented-in-php.tar.gz, invocation: php js2php.php --test

This proves that js2php has the potential to be a fullblown JavaScript engine for PHP. Only problem is poor performance (around 75x slower than NodeJS). I'll open a new issue regarding performance.

Best,

Immanuel