This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Why does ScalaObject exist?

3 replies
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Hi!

The question has been asked a few times already (I even asked it myself here http://stackoverflow.com/questions/3795404/why-does-scalaobject-exist) and it has been coming up in my mind after seeing what some optimizations to the "implements" part of class files have done to the class file size.

Is there any reason left why we still make many classes implicitly implement that type?
Checking if something implements ScalaObject has never been a reliable check if something is a Scala class and I can't imagine another usage after the $tag stuff was removed before 2.8.

After reading the compiler sources a bit it seems that it is not really a "core part" of anything.

Would it make sense to stop implementing it implicitly, even if it would just save a few bytes per class file?

Thanks and bye,


Simon
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Why does ScalaObject exist?


On Mon, Jan 9, 2012 at 5:32 PM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
Would it make sense to stop implementing it implicitly, even if it would just save a few bytes per class file?

It doesn't do anything at the moment, but I can imagine eventualities where we'd be glad to have it.  If we removed it, it would be difficult or impossible to put it back, so as long as it's there it's insurance.  If someone attempts to quantify what said insurance is costing us, we could then make an informed decision about whether to keep it or to switch to geico.  In the absence of such quantification, I side with status quo.
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Why does ScalaObject exist?
Right. I'll have a look at it after I finished my Java dependency stuff.

Is there any interest in publishing it here? Or at least translating the key findings into English?
Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Why does ScalaObject exist?
I'd be interested what the cost is.  I assume it should be minimal.

On Tue, Jan 10, 2012 at 1:33 PM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
Right. I'll have a look at it after I finished my Java dependency stuff.

Is there any interest in publishing it here? Or at least translating the key findings into English?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland