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 hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ 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), and, since go-notebook v0.18.0, run by its interpreter (v0.17.0, since go-notebook v0.19.0) in one kernel shared by the Julia cells: a global or a function a cell defines is there in the next one, a top-level loop updates a global as in IJulia (55 for a sum of 1 to 10), and a failure, a <code>MethodError</code> included, is julia's own text. The kernel boots from a prebuilt Base image, fetched on the first Julia cell and loaded only if its SHA-256 is the pinned one (cold start about a second). A cell may run 30 s and 50 million statements, within a memory budget of 512 MiB counted as 16 bytes per array element (a floor, not the heap: strings are not counted, and one array may have at most 2^24 elements). Julia variables cross with Go cells in both directions (Int64, Float64, Bool, String, and vectors and matrices of Float64 or Int64; Go <code>int</code> and <code>[]int</code> as Int64): a Julia value of another type stays in Julia and the Go reader is deferred, naming the type, and a Go value Julia cannot take fails the Julia cell. Inputs are measured before any copy (2^24 elements per array, a cell's inputs together within its memory limit, so a cell can hold up to twice its limit). This breaks v0.18.0, where Julia variables were not shared. Known limitations: a Float64 <code>A * x</code> needs BLAS (go-embedded-julia#67), a non-ASCII <code>uppercase</code> needs utf8proc (#65), and <code>Get</code> refuses an n×0 matrix (#76). The browser playground runs them too (playground v0.18.0), in a third core that the page loads only when a Julia cell is first run (about 28 MB and about 20 s), with Julia variables kept apart from Go's: 512 MiB, 20 million statements and 20 s per cell, and a new worker after each Julia run. <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.15.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> <strong>Fortran cells</strong> (<code>```fortran</code>) are checked and run with <a href=\"https://github.com/go-embedded-fortran/fortran\">go-embedded-fortran</a> (since go-notebook v0.17.0, go-embedded-fortran v0.17.0: its <code>sema</code> session for the names and errors, its <code>eval.Session</code> for the running; free form, implicit typing off) and highlighted with go-rouge's <code>fortran</code> lexer. The Fortran cells share one session: a cell sees the variables (with the values the earlier cells left), procedures, modules and derived types of the Fortran cells before it. Fortran variables stay in Fortran, as R's do: they are not shared with Go, Ruby, Julia, R or C cells in either direction yet. A cell may make at most 2^32 loop iterations and calls and run 30 s, within a counted memory budget of 512 MiB (since go-notebook v0.20.0), and a failure is reported at its line and column. The browser playground runs them too (playground v0.19.0, go-embedded-fortran v0.30.0), in its second core, with Fortran variables kept apart from the other languages: 512 MiB counted before each allocation (arrays, derived types, character data, pointer targets), 200 million steps, 10 s per cell and a nested-call bound weighted by statement nesting, so an endless <code>do</code>, a runaway recursion or a memory bomb ends with the evaluator's message and leaves the page usable. <a href=\"/docs/main/fortran/\">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), and, since go-notebook v0.18.0, run by its interpreter (v0.18.0, since go-notebook v0.21.0) in one kernel shared by the Julia cells: a global or a function a cell defines is there in the next one, a top-level loop updates a global as in IJulia (55 for a sum of 1 to 10), and a failure, a <code>MethodError</code> included, is julia's own text. The kernel boots from a prebuilt Base image, fetched on the first Julia cell and loaded only if its SHA-256 is the pinned one (cold start about a second). A cell may run 30 s and 50 million statements, within a memory budget of 512 MiB counted as 16 bytes per array element (a floor, not the heap: strings are not counted, and one array may have at most 2^24 elements). Julia variables cross with Go cells in both directions (Int64, Float64, Bool, String, and vectors and matrices of Float64 or Int64; Go <code>int</code> and <code>[]int</code> as Int64): a Julia value of another type stays in Julia and the Go reader is deferred, naming the type, and a Go value Julia cannot take fails the Julia cell. Inputs are measured before any copy (2^24 elements per array, a cell's inputs together within its memory limit, so a cell can hold up to twice its limit). This breaks v0.18.0, where Julia variables were not shared. Since go-notebook v0.21.0, a Float64 <code>A * x</code> runs through go-blas, non-ASCII <code>uppercase</code>, <code>lowercase</code> and <code>normalize</code> work, and an n×0 matrix crosses. The browser playground runs them too (playground v0.20.0), in a third core that the page loads only when a Julia cell is first run (about 28 MB and about 20 s), with Julia variables kept apart from Go's: 512 MiB, 20 million statements and 20 s per cell, and a new worker after each Julia run. <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.15.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> <strong>Fortran cells</strong> (<code>```fortran</code>) are checked and run with <a href=\"https://github.com/go-embedded-fortran/fortran\">go-embedded-fortran</a> (since go-notebook v0.17.0, go-embedded-fortran v0.17.0: its <code>sema</code> session for the names and errors, its <code>eval.Session</code> for the running; free form, implicit typing off) and highlighted with go-rouge's <code>fortran</code> lexer. The Fortran cells share one session: a cell sees the variables (with the values the earlier cells left), procedures, modules and derived types of the Fortran cells before it. Fortran variables stay in Fortran, as R's do: they are not shared with Go, Ruby, Julia, R or C cells in either direction yet. A cell may make at most 2^32 loop iterations and calls and run 30 s, within a counted memory budget of 512 MiB (since go-notebook v0.20.0), and a failure is reported at its line and column. The browser playground runs them too (playground v0.19.0, go-embedded-fortran v0.30.0), in its second core, with Fortran variables kept apart from the other languages: 512 MiB counted before each allocation (arrays, derived types, character data, pointer targets), 200 million steps, 10 s per cell and a nested-call bound weighted by statement nesting, so an endless <code>do</code>, a runaway recursion or a memory bomb ends with the evaluator's message and leaves the page usable. <a href=\"/docs/main/fortran/\">More →</a>"
[[params.repos]]
name = "playground"
kind = "wasm · page"
Expand Down
9 changes: 5 additions & 4 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.4

require github.com/go-notebook/playground v0.19.0
require github.com/go-notebook/playground v0.20.0

require (
filippo.io/age v1.3.2 // indirect
Expand Down Expand Up @@ -70,6 +70,7 @@ require (
github.com/go-asn1-ber/asn1-ber v1.5.8 // indirect
github.com/go-augeas/augeas v0.0.0-20260830115849-a0db83a6594a // indirect
github.com/go-bignum/bigfloat v0.2.0 // indirect
github.com/go-blas/blas v0.1.0 // indirect
github.com/go-commonmark/commonmark v0.1.0 // indirect
github.com/go-composites/array v0.0.0-20261015235938-f7161fa2d065 // indirect
github.com/go-composites/bag v0.0.0-20261017234052-8c0542744097 // indirect
Expand All @@ -82,7 +83,7 @@ require (
github.com/go-datetime/dates v0.2.0 // indirect
github.com/go-embedded-c/c v0.2.1 // indirect
github.com/go-embedded-fortran/fortran v0.30.0 // indirect
github.com/go-embedded-julia/julia v0.17.0 // indirect
github.com/go-embedded-julia/julia v0.18.0 // indirect
github.com/go-embedded-r/r v0.17.1 // indirect
github.com/go-embedded-r/tre v0.1.3 // indirect
github.com/go-embedded-ruby/ruby v0.8.5 // indirect
Expand All @@ -108,7 +109,7 @@ require (
github.com/go-mustache/mustache v0.1.0 // indirect
github.com/go-ndarray/ndarray v0.40.3 // indirect
github.com/go-nokogiri/nokogiri v0.1.0 // indirect
github.com/go-notebook/notebook v0.20.0 // indirect
github.com/go-notebook/notebook v0.21.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 @@ -305,7 +306,7 @@ require (
github.com/go-simd/adler32 v0.1.0 // indirect
github.com/go-simd/base64 v0.1.0 // indirect
github.com/go-simd/crc32 v0.0.0-20260903220012-5f164e0e0487 // indirect
github.com/go-simd/floats v0.15.0 // indirect
github.com/go-simd/floats v0.17.0 // indirect
github.com/go-simd/hex v0.0.0-20260903220024-a8d22a843218 // indirect
github.com/go-simd/highway v0.0.14 // indirect
github.com/go-sql-driver/mysql v1.10.1 // indirect
Expand Down
18 changes: 10 additions & 8 deletions playground/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ github.com/go-augeas/augeas v0.0.0-20260830115849-a0db83a6594a h1:WnRzPthHV1yr9s
github.com/go-augeas/augeas v0.0.0-20260830115849-a0db83a6594a/go.mod h1:syDsgdbvlbD/zjgs6nJktc2araTaN5DEL3a/OvPCrkM=
github.com/go-bignum/bigfloat v0.2.0 h1:9sDb0Trg9ikAoSvLtjAXBLERNX2wYkbHi/w3FSqj6BQ=
github.com/go-bignum/bigfloat v0.2.0/go.mod h1:YVHspp0DKscpWZ6NK+rSCXxCfVDldNNoAN2JYQ8FInk=
github.com/go-blas/blas v0.1.0 h1:MKRsvJ5yNhcZL+PxpFP2DCoJiXw3x2ROuRwLYUFERGg=
github.com/go-blas/blas v0.1.0/go.mod h1:WjhlqzQ+RA8tS473f18QtcJl5Q0GonPs3RJIxT5G7Bk=
github.com/go-commonmark/commonmark v0.1.0 h1:UUjE5rIPuYYxDBi2Nj2/fNoTGDyAirp3p/t8B4TzMjE=
github.com/go-commonmark/commonmark v0.1.0/go.mod h1:llCsI7zIAI9nbpH+zhewbQfL6WtyYxmkB4HWZ0YseD8=
github.com/go-composites/array v0.0.0-20261015235938-f7161fa2d065 h1:WDXYARIlvdq8yAthNq8esKhDlJPBxbAgYs/7psRyI/E=
Expand All @@ -208,8 +210,8 @@ github.com/go-embedded-c/c v0.2.1 h1:LCNcLHJ1T3Ry0adJwO+jK9RnoFwrMd6yR/0bb0muHIc
github.com/go-embedded-c/c v0.2.1/go.mod h1:MhuXRqUtTZTUnm/3fVjho1HiL6QCFylChzOQ+Tu9eiQ=
github.com/go-embedded-fortran/fortran v0.30.0 h1:istuoEzsA+a1NEkl6LwOmgx1Sh4CdYmpEWjPSf8XmNs=
github.com/go-embedded-fortran/fortran v0.30.0/go.mod h1:UUtUFdyuO7fWnDoBjbjGZNGXg7bH2fW2DLp1D4QOAkg=
github.com/go-embedded-julia/julia v0.17.0 h1:lCsAJ6bsvfqC1OGM3d5LUGbZlpdvDq+MoXFv/Bo+VVo=
github.com/go-embedded-julia/julia v0.17.0/go.mod h1:WkSyHRvyKTls2QhqjwORXAcDOJCeoO6zIx2wedBPLpk=
github.com/go-embedded-julia/julia v0.18.0 h1:YOH41vaqd0rowp1+n0XfYNhLnBhafQTPMoL4LiFByTg=
github.com/go-embedded-julia/julia v0.18.0/go.mod h1:OIx3KU2U0xVneJdwcdH73/9UXi2gDWbFZOFAbh7sBvI=
github.com/go-embedded-r/r v0.17.1 h1:raX7Ac9Bvni/pw+A+7lWFO1UkJqm66d4f26uh57DH2w=
github.com/go-embedded-r/r v0.17.1/go.mod h1:+SbBiE9KSTuc1kWNF6009Ixrs2tM2uQCuKxByngTWL4=
github.com/go-embedded-r/tre v0.1.3 h1:MuHk9dLUO51F6kr7j8mnu01bUMVBmOpVlrmO16qObjo=
Expand Down Expand Up @@ -267,10 +269,10 @@ github.com/go-ndarray/ndarray v0.40.3 h1:jsQnEKagtYZs484MzLNGbpcttkVvS1m8UrodoWJ
github.com/go-ndarray/ndarray v0.40.3/go.mod h1:O4U0Y5pV0Pakd0iqx5ECW8VP346oxJlvm73FTeQ1rI8=
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.20.0 h1:puHnpLw1qupEVT+9PYgm0WnKlQCJf0yoiw5vNCzDMBk=
github.com/go-notebook/notebook v0.20.0/go.mod h1:UuafSbeeR/l6bA/dg817XK0/ns6azBubh9uJmiys9bY=
github.com/go-notebook/playground v0.19.0 h1:8RBQl90JJNdv4VYxWjHNAgSelaLMC/WWJHLE0TCMA90=
github.com/go-notebook/playground v0.19.0/go.mod h1:+hjM+eLqU2FsIqWxCsCYxGiCE0bdep3clS2stpHzCe4=
github.com/go-notebook/notebook v0.21.0 h1:5vMENhry1AKrntHVONNMIbaD5v0GOQzigHJs970GCZ0=
github.com/go-notebook/notebook v0.21.0/go.mod h1:17GARyjSbbksADGo0jcU+isopJLVV9KYALt3yTicSC0=
github.com/go-notebook/playground v0.20.0 h1:cGSE3yG0EZfgcmXmjFpNMMagZxdyOsyUBL61992D204=
github.com/go-notebook/playground v0.20.0/go.mod h1:Z6dquAL8hn5ZUBbD5LiTdPlJ7wrGUsE2RpUz7Na7H9w=
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 @@ -663,8 +665,8 @@ github.com/go-simd/base64 v0.1.0 h1:Pd5aYE5Zuflf8PDvXeYXDZqa27NQ4gvg2PTjWHnPuTQ=
github.com/go-simd/base64 v0.1.0/go.mod h1:iPa0zSBQKLgChjjqixi+jckt7kjxTj2p/tG18lHq+lE=
github.com/go-simd/crc32 v0.0.0-20260903220012-5f164e0e0487 h1:6JZ4TKf3j6y7xS9meu2MBQZHkkeebFWiQo8x2htKfd0=
github.com/go-simd/crc32 v0.0.0-20260903220012-5f164e0e0487/go.mod h1:lickteAl0z3L24ypOqBe0AwoHPMMxxpYcxJu72aO1kw=
github.com/go-simd/floats v0.15.0 h1:0joQTqse6+Ccl78FETksCrrBGdeLhy7ZsxRJRNU6yLU=
github.com/go-simd/floats v0.15.0/go.mod h1:Aq5a6oY5pUqm9Hpi+iV2nrNmaaUb0rwHvUHIerXWSvA=
github.com/go-simd/floats v0.17.0 h1:Dv0ZmZ3k0IavvHwQgstpUz+TeIf/gGJ9HEGQ/UART8Q=
github.com/go-simd/floats v0.17.0/go.mod h1:Aq5a6oY5pUqm9Hpi+iV2nrNmaaUb0rwHvUHIerXWSvA=
github.com/go-simd/hex v0.0.0-20260903220024-a8d22a843218 h1:TymapuhKzqUf8LNtsv8L4PJY/gz5bAaEbD2cpot1vFI=
github.com/go-simd/hex v0.0.0-20260903220024-a8d22a843218/go.mod h1:ZwRN06+N0wTIjn+mxT2NF/CbzTMAlfH/c0CKG8q5cwU=
github.com/go-simd/highway v0.0.14 h1:O3HPG00qgLGlrQyYBlMGyLYsuzZrqHA4+XNptPjV5gs=
Expand Down
Loading