Scala 2.9.0 RC1

284 views
Skip to first unread message

Antonio Cunei

unread,
Mar 25, 2011, 4:34:08 PM3/25/11
to scala-l...@googlegroups.com, scala-a...@googlegroups.com
After many months of work, the Scala Team is happy to announce
the first release candidate of the new Scala 2.9 distribution!
Scala 2.9.0 RC1 is currently available from our Download Page.

The Scala 2.9.0 codebase includes several additions, notably the
new Parallel Collections, but it also introduces improvements on
many existing features, and contains many bug fixes.

Please help us with the testing of this release candidate, and
let us know of any issues you may detect.


The Scala 2.9.0 RC1 distribution
=====================================

This Release Candidate is made available for testing purposes
only and is not intended for production environments. We will
wait at least two weeks before issuing a final release, in
order to allow developers and testers to send us their
feedback.

What is new?
============

The new Scala 2.9 codebase includes the following new features
and changes:

- Parallel Collections

Every collection may be converted into a corresponding
parallel collection with the new `par` method. Parallel
collections utilize multicore processors by implementing bulk
operations such as `foreach`, `map`, `filter` etc. in
parallel. Parallel collections are located in the package
`scala.collection.parallel`.

Depending on the collection in question, `par` may require
copying the underlying dataset to create a parallel
collection. However, specific collections share their
underlying dataset with a parallel collection, making `par` a
constant time operation.

Currently available parallel collections are:

* parallel arrays -
scala.collection.parallel.mutable.ParArray
* parallel ranges -
scala.collection.parallel.immutable.ParRange
* parallel hash maps -
scala.collection.parallel.mutable.ParHashMap
* parallel hash sets -
scala.collection.parallel.mutable.ParHashSet
* parallel hash tries -
scala.collection.parallel.immutable.ParHashMap
scala.collection.parallel.immutable.ParHashSet
* parallel vectors -
scala.collection.parallel.immutable.ParVector

The method `seq` is used to convert from a parallel collection
to a corresponding sequential collection. This method is
always efficient (O(1)).

Other features
==============

* Generalized try-catch-finally:

try body
catch handler
finally cleanup

Here body, hander, and cleanup can be arbitrary expressions.

* Better REPL:
Better jline support, multi-line history, faster startup.

* New REPL commands:
:implicits, :keybindings, :javap

* New packages:
scala.sys and scala.sys.process which are imported from
sbt.Proces

* New trait:
App, a safer and more performant alternative to Application.
It now allows to access command line arguments. It relies
on another new trait, DelayedInit, which lets one capture
class initialization code in a closure.

* New methods in collections:
collectFirst, maxBy, minBy, span, inits, tails,
permutations, combinations, subsets

* Annotation @strictfp is now supported.

* A large number of bugfixes and performance improvements.

Rodrigo Cano

unread,
Mar 25, 2011, 5:24:52 PM3/25/11
to scala-l...@googlegroups.com, Antonio Cunei, scala-a...@googlegroups.com
hmm, this is a bit ugly:

