Skip to content

Instantly share code, notes, and snippets.

View jvican's full-sized avatar

Jorge jvican

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jvican on github.
* I am jvican (https://keybase.io/jvican) on keybase.
* I have a public key whose fingerprint is B348 226B CC08 589C 1585 D21C 42DA FA0F 112E 8050
To claim this, I am signing this object:
4#package <empty>
6#package sun
7#package class sun
20563#package text
20564#package class text
20565#package rmi
20566#package class rmi
20567#package net
20568#package class net
20569#package print
// A.scala
abstract class A {
type T <: S
type S
object X {
def foo: T = null.asInstanceOf[T]
}
}
// B.scala
class B extends A {
@jvican
jvican / benchmarks-zinc-7d4bf285
Created February 16, 2017 12:44
Benchmarks for commit 7d4bf285 in Zinc.
l/zinc-benchmarks/target/scala-2.12/src_managed/jmh and resources to /data/rw/code/scala/zinc/internal/zinc-benchmarks/target/scala-2.12/resource_managed/jmh
[info] Compiling 15 Java sources to /data/rw/code/scala/zinc/internal/zinc-benchmarks/target/scala-2.12/classes...
[info] Running org.openjdk.jmh.Main -p _tempDir=/tmp/sbt_67b913f6
[info] # JMH 1.17.4 (released 29 days ago)
[info] # VM version: JDK 1.8.0_92, VM 25.92-b14
[info] # VM invoker: /usr/lib/jvm/java-8-openjdk/jre/bin/java
[info] # VM options: <none>
[info] # Warmup: 6 iterations, 10 s each
[info] # Measurement: 6 iterations, 10 s each
[info] # Timeout: 10 min per iteration
@jvican
jvican / IncrementalCompiler.scala
Created February 23, 2017 15:46
Binary API of IncrementalCompiler
/*
* Zinc - The incremental compiler for Scala.
* Copyright 2011 - 2017, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* This software is released under the terms written in LICENSE.
*/
package xsbti.compile;
import xsbti.*;
@jvican
jvican / BloatedTest.scala
Created July 20, 2017 11:08
Gist to test whether unused names have an effect in the first compiler iteration.
package test
import java.lang._
import java.applet._
import java.awt._
import java.beans._
import java.io._
import java.lang._
import java.math._
import java.net._
@jvican
jvican / sipzz.md
Last active July 26, 2017 16:05 — forked from non/sipzz.md

SIP-ZZ - NewType Classes

Introduction

This is a proposal to introduce syntax for classes in Scala that can get completely inlined, so operations on these classes have zero overhead compared to external methods. Some use cases for inlined classes are:

  • Inlined implicit wrappers. Methods on those wrappers would be
DEBUG <2017-07-30 11:14:52,230> (client.py:584) - unqueue: result received
{
"payload": {
"typehint": "NewScalaNotesEvent",
"isFull": false,
"notes": [{
"beg": 2027,
"line": 55,
"col": 67,
"end": 2027,
sbt @ root > integrations/compile
[info] Compiling 1 Scala source to /data/rw/code/scala/scala-profiling/plugin/target/scala-2.12/classes...
[info] Packaging /data/rw/code/scala/scala-profiling/plugin/target/scala-2.12/scalac-profiling_2.12-2.12.4-bin-SNAPSHOT.jar ...
[info] Done packaging.
[info] Compiling 1 Scala source to /data/rw/code/scala/scala-profiling/integrations/target/scala-2.12/classes...
[info] Ignoring duplicate plugin scalac-profiling (ch.epfl.scala.ProfilingPlugin)
EXPANDEE
shapeless.this.DefaultSymbolicLabelling.mkDefaultSymbolicLabelling[Foo]
EXPANDED
({
[info] Loading global plugins from /home/jvican/.sbt/0.13/plugins
[info] Loading project definition from /data/rw/code/scala/compiler-benchmark/project
[info] Set current project to compiler-benchmark (in build file:/data/rw/code/scala/compiler-benchmark/)
[info] Setting version to 2.12.3
[info] Reapplying settings...
[info] Set current project to compiler-benchmark (in build file:/data/rw/code/scala/compiler-benchmark/)
[info] Updating {file:/data/rw/code/scala/compiler-benchmark/}infrastructure...
[info] Resolving pl.project13.scala#sbt-jmh-extras;0.2.25 ...
[info] Resolving org.openjdk.jmh#jmh-core;1.19 ...
[info] Resolving net.sf.jopt-simple#jopt-simple;4.6 ...