Giter Club home page Giter Club logo

perltojs's Introduction

PerlToJs

Perl5 modules in javascript

purpose

To make possible the use of Perl5 modules in Javascript code.

This is desirable for two reasons:

  1. Some functionality (e.g. validating forms, rendering templates) can be shared between the server and the browser, without the need to write and maintain it in two separate files in two separate languages
  2. Server-side functionality can be written in perl and run on any server-side javascript platform, such as nodejs, iojs, or meteor. This could be a legacy perl codebase, or complex functionality that would be longwinded to write and difficult to maintain in javascript.

This package is currently powered by Perlito, which transpiles perl to js (among other languages) but lacks a practical interface for using your transpiled code in javascript.

usage

bundling using the CLI

$ perl-to-js.pl help

Usage:
  perl-to-js.pl bundle <module>... [--include <directory>]... [--output <file>]
  perl-to-js.pl interface [--output <file>]
  perl-to-js.pl help [--output <file>]
  perl-to-js.pl version [--output <file>]

Options:
  --include <directory>         an @INC directory (any number allowed)
  --output <file>               the file to write to [default: STDOUT]

bundling using perl

... See the CLI script for now

the perl-js interface

... See the perl dummy module and the javascript test for now

requirements

  • Perl5 v5.10.1 or higher

changelog

v0.0.1

  • Initial alpha release

todo

  • make: one encode function to tie together encodeScalar+encodeArray+encodeHash+encodeSub... same for decode
  • Dummy::Subs
  • use CPAN standards for distribution packages
  • add notes in readme about getting set up
  • add PerlObject class
  • give perl modules a way of knowing if its running in perl, node, or the browser ("isomorphic" ability)!
  • use node and or a headless browser for automated tests, use Travis CI
  • add support for expanding use statements (either here or in Perlito)
  • move Perlito runtime from each bundle to the singular PerlToJs runtime
  • support commonj-esque (i.e. node & browserify) javascript module format

perltojs's People

Contributors

zenflow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.