The Artima Developer Community
Sponsored Link

Java Community News
Lex Spoon on Scala and Bringing Future Languages to the JVM

9 replies on 1 page. Most recent reply: May 7, 2008 3:27 PM by Raoul Duke

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 9 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 24, 2008 5:19 PM
Reply to this message Reply
Summary
Lex Spoon, co-author of Programming in Scala, gave a presentation at the 2007 JAOO conference on Scala and on bringing future languages to the JVM. InfoQ posted a video of Spoon's presentation.
Advertisement

Lex Spoon has worked with Martin Odersky on the Scala language, and is also a co-author of Programming in Scala, the authoritative book on the language.

At the 2007 JAOO conference, Spoon gave a presentation on Scala, focusing mainly on the reasons the language should be of interest to a general developer audience. The video of Spoon's presentation was recently posted on InfoQ's Web site:

[Scala] is interesting for a general audience for two reasons. One, from a pure design view, it manages to integrate functions and objects fairly well: it gives you objects that are functional.

And ... it does this while maintaining compatibility with what mainstream practitioners are doing right now. This is an effort to bring advanced [programming] language constructs to where programmers are right now...

We really believe in domain-specific languages. We think you're either going to write them in another language, or you're going to write internal DSLs in the same language. We would like to support you writing them internally, when possible...

Scala also has a lot to say about component-style development, which everyone is talking about, but is somehow not working really well...

The rest of Spoon's presentation focuses on the functional and object-oriented aspects of Scala, and on key Scala programming constructs:

The way Scala tries to do this is with two hypotheses: The first one is that [if] you want to make progress, you should make that with a language that's scalable, [meaning] the constructs work with both small and big pieces of code.

So Scala uses the same constructs for everything from programs and structures down to tiny little integers. It totally resists the temptation to add a module keyword, for example.

The problem is that you end up implement similar language [things] at different levels of code size, but [those things are] not quite the same, and then programmers have to decide [if they] want to use the big code construct or the little code construct. Scala's answer is [to] use the same constructs for all scales.

The second hypothesis is that if you're going achieve this, then you'll have to steal ideas from both the functional and the object-oriented language [communities].

Functional languages are very good at parametric abstraction... The lowly function, is abstracted over values. You can think of the parameters of a function as parts of a computation that have been left out. The caller has to fill in those values...

Higher-order functions are nothing more than doing this very same thing for control. A function that takes functions as arguments allows you to abstract over control. Finally, parametric polymorphism of your type system does the same thing for types. Functional language do this parametric abstraction for a lots of different things.

Object-oriented languages, on the other hand, are very good at abstracting and extending. OO languages have inheritance, they have a strong notion of subtype. Also, OO languages let you reconfigure things at runtime. If your modules are hooked up one way, and you want to reconfigure them in some other way at runtime, that's no big deal in an OO language...

A key message of Spoon's presentation is that while Scala is a production-ready language, familiarity with key Scala concepts can make one a better programmer, regardless of whether one ends up using Scala in a project.

How has Scala influenced your thinking about programming in general?


Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 24, 2008 6:38 PM
Reply to this message Reply
> How has Scala influenced your thinking about
> programming in general?

i cry daily into my job-required java compiler?

sawan kuntala

Posts: 7
Nickname: kst
Registered: Aug, 2006

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 25, 2008 6:57 AM
Reply to this message Reply
"A key message of Spoon's presentation is that while Scala is a production-ready language, familiarity with key Scala concepts can make one a better programmer, regardless of whether one ends up using Scala in a project."

Irrespective of "production-ready", i really think every programmer comming from different backgrounds, c++, ruby/pyhton, Java etc should get familiar with scala's type system and language features, specially the flexibility it provides with less complexity, to become a better programmer.

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 25, 2008 2:42 PM
Reply to this message Reply
> flexibility it provides with less complexity

debatable / need to define "less complexity compared to what?"

http://www.nabble.com/Re%3A-Re%3A-The-Future-of-Scala--p16287707.html

Leo Lipelis

Posts: 111
Nickname: aeoo
Registered: Apr, 2006

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 26, 2008 4:14 PM
Reply to this message Reply
I guess I am just too lazy at this point in life, but I have become addicted to auto-completing, auto-generating and to some degree auto-refactoring everything. I don't want to use Scala as long as it's missing these features in its Eclipse plug-in.

At least, Scala should get a first-class REPL environment. Although a good REPL is not a substitute for the above features, it might compensate somewhat for their lack.

James Iry

Posts: 85
Nickname: jiry
Registered: Nov, 2007

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Mar 28, 2008 11:48 AM
Reply to this message Reply
What makes a REPL first-class? Scala comes with a pretty nice little REPL.
<code>
Welcome to Scala version 2.7.0-final (Java HotSpot(TM) Client VM, Java 1.6.0_03)
.
Type in expressions to have them evaluated.
Type :help for more information.

scala> "hello"
res0: java.lang.String = hello

scala> println("hello")
hello

scala> class HelloSayer {

scala> class HelloSayer {
| def sayIt = println("Hello")
| }
defined class HelloSayer

scala> val x = new HelloSayer()
x: helloSayer = HelloSayer@1606bf5

scala> x.sayIt
Hello

scala> :quit
</code>

Javier Diaz Soto

Posts: 29
Nickname: javierbds
Registered: Sep, 2005

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Apr 5, 2008 7:11 PM
Reply to this message Reply
> http://www.nabble.com/Re%3A-Re%3A-The-Future-of-Scala--p162
> 87707.html

Citing T Morris is asking for (at least) futile debate. Not that I don´t find him interesting (and much more ´functionally enlightened´ than me) but his POVs are not always widely held, specially concerning (?) how a language should grow and evolve and how to get market acceptance of such language ...

Javier Diaz Soto

Posts: 29
Nickname: javierbds
Registered: Sep, 2005

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Apr 5, 2008 7:24 PM
Reply to this message Reply
> At least, Scala should get a first-class REPL environment.
> Although a good REPL is not a substitute for the above
> e features, it might compensate somewhat for their lack.

If you’re on Unix, you’ll need to say either “ledit scala” or
“rlwrap scala” to get line editing functionality in the interpeter. (From Programming in Scala) If you are on OS X you can install MacPorts then rlwrap. In Win I guess you get history, inline editing ´bolted-in´ ... This is more or less what you (used to?) get in python that is considered to have a good REPL

Javier Diaz Soto

Posts: 29
Nickname: javierbds
Registered: Sep, 2005

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: Apr 11, 2008 11:34 PM
Reply to this message Reply
OTOH, (last I tried) you cannot make companion objects access private members of a class from the REPL ...

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: Lex Spoon on Scala and Bringing Future Languages to the JVM Posted: May 7, 2008 3:27 PM
Reply to this message Reply
> http://www.nabble.com/Re%3A-Re%3A-The-Future-of-Scala--p16287707.html
> Citing T Morris is asking for (at least) futile debate.

i only meant that Scala's type system is perhaps more complicated to understand in some regards than e.g. Haskell's, which i think is what Tony was getting at. maybe.

"it all depends" on who the given learner-to-be is. i don't think one can blanketly affirm "scala's type system and language features, specially the flexibility it provides with less complexity" because it really depends on what language and what use cases you are comparing it to.

(don't get me wrong, i'd a buhzillion times prefer using Scala over Java, too bad my day job isn't into that.)

Flat View: This topic has 9 replies on 1 page
Topic: Dojo 1.0 Released Previous Topic   Next Topic Topic: ZeroTurnaround Releases JavaRebel 1.1

Sponsored Links



Google
  Web Artima.com   

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