Comment

Comment by stevenjgarner

Took me a long time to figure out what gets lost with Erlang is:

a) Ubiquity — everything understands HTTP. Erlang nodes only talk to Erlang (or a compatible runtime)

b) Because there are no middleware standards (REST, GraphQL, OAuth, etc.), you must build or integrate your own abstractions

c) Giving up infrastructure (reverse proxies, load balancers, CDNs), You handle distribution yourself or through OTP design

d) Interoperability with browsers and APIs, requiring bridging via something like Cowboy or gRPC gateway

setcookie secret in Erlang does not create or use an HTTP cookie, SSL certificate, or HTTPS connection. It sets the Erlang distribution cookie, a shared secret string used for node authentication within the Erlang runtime system (the BEAM VM).

Erlang’s built-in distributed networking subsystem allows them to connect to each other if:

1) They can reach each other over TCP (default port 4369 for the EPMD — Erlang Port Mapper Daemon — plus a dynamically assigned port for the node-to-node connection).

2) They share the same cookie value (here "secret").

The author's insight "No HTTP. No REST API", reframes the reality that Erlang moves things down the ISO OSI model - HTTP being on layer 7 and TCP being on layer 4. Erlang therefore misses the "benefits" of operating on a higher ISO layer, but gains powerful advantages of operating on layer 4:

i) True concurrency

ii) Transparent message passing

iii) Fault tolerance

iv) Soft real-time guarantees

v) Persistent cluster connections

Erlang’s design assumes a trusted, closed system of cooperating nodes, not a public Internet of clients. In other words, Erlang doesn’t live below Layer 7 — it IS its own Layer 7.

parent stevenjgarner 11 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton