Hacker News new | ask | show | jobs
by bjacks 3798 days ago
Can anyone explain what a sequential programming language is?

Context here:

"I guess I’d underestimated the difficulty of implementing Anything-over-TCP in a sequential language. Just because it’s really really easy in Erlang doesn’t mean to say it’s easy in sequential languages."

4 comments

I think he's referring to how Erlang uses the Actor Model. An Erlang program consists of (possibly) thousands of individual lightweight-processes. In this model a typical task may be spread out over many asynchronous processes. You can think of it as a program thats made up of thousands of micro-services. Instead of a task taking place over a sequential piece of code, it takes places over many individual processes that coordinate by communicating with each other.
Imperative programming. Lists of statements, vs Erlang's declarative programming, where you describe the program without specifying control flow.
Erlang is absolutely a fixed in-order control flow programming language, on message receipt. It is (generally) referentially transparent, but not declarative.
Oh, I don't know much about Erlang so I thought for sure that's what he meant. What was that supposed to mean, then?
Given that he is contrasting to Erlang, maybe he's talking about imperative languages instead of (pure) functional ones?
Erlang's pattern matching allows a great many things to be done in a declarative style. For some problems you end up with a lot of pattern stuff and not all that much "normal" code. Or you pattern match through what would ordinarily be a lot of flow control statements, for each case writing very simple code to handle that one thing.

Since Erlang isn't a declarative language in the larger sense, that's my guess what he meant.