-
Add Graal JIT Compilation to Your JVM Language in 5 Steps, A Tutorial http://stefan-marr.de/2015/11/add-graal-jit-compilation-to-your-jvm-language-in-5-easy-steps-step-1/
-
The SimpleLanguage, an example of using Truffle with great JavaDocs https://github.com/graalvm/simplelanguage
-
Truffle Tutorial, Christan Wimmer, PLDI 2016, 3h recording https://youtu.be/FJY96_6Y3a4 Slides
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
;; Count a sequence | |
(fn [coll] | |
(reduce (fn [c _] (inc c)) 0 coll)) |
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
(fn [coll] | |
(reduce conj '() coll)) |
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
(partial reduce +) |
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
(fn [num] | |
(take num (map first (iterate (fn [[a b]] [b (+' a b)]) [1 1])))) | |
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
(fn [input] | |
(if (coll? input) | |
(= input (reverse input)) | |
(= input (clojure.string/join "" (reverse input))))) |
One thing that always made me a little sad about transducers was how map
lost its ability to iterate multiple collections in parallel. This is actually my favorite feature of map
. For example:
(map + (range 5) (range 5 10))
=> (5 7 9 11 13)
One somewhat practical use of this is if you want to compare two sequences, pairwise, using a comparator. Though I wish that every?
took multiple collections, this is an adequate substitute:
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
==== Testing JVM version | |
==== Testing JVM version | |
lein test clj-kondo.analysis-test | |
lein test clj-kondo.compojure-test | |
lein test clj-kondo.core-test | |
lein test :only clj-kondo.core-test/run!-test |
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
# Check your changes compared to master with clj-kondo: | |
git diff `git merge-base origin/master HEAD` --name-only |grep -e '.clj$' | (cd `git root`; xargs clj-kondo --lint) |
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
class Clojure < Formula | |
desc "The Clojure Programming Language" | |
homepage "https://clojure.org" | |
url "https://download.clojure.org/install/clojure-tools-1.10.1.510.tar.gz" | |
sha256 "c6e003f612bdd7f9a9baa6d86deafb2d51b411310077c83c9ed13bc649c13b18" | |
revision 1 | |
bottle :unneeded | |
depends_on "rlwrap" |