The Artima Developer Community
Sponsored Link

Weblogs Forum
Scala: The Static Language that Feels Dynamic

31 replies on 3 pages. Most recent reply: Oct 1, 2011 8:59 PM by Qingsheng Gao

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 31 replies on 3 pages [ « | 1 2 3 | » ]
Paul Butcher

Posts: 6
Nickname: 53192
Registered: Jan, 2008

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 14, 2011 1:52 AM
Reply to this message Reply
Advertisement
Nice article, and welcome to Scala :-)

The expressivity of a language is a difficult concept to pin down. It’s something that anyone who’s used more than one language will develop an intuition for, but how do you explain why one language is more expressive than another? I’ve recently convinced myself that it boils down to the scale at which a language makes it convenient to use a particular type of abstraction.

I blogged about this here:

http://www.paulbutcher.com/2010/11/language-expressivity-is-all-about-scale/

Adrian Sampaleanu

Posts: 1
Nickname: adrians
Registered: Jun, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 14, 2011 6:24 AM
Reply to this message Reply
Hi Bruce,

A great playground for Scala is the Kojo learning environment (http://www.kogics.net/sf:kojo). From its description:

"Kojo is a desktop application that runs on Windows, Linux, and the Mac. It is a Learning Environment - with many different features that help with the exploration, learning, and teaching of concepts in the areas of:

Computer Programming and Critical Thinking.
Math and Science.
Art, Music, and Creative Thinking.
Computer and Internet Literacy."

"Kojo is based on ideas derived from Logo, Processing, and The Geometer's Sketchpad."

It's one of the most fun ways to learn Scala.

Cheers,
Adrian

Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 14, 2011 9:35 AM
Reply to this message Reply
FYI, I just came across these definitions of concurrency vs. parallelism by Rob Pike, in http://www.infoq.com/interviews/pike-concurrency: "One of the misconceptions about concurrency is people often confuse concurrency and parallelism. Concurrency is a programming model that lets you express things that are independent as independent executions, and parallelism is about running two things at the same time. They are not the same idea and a lot of people confuse them, they think they are the same thing, but concurrency and parallelism are best thought of as different ideas. You can write beautiful concurrent programs with no parallelism whatsoever and you can also write extremely parallel programs that are not remotely concurrent. Concurrency is a model, parallelism is a result - maybe that's the best way to say it."

I don't think I've been using the terms correctly, because I've read lots of different (and conflicting) usages of them, so I just guessed (Seriously, "Concurrency" does sound like things that are running at the same time). It's good to finally find someone authoritative to nail down the definitions.

So Python can produce concurrent programs, but Cpython cannot do parallelism, for example.

Mark Lewis

Posts: 1
Nickname: 74783
Registered: Jan, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 14, 2011 10:06 AM
Reply to this message Reply
Bruce,

This is a great article that I will be sharing with everyone I know. I fell in love with Scala about a year ago and I started using it for my CS1 and CS2 courses last year. I think it is a great beginner language and you do a great job of summing that up here. As it happens, I recently got a contract for a CS1 and CS2 textbook that uses Scala so hopefully by Fall 2012 that will be available as a resource for people who want to use Scala as a first language.

Mark

Steven Dick

Posts: 1
Nickname: stevendick
Registered: Jun, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 15, 2011 4:39 AM
Reply to this message Reply
I keep seeing the 'Scala is too complex' meme cropping up in blogs. Have all these developers forgotten about C++? For me C++ was a fantastically powerful, but potentially complex language.

If we can have average developers deliver working code in C++, I don't see why we can't have them deliver working code in Scala.

I remember my head exploding reading the 'Modern C++ Design' book. One colleague agreed it was an eye-opening book, but he'd fire any developer he found using the ideas in it. ;-)

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 16, 2011 8:46 AM
Reply to this message Reply
<HotButton>
Can artima.com please redirect to scalanews.com?
</HotButton>

Other thoughts: Glad to see you are back to writing about programming, Bruce.

> You can always make them private if you want, and Scala has more fine-grained access control than any language I've seen.

I'm not really familiar with how Scala promotes fine-grained access control, but mentioning fine-grained access control with the "private" keyword in the same sentence seems like an oxymoron to me.

If you are interested, take a look at Newspeak and E. Fine-grained access control is not determined by how many keywords you have, but rather the semantics of your language. If keywords were the victor, then the CLR's visibility model would be king: http://msdn.microsoft.com/en-us/library/faz18t9a.aspx

The real question is why do you need to write programs that can check:

IsAssembly?
IsFamily? (Protected)
IsFamilyAndAssembly?
IsFamilyOrAssembly?
IsPrivate?
IsPublic?
IsSta tic?

Or even the InternalsVisibleToAttribute (Friendship) http://msdn.microsoft.com/en-us/library/0tke9fxk.aspx

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 16, 2011 8:54 AM
Reply to this message Reply
> So Python can produce concurrent programs, but Cpython cannot do parallelism, for example.

That's not an example, that's a statement without explanation.

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Scala: The Static Language that Feels Dynamic Posted: Jun 16, 2011 8:57 AM
Reply to this message Reply
> "Kojo is based on ideas derived from Logo, Processing, and
> The Geometer's Sketchpad."
>
> It's one of the most fun ways to learn Scala.

Adrian,

Thank you for this wonderful link. I am a huge fan of Logo and Geometer's Sketchpad. Will check it out.

C G

Posts: 3
Nickname: easylife
Registered: Jan, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 6, 2011 12:06 PM
Reply to this message Reply
How does Scala compare to Java in performance ?

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 8, 2011 12:18 AM
Reply to this message Reply
Scala is compiled into bytecode that runs on the JVM, in the same way as Java. In general, "performance" is similar for similar tasks performed in similar ways.

http://www.lmgtfy.com/?q=scala+java+performanceScala

Marko Loparic

Posts: 3
Nickname: markolopa
Registered: Jul, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 11, 2011 3:16 AM
Reply to this message Reply
You say

"The highest complement you can deliver in the Python world..."

I guess you mean "compliment" instead.

Thanks for the interesting and informative article!

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 11, 2011 7:14 AM
Reply to this message Reply
> > So Python can produce concurrent programs, but Cpython
> cannot do parallelism, for example.
>
> That's not an example, that's a statement without
> explanation.

This covers the basic:

http://www.astrobetter.com/parallel-processing-in-python/

Bruce Fancher

Posts: 4
Nickname: iterative
Registered: Mar, 2007

Take a look at Clojure Posted: Jul 15, 2011 9:55 PM
Reply to this message Reply
I recently asked the author of a book on Scala to compare and contrast the experience of using Scala with the experience of using Clojure. He said that with Clojure, all the pain of the learning curve was up front, while with Scala, every time you thought you'd climbed the learning curve, you'd run into something new that would drag you back down again.

Scala is a very impressive piece of engineering, but it's just too damn complicated. Just learn and use Clojure instead. If you have any doubts about why you'd want to learn and use a Lisp, read Paul Graham.

Mark Seal

Posts: 1
Nickname: w0lf
Registered: Jul, 2011

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 18, 2011 6:52 AM
Reply to this message Reply
ntrif, I read the short article that you posted. It read more as a plug for the GO language than anything else. That is fine and all but is not a good reason not to try Scala.

Rusco rebhan

Posts: 2
Nickname: rebhan
Registered: Aug, 2007

Re: Scala: The Static Language that Feels Dynamic Posted: Jul 20, 2011 11:38 AM
Reply to this message Reply
@Bruce,
it seems you look at every language about 2 yrs after I did :-)

Scripting languages are a valid option for small scale projects, they just break like a castle of sand if your project gets too big - unless you write tons of testing code. Then you refactor - then you have to rewrite your testing code again..... The need for cheap refactoring is what makes strong typing necessary. Therefore Python 2 will continue still for some more years :-(

Scala to the rescue. But it looks you didn't yet reach the phase of a component developer - you are still a consumer. Writing reusable components in Scala is quite hard, it's just a language which needs 100 % commitment and is unfortunately not suited to Joe the Programmer.

Btw: Since Javascript is just a too important target to ignore I started to look at Haxe again (has like Scala a strong OCaml influence) and can just warmly recommend it ! Will you join me in 2 years ?

Cheers
Rusco
j.rebhan (gmail)

Flat View: This topic has 31 replies on 3 pages [ « | 1  2  3 | » ]
Topic: Static Typing, Guard Rails and Street Signs Previous Topic   Next Topic Topic: Creating an Interactive JRuby Console for the Eclipse Environment

Sponsored Links



Google
  Web Artima.com   

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