Git Product home page Git Product logo

microsoft / node-v0.12 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nodejs/node-v0.x-archive

777.0 106.0 42.0 167.09 MB

Enable Node.js to use Chakra as its JavaScript engine.

Home Page: http://nodejs.org/

License: Other

Makefile 0.46% Shell 0.12% JavaScript 36.22% Ruby 0.02% C 28.09% C++ 10.52% Python 17.28% R 0.02% DTrace 0.41% Batchfile 0.19% Roff 0.16% Emacs Lisp 0.14% Perl 0.07% CSS 0.09% HTML 2.53% Lua 3.66%

node-v0.12's Introduction

Evented I/O for javascript.

Node.js uses the V8 JavaScript engine by default. This project enables Node.js to optionally use the Chakra JavaScript engine on Windows 10, allowing Node.js to run on Windows 10 IoT. Our goal is to merge back into master after stabilizing this code, fixing key gaps and responding to early community feedback.

How it works

To enable building and running Node.js with the Chakra JavaScript engine, we created a V8 API shim on top of the Chakra runtime hosting API ([JSRT] (https://msdn.microsoft.com/en-us/library/dn249673(v=vs.94).aspx)). This shim implemented most essential V8 APIs so that the underlying JavaScript engine change is transparent to Node.js and other native addon modules written for V8. All we need is to rebuild node.exe and native addon modules with Chakra.

How to get started

You will need the following installed on your PC to start using Node.js with Chakra

Checkout IoT specific instructions and samples here.

How to build (with Chakra on Windows)

In addition to the above installations. You will need to install Python 2.6 or 2.7 to build Node.js for Chakra

To build node.exe:

vcbuild chakra nosign [x86|x64|arm]

Original README

Read original node.js README here.

node-v0.12's People

Contributors

andreasmadsen avatar bnoordhuis avatar cjihrig avatar creationix avatar felixge avatar henryrawas avatar indutny avatar isaacs avatar jacksontian avatar kapouer avatar koichik avatar mikeal avatar miksago avatar mmalecki avatar mranney avatar mscdex avatar orangemocha avatar pgriess avatar piscisaureus avatar pquerna avatar rsms avatar ry avatar saghul avatar sam-github avatar shama avatar thughes avatar tjfontaine avatar tootallnate avatar trevnorris avatar yorkie 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  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

node-v0.12's Issues

Clarify supported platforms for ChakraNode

I've seen some confusion from devs related to the supported OSs for ChakraNode.
I think it comes down to the readme having notes about Unix/Macintosh.

This could be resolved with a more explicit message about support.

Path to python does not have quotes

In the configure script, the PYTHON variable is missing quotes around it (PYTHON=c:\Program Files\Python\python). This causes problems compiling the code on Windows 8.1

Thank you!

Native addons

Given most native addons use the V8 APIs, is there any plans from Microsoft to either contribute something to nan, so that it allows addons to be compatible with Chakra, or some guidelines to port native modules?

Also #9 is relevant too at this point.

Why wouldn't we just create a script to install applications ?

Dear,

Why wouldn't we just create a script called npm.cmd like in the legacy nodeJS and add it to the path ?

:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
) ELSE (
  node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
)

With that kind of script, we will be able to use :

npm install package

patchTypedArrays issues in chakra_shim.

I noticed some issues with patchTypedArrays.

The additions are missing toString functions that mimic their original built-ins, e.g.
function slice() { [native code] }, and instead return their shim source.

This affects lodash's check to see whether ArrayBuffer#slice is built-in:

_.isNative(ArrayBuffer.prototype.slice);
// => false

I also noticed issues with the overwritten TypedArray#set method. It performs a first instanceof Array check which causes set not to work correctly when passed a typed array.

I'm not sure why the methods are wrapped but they could hold a reference to their original method and defer to it when not needing the custom behavior. For example:

Float64Array.prototype.set = (function(func) {
  function set(array) {
    var offset = arguments[1];
    if (somethingToBranchFor) {
      /* do custom stuff */
    }
    return func.apply(this, arguments);
 }

 function toString() {
   return func.toString();
 }
 Object.defineProperty(set, 'toString', Object.getOwnPropertyDescriptor(func, 'toString')); 
 return set;
}(Float64Array.prototype.set));

native addon compiling problem

Hello, I apologize if this isn't the right place to post this, but I've been trying to build the curve25519 addon and I keep coming up with a lot of errors.
Most of the errors seem related to v8 files. Could you point me in the rigth direction?

Here are the error I got:
image

and here the code that doesn't compile:

image

process.versions.chakra

I see there's process.versions.chakra with a value of 11.0.10056.0 and wondering what it maps to.
Is that really the version number?

node.exe fails on Win10 ver 1511 with "Failed to initialize context"

Reproduced it on two Win10/x64 PCs after updating them to ver 1511.
Was able to fix it by the following change to chakra_shim.js:

    diff --git a/deps/chakrashim/lib/chakra_shim.js b/deps/chakrashim/lib/chakra_shim.js
    index 29adee1..79d287c 100644
    --- a/deps/chakrashim/lib/chakra_shim.js
    +++ b/deps/chakrashim/lib/chakra_shim.js
    @@ -390,8 +390,8 @@
           arr.push(Object_getOwnPropertyDescriptor(x, 'caller').get);

           var x = createEmptyStrictModeFunction();
    -      arr.push(Object_getOwnPropertyDescriptor(x, 'caller').get);
    -      arr.push(Object_getOwnPropertyDescriptor(x, 'arguments').get);
    +      arr.push(Object_getOwnPropertyDescriptor(x.__proto__, 'caller').get);
    +      arr.push(Object_getOwnPropertyDescriptor(x.__proto__, 'arguments').get);
           arr.push(Object_getOwnPropertyDescriptor(x(), 'callee').get);

           return arr;

Memory issue?

This is most probably an underlying engine (chakra) issue instead of the interface. Below code would end up showing out of memory error for V8(node/jxcore), works without a problem for SpiderMonkey(jxcore) and shows undefined behavior for chakra build.

jx / node.exe -pe "var arr=new Array(1e8); for(var i=0;i<1e8;i++) arr[i]=2 + (i%2); arr[1e6]"

produces undefined on ARM. If I check the value for arr[1e3], the result is 2 as expected. I would expect either out of memory error or showing the same result for both indexes.

Am I missing a point here ?

Building issues

Hello, I apologize if this isn't the right place to post this, But I've been trying to build this and I keep coming up with tons of errors

I have all the prerequisites except for Windows 10 tools, which this page said was included with VS 2015
https://dev.windows.com/en-us/downloads/windows-10-developer-tools

Most of the errors/warnings are about v8 files, could anyone point me in the right direction?

Let's get this merged upstream :)

Everyone I've talked to so far would like to find a way to get this merged in to node.js upstream.

What do we need to do? @nodejs/Collaborators @nodejs/TSC

Open Source Chakra / clear things up with whitelisted dll files

Currently, this project lacks of major open source documentations and clarifications.

There's no hint that chakra will ever be open source, so that is kind of a hard issue.
Another issue is that Windows (at least IoT) uses explicitely whitelisted dlls, which may be required for other JIT compilers/runtimes.

Is there any way to use your own JIT in Win10?
I bet the community will deny a forced JIT (if it's not open source), as this is quality level of iOS. And to be honest, it can't get worse than that.

So, please clarify the usage of chakra here. It is nice to see API bindings for Chakra, but they won't have a real-world usecase if the JS engine can't be fixed and be maintained properly with the nodejs / iojs API and occuring bugs.

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.