Picon
Gravatar

Re: Scala Meeting Reports

On 31 January 2012 23:32, Lars Hupel <hupel-xrfDFxQfymSzQB+pC5nmwQ@public.gmane.org> wrote:
I was wondering why there were no summaries of the Scala meetings since
November last year. Is there any specific reason or did I miss something?

Hi Lars,

Thanks for reminder! I think we just forgot to publish them as everyone was pretty busy in December and January. I'll ping people at LAMP.

--
Grzegorz Kossakowski

Eugene Burmako | 1 Feb 13:00
Picon
Picon
Favicon
Gravatar

AbstractFileClassLoader does not support getPackage

Subj. always returns null, even on valid package names (e.g. when I try to load one of the $lineXXX packages defined by REPL). Shall I submit a bug?
Picon
Gravatar

Fix to fjbg, do I need to replace starr?

Hi,


I have a bug-fix that touches src/fjbg. I'm wondering what I should do once I implement my fix? Should I rebuild a whole new starr so those changes are propagated to lib/fjbg.jar file?

I was thinking about just rebuilding fjbg.jar using 'libs.fjbgpack' target and copying it manually to lib directory. My change is binary compatible so I don't think it would cause any problems. Thoughts?

--
Grzegorz Kossakowski

Eugene Burmako | 1 Feb 16:28
Picon
Picon
Favicon
Gravatar

Classes that have names starting from dollars

...ask for troubles.

Say, we've got a class $line5.$read$$iw$$iw$ (generated by REPL) that
corresponds to the innermost $iw from:

package $line5

