in reply to Translating Perl into JavaScript

I hope you know that your chances are very slim to actually port full p5 to javascript, even if you consider only these parts that aren't inherently impossible in Javascript (some I/O, system calls).

But that shouldn't stop you from doing this stuff, especially if it's fun.

The major problem could be that once you use this in production code, you have to be very clear about what works and what doesn't. (Just a few keywords: tie, overload, local, type globs - how much of them will work, if any?)

Replies are listed 'Best First'.
Re^2: Translating Perl into JavaScript
by /dev/urandom (Beadle) on Jun 02, 2008 at 17:55 UTC
    Oh I know. Complex Perl code can never be translated into JavaScript, since ES3 is quite limited anyway. Furthermore, more complex JavaScript code should definitely go in its own file, for multiple reasons which are not even related to features that cannot be translated from p5 to js. That's why I only consider this worthwhile using, if its uses are limited to small (and simple) sliced of code, like the one I posted above.

    That's the whole thing actually, this module (and most likely anything else) will never be able to cover all of p5, but it'd be nice if it covers all the basic stuff.
Re^2: Translating Perl into JavaScript
by Jarble (Initiate) on Mar 15, 2017 at 18:56 UTC
    There is a compiler called Perlito that can convert a subset of Perl into JavaScript.
      IIRC last time I tried it out (some years ago but after 2012's talk from Flavio) I wasn't able to use s/// or m// for regexes.

      Did this change?

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!