[rcano@scrat ~]$ scala
Welcome to Scala version 2.9.0.RC1 (Java HotSpot(TM) Client VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala> exit
warning: there were 1 deprecation warnings; re-run with -deprecation for details
[rcano@scrat ~]$ 

How do you expect me to not use deprecated API, if you use it! :P

Paul Phillips

unread,
Mar 25, 2011, 5:31:49 PM3/25/11
to scala-l...@googlegroups.com, Rodrigo Cano, Antonio Cunei
On 3/25/11 2:24 PM, Rodrigo Cano wrote:
> scala> exit
> *warning: there were 1 deprecation warnings; re-run with -deprecation
> for details*

> [rcano@scrat ~]$
>
> How do you expect me to not use deprecated API, if you use it! :P

Did we come to your house and type exit? That wasn't cool of us.

(You are calling Predef.exit, not us.)

That said, I know people are used to typing "exit" even when it's not
actually a command and I have it on my list to quietly import sys.exit.

Rodrigo Cano

unread,
Mar 25, 2011, 5:38:01 PM3/25/11
to Paul Phillips, scala-l...@googlegroups.com, Antonio Cunei
Did we come to your house and type exit? That wasn't cool of us.
Yeah, I knew I shouldn't give you the keys that easily..


That said, I know people are used to typing "exit" even when it's not actually a command and I have it on my list to quietly import sys.exit.

Thanks for the clarification, and next time you come by, at least bring some pizza. 

Jason Zaugg

unread,
Mar 25, 2011, 5:42:09 PM3/25/11
to scala-l...@googlegroups.com, Rodrigo Cano, Paul Phillips, Antonio Cunei
On Fri, Mar 25, 2011 at 10:38 PM, Rodrigo Cano <ioni...@gmail.com> wrote:
>> Did we come to your house and type exit? That wasn't cool of us.
>
> Yeah, I knew I shouldn't give you the keys that easily..
>
>> That said, I know people are used to typing "exit" even when it's not
>> actually a command and I have it on my list to quietly import sys.exit.
>
> Thanks for the clarification, and next time you come by, at least bring some
> pizza.

:quit or ^D are the polite ways of leaving.

^D

Michael Cotterell

unread,
Mar 26, 2011, 12:04:36 AM3/26/11
to scala-l...@googlegroups.com, scala-a...@googlegroups.com, Antonio Cunei
Scala 2.9 RC1 ... aka ... LIKE A BOSS

Randall R Schulz

unread,
Mar 26, 2011, 12:32:44 AM3/26/11
to scala-l...@googlegroups.com
On Friday March 25 2011, Antonio Cunei wrote:
> After many months of work, the Scala Team is happy to announce
> the first release candidate of the new Scala 2.9 distribution!
> Scala 2.9.0 RC1 is currently available from our Download Page.
>
> The Scala 2.9.0 codebase includes several additions, notably the
> new Parallel Collections, but it also introduces improvements on
> many existing features, and contains many bug fixes.
>
> ...

Was it an oversight in the announcement,
or did Dynamic not get included?


Randall Schulz

martin odersky

unread,
Mar 26, 2011, 5:28:00 AM3/26/11
to scala-l...@googlegroups.com, Randall R Schulz
Dynamic is available under -Xexperimental. We are not 100% sure yet how we will support it, so we did not want to commit to one way of doing it now.

Cheers
 
 -- Martin

Cay Horstmann

unread,
Mar 26, 2011, 6:46:38 AM3/26/11
to scala-l...@googlegroups.com
Unfortunately, the Scala REPL doesn't seem to work with Cygwin:

$ scala-2.9.0.RC1/bin/scala
[ERROR] Failed to construct terminal; falling back to
unsupportedjava.lang.IllegalArgumentException: Invalid terminal type:
jline.UnixTerminal
at scala.tools.jline.TerminalFactory.create(TerminalFactory.java:83)
at scala.tools.jline.TerminalFactory.get(TerminalFactory.java:154)
at scala.tools.jline.console.ConsoleReader.<init>(ConsoleReader.java:87)
at scala.tools.jline.console.ConsoleReader.<init>(ConsoleReader.java:134)
at scala.tools.nsc.interpreter.JLineReader$JLineConsoleReader.<init>(JLineReader.scala:38)
at scala.tools.nsc.interpreter.JLineReader.<init>(JLineReader.scala:63)
at scala.tools.nsc.interpreter.JLineReader$.apply(JLineReader.scala:77)
at scala.tools.nsc.interpreter.ILoop.chooseReader(ILoop.scala:694)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:710)
at scala.tools.nsc.MainGenericRunner$.runTarget$1(MainGenericRunner.scala:72)
at scala.tools.nsc.MainGenericRunner$.process(MainGenericRunner.scala:85)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:33)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassNotFoundException: jline.UnixTerminal
at scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$1.apply(AbstractFileClassLoader.scala:40)
at scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$1.apply(AbstractFileClassLoader.scala:40)
at scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$findBytes$1.apply(AbstractFileClassLoader.scala:27)
at scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$findBytes$1.apply(AbstractFileClassLoader.scala:24)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.interpreter.AbstractFileClassLoader.findBytes(AbstractFileClassLoader.scala:24)
at scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:40)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at scala.tools.nsc.interpreter.AbstractFileClassLoader.scala$tools$nsc$util$ScalaClassLoader$$super$loadClass(AbstractFileClassLoader.scala:16)
at scala.tools.nsc.util.ScalaClassLoader$class.loadClass(ScalaClassLoader.scala:54)
at scala.tools.nsc.interpreter.AbstractFileClassLoader.loadClass(AbstractFileClassLoader.scala:16)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at scala.tools.jline.TerminalFactory.create(TerminalFactory.java:80)
... 12 more

