Author Archives: Julia – Alex Mellnik

Converting Julia to Javascript and WebAssembly

By: Julia – Alex Mellnik

Re-posted from: http://alex.mellnik.net/converting-julia-to-javascript-and-webassembly/

I have a “two language problem”, but not this two language problem.  I often find myself prototyping small data analysis projects in Julia, and then rewriting them as web applications using Angular & Typescript to make them easily accessible to a broad audience.  Much of the work is similar in Julia and Typescript (such as creating plots) so it’s not that annoying to translate, but occasionally I run into analytical code that is really painful to rewrite in Typescript.  Some tasks that I could accomplish in a few lines in Julia (usually with the help of a package) can turn into hundreds of awkward lines in Typescript.

I’ve always dreamed of the day that I could write arbitrary Julia code and have it run in a browser, and while we’re definitely not there yet, we’re getting closer.  One first step forward was made by Tom Short, who developed two distinct ways to generate Emscripten-friendly LLVM bitcode from Julia v0.7.  Recently, Mike Innes (with contributions from Tom) developed a new approach (Charlotte.jl) that works with Julia v0.6 and generates Javascript/WebAssembly directly from Julia.  See the source repositories for details on how to use them, and you can also try both out in your browser using demos that I put together at julia2js.gotfork.net.

Online demos for Flux.jl

By: Julia – Alex Mellnik

Re-posted from: http://alex.mellnik.net/online-demos-for-flux-jl/

I’m currently developing a set of demos for Flux, a slick new Julia machine learning framework.  It’s still under active development and won’t be ready for production use any time soon, but it’s already a very powerful tool and lets you develop models in far less time than would be required with something like PyTorch or TensorFlow.

One of the nice things about Flux is that it’s easy to export trained models to the web with deeplearn.js via FluxJS.  There’s currently demos for a multilayer perceptron and an autoencoder, and more will be added over the next week or two.

Want to solve some differential equations?

By: Julia – Alex Mellnik

Re-posted from: http://alex.mellnik.net/diffeqonline/

Over the past two weeks I’ve been working with Chris Rackauckas on a nifty little project – putting the power of DifferentialEquations.jl into your browser.

Chris, in addition to being the driving force behind DifferentialEquations.jl, did some amazing work getting the startup time down for the service and it now feels pretty snappy. It’s been a great learning experience, and we now have a good idea for what goes into deploying a julia-driven website on a service like Heroku.

If you see any issues or have any suggestions, please let us know! In the meantime, enjoy a Lorenz attractor!