Notebooks 2.0 is here.

Public
Edited
Feb 5, 2024
1 fork
13 stars
Insert cell
Insert cell
Insert cell
Insert cell
viewof triple = Inputs.text({ value: "x86_64", submit: true }) //<arch><sub>-<vendor>-<sys>-<env>, supported targets:x86_64, i386, wasm32
Insert cell
viewof asm = compile_and_disasm`

int fac(int n) {
if (n < 1) return 1;
return n * fac(n - 1);
}

`
Insert cell
Insert cell
Insert cell
compile_and_run`
// re-run it if error occurs
#include <canvas.h>
#include <stdint.h>
#include <math.h>

const int w = 960;
const int h = 500;
Canvas c{w, h};
ImageData image{w, h};

int main() {
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
image.data[y * w + x] = RGB(x | y, 0, 0);
}
}
image.commit();
c.putImageData(image, 0, 0);

const char* msg = "x + y";
c.setFillStyle("white");
c.setFont("bold 200px sans");
c.fillText(msg, (w - c.measureText(msg)) / 2, (h + 100) / 2);
}
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more