Paul Phillips | 1 Jun 02:39 2010

Re: help with very simple compiler transformation

On Mon, May 31, 2010 at 03:23:52PM -0700, Nicholas Tung wrote:
> Thanks very much. I have another question -- how can I follow a
> TypeRef to get an annotation? Here's some example code:
> type Int5 = Int  <at>  Range(-32 to 31)
> val x = (fcn() : Int5)

Do you have reason to believe this can work? I'll be surprised.  It'd be 
neat if so.  I don't think type aliases are sufficiently first class 
that you can annotate them and distinguish between the annotated alias 
and the underlying type.

Here's a little repl session in my current repl, which I can't resist to 
demo the stuff I've been adding.  Not sure what if anything this will 
tell you -- I know little about the annotations implementation.  But it 
seems to support my suspicion since I only see the annotation at all if 
I normalize.

scala> class Range(x: scala.Range) extends scala.StaticAnnotation
defined class Range

scala> type Int5 = Int  <at>  Range(-32 to 31)                        
defined type alias Int5

scala> :type Int5                                                
tpe7: global.Type = Int5

scala> tpe7.normalize
res10: global.Type = Int

scala> repl.allPhases( tpe7.normalize.annotations)
(Continue reading)

Nicholas Tung | 1 Jun 04:00 2010

Re: help with very simple compiler transformation

Thanks so much, normalize works great!!!

I'm not sure why the annotations are not showing up for you... I see them
after the typer. I'm running Scala 2.8.0 RC2 from Maven; the primary files
in my project are here (plugin, file, and library defining  <at> Range):

http://github.com/gatoatigrado/skalch/blob/564b7e6b97305e62faeee69a321cdd1faabdf1d3/plugin/src/main/scala/skalch/plugins/SketchRewriter.scala

http://github.com/gatoatigrado/skalch/blob/564b7e6b97305e62faeee69a321cdd1faabdf1d3/base/src/test/scala/angelic/simple/SugaredTest.scala

http://github.com/gatoatigrado/skalch/blob/564b7e6b97305e62faeee69a321cdd1faabdf1d3/base/src/main/scala/skalch/AngelicSketch.scala

regards,
Nicholas — ntung at ntung —  https://ntung.com — CS major  <at>  UC Berkeley

On Mon, May 31, 2010 at 5:39 PM, Paul Phillips <paulp@...> wrote:
> On Mon, May 31, 2010 at 03:23:52PM -0700, Nicholas Tung wrote:
>> Thanks very much. I have another question -- how can I follow a
>> TypeRef to get an annotation? Here's some example code:
>> type Int5 = Int  <at>  Range(-32 to 31)
>> val x = (fcn() : Int5)
>
> Do you have reason to believe this can work? I'll be surprised.  It'd be
> neat if so.  I don't think type aliases are sufficiently first class
> that you can annotate them and distinguish between the annotated alias
> and the underlying type.
>
> Here's a little repl session in my current repl, which I can't resist to
> demo the stuff I've been adding.  Not sure what if anything this will
> tell you -- I know little about the annotations implementation.  But it
(Continue reading)

Paul Phillips | 1 Jun 04:31 2010

Re: help with very simple compiler transformation

On Mon, May 31, 2010 at 07:00:37PM -0700, Nicholas Tung wrote:
> I'm not sure why the annotations are not showing up for you... I see 
> them after the typer. I'm running Scala 2.8.0 RC2 from Maven; the 
> primary files in my project are here (plugin, file, and library 
> defining  <at> Range):

I'm going to guess it's because I defined the annotation in the repl.  
I've recently found myself unable to recover the scala sig annotation in 
repl defined classes so maybe this is serendipitously pointing me in the 
right general direction for fixing that.

--

-- 
Paul Phillips      | We must respect the other fellow's religion, but only
In Theory          | in the sense and to the extent that we respect his
Empiricist         | theory that his wife is beautiful and his children smart. 
up hill, pi pals!  |     -- H. L. Mencken

Lukas Rytz | 2 Jun 15:18 2010
Picon
Picon

msiltest

Hi Miguel,


i added a tool for running parts of our test suite on the cross-compiler. If you update the msil
branch you'll find it in "test/msiltest". It can run "pos", "neg" and "run" tests.

