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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
grep -qE "https://github.com/$org[\">]" public/index.html \
|| { echo "::error::https://github.com/$org is not on the page"; rc=1; }
done
for repo in go-scikit.github.io brand .github; do
for repo in go-scikit.github.io brand .github docs roadmap ruby; do
grep -qF "go-scikit/$repo" public/index.html \
|| { echo "::error::go-scikit/$repo is not on the page"; rc=1; }
done
Expand Down
8 changes: 8 additions & 0 deletions example/first.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ x, _ := stats.Normal{Loc: 10, Scale: 2}.Rvs(rng, 1000)
```go
stats.Percentiles(x, []float64{25, 50, 75}, nil)
```

The same draws in Ruby, through
the go-scikit bindings.

```ruby
fit = Stats::Normal.fit(x)
format("loc %.4f, scale %.4f", fit.loc, fit.scale)
```
9 changes: 5 additions & 4 deletions example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ require (
)

require (
github.com/go-notebook/notebook v0.2.0 // indirect
github.com/go-notebook/notebook v0.3.0 // indirect
github.com/go-numerics/optimize v0.1.0 // indirect
github.com/go-numerics/special v0.1.0 // indirect
github.com/go-opentype/opentype v0.13.0 // indirect
github.com/go-regexp/engine v0.1.3 // indirect
github.com/go-rouge/rouge v0.4.0 // indirect
github.com/go-ruby-parser/parser v0.13.1 // indirect
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 // indirect
github.com/go-tex/math v0.50.0 // indirect
github.com/yuin/goldmark v1.8.6 // indirect
golang.org/x/mod v0.41.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/mod v0.42.0 // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/tools v0.51.0 // indirect
golang.org/x/tools v0.52.0 // indirect
)

