Julia online compiler

The Go Playground dates way back to 2010:

5 Likes

And thatā€™s tied to the language developers as well. As for whether thereā€™s an online playground/compiler/REPL for any given language, Iā€™d hazard a guess that any language anyone cares about will have at least one third-party project somewhere because creating one is a lot easier than updating or scaling one, especially if part of a larger project hosting several languages. Even Brainfuck has a few.

I agree this would be great, but itā€™s hard. There are numerous issues, both technical and non-technical. Some are common to all languages, but Julia has a few additional considerations that are extra-challenging.

  • Experience: The point of such a thing ā€” especially if itā€™s an official resource hosted by the language itself ā€” is to give folks a positive first experience with the language. Itā€™s gotta work and itā€™s gotta work well.
  • Security: Remote code execution is the holy grail for attackers, and this is literally remote code execution. Yes, there is lots of prior art on sandboxing and the like here that we can lean on, but itā€™s still something that takes knowledge and skill to get right.
  • Cost: Unless thereā€™s a WASM or JS front-end, someone is paying for this compute, even without abuse itā€™s not insignificant.
  • Abuse: Compute is inherently valuable. Thereā€™s literally a cost to it, and crypto currencies have granted a viable mechanism for exfiltrating that value. Yes, even without GPUs, attackers will try to play the hash lottery on any machine they can pwn.
  • Implementation and maintenance: Someoneā€™s gotta implement, maintain, and monitor all of the above. Is that person you?

Those are all common to all languages, and ā€” as evidenced ā€” definitely arenā€™t insurmountable. The hardest bit is the person to do it; thatā€™s a zero-sum game that competes with everything else everyone is already doingā€¦ unless you get involved!

Both Julia and Juliaā€™s users make this even harder:

  • Interactivity: The experience most Julia programmers expect an interactive REPL or notebook, not just a compiler with print statements.
  • Plots: Again, this is pointing towards what folks expect and what would make a positive experience. The first thing many folks do is try a plot. This isnā€™t necessarily hard, butā€¦
  • TTFX: Without persistent sessions, youā€™re in Juliaā€™s worst state. Youā€™ll have to do some hard work to choose what packages to precompile and the like.
  • Memory: The way to reduce costs is to throw everyone on a single machine. Everyone will compete for time on the CPU, but thatā€™s ok, it neednā€™t be blazingly fast. But unlike the CPU, everyoneā€™s gotta fit in memory at the same time. And every interactive Julia process takes up lots of memory, especially if you want to plot or the like. This puts a pretty hard limit on the number of concurrent users and explodes the above costs.
8 Likes

On repl.it one can run Julia. Granted, perhaps not the latestā€¦

2 Likes

Hi,
I am a newbie in Julia but not in server configuration. I can help Julia team with security and server configuration. Also, a subdomain and a small amount of space is free for Julia team. Maybe Julia team can talk to some companies about sponsorship.

Hi,
Server load? You can limit the lines of code to compile.

Hi,
Yes. They did by the third parties, but some compiler developers do this themselves.

Hi,
Those sites are just a user interface to the compiler.

Hello,
You wrong:

1- Swift Online Compiler

2- Go Playground - The Go Programming Language

Hello,
I am a novice when it comes to programming, but I have experience in server setup and security. If you would like, I can introduce you to someone who has experience but specializes in server setup and virtualization.
It doesnā€™t cost much to reserve a subdomain and a small amount of server space. Iā€™m sure the Julia team could hire companies to do this. Look at other languages ā€‹ā€‹where developers or fans have done this. Why shouldnā€™t Julia have something like this? It could help the Julia community grow.
In terms of securing the server, security can also be provided by applying a series of restrictions, such as limiting the number of lines of code that the website can execute, limiting functions, etc.

In one line I can also call to solve a travelling salmon problem or some bit coin mining. So number of code lines is maybe not enough.

4 Likes

One of the issues with the WASM REPL is it takes ages to download. Maybe once juliac is live, it would be easier to compile a more limited version for a browser local REPL experience.

Way more complicated but I think possible, could be rewiring the Pluto backend so that it could be driven from a WASM runtime instead of a server. That would make showing plots and other Julia essentials easier.

2 Likes

Hi,
How do I notify the core Julia developers?

Youā€™re talking to them here :grin:

But bigger picture, ā€œnotifying themā€ of your desire doesnā€™t create funding or personal bandwidth to take on your project for anyone else.

Open source is one of those ā€œbe the change you want to see in the worldā€ kinda things! If you decide to take this on, the community would be happy to help!

4 Likes

Keno has a cool proof of concept of a Pluto notebook using Julia in WASM.

The Julia core developers are working on how to run Julia in a browser. For instance, Jeff gave this presentation two years ago.

When completed, it would bring new opportunities to Julia, including a playground similar to what other programming languages have.

:fish: :luggage:

17 Likes

Oh, darn autocorrect. Well, now it is salmons travelling, that can of course not be changed. Salesmen are out.

8 Likes

I didnā€™t even register that as a typo, I thought well heā€™s in Norway, they must have some advanced salmon modeling there

17 Likes

It was a typo + autocorrect, but sure we also do have quite nice salmon modelling.

But we are getting a bit off track. A compiler online would be nice I think, but probably unrealistic.

2 Likes

A few lines of code can do quite a lot of harm; with no memory limits, I could allocate a massive array and stop anyone else from starting their own REPLs. The Rust playground limits the memory and time for AOT compilation and execution; this is far less straightforward for an interactive REPL and JIT compilation. Imagine if the REPL just quits after 10 seconds, or if it crashes because dynamic dispatches in a loop compiled too much.

Limitations have to be carefully designed because things like limiting users to a number of lines or expressions does the opposite of showcasing a languageā€™s capabilities. Despite the limitations, the Rust playground goes to the trouble of providing 100 crates and IDE-like features so people can try out the best of Rust, not waste their limited compilation time reimplementing it. Itā€™s really not as simple as leaving the base language up for grabs on a server; a lot of work specific to the language is needed to make these online playgrounds last. Bear in mind the competition isnā€™t other languagesā€™ playgrounds, itā€™s the relative ease of downloading Julia and trying it out locally.

7 Likes