- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why does ScalaObject exist?
Tue, 2012-01-10, 02:32
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
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
Tue, 2012-01-10, 19:41
#2
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?
Is there any interest in publishing it here? Or at least translating the key findings into English?
Tue, 2012-01-10, 19:51
#3
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.ochsenreither@googlemail.com> wrote:
On Tue, Jan 10, 2012 at 1:33 PM, Simon Ochsenreither <simon.ochsenreither@googlemail.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?
On Mon, Jan 9, 2012 at 5:32 PM, Simon Ochsenreither <simon.ochsenreither@googlemail.com> wrote:
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.