- Abramsky and Jung "Domain Theory" http://www.cs.bham.ac.uk/~axj/pub/papers/handy1.pdf
- Appel, Andrew "Modern Compiler Implementation in ML"
- Cousot, Patrick "Abstract Interpretation Based Formal Methods and Future Challenges" http://www.di.ens.fr/~cousot/publications.www/Cousot-LNCS2000-sv-sb.pdf
- Darais, Might, and Van Horn "Galois Transformers and Modular Abstract Interpreters" http://arxiv.org/pdf/1411.3962v1.pdf
- Davey and Priestley, "Introduction To Lattices and Order"
- Friedman and Mendhekar, "Using an Abstracted Interpreter to Understand Abstract Interpretation" http://www.cs.indiana.*du/l/www/classes/b621/abiall.pdf
- Friedman and Wand, "Essentials of Programming Languages"
- Jones and Nielson, "Abstract Interpretation: a Semantics-Based Tool for Program Analysis" http://se.inf.ethz.ch/courses/2014b_fall/sv/reading/jones-nielson.pdf
- Livshits, Sridharan, Smaragdakis, et. al. "In Defense of Soundiness: A Manifesto" http://cgi.di.uoa.gr/~smaragd/Soundiness-CACM.pdf
- Might, Matt "Writing an inte
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB']; | |
var number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
}; | |
}); |
(deftask start [] | |
(let [f (delay (do | |
(require 'fy.core) ;; cljx file | |
((resolve 'fy.core/start-system!))))] | |
(with-post-wrap fileset @f fileset))) |
(ns example.macros | |
(:require | |
[cljs.analyzer :as a] | |
[cljs.compiler :as c])) | |
(defmacro complies? | |
"True if x satisfies and implements all methods of a protocol. | |
Ex. |
Let's say you want to use cljs.js
to eval
code using functions declared in your project.
Expressions that only use core functions are simple to evaluate:
(ns foo.try-eval
(:require [cljs.js :as cljs]))
(def compiler-state (cljs/empty-state))
;; Let's start with a simple conditional interceptor that works with functions... | |
(defn conditional-context | |
"Given a keyword name and any variable predicate and terminator function pairs, | |
return an interceptor that will apply the terminator function paired to the first | |
truthy predicate. Predicates and terminators are both given the context as | |
the only argument. | |
If all predicates fail, the original context is returned." | |
[name-kw & pred-terms] |
(ns project.leaflet | |
(:require-macros [project.macros :as m]) | |
(:require [rum.core :as rum] | |
cljsjs.react-leaflet)) ;; js/ReactLeaflet | |
(m/adapt-react leaflet-map js/ReactLeaflet.Map) | |
(m/adapt-react tile-layer js/ReactLeaflet.TileLayer) | |
(m/adapt-react marker js/ReactLeaflet.Marker) | |
(m/adapt-react popup js/ReactLeaflet.Popup) |
Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).
In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true
to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen
(require '[clojure.java.io :as io]) | |
(deftask demo [] | |
(let [tmp (tmp-dir!) ; Anonymous, boot-managed temp directory. | |
prev-fs (atom nil)] ; Atom where the previous fileset is stored. | |
(with-pre-wrap [fs] | |
(let [diff (fileset-diff @prev-fs (reset! prev-fs fs)) ; Fileset containing only changed files. | |
inputs (->> (input-files diff) ; Sequence of [String, java.io.File] | |
(by-ext [".c"]) ; pairs, the classpath path and File | |
(map (juxt tmp-path tmp-file)))] ; for files with given extensions. |
<? | |
// | |
// [ BUY BTC & ETH DAILY ON BITSTAMP ] | |
// by @levelsio | |
// | |
// 2017-08-23 | |
// | |
// 1) buy $40/day BTC | |
// 2) buy $10/day ETH | |
// |