Welcome to Scala version 2.9.0.RC1 (Java HotSpot(TM) Client VM, Java 1.6.0_23).


Type in expressions to have them evaluated.
Type :help for more information.

scala>

I looked at the launch script and didn't see anything obviously wrong.
I tried moving the "-Djline.terminal=jline.UnixTerminal with the
JAVA_OPTS, but that made no difference. Is this something that went
awry when moving from stock jline to scala.tools.jline? Or is it
working for others, and just something weird in my local installation?

Thanks,

Cay

2011/3/26, martin odersky <martin....@epfl.ch>:

Antonio Rodríguez S.

unread,
Mar 26, 2011, 9:30:12 AM3/26/11
to scala-l...@googlegroups.com, Antonio Cunei, scala-a...@googlegroups.com
Great news! First thanks to the whole Scala team. In a new version of the Eclipse plugin include or planned next?

Cheers,
Antonio Rodríguez S.

2011/3/25 Antonio Cunei <antoni...@epfl.ch>



--
Dr. Antonio R. Rodríguez Santiesteban
Java-Plattform-Entwickler

Tel.: (030) 74921026
Priv. Tel.: (030) 470 03 470
Mobil: 01577 2856 033
E-Mail: antonio....@it-asesor.de, roda...@googlemail.com
Skype: rodant0268

martin odersky

unread,
Mar 26, 2011, 10:11:48 AM3/26/11
to scala-l...@googlegroups.com, Antonio Rodríguez S., Antonio Cunei, scala-a...@googlegroups.com


2011/3/26 Antonio Rodríguez S. <roda...@googlemail.com>

Great news! First thanks to the whole Scala team. In a new version of the Eclipse plugin include or planned next?

The revamped Eclipse plugin for 2.9 will most likely be released on Monday.

Cheers

 -- Martin 

Paul Phillips

unread,
Mar 26, 2011, 12:08:32 PM3/26/11
to scala-l...@googlegroups.com, Cay Horstmann
On 3/26/11 3:46 AM, Cay Horstmann wrote:
> Unfortunately, the Scala REPL doesn't seem to work with Cygwin:

I'm completely at the mercy of someone on windows trying things out.
It should be fixed in trunk now, assuming changing

-Djline.terminal=jline.UnixTerminal

to

-Djline.terminal=scala.tools.jline.UnixTerminal

in the runner fixes it.

Josh Suereth

unread,
Mar 26, 2011, 1:12:04 PM3/26/11
to scala-l...@googlegroups.com, Paul Phillips, Cay Horstmann
As a side note, the REPL will be broken in SBT and Maven until we issue quick fixes.  I'm working on the Maven patch ASAP.

huynhjl

unread,
Mar 26, 2011, 2:04:26 PM3/26/11
to scala-language
Made the scala.tools.jline.UnixTerminal edit in my local RC1 scala
script on Vista 32 bits and that works for rxvt-cygwin.

I did find another issue that I don't understand yet. Under cygwin
console (TERM is cygwin), jline is disabled (so no history or CTRL key
shortcuts). But there is a work around as using scala -nobootcp works
fine.

scala.bat under cmd shell works fine (and does not use bootcp from
what I can see).

Nils Kilden-Pedersen

unread,
Mar 26, 2011, 2:23:39 PM3/26/11
to Antonio Cunei, scala-l...@googlegroups.com, scala-a...@googlegroups.com
I tried compiling O/R Broker with scaladoc 2.9 RC1 and got this weird result. Last I tried, it worked fine with 2.9.0.r24394-b20110307020059.

scaladoc -unchecked -d docs\api -doc-title "O/R Broker" -
doc-version 3.1 -classpath bin;e:\Java\freemarker-2.3.16\lib\freemarker.jar;e:\Java\joda-time-1.6\joda-time-1.6.jar;e:\Java\velocity-1.6.3\v
elocity-1.6.3-dep.jar -sourcepath src\main\scala src\main\scala\org\orbroker\*.scala src\main\scala\org\orbroker\conv\*.scala src\main\scala
\org\orbroker\callback\*.scala src\main\scala\org\orbroker\config\*.scala src\main\scala\org\orbroker\adapt\*.scala src\main\scala\org\orbro
ker\exception\*.scala src\main\scala\org\orbroker\pimp\*.scala src\main\scala\org\orbroker\config\dynamic\*.scala src\main\scala\org\orbroke
r\util\*.scala
java.io.IOException: MALFORMED[1]
        at scala.tools.nsc.io.SourceReader$.decode(SourceReader.scala:137)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:91)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:46)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:65)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:268)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:274)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)

        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.immutable.List.map(List.scala:45)
        at scala.tools.nsc.Global$Run.compile(Global.scala:995)
        at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:51)
        at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:78)
        at scala.tools.nsc.ScalaDoc$.process(ScalaDoc.scala:65)
        at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:81)
        at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)
