The Go Playground dates way back to 2010:
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.
On repl.it
one can run Julia. Granted, perhaps not the latestā¦
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,
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.
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.
Hi,
How do I notify the core Julia developers?
Youāre talking to them here
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!
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.
Oh, darn autocorrect. Well, now it is salmons travelling, that can of course not be changed. Salesmen are out.
I didnāt even register that as a typo, I thought well heās in Norway, they must have some advanced salmon modeling there
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.
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.