Eugene Burmako | 9 Feb 14:27
Picon
Picon
Favicon
Gravatar

Get a symbol by its owner and its name

Is there a way to get a symbol if I know its owner and its name?

Positive answer will be very useful for importers (that provide
bijection between universes, e.g. between reflective mirror and
reflective compiler).

Currently importers create a new symbol for every symbol they haven't
seen yet. This means that certain symbols can be created multiple
times - once inside their own universe and once again during an import
from a universe that already has the same symbol.

Gravatar

Scala Compiler Performance Analysis

Hi All,

Not sure you all have seen this but we've been publishing a series of 
articles on the performance analysis of the existing 2.9.1 scala 
compiler code base. We did not set out to address all performance 
concerns of the compiler but to look at the issues one has in measuring 
(in our case metering) scala derived class bytecode. There has been a 
lot said about complexity but rarely has this actually looked at how 
does one make sense of the execution of such bytecode when traceability 
back to source and constructs is not as easy as it has been in Java 
itself with the mapping being explicit, direct and immediate. Definitely 
an address that needs attention when production deployments grow bigger.

We should have the last 3 remaining parts published by Monday next week. 
Hopefully the data that is presented will give you some direction in any 
proposed tuning (or rewrite) efforts.

Case Study: Scala Compiler – Part 7
How to identify particular execution performance outliners assessing 
differences and similarities.
http://www.jinspired.com/site/case-study-scala-compiler-part-7

Case Study: Scala Compiler – Part 6
How to manage performance measurement costs via inline optimizations and 
budget control.
http://www.jinspired.com/site/case-study-scala-compiler-part-6

Case Study: Scala Compiler – Part 5
How to eliminate noise or redundant data from a performance model whilst 
controlling overhead.
(Continue reading)

Eugene Burmako | 8 Feb 13:18
Picon
Picon
Favicon
Gravatar

How do I make SBT use scala snapshot from my own repo?

A few hours ago I put up my personal Maven repo at
https://bitbucket.org/xeno.by/mavenrepo/raw/master/, uploaded a custom
snapshot of Scala and tried to build scalacheck against it.

After some googling I found out how to make SBT ignore the standard
scala-tools repo and load Scala from a custom repo, and adjusted
build.sbt accordingly: https://bitbucket.org/xeno.by/mavenrepo/src/d651aa74420e/build.sbt.

However, to my surprise, when presented with scalaVersion := "2.10.0-
SNAPSHOT", SBT still went to scala-tools and ignored the custom repo.
To be 100% sure I destroyed all relevant caches (~/.sbt, ~.ivy2) and
tried again - with no luck.

I think that my repository is fine, since: a) it replicates the
structure of scala-tools.org, b) maven-ant is okay with it and happily
downloads custom Scala snapshot from there:
https://bitbucket.org/xeno.by/mavenrepo/src/d651aa74420e/build.xml.

What could be the problem?

Eugene Burmako | 7 Feb 21:49
Picon
Picon
Favicon
Gravatar

Outdated info in POMs

<scm /> and <issueManagement /> metadata is out-of-date, e.g.:
https://github.com/scala/scala/blob/master/src/build/maven/scala-compiler-pom.xml.

Eugene Burmako | 7 Feb 19:13
Picon
Picon
Favicon
Gravatar

Idempotency of typechecking

Recently I've discovered that typechecking isn't idempotent w.r.t. unapplies, i.e. if you:
1) take a well-typed pattern match that contains extractors
2) typecheck it
3) reset all attrs
4) typecheck it

Then step #4 will crash, because of the <unapply-selector> guy that's generated during step #2.

This is more than just a curious fact, because it's undesirable for reification. When the reifier processes an AST, it dehydrates it by removing the types and leaving only some of the symbols. Subsequent reflective compilation typechecks the reified tree again (actually, it does the typechecking twice) and expects something that has been typechecked once (before the reification) to be successfully typechecked later on. So situations similar to the one described above need to be processed by the reifier in a special way.

Hence the question. What other cases of non-idempotence do you know?
Adriaan Moors | 7 Feb 18:06
Picon
Picon
Favicon

Scala Meeting Report 2012/02/07

This summary is intended for Scala contributors and maintainers, and assumes a certain familiarity with Scala's internals.

It is for your information only, provided “AS IS” with no warranties and it confers no rights (nor lefts).

Scala Meeting Report 2012/02/07

Attending

Adriaan: VirtPatMat (handling the catches in a try/catch)
Alex: Parallel collections - CTries in trunk
Heather: doc-site tasks, dataflow with Alex, akka tasks, serializing closures
Martin: worked on inline classes (now called value classes), traits that inherit from Any, value class translation
Manohar: kmeans - big performance slowdown when using a single code block for the entire program - code size is also important -- play with the JVM parameters
Eugene: fixed reification bugs, got rid of the LiftCode phase, its logic has been transplanted into scala.reflect.macro.Context#reify
Christopher: slick bugfixes / refactorings, now using sbt for slick
Miguel: parallel inliner, exploring genJVM with ASM
Ingo: multi-way dependencies into scala react - ported a linear constraint solver to scala
Vlad: breaking nightlies, scaladoc patches, lms/delite work
Tiark: thesis writing
Hubert: fixed bug that was crashing sbt; type debugger
Lukas: finished design of lambda-calculus with “like”-effects, putting it in a tech report. After that, will start updating the compiler plugin and put things to work.
Georges: akka cluster runtime. Initial direction: io and data partitioning.

Discussion

Role of scaladoc in builds

1) let’s automate testing the full scaladoc suite for every commit
2) let’s not let scaladoc fail the nightly (but that should become easier to avoid given (1))

Scala-lang reorganization

We're going to prune old content, simplify the structure.
First step: getting statistics from drupal (list of all content, when it was last updated/accessed).
Next step: crowdsource decision of which content to keep, and which to archive

The doc site
Following the wikipedia model, we'll have a banner for outdated/inaccurate content so people are aware of it.
(When this becomes necessary. Next steps could include automating this process.)
Miguel Garcia | 7 Feb 10:54
Picon
Favicon
Gravatar

emitting classfiles with version number >= 50.0



I'm preparing a topic offer for a student project, to enable GenJVM to emit classfiles with version number >= 50.0

For that I'm considering ASM [1] because in addition to being fast, allow multi-threading (different threads emitting different classes), it can also compute stack map frames on the fly [2] [3].

Before moving forward with the topic offer, a question to the list: do you know of any previous attempts at the idea?


Miguel
http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/


[1] http://asm.ow2.org/

[2] Sec. 3.1.5, Stack map frames, http://download.forge.objectweb.org/asm/asm4-guide.pdf

[3] an explanation of least-common-ancestors and interfaces,
  https://groups.google.com/d/msg/jvm-languages/IT6Nn9eX5VM/amiHZk_sNUwJ

Paul Phillips | 6 Feb 18:54

scaladoc and heat seeking beetles

[Moved to scala-internals]

I do not write appeals of this nature with any frequency, and I
don't expect to make a habit of it. I recently experienced a couple
days where I allowed myself to pay no attention to all those little
matters which arise every day, and just work on the codebase. In the
process I was reminded of how much I can accomplish under optimal
conditions, and it motivates me to make sure people understand how
much all those little things are costing us.

Also, this is not aimed at Hubert, or anyone, in particular, and the
question I'm responding to is perfectly reasonable.

On Mon, Feb 6, 2012 at 2:15 AM, Hubert Plociniczak
<hubert.plociniczak@...> wrote:
> Isn't the reason why scaladoc is for example built in scala-checkin exactly
> to discover compiler bugs early?
> AFAIK some serious bugs forced us to do so and I feel that we will back
> again at the start of this nice circle if we remove it.

What compiler bugs has scaladoc uncovered? As far as I can remember
them, the bugs which have been discovered at the intersection of the
compiler and scaladoc have been bugs in scaladoc. One's perspective
on the responsible component may depend on the angle from which one
views things, because they are likely of the form "the compiler
does some ostensibly internal, totally undocumented thing one way,
scaladoc does it a slightly different way, the compiler assumes it
was done in the compiler's way, and now scaladoc crashes."

I say bugs of that form are scaladoc bugs. And it is a practical
necessity that they be considered scaladoc bugs because I cannot
have all my time frittered away trying to pull all the secondary
components along with the compiler and to diagnose every mystery
which arises in the face of what should be compiler-internal
modifications. (I trust nobody will dream of suggesting I owe even
more time to such endeavors.) And when things go wrong, it is almost
unheard of for them to be put right without my involvement. Either
I fix them or I diagnose them - and diagnosing is often, usually in
fact, more time-consuming than fixing.

I've spent something like four years now working on this codebase,
thousands and thousands of hours, and throughout I have poured large
amounts of time into matters which I have no direct interest in,
only because nobody was doing those things and I wasn't willing
to let them go undone. This is more true now than ever. We would
be smart to figure out a way to make this less true, because to
be honest I'm the only one close to having the whole codebase in
my head, which makes me the only one likely to undertake some
increasingly necessary tasks - at least, the only likely to do so
successfully.

In the shawshank redemption, the protagonist says it comes down to a
simple choice: get busy living, or get busy dying. That's the choice
before our codebase. If we don't get it under better control, yet
new bodies of code keep showing up, then it's going to get worse and
worse, and it's far from assured my head will be able to stay ahead
of it, let alone do anything about it.

There's probably a certain amount of stockholm syndrome going around
when it comes to scalac, that and/or the natural human tendency to
adapt one's definition of normal to one's present circumstances.
Maybe I ought to have lost my naive idealism by this point, but
I still think even at this late(r) hour that I can evolve the
compiler to a place with an order of mangnitude fewer bugs. The only
limits I acknowledge are those imposed by the universe: time is
finite. In open acknowledgement of that limitation, I plead to be
better insulated from day-to-day firefighting so we can all enjoy
the benefits of fireproof tuxedos, flame-retardant landscaping,
goggles which reveal traces of smoke to the wearer, and heat seeking
beetles[1], all of which are being developed in my lab and none
of which I can finish while dodging backdrafts in the abandoned
warehouse on route 61.

[1] http://indianapublicmedia.org/amomentofscience/fire-beetles/

Miguel Garcia | 6 Feb 15:44
Picon
Favicon
Gravatar

Inliner down from 100 sec to 50 sec. Here's how.


After some feedback last week on the improved Inliner, I essentially refactored my changes adding documentation and additional improvements along the way. These are all the optimizations I see applicable in a sequential version (hint hint: there might be a parallel version in the future).

If you ask me, I think its code quality is ripe enough for a pull request into trunk. Which makes your feedback all the more important (and who doesn't want for -optimize to run about twice faster). It would be great if you could field-test the following branch with your apps of choice:

   https://github.com/magarciaEPFL/scala/tree/improvedInliner

and report any differences in -Yinling log output, focusing on lines starting with "[log inliner] Inlining" which denote inlinings actually performed.


Miguel
http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/
Eugene Burmako | 6 Feb 15:35
Picon
Picon
Favicon
Gravatar

treeCopy.UnApply(tree, fun, transformTrees(args))

Any reason for tree transformers to ignore the fun of UnApply?





Picon
Picon
Favicon
Gravatar

code.jar

Did anyone notice this error:

/Users/aleksandar/workspaces/scala/scala/build.xml:1689: 
java.lang.RuntimeException: No code.jar found in 
/Users/aleksandar/workspaces/scala/scala/test/files/codelib
     at scala.sys.package$.error(package.scala:27)
     at 
scala.tools.partest.nest.PathSettings$$anonfun$srcCodeLib$1.apply(PathSettings.scala:47)
     at 
scala.tools.partest.nest.PathSettings$$anonfun$srcCodeLib$1.apply(PathSettings.scala:47)
     at scala.Option.getOrElse(Option.scala:106)
     at 
scala.tools.partest.nest.PathSettings$.srcCodeLib(PathSettings.scala:46)
     at scala.tools.partest.PartestTask.execute(PartestTask.scala:316)

--

-- 
Aleksandar Prokopec,
Doctoral Assistant
LAMP, IC, EPFL
http://people.epfl.ch/aleksandar.prokopec


Gmane