Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What is the difference between the concurrency models of Erlang, Elixir, and Scala?
This is way too hard to answer from a point of zero prior knowledge. I think the most valuable way to even approach it (because this sort of thing gets asked all the time in a most unhelpful sort of way) is to include some links to reference information about these -- and then close the question.
(If this is such a bad idea in the minds of other SO users that you think we should delete this entirely I'll create a resource page external to SO to use as a future reference-to-references.)
Erlang Process vs Java Thread
Is Scala's actors similar to Go's coroutines?
Future investment: Erlang vs. Scala
Seven Concurrency Models in Seven Weeks
Qt Concurrent (Qt documentation that explains a bit about how the underlying madness of shared memory concurrency is tamed somewhat within that framework)
An Introduction to Asynchronous Programming and Twisted
Parallelism and Concurrency (Haskell Wiki)
Why Events are a Bad Idea (USENIX paper -- good foundational information)
Wikipedia article on Concurrency
Why Microservices? (conceptually relevant, particularly since Erlang and other "actor systems" usually fit the conceptual definition of being swarms of microservices, whether distributed or not)
Concurrency: Time is of the Essence (SICP -- FYI: This entire text is probably one of the most important things you can read as a programmer)
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 months ago.
Improve this question
Reactive programming is a very useful way to increase the capacity of webservices because of non-blocking thread. I recently came to know about this programming paradigm and I want to use it for most of the applications I build. Despite being so efficient, I still see new applications being built in a blocking way. What are the reasons that reactive programming is not used everywhere as it's a nice paradigm and very efficient in handling users at scale?
I don't know if this question is too generic or suited for the platform. I tried searching on the internet and could not find any staisfactory information. Therefore, I am asking it here hoping foor someone experienced to help me with it. I am trying to learn Project Reactor for Reactive Spring.
Reactive, e.g, WebFlux, is to solve a specific problem that most websites won't experience. Regular servlet or dispatcher-based frameworks put each request on its own thread, which is generally fine. Soon Java will come with lightweight threads which is claimed to perform better than reactive anyway. Reactive is also based on function programming paradigm, which is a complicated and difficult way to write applications.
Reactive is meant to handle multiple requests on a single thread by using callbacks from I/O operations. If done correctly websites can handle more requests for the same number of threads than non-reactive. This would reduce resource costs and perhaps allow a service to be more responsive since starting regular threads is expensive.
In my experience, in practice, Reactor is not generally done correctly, has far more bugs due to the complexity of function programming, and takes much longer to deliver the code.
In my opinion, it can still be useful framework for simple services that are primarily I/O bound and have very little if any business logic. That is until lightweight threads become standard in the JDK and then maybe you have chosen the wrong path.
Also in my opinion, developers find it fun and exciting due to the functional programming paradigm, as do I. It's not a bad thing to use but shy away from it for important business related code/services.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am sorry if this is not a constructive enough question.. Coming from the SQL world I'm just trying to wrap my head around this. After reading a lot about MongoDB, I've become very enthusiastic about it and consider using it for an upcoming application (in combination with Meteor).
However, I came across this blog post, which describes the troubles Diaspora ran into when using it and states "you should never use MongoDB". The examples she's giving sound pretty convincing.
Are these true problems with MongoDB, or were they using it wrong? Is this article now outdated and are there better ways for doing what they're doing (duplicate data for instance, like users being linked to each other, to posts and to comments, is a very common use case)?
Yes, there is a plenty of cases when mongodb not feet good, some of them are
When data perfectly described with 'table' metaphor (better using
SQL)
When you need ACID and transactions out of the box
When your workflow extremely oriented to write operation
When you need to generate complex cross-data reports
Data model have strongly relational view (a lot of connected
instances)
There is a lot of others, but this is just something which comes to my head fast.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Question Context: Where there is an exiting Java application or a new project development that is to be written in mostly Java.
We know that we can use Scala from Java and vice versa.
What specific system features are more suited for functional programming. I mean I wouldn't use Scala just because it has a nice feature of executing a passed-in function implementation over the items of a collection nor would I use Scala just for its object orientation capabilities I would just use Java for that.
So going beyond the nice and interesting features of Scala what set of system features make a compelling case to use Scala on a Java project?
where to start, and where to end?
pattern matching
case classes
functions (and higher order ones)
great collections
more object oriented than java, avoid common anti-patterns
type inference -> much less noise
many great options in concurrency. Futures in Java are just so useless compared to Scala ones
traits for composing services
Testing with ScalaTest+ScalaCheck is much much better than JUnit/TestNG/
Akka !
The list is just too long.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
i'm rephrasing my question as it is deemed too opinion based. I will try to be more specific this time.
I wish to learn programming languages to expand my way of thinking and expressing problems:
Here are some background. My purposes for learning specific languages.
Scala as an OO-Functional hybrid for reactive programming
Clojure as a Lisp dialect for experiencing the power of macros
Note that Scala being statically typed and Clojure being dynamic is a bonus for me as i get to learn their pros and cons at the same time
What are the things to pay attention to in the process of learning Prolog that would help me think better?
So far, my research suggests that one of the most powerful feature of Prolog is its ease of implementing "Backtracking".
previous Version:
I figured I should learn prolog to add to my arsenal of programming.
But what is the essence of prolog? As in, what are the main features
and what should I expect to take away from the experience?
It would be nice to compare to Scala and Clojure as they're my
language of choice at the moment. I'm learning Scala mainly for actor
model/reactive programming, and the OO and functional approaches seem
really powerful to me. I took up Clojure because I wanted to pick up a
Lisp dialect to experience the power of macros, and so far, Clojure
had the most momentum. So what extras would Prolog give me?
Can I get those benefits/experience/features in Erlang since it's
syntax is derived from Prolog?
Thanks for looking at my question. Hope to hear all those wonderful
answers.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've seen quite a few books about Scala, but those are so similar to each other. Wonder what titles (related to Scala) would you like to see that would differ from "main stream"?
At this point, all Scala books are about teaching Scala. That's natural, as most readers won't be familiar with Scala.
As time passes, we'll likely need books with Scala Patterns (which can be very different from Java patterns) and anti-Patterns, coding tips, advanced algorithms, or topic-specific, like concurrency or strategic programming.
The Lift book kind of fits in the category of topic-specific, but it is really much more about the Lift library and Lift usage than about general Scala usage for web programming.
Another topic-specific book on the way is "actors in scala" - which was mentioned at the Scala BASE meetup - currently being authored (or co-authored at least) by Martin Odersky.
The actors framework offers a substantially new concurrency model (pioneered in Erlang) that aims to make writing concurrent code easier than traditional shared state concurrency, as well as offering better scalability for multi-core architectures.
One important thing we don't yet have is an entry-level book, suitable for Scala as a first language, rather than as a next step after Java, assuming some familiarity with the JVM APIs and the syntax of Java.
At the moment there is not a text on the language that I could really recommend to a bright youngster (late teens) who wants to start programming with something better than the Hobson's choice of Pascal available in the IT classes at school -- not that any of the other (quasi-)functional languages are in much better state.