You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
P. Oscar Boykin
johnynek
Some guy on Maui... I used to work at Stripe and before that Twitter. I like correct and fast code.
This note outlines a principled way to meta-programming in Scala. It tries to
combine the best ideas from LMS and Scala macros in a minimalistic design.
LMS: Types matter. Inputs, outputs and transformations should all be statically typed.
Macros: Quotations are ultimately more easy to deal with than implicit-based type-lifting
LMS: Some of the most interesting and powerful applications of meta-programming
I feel like conversations around laws and lawfulness in Scala are often not productive, due to a lack of rigor involved. I wanted to try to be as clear and specific as possible about my views of lawful (and unlawful) behavior, and what I consider a correct and rigorous way to think about laws (and their limits) in Scala.
Laws
A law is a group of two or more expressions which are required to be
the same. The expressions will usually involve one or more typed
holes ("inputs") which vary.
Better Dependency Hygiene With Private Dependencies On JVM
Better Dependency Hygiene With Private Dependencies On JVM
A common pain when working with large projects is the diamond dependency.
Consider a commonly used library such as ASM. One wants to build a big application reusing many powerful libraries, but unfortunately many of my desired dependencies themselves depend on different and incompatible versions of ASM. While compiling my code, since ASM does not appear in any APIs I touch, everything compiles fine, but at runtime the JVM only includes one version of classes of a given name leading to runtime binary errors.
OSGI Bundles are related to solving this problem, but it appears that is a heavy solution that has proven to be too cumbersome to actually use. Here we propose a lighter weight approach that benefits each incremental project that adopts this method.
Private dependencies are implemented by a build tool plug-in. In the build where one declares
dependencies, one can label a jar dependency to be a private dependency. A private dependency means tha
Basic encoding of Transducers with a little fanciness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters