gleam-erlang-interop

Solid

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.

Data & Documents 158 stars 16 forks Updated 3 weeks ago NOASSERTION

Install

View on GitHub

Quality Score: 79/100

Stars 20%
73
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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. ```gleam // Basic external function @external(erlang, "erlang", "list_to_binary") pub fn list_to_binary(list: List(Int)) -> BitArray // Using external functions pub fn convert_list() { let list = [72, 101, 108, 108, 111] let binary = list_to_binary(list) io.debug(binary) } // External function with multiple arguments @external(erlang, "string", "concat") pub fn string_concat(a: String, b: String) -> String pub fn join_strings() { let result = string_concat("Hello, ", "World!") io.debug(result) } // External function returning Result @ext...

Details

Author
TheBushidoCollective
Repository
TheBushidoCollective/han
Created
6 months ago
Last Updated
3 weeks ago
Language
TypeScript
License
NOASSERTION

Similar Skills

Semantically similar based on skill content — not just same category