logoalt Hacker News

lpilyesterday at 7:18 PM1 replyview on HN

Gleam has first class functions, so it has dynamic dispatch.

Both of type classes and interfaces desugar to high order functions, so anything you write with them can be written with first class functions, though with a less concise API.


Replies

the_dukeyesterday at 7:21 PM

What you are saying is: no, it doesn't.

Of course dynamic dispatch can be implemented in almost every language. The Linux kernel uses dynamic dispatch with C!

But that's a hack, not a language feature.

show 2 replies