Skip to content

Instantly share code, notes, and snippets.

View retronym's full-sized avatar

Jason Zaugg retronym

View GitHub Profile
@retronym
retronym / indylambda.md
Last active February 5, 2022 10:47
indylambda: Putting invokedynamic to work for Scala

indylambda: Putting invokedynamic to work for Scala

Java 8 introduced lambdas to the Java language. While the design choices differ in many regards from Scala's functions, the underlying mechanics used to represent Java lambdas is flexible enough to be used as a target for the Scala compiler.

Lambdas in Java

Java does not have canonical heirarchy of generic function types (ala scala.FunctionN), but instead allows a lambda to be used as a shorthand for an anonymous implementation of an Functional Interface

Here's an example of creating a predicate that closes over one value:

@tinkerware
tinkerware / hsdis-elcapitan.sh
Last active July 19, 2020 15:38
Build hsdis for JDK 1.8u92 on El Capitan
# You will need Mercurial; get it with `brew install hg`.
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u
cd jdk8u
hg update jdk8u92-b14
chmod +x ./get_source.sh; ./get_source.sh
cd hotspot/src/share/tools/hsdis
wget http://ftp.heanet.ie/mirrors/gnu/binutils/binutils-2.26.tar.gz
tar -xzf binutils-2.26.tar.gz
make BINUTILS=binutils-2.26 ARCH=amd64
@retronym
retronym / profiling-notes.md
Last active June 11, 2017 04:27
Compiler Profiling Notes
@mushtaq
mushtaq / universal.scala
Last active February 12, 2016 01:14 — forked from paulp/universal.scala
// [info] Running p.Run
// List(Fish(Bob, Esq.,12), Kitty(Thor, Esq.,java.awt.Color[r=255,g=200,b=0]))
package misc
import java.awt.Color
trait Pet[A] {
def name(a: A): String
def renamed(a: A, newName: String): A
@retronym
retronym / plan.md
Created September 12, 2012 08:03
.plan

Process

  • Scala PR review checklist
  • Scala SIP Template / review checklist

Ideas

  • Finalize classes/methods in stdlib
  • Unused code detection / eradication
  • optimize local lazy vals that don't escape
@gseitz
gseitz / sbt_complete.scala
Created July 18, 2012 08:52
SBT command for extracting completions
package sbtcomplete
import sbt._
import complete.JLineCompletion
import Keys._
object SbtComplete {
private val CompletionsCommand = "completions"
private val CompletionsBrief = ("<arg>", "The string to complete.")