error: IO error while decoding e:\Java\freemarker-2.3.16\lib\freemarker.jar with UTF-8
Please try specifying another one using the -encoding option
java.io.IOException: MALFORMED[1]
        at scala.tools.nsc.io.SourceReader$.decode(SourceReader.scala:137)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:91)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:46)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:65)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:268)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:274)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)

        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.immutable.List.map(List.scala:45)
        at scala.tools.nsc.Global$Run.compile(Global.scala:995)
        at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:51)
        at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:78)
        at scala.tools.nsc.ScalaDoc$.process(ScalaDoc.scala:65)
        at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:81)
        at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)
error: IO error while decoding e:\Java\joda-time-1.6\joda-time-1.6.jar with UTF-8
Please try specifying another one using the -encoding option
java.io.IOException: MALFORMED[1]
        at scala.tools.nsc.io.SourceReader$.decode(SourceReader.scala:137)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:91)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:46)
        at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:65)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:268)
        at scala.tools.nsc.Global.getSourceFile(Global.scala:274)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.tools.nsc.Global$Run$$anonfun$14.apply(Global.scala:995)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)

        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.immutable.List.map(List.scala:45)
        at scala.tools.nsc.Global$Run.compile(Global.scala:995)
        at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:51)
        at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:78)
        at scala.tools.nsc.ScalaDoc$.process(ScalaDoc.scala:65)
        at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:81)
        at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)
error: IO error while decoding e:\Java\velocity-1.6.3\velocity-1.6.3-dep.jar with UTF-8
Please try specifying another one using the -encoding option
src\main\scala\org\orbroker\conv\converters.scala:43: error: object joda is not a member of package org
  type T = org.joda.time.LocalDate
               ^
src\main\scala\org\orbroker\conv\converters.scala:45: error: value toDateMidnight is not a member of org.orbroker.conv.JodaLocalDateConv.T
  def toJdbcType(date: T) = new java.sql.Date(date.toDateMidnight.getMillis)
                                                   ^
src\main\scala\org\orbroker\conv\converters.scala:52: error: object joda is not a member of package org
  type T = org.joda.time.LocalTime
               ^
src\main\scala\org\orbroker\conv\converters.scala:54: error: value getMillisOfDay is not a member of org.orbroker.conv.JodaLocalTimeConv.T
  def toJdbcType(time: T) = new java.sql.Time(time.getMillisOfDay)
                                                   ^
src\main\scala\org\orbroker\conv\converters.scala:61: error: object joda is not a member of package org
  type T = org.joda.time.DateTime
               ^
src\main\scala\org\orbroker\conv\converters.scala:63: error: value getMillis is not a member of org.orbroker.conv.JodaDateTimeConv.T
  def toJdbcType(ts: T) = new java.sql.Timestamp(ts.getMillis)
                                                    ^
src\main\scala\org\orbroker\config\dynamic\FreeMarkerStatement.scala:8: error: not found: object freemarker
import freemarker.template._
       ^