Please let me know if running the tool works for you. it runs only on linux / mac. Maybe also
in cygwin.


Cheers: Lukas




lamppc11:msil luc$ test/msiltest --help
msiltest [--help] [--testdir path] [--scalaccmd file] [--ilasmcmd file] [--monocmd file] [--monopath path] [--diffcmd file] [--debug] [--show-log] [--show-diff] [--pos] [--neg] [--run] [--all] [testfiles]



lamppc11:msil luc$ test/msiltest test/files/pos/bug262.scala 
running 1 tests with settings

--diffcmd diff
--monocmd mono
--scalaccmd /Users/luc/scala/msil/test/../build/msil-pack/bin/scalac-net
--monopath /Users/luc/scala/msil/test/../build/msil-pack/lib
--ilasmcmd ilasm
--testdir /Users/luc/scala/msil/test

test files: test/files/pos/bug262.scala

test/files/pos/bug262.scala                                                    [  OK  ]
all tests passed.



lamppc11:msil luc$ test/msiltest test/files/run/absoverride.scala --debug
running 1 tests with settings

--diffcmd diff
--debug
--testdir /Users/luc/scala/msil/test
--monocmd mono
--scalaccmd /Users/luc/scala/msil/test/../build/msil-pack/bin/scalac-net
--monopath /Users/luc/scala/msil/test/../build/msil-pack/lib
--ilasmcmd ilasm

test files: test/files/run/absoverride.scala

[msiltest] [debug:compile] /Users/luc/scala/msil/test/../build/msil-pack/bin/scalac-net  -d /Users/luc/scala/msil/test/msiltest.out absoverride.scala
[msiltest] [debug:ilasm] ilasm /exe /output:test.exe /Users/luc/scala/msil/test/msiltest.out/absoverride.msil /Users/luc/scala/msil/test/msiltest.out/Test.msil
[msiltest] [debug:execute] mono test.exe msil
[msiltest] [debug:diff] diff /Users/luc/scala/msil/test/files/run/absoverride-msil.check /Users/luc/scala/msil/test/files/run/absoverride.log
test/files/run/absoverride.scala                                               [  OK  ]
all tests passed.




lamppc11:msil luc$ test/msiltest test/files/pos/bug287.scala --show-log
running 1 tests with settings

--ilasmcmd ilasm
--testdir /Users/luc/scala/msil/test
--scalaccmd /Users/luc/scala/msil/test/../build/msil-pack/bin/scalac-net
--show-log
--monocmd mono
--diffcmd diff
--monopath /Users/luc/scala/msil/test/../build/msil-pack/lib

test files: test/files/pos/bug287.scala

