Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
P is for Practical
 
PerlMonks  

Re: scala vs perl (5 and 6)

by moritz (Cardinal)
on Jun 02, 2013 at 10:16 UTC ( #1036571=note: print w/ replies, xml ) Need Help??


in reply to scala vs perl (5 and 6)

I haven't written any Scala code myself, so the following is only hearsay.

Scala is supposed to be a rather nice language, and its features often appeal to Perl programmers. The downsides are usually cited as the following:

  • High startup time due to JVM usage
  • While nice functional features like iterators, map etc. are available, they often make code slower
  • Heavy reliance on Java libraries

The last point needs a bit explaining. On the one hand it's nice to have access to the rich of java libraries. On the other hand, those libraries are designed for java, and the limitations that java has. For example Java doesn't you allow to pass callback functions (because it has no functions, and no references to methods), so whenever you need to pass a callback to a library, you have to implement an interface instead with a method that the library calls for you, which is much more boilerplate. Likewise container libraries written in Java are limited by Java's type erasure.

That said, I would like to encourage you to simply try it out, and see if you like it. Programming languages very much cater to personal preferences, and while some are nearly universally hated (or do you know somebody who does COBOL for fun?), most have their loyal followers who are very productive with their language of choice.

Knowing other programming languages typically also makes you a better Perl programmer.


Comment on Re: scala vs perl (5 and 6)
Re^2: scala vs perl (5 and 6)
by Jenda (Abbot) on Jun 02, 2013 at 15:37 UTC

    For an example (albeit on a much smaller scale) of this problem look at C# and the .Net framework. While the language supports generic types and lambdas for quite some time, there's still a helluvalot of APIs designed for the older versions. Whole frameworks with tens of custom collections each one slightly different and neither supporting type inference in enumeration and LINQ, APIs forcing you do implement over-complicated interfaces and wrapper classes where a simple lambda would do, APIs designed so that they in effect turn the whole type system off, because before the introduction of generics there was no other way, ...

    Some of those APIs are deprecated, some of them should be (eg. the whole of ASP.Net Web Forms and the insane mess that's LLBLBLBLBBLLBLLGen), some are still being used, all are painful.

    In either case if you feel like trying Scala, do.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-04-19 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls