the physiological side effects of `health-deleterious non-caffeine components' in the beverage for heavy drinkers, coffee with an enhanced caffeine content (recaffeinated coffee) can be prepared by mixing roast and ground coffee with ground caffeine crystals or by spraying a liquid caffeine solution on to ground coffee. Coffee: Recent Developments by Ronald Clarke, O. G. Vitzthum, ISBN: 978-0-632-05553-1
Alas, programming styles are retrofitted instead of being pure and beautiful! (e.g., async, reactive, streams, coroutines, solvers, DSLs, declarative GUIs, etc)
do-notation in Haskell • Computation Expressions in F# • scala-virtualized in Scala 8 do x1 <- fun1 x2 <- fun2 funnier x1 x2 compute { for x in 1..2 do return x } __match.runOrElse(x)(x1 => P.unapply(x1).flatMap(x2 => __match.one(x2._1 + x2._2)))
{}; recaf String usingExample(String path) { using (Resource r : new Resource(path)) { return r.readLine(); } } using the new construct declaring the new semantics 10
String usingExample(String path) { return (String) alg.Method(alg.Using( () -> new Resource(path), (Resource r) -> { return alg.Return(() -> r.readLine()); })); } code is transformed into calls to methods of the semantics object notice the signature of Using 11
an interface • Recaf comes with a predefined set to extend or override in case of new • written in plain Java by the developer interface MuJavaMethod<R, S> { R Method(S s); } interface MuJava<R, S> { S Exp(Supplier<Void> e); S If(Supplier<Boolean> c, S s1, S s2); <T> S For(Supplier<Iterable<T>> e, Function<T, S> s); <T> S Decl(Supplier<T> e, Function<T, S> s); S Seq(S s1, S s2); S Return(Supplier<R> e); S Empty(); } 15
also want to alter the control flow interface MuJavaCPS<R> extends MuJava<R, SD<R>> { ... } interface SD<R> { void accept(K<R> r, K0 s); } dealing with denotations An OCaml developer will see: val SD : (r → unit) → (unit → unit) → unit A language designer will see: SD[[ · ]]ρ, σ , etc 17
primary() { choice { alt "value": regexp String n = "[0-9]+"; return new Int(n); alt "bracket": lit! "("; let Exp e = addSub(); lit! ")"; return e; } } switch like declaration like declaration like return like
compilation pipeline • Runtime performance depends on the implementation of the semantics • Interpretation is slow at the moment • For generative scenarios that cost is amortized 25
handlers, freer?) • Performance Assessment: Recaf, Partially Evaluated • Use Recaf to create a template language for JS / transpilation (with the syntax of Java, e.g., ASP.NET’s Razor) • Improve typing features toward modular type checking • class definitions - memory layout overriding • … and Development • Develop an ecosystem (e.g., a package manager for dialects, e.g., recaf-pm install z3-extension async-extension) 26