Git Product home page Git Product logo

dukpy's Introduction

dukpy

image

image

image

DukPy is a simple javascript interpreter for Python built on top of duktape engine without any external dependency. It comes with a bunch of common transpilers built-in for convenience:

  • CoffeeScript
  • BabelJS
  • TypeScript
  • JSX
  • LESS

CoffeeScript Compiler

Using the coffeescript compiler is as easy as running:

>>> import dukpy
>>> dukpy.coffee_compile('''
...     fill = (container, liquid = "coffee") ->
...         "Filling the #{container} with #{liquid}..."
... ''')
'(function() {\n  var fill;\n\n  fill = function*(container, liquid) {\n    if (liquid == null) {\n      liquid = "coffee";\n    }\n    return "Filling the " + container + " with " + liquid + "...";\n  };\n\n}).call(this);\n'

TypeScript Transpiler

The TypeScript compiler can be used through the dukpy.typescript_compile function:

>>> import dukpy
>>> dukpy.typescript_compile('''
... class Greeter {
...     constructor(public greeting: string) { }
...     greet() {
...         return "<h1>" + this.greeting + "</h1>";
...     }
... };
...
... var greeter = new Greeter("Hello, world!");
... ''')
'var Greeter = (function () {\n    function Greeter(greeting) {\n        this.greeting = greeting;\n    }\n    Greeter.prototype.greet = function () {\n        return "<h1>" + this.greeting + "</h1>";\n    };\n    return Greeter;\n})();\n;\nvar greeter = new Greeter("Hello, world!");\n'

Currently the compiler has built-in options and doesn't accept additional ones,

