Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.

Replies are listed 'Best First'.
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.

    Enoch was right!
    Enjoy the last years of Rome.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036571]
[Corion]: (and the SQL files to create the database and to run the query :) )
[Corion]: So, the application I'm writing this for is more a nice use case of these command line tools and less an application in its own right, except that I get use out of it :)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-02-23 19:46 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.