Agent skill · software engineering · thebushidocollective
Gleam Erlang Interop
Use when gleam-Erlang interoperability including calling Erlang code from Gleam, using Erlang libraries, external functions, working with Erlang types, NIFs, and leveraging the BEAM ecosystem from Gleam applications.
Why this skill is useful
Provides specific patterns and external function declarations for integrating Gleam with Erlang, which are not commonly known.
What it needs
About 9k tokens when loaded. Last updated 2026-07-19. 187 stars on the source repository.
What this skill does
Gleam Erlang Interop Introduction Gleam compiles to Erlang, enabling seamless interoperability with the vast Erlang ecosystem. This interop allows Gleam developers to leverage battle-tested Erlang libraries while writing type-safe Gleam code, combining modern language features with decades of production-proven libraries. The interop mechanism uses external functions to call Erlang code, with Gleam's type system providing safety at the boundary. Gleam can call any Erlang function, use Erlang processes, and integrate with OTP behaviors while maintaining type safety. This skill covers external function declarations, calling Erlang modules, working with Erlang types, using Erlang standard library, NIFs and ports, and patterns for safe type boundaries when integrating with Erlang code. External Function Declarations External functions declare Erlang functions with Gleam types, providing typed interfaces to Erlang code. External declarations bridge Gleam's type system with Erlang's dynamic runtime. Using Erlang Standard Library Gleam can leverage Erlang's comprehensive standard library for various operations. Erlang's standard library provides production-tested functionality for common operations. Working with Erlang Types Gleam's Dynamic type enables safe interop with Erlang's dynamic type system. Dynamic decoders provide safe conversion from Erlang's dynamic types to Gleam's static types. NIFs and Ports Native Implemented Functions and ports enable integration with C code and external programs. NIFs provide performance-critical native code while ports enable safe external process communication. OTP Integration Gleam integrates seamlessly with OTP behaviors and supervision trees. OTP integration enables building production-grade applications with proven patterns. Best Practices 1. Wrap external functions with safe interfaces that handle errors and provide Gleam types 2. Use Dynamic decoders for all data received from Erlang to ensure type safety 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills thebushidocollective/gleam-interop