Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate status of scala.mobile #4505

Closed
scabug opened this issue Apr 22, 2011 · 7 comments
Closed

Investigate status of scala.mobile #4505

scabug opened this issue Apr 22, 2011 · 7 comments
Assignees

Comments

@scabug
Copy link

scabug commented Apr 22, 2011

= problem =
scala.mobile seems to be of little use, considering all the boxing/implicit/type/... magic happening in the compiler.

In fact when investigating, I couldn't find a single example of how to use it with the Scala library ... without getting ("java.lang.RuntimeException: class <something> has no public constructor")

There seems to be no way to actually instantiate a "Location" properly and the way to get the "standard constructor" seems seriously broken (cs(0).newInstance("") ... since when do we expect that classes have a constructor taking a String? Expecting them to have a empty standard constructor, yes, but ""?)

= analysis =
This code is seriously broken.

Considering there are actually no tests which could help figuring out what is supposed to work and what is not and classes which need related functionality like scala.testing.Show don't even use it at all and roll their own invocation scheme instead, there just be serious thoughts about how long scala.mobile should still be living.

(The name is also pretty bad ... I can't see how anyone will first expect some JavaME/handset related functionality in it ...)

Actually every use cases in the documentation refers to some non-existing jar file, which makes it impossible to actually understand what the use cases are about.

= enhancement recommendation =
Figure out what this classes are supposed to do, document it and write tests for it ... if that doesn't work, maybe deprecate and remove it?

I just checked Google and I found not a single case of code using this class or even a question about it.

@scabug
Copy link
Author

scabug commented Apr 22, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4505?orig=1
Reporter: @soc

@scabug
Copy link
Author

scabug commented Apr 22, 2011

@soc said:
OK, it seems that quite some parts have outdated assumptions, like this part:

// source 'class A { ... }' becomes in bytecode: interface A.class + class A$$class.class
// source 'object A { ... }' becomes in bytecode: interface A.class + class A$$.class
val append = if (loader.loadClass(className).isInterface) "$$class" else "$$"

When did Scala actually change the classname mangling? It is certainly before I started looking at Scala during 2.7.x.

This code obviously hasn't worked since a long time, isn't used anywhere and mainly just throws exceptions.

Maybe this is a candidate for a "quick delete"?
Even Java did that once with some constructor which used a private class and therefore wasn't usable for any user code at all.

@scabug
Copy link
Author

scabug commented Apr 24, 2011

Trond Olsen (tolsen77) said:
There's an example in trunk under \docs\examples\mobile\sort.scala. Couldn't find any other references to mobile.

@scabug
Copy link
Author

scabug commented Apr 24, 2011

@soc said:
It's the same example as in the ScalaDoc. The problem is that the example is purely imaginative. There exists no "http://scala.epfl.ch/classes/examples.jar" and I don't really believe it ever existed.

@scabug
Copy link
Author

scabug commented Apr 26, 2011

@magarciaEPFL said:
Asking the author of scala.mobile for comments, http://lamp.epfl.ch/~michelou/

@scabug
Copy link
Author

scabug commented May 1, 2011

@soc said:
Fixed in r24850.

@scabug
Copy link
Author

scabug commented May 2, 2011

@SethTisue said:
to add code is human, to remove code, divine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants