Libraries

Official libraries

Besides the standard library, the suru-lang organization keeps small libraries in their own repositories. Add one to a kumu project with kumu 追加 and load it by its name. Each has a README and, for most, API pages on Read the Docs. This list is also in the documentation.

01Using a library

Add the libraries to your project. kumu also fetches what they depend on:

terminal
$ kumu 追加 github.com/suru-lang/db
$ kumu 追加 github.com/suru-lang/sqlite

Then load them by name. This uses 「蔵」 with its SQLite driver:

本体.suru
「蔵」 を 読み込んで 使う
「SQLite」 を 読み込んで 使う

主処理する とは 以下の手順です  # 主処理する = main procedure
  db とは 「店.db」 を SQLite駆動 で DB開封した 結果  # DB開封する = open a database, 駆動 = driver
  db に 「CREATE TABLE IF NOT EXISTS 品 (名前 TEXT, 値段 REAL)」 を DB実行する  # DB実行する = run SQL
  db を DB閉鎖する              # DB閉鎖する = close
  「以上です」 を 表示する
  以上です

主処理する

Libraries that call a C library need it on the system. kumu checks the 外部依存 in each library's 組.suru and tells you how to install it if it is missing.

02Libraries

RepositoryLoad withWhat it doesするAPI
http「HTTP」 「HTTP/クライアント」HTTP server (static files, parallel answering, WebSocket) and an HTTP/HTTPS client0.14.0docs
template「雛形」Jinja2-like template engine: loops, conditions, filters, inheritance, auto-escaping—docs
db「蔵」thin database layer: connect, execute, fetch rows, transactions; the driver picks the database0.14.0docs
sqlite「SQLite」SQLite (libsqlite3), on its own or as the 蔵 driver SQLite駆動0.9.1docs
postgresql「PostgreSQL」PostgreSQL driver for 蔵 (libpq)0.9.1docs
mysql「MySQL」MySQL driver for 蔵 (libmysqlclient)0.9.1docs
orm「台帳」O/R mapper on 蔵: save and find records, conditions as values, one-to-many, tables derived with 【表】0.14.0docs
regex「正規表現」PCRE2 regular expressions: search, search all, replace, split0.9.1docs
gui-sdl3「画面」windows, shapes and Japanese text with SDL3, and Elm-like widgets0.9.1docs
python「Python」runs Python code in the same process (embedded libpython) and gets values back0.9.1README

する is the oldest version of する each README asks for (— means none). All are tested with the latest release. 「蔵」, 「台帳」 and the drivers fit together: the same program runs on SQLite, PostgreSQL or MySQL by changing the driver.

03Web framework 屋台

屋台 (suru-lang/web, 「屋台」, する 0.11.0 or later) is a web framework built from http, 雛形 and 台帳. List the routes with 【道】 and write a handler for each. kumu 新規 店 --対象 web creates an app with everything in place. See the section on the home page and the API documentation.

04ROS 2

rclsuru (「rclsuru」) writes ROS 2 nodes in する that talk to rclcpp and rclpy nodes. Start with the short tutorial.

05Tools written in する

RepositoryWhat it isする
doko“Where am I?”: the Japanese postal code and address for GPS coordinates (decimal degrees, degrees-minutes-seconds, NMEA sentences, GPX files), from the reverse geocoder of GSI and the postal code data of Japan Post; also the libraries 「doko/住所」, 「doko/入力」 and 「doko/郵便」 (API docs); install with kumu 導入0.13.0
surla curl-like command for HTTP and HTTPS, built on http; install with kumu 導入0.12.0
warekia date-like command that answers in the Japanese calendar: the eras from 大化 (645), the sexagenary cycle, the old lunisolar calendar and rokuyō from 445 to 2200; also the library 「和暦」 (API docs); install with kumu 導入0.13.0
ohanashi-ollamaa web app for chatting with local LLMs through Ollama (how to use it)0.4.0

06Making your own

Any Git repository with a 組.suru and a tag can be added with kumu 追加; there is no central registry. See Publishing a library.