JoelOtter / kajero

Interactive JavaScript notebooks with clever graphing
Other
1.87k stars 110 forks source link

Add support for executing code in other languages #39

Open plainas opened 8 years ago

plainas commented 8 years ago

Coffescript is the obvious candidate for the first next supported languages, because of it's golden rule "it's just javascript". But a multitude of other languages that compile to javascript or run on a browser VM would be nice. Of course, there is the risk of bloat.

Purescript, APL, scala, I personally find these much more suited for processing batches of tabular data.

Could you briefely outline the procedure for adding support for other languages? Other forks could be maitained with focus on other languages.

JoelOtter commented 8 years ago

Code execution currently happens in the file reducers/executionReducer.js - you may wish to read up on Redux before making changes there.

Adding support for other languages is something I'd very much like to look into, and there have been a fair few requests for it. Rather than adding support directly to the codebase, though, or forking, I would prefer to build out something more general. Perhaps some form of external module loader. The JSPM CDN could be of use here.

To reiterate the word of warning on the README - I'm currently not accepting pull requests on this project, as I have to submit it as part of my master's dissertation at the end of June and it should really be my own work. That is to say - for now, at least, I'll try and get this feature in myself. 😄

(Unless you want to make a CoffeeScript fork or something; that's entirely your call! We could maybe maintain a list of forks in the README here if people want to do that.)

CreativeCode commented 7 years ago

I was wondering how difficult it would be to execute processing.js code. If I understand it correctly, Processing.js is a javascript port of the Processing language. Therefor, I was hoping that importing the processing.js library in the header of my HTML file would suffice. However, this does not seem to be the case... Any advice on how to proceed to use Kajero for displaying/executing/sharing Processing sketches (either using Processing.js or another solution) is very welcome.

JoelOtter commented 7 years ago

@CreativeCode I've not really used Processing, but from this page it would seem you can call the compiler from a code block and point it at the correct drawing surface.

Of course, this would require your Processing code to be represented as a string value; the code block would still be JavaScript. To execute Processing "natively", you're going to need to fork Kajero.

CreativeCode commented 7 years ago

Thanks @JoelOtter for your pointers!