I certainly have my point of view, but i would like to hear from you.
If you are a scala user with a couple minutes to spare, please tell me
what caused you most joy and/or trouble.
Thanks in advance,
Julio
> Fewer bugs due to less boilerplate and cleaner code.
... expect this really to be the case, although I haven't given Scala
that much of real-world use yet. And,
> Overall, I think Scala is great if you are not writing performance critical code,
have the same impression so far. I need to state though that it is
only a few months since I've started learning Scala.
HTH,
--Hossein
--------------------------------------------------------------------------------------------------------------
Seyed H. HAERI (Hossein)
Research Assistant
Institute for Software Systems (STS)
Technical University of Hamburg (TUHH)
Hamburg, Germany
ACCU - Professionalism in programming - http://www.accu.org/
--------------------------------------------------------------------------------------------------------------
Here is a quick summary of my experiences with Scala.
Pros:
Increased productivity, subjective factor of 2.
Fewer bugs due to less boilerplate and cleaner code.
The language flexibility allows to design APIs that are simply not possible in Java.
Ability to create compiler plugins to optimize existing libraries (I think this is an incredible feature).
Cons:
Unstable toolchain and IDEs.
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
The IDEA plugin for Scala is already pretty good (better than any IDE
available in the 20th century) and continuously improving. (IMO)
>> Requires decompiling the bytecode to learn how to write
>> performance-sensitive code (not an issue once learned).
>
> Indeed. Writing high-performance Scala is very doable, but it takes rather
> a while to learn how to do it by design rather than by getting it working
> and then profiling (which is much more labor-intensive than doing it right
> the first time). (That said, that you can write high-performance code at
> _all_ is almost unique among languages with Scala's expressiveness.)
This indicates shortcomings in the Scala optimizations. It shouldn't
be necessary to do this.
> Also: although simple uses of the collections library give you amazing
> power, mastering it is a lot of work, and doing anything sophisticated with
> it even when you are a master requires considerable effort.
>
> And there are still spots in the library which are not documented well
> (scala.util.continuations)
Spots in the library? More like one big spot that covers pretty much
the entire library. ScalaDoc for collections is particularly
egregious.
Donald
Spots in the library? More like one big spot that covers pretty much
the entire library. ScalaDoc for collections is particularly
egregious.
Contains the base traits and objects needed to use and extend Scala's collection library.
A detailed guide for the collections library is available at http://www.scala-lang.org/docu/files/collections-api.
Selects all elements except first n ones.
What do you think is missing? (Now, not historically?)
--Rex
And yes, examples is one of the things that is missing. Doing a
foreach on a map is completely non-trivial, the ScalaDoc is completely
useless and the "detailed guide" is completely mute on the subject.
IMO
Donald
Cons:
Unstable toolchain and IDEs.
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
:) having said that, working with scala collections is just phantastic, the design is just great. i think this is one of the keystones.
best, -sciss-
On Thu, Dec 1, 2011 at 8:28 AM, Aleksey Nikiforov <lex...@gmail.com> wrote:Cons:
Unstable toolchain and IDEs.
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).The biggest con for me is the lack of descriptive names in the collections library. Every single time I have to look up the docs to find out how e.g. to add to a particular collection. Sometimes it's +, other times :+, and then there's ++ vs ++:, etc. I can haz descriptive names?
I would love this to be available,
it's in my short list of high value / low effort improvements that
would make a difference
in my daily life.
I second this, less the lolcats.
Geir
Just to clarify, i will collect opinions from several sources, this
list being the most valuable, then check *all* the facts and write.
Is anyone using scala for .NET who could also share the experience?
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
Indeed. Writing high-performance Scala is very doable, but it takes rather a while to learn how to do it by design rather than by getting it working and then profiling (which is much more labor-intensive than doing it right the first time). (That said, that you can write high-performance code at _all_ is almost unique among languages with Scala's expressiveness.)
This could be a post itself and am happy to move this to its own question.marc
On Thu, Dec 1, 2011 at 6:58 PM, marc <mill...@gmail.com> wrote:
On Thursday, December 1, 2011 6:55:56 AM UTC-8, Rex Kerr wrote:
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
Indeed. Writing high-performance Scala is very doable, but it takes rather a while to learn how to do it by design rather than by getting it working and then profiling (which is much more labor-intensive than doing it right the first time). (That said, that you can write high-performance code at _all_ is almost unique among languages with Scala's expressiveness.)
Do you know of any references for tricks and techniques to get the most of your scala code? I am using scala in HPCand could use a new bag a tricks for performance-critical areas. So far, I have made great bounds by macro-optimizations(algorithm improvement and parallelization), but am now getting into the situation where I have to go micro.
We have tons of experience on this topic, I just wished I had time to do more blogging :(
what i use scala for:
+ when performance doesn't matter. under this condition, i can use all
the features scala offers without worries. i just love spamming closures
all over the place, chain collection calls and express anything as a
series of filters and transformations. under these conditions, i'm
*much* faster than in java despite java having superior ide support
(intellij idea).
i am not saying scala itself it slow - i'm saying that for high
performance code, you need to sacrifice the features i like the most. in
extreme cases, you're pretty much back to low level programming (as in
any language).
+ to create DSLs
On Thu, Dec 1, 2011 at 6:58 PM, marc <mill...@gmail.com> wrote:
On Thursday, December 1, 2011 6:55:56 AM UTC-8, Rex Kerr wrote:
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
Indeed. Writing high-performance Scala is very doable, but it takes rather a while to learn how to do it by design rather than by getting it working and then profiling (which is much more labor-intensive than doing it right the first time). (That said, that you can write high-performance code at _all_ is almost unique among languages with Scala's expressiveness.)
Do you know of any references for tricks and techniques to get the most of your scala code? I am using scala in HPCand could use a new bag a tricks for performance-critical areas. So far, I have made great bounds by macro-optimizations(algorithm improvement and parallelization), but am now getting into the situation where I have to go micro.
We have tons of experience on this topic, I just wished I had time to do more blogging :(
i find -, +, ++ very intuitive, but since the 3.5 years i use scala, my brain was unable to capture whether +: is append and :+ is prepend, or the other way round. i am shocked that i need to look that up virtually everytime i use it, or i just put it with 50:50 chance and wait for the compiler to complain so that i switch +: and :+. i hope nothing is damaged in one of my hemispheres.
:) having said that, working with scala collections is just phantastic, the design is just great. i think this is one of the keystones.
That still does not tell us where the element goes (first or last); just that the collection argument itself goes to the right or left of the element.
Wow! That should go into the scaladocs
--
Brian Schlining
[1]: https://www.assembla.com/spaces/scala-msbuild/new_dashboard
[2]: SI-5095, SI-5094, SI-4966
[3]: http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx
On Dec 1, 4:55 pm, HamsterofDeath <h-s...@gmx.de> wrote:
> Am 01.12.2011 10:10, schrieb Julio Faerman:> Everything i read about Scala nowadays is full of either passion or
> > hate. I would like to publish a balanced and updated assessment of the
> > language pros and cons, and for that i would appreciate your help.
>
> > I certainly have my point of view, but i would like to hear from you.
> > If you are a scala user with a couple minutes to spare, please tell me
> > what caused you most joy and/or trouble.
>
> > Thanks in advance,
>
> > Julio
>
> i don't really like "pros vs cons" lists. if you think of scala as a
> tool like a hammer, you'd think it would be absurd to make a pros/cons
> list to be able to compare it to a car and in the end decide "cars are
> worse/better than hammers", wouldn't you?
I was thinking about this too.
I do not intend to write yet another pros and cons list, but a
realistic and up to date assessment of the language "appliability"
without the noise of enthusiasm or failure.
+1
I'm waiting for this to have a quick bubble help in eclipse if I stumble over
a "what is this again?" operator. It would be a HUGE win in my eyes.
Just my 2 cents
Bernd
I actually think it's a strength of scala to be able to feature both. The
higly productive chain-them-all approach with the collection library with is
absolutely awesome. It's simply cool to see even some involved processing fall
apart into some map filter flatMap zip grouped andwhatnot chains which simply
work in the end - without all the fuss.
On the other hand if performance is the first concern one can always resort to
javaish style and walk on par with java performance.
The ability to do this within one language is amazing.
Greetings
Bernd
Am 01.12.2011 20:09, schrieb Alex Cruise:
> My mnemonic is basically "COLon goes on the COLlection side" --
codelicious!
- --
Tsch���--->...Stefan
- ---------------------------
Don't visit my homepage at:
http://home.arcor-online.net/hirnstrom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk7YGhgACgkQQeATqGpDnRplEACginYA2wxzmIekC2VyVFOeWzFi
UzIAn0UaFFvK9RAH9iP103qJC/vcnnWm
=ljmV
-----END PGP SIGNATURE-----
On Thu, Dec 1, 2011 at 8:55 AM, Sciss <con...@sciss.de> wrote:i find -, +, ++ very intuitive, but since the 3.5 years i use scala, my brain was unable to capture whether +: is append and :+ is prepend, or the other way round. i am shocked that i need to look that up virtually everytime i use it, or i just put it with 50:50 chance and wait for the compiler to complain so that i switch +: and :+. i hope nothing is damaged in one of my hemispheres.
My mnemonic is basically "COLon goes on the COLlection side" -- I remember the colon-suffix-right-associative rule because it's bugged me since day 2--not that I have any well-thought-out alternative proposal.
It's a good one indeed. I'm opening a pull request for that.
--
Daniel C. Sobral
I travel to the future all the time.
I also have way more experience than I ever hoped to have, and also am starved for time. Hopefully a few of us overly busy yet performance-minded folk can get together and write up some tips.
Ideally, one would like to cover profiling, benchmarking, low-level design patterns, how to help the JVM, patterns for high-performance threading, when to switch from high- to low-level patterns, and selection of algorithms based on use case.
But that's a lot of work. I don't even have time to do half of one of those, let alone all of them, and you really need to know all of them to routinely produce high-performance code.
--Rex
This is almost exactly my experience also. I'll go into a bit more depth:On Thu, Dec 1, 2011 at 9:28 AM, Aleksey Nikiforov <lex...@gmail.com> wrote:
Here is a quick summary of my experiences with Scala.
Pros:
Increased productivity, subjective factor of 2.
Ranges from 0.8 to about 10 for me; I try to avoid writing too much code in which I am less productive than Java. For quick scripting tasks, it is often in the 5-10x range. There are many, many reasons for the increased productivity, ranging from functional libraries to trivially easy nested method declarations that make it simple to reduce boilerplate to powerful matching capability to low-effort exception handling and so on.
Fewer bugs due to less boilerplate and cleaner code.
Indeed, and due to using features (e.g. Option) that make it much easier to handle corner cases, once you have mastered how they work.
The language flexibility allows to design APIs that are simply not possible in Java.
Indeed. Especially being able to use operators for mathematics. In Scala, if I have a vector operation, I write it down. In Java, I write down the vector operation in a comment, and then produce an unreadable mess that implements it.
Ability to create compiler plugins to optimize existing libraries (I think this is an incredible feature).
I haven't personally used this.
I also find the REPL a huge advantage--both that it exists, and that the language features are such that it makes sense to have a REPL. One could create a Java REPL, but it would be awkward to use.
And of course I appreciate that it runs on the JVM, because that means I can deploy it "anywhere" (major platforms).
Cons:
Unstable toolchain and IDEs.
Agreed, though I find the toolchain and IDEs much more dispensable than with Java. However, I would not consider this problem solved until there is not just one build tool and IDE that is stable and delivers useful features, but a decent selection. For example, I should be able to use make, ant, maven, or SBT, without having to worry that I will spend endless time getting the tooling right.
Requires decompiling the bytecode to learn how to write performance-sensitive code (not an issue once learned).
Indeed. Writing high-performance Scala is very doable, but it takes rather a while to learn how to do it by design rather than by getting it working and then profiling (which is much more labor-intensive than doing it right the first time). (That said, that you can write high-performance code at _all_ is almost unique among languages with Scala's expressiveness.)
On 2 dec, 03:16, Nils Kilden-Pedersen <nil...@gmail.com> wrote:
> On Thu, Dec 1, 2011 at 1:09 PM, Alex Cruise <a...@cluonflux.com> wrote:
It is immensely useful for doing functional programming in Scala while
maintaining reasonable performance.
--
Tony Morris
http://tmorris.net/
As I understand it, this is not about performance but correction.
I think trampolining is slower than a standard call.
But it allows not to overflow the stack.
Best,
Nicolas.
Please be sure to include Runar's trampolining in such a guide.
http://apocalisp.wordpress.com/2011/10/26/tail-call-elimination-in-scala-monads/
It is immensely useful for doing functional programming in Scala while
maintaining reasonable performance.
The biggest con for me is the lack of descriptive names in the collections library. Every single time I have to look up the docs to find out how e.g. to add to a particular collection. Sometimes it's +, other times :+, and then there's ++ vs ++:, etc. I can haz descriptive names?