Skip to content

Commit

Permalink
adding clojure kernel howto
Browse files Browse the repository at this point in the history
  • Loading branch information
aaelony committed Feb 27, 2025
1 parent 1696016 commit a88d6c6
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 11 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cd notebook_hello
```
uv add --dev ipykernel
uv run ipython kernel install --user --name notebook_hello
uv run --python 3.13 --with jupyter jupyter-kernelspec list
uv run --python 3.13 --with jupyter jupyter lab
```

Expand All @@ -38,7 +39,19 @@ cargo install jupyter
cargo install evcxr_jupyter
```

6. Run the notebook server
6. Set up the Clojure kernel

- See [https://github.com/clojupyter/clojupyter?tab=readme-ov-file#installation](https://github.com/clojupyter/clojupyter?tab=readme-ov-file#installation) for detailed instructions.

```
git clone https://github.com/clojupyter/clojupyter.git
cd clojupyter
clj -T:build uber
uv run --python 3.13 --with jupyter jupyter-kernelspec l
uv run --python 3.13 --with jupyter jupyter lab
```

7. Run the notebook server

```
uv run --with jupyter jupyter lab
Expand Down
81 changes: 71 additions & 10 deletions notebook-hello-with-different-kernels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
"\n"
]
},
{
"cell_type": "markdown",
"id": "6e96ad48-b00c-44b4-9e1e-2c63642ca751",
"metadata": {},
"source": [
"## Rust code"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down Expand Up @@ -52,6 +60,14 @@
"println!(\"Rust compiler version: {}\", rust_version.trim());\n"
]
},
{
"cell_type": "markdown",
"id": "87c3155b-9897-4a8a-aeeb-b84eda195bbf",
"metadata": {},
"source": [
"## R code"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -72,6 +88,14 @@
"cat(\"Hello, R users!\\n\", R.version$version.string)\n"
]
},
{
"cell_type": "markdown",
"id": "91a516bc-c280-4469-b894-ea9ea8324f02",
"metadata": {},
"source": [
"## Python code"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -92,28 +116,65 @@
"!python --version"
]
},
{
"cell_type": "markdown",
"id": "86d9604c-24cb-49ad-99d0-acb25eab4ac0",
"metadata": {},
"source": [
"## Clojure code"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "37bca00f-b1cd-48cc-872c-6e4c5afaf2dc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello from Clojure, version: 1.12.0\n"
]
},
{
"data": {
"text/plain": [
"nil"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(require '[clojure.string :as str])\n",
"(println \"Hello from Clojure, version: \"\n",
"(str/join \".\" (mapv (fn [k] (str (k *clojure-version*))) [:major :minor :incremental]))\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d9cfdfa6-5948-43ea-866e-d8c8f85ecca8",
"id": "47ffb1a3-286d-4fcb-9187-2ee3a05a13ff",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Rust",
"language": "rust",
"name": "rust"
"display_name": "Clojure (clojupyter-0.5.424-snapshot424)",
"language": "clojure",
"name": "clojupyter-0.5.424-snapshot424"
},
"language_info": {
"codemirror_mode": "rust",
"file_extension": ".rs",
"mimetype": "text/rust",
"name": "Rust",
"pygment_lexer": "rust",
"version": ""
"file_extension": ".clj",
"mimetype": "text/x-clojure",
"name": "clojure",
"version": "1.12.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a88d6c6

Please sign in to comment.