r/functionalprogramming

How does Elixir 1.20's type system actually differ from what TypeScript or Dialyzer do - and does the distinction matter in practice?
▲ 85 r/functionalprogramming+3 crossposts

How does Elixir 1.20's type system actually differ from what TypeScript or Dialyzer do - and does the distinction matter in practice?

New BEAM There, Done That with Annette Bieniusa (RPTU, Germany) and Guillaume Duboc (Dashbit, PhD from IRIF Paris) on the theoretical and practical story behind what's shipping in Elixir 1.20.

The episode covers the set-theoretic foundation, the gradual design, and the long history of failed attempts at typing Erlang since 1995. But the thing that stuck with me most was the framing of what the type system is and isn't trying to do:

The BEAM ran telecoms for 25 years without static types, with seconds of downtime per year. Supervision trees and let it crash handle an entirely different class of failures from what a type checker catches. The argument for types here isn't that the runtime is broken - it's that type errors are a separate cost (restarts, latency, overprovisioning) that supervision handles but doesn't eliminate. Even catching 5% of those at compile time instead has measurable infrastructure impact.

What got me thinking: the episode raises the false confidence risk - developers seeing types and writing fewer supervision trees, less defensive code, no recovery strategy. Has anyone here actually observed this shift in teams adopting typed languages? And do you think the BEAM community is more or less susceptible to it than others, given how explicitly OTP teaches you to expect failure?

https://youtu.be/X_CPDt3PeDE?si=yJTRAwlAaf7h2rlZ

u/rtrusca — 3 days ago
▲ 35 r/functionalprogramming+3 crossposts

Code BEAM Europe 2026: Keynotes, Full Tech Lineup, and Community Spaces

Hi everyone,

Code BEAM Europe 2026 is happening this October 21-22 in Haarlem, NL, and online! The schedule is locked in, and we are excited to finally share the full lineup and core tracks with the community.

Here is a look at what we have lined up for this year:

Keynote Speakers

We are thrilled to have two incredible visionaries taking the main stage to kick things off:

  • Brooklyn Zelenka: Distributed systems researcher, founder of Fission, and author of Elixir libraries like Witchcraft. She will be sharing her deep expertise in local-first access control and open distributed standards.
  • Sam Aaron: The creator of Sonic Pi! An internationally renowned live coding performer and Computer Science PhD, Sam will bring his unique blend of science, code, and live music to the BEAM community.

Core Themes & Subjects

The regular sessions are packed with core team members, maintainers, and production engineers covering the cutting edge of the ecosystem. You can expect deep dives into the rise of Gleam and frontend architectures with Lustre, alongside advanced Erlang and OTP core updates directly from the team at Ericsson. We will also explore real-world Elixir battle stories—from taming LiveView at scale to prototyping BlueSky's DataPlane—while tackling the intersection of AI, security, and modern developer experience. Finally, we'll take the BEAM out of the server room with talks on embedded systems, AtomVM, hardware design, and safe native interop via Rustler and C nodes.

Check all speakers and their talks at: https://codebeameurope.com/#speakers

Beyond the Stage: The Informal Space

Some of the best moments happen off the main stage. This year, we are introducing a community-driven sandbox running alongside the main tracks for everything that doesn't perfectly fit a standard talk format. Expect live demos, hacking sessions, panel debates, lightning talks, and games. If you have an idea for an activity you want to coordinate, let us know and help shape the space!

Submit your ideas here!

Join Us in Haarlem

Whether you are looking to level up your skills, hack on new projects, or just grab a coffee and talk shop with fellow BEAMers, we would love to see you there.

Early Bird tickets are currently LIVE.

This is the absolute best time to secure your spot at the lowest possible price point.

Grab them here: https://codebeameurope.com/#register

And Also! For the full details, check our website: https://codebeameurope.com/

See you in October!

- The Code BEAM Europe Team

u/Code_Sync — 3 days ago

Beginner in functional programming

Hi everyone, I wanted to ask how you would start from scratch in functional programming to understand it in detail. I'm a guy who comes from the imperative paradigm and I want to delve deeper and investigate about functional programming.

I'm learning Gleam and some Erlang to understand Beam, and I'm not sure if it's a good place to start. I feel like I'm lacking some theory. Any recommendations would be appreciated.

reddit.com
u/Secure_Employer132 — 5 days ago
▲ 22 r/functionalprogramming+1 crossposts

Algebraic Shape Composition in a tiny functional language

