Anything like the Sage cell server in Julia, or planned for Julia?


#1

Not sure how to tag this, but it seems a request for discussion of a new interface, so probably belongs under Development.

I am wondering if anything like the Sage cell server is possible, desirable and contemplated in/for Julia?

My immediate need is for using PreTeXt to write some course material and/or books (see https://mathbook.pugetsound.edu/). The Sage cell server is a way to short bits of Sage code within a browser, usually via HTML but more generally from some XML application as is the case with PreTeXt. (See https://sagecell.sagemath.org/, https://www.sagemath.org/ and https://en.wikipedia.org/wiki/SageMath).

Madrid Autonomous University’s maths dept even have a Sage cell server anybody can call on via HTML in a web page. Bit like a tiny JuliaBox, one cell at a time and no need to log in …

My perception is that this might be difficult to do efficiently in Julia, unless the cell server is purely local and loads a number of additional packages beyond Core and Base (perhaps specified by the user setting up the server), so that when a cell runs on the server it is basically a REPL with those packages (possibly even user-defined modules) available. In that case, it would start a new REPL each time, with a new workspace, so it might have noticeable lag. Even so it might be OK for course-work interface I force my students to use ;-).


#2

Are you looking for something like JuliaBox?


#3

No, looking for something weaker. JuliaBox fires up and runs a whole
environment, with active code cells (perhaps very many), maintained by a
live kernel. I am no expert on sagecell, but it seems that it runs a cell
and exits (storing some sort of history/variables, no idea how that works).
It is this lightweight property that makes it attractive for embedding bits
of code in a teaching text, which is what I would want it for.

In other words, I am not wanting to write a notebook. The main reason for
that is to escape from the limitations of markdown (and to embrace the
possibilities of LaTeX).


#4

You may be looking for


#5

Indeed I might, and for my purposes that might serve. But there is a bit of
a community around PreTeXt, and I am (partly) speaking for them: they
already have this resource and some 40 open text books have been or are
being made that way, and they already use sagecell, so merely adding some
more capacity (i.e. running small free-standing bits of Julia code in a
code cell) is attractive to them.

I wonder if some sort of Julia-lite is not attractive in other contexts
also. Of course, what one might mean by “Julia-lite” is likely to vary a
lot, but in this context it means Core and Base and a bit more (for example
linear algebra and differential equations, but not all of many linear
packages that go beyond Base and not all of DifferentialEquations). For
example, Julia as a first language for computing might use Core, Base,
IJulia, Plots and perhaps a few more bits and pieces. If this were
pre-compiled it might have virtually no lag for any typical beginner’s
project. Of course such a beginner’s Julia-lite might exactly not serve for
the code examples of a textbook!


#6

Then perhaps they could contribute this functionality?

All of the tools above were written by people who found them useful; I guess that this is the most likely way for Sage cells to happen, too. If you want to do this yourself, I am sure you could get help here implementing it. My impression is that this needs someone who knows Python (because Sage uses that) and Julia.

That said, I am not sure I see the benefit. Small snippets of code for relatively simple calculations is not where Julia’s comparative advantages are.


#7

Oh, I doubt there would much pay-off for the current Julia community. I see
it as yet another opportunity to raise awareness of and liking for Julia
elsewhere :wink:

Rob Beezer, the main PreTeXt developer, is already trying it out, but
within PreTeXt, mostly because I suggested it to him. Thanks for implied
offer of help — or perhaps I should say reminder that the Julia community
is vibrant and generous one, where help is never far away!