The DukPY based TypeScript compiler also provides a WebAssets ( http://webassets.readthedocs.org/en/latest/ ) filter to automatically compile TypeScript code in your assets pipeline. You register this filter as typescript within WebAssets using:

from webassets.filter import register_filter
from dukpy.webassets import TypeScript

register_filter(TypeScript)

Which makes the filter available with the typescript name.

NOTE: When using the TypeScript compiler for code that needs to run in the browser, make sure to add https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.24/system.js dependency. As import statements are resolved using SystemJS.

EcmaScript6 BabelJS Transpiler

To compile ES6 code to ES5 for everyday usage you can use dukpy.babel_compile:

>>> import dukpy
>>> dukpy.babel_compile('''
... class Point {
...     constructor(x, y) {
...             this.x = x;
...         this.y = y;
...         }
...         toString() {
...             return '(' + this.x + ', ' + this.y + ')';
...         }
... }
... ''')
'"use strict";\n\nvar _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };\n\nvar _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };\n\nvar Point = (function () {\n    function Point(x, y) {\n        _classCallCheck(this, Point);\n\n        this.x = x;\n        this.y = y;\n    }\n\n    _prototypeProperties(Point, null, {\n        toString: {\n            value: function toString() {\n                return "(" + this.x + ", " + this.y + ")";\n            },\n            writable: true,\n            configurable: true\n        }\n    });\n\n    return Point;\n})();\n'

You can pass options to the BabelJS compiler just as keywords on the call to babel_compile().

The DukPY based BabelJS compiler also provides a WebAssets ( http://webassets.readthedocs.org/en/latest/ ) filter to automatically compile ES6 code in your assets pipeline. You register this filter as babeljs within WebAssets using:

from webassets.filter import register_filter
from dukpy.webassets import BabelJS

register_filter(BabelJS)

Which makes the filter available with the babeljs name. Only supported filter option is currently BABEL_MODULES_LOADER with value systemjs or umd to specify that compiled code should use SystemJS or UMD instead of CommonJS for modules.

NOTE: When using the BabelJS compiler for code that needs to run in the browser, make sure to add https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js dependency.

JSX to React Transpiling

DukPy provides a built-in compiler from JSX to React, this is available as dukpy.jsx_compile:

>>> import dukpy
>>> dukpy.jsx_compile('var react_hello = <h1>Hello, world!</h1>;')
u'"use strict";\n\nvar react_hello = React.createElement(\n  "h1",\n  null,\n  "Hello, world!"\n);'

The DukPY based JSX compiler also provides a WebAssets ( http://webassets.readthedocs.org/en/latest/ ) filter to automatically compile JSX+ES6 code in your assets pipeline. You register this filter as babeljsx within WebAssets using:

from webassets.filter import register_filter
from dukpy.webassets import BabelJSX

register_filter(BabelJSX)

Which makes the filter available with the babeljsx name. This filter supports the same options as the babel one.

Less Transpiling

DukPy provides a built-in distribution of the less compiler available through `dukpy.less_compile`:

>>> import dukpy
>>> dukpy.less_compile('.class { width: (1 + 1) }')
'.class {\n  width: 2;\n}\n'

The DukPY based LESS compiler also provides a WebAssets ( http://webassets.readthedocs.org/en/latest/ ) filter to automatically compile LESS code in your assets pipeline. You register this filter as lessc within WebAssets using:

from webassets.filter import register_filter
from dukpy.webassets import CompileLess

register_filter(CompileLess)

Which makes the filter available with the lessc name.

Using the JavaScript Interpreter

Using dukpy is as simple as calling the dukpy.evaljs function with the javascript code:

>>> import dukpy
>>> dukpy.evaljs("var o = {'value': 5}; o['value'] += 3; o")
{'value': 8}

The evaljs function executes the javascript and returns the resulting value as far as it is possible to encode it in JSON.

If execution fails a dukpy.JSRuntimeError exception is raised with the failure reason.

Passing Arguments

Any argument passed to evaljs is available in JavaScript inside the dukpy object in javascript. It must be possible to encode the arguments using JSON for them to be available in Javascript:

>>> import dukpy
>>>
>>> def sum3(value):
...     return dukpy.evaljs("dukpy['value'] + 3", value=value)
...
>>> sum3(7)
10

Running Multiple Scripts

The evaljs function supports providing multiple source codes to be executed in the same context.

Multiple script can be passed in a list or tuple:

>>> import dukpy
>>> dukpy.evaljs(["var o = {'value': 5}",
...               "o['value'] += 3",
...               "o"])
{'value': 8}

This is useful when your code requires dependencies to work, as you can load the dependency and then your code.

This is actually how the coffeescript compiler is implemented by DukPy itself:

def coffee_compile(source):
    with open(COFFEE_COMPILER, 'r') as coffeescript_js:
        return evaljs((coffeescript_js.read(), 'CoffeeScript.compile(dukpy.coffeecode)'),
                      coffeecode=source)

Using a persistent JavaScript Interpreter

The evaljs function creates a new interpreter on each call, this is usually convenient and avoid errors due to dirt global variables or unexpected execution status.

In some cases you might want to run code that has a slow bootstrap, so it's convenient to reuse the same interpreter between two different calls so that the bootstrap cost has already been paid during the first execution.

This can be achieved by using the dukpy.JSInterpreter object.

Creating a dukpy.JSInterpreter permits to evaluate code inside that interpreter and multiple eval calls will share the same interpreter and global status:

>>> import dukpy
>>> interpreter = dukpy.JSInterpreter()
>>> interpreter.evaljs("var o = {'value': 5}; o")
{u'value': 5}
>>> interpreter.evaljs("o.value += 1; o")
{u'value': 6}

Loading modules with require

When using the dukpy.JSInterpreter object it is possible to use the require('modulename') instruction to load a module inside javascript.

Modules are looked up in all directories registered with dukpy.JSInterpreter.loader.register_path:

>>> import dukpy
>>> jsi = dukpy.JSInterpreter()
>>> jsi.loader.register_path('./js_modules')
>>> jsi.evaljs("isEmpty = require('fbjs/lib/isEmpty'); isEmpty([1])")
False

Installing packages from npmjs.org

When using the persistent javascript interpreter it is also possible to install packages from npmjs.org through the dukpy.install_jspackage function:

>>> import dukpy
>>> jsi = dukpy.JSInterpreter()
>>> dukpy.install_jspackage('promise', None, './js_modules')
Packages going to be installed: promise->7.1.1, asap->2.0.3
Fetching https://registry.npmjs.org/promise/-/promise-7.1.1.tgz..........................
Fetching https://registry.npmjs.org/asap/-/asap-2.0.3.tgz............
Installing promise in ./js_modules Done!

The same functionality is also provided by the dukpy-install shell command:

$ dukpy-install -d ./js_modules promise
Packages going to be installed: promise->7.1.1, asap->2.0.3
Fetching https://registry.npmjs.org/promise/-/promise-7.1.1.tgz..........................
Fetching https://registry.npmjs.org/asap/-/asap-2.0.3.tgz............
Installing promise in ./js_modules Done!

Please note that currently install_jspackage is not able to resolve conflicting dependencies.

dukpy's People

Contributors

amcgregor avatar amol- avatar azazel75 avatar bobotig avatar dknowles2 avatar edwardbetts avatar gasbasd avatar lmagomes avatar mortal avatar pandasauce avatar pavpanchekha avatar qwenger avatar raulcd avatar webknjaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dukpy's Issues

compile error with python3.7 on mac

hi, when I try to insall dukpy with latest version 0.2.2 (or 0.2.1, 0.2.0) on mac, some error messages occur.

Mac: RELEASE_X86_64 x86_64
Python: 3.7
pip3: 18.0

when run command:
pip3 install dukpy

error messages:
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I./src/duktape -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/duktape/duktape.c -o build/temp.macosx-10.13-x86_64-3.7/src/duktape/duktape.o
duk_bi_date_unix.c:53:15: error: array has incomplete element type 'struct tm'
struct tm tms[2];
^
duk_bi_date_unix.c:53:9: note: forward declaration of 'struct tm'
struct tm tms[2];
^
duk_bi_date_unix.c:134:28: error: invalid application of 'sizeof' to an incomplete type 'struct tm'
DUK_MEMZERO((void *) tms, sizeof(struct tm) * 2);
^ ~~~~~~~~~~~
./src/duktape/duk_config.h:1965:46: note: expanded from macro 'DUK_MEMZERO'
#define DUK_MEMZERO(p,n) DUK_MEMSET((p), 0, (n))
^
/usr/include/secure/_string.h:76:33: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^~~~~~~~~~~
duk_bi_date_unix.c:53:9: note: forward declaration of 'struct tm'
struct tm tms[2];
...

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-install-nemfkg94/dukpy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-record-afo8rlwm/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-install-nemfkg94/dukpy/

execute es6 code

How can I use it to execute es6 code, Are there any similar examples

sandboxing

From what I can see you are not sandbox'ing duktape at all... is this correct?

Why the context is not saved?

Imgur

See what I do in the screenshot, I definded a class in es5js and then call evaljs the first time, everything seems OK.
But when I tried to used the persistent instants, got identifier 'udm' undefined.

The strange things is, the code I pasted from document works well.

Is it a bug?

setuptools...

Hi,

is (and how) it possible to specify my js-requirements in setup.py. Do you have a simple example for that? Is there a hook or something i can register the install_jspackage in an smart way.

thanks in advance

Resolving modules paths possible?

@amol- First of all thanks so much for putting up this interesting project!

As you have also mentioned webassets in your presentation on EuroPython 2016.
https://www.slideshare.net/__amol__/pyconit7-dukpy-webassets-free-yourself-from-nodejs-chains

I wondered whether it would be possible to use dukpy to resolve paths of all css and js files in a node_modules folder.

Currently the necessary function require.resolve('module_name'); does not work.

We could then feed those paths directly into webassets' Bundle().
If we could simply catch and bundle all packages we have downloaded that way, it would alleviate the need to update our Bundle config every time we add dependencies. Or create an elaborate config in the first place.

Hence we would only need to run dukpy.install_jspackage('bootstrap) and it would be automagically made available in our web templates. Thereby we could indeed dismiss npm.

IMHO. This could be one of the hidden superpowers of dukpy. (Opposed to mere transpilations, because we can do this with webassets already.)

Failed to build wheel on macOS

Just a minor issue. When installing on macOS, the wheel fails to build. This is due to the missing LICENSE file listed in the setup.cfg metadata. Most likely you just need to add the file to the MANIFEST.in.

  error: [Errno 2] No such file or directory: 'LICENSE'
  
  ----------------------------------------
  Failed building wheel for dukpy

That said, the package does install correctly as a traditional sdist. I don't fully understand the install process here, but it looks like installation attempts to build the wheel first, which fails then falls back to installing the sdist.

pip install fails on windows

Hi, when trying to pip install dukpy, it fails with the following:

copying dukpy\jsmodules\less\less\visitors\visitor.js -> build\lib.win-amd64-3.9\dukpy\jsmodules\less\less\visitors
      running build_ext
      building 'dukpy._dukpy' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

error: legacy-install-failure
ร— Encountered error while trying to install package.
โ•ฐโ”€> dukpy
note: This is an issue with the package mentioned above, not pip.

Microsoft Visual C++ is a dependency? Is it required to build this package?
Or if I have another c compiler, can I force to use that one?
(windows 10, python 3.9.7)

Release for Python 3.7

Please create a release with wheels for Python 3.7. I've added dukpy as a dependency for my library, PyPAC, but I'm holding off on declaring Python 3.7 support until dukpy has wheels for it on PyPI.

And thanks for your work! I really appreciate it.

[Question] Is evaljs safe?

If I implement a library to, for instance, pull some javascript off the web and evaluate it -- would I open the door to malicious code accessing things that it couldn't if I were running it in the browser?

Compile from a file to a file?

Hey, I'm wondering if DukPy can compile a file rather than a string?

Details

What I mean is that I want to be able to provide the path to a CoffeeScript or TypeScript file and the name of an output file and have DukPy do the compilation for me. Something like this:

import dukpy
dukpy.coffee_compile('file.coffee', 'file.js')

OR

import dukpy
dukpy.typescript_compile('file.ts', 'file.js')

Im currently using another package called libsass-python for compiling Sass and Scss files to CSS and it offers this functionality. Would be great if DukPy could do the same!

I know I could write this functionality myself by getting a Python script to read a file into a string variable, pass that sting variable to the DukPy compile function and then write the output to a file. I just thought I would first check to see if this functionality already exists... don't want to reinvent the wheel!

some emoji not supported

I'm getting an error when the js code contains a special emoji.

MWE:
dukpy.evaljs("var data = '๐Ÿ’ซ'; data")

Error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 1: invalid continuation byte

Thank you

Thread safety

I'm curious if anyone knows what (if any) calls to dukpy are thread safe?

From what I have been able to gather so far. The safest bet is to instantiate dukpy.JSInterpreter() for each 'thread/request' in a web app. The downside to this is having to load any library javascript code durring the request.

Is this not safe?

app = Flask(__name__)
jsi = JSInterpreter()
jsi.evaljs(libs_js)

@app.route('/'):
def index():
      jsi.eval(request_js)
     ...

Is this the 'correct' way?

app = Flask(__name__)

@app.before_request
def before_request():
      g.jsi = JSInterpreter()
      g.jsi.evaljs(libs_js)

@app.route('/'):
def index():
      g.jsi.eval(request_js)
     ...

Is let keyword not supported?

I passed a JavaScript file I have been working on into dukpy's evaljs and got an error. I found the offending line and did some testing and discovered that it doesn't like the let keyword. Some examples of what I used are:

let a;
let b = 5;
let c='hello world';

Each line above (which is valid JavaScript) results in this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\HPOWNE~1\DOCUME~1\CHRIST~1\projects\TDP\thea\KIVY_V~1\lib\site-packages\dukpy\evaljs.py", line 57, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: SyntaxError: unterminated statement (line 1)
        src\pyduktape.c:1
        duk_js_compiler.c:6594

It would seem as if the let keyword is not supported. Is there a reason for that or has it simply not been added yet?

Better packaging

Hi,

There's a few ways of improving this distribution package:

  • integrate setuptools_scm into setup.py to enable version guessing via git tag โ€” you'll never need to hardcode the version in Python files;
  • enable automatic deployment of the package to PYPI via TravisCI on git tag created.

Would you accept my help with this?

Have a duckpy context that lasts for more than more tha one .evaljs() call

Hi @amol-,

this is a feature request, not a bug.

As you maybe remember, i'm using duckpy with babeljs to compile ES6+ javascript to ES5 js.
In this use case, evaluating the babeljs minified source code which is 750 KB takes time and this slows down the overall per-file translation time. If the number of code blocks (or files) to translate is known this can be resolved with an evaljs() wrapper that handles such multiple blocks. Unfortunately this doesn't cover all the use cases where it would be nice to have a js interpreter already "hot", waiting for translation job... but let me contextualize a bit.

I'm using duckpy together with metapensiero.pj (AKA Javascripthon)
to transpile anything ranging from a tree of Python 3.5 source files to a code object (a class, a function) to ES6+ JS and then to ES5 with babeljs.

Having an "hot" duckpy interpreter, with all the babeljs code already loaded would mean that converting and serving python-ish code to the client becomes possible if the client has loaded the dependencies already.

UnicodeDecodeError: 'utf-8' codec can't decode byte

Hi,

Im getting this error on render.com:

Traceback (most recent call last):
Nov 17 03:33:06 AM    File "kaktos.py", line 6, in <module>
Nov 17 03:33:06 AM      system.process_command()
Nov 17 03:33:06 AM    File "/opt/render/project/src/modules/system.py", line 122, in process_command
Nov 17 03:33:06 AM      run(command_params)
Nov 17 03:33:06 AM    File "/opt/render/project/src/modules/commands/build.py", line 12, in run
Nov 17 03:33:06 AM      system.build_pages()
Nov 17 03:33:06 AM    File "/opt/render/project/src/modules/system.py", line 85, in build_pages
Nov 17 03:33:06 AM      assets.build_js()
Nov 17 03:33:06 AM    File "/opt/render/project/src/modules/assets.py", line 44, in build_js
Nov 17 03:33:06 AM      b.write(minify_js(og.read()))
Nov 17 03:33:06 AM    File "/opt/render/project/src/modules/assets.py", line 21, in minify_js
Nov 17 03:33:06 AM      result = str(es5(babel_compile(str(code))["code"]))
Nov 17 03:33:06 AM    File "/opt/render/project/src/.venv/lib/python3.8/site-packages/dukpy/babel.py", line 13, in babel_compile
Nov 17 03:33:06 AM      return evaljs(
Nov 17 03:33:06 AM    File "/opt/render/project/src/.venv/lib/python3.8/site-packages/dukpy/evaljs.py", line 138, in evaljs
Nov 17 03:33:06 AM      return JSInterpreter().evaljs(code, **kwargs)
Nov 17 03:33:06 AM    File "/opt/render/project/src/.venv/lib/python3.8/site-packages/dukpy/evaljs.py", line 31, in __init__
Nov 17 03:33:06 AM      self._init_process()
Nov 17 03:33:06 AM    File "/opt/render/project/src/.venv/lib/python3.8/site-packages/dukpy/evaljs.py", line 87, in _init_process
Nov 17 03:33:06 AM      self.evaljs("process = {}; process.env = dukpy.environ", environ=dict(os.environ))
Nov 17 03:33:06 AM    File "/opt/render/project/src/.venv/lib/python3.8/site-packages/dukpy/evaljs.py", line 61, in evaljs
Nov 17 03:33:06 AM      return json.loads(res.decode('utf-8'))
Nov 17 03:33:06 AM  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 6510: invalid continuation byte

Do you know what can be wrong?

Help building dukpy filter

Hi,

I need help with building a dukpy filter. I am trying to build tools to create vue.js assets via webassets.
I copied the logic in the less filter. When I run the tests I just get:

  JSRuntimeError: SyntaxError: unterminated statement (line 2). 

However the file pointed to is the package.json file. The full code is in my fork at..

 https://github.com/kevingill1966/dukpy

Full traceback is in

  https://github.com/kevingill1966/dukpy/blob/master/PROBLEM.rst

Summary traceback...

File "/srv/insight_nrn/submodules/dukpy/dukpy/webassets/vuejsfilter.py", line 24, in input
src = dukpy.vue_template_compiler(_in.read(), options=options)
File "/srv/insight_nrn/submodules/dukpy/dukpy/vuejs.py", line 18, in vue_template_compiler
options=options
File "/srv/insight_nrn/submodules/dukpy/dukpy/evaljs.py", line 57, in evaljs
res = _dukpy.eval_string(self, jscode, jsvars)
JSRuntimeError: SyntaxError: unterminated statement (line 2)
vue-template-compiler/package.json:2
duk_js_compiler.c:6594
anon native strict preventsyield
anon vue-template-compiler:5 preventsyield
require native strict preventsyield
eval src/pyduktape.c:1 preventsyield

Trailing commas not supported inside Array constructor

In evaljs, trailing commas are allowed in array declarations, but when using Array constructors, it causes a crash:

import dukpy
testArray1 = '''
var array1 = [1, 2, 3, ];
array1.reduce(function(a, b) { return a + b; }, 0);
'''
print(dukpy.evaljs(testArray1))

testArray2 = '''
var array2 = new Array(1, 2, 3, );
array2.reduce(function(a, b) { return a + b; }, 0);
'''
print(dukpy.evaljs(testArray2))
~ $ python3 test.py
6
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    print(dukpy.evaljs(testArray2))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dukpy/evaljs.py", line 134, in evaljs
    return JSInterpreter().evaljs(code, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dukpy/evaljs.py", line 57, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: SyntaxError: empty expression not allowed (line 2)
	src/pyduktape.c:2
	duk_js_compiler.c:4731

Mac Mojave python3.7 install error

I want to install pyecahrts ,but it happened some error ,looks like Dukpy error, so I pip3 install dukpy.
Then this error happened:

Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/lj/k3xsm5p51j78fgjswrcty33m0000gn/T/pip-install-cf5q7g6j/dukpy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/lj/k3xsm5p51j78fgjswrcty33m0000gn/T/pip-record-ump5c0lu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/lj/k3xsm5p51j78fgjswrcty33m0000gn/T/pip-install-cf5q7g6j/dukpy/

How can I do?

Invalid link in the error warning

Pyecharts user pointed out that the link in the following error message is no longer valid. Could you please see if you could address this issue in your next release?

Running setup.py install for dukpy: finished with status 'error'
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

Reference:

pyecharts/pyecharts#646

Dependency update

Hi,

Thanks for developing and maintaining dukpy!

I stumbled into a situation that makes me think that dukpy needs to update its dependencies:

I need to babel-transpile KaTeX and noticed that this does not currently work with dukpy; I get the following error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 49: invalid continuation byte

This is caused by a regex in KaTeX (https://github.com/KaTeX/KaTeX/blob/master/src/Lexer.js#L39) containing a unicode code point. Babel 6.14 - as currently used in dukpy - wrongly transforms it into the code point literal.
(An interesting point is that the error is raised "by chance", because this code point happens to represent a unicode surrogate, which Python's utf-8 disallows decoding.)

This is clearly a bug in babel 6.14, that was later fixed. Modifying dukpy to use the latest babel-standalone 6.x (currently 6.26, e.g. from https://github.com/babel/babel-standalone/releases/download/release-6.26.0/babel.min.js) fixes this issue.

A second problem arises when one tries to use dukpy with the newer babel-standalone 7.x: duktape then fails:

  File "/home/.../.local/share/virtualenvs/fsjm-django/lib/python3.7/site-packages/dukpy/evaljs.py", line 136, in evaljs
    return JSInterpreter().evaljs(code, **kwargs)
  File "/home/.../.local/share/virtualenvs/fsjm-django/lib/python3.7/site-packages/dukpy/evaljs.py", line 57, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: RangeError: register limit (line 1)
	src/pyduktape.c:1
	duk_js_compiler.c:1376

I did not try to make dukpy use a newer duktape release.

So:

  • It seems necessary (and AFAICS easy) to upgrade the integrated babel standalone to the latest 6.x.
  • Bumping duktape may also be considered.

Thanks!

"dukpy is currently not production ready"

This is stated in the README.rst file.

Since production ready is likely a fairly subjective status, what steps would it take to remove this status?

The inclusion of this library in the new version of pypac - which my team uses - has led us to wonder how we could change this status.

Math.trunc not supported by evaljs

In dukpy.evaljs, the math function Math.trunc raises the exception _dukpy.JSRuntimeError: TypeError: undefined not callable. Other math functions, such as Math.floor, work.

To reproduce in Python 3 (tested in 3.6.9):

>>> import dukpy
>>> print(dukpy.evaljs("Math.trunc(2.3)"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxx/.local/lib/python3.6/site-packages/dukpy/evaljs.py", line 134, in evaljs
    return JSInterpreter().evaljs(code, **kwargs)
  File "/home/xxx/.local/lib/python3.6/site-packages/dukpy/evaljs.py", line 57, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: TypeError: undefined not callable
        duk_js_call.c:776
        eval src/pyduktape.c:1 preventsyield
>>> print(dukpy.evaljs("Math.floor(2.3)"))
2

Dukpy leaks memory

Tested with Python 3.5.3 from master branch

The issue can be seen with:

import dukpy
import psutil

for i in range(100):
    dukpy.evaljs("var o = {'value': 5}; o['value'] += 3; o")
print(psutil.virtual_memory())

Increase the value 100 to see larger leaks.

Cannot install webpack due to eslint-scope's folder structure

I tried installing webpack via dukpy.install_jspackage but it fails because some dependencies do not have a package folder in the .tgz file:

import dukpy

dukpy.install_jspackage("webpack", "5.59.0", "assets_dl/")
Packages going to be installed: webpack->5.59.0, @types/eslint-scope->3.7.1, @types/eslint->7.28.1, @types/estree->0.0.50, @types/json-schema->7.0.9, @types/estree->0.0.50, @types/estree->0.0.50, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/wasm-edit->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-buffer->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-wasm-section->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-buffer->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/wasm-gen->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, @webassemblyjs/wasm-gen->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, @webassemblyjs/wasm-opt->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-buffer->1.11.1, @webassemblyjs/wasm-gen->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, @webassemblyjs/wasm-parser->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, @webassemblyjs/wasm-parser->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, @webassemblyjs/wast-printer->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/wasm-parser->1.11.1, @webassemblyjs/ast->1.11.1, @webassemblyjs/helper-numbers->1.11.1, @webassemblyjs/floating-point-hex-parser->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/helper-api-error->1.11.1, @webassemblyjs/helper-wasm-bytecode->1.11.1, @webassemblyjs/ieee754->1.11.1, @xtuc/ieee754->1.2.0, @webassemblyjs/leb128->1.11.1, @xtuc/long->4.2.2, @webassemblyjs/utf8->1.11.1, acorn->8.5.0, acorn-import-assertions->1.8.0, browserslist->4.17.4, caniuse-lite->1.0.30001270, electron-to-chromium->1.3.873, escalade->3.1.1, node-releases->2.0.0, picocolors->1.0.0, chrome-trace-event->1.0.3, enhanced-resolve->5.8.3, graceful-fs->4.2.8, tapable->2.2.1, es-module-lexer->0.9.3, eslint-scope->5.1.1, esrecurse->4.3.0, estraverse->5.2.0, estraverse->4.3.0, events->3.3.0, glob-to-regexp->0.4.1, graceful-fs->4.2.8, json-parse-better-errors->1.0.2, loader-runner->4.2.0, mime-types->2.1.33, mime-db->1.50.0, neo-async->2.6.2, schema-utils->3.1.1, @types/json-schema->7.0.9, ajv->6.12.6, fast-deep-equal->3.1.3, fast-json-stable-stringify->2.1.0, json-schema-traverse->0.4.1, uri-js->4.4.1, punycode->2.1.1, ajv-keywords->3.5.2, tapable->2.2.1, terser-webpack-plugin->5.2.4, jest-worker->27.3.1, @types/node->16.11.1, merge-stream->2.0.0, supports-color->8.1.1, has-flag->4.0.0, p-limit->3.1.0, yocto-queue->0.1.0, schema-utils->3.1.1, @types/json-schema->7.0.9, ajv->6.12.6, fast-deep-equal->3.1.3, fast-json-stable-stringify->2.1.0, json-schema-traverse->0.4.1, uri-js->4.4.1, punycode->2.1.1, ajv-keywords->3.5.2, serialize-javascript->6.0.0, randombytes->2.1.0, safe-buffer->5.2.1, source-map->0.6.1, terser->5.9.0, commander->2.20.3, source-map->0.7.3, source-map-support->0.5.20, buffer-from->1.1.2, source-map->0.6.1, watchpack->2.2.0, glob-to-regexp->0.4.1, graceful-fs->4.2.8, webpack-sources->3.2.1
Fetching https://registry.npmjs.org/webpack/-/webpack-5.59.0.tgz..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Fetching https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz...
Traceback (most recent call last):
  File "/usr/lib/python3.9/shutil.py", line 814, in move
    os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpgi47tjcg/package' -> '[...]/assets_dl/@types/eslint-scope'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "[...]/dl_webpack.py", line 3, in <module>
    dukpy.install_jspackage("webpack", "5.59.0", "assets_dl/")
  File "[...]/lib/python3.9/site-packages/dukpy/install.py", line 82, in install_jspackage
    shutil.move(os.path.join(tmpdir, 'package'),
  File "/usr/lib/python3.9/shutil.py", line 834, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.9/shutil.py", line 443, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.9/shutil.py", line 265, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpgi47tjcg/package'

Wheel file for Python 3.9?

We are in a situation where it is difficult to ensure that MS Build Tools is installed on a machine that is using pip install-ing dukpy. As wheel files have not been uploaded to PyPI for Python 3.9 this results in a failed installation for us. Although we can come up with workarounds on our side, we figured other users may have the same problem. Is there any appetite for uploading 3.9 .whl files for the latest release?

Thanks for reading.

'unistd.h' not found - Compilation under Windows + VisualStudio fails

Hello,

I came to your lib via javascripthon. Do you have any plan to support windows build?

Thanks

Here are the errors:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I.\src\duktape -IC:\Python35-x64\include -IC:\Python35-x64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt" /Tcsrc\duktape\duktape.c /Fobuild\temp.win-amd64-3.5\Release\src\duktape\duktape.obj
336    duktape.c
337    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I.\src\duktape -IC:\Python35-x64\include -IC:\Python35-x64\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\winrt" /Tcsrc\_support.c /Fobuild\temp.win-amd64-3.5\Release\src\_support.obj
338    _support.c
339    src\_support.c(1): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
340    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
341    
342    ----------------------------------------
343Command "C:\Python35-x64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-build-i9t2zpp9\\dukpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\appveyor\AppData\Local\Temp\1\pip-46n0b6pn-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\appveyor\AppData\Local\Temp\1\pip-build-i9t2zpp9\dukpy\

Error: cannot find module: path

I'm trying to run less.js with dukpy, but the library appears to use the Node.js path module which seems to be unavailable with dukpy.

Is this fixable?

(venv) rav@gonzales:~/dukpy$ dukpy-install less
Packages going to be installed: less->2.7.1, image-size->0.5.0, source-map->0.5.6, graceful-fs->4.1.5, mime->1.3.4, errno->0.1.4, prr->0.0.0, promise->7.1.1, asap->2.0.4, mkdirp->0.5.1, minimist->0.0.8
Fetching https://registry.npmjs.org/promise/-/promise-7.1.1.tgz..........................
Fetching https://registry.npmjs.org/image-size/-/image-size-0.5.0.tgz.......
Fetching https://registry.npmjs.org/asap/-/asap-2.0.4.tgz...........
Fetching https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz.......................................................................................................................................................................................
Fetching https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.5.tgz........
Fetching https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz......
Fetching https://registry.npmjs.org/prr/-/prr-0.0.0.tgz....
Fetching https://registry.npmjs.org/mime/-/mime-1.3.4.tgz............
Fetching https://registry.npmjs.org/errno/-/errno-0.1.4.tgz......
Fetching https://registry.npmjs.org/less/-/less-2.7.1.tgz...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Fetching https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz.....
Installing less in ./js_modules Done!
(venv) rav@gonzales:~/dukpy$ python
Python 3.5.2 (default, Jun 28 2016, 08:46:01) 
[GCC 6.1.1 20160602] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dukpy.evaljs import evaljs
>>> evaljs('require("less")')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ssd/home/venvs/kasse/lib/python3.5/site-packages/dukpy/evaljs.py", line 119, in evaljs
    return JSInterpreter().evaljs(code, **kwargs)
  File "/ssd/home/venvs/kasse/lib/python3.5/site-packages/dukpy/evaljs.py", line 53, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: Error: cannot find module: less
    anon src/pyduktape.c:5 preventsyield
    require  native strict preventsyield
    eval src/pyduktape.c:1 preventsyield

Trying to import the path module directly similarly fails:

>>> interpreter = dukpy.JSInterpreter()
>>> interpreter.loader.register_path('./js_modules')
>>> interpreter.evaljs('require("path")'
... )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ssd/home/venvs/kasse/lib/python3.5/site-packages/dukpy/evaljs.py", line 53, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: Error: cannot find module: path
    anon src/pyduktape.c:5 preventsyield
    require  native strict preventsyield
    eval src/pyduktape.c:1 preventsyield
>>> interpreter.evaljs('require("./path")')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ssd/home/venvs/kasse/lib/python3.5/site-packages/dukpy/evaljs.py", line 53, in evaljs
    res = _dukpy.eval_string(self, jscode, jsvars)
_dukpy.JSRuntimeError: Error: cannot find module: path
    anon src/pyduktape.c:5 preventsyield
    require  native strict preventsyield
    eval src/pyduktape.c:1 preventsyield

Propagating exceptions inside call_python()

This is more of a feature request.

Currently, if there is an exception inside a function called with call_python(), it ends up being consumed by dukpy and gets translated into a dukpy.JSRuntimeError.

However, dukpy itself seems to have all the necessary information to just rethrow this exception to the caller of evaljs(), which would be more useful for error handling. If preserving existing behaviour is necessary, maybe it could be an optional argument to evaljs() that is set to False by default.

Is this something that could be added?

fatal error C1083: Cannot open include file: 'unistd.h': No s uch file or directory

(py35) C:\Users\Batman>easy_install dukpy
Searching for dukpy
Reading https://pypi.python.org/simple/dukpy/
Downloading https://pypi.python.org/packages/37/ac/b0bb18515ada37defe2d2a44471fc
114264c3c5f435b4d2d23432537c239/dukpy-0.1.0.tar.gz#md5=09c90bf96c552b33d99a11911
cff8d0a
Best match: dukpy 0.1.0
Processing dukpy-0.1.0.tar.gz
Writing C:\Users\Batman\AppData\Local\Temp\easy_install-0ykfkg6z\dukpy-0.1.0\set
up.cfg
Running dukpy-0.1.0\setup.py -q bdist_egg --dist-dir C:\Users\Batman\AppData\Loc
al\Temp\easy_install-0ykfkg6z\dukpy-0.1.0\egg-dist-tmp-tf5yv703
duktape.c
_support.c
src_support.c(1): fatal error C1083: Cannot open include file: 'unistd.h': No s
uch file or directory
error: Setup script exited with error: command 'C:\Program Files (x86)\Microso
ft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

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.