Why is every programming language becoming homogenous?

Literally every modern programming language is converging on the same syntax.

>Lambdas
>match
>functional (map, reduce, filter, etc.)

What's even the differences between our languages anymore? Is this globohomo's attempt to ruin our programming languages?

Attached: syntactic_sugar.png (340x263, 18.53K)

>why do good ideas persist, prevail, and permeate
Functional programming is probably as close as we get to mathematics. Which is like the fundamentals of what we're doing here. Make the computer compute something.
Math has an infinite amount of maturity compared to digital computers at all. So it makes sense to allow people to express to humans and the machine how to execute an operation as a lambda in an approximate way they would in mathematics. It's one of the most basic things, a function call. Which has no reason to be special. Why not be able to write it in line or treat it as a variable set of data?

Why not have pattern matching? That's a very common thing programmers need to do, having a standard way seems fine.
Likewise with the map reduce filter, you can use other pipelining patterns instead of calls like that but this wouldn't prevent you from doing that.

What's your issues with these things?

Why is that a problem exactly? Even if it were true (which it isnt) you would need some sort of concrete argument for why it's bad. Spending all your time worrying about syntax is just less time you spend actually writing code or doing something cool.

Meds

ooptard paid for courses on ooptard shit now realizing theyre worthless irl

What is the difference between Java and Javascript?

>Well, Java has the JVM and doesn't have protoypal inheritance
>Javascript has functions as first-class objects. Every function in Java is a method.
>Javascript has async await built in.
>Javascript has different scoping rules
>Java is statically typed
>and ...???????

What about javascript and python?

>Well python has traditional object oriented programming along with some extra features like class methods and dunder methods
>python also has list comprehensions, generators, with statements
>different scoping rules, use-strict

Python and javascript are virtually the same language. Neither is more powerful than the other and neither is more competent at a particular job than one another. The main reason why they aren't used equally is because one is used in the web browser while the other isn't.

If we don't specialize languages for a particular purpose or application, we won't reap productivity benefits.

>lambdas
A nameless local function.

>match
A more powerful switch.

>functional
Implicit structs with function pointers in them.

Because there's a lot of make-work in software development these days. Programming languages are no exception. C++ is getting updated every 3 years. .NET is yearly. Python even more often. This update cadence must be justified with new features, so everything that can be copied from elsewhere gets implemented.

>>functional
>Implicit structs with function pointers in them.
Is this essential? You can probably do functional programming without closures, though I haven't tried yet.

It is essential to get any use of function passing beyond the simplest examples. Without closures, you severely cripple what's possible with higher-order functions, which is why when the functional craze started and everyone added "lambdas", they also kept talking about "closures".
If you lack the implicit mechanism for closures, it's better to just standardize on a calling convention to pass a pointer to additional parameters to the function pointer, and then you might as well put that pointer in a struct with the function pointer, and you've got yourself a closure.

>If we don't specialize languages for a particular purpose or application, we won't reap productivity benefits.
I posit this has nothing to do with the language or grammer and everything to do with the implementation.
Java in particular being great here. Not only does the language not have to change, but the program doesn't either, yet the JVM it runs on can be swapped out and tuned to specific applications.
Do you want to trade memory for perf? Compile up front instead of being interpreted at runtime? Do you have really low specs?
Just use the appropriate jvm for each instance with the same program, written in the same language.

The same applies elsewhere. You can use JS outside of the browser despite node still just being JS with some libraries.
You can put Python in the browser, multiple of these already exist.

I argue issues with specialization are not as heavily tied to the language and its feature set as you imply.

I remember doing last years advent of code in haskell and I don't remember accessing the outer function's scope much. I'm a noob though, and in functions with mutable data I've done it occasionally.
Partial function application is much more essential

LISP may be an even better example here. You get function calls and the ability to extend the syntax, any specialization is up to you and/or your LISP dialect/toolset.
No features, yet still appropriate for any task depending on how you make the interpreter.
Other languages could still be applied if the interpreter/compiler was specialized instead of the language as a whole.
People do embedded Python despite that not making sense if you're used to using the regular distributions for general scripts.

If you've used partially applied functions in Haskell, you have used closures extensively. Say that f takes two arguments, then (f x) in map (f x) ys closes over x. Currying, and the lightweight partial application it permits, works because of closures: you return a closure of the partial application for each new argument. (of course this is optimized away for the most part when possible, but ideally this is what it is)
FP without closures would mean that you can ONLY pass top level functions partially applied to nothing, and that lambdas are syntactic sugar for top level functions.

I’m doing what that user in /dpt/ said and tried learning Coroutines, Closures, and OOP in C
It’s scarily hard

They are becoming Lisp.

Assuming you've read your sicp, you'd be better off doing something like nand2tetris and gforth and then read up on how to compile those things (e.g. write a compiler for a small scheme with call/cc using compiling with continuations), and then do it again in a typed language (rewrite said compiler in haskell). Finish reading up on the "compiling with compilations" line of papers and you're up to par with PLT research without the pains of C's accidental complexities.

ah ok that makes sense then
I always wondered about the best way to do python-style generator functions in C.
The easiest but most fragile way would probably be static variables
Struct with the state could work but be very tedious
I don't know how good the pthreads api is to know if it could produce an elegant solution for you.
Would longjump be feasible too?

Haskell is superior. Therefore, other languages imitate Haskell.

Attached: 6CDE69F1-D47B-48E9-B896-CC59EB504E0B.png (775x1127, 21.62K)

Generator "functions" are usually done with macros. Easier than actually trying to figure out how the fuck you're going to do all that memory management.

>gforth
I meant jonesforth sorry.