babashka/README.md

485 lines
24 KiB
Markdown
Raw Normal View History

[<img src="logo/babashka.svg" alt="Babashka" width="425px">](https://babashka.org)
2019-08-09 12:51:42 +00:00
2021-01-01 10:26:31 +00:00
[![CircleCI](https://circleci.com/gh/babashka/babashka/tree/master.svg?style=shield)](https://circleci.com/gh/babashka/babashka/tree/master)
2019-12-12 11:18:24 +00:00
[![project chat](https://img.shields.io/badge/slack-join_chat-brightgreen.svg)](https://app.slack.com/client/T03RZGPFR/CLX41ASCS)
2021-01-01 10:26:31 +00:00
[![Financial Contributors on Open Collective](https://opencollective.com/babashka/all/badge.svg?label=financial+contributors)](https://opencollective.com/babashka) [![Clojars Project](https://img.shields.io/clojars/v/babashka/babashka.svg)](https://clojars.org/babashka/babashka)
2020-09-07 11:51:22 +00:00
[![twitter](https://img.shields.io/badge/twitter-%23babashka-blue)](https://twitter.com/search?q=%23babashka&src=typed_query&f=live)
[![docs](https://img.shields.io/badge/website-docs-blue)](https://book.babashka.org) [![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20Babashka%20Guru-006BFF)](https://gurubase.io/g/babashka)
2019-08-09 12:51:42 +00:00
2019-12-20 15:51:41 +00:00
<blockquote class="twitter-tweet" data-lang="en">
2019-12-30 12:38:05 +00:00
<p lang="en" dir="ltr">Life's too short to remember how to write Bash code. I feel liberated.</p>
2019-12-20 15:51:41 +00:00
&mdash;
<a href="https://github.com/laheadle">@laheadle</a> on Clojurians Slack
</blockquote>
2020-03-29 09:59:50 +00:00
## Introduction
2021-03-15 22:18:45 +00:00
Babashka is a native Clojure interpreter for scripting with fast startup. Its
main goal is to leverage Clojure in places where you would be using bash
otherwise.
2019-08-15 09:05:59 +00:00
2019-11-07 11:25:51 +00:00
As one user described it:
2019-11-07 11:46:14 +00:00
> Im quite at home in Bash most of the time, but theres a substantial grey area of things that are too complicated to be simple in bash, but too simple to be worth writing a clj/s script for. Babashka really seems to hit the sweet spot for those cases.
2019-11-07 11:25:51 +00:00
2020-03-29 09:59:50 +00:00
### Goals
2019-11-03 20:28:16 +00:00
2020-06-29 09:41:54 +00:00
* **Fast starting** Clojure scripting alternative for JVM Clojure
* **Easy installation:** grab the self-contained binary and run. No JVM needed.
* **Familiar:** targeted at JVM Clojure users
2020-06-29 09:43:20 +00:00
* **Cross-platform:** supports linux, macOS and Windows
2020-06-29 09:41:54 +00:00
* **Interop** with commonly used classes (`System`, `File`, `java.time.*`, `java.nio.*`)
* **Multi-threading** support (`pmap`, `future`)
* **Batteries included** (tools.cli, cheshire, ...)
2019-11-03 20:28:16 +00:00
2020-03-29 09:59:50 +00:00
### Non-goals
2019-11-03 20:28:16 +00:00
2020-03-02 08:56:22 +00:00
* Provide a mixed Clojure/Bash DSL (see portability).
* Replace existing shells. Babashka is a tool you can use inside existing shells like bash and it is designed to play well with them. It does not aim to replace them.
2020-03-02 09:00:28 +00:00
## Quickstart
2021-01-01 10:26:31 +00:00
For installation options check [Installation](https://github.com/babashka/babashka#installation).
2024-08-16 13:40:34 +00:00
For quick installation using `bash`, use:
2020-09-25 16:46:22 +00:00
``` shell
2024-08-16 13:40:34 +00:00
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
2020-09-25 16:46:22 +00:00
```
or grab a binary from [Github
2021-01-01 10:26:31 +00:00
releases](https://github.com/babashka/babashka/releases) yourself and place it
2020-09-25 16:46:22 +00:00
anywhere on the path.
Then you're ready to go:
2020-03-02 09:00:28 +00:00
``` shellsession
2024-08-16 13:40:34 +00:00
time bb -e '(->> (fs/list-dir ".") (filter fs/directory?) (map fs/normalize) (map str) (take 3))'
```
``` clojure
(".build" "feature-lanterna" ".repl")
bb -e 0,01s user 0,01s system 70% cpu 0,017 total
2020-03-02 09:00:28 +00:00
```
2023-05-01 10:09:25 +00:00
## Support :heart:
You can support this project via [Github
Sponsors](https://github.com/sponsors/borkdude),
[OpenCollective](https://opencollective.com/babashka),
[Ko-fi](https://ko-fi.com/borkdude) or indirectly via [Clojurists
Together](https://www.clojuriststogether.org/).
<details>
<summary>Top sponsors</summary>
- [Clojurists Together](https://clojuriststogether.org/)
- [Roam Research](https://roamresearch.com/)
- [Nextjournal](https://nextjournal.com/)
- [Toyokumo](https://toyokumo.co.jp/)
- [Cognitect](https://www.cognitect.com/)
- [Kepler16](https://kepler16.com/)
- [Adgoji](https://www.adgoji.com/)
</details>
2021-10-04 19:24:45 +00:00
## Babashka users
2020-12-03 09:21:24 +00:00
2021-10-04 19:23:50 +00:00
See [companies](doc/companies.md) for a list of companies using babashka.
Are you using babashka in your company or personal projects? Let us know
[here](https://github.com/babashka/babashka/issues/254).
2020-12-03 09:21:24 +00:00
2021-10-04 19:24:45 +00:00
## Setting expectations
2020-12-03 09:21:24 +00:00
2021-10-04 19:24:45 +00:00
Babashka uses [SCI](https://github.com/borkdude/sci) for interpreting
Clojure. SCI implements a substantial subset of Clojure. Interpreting code is in
2020-12-03 09:21:24 +00:00
general not as performant as executing compiled code. If your script takes more
than a few seconds to run or has lots of loops, Clojure on the JVM may be a
2021-10-04 19:24:45 +00:00
better fit as the performance on JVM is going to outweigh its startup time
penalty. Read more about the differences with Clojure
2020-12-03 09:21:24 +00:00
[here](#differences-with-clojure).
## Status
Functionality regarding `clojure.core` and `java.lang` can be considered stable
and is unlikely to change. Changes may happen in other parts of babashka,
although we will try our best to prevent them. Always check the release notes or
[CHANGELOG.md](CHANGELOG.md) before upgrading.
2023-05-01 10:25:14 +00:00
## Talk
2020-12-03 09:21:24 +00:00
To get an overview of babashka, you can watch this talk ([slides](https://speakerdeck.com/borkdude/babashka-and-the-small-clojure-interpreter-at-clojured-2020)):
[![Babashka at ClojureD 2020](https://img.youtube.com/vi/Nw8aN-nrdEk/0.jpg)](https://www.youtube.com/watch?v=Nw8aN-nrdEk)
2020-11-28 20:23:06 +00:00
## Babashka book
2020-11-28 22:25:42 +00:00
The [babashka book](https://book.babashka.org) contains detailed information
about how to get the most out of babashka scripting.
2020-11-28 20:23:06 +00:00
There is also the book [Babashka Babooka](https://www.braveclojure.com/quests/babooka/),
by Daniel Higginbotham, who has also helped a lot of people learn Clojure with
[Clojure for the Brave and
True](https://www.braveclojure.com/clojure-for-the-brave-and-true/).
2023-01-23 14:12:55 +00:00
2020-11-28 22:25:42 +00:00
## Try online
2020-11-27 09:52:08 +00:00
You can try babashka online with Nextjournal's babashka [notebook
environment](http://nextjournal.com/try/babashka?cm6=1).
2019-08-09 14:02:08 +00:00
## Installation
2019-08-11 07:27:45 +00:00
### Brew
2019-08-09 14:02:08 +00:00
Linux and macOS binaries are provided via brew.
Install:
brew install borkdude/brew/babashka
Upgrade:
brew upgrade babashka
### Nix
Linux and macOS (including ARM Macs) binaries are provided via nix (see the installation instructions for nix [here](https://nixos.org/download.html)).
Install:
# Adding `nixpkgs-unstable` channel for more up-to-date binaries, skip this if you already have `nixpkgs-unstable` in your channel list
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
nix-channel --update
nix-env -iA nixpkgs-unstable.babashka
Upgrade:
nix-channel --update
nix-env -iA nixpkgs-unstable.babashka
You can find more documentation on how to use babashka with nix [here](./doc/nix.md).
### Alpine
2022-12-09 12:08:03 +00:00
On Alpine it's recommended to download the binary manually from [Github
Releases](https://github.com/babashka/babashka/releases) and use the static
linux binary.
### Arch (Linux)
`babashka` is [available](https://aur.archlinux.org/packages/babashka-bin/) in the [Arch User Repository](https://aur.archlinux.org). It can be installed using your favorite [AUR](https://aur.archlinux.org) helper such as
[yay](https://github.com/Jguer/yay), [yaourt](https://github.com/archlinuxfr/yaourt), [apacman](https://github.com/oshazard/apacman) and [pacaur](https://github.com/rmarquis/pacaur). Here is an example using `yay`:
yay -S babashka-bin
2019-08-11 07:27:45 +00:00
2021-04-21 18:05:47 +00:00
### asdf
[asdf](https://github.com/asdf-vm/asdf) is an extendable version manager for linux and macOS. Note that asdf will add significant startup time to any babashka script, consider using [mise](#mise) instead.
2021-04-21 18:05:47 +00:00
Babashka can be installed using a plugin as follows:
2023-01-12 14:59:45 +00:00
asdf plugin add babashka https://github.com/pitch-io/asdf-babashka
2021-04-21 18:05:47 +00:00
asdf install babashka latest
### mise
[mise](https://mise.jdx.dev/) is a development environment setup tool for linux and macOS.
Install:
mise use --global babashka@latest
Upgrade:
mise upgrade babashka
2020-02-02 12:44:34 +00:00
### Windows
2022-05-17 14:56:06 +00:00
#### Scoop
2020-02-02 12:44:34 +00:00
On Windows you can install using [scoop](https://scoop.sh/) and the
[scoop-clojure](https://github.com/littleli/scoop-clojure) bucket.
Or just follow these concrete steps:
``` powershell
# Note: if you get an error you might need to change the execution policy (i.e. enable Powershell) with
# Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop bucket add scoop-clojure https://github.com/littleli/scoop-clojure
scoop bucket add extras
scoop install babashka
```
2022-05-17 14:56:06 +00:00
#### Manual
If scoop does not work for you, then you can also just download the `bb.exe`
binary from [Github releases](https://github.com/babashka/babashka/releases) and
place it on your path manually.
#### WSL1
> Note: WSL1 users might experience a BSOD, please use the --static install option when installing
``` shell
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
$ chmod +x install
$ ./install --static
```
2019-08-11 07:27:45 +00:00
### Installer script
Install via the installer script for linux and macOS:
2019-08-11 07:27:45 +00:00
2020-09-25 16:47:44 +00:00
``` shell
2021-01-01 10:26:31 +00:00
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
# or
$ wget -qO install https://raw.githubusercontent.com/babashka/babashka/master/install
2020-09-25 16:47:44 +00:00
$ chmod +x install
$ ./install
2019-08-11 07:27:45 +00:00
```
2020-09-25 16:47:44 +00:00
By default this will install into `/usr/local/bin` (you may need `sudo` for
this). To change this, provide the directory name:
2019-08-11 07:27:45 +00:00
2020-09-25 16:47:44 +00:00
``` shell
2020-12-23 18:35:15 +00:00
$ ./install --dir .
2020-09-25 16:46:22 +00:00
```
To install a specific version, the script also supports `--version`:
2020-09-25 16:47:44 +00:00
``` shell
$ ./install --dir . --version 0.4.1
2020-12-23 18:35:15 +00:00
```
To force the download of the zip archive to a different directory than `/tmp`
use the `--download-dir` argument:
``` shell
$ ./install --dir . --version 0.4.1 --download-dir .
2019-08-11 07:27:45 +00:00
```
On Linux, if you want to install the static binary version:
``` shell
$ ./install --dir . --version 0.4.1 --download-dir . --static
```
In case you want to check the download, you can use the `--checksum` option.
This maybe useful for unattended installations:
``` shell
$ sha256sum babashka-0.4.1-linux-amd64-static.tar.gz
ab70fb39fdbb5206c0a2faab178ffb54dd9597991a4bc13c65df2564e8f174f6 babashka-0.4.1-linux-amd64-static.tar.g
$ ./install --dir /tmp --checksum ab70fb39fdbb5206c0a2faab178ffb54dd9597991a4bc13c65df2564e8f174f6 --static --version 0.4.1
```
Note that the `--checksum` option only works when `--version` option is also
provided. This is to avoid breakage when a new version of Babashka is released.
2020-09-25 16:46:22 +00:00
### Github releases
2019-08-11 07:27:45 +00:00
2020-02-23 21:56:47 +00:00
You may also download a binary from
2021-01-01 10:26:31 +00:00
[Github](https://github.com/babashka/babashka/releases). For linux there is a
2020-02-23 21:56:47 +00:00
static binary available which can be used on Alpine.
2019-08-09 14:02:08 +00:00
2023-01-06 12:33:49 +00:00
### CI
2023-01-06 12:34:44 +00:00
- On Github Actions it's recommended to use [setup-clojure](https://github.com/DeLaGuardo/setup-clojure) with `bb: latest`.
- You can use the [installer script](https://github.com/babashka/babashka#installer-script) on any non-Windows CI system. CircleCI requires `sudo`.
- On Appveyor + Windows you can use a bit of [Powershell](https://github.com/clj-kondo/clj-kondo/blob/39b5cb2b0d3d004c005e8975b6fafe0e314eec68/appveyor.yml#L60-L64).
2023-01-06 12:33:49 +00:00
2020-11-28 22:20:32 +00:00
## Docker
2021-01-01 10:26:31 +00:00
Check out the image on [Docker hub](https://hub.docker.com/r/babashka/babashka/).
2020-11-28 22:20:32 +00:00
2020-11-28 21:36:36 +00:00
## [News](doc/news.md)
2020-11-20 10:08:42 +00:00
2020-11-20 10:39:05 +00:00
Check out the [news](doc/news.md) page to keep track of babashka-related news items.
2020-11-20 10:08:42 +00:00
2020-11-28 21:36:36 +00:00
## [Built-in namespaces](https://book.babashka.org/#built-in-namespaces)
2020-11-28 21:34:34 +00:00
Go [here](https://book.babashka.org/#built-in-namespaces) to see the full list of built-in namespaces.
## [Compatible Projects](doc/projects.md)
2020-11-28 21:34:34 +00:00
A list of projects (scripts, libraries, pods and tools) known to work with babashka.
## Badges
[![bb compatible](/logo/badge.svg)](https://book.babashka.org#badges)
The babashka compatible badge indicates that a library can be used as babashka dependency.
If this is the case for your library, we encourage you to proudly display this badge.
[![bb built-in](/logo/built-in-badge.svg)](https://book.babashka.org#badges)
The babashka built-in badge means that a library has been built directly into babashka and requires no extra dependencies to use it.
If this rare honor belongs to your library, you should display this badge.
See [the babashka book for details](https://book.babashka.org#badges).
2022-07-01 09:35:07 +00:00
2023-05-01 10:25:14 +00:00
## Swag
- [t-shirt](https://www.etsy.com/listing/1241766068/babashka-clj-kondo-nbb-shirt)
2020-11-28 22:20:32 +00:00
## [Pods](https://github.com/babashka/babashka.pods)
2020-11-28 21:34:34 +00:00
Pods are programs that can be used as a Clojure library by
2020-11-28 21:36:36 +00:00
babashka. Documentation is available in the [pod library
repo](https://github.com/babashka/pods).
2020-11-28 21:34:34 +00:00
A list of available pods can be found in the [pod registry](https://github.com/babashka/pod-registry).
2020-11-28 21:34:34 +00:00
2019-10-07 21:11:49 +00:00
## Differences with Clojure
Babashka is implemented using the [Small Clojure
Interpreter](https://github.com/borkdude/sci). This means that a snippet or
script is not compiled to JVM bytecode, but executed form by form by a runtime
2020-09-14 13:48:37 +00:00
which implements a substantial subset of Clojure. Babashka is compiled to
2020-03-02 08:50:47 +00:00
a native binary using [GraalVM](https://github.com/oracle/graal). It comes with
a selection of built-in namespaces and functions from Clojure and other useful
libraries. The data types (numbers, strings, persistent collections) are the
same. Multi-threading is supported (`pmap`, `future`).
2019-10-07 21:11:49 +00:00
Differences with Clojure:
2020-03-02 08:50:47 +00:00
- A pre-selected set of Java classes are supported. You cannot add Java classes
at runtime.
2020-08-31 13:01:42 +00:00
- Interpretation comes with overhead. Therefore loops are slower than in Clojure
on the JVM. In general interpretation yields slower programs than compiled
programs.
2020-06-11 07:29:22 +00:00
- No `deftype`, `definterface` and unboxed math.
2020-08-31 12:59:57 +00:00
- `defprotocol` and `defrecord` are implemented using multimethods and regular
maps. Ostensibly they work the same, but under the hood there are no Java
classes that correspond to them.
2020-10-01 12:21:40 +00:00
- Currently `reify` works only for one class at a time
2020-08-31 12:59:57 +00:00
- The `clojure.core.async/go` macro is not (yet) supported. For compatibility it
2021-05-16 15:29:02 +00:00
currently maps to `clojure.core.async/thread`. More info
[here](https://book.babashka.org/#core_async).
2020-08-31 12:59:57 +00:00
2020-03-28 08:52:55 +00:00
## Package babashka script as a AWS Lambda
AWS Lambda runtime doesn't support signals, therefore babashka has to disable
handling of SIGINT and SIGPIPE. This can be done by setting
`BABASHKA_DISABLE_SIGNAL_HANDLERS` to `true`.
2020-03-28 08:52:55 +00:00
2020-04-06 19:53:54 +00:00
## Articles, podcasts and videos
2019-12-20 09:45:07 +00:00
2023-02-05 19:31:18 +00:00
- [Blambda analyses sites](https://jmglov.net/blog/2023-01-04-blambda-analyses-sites.html) by Josh Glover
- [The wizard of HOP - How we built the web based HOP CLI Settings Editor using Babashka and Scittle](https://www.gethop.dev/post/the-wizard-of-hop-how-we-built-the-web-based-hop-cli-settings-editor-using-babashka-and-scittle) by Bingen Galartza
- [Simple TUIs with Babashka and Gum](https://rattlin.blog/bbgum.html) by Rattlin.blog
- [Babashka And Dialog Part Ii: Announcing The Bb-Dialog Library](https://www.pixelated-noise.com/blog/2023/01/20/bb-dialog-announcement/index.html) by A.C. Danvers
2023-01-23 14:12:55 +00:00
- [Babashka Babooka](https://www.braveclojure.com/quests/babooka/): Write Command-Line Clojure by Daniel Higginbotham
2023-02-05 19:31:18 +00:00
- [Re-Writing a GlobalProtect OpenConnect VPN Connect script in Babashka](https://tech.toryanderson.com/2023/01/14/re-writing-a-globalprotect-openconnect-vpn-connect-script-in-babashka/) by Tory Anderson
- [Babashka: How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://medium.com/graalvm/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure-b0fcc38b0746) by Michiel Borkent (Japanese version [here]((https://logico-jp.io/2023/01/07/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure/)))
2022-12-18 11:04:30 +00:00
- [Adding Prompts To Your Babashka Scripts With Dialog](https://www.pixelated-noise.com/blog/2022/12/09/dialog-and-babashka/index.html) by A.C. Danvers
2023-01-06 14:14:52 +00:00
- [Scraping an HTML dictionary with Babashka and Bootleg](https://blog.exupero.org/scraping-an-html-dictionary-with-babashka-and-bootleg/) by exupero
2022-12-06 10:39:19 +00:00
- [Using Babashka to Get Electricity Prices](https://www.karimarttila.fi/clojure/2022/12/04/using-babashka-to-get-electricity-prices.html) by Kari Marttila
2023-01-06 14:14:52 +00:00
- [How to Do Things With Babashka](https://presumably.de/how-to-do-things-with-babashka.html) by Paulus Esterhazy (2022-12)
2023-01-06 13:56:19 +00:00
- [Using nREPL as a system interface](https://yogthos.net/posts/2022-11-26-nREPL-system-interaction.html) by Dmitri Sotnikov
2022-11-30 15:51:52 +00:00
- [Manage git hooks with babashka tasks](https://blaster.ai/blog/posts/manage-git-hooks-w-babashka.html) by Mykhaylo Bilyanskyy
- [Messing around with babashka](https://ian-muge.medium.com/messing-around-with-babashka-f181a9003faa) by Ian Muge
2023-01-06 13:38:22 +00:00
- Introducing [bbin](https://radsmith.com/bbin) by Radford Smith (2022-09)
2022-07-23 12:06:38 +00:00
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
2022-07-15 21:33:20 +00:00
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
2022-07-15 21:29:37 +00:00
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
2022-07-15 21:19:34 +00:00
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
- [Breakneck Babashka on K8s](https://www.linkedin.com/pulse/breakneck-babashka-k8s-heow-goodman/) by Heow Goodman
2022-07-15 19:09:25 +00:00
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/)
2022-07-15 19:35:28 +00:00
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
2022-07-15 19:30:23 +00:00
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
2022-07-15 19:44:23 +00:00
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
2022-03-15 10:10:35 +00:00
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
2022-07-15 19:21:24 +00:00
- [Writing Clojure-living-cookbooks](https://www.loop-code-recur.io/live-clojure-cookbooks) by Cyprien Pannier
- [Using babashka with PHP](https://blog.michielborkent.nl/using-babashka-with-php.html) by Michiel Borkent
2021-11-06 08:38:23 +00:00
- [Moldable Emacs: a Clojure Playground with Babashka](https://ag91.github.io/blog/2021/11/05/moldable-emacs-a-clojure-playground-with-babashka/) by Andrea
2021-10-19 17:31:44 +00:00
- [Finding my inner Wes Anderson with #Babashka](https://javahippie.net/clojure/2021/10/18/finding-my-inner-wes-anderson.html) by Tim Zöller
2021-11-14 17:02:04 +00:00
- [Awesome Babashka: Parse & produce HTML and SQLite](https://blog.jakubholy.net/2021/awesome-babashka-dash/) by Jakub Holý
2021-09-01 12:49:28 +00:00
- [Babashka tasks](https://youtu.be/u5ECoR7KT1Y), talk by Michiel Borkent
- [Rewriting a clojure file with rewrite-clj and babashka](https://youtu.be/b7NPKsm8gkc), video by Oxalorg
2021-06-29 21:37:29 +00:00
- [Integrating Babashka into Bazel](https://timjaeger.io/20210627-integrating-babashka-with-bazel.html) by Tim Jäger
- [Talk](https://youtu.be/Yjeh57eE9rg): Babashka: a native Clojure interpreter for scripting — The 2021 Graal Workshop at CGO
- [Blog](https://savo.rocks/posts/playing-new-music-on-old-car-stereo-with-clojure-and-babashka/): Playing New Music On Old Car Stereo With Clojure And Babashka
2021-05-10 18:06:22 +00:00
- [Homoiconicity and feature flags](https://martinklepsch.org/posts/homoiconicity-and-feature-flags.html) by Martin Klepsch
2021-02-08 10:53:30 +00:00
- [Clojure like its PHP](https://eccentric-j.com/blog/clojure-like-its-php.html) by Jay Zawrotny (eccentric-j)
2021-02-08 18:47:13 +00:00
- [Deploy babashka script to AWS Lambda](https://www.jocas.lt/blog/post/babashka-aws-lambda/) by Dainius Jocas.
- [Automating Video Edits with Clojure and ffmpeg](https://youtu.be/Tmgy57R9HZM) by Adam James.
2020-12-26 20:54:10 +00:00
- [Exporter for passwordstore.org](https://www.ieugen.ro/posts/2020/2020-12-26-export-passwords-with-babashka/) by Eugen Stan
2020-12-02 13:22:45 +00:00
- [Babashka and sci internals](https://youtu.be/pgNp4Lk3gf0), a talk by Michiel Borkent at the [London Clojurians Meetup](https://www.meetup.com/London-Clojurians).
- [Writing Clojure on the Command Line with Babashka](https://youtu.be/RogyxI-GaGQ), a talk by Nate Jones.
2020-09-01 22:02:36 +00:00
- [Using Clojure in Command Line with Babashka](http://www.karimarttila.fi/clojure/2020/09/01/using-clojure-in-command-line-with-babashka.html), a blog article by Kari Marttila.
- [Babashka and GraalVM; taking Clojure to new places](https://youtu.be/3EUMA6bd-xQ), a talk by Michiel Borkent at [Clojure/NYC](https://www.meetup.com/Clojure-NYC/).
2020-07-13 19:47:48 +00:00
- [Import a CSV into Kafka, using Babashka](https://blog.davemartin.me/posts/import-a-csv-into-kafka-using-babashka/) by Dave Martin
2020-09-01 21:50:28 +00:00
- [Learning about babashka](https://amontalenti.com/2020/07/11/babashka), a blog article by Andrew Montalenti
2020-05-19 09:26:44 +00:00
- [Babashka Pods](https://www.youtube.com/watch?v=3Q4GUiUIrzg&feature=emb_logo) presentation by Michiel Borkent at the [Dutch Clojure Meetup](http://meetup.com/The-Dutch-Clojure-Meetup).
2020-07-11 20:05:28 +00:00
- [AWS Logs using Babashka](https://tech.toyokumo.co.jp/entry/aws_logs_babashka), a blog published by [Toyokumo](https://toyokumo.co.jp/).
2020-05-19 09:26:44 +00:00
- [The REPL podcast](https://www.therepl.net/episodes/36/) Michiel Borkent talks about [clj-kondo](https://github.com/borkdude/clj-kondo), [Jet](https://github.com/borkdude/jet), Babashka, and [GraalVM](https://github.com/oracle/graal) with Daniel Compton.
2020-04-09 20:02:54 +00:00
- [Implementing an nREPL server for babashka](https://youtu.be/0YmZYnwyHHc): impromptu presentation by Michiel Borkent at the online [Dutch Clojure Meetup](http://meetup.com/The-Dutch-Clojure-Meetup)
2020-04-06 19:53:11 +00:00
- [ClojureScript podcast](https://soundcloud.com/user-959992602/s3-e5-babashka-with-michiel-borkent) with Jacek Schae interviewing Michiel Borkent
2021-01-01 10:26:31 +00:00
- [Babashka talk at ClojureD](https://www.youtube.com/watch?v=Nw8aN-nrdEk) ([slides](https://speakerdeck.com/babashka/babashka-and-the-small-clojure-interpreter-at-clojured-2020)) by Michiel Borkent
2020-02-21 11:15:47 +00:00
- [Babashka: a quick example](https://juxt.pro/blog/posts/babashka.html) by Malcolm Sparks
2019-12-21 20:05:40 +00:00
- [Clojure Start Time in 2019](https://stuartsierra.com/2019/12/21/clojure-start-time-in-2019) by Stuart Sierra
2019-12-20 09:45:07 +00:00
- [Advent of Random
Hacks](https://lambdaisland.com/blog/2019-12-19-advent-of-parens-19-advent-of-random-hacks)
by Arne Brasseur
- [Clojure in the Shell](https://lambdaisland.com/blog/2019-12-05-advent-of-parens-5-clojure-in-the-shell) by Arne Brasseur
- [Clojure Tool](https://purelyfunctional.tv/issues/purelyfunctional-tv-newsletter-351-clojure-tool-babashka/) by Eric Normand
2020-04-26 11:10:30 +00:00
## [Building babashka](doc/build.md)
2020-01-08 20:30:50 +00:00
## [Developing Babashka](doc/dev.md)
2019-08-09 12:51:42 +00:00
2020-05-01 11:12:53 +00:00
## Including new libraries or classes
Before new libraries or classes go into the standardly distributed babashka
binary, these evaluation criteria are considered:
2020-05-01 13:40:53 +00:00
- The library or class is useful for general purpose scripting.
2020-05-01 11:12:53 +00:00
- Adding the library or class would make babashka more compatible with Clojure
2020-05-01 13:40:53 +00:00
libraries relevant to scripting.
2020-05-02 08:44:41 +00:00
- The library cannot be interpreted by with babashka using `--classpath`.
2020-05-01 11:12:53 +00:00
- The functionality can't be met by shelling out to another CLI or can't be
written as a small layer over an existing CLI (like `babashka.curl`) instead.
2022-04-28 10:21:54 +00:00
- The library cannot be implemented as a
2020-06-12 17:47:44 +00:00
[pod](https://github.com/babashka/babashka.pods).
2020-05-01 11:12:53 +00:00
If not all of the criteria are met, but adding a feature is still useful to a
particular company or niche, adding it behind a feature flag is still a
possibility. This is currently the case for `next.jdbc` and the `PostgresQL` and
`HSQLDB` database drivers. Companies interested in these features can compile an
instance of babashka for their internal use. Companies are also free to make
2020-05-01 11:16:38 +00:00
forks of babashka and include their own internal libraries. If their customized
2020-05-01 11:15:11 +00:00
babashka is interesting to share with the world, they are free to distribute it
using a different binary name (like `bb-sql`, `bb-docker`, `bb-yourcompany`,
etc.). See the [feature flag documentation](doc/build.md#feature-flags) and the
implementation of the existing feature flags ([example
2021-01-01 10:26:31 +00:00
commit](https://github.com/babashka/babashka/commit/02c7c51ad4b2b1ab9aa95c26a74448b138fe6659)).
2020-05-01 11:12:53 +00:00
2019-08-13 07:20:48 +00:00
## Related projects
- [planck](https://planck-repl.org/)
- [joker](https://github.com/candid82/joker)
- [closh](https://github.com/dundalek/closh)
- [lumo](https://github.com/anmonteiro/lumo)
2020-11-28 22:34:02 +00:00
## Contributors
Thanks to all the people that contributed to babashka:
2019-11-03 20:28:16 +00:00
2020-04-05 09:32:20 +00:00
- [CircleCI](https://circleci.com/) for CI and additional support
2020-02-23 22:20:16 +00:00
- [Nikita Prokopov](https://github.com/tonsky) for the logo
2021-01-01 10:26:31 +00:00
- [Contributors](https://github.com/babashka/babashka/graphs/contributors) and
2020-02-23 22:20:16 +00:00
other users posting issues with bug reports and ideas
2019-08-09 12:51:42 +00:00
## License
2020-03-02 13:21:57 +00:00
Copyright © 2019-2020 Michiel Borkent
2019-08-09 12:51:42 +00:00
Distributed under the EPL License. See LICENSE.
This project contains code from:
- Clojure, which is licensed under the same EPL License.