The Artima Developer Community
Sponsored Link

Articles Forum
Scala: A Scalable Language

8 replies on 1 page. Most recent reply: Dec 10, 2008 1:00 PM by Jason Young

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Scala: A Scalable Language Posted: May 6, 2008 1:00 AM
Reply to this message Reply
Advertisement
This article, based on Chapter 1 of the book <a href="http://www.artima.com/shop/forsale">Programming in Scala</a>, describes the scalable programming features of Scala:

http://www.artima.com/scalazine/articles/scalable-language.html

What do you think of the language features described in the article?


Leo Lipelis

Posts: 111
Nickname: aeoo
Registered: Apr, 2006

Re: Scala: A Scalable Language Posted: May 6, 2008 6:51 PM
Reply to this message Reply
The language features sound great to me.

Can anyone comment on Rich Hickey's decision to make all values read-only in Clojure and how Scala compares in that regard? Does anyone believe that, paraphrased, "updatable values are the new spaghetti code", as Rich says? If no, why not? If yes, what does Scala do about it?

Joshua Cough

Posts: 20
Nickname: joshcough
Registered: Jan, 2008

Re: Scala: A Scalable Language Posted: May 6, 2008 8:50 PM
Reply to this message Reply
I can't say much about Clojure, but I do agree that state leads to spaghetti in most situations.

Scala allows you to have read-only, and writable fields called val, and var. I think it is normally suggested that you use val, (everything immutable) unless you have a really good reason for state.

My rather uneducated guess is that Scala allows for var because (hardcore functional programmers please don't kill me) it makes sense in some situations, and to ease Java programmers into functional programming.

Jiri Goddard

Posts: 54
Nickname: goddard
Registered: May, 2007

Re: Scala: A Scalable Language Posted: May 6, 2008 11:11 PM
Reply to this message Reply
scala sounds great.
the val (value) is like constant, var (variable) is nothing more than variable - it can change its value whenever.

Alex Stojan

Posts: 95
Nickname: alexstojan
Registered: Jun, 2005

Re: Scala: A Scalable Language Posted: May 7, 2008 7:14 AM
Reply to this message Reply
> My rather uneducated guess is that Scala allows for var
> because (hardcore functional programmers please don't kill
> me) it makes sense in some situations, and to ease Java
> programmers into functional programming.

It definitely makes sense in certain situations to be able to use state, i.e. mutable objects. For example, if you have a queue that you need to modify it would be very inefficient to create a new queue every time you do an add or remove.

Vijay Kandy

Posts: 37
Nickname: vijaykandy
Registered: Jan, 2007

Re: Scala: A Scalable Language Posted: May 7, 2008 8:42 AM
Reply to this message Reply
Looks like Scala borrowed a lot of concurrency constructs from Erlang rather than from Java. Now I am interested in Scala :)

Joshua Cough

Posts: 20
Nickname: joshcough
Registered: Jan, 2008

Re: Scala: A Scalable Language Posted: May 7, 2008 8:56 AM
Reply to this message Reply
Scala did borrow the actor model from Erlang, and built it on top of Doug Lea's fork-join.

Jiri Goddard

Posts: 54
Nickname: goddard
Registered: May, 2007

Re: Scala: A Scalable Language Posted: May 7, 2008 12:00 PM
Reply to this message Reply
actually scala borrowed a lot of things from many languages, it's a good blend :)

Jason Young

Posts: 6
Nickname: apollodude
Registered: Dec, 2008

Re: Scala: A Scalable Language Posted: Dec 10, 2008 1:00 PM
Reply to this message Reply
If I understand correctly:

1. The object composition pattern is a language feature in Scala. I imagine this would make a much bigger difference in scalability than combining object-oriented and functional paradigms.

2. Also exciting is the way Scala, like Smalltalk, is a small language with a big API, where operators have almost no special rules regarding lexical or syntactic analysis as they do in languages with far more complex grammars, such as Java or C#.

Hooray for Scala!

Flat View: This topic has 8 replies on 1 page
Topic: How To Go Slow Previous Topic   Next Topic Topic: Creating Printable Documents with Ruby

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use