11-12 Gleam Weekly

読み終わるまでの目安 約6分

Gleam Weeklyの11と12がリリースされたので勝手に解説していきます。

issue 11

Gleam Weekly
GleamWeekly is handpicked articles and community news delivered to your inbox in one weekly email.
Gleam Weekly favicon https://gleamweekly.com/issues/11/
Gleam Weekly

issue 12

Gleam Weekly
GleamWeekly is handpicked articles and community news delivered to your inbox in one weekly email.
Gleam Weekly favicon https://gleamweekly.com/issues/12/
Gleam Weekly

issue11

This week in Gleam

Gleam 1.2.0 release - Fault tolerant Gleam

Fault tolerant Gleam – Gleam
The Gleam programming language
Fault tolerant Gleam – Gleam favicon https://gleam.run/news/fault-tolerant-gleam/
Fault tolerant Gleam – Gleam

Gleam v1.2.0がリリースされました。ここ1~2週間で一番デカい出来事と言えばこれですね。 今回のリリースは開発体験の向上が主となっています。現に自分も日々の開発で恩恵を受ける機会が多いです。

このリリースについてはZennでも解説しているので気になる方は是非読んでみてください。

Gleam v1.2.0がリリースされた話
Gleam v1.2.0がリリースされた話 favicon https://zenn.dev/comamoca/articles/gleam-release-v1-2-0
Gleam v1.2.0がリリースされた話

Kielet 2.0.0 - A GNU Gettext implementation

KieletというGleamのgettext統合を提供するライブラリのv2.0.0がリリースされました。 gettextというのはGNUプロジェクトにより開発されているツールで、プログラムの他言語対応を補助する機能を持っています。

ソフトウェアの翻訳をやったことがある方は.poとか.moなんて名前のファイルを見たことがあると思うのですが、アレを生成したりするツールがgettextです。

Kieletというライブラリを使うことで、プログラムが出力する文字列をこのgettextの対象に含めることができ翻訳作業をスムースに行えます。

Gloogle - Search through all public gleam packages

Gloogle
Gloogle favicon https://gloogle.run/

これは個人的に衝撃を受けたサイトで、Gleamの型名などを元に関数単位での検索を行なえるというものです。 ライブラリの検索としてGleam Packagesというサイトが既に存在しています。

こちら自分も便利に使っているのですが、ここまで詳細かつ多くの情報を見られるサイトは無いと思います。

リリース当初は応答が遅く、タイムアウトすることもしばしばでしたが、今では応答もかなり速くなっているのでぜひ使ってみてください。

Even more great Gleam stuff

Gleam JSON 2.0 is faster using erlangs built-in JSON library

Gleam公式が提供しているJSONライブラリgleam_jsonがv2.0.0に到達しました。 また、このリリースではErlangの組込みライブラリを用いることで速度が向上しました。

最近gleam_jsonを使う機会が増えているので速度の向上はかなりありがたいです。

Convert HTML into Lustre automatically.

HTML Lustre converter
HTML Lustre converter favicon https://lpil.github.io/html-lustre-converter/

HTMLをLustreのプログラムに変換してくれるサイトです。 FlowbiteなどのTailwindのコンポーネントをLustre使う際にかなり使えます。

issue12

This week in Gleam

End-to-end types: full-stack web apps

End-to-end types: full-stack Web apps with Gleam by Hayleigh Thompson | Code BEAM Europe 2023
✨This talk was recorded at Code BEAM Europe 2023. If you're curious about our upcoming event, check https://codebeameurope.com ✨Abstract:Gleam is a friendly...
End-to-end types: full-stack Web apps with Gleam by Hayleigh Thompson | Code BEAM Europe 2023 favicon https://www.youtube.com/watch?v=eVtkYQva0Ic
End-to-end types: full-stack Web apps with Gleam by Hayleigh Thompson | Code BEAM Europe 2023

ベルリンで開かれたBEAM言語のカンファレンスでGleamのセッションがありました。 このセッションではGleamとLustreを使って音楽を作れるアプリのデモやElmアーキテクチャとErlang OTPのプロセスの類似性などハッとさせられる内容が多かったです。

あとLustreって「ラスター」って読むんですね…ちゃんとした読み方が分かったのも良い収穫でした。

Interactive Lustre tutorial

Welcome to lustre - The Lustre tutorial
An interactive introduction and reference to the Gleam programming language. Learn Gleam in your browser!
Welcome to lustre - The Lustre tutorial favicon https://gleamtours.com/lustre-tutorial/introduction/welcome-to-lustre/
Welcome to lustre - The Lustre tutorial

対話的なLustreのチュートリアルサイトが公開されています。 Runボタンを押すと実際のページが見られるので気軽にLustreをいじれます。

Image from Gyazo Image from Gyazo

Bravo - 2.3.0

GitHub - Michael-Mark-Edu/bravo: Comprehensive ETS bindings for Gleam.
Comprehensive ETS bindings for Gleam. Contribute to Michael-Mark-Edu/bravo development by creating an account on GitHub.
GitHub - Michael-Mark-Edu/bravo: Comprehensive ETS bindings for Gleam. favicon https://github.com/Michael-Mark-Edu/bravo
GitHub - Michael-Mark-Edu/bravo: Comprehensive ETS bindings for Gleam.

ETSのGleam wrapperです。

ETSのWrapperとしてはcarpenterがありますが、 CarpenterはDict と同様に、オブジェクトを単純なキーと値のペアに制限している1ため、柔軟性に欠けています。

bravoはテーブル内の全てのオブジェクトが同じ型でなければならないという事以外制約がありません。

またbravoはすべてのETS関数をライブラリに実装する予定らしく、期待したいところです。

Even more great Gleam stuff

stdin 1.0.0 - provides a synchronous iterator for consuming stdin.

GitHub - Olian04/gleam_stdin: This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun.
This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun. - Olian04/gleam_stdin
GitHub - Olian04/gleam_stdin: This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun. favicon https://github.com/Olian04/gleam-stdin
GitHub - Olian04/gleam_stdin: This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun.

Gleamで標準入力を扱うためのライブラリです。 ありそうでなかったのが結構ビックリで、これ使えば競プロできるんじゃないかと思ったのでやってみたいですね。

This Gleam project prints iterations of the Dragon Curve stacked on top of each other.

GitHub - tcoard/gleam3d
Contribute to tcoard/gleam3d development by creating an account on GitHub.
GitHub - tcoard/gleam3d favicon https://github.com/tcoard/gleam3d
GitHub - tcoard/gleam3d

Gleamでドラゴン曲線を生成できるプロジェクトです。 リポジトリをcloneしてgleam runすると./dataにSTLファイルが出力されます。

Temporary - A package to work with temporary files and directories.

GitHub - giacomocavalieri/temporary: 🗂️ Temporary files in Gleam
🗂️ Temporary files in Gleam. Contribute to giacomocavalieri/temporary development by creating an account on GitHub.
GitHub - giacomocavalieri/temporary: 🗂️ Temporary files in Gleam favicon https://github.com/giacomocavalieri/temporary
GitHub - giacomocavalieri/temporary: 🗂️ Temporary files in Gleam

Gleamで一時ファイルを扱うためのライブラリです。 一時ファイルを扱う機会は以外と多いのでありがたいですね。

まとめ

今回も色々なライブラリが発表されたり更新されました。 興味深いプロダクトも増えてきて、知名度も増してきているのを感じているので自分も何か作ってみたいですね。

Footnotes

  1. 本来ETSは動的型付け言語なので、静的型付け言語であるGleamにとって実装がかなり難しい。