×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Scala, a Statically Typed, Functional, O-O Language

kdawson posted more than 4 years ago | from the means-scaleable dept.

Programming 299

inkslinger77 notes a Computerworld interview with Martin Odersky on the Scala language, which is getting a lot of attention from its use on high-profile sites such as Twitter and LinkedIn. The strongly typed language is intended to be a usable melding of functional and object-oriented programming techniques. "My co-workers and I spend a lot of time writing code so we wanted to have something that was a joy to program in. That was a very definite goal. We wanted to remove as many of the incantations of traditional high-protocol languages as possible and give Scala great expressiveness so that developers can model things in the ways they want to. ... You can express Scala programs in several ways. You can make them look very much like Java programs which is nice for programmers who start out coming from Java. ... But you can also express Scala programs in a purely functional way and those programs can end up looking quite different from typical Java programs. Often they are much more concise. ... Twitter has been able to sustain phenomenal growth, and it seems with more stability than what they had before the switch, so I think that's a good testament to Scala. ... [W]e are looking at new ways to program multicore processors and other parallel systems. We already have a head start here because Scala has a popular actor system which gives you a high-level way to express concurrency. ... The interesting thing is that actors in Scala are not a language feature, they have been done purely as a Scala library. So they are a good witness to Scala's flexibility..."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

299 comments

Functional? (0)