src\main\scala\org\orbroker\config\dynamic\FreeMarkerStatement.scala:10: error: too many arguments for constructor Object: ()java.lang.Objec
t
private[orbroker] class FreeMarkerStatement(
                                           ^
8 errors found
Exception in thread "main" java.lang.AssertionError: assertion failed: mismatch class FreeMarkerStatement List() List(id, callback, adapter)

        at scala.Predef$.assert(Predef.scala:100)
        at scala.tools.nsc.typechecker.Typers$Typer.decompose$1(Typers.scala:1529)
        at scala.tools.nsc.typechecker.Typers$Typer.computeParamAliases(Typers.scala:1536)
        at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:1707)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3818)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4158)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2036)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$24.apply(Typers.scala:2119)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$24.apply(Typers.scala:2119)
        at scala.collection.immutable.List.loop$1(List.scala:117)
        at scala.collection.immutable.List.mapConserve(List.scala:133)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2119)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1455)
        at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1220)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3809)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4158)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:2036)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$24.apply(Typers.scala:2119)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$24.apply(Typers.scala:2119)
        at scala.collection.immutable.List.loop$1(List.scala:117)
        at scala.collection.immutable.List.mapConserve(List.scala:133)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2119)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:3805)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4158)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:4207)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:94)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:326)
        at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:47)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:326)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:86)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:86)
        at scala.collection.Iterator$class.foreach(Iterator.scala:652)
        at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:311)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:86)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:896)
        at scala.tools.nsc.Global$Run.compile(Global.scala:997)
        at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:51)
        at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:78)
        at scala.tools.nsc.ScalaDoc$.process(ScalaDoc.scala:65)
        at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:81)
        at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)

Paul Phillips

unread,
Mar 26, 2011, 2:26:15 PM3/26/11
to scala-l...@googlegroups.com, huynhjl
On 3/26/11 11:04 AM, huynhjl wrote:
> I did find another issue that I don't understand yet. Under cygwin
> console (TERM is cygwin), jline is disabled (so no history or CTRL key
> shortcuts).

That's the behavior you would see if an exception was thrown when
instantiating the jline reader. (It falls back on SimpleReader which
lacks those features.) I added some output so in future builds it'll
tell you what happened.

> But there is a work around as using scala -nobootcp works fine.

So I suppose the attempt to create it by name is failing due to some
classpath visibility issue.

> scala.bat under cmd shell works fine (and does not use bootcp from
> what I can see).

I don't even know what's in scala.bat. Now there's a file which could
use a maintainer.

Doug Tangren

unread,
Mar 26, 2011, 2:35:00 PM3/26/11
to scala-l...@googlegroups.com, Jason Zaugg, Rodrigo Cano, Paul Phillips, Antonio Cunei
:quit or ^D are the polite ways of leaving.


also for the super lazy, you can just type :q 

Cay Horstmann

unread,
Mar 26, 2011, 9:11:42 PM3/26/11
to scala-l...@googlegroups.com
I can confirm that. Cywin/rxvt works fine with this fix (hooray), but
Cygwin in a DOS shell doesn't have history or tab completion.

2011/3/27 huynhjl <huy...@gmail.com>:

huynhjl

unread,
Mar 27, 2011, 3:08:31 AM3/27/11
to scala-language
On Mar 26, 11:26 am, Paul Phillips <pa...@improving.org> wrote:
> On 3/26/11 11:04 AM, huynhjl wrote:
>
> > I did find another issue that I don't understand yet. Under cygwin
> > console (TERM is cygwin), jline is disabled (so no history or CTRL key
> > shortcuts).
>
> That's the behavior you would see if an exception was thrown when
> instantiating the jline reader.  (It falls back on SimpleReader which
> lacks those features.) I added some output so in future builds it'll
> tell you what happened.

Failed to created JLineReader: java.lang.NoClassDefFoundError: Could
not initialize class org.fusesource.jansi.internal.Kernel32

My guess is it can't load the dll packaged with the jline.jar (for
accessing Win32 console functions).

Apparently, when using bootclasspath, JNI libs can only be loaded from
$JAVA_HOME/bin or -Dsun.boot.library.path has to be specified.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4285197

IMHO, the script can default on nobootcp behavior when using cygwin
TERM.
Here is my take on a fix:
https://github.com/huynhjl/scala-full/commit/a2fc3d945559a73330ca8a31c5a3d687f0c16ca8#diff-0

--Jean-Laurent

Philippe Lhoste

unread,
Mar 27, 2011, 9:25:06 AM3/27/11
to scala-l...@googlegroups.com
On 25/03/2011 21:34, Antonio Cunei wrote:
> * Better REPL:
> Better jline support, multi-line history, faster startup.

Indeed. Previously, on Windows, the REPL was a pain to use because if I
keep the left arrow pressed to move inside the line, I lost the caret.
Now, I can keep track where I am. Good move, now perhaps I will use the
REPL a bit more...

