Gleam 0.30 released: Local dependencies and enhanced externals
Gleam, a type-safe and scalable language for the Erlang virtual machine and JavaScript runtimes, has just released version 0.30.0. This update brings exciting new features that developers will find useful.
One of the notable additions is support for local dependencies. Previously, Gleam's build tool only supported Hex, the package repository for the Erlang ecosystem. With this update, developers can now depend on other Gleam projects without pushing them to the repository. This feature is especially helpful when testing projects, working on related packages, or enforcing a specific dependency structure.
Another improvement in Gleam 0.30.0 is the enhanced externals feature. Gleam can import and call functions written in other languages on the runtime, such as Erlang, Elixir, JavaScript, and TypeScript. However, the previous syntax for defining these functions was verbose and repetitive. Now, with the redesigned FFI, developers can define these functions more concisely and keep the various targets in sync.
Additionally, Gleam now includes the "todo" and "panic" keywords, which can be used to crash the program when unfinished or unreachable code is reached. Developers can provide custom messages for these crashes, making it easier to identify and address issues during development.
With these updates, Gleam continues to provide developers with a powerful and efficient language for building robust applications on the Erlang virtual machine and JavaScript runtimes. To learn more about Gleam and its latest features, visit the Gleam package index website.
// Example code using local dependencies and enhanced externals
import gleam/other_package
pub fn main() {
let result = other_package.someFunction()
// ...
}
Stay tuned for more news and updates from the programming language and framework world on Dev Radar!