Anonymous Coward | more than 4 years ago | (#29108709)

More like FUN-ctional!

pronounced ... (2)

neonprimetime (528653) | more than 4 years ago | (#29108765)

... skah-lah not scale-la

Re:pronounced ... (5, Funny)

Profane MuthaFucka (574406) | more than 4 years ago | (#29108929)

Same difference. You say potato, I say you're an asshole.

Re:pronounced ... (0, Offtopic)

maxume (22995) | more than 4 years ago | (#29109883)

Do assholes have eyes?

DO THEY?

Re:pronounced ... (-1, Offtopic)

Anonymous Coward | more than 4 years ago | (#29110225)

Do assholes have eyes?

DO THEY?

The neurological physical exam finding that demonstrates intact innervation of the anal sphincter is the so-called 'anal wink' reflex.

I'll leave it to some asshole on here to post whatever it is that non-physicians look for down there.

Re:pronounced ... (0)

Anonymous Coward | more than 4 years ago | (#29109047)

For the uninitiated, it's a Bones reference.

Re:pronounced ... (0)

Anonymous Coward | more than 4 years ago | (#29110733)

Skah-lah back y'all!

Wanted: Scala Expert (5, Funny)

sycodon (149926) | more than 4 years ago | (#29108825)

Scala Programmers: $35K - $45K

Our company is looking for motivated individuals with 5 + years in depth experience with Scala.
Must be familiar with all aspects of O-O Languages.

We are an equal opportunity employer.

Re:Wanted: Scala Expert (-1)

Anonymous Coward | more than 4 years ago | (#29108885)

Seeing as Scala has only been around since 2003, are you looking to employ Martin Odersky for $45k?

Re:Wanted: Scala Expert (0)

Anonymous Coward | more than 4 years ago | (#29108917)

*sigh*

Re:Wanted: Scala Expert (0)

Anonymous Coward | more than 4 years ago | (#29108959)

WHO-OSH!

Re:Wanted: Scala Expert (1, Funny)

Anonymous Coward | more than 4 years ago | (#29109153)

I'm getting a kick out of all the ACs whooshing eachother.

Re:Wanted: Scala Expert (0)

Anonymous Coward | more than 4 years ago | (#29109127)

I've seen worse. I saw a job post early this year looking for someone with 5 years of experience with .NET 3.5 and LINQ to SQL.

I have also seen one looking for a web designer with 2 years experience, offering 8 dollars an hour.

Re:Wanted: Scala Expert (1)

JAlexoi (1085785) | more than 4 years ago | (#29110119)

Why only 5? Why not 7? We seem to love that number. Even Win7, sounds better with 7 in it :)

Reinventing the wheel is sometimes good (-1)

BadAnalogyGuy (945258) | more than 4 years ago | (#29108827)

If you can create a better wheel, sometimes it makes sense to reinvent the wheel.

But if all you're doing is reinventing Perl with C-like syntax, it's not really a step forward.

A Perl Server Pages technology that was scalable and didn't require the interpreter to load on every access would make Scala obsolete in a New York minute.

Re:Reinventing the wheel is sometimes good (2, Informative)

Fnord (1756) | more than 4 years ago | (#29109071)

You mean like Mason [masonhq.com] ? Possibly you're looking for something more like Catalyst [catalystframework.org] ?

These things have been available for Perl for a long time.

Re:Reinventing the wheel is sometimes good (2, Insightful)

Coryoth (254751) | more than 4 years ago | (#29109221)

But if all you're doing is reinventing Perl with C-like syntax, it's not really a step forward.

Perl already has C-like syntax. It doesn't, however, have static type checking, let alone robust static type checking (with nice features like variance annotation etc.); nor does it have particularly robust functional programming support -- you can certainly do functional programming in Perl, but it isn't as clean and syntactically sugared as it could be; nor does perl have particularly clean OO if we're being honest -- yes it works and can be made to work quite well, but elegant isn't a word that comes to mind when I think Perl and OO; nor does Perl have function pattern matching and algebraic data types; nor does Perl have a nice concurrent programming interface based on the Actor model. None of this is really to say that Perl is bad -- it is very good for a great many things, and the features I've mentioned needn't hold it back. My point is that Scala is most certainly not re-inventing Perl. In fact Scala doesn't even have a particularly C-like syntax: it's less C-like than Perl really.

Re:Reinventing the wheel is sometimes good (2, Informative)

SL Baur (19540) | more than 4 years ago | (#29109729)

My point is that Scala is most certainly not re-inventing Perl.

True, it also doesn't appear to be a reimplementation of anything. It's somewhat related to Java (Scala programs execute with the JVM).

The code snippets on the website http://www.scala-lang.org/ [scala-lang.org] are intriguing. It's certainly a terse language. That's both good and bad.

Re:Reinventing the wheel is sometimes good (4, Funny)

moon3 (1530265) | more than 4 years ago | (#29110059)

already has C-like syntax

Why not use the C instead then, or even better C++. After all many top websites run C++ (Google,eBay,Yahoo) as it is the fastest, well memory utilizing, best threading performance and green/CPU saving solution. With the native processor exceptions used properly it is also the most robust solution.

Eh sonny? (1, Offtopic)

fuzzyfuzzyfungus (1223518) | more than 4 years ago | (#29108861)

"Twitter has been able to sustain phenomenal growth"

This is my friend FailWhale. You are making FailWhale sad. You wouldn't like FailWhale when he is sad...

Re:Eh sonny? (4, Insightful)

iluvcapra (782887) | more than 4 years ago | (#29109101)

To be fair, FailWhale has not been seen by me of late, and the Twitter devs attribute their salvation to Scala. However, there are some pretty good arguments that the Twitter developers Mother of All Fail was initially trying to write their own hand-rolled message queue [unlimitednovelty.com] instead of simply using one off-the-shelf.

Bit more on the twitter culture. (4, Interesting)

juuri (7678) | more than 4 years ago | (#29110475)

Recently I decided to move from contracting to full time work as the job market is balls here in the Bay currently for Contracts. Twitter was one of the companies which I applied and I had the pleasure of having a "phone screen" with them for a senior unix position. Here's what this screen was, a basic unix question, that any lunix user could get. A more intermediate type question that could trick some people. And finally their *BIG SCREEN* a tricky question that was based on esoteric knowledge that had absolutely nothing to do with one's ability to perform the job.

The person calling me was just reading these off a list, she didn't know why they were picked and was only able to write down the answers. Here's the hilarious part, I informed her that the question was silly and there's no reason anyone should really care about this sort of information except in extreme situations. That this was the question that lead me to believe they had a culture of primadonnas. She diligently wrote all this down, in case they still wanted to talk to me.

But here's the REAL kicker, their stupid asinine esoteric question? Was wrong. They had the phrasing wrong... what they were asking and looking for in an answer were not the same things. Being a pedantic asshole, in my followup to tell them what I thought of their process I pointed this out. Never heard anything back ;) Wonder if they have fixed their question yet?

Re:Bit more on the twitter culture. (1)

iluvcapra (782887) | more than 4 years ago | (#29110747)

Maybe they didn't care about Unix experience, and were primarily testing your personal skills and your ability to hold a pleasant conversation with a non-technical person over the phone.

Always keep an eye out for the psych test [memory-alpha.org] .

Re:Eh sonny? (0)

Anonymous Coward | more than 4 years ago | (#29109617)

This is not offtopic. Do you know what failwhale is?

Type erasure (4, Informative)

shutdown -p now (807394) | more than 4 years ago | (#29108971)

Scala is great, but one really annoying thing about it is that it inherits type erasure [safalra.com] implementation of generics from Java. This means that you cannot overload methods on argument with the same generic class with different type parameters, cannot implement the same generic interface with different type parameters on the same class, cannot check whether a class implements a particular generic interface for a given type parameter, etc. They did fix some issues [lamp.epfl.ch] - for example, you can instantiate arrays - but it's still far from perfect.

I understand the need to match Java's broken model for the sake of interoperability, but surely a better way can be devised for pure Scala code? It's pretty much the only area where Scala noticeably lags behind advanced .NET-hosted languages (such as Nemerle or F#).

Re:Type erasure (1)

ahabswhale (1189519) | more than 4 years ago | (#29110307)

How do you propose they support this given that Java generics aren't reified? Arrays are, which is why that works.

Miracle language. (0)

Anonymous Coward | more than 4 years ago | (#29108975)

... Twitter has been able to sustain phenomenal growth, and it seems with more stability than what they had before the switch, so I think that's a good testament to Scala...Hmmmm, maybe I should switch my company's programming language to Scalia. After all, it cause market share to increase, computer systems to become more stable, and maybe it will make my hair grow back. I'm in!

Re:Miracle language. (2, Funny)

Doctor O (549663) | more than 4 years ago | (#29109109)

maybe it will make my hair grow back

OTOH, it might as well make your back hair grow, and who wants that?

Re:Miracle language. (4, Funny)

spun (1352) | more than 4 years ago | (#29109331)

... Twitter has been able to sustain phenomenal growth, and it seems with more stability than what they had before the switch, so I think that's a good testament to Scala...Hmmmm, maybe I should switch my company's programming language to Scalia. After all, it cause market share to increase, computer systems to become more stable, and maybe it will make my hair grow back. I'm in!

No, this is Scala, a language that is a blend of functional and object oriented programming. Scalia [wikipedia.org] is mix of textualism and originalism with a very conservative framework. Some consider its inability to recuse itself to be its greatest asset.

Re:Miracle language. (1)

staeiou (839695) | more than 4 years ago | (#29110707)

No, this is Scala, a language that is a blend of functional and object oriented programming. Scalia [wikipedia.org] is mix of textualism and originalism with a very conservative framework. Some consider its inability to recuse itself to be its greatest asset.

Eh, different tools for different jobs.

oblig (1, Insightful)

Anonymous Coward | more than 4 years ago | (#29108987)

Different tools for different jobs.
That being said, does anyone know of a good comparison of languages broken down by what they're best at doing? How does one decide what the best language for what they want to do is? My google-fu is weak today. I found this: popular programming languages [scriptol.com] ; but the analysis seems lacking.

Re:oblig (0)

gbjbaanb (229885) | more than 4 years ago | (#29110173)

C++ for everything. All the other languages start off with it after all. Of course, you have to up your game to be good enough to use it.

Re:oblig (0)

Anonymous Coward | more than 4 years ago | (#29110585)

You use something as high level as C++? Bah! Only noobs don't write everything in machine code.

Strongly typed language? (0, Offtopic)

xgr3gx (1068984) | more than 4 years ago | (#29109013)

What does that even mean?

Re:Strongly typed language? (2, Informative)

Anonymous Coward | more than 4 years ago | (#29109177)

http://en.wikipedia.org/wiki/Strongly_typed

Re:Strongly typed language? (0)

Anonymous Coward | more than 4 years ago | (#29109193)

It means all variables are typed with the CAPS LOCK ON... everyone knows that.

Re:Strongly typed language? (4, Informative)

Ann Coulter (614889) | more than 4 years ago | (#29109209)

Strongly typed languages usually make type conversions explicit and enforce type restrictions; whereas weakly typed languages usually allow implicit type conversions and relax type restrictions.

Explicit type conversions disallow a value of type T to be treated as a value of type S without invoking a function that takes a value of type T and returns a corresponding value of type S. For example, a conversion from an integer type to a floating point type requires the invocation of a function that performs the conversion. Contrast this with implicit type conversions where a value can be treated as almost any type depending on how it is to be used.

Type restrictions only allow certain operations to be done to certain types. For example, numerical addition mïay only be performed on numerical types. A lack of type restrictions allow for numerical addition to apply for, say, booleans, for example.

Re:Strongly typed language? (4, Funny)

xgr3gx (1068984) | more than 4 years ago | (#29109361)

Ah - duh. Immediately started thinking typed, as in the clicky clicky kind of typing done on a keyboard.
Man, was that a loud and smelly brain fart.
Thanks for that.
Sorry. Sorry Everyone!

Re:Strongly typed language? (0)

Anonymous Coward | more than 4 years ago | (#29109533)

Do it loud ...
    Do it proud !!!

Don't be sorry (0)

Anonymous Coward | more than 4 years ago | (#29110763)

Even if it was a brain fart it's quite funny. Thanks for making me laugh.

Re:Strongly typed language? (1)

binary paladin (684759) | more than 4 years ago | (#29110369)

I like your definition.

One of the biggest problems with "strongly typed" that I've seen is that sometimes it becomes synonymous with with "statically typed" and they just aren't the same thing. Some people seem to think that dynamically typed languages are automatically "weakly typed" which is just flat out wrong.

Re:Strongly typed language? (1, Informative)

Ephemeriis (315124) | more than 4 years ago | (#29109441)

What does that even mean?

It basically means that variable types are rigidly enforced and conversions are explicit.

It's annoying, but also eliminates some possible mistakes.

For example, say you've got a float variable: FloatNum1
And a couple integer variables: IntNum1, IntNum2

Some languages don't care much about variable types and do conversions on the fly. So you could write code to do
IntNum2 = (FloatNum1 + IntNum1)
and nobody would complain. No errors. Nothing. It would compile and run just fine. At least, assuming you didn't lose something important in a rounding error somewhere.

A strongly typed language will not allow that. It will kick out errors, refuse to compile, and generally pitch a fit. You are not allowed to add a float to an integer, and you certainly aren't allowed to assign it to another integer variable. Instead, you do something like this:
IntNum2 = (Float_to_Int(FloatNum1) + IntNum1)

Re:Strongly typed language? (0)

Anonymous Coward | more than 4 years ago | (#29109839)

An example in ocaml: if a function that expects a pair ({key: string;value:string} of strings is passed a string will flag a compiler error. A stongly typed language helps extend systems/scripts with greater consistency as many errors can be caught at compile time. I am not sure whether scala supports pattern matching, ocaml does it and I find that the compiler catches errors in scripts very nicely if not all patterns are matched: handling default cases. I find that using ocaml instead of python makes scripts (specially reading large files etc.) more readable, mainly due to strong type checking.

Another much more elegant example is the Printf.printf functions available in the ocaml standard library: the function call if incorrectly set will return a compile time error and not a runtime error. For example: Printf.printf "%d %s" anInt errorFunctionReturningInt) will flag an error. I know I saved quite a bit of debugging time with the above feature alone!

Re:Strongly typed language? (1)

John Betonschaar (178617) | more than 4 years ago | (#29109941)

Funny that you picked this particular example, because even strongly typed languages more often than not allow implicit floatint conversions. Take C/C++ for example, which would be a prime example of a strongly typed language but still it allows implicit int->float conversions, and many compilers don't mind going from int->float conversions either, even though it's a narrowing type conversion.

A better example would be something like string s = '0nice' and int i = 1. A typical weakly typed language allows statements such as string t = s + i (yielding '0nice1' for example) or i = i + s (multiple possible interpretations possible, but most languages would convert '0nice' to 0 to get i = i + 0).

Re:Strongly typed language? (1)

shutdown -p now (807394) | more than 4 years ago | (#29110063)

It basically means that variable types are rigidly enforced and conversions are explicit.

Actually, no, it means that value types are strongly enforced. A language may not have typed variables at all, and still be strongly typed - Python and Ruby are both examples of that. Static/dynamic typing, which is what you describe, is orthogonal to weak/strong typing.

Examples of weakly typed language are PHP, Tcl, and AFAIK Perl.

Re:Strongly typed language? (2, Informative)

Dgtl_+_Phoenix (1256140) | more than 4 years ago | (#29109477)

Assuming you're not being merely rhetorical (because the definition is kind of loose), strongly typed just means that the language makes some restrictions on how operations operating on different value types can be intermixed. Assuming that you're not a programmer, I'll give an example. Letâ(TM)s say you have a BMW Z4 roadster. It's a car. Understanding the nature of cars, you know that it can be classified as a vehicle, a sports car, a BMW sports car, and a BMW Z4 roadster. Strongly type languages make restrictions like you can't just say: roadsterCar car = myCar. This is implicitly is saying my car is roadster. Rather you have to explicitly say that the car is a roadster (called a cast) like this: roadsterCar car = (roadsterCar) myCar This concept has a number of benefits, most of which are related to catching programming mistakes before they become bugs or immediately at runtime. Without strongly typed languages, you won't notice that you tried to call a bike a BMW Z4 roadster until you try to get it up to 140 miles an hour. And by then you might have tried to do valid but nonsensical things that might have really broken something.

Re:Strongly typed language? (2, Informative)

SL Baur (19540) | more than 4 years ago | (#29109837)

Scala is statically typed. Most languages are strongly typed so that's not a particularly useful metric.

Static typing means that every object type is known at compile time and thus type safeness can be enforced before the code is executed.

Re:Strongly typed language? (4, Insightful)

Abcd1234 (188840) | more than 4 years ago | (#29110399)

Most languages are strongly typed so that's not a particularly useful metric.

Hardly. The One True Language for client-side web development, aka Javascript, is weakly typed, as is PHP, that ubiquitous server-side programming language. Perl is weakly typed. Good ol' shell script is weakly typed. Heck, even C is considered weakly typed (unless you enable -Werror, of course).

Re:Strongly typed language? (1, Interesting)

Anonymous Coward | more than 4 years ago | (#29110125)

"To this day, many C programmers believe that 'strong typing' just means pounding extra hard on the keyboard." --Peter van der Linden, Expert C Programming.

Re:Strongly typed language? (1, Insightful)

Abcd1234 (188840) | more than 4 years ago | (#29110331)

What does that even mean?

It means you're not qualified to even enter this discussion. Go take a course on programming languages and then get back to us.

Re:Strongly typed language? (0)

Anonymous Coward | more than 4 years ago | (#29110757)

What does that even mean?

It means you're not qualified to even enter this discussion. Go take a course on programming languages and then get back to us.

asshole.

Got me into functional programming (1)

DollyTheSheep (576243) | more than 4 years ago | (#29109275)

Back at university I somehow dodged functional programming. I knew functional programming was and is an important concept, but besides an excursion to Prolog and some SQL I never went outside imperative and/or object-oriented programming. I never wanted to learn Lisp or Scheme, Haskell seemed to much for mathematicians back then. Scala intrigued me enough to give functional programming a try again. It's object-oriented, has generics, is strongly typed, but has a powerful inference systems, so declaring things is not too tedious. Java classes and packages can be used within. It has not only builtins for concurrency but also for parallelism. However, it was the functional programming paradigm opened my eyes, what I was missing yet.

Software Engineering Radio... (1)

tcopeland (32225) | more than 4 years ago | (#29109369)

...had Martin Odersky in for an interview a while back [se-radio.net] .

It's good stuff; se-radio isn't afraid to get down in the weeds with the interviewee.

Library vs core language (1, Insightful)

Anonymous Coward | more than 4 years ago | (#29109469)

FTA: actors in Scala are not a language feature, they have been done purely as a Scala library

So:
1. There will be no useful compiler warnings/errors for the feature, since compilers implement only the core languuage.
2. Even if the library code will be 100% bug free, you'll still have to drag a debugger though it when debugging a hard bug in nearby code.
3. The library's API will never acheive the self-consistency of the core language because of too many cooks spoiling the broth.
4. The library will be massively overfeatured, but still not do what you actually want.
5. The library will change more frequently than core langage, meaning nothing will compile in the real world without hacks.
6. The library designer will hypnotise the core language designer and impose his own stupid ideas on the core language.
7. (6.) will lead to the entropy death of the language; people will simply stop paying attention to new versions.

Seriously, we should be figuring out a minimal subset of concurrancy features that really *can* go into a core language, with compiler support, debugger support, good consistency (like the while loop which does the same thing in all languages) etc.

Then libraries can implement endless semantic sugar/bullet-point fluff on top of the core features, since that's what libraries are good at.

Re:Library vs core language (1)

Homburg (213427) | more than 4 years ago | (#29110675)

All of your points are bullshit, but especially:

1. There will be no useful compiler warnings/errors for the feature, since compilers implement only the core languuage.

There's no reason that a library can't express sufficient semantics for the compiler to detect errors with its use.

Twitter - testament to Scala - Really? (1, Interesting)

Anonymous Coward | more than 4 years ago | (#29109577)

"Twitter has been able to sustain phenomenal growth, and it seems with more stability than what they had before the switch, so I think that's a good testament to Scala"

Have you ever bothered to look what the Twitter site does - there is virtually nothing to it. To argue that any language that is behind it is a testament to that language is ridiculous. The bigger question is how could they get any language to unstable for such a trivial set of functionality?

Doomed (5, Funny)

decipher_saint (72686) | more than 4 years ago | (#29109603)

Martin Odersky is beardless, Scala is doomed.

Re:Doomed (0)

Anonymous Coward | more than 4 years ago | (#29110701)

I work in the same building as him and I have a beard. The project is thus saved.

Not sold on Scala (4, Interesting)

glwtta (532858) | more than 4 years ago | (#29109657)

Am I the only one not terribly enamored with Scala? It's a massive language (have you seen the book?), but a lot of the syntax is somewhat redundant and doesn't seem to add that much. The type system is downright byzantine, and the Java interface is, let's say, somewhat inelegant. And the whole object-functional thing seems like a paradigm in search of an audience (maybe I'm just not getting it).

And you get to pay for all this with a huge performance hit.

I guess their "more is more" approach is mostly making Clojure look more attractive.

Re:Not sold on Scala (0, Troll)

Anonymous Coward | more than 4 years ago | (#29110041)

You just said a lot of meaningless stuff. If you could write some specifics instead of this rather generalized rant I'd appreciate it.

Re:Not sold on Scala (0)

Anonymous Coward | more than 4 years ago | (#29110105)

Take the dick out of your mouth..

Re:Not sold on Scala (0)

Anonymous Coward | more than 4 years ago | (#29110069)

Agreed. It is a neat language but it's way too big. It allows programmers to be "clever" and I don't mean that in a good way. Often I find myself staring blankly at some Scala just trying to figure out what the hell it is suppose to be doing (sometimes even my own code).

I have found there isn't that much of a performance hit but it depends on what you are doing. I'm generally surprised at how often there isn't a performance hit where I would have expected one.

Like Java itself, I did a few projects in Scala before abandoning it.

Re:Not sold on Scala (3, Interesting)

shutdown -p now (807394) | more than 4 years ago | (#29110113)

Am I the only one not terribly enamored with Scala? It's a massive language (have you seen the book?), but a lot of the syntax is somewhat redundant and doesn't seem to add that much. The type system is downright byzantine, and the Java interface is, let's say, somewhat inelegant.

I've read the book. Yes, it's fairly complicated, but then all languages tend to become that as they move from academia or design-by-committee stage into real world - witness Java. In terms of power, however, it's one of the most advanced languages today which can be used in production... and yet it's statically typed, which is a plus in my book.

And the whole object-functional thing seems like a paradigm in search of an audience (maybe I'm just not getting it).

You probably aren't. It's been a big thing in .NET land ever since C# 3.0 appeared, and grows even bigger now with F#. It's a pragmatic approach - it gives you both OO and FP tools, and lets you mix and match freely to get the optimal balance for the task at hand.

And you get to pay for all this with a huge performance hit.

I guess their "more is more" approach is mostly making Clojure look more attractive.

Funny how you speak about performance hit, and then immediately mention Clojure...

Anyway, where did you see the "huge" perf hit there? Examples? It's still JVM bytecode, remember, and it's statically typed, so in the end it's mostly normal Java method invocations all around. It has to fall back on reflection for some things that JVM simply doesn't support otherwise, but those are corner cases, not normal operation.

Re:Not sold on Scala (3, Interesting)

JAlexoi (1085785) | more than 4 years ago | (#29110235)

whole object-functional thing seems like a paradigm in search of an audience

Ah, young grasshopper. You are not aware of the mixed paradigm programming languages then. See OCaml, that is object/function oriented lang.

And you get to pay for all this with a huge performance hit.

That is definitely an overstatement. The performance hit is not huge, it's not even big.

Now, if you want a language with truely different syntax, try erlang.

how impressive is the twitter implementation (1)

mikem170 (698970) | more than 4 years ago | (#29109825)

The summary mentions that twitter is more stable after a rewrite and scales well...

Well, any system in any language benefits from a rewrite. And how hard should it be to scale a (stateless?) 150 character messagaging system?

Re:how impressive is the twitter implementation (1)

maxume (22995) | more than 4 years ago | (#29110025)

I have no idea how hard is should be, but remember, each time Scoble farts, twitter has to handle 93,000 messages.

Re:how impressive is the twitter implementation (1)

natehoy (1608657) | more than 4 years ago | (#29110053)

Given the number of reported "fail whale" incidents (if I'm naming them correctly), apparently it's really, REALLY hard to do. Or at least for the people who did it...

Bit I'm not a Twitter-er. I have an account and I occasionally read news blurbs on it, but I have yet to post anything on it.

check out Fan (0)

Anonymous Coward | more than 4 years ago | (#29109867)

If you think Scala is good, then check out the Fan programming language!

Choosing a language (4, Insightful)

jma05 (897351) | more than 4 years ago | (#29109929)

I could use an alternative programming language for the JVM that is more expressive than Java. Both Scala and Groovy integrate well with Java at the language level, albeit with different type systems. While I do use Groovy from time to time, what kept me from Scala was that it is not well supported by IDEs (Eclipse/Netbeans - I hear things are somewhat better with IntelliJ). The problem is the nature of Java libraries. They tend to be deeply nested and often expressed in lower level abstractions and are difficult to use without strong IDE support. I don't need an IDE for Python (flat module systems, high level libraries), but certainly do for Java. With solid IDE support however, I am nearly as productive in Eclipse + Java as with dynamic languages, even for medium apps. Scala and Groovy come with their own standard libraries and I don't need IDE support as long as I stay within them. But sooner or later, I will need to step into plain Java land and I no longer feel productive. I would rather use straight Java for them.

The development experience is language + tools, not just the language. While Scala can piggy back on JVM and undercut the rest of the process that languages need to go through to mature and be accepted, Scala plugin (or someone else) has to provide a JDT equivalent first to have popular appeal.

I just wish there was a well supported superset of Java with productivity considerations that maintains 1:1 byte-code compatibility on compilation. Java purists can keep their language clean. But the rest of us can be happy too. Scala has that potential.... almost. So far, Groovy has been filling that role for me. Groovy will never have the kind of edit-time IDE intelligence simply due to it's dynamic nature. But for now, it stands ahead (after all, it has been around longer).

Re:Choosing a language (1)

slartibart (669913) | more than 4 years ago | (#29110107)

I like Groovy, it's java-like and scratches some of my biggest itches about java.

However I like Clojure better. It's hard for me to resist the power of a lisp, with a full macro system, *and* full java interop. To me it's the only JVM language that stands out, Scala and Groovy are nice, but I don't see why they are any better or different than JRuby or Jython.

Re:Choosing a language (1)

ahabswhale (1189519) | more than 4 years ago | (#29110447)

Groovy is different because it's easy for Java programmers to learn. In fact, most Java devs can understand Groovy code with little or no explanation. That's certainly not the case for JRuby or Jython.

In any event, I agree Clojure is pretty sweet. However, being a Lisp, it's future is questionable. A lot of devs won't be willing to deal with the brain melting process necessary to grock it.

Re:Choosing a language (4, Interesting)

slartibart (669913) | more than 4 years ago | (#29110651)

Groovy is different because it's easy for Java programmers to learn. In fact, most Java devs can understand Groovy code with little or no explanation. That's certainly not the case for JRuby or Jython. In any event, I agree Clojure is pretty sweet. However, being a Lisp, it's future is questionable. A lot of devs won't be willing to deal with the brain melting process necessary to grock it.

Yeah I agree with you there. I do use groovy as my "java and then some" language. It looks an awful lot like ruby to me, but yes it's more java-like.

Its unfortunate about lisp(s) and their popularily, because honestly I don't see what's so difficult about them. Macros are hard, but lisps don't force you to use them. Other languages don't even give you an option, you can't. Paren matching is done by any modern editor. Prefix notation is a bit unintuitive I guess, but that slowed me down for maybe a couple of weeks, about the same as new syntax for almost any language. I am starting to think that "a lot of devs" just don't want to understand it. Or maybe a lot of devs just don't get programming in general, they just learn their one language, and can maybe pick up a few similar ones.

Re:Choosing a language (1)

Ichoran (106539) | more than 4 years ago | (#29110799)

Scala is better and different from Groovy and JRuby and Jython in that it is statically typed (but does a fantastic job at hiding all the type nonsense as long as you are doing something sensible). Those of us who make type errors as one of their most common errors really benefit from this. It is also better and different in that it is quite a lot faster than the interpreted languages. (It is worse and different in that a few fancy tricks are impossible, such as method-missing stuff, or generic operations using anything for which the operator is defined, etc..)

Re:Choosing a language (1)

Ichoran (106539) | more than 4 years ago | (#29110719)

I've found NetBeans + Java + Scala to not detract at all from NetBeans + Java. So to me, it's a win to add Scala to the mix. It would also be a win to add Groovy or Clojure or Jython or whatever; I just find adding Scala to be the biggest win because the interoperability with Java is easiest (at least in the Java->Scala direction) and because performance is by far the best.

Oooooooohhhh.... (-1, Troll)

gestalt_n_pepper (991155) | more than 4 years ago | (#29109995)

Another next biggest thing for the "guys in Mom's basement" crowd.

Learn C#, Java, C++ or VB.Net. Get a job.

Learn {obscure fad language of the month created by college students who don't have to make money}, stay unemployed.

It's either about money or masturbation guys. Learn the difference.

Re:Oooooooohhhh.... (1)

seizurebattlerobot (265408) | more than 4 years ago | (#29110325)

Sounds like someone is bitter about not having much choice in their life. You probably don't have any hobbies, either, since your employer wouldn't approve. Have fun tilling the land for your lord. The rest of us will be making real money for ourselves, out-competing your boss because of productivity gains from using decent tools, as opposed to whatever tools your boss thinks are the cheapest to teach monkeys to use.

Enjoy your job. Maybe if you're a good, your employer will give you a 1% raise next year? As long as it doesn't cut into executive bonuses, that is.

Re:Oooooooohhhh.... (2, Insightful)

david_thornley (598059) | more than 4 years ago | (#29110357)

Next biggest thing for the "guys with a job" crowd.

Learn some other language that isn't C#, Java, C++, VB.NET, or in fact particularly related.

Specifically, learn something with functional programming, or a different sort of object orientation (Common Lisp comes to mind, or Smalltalk or Objective-C), or declarative programming (like Prolog)...anything that's considerably different from any of the standard compiled OO languages.

Learn and improve, or don't learn and become unable to earn a living in the field.

Runs on Java JVM. Why bother? (0)

Animats (122034) | more than 4 years ago | (#29110171)

It seems sort of pointless to have another language that runs on top of the Java JVM. You still have all the Java baggage, plus a new language with its own baggage.

Scala is heavy on "cute" features. Wow, you can define your own infix operators! Mixins! Traits! Lots of overriding and overloading! Heavy "extensibility". You can beat the language into letting you write parser rules in Scala.

The trouble with overdoing language extensibility is that someone else may have to fix the "extended" code.

to put it differently (1)

Fuzzums (250400) | more than 4 years ago | (#29110619)

a language that can be used in many different ways will result in code that will be a JOY to maintain and debug.

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...