n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.19k stars 185 forks source link

Information - Ño Bug #37

Closed MortalCatalyst closed 9 years ago

MortalCatalyst commented 9 years ago

Just a question to further understand implementation details and future opportunities.

First Thank you for creating and driving this project it's much appreciated.

The ipython project can handle only a dynamic kernel can't it? So nothing that requires compilation Babel/TypeScript etc would not work would they?

n-riesco commented 9 years ago

If the question is whether it would be possible to write a kernel for Babel or Typescript. The answer is yes, although I imagine it requires compiling each cell into Javascript and running on Node.js. This is from a quick search on https://www.npmjs.com :

https://www.npmjs.com/package/babel-repl https://www.npmjs.com/package/tsun

On the other hand, if what you want is to run Coffescript, Babel or Typescript from IJavascript, then you need to install the necessary npm packages and require them from within your code. For example, if you want to run a piece of Coffescript code, you could do:

var cs = require("coffee-script");
cs.eval(
    "if Math.random() >= 0.5 then 'head' else 'tail'"
);

Does this answer your question?

MortalCatalyst commented 9 years ago

Yes thank you. I was interested in being able to try latest JavaScript babel features and TypeScript