Skip to content

Instantly share code, notes, and snippets.

View gkossakowski's full-sized avatar
🎯
Focusing

Grzegorz Kossakowski gkossakowski

🎯
Focusing
View GitHub Profile
Description Resource Path Location Type
object TypeParameterElementInfo is not a member of package org.eclipse.jdt.internal.core ScalaElements.scala /org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements line 13 Scala Problem
not found: type JavaElement ScalaElements.scala /org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements line 27 Scala Problem
object SourceField is not a member of package org.eclipse.jdt.internal.core ScalaElements.scala /org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements line 13 Scala Problem
object SourceFieldElementInfo is not a member of package org.eclipse.jdt.internal.core ScalaElements.scala /org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements line 13 Scala Problem
object SourceMethod is not a member of package org.eclipse.jdt.internal.core ScalaElements.scala /org.scala-ide.sdt.core/src/scala/tools/eclipse/javaelements line 13 Scala Problem
object SourceMethodElementInfo is not a member of package org.eclipse.jdt.internal.core ScalaElements.scala /or
@gkossakowski
gkossakowski / timeline.scala
Last active December 11, 2015 04:09
A helper script that generates little timeline out of data dumped by https://github.com/gkossakowski/scalac-aspects#typing-timings-typingtimingsaj
val input = Stream.continually(Console.readLine).takeWhile(_ != null)
val parsed = input.map(_.trim.split("\\s+").toSeq)
//parsed.take(100).foreach(println)
/** see CSS definition */
def color(hash: Int): String = {
val hashAbs = math.abs(hash)
val colors = Seq("primary", "secondary-a", "secondary-b", "complement")
@gkossakowski
gkossakowski / specialization-mh.md
Created January 11, 2013 21:17
Random ideas from Scala compiler hacker (@gkossakowski) on how we could improve specialization scheme by exploiting MethodHandles. What you read below is not a plan or a commitment of any kind. I just wanted to get it out from my head and hear what other people think while I'm busy with other things.

Specialization with method handles

Two canonical examples for specialization:

  • Function1
  • Tuple2

Function1 specialization

Specializing Function1 is a lot easier because functions do not have specialized fields.

@gkossakowski
gkossakowski / gist:4498894
Created January 10, 2013 02:31
See discussion on scala-internals.
Grzegorzs-MacBook-Pro:scala grek (2.10.x)$ awk -v startTime=5560684 -v duration=334546 '($1 >= startTime && $1 < startTime+duration) { print }' quick-lib-timings
5561559 289 scala.collection.Parallelizable.seq source-/Users/grek/scala/scala/src/library/scala/collection/Parallelizable.scala,line-22,offset=1019
5562035 484 scala.collection.parallel.ParIterableLike.Repr source-/Users/grek/scala/scala/src/library/scala/collection/parallel/ParIterableLike.scala,line-156,offset=7465
5562571 281 scala.collection.GenTraversableOnce.seq source-/Users/grek/scala/scala/src/library/scala/collection/GenTraversableOnce.scala,line-55,offset=1980
5561401 1893 scala.collection.parallel.ParIterableLike.seq source-/Users/grek/scala/scala/src/library/scala/collection/parallel/ParIterableLike.scala,line-205,offset=9512
5564180
@gkossakowski
gkossakowski / release-against-scala-2.11-M1.sbt
Last active December 10, 2015 19:29
Settings needed to release your sbt-based Scala project against Scala 2.11.0-M1.
// release-against-scala-milestone v0.1
// ALTERED SETTINGS START
scalaVersion := "2.11.0-M1"
// disable cross building completely for releasing against milestones
crossScalaVersions := Seq.empty
scalaBinaryVersion in Global <<= scalaVersion.identity
@gkossakowski
gkossakowski / gist:4061123
Created November 12, 2012 18:49
RefinedType accessible through reflection and having different owner depending when the symbol comes from (unpickling vs type-checking)
$ cat Foo.scala
object test3 {
trait A; trait C
trait B { self: A with C =>
class Inner {
def b = B.this
}
}
}
@gkossakowski
gkossakowski / eclipsify_sbt.sh
Created October 19, 2012 00:54 — forked from adriaanm/eclipsify_sbt.sh
rewire sbt's directory structure so it adheres to a standard eclipse can deal with
#!/bin/sh
BASE=$HOME/git/xsbt/
for SRC in `find $BASE -not -path '*/src*/*' -name '*.scala'`;do
PKG=`grep "^\s*package " $SRC | perl -pse 's/\s*package\s*(\w*?)\b/package $1/' | tr -d '\r' | tr -d ';' | cut -d' ' -f2 | tr '\n.' '//'`
mkdir -p `dirname $SRC`/src/main/scala/$PKG
ln -s $SRC `dirname $SRC`/src/main/scala/$PKG`basename $SRC`
done
strap.clean:
pack.clean:
init.jars.check:
init.jars:
init.maven.tasks:
@gkossakowski
gkossakowski / gist:3143775
Created July 19, 2012 13:06
Scala compiler crash with -target:jvm-1.6
Possible compiler crash during test of: /Users/grek/scala/scala/test/files/pos/t5957
java.lang.AssertionError: assertion failed:
while compiling: /Users/grek/scala/scala/test/files/pos/t5957/T_1.scala
during phase: jvm
library version: version 2.10.0-20120719-133117-f18ef37c66
compiler version: version 2.10.0-20120719-133117-f18ef37c66
reconstructed args: -deprecation -d /Users/grek/scala/scala/test/files/pos/t5957-pos.obj -classpath /Users/grek/scala/scala/test/files/codelib/code.jar:/Users/grek/scala/scala/build/pack/lib/scala-library.jar:/Users/grek/scala/scala/test/files/pos/t5957-pos.obj:/Users/grek/scala/scala/test/files/pos/t5957:/Users/grek/scala/scala/build/pack/lib/scala-compiler.jar:/Users/grek/scala/scala/build/pack/lib/scala-reflect.jar:/Users/grek/scala/scala/build/pack/lib/scala-library.jar:/Users/grek/scala/scala/build/pack/lib/scala-partest.jar:/Users/grek/scala/scala/lib/fjbg.jar:/Users/grek/scala/scala/build/pack/lib/scalap.jar:/Users/grek/scala/scala/build/pack/lib
mac-grek:codwh grek (master)$ ./network_test.sh 10 7 queries/q7.ascii
RUNNING:./src/worker 1 2001 localhost:2000 localhost:2001 localhost:2002 localhost:2003 localhost:2004 localhost:2005 localhost:2006 localhost:2007 localhost:2008 localhost:2009 7 &
WARNING: New server, query id = 7
Awaiting for a job
RUNNING:./src/worker 2 2002 localhost:2000 localhost:2001 localhost:2002 localhost:2003 localhost:2004 localhost:2005 localhost:2006 localhost:2007 localhost:2008 localhost:2009 7 &
RUNNING:./src/worker 3 2003 localhost:2000 localhost:2001 localhost:2002 localhost:2003 localhost:2004 localhost:2005 localhost:2006 localhost:2007 localhost:2008 localhost:2009 7 &
WARNING: New server, query id = 7
Awaiting for a job
RUNNING:./src/worker 4 2004 localhost:2000 localhost:2001 localhost:2002 localhost:2003 localhost:2004 localhost:2005 localhost:2006 localhost:2007 localhost:2008 localhost:2009 7 &
WARNING: New server, query id = 7