andrewray / iocamljs Goto Github PK
View Code? Open in Web Editor NEWAn OCaml javascript kernel for the IPython notebook
License: MIT License
An OCaml javascript kernel for the IPython notebook
License: MIT License
I've packaged up the ocaml-dockerfile bindings with an iocamljs notebook to explain them here:
http://anil-code.recoil.org/ocaml-dockerfile/
This all worked great, but I've just packaged up a refresh of the package and failed to recreate it. The iocamljs kernel now built (with latest opam-repository and OCaml 4.02.3) fails to evaluate the statements when play is pressed, but throws no errors in the JS console either. I'm a little stumped about where to start debugging and wondered if anyone else had this problem.
There's a Dockerfile that builds everything here:
https://github.com/avsm/ocaml-dockerfile/blob/master/Dockerfile.doc
If there's anything obviously wrong would love to know, otherwise will continue debugging.. (the Dockerfile can be run locally via docker build -f Dockerfile.doc . dfile && docker run -p 8888:8888 -d dfile
Hi,
sorry for the naive question. I am trying to put online a small tutorial using static webpages, using a custom iocamljs kernel. I've read the documentation to successfully build my custom kernel.js
but I don't know what to do next. What static files should I copy on my website?
Try any print function (I tried print_int and Printf.printf) in https://andrewray.github.io/iocamljs/min.html or https://andrewray.github.io/iocamljs/full.html.
The output is not visible until you print the next "\n" character.
It is "as if" there is no flush.
There's a partly-working attempt in my gh-pages branch, and a sample notebook online. Here's what's currently working:
.< e >.
and .~e
As the online notebook shows, attempting to run generated code results in an error:
Exception:
Typetexp.Error (<abstr>, <abstr>,
Typetexp.Unbound_module (Longident.Lident "Pervasives")).
The build commands I used to build the partly-working kernel are in the commit message.
Are there plans to make this work with recent dependencies?
It'd be very handy to have a kernel built from the 4.02.1+modular-implicits-ber compiler.
I managed to compile one (kernel.meta-modimp.js
) after pinning a few packages, following a procedure similar to #7 (comment), but it doesn't actually work: it fails with various JavaScript errors, such as
TypeError: IPython.Kernel is not a constructor
TypeError: this.kernel is null
and I'm not sure how best to debug it.
It seems stand-alone kernel.foo.js
doesn't work with split lines in the code. I got the following error message:
[Error] TypeError: undefined is not a function (evaluating 'string.split(/\r\n?|\n/)')
(anonymous function) (codemirror.js, line 5481)
setValue (codemirror.js, line 4689)
(anonymous function) (codemirror.js, line 4888)
set_text (codecell.js, line 366)
fromJSON (codecell.js, line 401)
fromJSON (notebook.js, line 1556)
load_notebook_success (notebook.js, line 1742)
i (jquery.min.js, line 3)
l (jquery.min.js, line 3)
fireWith (jquery.min.js, line 3)
k (jquery.min.js, line 5)
(anonymous function) (jquery.min.js, line 5)
Setting both options leads to undefined results (seems that -static
is ignored)
Hello there @andrewray,
I tried to download the code from master or gh-pages branch, or to "save as" the web page (e.g., full402.html), but I keep failing to have a working local version of this static webpage.
Could you please explain what I should do, in order to be able to deploy the static web pages (like full402.html) to a personal server, but without building them?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.