4 ms·
I always feel like a bit of an outsider with these things; I see stuff like Zig and Odin and Nim being posted, and everyone on HN talking about how great they a
by tombert 3y ago
I always feel like a bit of an outsider with these things; I see stuff like Zig and Odin and Nim being posted, and everyone on HN talking about how great they are, and I feel like I'm missing something.
I have absolutely no desire to going back to manual loops instead of `map` and `reduce` and `filter`, and I have no desire to go back to imperative style, but I appear to be somewhat in the minority on this. Everyone seems to love Go now, and people keep telling me that they like the language because it's "simple", but I have absolutely no god damn idea how they explain that. I know C well enough to do an interview or hack on FreeRTOS, and I've done a fair amount of paid Go work in the last few years, and despite that I am always craving for a functional language. Any functional language. Give me Haskell or Lisp or OCaml or F# or Rust or even JavaScript.
- mjburgess 3y agoIt's the aesthetic of programming as "solving the actual problem", vs. programming as "solving the problem of how to solve the problem". When you're solving the actual problem imperative is largely the right default: each line clearly relates to the actual problem; and it's clear how the actual problem is being solved. When you're bored, or have no actual problems, it's fun that every line is a little puzzle.
- tombert 3y agoI think I disagree with this entirely. With imperative you’re actively translating the problem in terms of how things are going to be interpreted by the CPU. With functional you actual express how to solve the problem and trust that the language constructs will handle stuff like loops for you.
- flohofwoe 3y ago> ...manual loops instead of `map` and `reduce` and `filter`... ...you're free to implement such functions in a Zig/Odin/Nim library as well, but in the end it's just another way to loop over data, and inside your own implementation there will be regular loops, so why bake this stuff into the language when it can be done just as effciently in a library.
- pjmlp 3y agoThis is only possible if the language is powerfull enough to express such things as library types, and the optimizer good enough to ellide them. Only then it can be done "just as effciently in a library.".
- gingerBill 3y ago> I have absolutely no desire to going back to manual loops instead of `map` and `reduce` and `filter` Not everyone wants nor desired to use a functional language. They might want or even need an imperative (and procedural) language. Odin is an imperative procedural language, and has no "functional programming" aspects to it. Odin is not of that tradition. If you love functional programming languages and they are useful for solving your problems, then Odin is not the language for you, and that is absolutely great! Odin is for people who wanted a C alternative for systems-level programming, and thus an imperative procedural language is what they desire. And as such, Odin is not a mixed-paradigm language either, since it does not make sense for it (e.g. explicit manual memory management, imperative style, etc). --- Isn't it great that there is choice now between programming languages?---in the domains people work in.
- tombert 3y agoSure, I wasn’t really asking permission to prefer functional languages. I’m just a bit confused to why everyone on HN seems to prefer imperative languages, and it’s not quite as simple as preference. If an imperative procedural language gets popular, that affects the job market. It seems like every job now requires a million years of Go experience. That’s fine, times change, but it just feels like the wrong direction. Personally I was more rooting for Rust or Swift becoming the lingua Franca.