Last week i built a little side-project, Clape (https://github.com/zweiler1/clape), a very minimal funcrional programming language built around composable shapes instead of nominal types.

The core idea is that you don't define types but rather describe shapes and compose them using & for products and | for sums. Here are two examples of the language for a quick glimpse at it:

use Print

let Option<T> = Some(T) | None

let get_first<T> = (list: [T]) -> Option<T> {
    match list {
        [] => .None;
        head :: tail => .Some(head)
    }
}

let _ = print {get_first []}
let _ = print {get_first [1, 2]}
let _ = print {get_first ["hi", "there"]}

Output:

.None
.Some(1)
.Some("hi")

and

use Print

let Point2D = x(Float) & y(Float)
let Point3D = Point2D & z(Float)

let add = (p1: Point2D, p2: Point2D) -> Point2D {
    .x(p1.x + p2.x) & .y(p1.y + p2.y)
}

let get_x = (p: x(Float)) -> Float {
    p.x
}

let p1 = .x(2.3) & .y(3.4)
let p2 = p1 & .z(4.4)
let p3 = p2 & {add p1 p2}
let _ = print p3

let _ = print {get_x p1}
let _ = print {get_x p2}
let _ = print {get_x p3}

Output:

.x(4.6) & .y(6.8) & .z(4.4)
2.3
2.3
4.6

I kept the languages scope as minimal and focused as possible, so i think it's learnable in under an hour, or even less if you are familiar with functional languages. So, if you want to read more about it, the entire language documentation is in the repos readme, as it's really not that much.

I’m very new to functional languages in general (i mainly use C++, C and Zig nowadays), so this was mostly a small exploration project. I wanted to experiment with interpreters before adding compile-time execution to my main language (Flint). The experience has been surprisingly fun, as the language scope was so narrow too.

I’m posting here because I’d love feedback from people more experienced in FP:

  • Is this kind of structural shape composition similar to anything that already exists in other languages? (It seems to me like Row Polymorphism could be similar to this system)
  • Does the core idea feel useful to you or is the language basically just a copy of language X? I only have experience in imperative languages and took some inspiration from Ocaml syntax regarding Lists (cons operator) for Clape.

Disclaimer: I used an LLM in the early commits to get the interpreter and parser up and running quickly. It suprised me with a pratt parser (i never wrote one myself before). Nothing anyLLM did was just blindly accepted, I carefully reviewed and rewrote it all. But i still used them as this project was meant as a fun exploration project. I hope that's understandable for you all.

Edit: Formatting of code blocks and output, it somehow escaped a lot of stuff with \...

Edit2: Changed product type example to better showcase what I mean with shapes

Edit3: I now understand that the entire language is essnetially just purely strucutal typing of structural sums (exact same as TypeScripts union types or OCamls polymorphic variants) and structural products (which is just row polymorphism). So, there is nothing new or novel about it, only the syntax and coherence of it, but other than that it's just a rehashing of already known concepts. Thanks to everyone who answered :)

u/zweiler1 — 5 days ago

Katharos: a functional programming and concurrency library for Python where errors, effects, and channel hand-offs are all composable values

I have been building Katharos, a functional programming library for Python that recently grew a message-passing concurrency layer. I wanted to share it and get some feedback.

The whole library is built around one idea: model errors, effects, and concurrent communication as composable, type-safe values rather than as control flow that jumps around your program. The interesting part (to me, at least) is that the concurrency layer follows the exact same idea, so receiving from a channel gives you a Result. "The channel is closed" becomes a value you handle, not an exception you remember to catch.

The functional core

Optional values without scattered None checks, using do-notation that short-circuits on Nothing:

from katharos.types import Maybe
from katharos.syntax_sugar import do, DoBlock

@do(Maybe)
def lookup_discount(user_id: int) -> DoBlock[Maybe, float]:
    user    = yield find_user(user_id)
    account = yield find_account(user)
    return account.discount   # Just(0.15) or Nothing()

Errors as values, chained with |, so a failure short-circuits the rest automatically:

from katharos.types import Result

def process(raw: str) -> Result[Exception, int]:
    return parse_int(raw) | validate_positive

And Result.catch turns a function that raises into one that returns a Result, while keeping the original traceback so you can still find the line that failed:

from katharos.types import Result

@Result.catch(ValueError)
def parse_int(s: str) -> int:
    return int(s)

parse_int("42")   # Success(42)
parse_int("??")   # Failure(ValueError("invalid literal for int() with base 10: '??'"))

There is also ImmutableList, NonEmptyList, IO, Lazy, numeric monoids, and the usual algebraic abstractions (Functor, Applicative, Monad, Semigroup, Monoid) if you want to build your own types.

The new part: CSP concurrency

This is what I have been working on lately. Katharos now has Go-style CSP (Communicating Sequential Processes): launch work concurrently with go, talk over typed channels, and receive values as a Result.

from katharos.concurrency.csp import csp

ch = csp.Channel[int](capacity=1)

csp.go(ch.send, 42)     # run work concurrently, like Go's `go f(x)`

ch.recv()               # Success(42)

ch.close()
ch.recv()               # Failure(ChannelClosedError(...)): closure is a value, not a raise

Used as a context manager, go becomes a structured-concurrency scope that joins everything spawned inside it before the block exits, so concurrent work cannot leak out of the block:

with csp.go:                 # scope waits for all work launched inside
    csp.go(worker, 1)
    csp.go(worker, 2)
# both workers have finished here

There is also a select for waiting on whichever of several channels is ready first, with non-blocking polls and timeouts:

from katharos.concurrency.csp import csp, recv, select

choice = select(recv(results), recv(cancel), timeout=1.0)
if choice.is_timeout:
    ...
else:
    print(choice.index, choice.value.unwrap())

The concurrency model sits on a swappable backend (standard threads by default), so the same code could run on a green-thread backend later. An actor model is planned next, built on the same backend abstraction and the same Result-valued style.

Why I think the "channel returns a Result" thing is nice

In most channel APIs, a closed channel or a timeout shows up as a sentinel, a second return value, or an exception. In Katharos it is just a typed value: Success(v), Failure(ChannelClosedError), or Failure(ChannelTimeoutError). You pattern-match it the same way you handle any other Result, and the type tells you it can happen. The error-handling discipline you use in the rest of your code carries straight over to concurrency.

Links

I would love feedback on the API, the concurrency design, or whether the Result-everywhere approach feels natural or noisy to you in practice. Thanks for reading.

reddit.com
u/EntryNo8040 — 10 days ago