“Why Functional Programming Matters” by John Hughes.
https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf.
https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/
“The Design of a Pretty-printing Library” by John Hughes.
“Why Functional Programming Matters” by John Hughes.
https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf.
https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/
“The Design of a Pretty-printing Library” by John Hughes.
Start cljs.main
with rebel-readline
:
clojure -Sdeps '{:deps {github-mfikes/cljs-main-rebel-readline {:git/url "https://gist.github.com/mfikes/9f13a8e3766d51dcacd352ad9e7b3d1f" :sha "27b82ef4b86a70afdc1a2eea3f53ed1562575519"}}}' -i @setup.clj -m cljs.main
Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.
This example uses Figwheel as something that you want to exclude for production, but the pattern is general.
With this simple setup you only need one html file/view and it will work for developement and production.
If you are curious about the types inferred by ClojureScript, it is easy to get some insight using a macro:
(defmacro inferred-type [form]
`'~(cljs.analyzer/infer-tag &env
(cljs.analyzer/no-warn (cljs.analyzer/analyze &env form))))
This is the kind of dev-time macro you could refer using the new user.cljs
feature.
Let's say you want to run a Processing sketch on a server. Like maybe you want to generate several million PDF and JPEG images using a handful of Amazon EC2 instances.
This is called “headless” mode, and to do so, it's necessary to install what's known as a virtual frame buffer.
On Ubuntu 14.04, these are the things you need to install first:
sudo apt-get install xvfb libxrender1 libxtst6 libxi6
# JSON diff and patch for jq (https://stedolan.github.io/jq/) | |
# Author: Srinath Sankar | |
# | |
# Usage: | |
# diff: jq -sS 'include "diff-patch"; diff' a.json b.json > patch.json | |
# patch: jq -sS 'include "diff-patch"; patch' a.json patch.json | |
# | |
# Caveats: tested only with top level objects using jq 1.6 | |
def flatten_obj: |
; A minimal Mach-o x32 executable for OS X El Capitan (with proper padding and symtable) | |
; | |
; Original (pre 10.10.5) version - https://gist.github.com/softboysxp/1084476 | |
; $ nasm -O0 -f bin -o tiny_hello tiny_hello.asm | |
; $ chmod +x tiny_hello | |
; $ ./tiny_hello | |
; (returns 42) | |
; $ | |
; c.f. |
<html> | |
<head> | |
<script type="text/javascript"> | |
window.onload = draw; | |
function draw(){ |
package org.linux.X11; | |
import com.sun.jna.Native; | |
import com.sun.jna.NativeLong; | |
import com.sun.jna.platform.unix.X11; | |
import java.awt.*; | |
/** | |
* Author: Vladimir Kravets |
#include <iostream> | |
#include <cstdint> | |
#include <string> | |
#include "llvm/ExecutionEngine/JIT.h" | |
#include "llvm/IR/IRBuilder.h" | |
#include "llvm/IR/Module.h" | |
#include "llvm/PassManager.h" | |
#include "llvm/Support/TargetSelect.h" | |
#include "llvm/Analysis/Verifier.h" |