tool github.com/go-notebook/notebook/cmd/notebook
10 changes: 10 additions & 0 deletions example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/go-ndarray/ndarray v0.12.0 h1:4xfl9ZQo1m0UXopo06KypELg1wUYgQb5kdKaJPZ
github.com/go-ndarray/ndarray v0.12.0/go.mod h1:ZcgNCBVLXt1FxeZjQWI5Z+k0SSWAT0/wR8slfat/gRA=
github.com/go-notebook/notebook v0.2.0 h1:W3z9TbBCyqsHaRcEpa2csMw5UDe8JsgOu6Hwd/R1T6M=
github.com/go-notebook/notebook v0.2.0/go.mod h1:cqXgByviyVH6wBixaCPPnHfJkPP1c3jh2JAAfaz2Zf8=
github.com/go-notebook/notebook v0.3.0 h1:DdIynF6MDCiUXbZzImIhUemNvnNdP6QEMsPX821AzZM=
github.com/go-notebook/notebook v0.3.0/go.mod h1:wLXtnHz8JMuXRN0LL2flSQVbBR8H8701Yom1ViAsiKI=
github.com/go-numerics/optimize v0.1.0 h1:SOA+QxTuIjeZSAsd5Dyj433lItnOKWyprCbHQoLxg/c=
github.com/go-numerics/optimize v0.1.0/go.mod h1:ieZ+/EsbBw/EfHl4W8JryPyCBB8n5a8xKk6lu/xh7zk=
github.com/go-numerics/special v0.1.0 h1:HcsebTwcNuAhFBP8RuOirO9XVmWJSrxARiOVkyeCfUk=
Expand All @@ -12,6 +14,8 @@ github.com/go-regexp/engine v0.1.3 h1:0U5DrrBEYjNX/f0yFESpQDWmJOtXmmZqluNAUBXjfx
github.com/go-regexp/engine v0.1.3/go.mod h1:8rju5lq5OkskQh9+m+FjBP6965giMPUdIOdrvFrbqn4=
github.com/go-rouge/rouge v0.4.0 h1:f/5EVTEwiEnBOeyAtkV8r5KopdIRAsRoA7Kzi/cyh2Y=
github.com/go-rouge/rouge v0.4.0/go.mod h1:V4Xlyl1EDqEfrzloW9y6X0xpv/WvCvTiOWNIcByw2Y8=
github.com/go-ruby-parser/parser v0.13.1 h1:gq7QVT7KdRp7nZt1UHsa73YDo77qrD8kGdQY/GVEA6g=
github.com/go-ruby-parser/parser v0.13.1/go.mod h1:Se+ZvnD/4Vm0RRe1U5kZi0GmPSvSczJJXdZLiB0PlJY=
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 h1:pNvJf0zgzg0rTEq1fToFa5fnzK13nIble80caTmdG3g=
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2/go.mod h1:I3i2r1AXulgMBt/KiWBcxjnoNsB09ZFKkj2Vb5Mhzuw=
github.com/go-statistics/stats v0.1.0 h1:m8/5lxOZEcbWp51T6evG3Yx0ZzMlOO2wIEZa8uBGryA=
Expand All @@ -24,9 +28,15 @@ github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4=
github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c=
golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o=
golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg=
golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs=
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI=
golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA=
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
2 changes: 2 additions & 0 deletions example/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
── cell 1 (line 14)
── cell 2 (line 19)
[8.607374170843807 10.012355742798341 11.179773490450081]
── cell 3 (line 26)
"loc 9.9422, scale 1.9774"
9 changes: 7 additions & 2 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404']
layer = 2
short = "compiled, reactive notebooks"
lib = "notebook"
state = "notebook v0.2.0"
state = "notebook v0.3.0"
live = true
brand = true
blurb = "A notebook is a Markdown file whose <code>go</code> blocks are cells. The kernel compiles it into a real Go program, orders the cells by what they use, and runs only what changed, keeping values across runs."
blurb = "A notebook is a Markdown file whose <code>go</code> and <code>ruby</code> blocks are cells. The kernel compiles it into a real Go program, orders the cells of both languages by what they use, and runs only what changed, keeping values across runs. Ruby cells run on go-embedded-ruby, with the go-scikit bindings."
[[params.orgs]]
name = "go-bignum"
layer = 1
Expand Down Expand Up @@ -278,6 +278,11 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404']
kind = "docs"
href = "https://github.com/go-scikit/docs"
blurb = "The documentation site (Hugo and Hextra), served at go-scikit.github.io/docs: the member organisations with their landing and docs links, and the status of the parity-plan packages."
[[params.repos]]
name = "ruby"
kind = "bindings"
href = "https://github.com/go-scikit/ruby"
blurb = "Ruby bindings to the stack, for go-embedded-ruby (v0.1.0): <code>Stats</code>, <code>Special</code>, <code>Optimize</code>, <code>Integrate</code>, <code>DataFrame</code> and <code>Plot</code>, each compared with the Go call it wraps, and the runner of a notebook's <code>ruby</code> cells."
[[params.repos]]
name = "roadmap"
kind = "plan"
Expand Down
7 changes: 4 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<h1 class="head">Science in Go,<br>{{/* The sheet's .accent paints with --grad, base to deep: on a dark page
this logo's dark slate stops would vanish. --accent and --accent-deep
are the same two in light and the bright stop in dark. */}}<span class="accent" style="background:linear-gradient(135deg,var(--accent),var(--accent-deep));-webkit-background-clip:text;background-clip:text">all the way down.</span></h1>
<p class="sub">go-scikit is the umbrella over <b>{{ len $orgs }} organisations</b> that together cover what a Python notebook reaches for in NumPy, SciPy, pandas and matplotlib: <b>arrays</b>, <b>FFTs</b>, <b>numerical methods</b>, <b>statistics</b>, <b>labelled tables</b>, <b>figures</b> and <b>notebooks</b>, and, on the way to parity with MATLAB and Mathematica, <b>sparse matrices</b>, <b>interpolation</b>, <b>signal processing</b> and <b>arbitrary precision</b>. Pure Go, CGO=0, and each library measured against its reference, with the documents that say where it is slower or less accurate.</p>
<p class="sub">go-scikit is the umbrella over <b>{{ len $orgs }} organisations</b> that together cover what a Python notebook reaches for in NumPy, SciPy, pandas and matplotlib: <b>arrays</b>, <b>FFTs</b>, <b>numerical methods</b>, <b>statistics</b>, <b>labelled tables</b>, <b>figures</b> and <b>notebooks</b>, and, on the way to parity with MATLAB and Mathematica, <b>sparse matrices</b>, <b>interpolation</b>, <b>signal processing</b> and <b>arbitrary precision</b>. Pure Go, CGO=0, and each library measured against its reference, with the documents that say where it is slower or less accurate. A notebook's cells can be <b>Go</b> or <b>Ruby</b>, one cell reading what the other computed.</p>
<div class="cta">
<a class="btn btn-primary" href="#start">Write a first notebook →</a>
<a class="btn btn-ghost" href="#orgs">{{ partial "icons/book.html" . }}The organisations</a>
</div>
<div class="trust"><span><b>{{ len $orgs }}</b> organisations</span><span><b>CGO=0</b> everywhere</span><span><b>BSD-3-Clause</b></span></div>
<div class="trust"><span><b>{{ len $orgs }}</b> organisations</span><span><b>Go</b> and <b>Ruby</b> cells</span><span><b>CGO=0</b> everywhere</span><span><b>BSD-3-Clause</b></span></div>
</div>
<div class="term" style="min-width:0">
<div class="bar"><i style="background:#ff5f57"></i><i style="background:#febc2e"></i><i style="background:#28c840"></i><span class="t">first.md</span></div>
Expand Down Expand Up @@ -114,7 +114,7 @@ <h2>Parity with MATLAB and Mathematica, <i>in four waves</i>.</h2>
<section id="start" style="padding-top:10px"><div class="wrap">
<span class="eyebrow">Get started</span>
<h2>A first notebook, <i>in four commands</i>.</h2>
<p class="lead">A notebook is a Markdown file; its <code>go</code> blocks are the cells. Put the notebook from the top of this page in <code>first.md</code>, in a module that requires the libraries it imports, and run it. It prints the quartiles of a thousand normal draws from seed 42: the draws SciPy's <code>norm.rvs(10, 2, size=1000, random_state=np.random.default_rng(42))</code> makes.</p>
<p class="lead">A notebook is a Markdown file; its <code>go</code> and <code>ruby</code> blocks are the cells. Put the notebook from the top of this page in <code>first.md</code>, in a module that requires the libraries its Go cells import, and run it. It prints the quartiles of a thousand normal draws from seed 42 (the draws SciPy's <code>norm.rvs(10, 2, size=1000, random_state=np.random.default_rng(42))</code> makes), then fits a normal distribution to the same draws in Ruby.</p>
<div class="term" style="margin-top:22px">
<div class="bar"><i style="background:#ff5f57"></i><i style="background:#febc2e"></i><i style="background:#28c840"></i><span class="t">shell</span></div>
<pre style="white-space:pre;overflow-x:auto"><span class="c-cmd">$ go install github.com/go-notebook/notebook/cmd/notebook@latest</span>
Expand All @@ -126,6 +126,7 @@ <h2>A first notebook, <i>in four commands</i>.</h2>
# notebook serve first.md the same, live in the browser, editable</span></pre>
</div>
<p class="lead">Run it again and every cell is <i>kept</i>: a cell whose code and inputs did not change is not run again, across runs. The <a href="https://go-notebook.github.io/docs/"><u>go-notebook documentation</u></a> gives the cell rules; to try the arrays and the transforms without installing anything, the <a href="https://go-ndarray.github.io/playground/"><u>go-ndarray</u></a> and <a href="https://go-fft.github.io/playground/"><u>go-fft</u></a> playgrounds run them compiled to WebAssembly in the browser, and the <a href="https://go-statistics.github.io/playground/"><u>go-statistics</u></a> and <a href="https://go-numerics.github.io/playground/"><u>go-numerics</u></a> playgrounds run whole notebooks there: edit the cells, run them, see the figures.</p>
<p class="lead">A <code>ruby</code> cell runs on <a href="https://github.com/go-embedded-ruby"><u>go-embedded-ruby</u></a>, a Ruby written in Go, so the notebook stays one Go program with no Ruby to install. It sees the values the Go cells above it defined (here <code>x</code>, a Go <code>[]float64</code>), and the Go cells below it see what it defines; the kernel orders and re-runs cells of both languages by what they use. From Ruby, the stack is reached through <a href="https://github.com/go-scikit/ruby"><u>go-scikit/ruby</u></a>, which the kernel adds by itself: <code>Stats</code>, <code>Special</code>, <code>Optimize</code>, <code>Integrate</code>, <code>DataFrame</code> and <code>Plot</code> call the same Go functions, with the same answers. The <a href="https://go-notebook.github.io/docs/latest/ruby/"><u>Ruby cells page</u></a> gives the rules, and the <code>-timeout</code> and <code>-memory</code> limits that stop a runaway cell.</p>
</div></section>

<section id="repos" style="padding-top:10px"><div class="wrap">
Expand Down
Loading