InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Scala: combining the best of Ruby and Java?

Posted by Floyd Marinescu on Jun 09, 2006

Sections
Development,
Architecture & Design
Topics
Programming ,
Java ,
Ruby ,
Scripting
Tags
Scala ,
Functional Programming
While the Ruby vs. Java / dynamic vs. static debate continues, a small community has been forming around the Scala programming language, which has has some of the best features of both languages but is also a functional programming language and runs on the JVM.  Like Ruby, Scala has a very terse syntax and its extensibility makes it suitable for writing DSLs, like Java, Scala is statically typed and can call Java code seamlessly without any declarations or glue code.  An older version of Scala also compiles to .NET.   Scala founder Martin Odersky (who co-designed Java Generics and implemented javac) has started blog on Artima today with his first entry on the history which led up to Scala:
Scala was designed to be both object-oriented and functional. It is a pure object-oriented language in the sense that every value is an object. Objects are defined by classes, which can be composed using mixin composition. Scala is also a functional language in the sense that every function is a value. Functions can be nested, and they can operate on data using pattern matching.
Earlier this year, Ted Neward also picked up on the "Ruby-esque" features of Scala and made three detailed blog entries introducing Scala, demonstrating it's brevity, and explaining it's object oriented design.

Key features, from the Scala homepage:
According to Martin, Scala has a small but growing community. "We currently see about 1000 downloads per month of the Scala distribution on our website."  Scala 2.1.2 was released this past April.
Scala is cool by Jason Carreira Posted
Hmm without all the "end"s it looks like Python to me by Todd G Posted
Re: Entity escape issue in comment subject lines by Todd G Posted
JVM bytecodes by Binil Thomas Posted
Re: [OT] Haskell - by Dan Diephouse Posted
Re: [OT] Haskell -> JVM bytecodes by James Shipley Posted
And so on..... by ivan orero Posted
Re: And so on..... by Roger Pack Posted
  1. Back to top

    Scala is cool

    by Jason Carreira

    I started picking up Scala earlier this year around when Ted did, and it's definitely cool... I haven't had as much time as I'd like to dig in, and I got sidetracked on other functional programming topics like Monads, but I'm trying to make time to play with it some more.

    The functional stuff is definitely nice as it allows for some very concise code to do powerful things. I'm still finding it a bit tough to read compared to Java, though. Partly it's because I'm so used to Java, but partly it's because Scala is just more powerful and somewhat more complex.

  2. Back to top

    Hmm without all the "end"s it looks like Python to me

    by Todd G

    Okay I'm trolling a bit but I couldn't help myself. For my eyes the "end" keywords everywhere in Ruby visually distinguish it from Python at a quick glance. Otherwise they're so similar it's hard to tell at a [very] quick glance. But I sense Ruby-colored glasses around these parts ;-)

  3. Back to top

    Re: Entity escape issue in comment subject lines

    by Todd G

    See subject!

  4. Back to top

    JVM bytecodes

    by Binil Thomas

    While, we are on FP, does anyone know of a Haskell compiler that can generate JVM bytecodes?

  5. Back to top

    Re: [OT] Haskell -

    by Dan Diephouse

    Its not haskell per se, but I did see this: jaskell.codehaus.org/

  6. Back to top

    Re: [OT] Haskell -> JVM bytecodes

    by James Shipley

  7. Back to top

    And so on.....

    by ivan orero

    Ruby is slow. Scala It is slow compared to Java and Java is slow compared to C and C is slow compared to well written assembly language....

  8. Back to top

    Re: And so on.....

    by Roger Pack

    looks to me like scala isn't slow compared to java. shootout.alioth.debian.org/u32/scala.php

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.