logoalt Hacker News

hardwaregeeklast Sunday at 4:21 PM2 repliesview on HN

Everyone agrees that "syntax doesn't matter", but implicit in that is "syntax doesn't matter, so let's do what I prefer". So really, syntax does matter. Personally I prefer the Rust/Zig/Go syntax of vaguely C inspired with some nice fixes, as detailed in the post. Judging by the general success of that style, I do wonder if more functional languages should consider an alternative syntax in that style. The Haskell/OCaml concatenative currying style with whitespace is elegant, but sufficiently unfamiliar that I do think it hurts adoption.

After all, Rust's big success is hiding the spinach of functional programming in the brownie of a systems programming language. Why not imitate that?


Replies

nromiunlast Sunday at 5:09 PM

That saying never made any sense to me either. After all syntax is your main interface to a language. Anything you do has to go through the syntax.

Some people say the syntax just kind of disappears for them after some time. That never seems to happen with me. When I am reading any code the syntax gets even more highlighted.

show 3 replies
brabellast Sunday at 6:08 PM

If you like C-like syntax and want a functional language that uses it, try Gleam: https://gleam.run/

Quite lovely looking code.

    fn spawn_greeter(i: Int) {
      process.spawn(fn() {
        let n = int.to_string(i)
        io.println("Hello from " <> n)
      })
    }
There's also Reason, which is basically OCaml (also compiles to JS - funnily enough, Gleam does that too.. but the default is the Erlang VM) with C-like syntax: https://reasonml.github.io/