Informal request (I know, I shouldn't make it here...): it would be nice
if Ctrl+left/right arrow would work (moving by word/token).

:keybindings [1] shows that Ctrl+G does "move to the previous word", but
it does nothing. Other commands like Ctrl+A/E work. Ah, I see that
Ctrl+O has the same binding, and it works.

Ctrl+K (erase the current line) doesn't work (but Esc does that).
Ctrl+D inside a line acts like Del (delete char under caret).
Ctrl-? doesn't work for me, but on my French keyboard, I have to press
Shift to get a ?

Other thinks seems to work as advertized.

[1] OK, it states "Accuracy not guaranteed", but I thought I should
report them...

> * New REPL commands:
> :implicits, :keybindings, :javap

Cool. But:

cmd> C:\Languages\scala-2.9.0.RC1\bin\scala.bat


Welcome to Scala version 2.9.0.RC1 (Java HotSpot(TM) Client VM, Java

1.6.0_21).


Type in expressions to have them evaluated.
Type :help for more information.

scala> case class Person(name: String, age: Int)
defined class Person

scala> :javap
:javap [-lcsvp] [path1 path2 ...]

scala> :javap -l
java.lang.NullPointerException
at scala.tools.util.Javap.<init>(Javap.scala:40)
at scala.tools.nsc.interpreter.ILoop$javap$.<init>(ILoop.scala:306)
at scala.tools.nsc.interpreter.ILoop.javap(ILoop.scala:306)
at
scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$javapCommand(ILoop.scala:331)
at
scala.tools.nsc.interpreter.ILoop$$anonfun$9.apply(ILoop.scala:212)
at
scala.tools.nsc.interpreter.ILoop$$anonfun$9.apply(ILoop.scala:212)
at
scala.tools.nsc.interpreter.LoopCommands$LineArg.apply(LoopCommands.scala:29)
at
scala.tools.nsc.interpreter.LoopCommands$LineArg.apply(LoopCommands.scala:27)
at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:562)
at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:442)
at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:449)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:730)


at
scala.tools.nsc.MainGenericRunner$.runTarget$1(MainGenericRunner.scala:72)
at
scala.tools.nsc.MainGenericRunner$.process(MainGenericRunner.scala:85)
at
scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:33)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

The repl compiler has crashed spectacularly. Shall I replay your
session? I can re-run all lines except the last one.
[y/n]
Abandoning crashed session.

On cmd:
cmd> javap -l
No classes were specified on the command line. Try -help.

Same error if I type ":javap -l Person" in the REPL after having defined it.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Paul Phillips

unread,
Mar 27, 2011, 11:11:36 AM3/27/11
to scala-l...@googlegroups.com, Philippe Lhoste
On 3/27/11 6:25 AM, Philippe Lhoste wrote:
> scala> :javap
> :javap [-lcsvp] [path1 path2 ...]
>
> scala> :javap -l
> java.lang.NullPointerException

This of course is something windows. I'll take patches.

Roland Kuhn

unread,
Mar 27, 2011, 5:11:18 PM3/27/11
to scala-l...@googlegroups.com, Philippe Lhoste

Well, it also happens on Ubuntu Lucid:

Welcome to Scala version 2.9.0.RC1 (OpenJDK 64-Bit Server VM, Java 1.6.0_20).


Type in expressions to have them evaluated.
Type :help for more information.

scala> :javap -l


java.lang.NullPointerException
at scala.tools.util.Javap.<init>(Javap.scala:40)
at scala.tools.nsc.interpreter.ILoop$javap$.<init>(ILoop.scala:306)
at scala.tools.nsc.interpreter.ILoop.javap(ILoop.scala:306)
at scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$javapCommand(ILoop.scala:331)
at scala.tools.nsc.interpreter.ILoop$$anonfun$9.apply(ILoop.scala:212)
at scala.tools.nsc.interpreter.ILoop$$anonfun$9.apply(ILoop.scala:212)
at scala.tools.nsc.interpreter.LoopCommands$LineArg.apply(LoopCommands.scala:29)
at scala.tools.nsc.interpreter.LoopCommands$LineArg.apply(LoopCommands.scala:27)
at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:562)
at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:442)
at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:449)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:730)
at scala.tools.nsc.MainGenericRunner$.runTarget$1(MainGenericRunner.scala:72)
at scala.tools.nsc.MainGenericRunner$.process(MainGenericRunner.scala:85)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:33)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

The repl compiler has crashed spectacularly. Shall I replay your
session? I can re-run all lines except the last one.
[y/n]
Abandoning crashed session.

BTW: the same happens when giving actual arguments like class names.

Regards,

Roland

Paul Phillips

unread,
Mar 27, 2011, 5:16:23 PM3/27/11
to scala-l...@googlegroups.com, Roland Kuhn, Philippe Lhoste
On 3/27/11 2:11 PM, Roland Kuhn wrote:
> Well, it also happens on Ubuntu Lucid:

OK, maybe "everything but osx" is a better summary. I will say it is
77% likely that if the jdk tools.jar is on your classpath it will work
as is. (Let me know.) I already checked in a patch not to crash, but
that's as much as I can do for 2.9.

Roland Kuhn

unread,
Mar 27, 2011, 5:22:09 PM3/27/11
to scala-l...@googlegroups.com, Philippe Lhoste

"scala -cp /usr/lib/jvm/java-6-openjdk/lib/tools.jar" works. How well
can that be auto-detected? Hmm...

Regards,

Roland

Philippe Lhoste

unread,
Mar 27, 2011, 5:36:23 PM3/27/11
to scala-l...@googlegroups.com
On 27/03/2011 23:16, Paul Phillips wrote:
> OK, maybe "everything but osx" is a better summary. I will say it is 77%
> likely that if the jdk tools.jar is on your classpath it will work as
> is. (Let me know.) I already checked in a patch not to crash, but that's
> as much as I can do for 2.9.

Ah, I used the trick given by Roland:
C:\Languages\scala-2.9.0.RC1\bin\scala.bat -cp
C:\Java\jdk1.6.0_21\lib\tools.jar

:javap -l gives nothing
:javap -l Person gives the expected result.

So the suggestion is, perhaps, to "crash" in a less spectacular way if
the needed tool isn't in the classpath.

Paul Phillips

unread,
Mar 27, 2011, 6:09:48 PM3/27/11
to scala-l...@googlegroups.com, Philippe Lhoste
On 3/27/11 2:36 PM, Philippe Lhoste wrote:
> On 27/03/2011 23:16, Paul Phillips wrote:
>> OK, maybe "everything but osx" is a better summary. I will say it is 77%
>> likely that if the jdk tools.jar is on your classpath it will work as
>> is. (Let me know.) I already checked in a patch not to crash, but that's
>> as much as I can do for 2.9.
>
> So the suggestion is, perhaps, to "crash" in a less spectacular way if
> the needed tool isn't in the classpath.

I thought my 4-liners were the easy ones.

Alex Kravets

unread,
Mar 28, 2011, 7:55:20 PM3/28/11
to scala-l...@googlegroups.com

I would like to raise a small but persistently taxing annoyance that should be easily addressable before 2.9.0 final ships.

Observe http://www.scala-lang.org/api/rc/index.html , notice that all the packages are unfolded by default. 
I find myself having to click to re-collapse the package list before proceeding to navigate to intended destination.  Anecdotally, other heavy users of Scaladoc at my company and a few on this list would second my complaint.

Question.  Is it possible to have the package list collapsed by default ?


Thanx for the great release candidate !
 


   * Better REPL:
     Better jline support, multi-line history, faster startup.

   * New REPL commands:
     :implicits, :keybindings, :javap

   * New packages:
     scala.sys and scala.sys.process which are imported from
     sbt.Proces

   * New trait:
     App, a safer and more performant alternative to Application.
     It now allows to access command line arguments. It relies
     on another new trait, DelayedInit, which lets one capture
     class initialization code in a closure.

   * New methods in collections:
     collectFirst, maxBy, minBy, span, inits, tails,
     permutations, combinations, subsets

   * Annotation @strictfp is now supported.

   * A large number of bugfixes and performance improvements.



--
Alex Kravets       def redPill = 'Scala
[[ brutal honesty is the best policy ]]

Daniel Sobral

unread,
Mar 29, 2011, 10:05:35 AM3/29/11
to scala-l...@googlegroups.com, Alex Kravets
Actually, that bugged me until I started typing in whatever I was after. Once I started using explicit search, it ceased to bother me, and I started to get annoyed at JavaDoc for making be browse the package/class list to find things.
--
Daniel C. Sobral

I travel to the future all the time.

Philippe Lhoste

unread,
Mar 29, 2011, 10:46:51 AM3/29/11
to scala-l...@googlegroups.com
On 29/03/2011 16:05, Daniel Sobral wrote:
> I started to get annoyed at JavaDoc for
> making be browse the package/class list to find things.

