r/elixir • u/durchlino • 6h ago
r/elixir • u/MagnusSedlacek • 1h ago
Bringing Static Types to Elixir - Giuseppe Castagna & Guillaume Duboc at Func Prog Conf
Elixir is a dynamically typed language, but for several years it has been evolving towards a static type system. This reflects a broader trend across dynamic languages, driven largely by programmers who want stronger guarantees and better tooling without giving up the flexibility that made these languages attractive in the first place.
This talk presents the ideas behind Elixir’s set-theoretic type system, and why set-theoretic types are a particularly good fit for dynamic languages. The system models types as sets of possible values, allowing unions, intersections, negation, and subtyping to be used as first-class tools for describing the highly dynamic code that appears in real Elixir programs.
We will look at how these ideas interact naturally with some of Elixir’s most prominent features: pattern matching with guards, function overloading, flexible data structures such as maps and tuples, protocols (aka type classes), and parametric polymorphism.
As these ideas make their way into the Elixir compiler, we will show how we put them to the test, measuring the type checker’s accuracy across a range of existing Elixir codebases.
We will conclude by outlining the theoretical extensions we plan to explore and how they could eventually be implemented in Elixir.
r/elixir • u/Shoddy_One4465 • 17h ago
BAM 0.1.0 — streaming SAM and BAM for Elixir
I just released bam 0.1.0, a library for reading and writing SAM and BAM alignment files.
It streams records, reads a genomic interval through a BAI or CSI index, and writes BAM plus an index. Compression goes through OTP :zlib. There is no NIF. Elixir ~> 1.18, no runtime dependencies.
{:bam, "~> 0.1.0"}
{:ok, handle} = BAM.open("sample.bam")
{:ok, reads} = BAM.read(handle, "chr1:1-1000")
This is a first release. It uses samtools 1.25 for synthetic fixtures. It is not a claim of full SAMv1 conformance. CRAM is not implemented.
- https://hex.pm/packages/bam
- https://hexdocs.pm/bam
- https://github.com/baoulo/bam-elixir