[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Erlang-Inspired Language Gleam Now Compiles to JavaScript

Erlang-Inspired Language Gleam Now Compiles to JavaScript

This item in japanese

Sep 12, 2021 1 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

Gleam, which self-describes as a language for building type-safe, scalable systems for the Erlang virtual machine, now also compiles to JavaScript.

Gleam, a statically typed language for the Erlang VM, is inspired by the ML family of languages. Gleam compiles to Erlang and boasts zero-cost interoperation with other BEAM languages (e.g., Erlang itself, Elixir, LFE (Lisp Flavored Erlang). The latest release of Gleam (v0,16) now compiles to JavaScript.

Gleam’s core maintainer explained the rationale behind the adoption of JavaScript as a compilation target as follows:

The Erlang virtual machine is second-to-none for long-running services that run on servers, but outside of this space, it may not always be the best tool for the job. [...]
JavaScript [...] has robust concurrency features and respectable single-threaded performance thanks to highly optimised runtimes such as Google’s V8 engine [...]
By compiling to JavaScript [...] Gleam can be used for a much wider range of problem spaces and domains, and be accessible to a wider range of people. A team writing a backend web API in Gleam can now choose to also write their website frontend in Gleam, sharing code between both platforms and enjoying the friendly and productive type-based programming style of Gleam throughout their application stack.

As a new member of the long list of compile-to-JavaScript languages, Gleam differentiates itself with three key features: actor-based multi-core concurrency, Erlang-style fault tolerance, and algebraic data types.

Gleam’s core maintainer addressed comments from developers and Gleam’s roadmap on Reddit. In particular, he signaled interest in leveraging the new compilation to JavaScript to experiment with a full-stack web framework:

[A developer:] This is awesome. I’ve been looking forward to a Phoenix-like framework in Gleam, and now I can totally see the same language being used on the frontend too.
[Gleam’s core maintainer:] A full-stack web framework is certainly something we want to explore in the future.

Developers may download a prebuilt version of the compiler for their operating system (Linux, Windows, macOS). As Gleam compiles to Erlang code, having Erlang installed is a prerequisite to run compiled Gleam code. Interested developers can review the full description of language features in the online documentation.

Rate this Article

Adoption
Style

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /