Opinions?
Thanks,
Simon
- Can we come up with a solution for ClassTags and friends? Even if reflection as a whole is still experimental/might be obsoleted by scala.meta, I think it should be possible to at least declare the small part of *Tags as "supported", so that we can stop dragging *Manifests around.
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- We are using exceptions for control flow in TraversableLike for core collection methods like isEmpty, forall, exists, takeWhile, copyToArray, etc. Additionally, we are creating a lot of superfluous classes here:
def head: A = {
var result: () => A = () => throw new NoSuchElementException
breakable {
for (x <- this) {
result = () => x
break
}
}
result()
}
Maybe I'm missing something, but I think we could get rid of most of this stuff.
- The signature of the withDefault* methods is an issue. Basically, it just creates a wrapper around the original Map, which isn't an issue if the underlying Map doesn't provide a larger API. Especially with concurrent.TrieMap, this is not great, because if you want to have defaults, you can't access TrieMap's API anymore (which was likely the case why one wanted to use TrieMap in the first place).
- Also, it seems like TrieMap is exposing a lot of methods which are neither documented nor look like they should be public at all, like @volatile var root = r, def CAS_ROOT(ov: AnyRef, nv: AnyRef), def RDCSS_READ_ROOT(abort: Boolean = false).
- We should really look into getting rid of those "default" implementations in scala.collection/scala.collection.generic which can't be right for both mutable and immutable collections.
- We should start thinking about a better name for scala.collection.immutable.Stream, especially in the light of all the other existing and upcoming things named Stream, which do something completely different. Just a few weeks ago, a group I was working with fell into a huge performance trap (using Stream[Char] for parsing) due to the misleading naming.
- Imho, it would make sense to have some option for scaladoc to fail if a public method/class lacks documentation.
- We are using exceptions for control flow in TraversableLike for core collection methods like isEmpty, forall, exists, takeWhile, copyToArray, etc. Additionally, we are creating a lot of superfluous classes here:
def head: A = {
var result: () => A = () => throw new NoSuchElementException
breakable {
for (x <- this) {
result = () => x
break
}
}
result()
}
Maybe I'm missing something, but I think we could get rid of most of this stuff.
- The signature of the withDefault* methods is an issue. Basically, it just creates a wrapper around the original Map, which isn't an issue if the underlying Map doesn't provide a larger API. Especially with concurrent.TrieMap, this is not great, because if you want to have defaults, you can't access TrieMap's API anymore (which was likely the case why one wanted to use TrieMap in the first place).
- Also, it seems like TrieMap is exposing a lot of methods which are neither documented nor look like they should be public at all, like @volatile var root = r, def CAS_ROOT(ov: AnyRef, nv: AnyRef), def RDCSS_READ_ROOT(abort: Boolean = false).
- We should really look into getting rid of those "default" implementations in scala.collection/scala.collection.generic which can't be right for both mutable and immutable collections.
- We should start thinking about a better name for scala.collection.immutable.Stream, especially in the light of all the other existing and upcoming things named Stream, which do something completely different. Just a few weeks ago, a group I was working with fell into a huge performance trap (using Stream[Char] for parsing) due to the misleading naming.
- Imho, it would make sense to have some option for scaladoc to fail if a public method/class lacks documentation.
Ugh. This is a tough one because Scala has had Stream for a long time. But with Akka streams and Java Stream (which mean two different things), and various other "stream" ideas, the name is overused. Do you have any ideas for a better name? LazyList is accurate but rather inelegant. "Creek" is a synonym for "Stream", but I doubt that would help anyone's comprehension (though we might induce people to name things "paddle" while traversing their Creek).
I *strongly* prefer LazyList over MemoizingList. While we are at it can we just deprecate Stream and implement LazyList with a lazy head. Last time I checked, it was a generally accepted flaw with current Stream that only the tail is lazy.
--
While reviewing the code base for Scala 2.12, I found a few things I'd like to bring up/discuss:
- Naked @deprecated. We really should just outlaw deprecated annotations without message/version. Nothing good comes from it, because it seems the warning already emitted is too easy to ignore. This is pretty annoying because it means we will be stuck with those elements for another few years. Example: https://github.com/scala/scala/blob/2.11.x/src/library/scala/collection/Iterator.scala#L169
- We are using exceptions for control flow in TraversableLike for core collection methods like isEmpty, forall, exists, takeWhile, copyToArray, etc. Additionally, we are creating a lot of superfluous classes here:
def head: A = {
var result: () => A = () => throw new NoSuchElementException
breakable {
for (x <- this) {
result = () => x
break
}
}
result()
}
Maybe I'm missing something, but I think we could get rid of most of this stuff.
- Shall we go ahead an convert scala.Cloneable and scala.Serializable to simple type aliases for java.lang.Cloneable and java.io.Serializable? I remember that the current state has caused confusion and a few issues.
- Scala 2.12 seems to use a pretty old STARR, 2.11.1 what's the plan here?
It should work to
- remove the defaults from the constructor of deprecated
- add deprecated overloaded constructors to support to keep source compatibility
--
we want 2.11 and 2.12 to be source compatible including deprecated parts
- It would be nice to start using the new class file attributes to save parameter names. (And especially start reading them from other class files, so that the Scala compiler doesn't have to do his x$1 thing when perfectly fine parameter names are available.
- Should we drop the private[Scala] modifier from deprecatedX annotations, so that everyone can start using them?
It would be nice to start using the new class file attributes to save parameter names. (And especially start reading them from other class files, so that the Scala compiler doesn't have to do his x$1 thing when perfectly fine parameter names are available.Agreed.
Are you interested in working on this?
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Support for this was added in Java 8: http://openjdk.java.net/jeps/118
Additionally, it might make sense to look into SI-2034 (especially with regard to the last point) and figure out what's the state of the attached patch.