Skip to content

Instantly share code, notes, and snippets.

@bamboo
bamboo / vscode.md
Last active April 26, 2021 14:41
hacky vscode instructions for idris2-lsp
@bamboo
bamboo / settings.gradle.kts
Created August 19, 2020 21:48
BuildService + projectsEvaluated callback example
import org.gradle.tooling.events.FinishEvent
import javax.inject.Inject
abstract class TraceService : BuildService<TraceService.Parameters>, org.gradle.tooling.events.OperationCompletionListener {
private
var projectsEvaluated = false
interface Parameters : BuildServiceParameters {
}
@bamboo
bamboo / build.gradle.kts
Last active April 21, 2021 18:20
Gradle ArtifactTransform example using the Gradle Kotlin DSL
import org.gradle.api.internal.artifacts.repositories.layout.IvyRepositoryLayout
import java.io.InputStream
import java.util.zip.*
object Attributes {
val artifactType = Attribute.of("artifactType", String::class.java)
val zipType = "zip"
val jars = "jars"
}
@bamboo
bamboo / build.gradle
Last active May 11, 2020 11:25
Drive kotlinc from build.gradle
// Execute Kotlin script with:
//
// gradle -q foo
//
// For correctness, we're going to configure two independent classpath configurations, one for kotlinc and the other for the
// script(s) we want to execute.
configurations {
kotlinc
@bamboo
bamboo / dotnet-idris-faster-than-idris.md
Created January 9, 2017 18:12
dotnet core can execute idris faster than idris
➜  /tmp  time ./pythag-idris > /dev/null
4.49s user 0.02s system 99% cpu 4.514 total
➜  /tmp  time dotnet pythag-idris.exe > /dev/null
4.23s user 0.03s system 99% cpu 4.265 total

pythag.idr

@bamboo
bamboo / popcnt-after-optimization.il
Created November 27, 2016 18:12
Idris bit population count as emitted by idris-cil before and after boxing optimization
.method static assembly object 'Data.HashSet.popcnt'(object 'e0') cil managed
{
.maxstack 2
.locals init (
int32 l0,
int32 l1,
int32 l2,
int32 l3,
int32 l4,
int32 l5)
@bamboo
bamboo / build.gradle.kts
Created May 30, 2016 14:26
Repro project for gradle/kotlin-dsl-samples#25 - loader constraint violation error
import org.gradle.api.artifacts.dsl.*
import org.gradle.api.plugins.*
import org.gradle.api.publish.*
import org.gradle.api.publish.maven.*
import org.gradle.api.tasks.bundling.Zip
import org.gradle.api.tasks.bundling.ZipEntryCompression
import org.gradle.jvm.tasks.Jar
import org.gradle.script.lang.kotlin.*
import java.util.concurrent.Callable
@bamboo
bamboo / ExternalComponentsAsFirstClassElements.gradle
Last active November 24, 2015 10:18
External Components as First Class Model Elements
model {
components {
// External components are modeled just like internal ones.
mavenLibrary 'collections' {
org 'com.acme'
version '1.0'
}
@bamboo
bamboo / *>.lisp
Last active August 29, 2015 14:27
SFun Prelude.Applicative.*>
SFun Prelude.Applicative.*> [{e0},{e1},{e2},{e3},{e4},{e5}] 5
(SLet (Loc 6)
(SLet (Loc 6)
(SLet (Loc 6) SNothing
(SLet (Loc 7) SNothing
(SLet (Loc 8) SNothing
(SApp False Prelude.Applicative.<*> [Loc 6,Loc 7,Loc 8,Loc 3]))))
(SLet (Loc 7)
(SLet (Loc 7)
(SLet (Loc 7)
@bamboo
bamboo / HelloWorld.il
Created July 27, 2015 10:42
idris-cil - Hello World
.assembly extern mscorlib
{
.ver 2:0:0:0
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
}
.assembly 'HelloIdris' {}
.class private M
{
.method static assembly object call__IO(object e0, object e1, object e2) cil managed
{