I am not, because way before discovering ScalaDoc, I am a happy user of the Javadoc
Incremental Search User Script
<http://www.teria.com/~koseki/tools/gm/javadoc_isearch/index.html> for Greasemonkey. Works
on an JavaDoc, even those generated for third party libraries.

Gábor Bakos

unread,
Mar 29, 2011, 3:53:25 PM3/29/11
to scala-l...@googlegroups.com, scala-a...@googlegroups.com
Hi,

   Just a side note. It looks the scala MSIL target is not supported by this build (see transcript below). I know I do not have to worry, as the .NET corner gives signs of really cool work there. So please do not take this as a complaint about the progress, but a little bit of communication would not hurt (I do not remember any announcements around the change to Jenkins that the msil target has been no longer built, and I do not see mentioning these kind of changes in this announcement either).
Kind regards, gabor

I:\tmp\scala-2.9.0.RC1>bin\sbaz.bat install scala-msil
planning to install: scala-msil/2.8.1.RC4
Installing...
Downloading: http://www.scala-lang.org/downloads/packages/scala-msil-2.8.1.RC4.s
bp
1,49M/1,49M Done

I:\tmp\scala-2.9.0.RC1>bin\scalac-net.bat X.scala
error: java.lang.Error: typeConstructor inapplicable for <none>
        at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:35)
        at scala.tools.nsc.symtab.Symbols$Symbol.typeConstructor(Symbols.scala:8
74)
        at scala.tools.nsc.symtab.Definitions$definitions$.scala$tools$nsc$symta
b$Definitions$definitions$$booltype(Definitions.scala:157)
        at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scal
a:798)
        at scala.tools.nsc.Global$Run.<init>(Global.scala:680)
        at scala.tools.nsc.Main$.process(Main.scala:105)
        at scala.tools.nsc.Main$.main(Main.scala:123)
        at scala.tools.nsc.Main.main(Main.scala)

Exception in thread "main" java.lang.Error: typeConstructor inapplicable for <no
ne>
        at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:35)
        at scala.tools.nsc.symtab.Symbols$Symbol.typeConstructor(Symbols.scala:8
74)
        at scala.tools.nsc.symtab.Definitions$definitions$.scala$tools$nsc$symta
b$Definitions$definitions$$booltype(Definitions.scala:157)
        at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scal
a:798)
        at scala.tools.nsc.Global$Run.<init>(Global.scala:680)
        at scala.tools.nsc.Main$.process(Main.scala:105)
        at scala.tools.nsc.Main$.main(Main.scala:123)
        at scala.tools.nsc.Main.main(Main.scala)

I:\tmp\scala-2.9.0.RC1>bin\scalac.bat X.scala

I:\tmp\scala-2.9.0.RC1>type X.scala
object X {
        def main(args: Array[String]) {
                println("Hello world")
        }
}

Lukas Rytz

unread,
Mar 30, 2011, 11:18:42 AM3/30/11
to scala-l...@googlegroups.com
Hi Gábor,

As you correctly observed, Scala.NET is indeed active and Miguel is putting a lot of
work into it. One main goal of the recent work is to bootstrap the compiler, i.e. to compile
the Scala library and Scala compiler to .NET assemblies.

The previously "released" version of Scala.NET was a cross-compiler which had a few
built-in hard-coded mappings from Java to .NET libraries (e.g. methods on java.lang.String
were mapped to equivalent calls on System.String). Using this compiler we "released" a
dll-scala-library, which in fact contained a subset of the real Scala library. This subset is

However, for performing the bootstrap, this approach was unmanageable: First, there are
too many references to Java libraries inside the Scala library and compiler. Creating and
maintaing a branch with these dependencies re-written to .NET libraries is nearly impossible.
Second, the hard-coded mappings in the compiler are also too inflexible.

Therefore Miguel started a different route, with success. He will certainly report about it soon.
The solution involves using the IKVM library.

The above-mentioned branch of the scala library became unmaintained a few months ago,
because there were bugs in the cross-compiler preventing it from building, and we focussed
on the new approach instead.

The consequence is that in the beginning, there will not be a scala-library.dll which is independent
of IKVM's classpath.dll. However, the above-mentioned branch can be revived at any point
if there is interest in the community.

Lukas



2011/3/29 Gábor Bakos <abor...@gmail.com>
Reply all
Reply to author
Forward
0 new messages