Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: scala vs perl (5 and 6)

by Grimy (Pilgrim)
on Jun 02, 2013 at 15:08 UTC ( #1036591=note: print w/replies, xml ) Need Help??

in reply to scala vs perl (5 and 6)


I'm a huge fan of both Perl5 and Scala. They are both strong language that fill different niches. In my opinion—and I know many won't agree—, when building complex class hierarchies, static typing is a must have. Thus I only use Perl for simple tasks: command-line one-shots, file manipulation, an audio player… and keep Scala for more complex things.

Scala is basically Java on steroids.
  • Since both compile to the same .class, they are entirely interoperable (Java code calling Scala functions sometimes requires boilerplate, but the other way round is trivial). This is a huge advantage, considering the vast amount of Java library available.
  • Scala's syntax is great and flexible. You can define your own operators; define objects that can be called as functions (this is a common pattern in Scala, even array accesses are written array(index)); use OO, functional, procedural or mix everything… Yup, in Scala too, TMTOWTDI.
  • There is no performance hit for using Scala rather than Java. On the contrary, using functional idioms is usually faster in Scala, because they are specifically optimized (e.g. tail recursion).
  • The only thing I don't like about Scala are the compilation times. It's getting better, but they where really silly (about 10s for 1000 lines on my machine).
I hope this was helpful (:

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036591]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-05-23 19:23 GMT
Find Nodes?
    Voting Booth?