Post

Avatar
Find a new massively parallel, high-level programming language. I ask, Is it a real language or do you not have for loops? They laugh and say it has higher-order functions with full closure support, “its a good language sir” Start reading the tutorial Theres no for loops
Avatar
Is this Bend by chance?
Avatar
Avatar
Avatar
It looks they have have folds and iteration, so they're not wrong that they can express for loops but they don't have a `for` keyword. `for` is `map` with the arguments reversed, so it should be very easy to add. This langue is based on the interaction calculus, so it's *very* functional flavoured
Avatar
Tail recursion is sufficient.
Avatar
Then let the compiler sort it out for me, add some sugar to turn my loops into recursion automagically. Normal programmers need loops
Avatar
When I’m doing a coding interview and there’s an obvious place for recursion I say “now as we all know a for loop is equivalent to tail recursion” and write a for loop
Avatar
utter brilliance. Put those FP losers in their place.
Avatar
Next time I get the chance I'm tempted to used nested closures to secretly create a return stack.
Avatar
I recommend you check out Erlang and Elixir; the languages do not require C++/C/ALGOL/Fortran/whatever-style loop iteration. It's a matter of how to write an algorithm, nothing more or less.
Avatar
Im very familiar with functional programming, i understand you *can* write code that way, but most people don’t, and if you’re building software beyond a personal hobby project you should write it so other people can read and contribute to it
Avatar
Not every functional programming language is Haskell There are a lot of companies using elixir or clojure
Avatar
> Not every functional programming language is Haskell :+1: :)
Avatar
Erlang does not have a loop but has a loop programming pattern using an iteration variable in recursion. The same as in Elixir. The compiler does optimize these patterns to prevent additional overhead. So I don't think "normal programmer" has anything special to catch up the programming pattern.
Avatar
I do agree and understand that ALGOL/C/C++/Java/whatever-style block structure, *mutable* variables and *sharing-based* arrays and structs, and loop-variable-based iteration are incorporated in majority of the programming languages.
Avatar
Avatar
Nah but I actually agree with you, that kind of sugar would be really easy too
Avatar
Why would you need that? Simply use reduce or function recursion
Avatar
As a retired software engineer, I'm fascinated as to why the humble 'for' loop is so high on your list of priorities.
Avatar
Avatar
was our for tea in Rome with an old friend reminiscing about how its 21 years since I discovered Erlang and the BEAM and now all the Elixir, Gleam, LFE etc loop-free languages and never missed for i =1, n; i++ You can do it - believe in yourself
Avatar
Lol. There ARE loops, there is not YET a for keyword but definitelly easy to implement as function. Go laughing about Bend. In the future you maybe cry for not being using or practicing it since the beginning.
Avatar
Taelin is a friend of mine and he is a motherf*cker workaholic that will definitely die to make the possible and impossible for Bend be an even more powerfull and faster language. He is very skilled on programming languages design, type theory, proofs and functional programming.
Avatar
"Quiet Posters" is down