Dissimilar Scala book in near future [closed] - scala

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.

Related

Concurrency model: Erlang, Elixir, and Scala [closed]

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)

Learning Scala as first 'functional' language? [closed]

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
Since Scala is a 'OO meets functional' language, is it a good idea for me to learn Scala as my first functional language as I know most OO concepts (from learning Java)?
Or would it be better if I learned a pure functional language such as Haskell, then mixed my knowledge of OO and functional programming together so I better understand Scala?
As functional programming is greatly different to what I'm used to, I want to make sure I learn the concepts in a way that I can transfer then between functional language to functional language and not get caught up on OO and functional concepts that only relate to Scala.
I'd recommend a language that exposes its FP traits more explicitly than Scala. You can still write OO code in Scala without dipping into FP at all.
If you want academic purity, go learn Haskell. The language now has a rich ecosystem and is gaining traction, and is definitely production ready, so you don't have to be afraid that what you learn will be lost. http://learnyouahaskell.com is a great starting point that is available for free on the web.
At some point in time you may want to learn a Lisp dialect. There's a whole plethora of them available today, with varying degrees of success, but you have probably heard of Clojure, which runs on top of JVM.
I am not aware of any good free resources, but I can recommend https://pragprog.com/book/shcloj2/programming-clojure. The book is a little bit old - it covers version 1.3 and we're currently approaching 1.7 - but is still relevant, and goes straight to the point. Once you've gone through that you're ready for something meatier, like Fogus' 'The Joy of Clojure'.
There is also a great site full of short programming problems in Clojure, which I recommend that you check out - google for '4Clojure'.
Scala is a pretty good first functional programming language. I personally didn't understand Haskell until after learning Scala. Learning Scala means the only new part is the functional programming part. You don't have to worry about a drastically different syntax or type system, and you don't have to learn about monads just to do simple IO. To make sure what you're learning is transferrable, don't use any vars, just vals.
At a certain point Scala's type system becomes unwieldy, as you dive into the abyss of implicits, covariance, and contravariance to try to use concepts such as monads. At that point, you will have enough background in functional programming to switch to Haskell and actually understand it. Haskell's type system is much better suited for such topics.
In other words, Scala makes beginner functional programming concepts easy, but advanced concepts harder, which makes it a very good gateway language.

What are the benefits of learning Lisp (or a dialect) if you have a good grasp of functional programming [closed]

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
Basically, what I'm asking is, when people say that learning Lisp will enlighten you, are they just talking about learning functional programming in general or is there some deeper benefit?
Personally, and I'm sure most people feel like this, I'm quite scared by the syntax. I feel like it gets in the way and I don't see the benefit in having all expressions look the same. Never had a problem interpreting expressions in a language...
However, Haskell was a beast as well, but after learning it I can confirm that I approach problems differently and that it was a worthwhile experience.
So, the question is. Is it worth it? What does Lisp offer that NO other languages offer? I know people are eager to promote the language they use, but if there are other languages that took the good parts of Lisp and incorporated them in a more manageable form, then I don't see a reason to learn Lisp specifically.
Lisp is the programmable programming language
Lisp offers something no other language does - "code is data".
This means that the code you write is a list which can be processed by Lisp.
This leads to a powerful macro facility, which means that you have the full power of Lisp itself at macroexpansion time.
Far more from merely adding new syntactic constructs like with-something, one can define a whole DSL in a few forms.
More information:
Examples of what Lisp's macros can be used for
Lisp Macro
Macros: Defining Your Own
http://weitz.de/macros.lisp

Using Scala in the real world [closed]

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.

Getting started with Prolog [closed]

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.