bug287.scala:2: error: not found: value java
  class mystream extends java.io.BufferedOutputStream(new java.io.FileOutputStream("/dev/null")) {
                         ^
bug287.scala:2: error: too many arguments for constructor Object: ()System.Object
  class mystream extends java.io.BufferedOutputStream(new java.io.FileOutputStream("/dev/null")) {
                 ^
bug287.scala:7: error: value write is not a member of AnyRef with ScalaObject
      super.write( foo ); // error
            ^
bug287.scala:9: error: value write is not a member of AnyRef with ScalaObject
      super.write( foo, 0, foo.length ); // this works however
            ^
four errors found
test/files/pos/bug287.scala                                                    [FAILED]
1 out of 1 tests failed.



Lukas Rytz | 2 Jun 16:14 2010
Antonio Cunei | 2 Jun 16:23 2010
Picon
Picon

Scala IDE for Eclipse

The code of the Scala IDE for Eclipse has been removed from the EPFL SVN 
repository and from our build process as of r22136. New developments of the 
plugin, as well as all previous history, can be found via:

   http://scala-ide.assembla.com/code/scala-ide/git/nodes

Links to the last version of the codebase hosted by EPFL will still be 
available at:

   http://lampsvn.epfl.ch/trac/scala/wiki/obsoleteSVNstuff

New releases of the IDE will be made available via the www.scala-ide.org 
website only. Please refer to the email sent by Miles to scala-user and 
scala-tools for further details.

Toni

Antonio Cunei | 2 Jun 20:58 2010
Picon
Picon

Scala Meeting report, 2010-06-01

We are currently publishing a summary of each of the weekly meetings of the 
Scala Core Team.

This information is made available as a service to the community. It is by 
necessity rather brief and gives only a rough approximation of the main 
points of discussions explored during each meeting; it should not be taken 
as a source of reliable information, nor as a record of concrete or firm 
decisions, nor as anything other than a record of a simple discussion.

The summary that follows is primarily intended for Scala contributors and 
maintainers. If you are not a contributor to the Scala system, the 
information below is unlikely to be very useful to you, and you might lack 
some of the necessary background to make sense of all the discussion items.

We do not have enough people on the team to be able to write a more 
complete record, and we might also not have the resources to discuss every 
point in detail afterwards. Nevertheless, we hope that this record, cursory 
as it is, is better than nothing.

------------------------------------------------------------------------------

Scala Meeting 2010-06-01

People attending the meeting: Phil, Hubert, Gilles, Alex, Ingo, Lukas, 
Philipp, Miguel, Toni.

* Current work
   - work on a .Net compatible version based on the IKVM port of the JDK
   - general bug fixing

* 2.8.0
   - JSON: patch for ticket #3248 involves an API change. Should it go in 
now? No, we will wait until after the final.
   - Disabled test for #1254 is still failing; we will look into that 
before the final.
   - Commits to trunk will no longer automatically be included in the 
final; only commits explicitly propagated to the 2.8.x branch will appear.
   - We have a few new tickets that may possibly be critical, but for the 
most part we should be OK. We will check the status again next week.

* Eclipse Tickets
   - The component "Eclipse Plugin" has been removed from Trac. If anyone 
files Eclipse plugin tickets on our Trac by mistake, the ticket should now 
be closed, asking them to re-file it on the new Scala IDE for Eclipse bug 
tracker. We will add a notice on the Trac Wiki.

martin odersky | 2 Jun 22:28 2010
Picon
Picon

source.fromFile missing

When trying to adapt an example of the Artima book for a course I found that

  source.fromFile(name)

no longer works. It has to be source.fromPath. I am OK with the change, but we need to keep & deprecate the old usage. It's used in several places in the Artima book and probably in other books as well. I think that's actually a breaking problem for RC3, so we need to do the change in both trunk and 2.8. Paul, do you agree? And, if yes, can you make the change and check it into trunk and 2.8?

Thanks

 -- Martin

Paul Phillips | 3 Jun 01:29 2010

Re: source.fromFile missing

On Wed, Jun 02, 2010 at 10:28:21PM +0200, martin odersky wrote:
> When trying to adapt an example of the Artima book for a course I found that
> 
>   source.fromFile(name)
> 
> no longer works. It has to be source.fromPath. I am OK with the 
> change, but we need to keep & deprecate the old usage.

Yeah... I would be all for that, except it's not possible, which is how 
it got changed in the first place.  You can't overload in the presence 
of default arguments, and my whole brilliant idea for making encodings 
work right and stay in the background was to use implicit defaults, 
which is what you'll see on all those factory methods.

So the only way to put fromFile back is to unroll the whole thing.  And 
for sure the IO code is in a pitiful state, since I was writing that 
code with a bigger picture in mind.  I don't even know what works and 
what doesn't, I avoid scala.io.* entirely.

Let me know how you'd like me to resolve it.  As far as I'm concerned we 
can roll scala.io.* back to 2.7.7 and I'll make the minimum changes to 
make it compile.  No more arrested development for me.

--

-- 
Paul Phillips      | The most dangerous man to any government is the man who
Vivid              | is able to think things out [...] Almost inevitably he
Empiricist         | comes to the conclusion that the government he lives under
pull his pi pal!   | is dishonest, insane, intolerable.   -- H. L. Mencken

Paul Phillips | 3 Jun 02:36 2010

Re: source.fromFile missing

It occurs to me that maybe I can make everything work out by way of 
LowPriorityImplicits or an equivalent.  When I wrote all that stuff 
there was no other way to supply a default implicit, but now that we 
have some blunt instruments for designating "the implicit of last 
resort" then I believe I could accomplish the same thing that way.

--

-- 
Paul Phillips      | We must respect the other fellow's religion, but only
Protagonist        | in the sense and to the extent that we respect his
Empiricist         | theory that his wife is beautiful and his children smart. 
up hill, pi pals!  |     -- H. L. Mencken


Gmane