Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
| #! /usr/bin/env stack | |
| -- stack --resolver lts-12.14 script | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {- | |
| This is a handy illustration of converting between five of the commonly-used | |
| string types in Haskell (String, ByteString, lazy ByteString, Text and lazy | |
| Text). |
| #!/bin/sh | |
| #_( | |
| "exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@" | |
| ) | |
| ;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print: | |
| ;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}] | |
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
| ; A simple demo of monadic composition of side effects | |
| ; Program to take 3 nubers as input and print their sum. | |
| (defn read-and-add! | |
| [prev] | |
| (print "Enter a number: ") | |
| (+ prev (do (flush) | |
| (Integer/parseInt (read-line))))) | |
| (defn bind |
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. It is the officle getting-started project: https://github.com/graalvm/simplelanguage
Truffle Tutorial, Christan Wimmer, PLDI 2016, 3h recording https://youtu.be/FJY96_6Y3a4 Slides