- Markdown style
[](https://youtu.be/nTQUwghvy5Q)- HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">| (ns prefix-tree) | |
| ;Record representing a node in the prefix tree. | |
| ;strings: The set of strings that the present node represents | |
| ;edges: Map representing edges emanating from this node. | |
| ;The key being the first letter of the label and the value being the label and the actual node being pointed to." | |
| (defrecord Node [strings edges]) | |
| (defn shorter-string [a b] | |
| "Return the shorter string of the two being passed in." |
| (ns webdav | |
| (:require [clojure.string :as str] | |
| [clojure.data.xml :as xml] | |
| [org.httpkit.server :as hk-server])) | |
| ;; add the XML namespace that we'll use later | |
| (xml/alias-uri 'd "DAV:") | |
| (defn dissoc-in | |
| "Should be in the standard library..." |
A minimal example of creating a (mostly) working FUSE filesystem using Clojure. NOTE: I have only tested this with OSX, and it assumes you have already installed libfuse.
Create an empty directory at /tmp/meld to serve as your mount point,
put these files in a directory called meld, then:
| (ns radix | |
| (:require [clojure.string :as string])) | |
| (use 'clojure.java.io) | |
| (use 'clojure.pprint) | |
| (println "Loading names... ") | |
| (time (def names | |
| (with-open | |
| [rdr (reader | |
| "/usr/share/dict/ProperNames")] |
| package sandbox; | |
| import java.util.Arrays; | |
| import java.util.Random; | |
| public class SoABenchmark { | |
| public static Random rand = new Random(9001); | |
| public static int NUM_LABELS = 10; | |
| public static Struct[] aos; |
I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.
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:
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