jononomo

jononomo

At my last company we migrated a large codebase from JavaScript to TypeScript – basically it just amounted to adding a couple of lines to the file, changing the extension to .ts instead of .js and then going through and making sure all your code now adhered to the slightly stricter standard. We also had a separate directory where we had some type-specification files that we had to create for some of the more complex types that we used.

Is there a similar layer that it is possible to add on top of Elixir?

Showing Posts 1 to 10

Marcus

Marcus

Maybe, @spec and dialyzer. See also: How do typespecs / dialyzer compare to Typescript?

jononomo

jononomo OP

Thanks - that was an interesting thread. There seem to be mixed reviews on Dialyzer.

I’d also be curious to hear someone spell out what the upsides are to having Elixir be a dynamically typed language rather than a statically typed language.

All I hear about are the downsides of dynamic typing, but surely there must also be some upsides (other than merely slightly shorter lines of code)?

ityonemo

ityonemo

Upsides to dynamic typing:

Consider the case of launching Task.async within a GenServer and catching the result using the info/2 callback. How does a static typesystem correctly type this situation?

LostKobrakai

LostKobrakai

There are few things, which need dynamic typing: modules defined at runtime, hot code updates, ducktyping (if if quacks it’s a duck), …

But the most important one is (distributed) message passing.

You could also look at gleam and what it can’t statically type.

dimitarvp

dimitarvp

At this point it’s pretty much known that BEAM code cannot be 100% statically type checked. But I do wonder what’s the problem in having static checking in 95% of the places and just use more defensive dynamic dispatch code for those 5% that can’t be typed (speaking about internal implementation of course, not about manual coding in Erlang/Elixir/etc.)

LostKobrakai

LostKobrakai

Isn’t that essentially what gleam does or at least tries to do?

dimitarvp

dimitarvp

From the (not much) of what I’ve read, yes. Still curious if they deal with macros or metaprogramming in general?

zkessin

zkessin

People have been trying to add types to the BEAM since at least the 2005 timeframe, and it always seems to fail on the same few corner cases. (Dynamic Upgrades, Message passing etc)

stevensonmt

stevensonmt

I believe the main developer of Gleam posted on here not too long ago that they do not handle macros yet in Gleam. They have an open issue on Github for discussing a macro system:
https://github.com/gleam-lang/suggestions/issues/22

al2o3cr

al2o3cr

For a start, dynamically-typed Elixir… exists.

There are statically-typed alternatives on the horizon, but they aren’t done yet: Gleam looks to be moving forward at a good speed in public (first release of the actor stuff dropped back in October), and there’s something over at Facebook working in private.

On the flipside: what would “full” static typing bring that Dialyzer doesn’t? Even Gleam has a Dynamic type for when it can’t decide / can’t verify the type (for instance, in the raw OTP plumbing).

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews