7 @Specialization( rewriteOn=ArithmeticException.class) int add(int l, int r) { return Math.addExact(l, r); } @Specialization double add(double l, double r) { return l + r; } @Specialization(guards = "isString") String doString(Object l, Object r) { return l.toString() + r.toString(); } Truffle Requirements L1: decl rax jz L2 movl rcx, rdx[16+4*rax] cvtsi2sd xmm1, rcx addsd xmm0, xmm1 jmp L1 L2: + Generality Ruby, JavaScript, Python, R, J, Java, Groovy, Clojure, Scala ... function f(a, n) { var x = 0; while (n-‐-‐ > 0) { x = x + a[n]; } return x; } Simplicity + Performance