270 karma · joined August 16, 2013
Personally as a developer I really like having the choice whether to buffer in one place in my system (using a persistent queue f.i.) and have the rest of the system cooperate in tandem without running out of memory f.i. Or to choose to ignore elements when stuff is just going to fast. Etc. I feel more in control of the behaviour under load of my system.
I guess Lightbend was onto something when they took the old EAI notion of backpressure (as f.i. described in Gregor Hohpes book) and implemented it in stream processing and started an interoperability standard around it.
In my experience with quite a few Scala project with mixed teams it's not a problem though.
You just maintain some shared culture of "don't do X if not absolutely necessary". You need that for any language. In this case it's: don't do typelevel tricks if you can help it. And it turns out that 99.9 % of non-framework code doesn't need it. And the large majority of devs are fine with writing clear code.
Then there are some smart devs that are at a stage of personal development where they are intrigued with typelevel tricks. I've only had one colleague who didn't wasn't open to the "hey, that's not really necessary there. Let's not add complexity if we can help it" type of code review comment.
To each his own. But for the teams I've worked with Scala was the typed-FP-on-the-JVM lets-get-shit-done language.
He's a professor of statistical econometrics now.
I recognise your concern: asynchronicity is infectious if it's manifested as monads. Which sucks. Client code needs to know whether the code it is calling is blocking or asynchronous.
Maybe effect systems can trace through code whether it is 'infected' with blockingness. Without any change showing in the intermediary source code. The blockingness/non-blockingness only manifesting itself at the top of the call graph.
I'm incredibly impressed with the stewardship of Scala: they did a thorough assessment of the strengths and weaknesses of language and compiler and are working on a complete refoundation of the language semantics and a rewrite of the compiler while also steadily progressing along a multi year roadmap for the current compiler.
Java has been sloooowly adding features that Scala championed in the JVM world; lambdas and type inference within them in Java 8, REPL in Java 9, partial cases clases in Java 10 (yes to the syntactic sugar, no to the ADT semantics and pattern matching). Adding those features underscores the validity of Scalas vision. But if you've experienced the real thing Java is just too little too late.
Good luck waiting for hobbled cases class for the next 3 to 4 years. By the time Java has those the rest of the world will be accustomed to union types and literal types.
When it comes to Monad et al I'm reminded of this talk by Gilad Bracha. He points out that the function names and type names that stem from category theory are not very good at communicating their intent in programming. (my words) Monad could be named Flatmappable f.i. 'unit' and 'bind' can have more intuïtive names as well.
At the moment I get the impression that as Scala is becoming a safe and productive and widely used tool there are developers moving to more Haskell like pastures within Scala. Perhaps because that kind of programming is required for some specific problems. But quite likely as well because they hope that it will make them stand out as smarter programmers.
Some people may remember the so called "Peters principle". Informally it states that people get promoted until they've reached their level of incompetence.
Similarly some smart developers tend to increase the complexity of their code to keep themselves amused until they're struggling to understand it themselves. Joosts principle. :-)
Edit: the link to the talk https://www.infoq.com/presentations/functional-pros-cons
https://github.com/akka/akka-meta/blob/master/ComparisonWith...
They do go into that in the research paper [1].
"Actor platforms such as Erlang [3] and Akka [2] are a step forward in simplifying distributed system programming. However, they still burden developers with many distributed system complexities because of the relatively low level of provided abstractions and system services. The key challenges are the need to manage the lifecycle of actors in the application code and deal with inherent distributed races, the responsibility to handl e failures and recovery of actors , the placement of actors, and thus distributed resource management. To build a correct solution to such problems in the application, the developer must be a distributed systems expert. To avoid these complexities, we built the Orleans programming model and runtime, which raises the level of the actor abstraction."
It's an interesting question how hard it would be to offer such a often-good-enough option in Akka for the cases when you don't have the need or the time or the team to develop a custom distributed computing model.
Edit: maybe Lagom is meant to fit that space. I think it's wider in scope than 'easy actors' though.
https://github.com/joost-de-vries/typescript-ramda/blob/mast...
Does something like that exist?
If not maybe I should try Kleislis instead. But I'd like my code to be accessible for my colleagues. And it's my rule of thumb that I try not to use point free constructions (like Kleislis) because a lot of colleagues will no longer understand my code easily.
We can only speculate what's going on at Oracle. Some options come to mind: 1) the JCP is moving too slowly to keep up with the changing IT landscape 2) Oracle no longer sees benefit in standard APIs with competing implementations and interoperability. Maybe it's eyeing enviously Salesforces cloud lockin...
Since I develop in Scala both are very intuïtive to write.
Apparently Linq for F# is really good as well. As someone else mentioned in a comment.
I get a programming interface that doesn't attempt to hide sql and still my code is fully typed. And it's really easy to make your query logic modular: make the sql fragment a function that you can call. Like any other code you reuse.
I can't think of an advantage of ORM over this functional approach. Apart from ORM being more well known.