object $read {
  object $iw {
    object $iw {
      ...
    }
}

Enclosing class for this class is $line5.$read$$iw$ (which is
correct), so we'd expect getSimpleName to return $iw$. However, what
really gets returned is iw$, because Java strips all leading dollars
and numbers from the simple name.

A sad consequence of that is that stuff that relies on getSimpleName
will not work (currently, this affects reflection, but I'm going to
change that, so it's not that big of a deal).

Bottom line of this post is that getSimpleName will work incorrectly
if class/object name intentionally starts with $. Is this something
we're fine with?

Paul Phillips | 1 Feb 16:30

Re: Fix to fjbg, do I need to replace starr?

On Wed, Feb 1, 2012 at 5:44 AM, Grzegorz Kossakowski
<grzegorz.kossakowski@...> wrote:
> I have a bug-fix that touches src/fjbg. I'm wondering what I should do once
> I implement my fix? Should I rebuild a whole new starr so those changes are
> propagated to lib/fjbg.jar file?
>
> I was thinking about just rebuilding fjbg.jar using 'libs.fjbgpack' target
> and copying it manually to lib directory. My change is binary compatible so
> I don't think it would cause any problems. Thoughts?

All you need to do is replace fjbg.jar with your updated one, and then
run ./push-binary-libs.sh (with arguments of username and password
which allow you to push to artifactory - jsuereth can give you those
if you don't have them.) After that you will notice the
fjbg.sha1.desired file has been updated, at which point you can check
that in, and once it is merged into trunk future people will pull the
new fjbg.jar.

Those future people will have to run pull-binary-libs.sh manually to
get the update (or maybe it works automatically if you use sbt, but
I'm still on ant, where it will notice a change to scala-compiler.jar
and pull new libs, but not to anything else because it is comically
challenging to write a conditional like if "a or b or c" in antese.)

Picon
Gravatar

Re: Classes that have names starting from dollars

On 1 February 2012 16:28, Eugene Burmako <eugene.burmako <at> epfl.ch> wrote:
...ask for troubles.

Say, we've got a class $line5.$read$$iw$$iw$ (generated by REPL) that
corresponds to the innermost $iw from:

package $line5

object $read {
 object $iw {
   object $iw {
     ...
   }
}

Enclosing class for this class is $line5.$read$$iw$ (which is
correct), so we'd expect getSimpleName to return $iw$. However, what
really gets returned is iw$, because Java strips all leading dollars
and numbers from the simple name.

A sad consequence of that is that stuff that relies on getSimpleName
will not work (currently, this affects reflection, but I'm going to
change that, so it's not that big of a deal).

Bottom line of this post is that getSimpleName will work incorrectly
if class/object name intentionally starts with $. Is this something
we're fine with?

Isn't it that we are going to have Scala reflection just to be able to avoid calls to getSimpleName? Corresponding method in Scala reflection should work, always, right?

--
Grzegorz Kossakowski

Paul Phillips | 1 Feb 16:37

Re: Classes that have names starting from dollars

On Wed, Feb 1, 2012 at 7:28 AM, Eugene Burmako <eugene.burmako@...> wrote:
> Bottom line of this post is that getSimpleName will work incorrectly
> if class/object name intentionally starts with $. Is this something
> we're fine with?

We're not fine with any of it.  We should not settle for anything
short of 100% compatibility with java reflection, by which I mean:
your program should not ever explode just because you called some
method on Class or Method.

But I don't think we can get there unless we reserve something beyond
$ for internal use.  I would dearly like to do this.  It will only get
more difficult from here.  You can't imagine how many semantic
collisions we are amassing *internally* due to the use of the '$' for
every form of name encoding under the sun.  That's before one adds the
constraint that we have to comply with java's hardcoded internal
implementation of getSimpleName, inner classes, anonymous classes, and
on and on.

See also:

  https://issues.scala-lang.org/browse/SI-2806
  "Name mangling has outstripped the abilities of lonesome '$$'"

  https://issues.scala-lang.org/browse/SI-4316
  "name mangling vs. java reflection"

Also take a moment to laugh/cry about "lonesome '$$'", not so lonesome
since the entire database was mangled.  Imagine it to be infinitely
more lonesome and you get the original description.

Picon
Gravatar

Re: Fix to fjbg, do I need to replace starr?

On 1 February 2012 16:30, Paul Phillips <paulp-v5eHc9rg9U0h9ZMKESR00Q@public.gmane.org> wrote:
On Wed, Feb 1, 2012 at 5:44 AM, Grzegorz Kossakowski
<grzegorz.kossakowski <at> gmail.com> wrote:
> I have a bug-fix that touches src/fjbg. I'm wondering what I should do once
> I implement my fix? Should I rebuild a whole new starr so those changes are
> propagated to lib/fjbg.jar file?
>
> I was thinking about just rebuilding fjbg.jar using 'libs.fjbgpack' target
> and copying it manually to lib directory. My change is binary compatible so
> I don't think it would cause any problems. Thoughts?

All you need to do is replace fjbg.jar with your updated one, and then
run ./push-binary-libs.sh (with arguments of username and password
which allow you to push to artifactory - jsuereth can give you those
if you don't have them.) After that you will notice the
fjbg.sha1.desired file has been updated, at which point you can check
that in, and once it is merged into trunk future people will pull the
new fjbg.jar.

Those future people will have to run pull-binary-libs.sh manually to
get the update (or maybe it works automatically if you use sbt, but
I'm still on ant, where it will notice a change to scala-compiler.jar
and pull new libs, but not to anything else because it is comically
challenging to write a conditional like if "a or b or c" in antese.)

Thanks. A pull request will follow shortly.

Regarding the fact that people might not have updated fjbg.jar file. It's not a terrible situation because it's going to only affect those that use -Yvirtpatmat and happen to have pattern exactly like this:

(x: Int) match {
  case _ => ... 
}

(with no other cases defined)

You can see we I don't need to worry about it too much.

--
Grzegorz Kossakowski

Martin Odersky | 1 Feb 17:22
Picon

Re: Classes that have names starting from dollars



Sent from my phone


On Feb 1, 2012, at 16:36, Grzegorz Kossakowski <grzegorz.kossakowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

On 1 February 2012 16:28, Eugene Burmako <eugene.burmako-p8DiymsW2f8@public.gmane.org> wrote:
...ask for troubles.

Say, we've got a class $line5.$read$$iw$$iw$ (generated by REPL) that
corresponds to the innermost $iw from:

package $line5

object $read {
 object $iw {
   object $iw {
     ...
   }
}

Enclosing class for this class is $line5.$read$$iw$ (which is
correct), so we'd expect getSimpleName to return $iw$. However, what
really gets returned is iw$, because Java strips all leading dollars
and numbers from the simple name.

A sad consequence of that is that stuff that relies on getSimpleName
will not work (currently, this affects reflection, but I'm going to
change that, so it's not that big of a deal).

Bottom line of this post is that getSimpleName will work incorrectly
if class/object name intentionally starts with $. Is this something
we're fine with?

Isn't it that we are going to have Scala reflection just to be able to avoid calls to getSimpleName? Corresponding method in Scala reflection should work, always, right?

--
That should be the aim. It would be nice if all firms of Java reflection worked as well on.all kind is Scala Dara including synthesized ones. But failing that we should at least make sure that Scala reflection is bullet proof.

  Martin

Grzegorz Kossakowski

Eugene Burmako | 1 Feb 17:25
Picon
Picon
Favicon
Gravatar

Re: Classes that have names starting from dollars

Speaking of bullet-proofness, this is what I'm implementing right now - no worries :)

On 1 February 2012 17:22, Martin Odersky <odersky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


Sent from my phone


On Feb 1, 2012, at 16:36, Grzegorz Kossakowski <grzegorz.kossakowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

On 1 February 2012 16:28, Eugene Burmako <eugene.burmako-p8DiymsW2f8@public.gmane.org> wrote:
...ask for troubles.

Say, we've got a class $line5.$read$$iw$$iw$ (generated by REPL) that
corresponds to the innermost $iw from:

package $line5

object $read {
 object $iw {
   object $iw {
     ...
   }
}

Enclosing class for this class is $line5.$read$$iw$ (which is
correct), so we'd expect getSimpleName to return $iw$. However, what
really gets returned is iw$, because Java strips all leading dollars
and numbers from the simple name.

A sad consequence of that is that stuff that relies on getSimpleName
will not work (currently, this affects reflection, but I'm going to
change that, so it's not that big of a deal).

Bottom line of this post is that getSimpleName will work incorrectly
if class/object name intentionally starts with $. Is this something
we're fine with?

Isn't it that we are going to have Scala reflection just to be able to avoid calls to getSimpleName? Corresponding method in Scala reflection should work, always, right?

--
That should be the aim. It would be nice if all firms of Java reflection worked as well on.all kind is Scala Dara including synthesized ones. But failing that we should at least make sure that Scala reflection is bullet proof.

  Martin

Grzegorz Kossakowski



Gmane