Coder Social home page Coder Social logo

js2cpp's Introduction

JavaScript like language to Cpp:

Dependent on: boost/any c++11

Limitation: Every clause should be ended with semicolon, and function must have and only have ONE argument and this parameter must be passed in as variable, no else and for flow control in flow control clause. Only control.log is supported as API. No module supported. For mathematic operation, please use brackets to eliminate the ambiguity. Only anonymous function is supported, but if you want to use named function, you can easily bind it to a var type and then call this var name as a named function.

Supported features: new/this keyword, high order function, prototype chain, closure, IIFE(without parenthese), if-clause, while-clause, recursive-call.

Supported types: dict(work like object), function, list(no apis support such attributs like pop, shift...), string, double, bool, undefined

Different to js hoist mechanism: The variable declared in local function will cover the existed same named variable in above function space. The variable used without declaration will not be hoisted as global variable but as local function space variable, so our iife does not need to add parentheses outside the function definition.

How to use it: ./tnode.sh infile.js

js2cpp's People

Contributors

yuandong-chen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.