Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ and the fleet's [landing kit](https://github.com/go-fleettools/landingkit)
(a Hugo module pinned in `go.mod`).

- **[/playground/](https://go-notebook.github.io/playground/)**: notebooks
in the browser, Go and Ruby cells, run in WebAssembly with no server. The
in the browser, Go, Ruby and R cells, run in WebAssembly with no server. The
deploy workflow builds it with
[go-notebook/playground](https://github.com/go-notebook/playground)'s
`cmd/build`, at the version `playground/go.mod` pins, from the notebooks in
Expand Down
6 changes: 3 additions & 3 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404']
title = "Go and Ruby cells, and what they printed"
[[params.hero.cards]]
title = "Try it in your browser"
text = "The playground runs notebooks, Go and Ruby cells, in WebAssembly in the tab: edit a cell, press Ctrl+Enter, see the result."
text = "The playground runs notebooks, Go, Ruby and R cells, in WebAssembly in the tab: edit a cell, press Ctrl+Enter, see the result."
href = "/playground/"
more = "Open the playground"

Expand All @@ -41,12 +41,12 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404']
name = "notebook"
kind = "kernel · command"
href = "https://github.com/go-notebook/notebook"
blurb = "The kernel, the <code>notebook</code> command (<code>run</code>, <code>html</code>, <code>watch</code>, <code>serve</code>, <code>irb</code>) and the HTML export: <code>format</code> parses the Markdown, <code>analysis</code> builds the dependency graph from the syntax, <code>gen</code> writes the Go program, <code>kernel</code> compiles and drives it through <code>runtime</code> and keeps results and values, <code>export</code> writes the page. <strong>Ruby cells</strong> (<code>```ruby</code>) run on <a href=\"https://github.com/go-embedded-ruby/ruby\">rbgo</a>, a Ruby written in Go, with the <a href=\"https://github.com/go-scikit/ruby\">go-scikit bindings</a> (<code>Stats</code>, <code>Special</code>, <code>Optimize</code>, <code>Integrate</code>, <code>DataFrame</code>, <code>Plot</code>, <code>NDArray</code>), and share their variables with the Go cells. <code>--timeout</code> and <code>--memory</code> stop a runaway cell in either language. <strong><code>notebook irb</code></strong> is the same Ruby as an interactive session, as irb: <code>=&gt; inspect</code> after each input, <code>_</code>, multi-line input decided by rbgo's parser, Tab completion and history in a pure-Go line editor (<a href=\"https://github.com/go-ruby-reline/reline\">go-ruby-reline</a>), each input in a worker that <code>--timeout</code>, <code>--memory</code> or Ctrl-C can stop without losing the prompt, and <code>--save</code> to keep the session as a notebook. <a href=\"/docs/main/irb/\">More →</a> <strong>Julia cells</strong> (<code>```julia</code>) are parsed with <a href=\"https://github.com/go-embedded-julia/julia\">go-embedded-julia</a>'s parser and checked: syntax errors at their line with julia's message, names in the dependency graph under Julia's scope rules. They do not run yet (go-embedded-julia's runtime is milestone M3): the cells that read one are blocked and say so. <a href=\"/docs/main/julia/\">More →</a> <strong>R cells</strong> (<code>```r</code>) are parsed with <a href=\"https://github.com/go-embedded-r/r\">go-embedded-r</a>'s parser, identical to R 4.6.2 on R's own sources, and checked in the same way: syntax errors at their line in R's words, names in the graph, and a cell that cannot be analysed from its text (<code>&lt;&lt;-</code>, <code>eval</code>, <code>library</code>) depending on every cell above it. They run on go-embedded-r's evaluator in one shared environment (v0.10.0), and since v0.12.0 each cell is bounded: 512 MiB of vectors, 50 million steps, 30 s. The browser playground does not run them. <a href=\"/docs/main/r/\">More →</a>"
blurb = "The kernel, the <code>notebook</code> command (<code>run</code>, <code>html</code>, <code>watch</code>, <code>serve</code>, <code>irb</code>) and the HTML export: <code>format</code> parses the Markdown, <code>analysis</code> builds the dependency graph from the syntax, <code>gen</code> writes the Go program, <code>kernel</code> compiles and drives it through <code>runtime</code> and keeps results and values, <code>export</code> writes the page. <strong>Ruby cells</strong> (<code>```ruby</code>) run on <a href=\"https://github.com/go-embedded-ruby/ruby\">rbgo</a>, a Ruby written in Go, with the <a href=\"https://github.com/go-scikit/ruby\">go-scikit bindings</a> (<code>Stats</code>, <code>Special</code>, <code>Optimize</code>, <code>Integrate</code>, <code>DataFrame</code>, <code>Plot</code>, <code>NDArray</code>), and share their variables with the Go cells. <code>--timeout</code> and <code>--memory</code> stop a runaway cell in either language. <strong><code>notebook irb</code></strong> is the same Ruby as an interactive session, as irb: <code>=&gt; inspect</code> after each input, <code>_</code>, multi-line input decided by rbgo's parser, Tab completion and history in a pure-Go line editor (<a href=\"https://github.com/go-ruby-reline/reline\">go-ruby-reline</a>), each input in a worker that <code>--timeout</code>, <code>--memory</code> or Ctrl-C can stop without losing the prompt, and <code>--save</code> to keep the session as a notebook. <a href=\"/docs/main/irb/\">More →</a> <strong>Julia cells</strong> (<code>```julia</code>) are parsed with <a href=\"https://github.com/go-embedded-julia/julia\">go-embedded-julia</a>'s parser and checked: syntax errors at their line with julia's message, names in the dependency graph under Julia's scope rules. They do not run yet (go-embedded-julia's runtime is milestone M3): the cells that read one are blocked and say so. <a href=\"/docs/main/julia/\">More →</a> <strong>R cells</strong> (<code>```r</code>) are parsed with <a href=\"https://github.com/go-embedded-r/r\">go-embedded-r</a>'s parser, identical to R 4.6.2 on R's own sources, and checked in the same way: syntax errors at their line in R's words, names in the graph, and a cell that cannot be analysed from its text (<code>&lt;&lt;-</code>, <code>eval</code>, <code>library</code>) depending on every cell above it. They run on go-embedded-r's evaluator in one shared environment (v0.10.0), and since v0.12.0 each cell is bounded: 512 MiB of vectors, 50 million steps, 30 s. The browser playground runs them too (playground v0.14.0), in its second core, with R variables kept apart from the other languages: 512 MiB, 20 million steps, 10 s per cell, and a crash restarts the core with a message on the cell. <a href=\"/docs/main/r/\">More →</a>"
[[params.repos]]
name = "playground"
kind = "wasm · page"
href = "https://github.com/go-notebook/playground"
blurb = "<strong>A notebook in the browser, with no server.</strong> The page shows the prose as text and each code cell as a syntax-highlighting editor (a plain text box if the editor fails to load); Ctrl+Enter runs the whole notebook again in the tab. A Go interpreter (<a href=\"https://github.com/traefik/yaegi\">yaegi</a>) compiled to WebAssembly runs the cells, while the libraries they import — go-statistics, go-numerics, go-ndarray, go-plot — run <em>compiled</em>: only the notebook's own code is interpreted. Each run posts the whole notebook to a Web Worker and gets every cell's results back, one call in and one string out, so a long run neither freezes the page nor costs a call per widget. <strong>Ruby cells</strong> run there too, in <a href=\"https://github.com/go-embedded-ruby/ruby\">rbgo</a> with the go-scikit bindings: the page fetches the Ruby core only when the notebook has a Ruby cell. <strong>Julia and R cells</strong> are parsed and checked there too, with their badge saying <em>not runnable yet</em>; their parsers come with the second core only. Nothing reaches the network or a file system, and every figure goes through an allowlist SVG sanitizer. Deployed as <code>/playground/</code> <a href=\"/playground/\">here</a>, with notebooks about the notebook itself, and on <a href=\"https://go-statistics.github.io/playground/\">go-statistics</a> and <a href=\"https://go-numerics.github.io/playground/\">go-numerics</a>."
blurb = "<strong>A notebook in the browser, with no server.</strong> The page shows the prose as text and each code cell as a syntax-highlighting editor in Go Mono at 13 px, with a minimap on its right (a click moves the caret) and line annotations, a gutter marker and an inline panel on Ctrl+Shift+M, saved in the Markdown as a <code>gonb:notes</code> comment (a plain text box if the editor fails to load); Ctrl+Enter runs the whole notebook again in the tab. A Go interpreter (<a href=\"https://github.com/traefik/yaegi\">yaegi</a>) compiled to WebAssembly runs the cells, while the libraries they import — go-statistics, go-numerics, go-ndarray, go-plot — run <em>compiled</em>: only the notebook's own code is interpreted. Each run posts the whole notebook to a Web Worker and gets every cell's results back, one call in and one string out, so a long run neither freezes the page nor costs a call per widget. <strong>Ruby cells</strong> run there too, in <a href=\"https://github.com/go-embedded-ruby/ruby\">rbgo</a> with the go-scikit bindings: the page fetches the Ruby core only when the notebook has a Ruby cell. <strong>R cells</strong> run there too, on <a href=\"https://github.com/go-embedded-r/r\">go-embedded-r</a>, in the second core (about 4.5 MB larger), bounded to 512 MiB, 20 million steps and 10 s. <strong>Julia cells</strong> are parsed and checked there, with their badge saying <em>not runnable yet</em>. Nothing reaches the network or a file system, and every figure goes through an allowlist SVG sanitizer. Deployed as <code>/playground/</code> <a href=\"/playground/\">here</a>, with notebooks about the notebook itself, and on <a href=\"https://go-statistics.github.io/playground/\">go-statistics</a> and <a href=\"https://go-numerics.github.io/playground/\">go-numerics</a>."
[[params.repos]]
name = "docs"
kind = "site"
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2>Speed, kept values and order — <i>together</i>.</h2>
<div class="card"><div class="ico">💾</div><h3>On disk, across runs</h3><p>Results and values are kept in the work directory, so a new kernel, or the next <code>notebook run</code>, starts where the last one stopped.</p></div>
<div class="card"><div class="ico">📄</div><h3>A page with no scripts</h3><p><code>notebook html</code> writes a standalone page: no scripts, no external resources, raw HTML in the prose left out. A page made from someone else's notebook runs nothing of theirs.</p></div>
<div class="card"><div class="ico">✅</div><h3>100% test coverage</h3><p>Gated in CI on Linux, macOS and Windows.</p></div>
<div class="card"><div class="ico">🌐</div><h3>In your browser</h3><p>The <a href="/playground/"><u>playground</u></a> runs notebooks, Go and Ruby cells, in WebAssembly in the tab: no server, no install.</p></div>
<div class="card"><div class="ico">🌐</div><h3>In your browser</h3><p>The <a href="/playground/"><u>playground</u></a> runs notebooks, Go, Ruby and R cells, in WebAssembly in the tab: no server, no install.</p></div>
</div>
</div></section>

Expand Down
7 changes: 4 additions & 3 deletions playground/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/go-notebook/go-notebook.github.io/playground

go 1.27.3

require github.com/go-notebook/playground v0.12.0
require github.com/go-notebook/playground v0.14.0

require (
filippo.io/age v1.3.2 // indirect
Expand Down Expand Up @@ -82,6 +82,7 @@ require (
github.com/go-embedded-c/c v0.2.1 // indirect
github.com/go-embedded-julia/julia v0.5.0 // indirect
github.com/go-embedded-r/r v0.13.1 // indirect
github.com/go-embedded-r/tre v0.1.3 // indirect
github.com/go-embedded-ruby/ruby v0.8.5 // indirect
github.com/go-encryptions/unixcrypt v0.1.0 // indirect
github.com/go-facter/facter v0.0.0-20260830120958-454b72e642ab // indirect
Expand All @@ -105,7 +106,7 @@ require (
github.com/go-mustache/mustache v0.1.0 // indirect
github.com/go-ndarray/ndarray v0.28.0 // indirect
github.com/go-nokogiri/nokogiri v0.1.0 // indirect
github.com/go-notebook/notebook v0.14.0 // indirect
github.com/go-notebook/notebook v0.15.0 // indirect
github.com/go-numerics/integrate v0.2.0 // indirect
github.com/go-numerics/optimize v0.3.1 // indirect
github.com/go-numerics/special v0.2.0 // indirect
Expand Down Expand Up @@ -313,7 +314,7 @@ require (
github.com/go-widgets/mvvm v0.15.0 // indirect
github.com/go-widgets/painter v0.17.0 // indirect
github.com/go-widgets/textinput v0.1.1 // indirect
github.com/go-widgets/toolkit v0.374.3 // indirect
github.com/go-widgets/toolkit v0.375.0 // indirect
github.com/go-widgets/toolkit/rougelex v0.2.0 // indirect
github.com/go-widgets/tui v0.61.0 // indirect
github.com/go-widgets/vcs v0.1.0 // indirect
Expand Down
14 changes: 8 additions & 6 deletions playground/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ github.com/go-embedded-julia/julia v0.5.0 h1:yLdnc0M+qycG8lbkDyH58RYushqdMOp2xdr
github.com/go-embedded-julia/julia v0.5.0/go.mod h1:f8anO/Ngw/UB/9Fj/k9qX/F8LRgh90Bp1VaJ2SQsGgw=
github.com/go-embedded-r/r v0.13.1 h1:dZQNZ9YDug3S0gIZ9JbTOBp+NoomuQoVpMBDfmH0VsY=
github.com/go-embedded-r/r v0.13.1/go.mod h1:+SbBiE9KSTuc1kWNF6009Ixrs2tM2uQCuKxByngTWL4=
github.com/go-embedded-r/tre v0.1.3 h1:MuHk9dLUO51F6kr7j8mnu01bUMVBmOpVlrmO16qObjo=
github.com/go-embedded-r/tre v0.1.3/go.mod h1:UN9RKw3VLEJpNmxPO+4JRTediME4pYay0iWFUMY2SUc=
github.com/go-embedded-ruby/ruby v0.8.5 h1:JGKa6Cz4ihKNVfooeeytuPsT133byK7CkZr04Px9PYQ=
github.com/go-embedded-ruby/ruby v0.8.5/go.mod h1:2wJ+VJXuGxD+Zl98T0L+/OQN1c5J/eLq452MS7aVZ2M=
github.com/go-encryptions/unixcrypt v0.1.0 h1:XWk4h9uCDd+T2hovOzgO0B2vOdJvAwi9nbOBVb3o62c=
Expand Down Expand Up @@ -261,10 +263,10 @@ github.com/go-ndarray/ndarray v0.28.0 h1:9RWfw01uRUH1YqsVUpNllm01XEohqdSfsk4Kw0x
github.com/go-ndarray/ndarray v0.28.0/go.mod h1:bDbGWswQLmTMh6V3LwvKUbpfHzeG4sZDcvuGnA0GC+s=
github.com/go-nokogiri/nokogiri v0.1.0 h1:3Q3BewGHK16Bt34ggJeyf9xeIMJyA3dmfbIxARPgR9U=
github.com/go-nokogiri/nokogiri v0.1.0/go.mod h1:zjghooYIK8Xfg+fL4/OUhROslx51xGsM3JKtB2TI0tg=
github.com/go-notebook/notebook v0.14.0 h1:Tm9mZkZb4rk5aYBB6aDvCjYLMOYahCKpMkr3dEsdEpU=
github.com/go-notebook/notebook v0.14.0/go.mod h1:kVOmlBr0TQt3XZUcJcY1Z4hJnl1UPz+5grPT5fNAK3M=
github.com/go-notebook/playground v0.12.0 h1:IT2t8HvXl/Pw94ugGfFawQDdLJ6C84OekN1tIJnxrio=
github.com/go-notebook/playground v0.12.0/go.mod h1:RRDrkC/YgjNYPxu27FGeo7Iqkc2xwW7R5E7UBdL2Hv0=
github.com/go-notebook/notebook v0.15.0 h1:YINDiZnu53vd8IYeN+7VBvceSP81SYm8hnWbpP4xrGo=
github.com/go-notebook/notebook v0.15.0/go.mod h1:kVOmlBr0TQt3XZUcJcY1Z4hJnl1UPz+5grPT5fNAK3M=
github.com/go-notebook/playground v0.14.0 h1:UElBr11A4RExGRvAGXcCXFwiIJ8Z29oL1QXVUfzr3bc=
github.com/go-notebook/playground v0.14.0/go.mod h1:+eX/Jd/AX4uE85dSSRRT/5MFuwmKKB/vS08jyuzEquI=
github.com/go-numerics/integrate v0.2.0 h1:IkJhDimTc7nQETCixEvbbHhtOF36GbANBKJI3mJB3Kw=
github.com/go-numerics/integrate v0.2.0/go.mod h1:ABjpcWy8ZSOg8j6S+7YRsvMJ2LpVkH4E64/CGet2gCw=
github.com/go-numerics/optimize v0.3.1 h1:eYkT9BpORKSwXnDtEJxXfZ19qJT0cI2RH6xEL3VLZSU=
Expand Down Expand Up @@ -684,8 +686,8 @@ github.com/go-widgets/painter v0.17.0 h1:PB/Xr0flFR9qL2/RPhbJOeyU6PPzcGyf3Qx4RRn
github.com/go-widgets/painter v0.17.0/go.mod h1:8kERcZUoWNyLIas1NsMWiYynvvyx+hcB2cNIh0Bx0yc=
github.com/go-widgets/textinput v0.1.1 h1:3NZD5CJm5XYSWA3YzQ64tXC86gnEQ0UlNPL5qJeIUSs=
github.com/go-widgets/textinput v0.1.1/go.mod h1:Y/k3PDtUEMQ/4psCVKdmUStNWa/EsVAMcCKG2lEtQ5c=
github.com/go-widgets/toolkit v0.374.3 h1:Az5pJJeAlFSyxdUGkkWsPsJ3+JqEXiSbdejJX1dpC5s=
github.com/go-widgets/toolkit v0.374.3/go.mod h1:zVKiLPMvy2igZZtU7IQ1rqoH31+kb1z2C6PptbCwaHI=
github.com/go-widgets/toolkit v0.375.0 h1:cSKh1OIhytXTnO5i4EBiCY4/IoYupdcRaXABvMzEu9w=
github.com/go-widgets/toolkit v0.375.0/go.mod h1:zVKiLPMvy2igZZtU7IQ1rqoH31+kb1z2C6PptbCwaHI=
github.com/go-widgets/toolkit/rougelex v0.2.0 h1:7EZ0sqD5ldLoRJAFktrz1gQovrv8pu2Spi8o0XROmAM=
github.com/go-widgets/toolkit/rougelex v0.2.0/go.mod h1:L5tohfJJv2JBPg9qXOy9wyyVCJfeg+FPCoMPXVM+qKg=
github.com/go-widgets/tui v0.61.0 h1:DmT5TOpCrnXBnG6t1060BvsaHLyJXEM23DWH4SpuGt8=
Expand Down
Loading
Loading