Skip to content

Instantly share code, notes, and snippets.

@syoyo
Created August 29, 2015 12:02
Show Gist options
  • Save syoyo/901a2a2d47b32834e917 to your computer and use it in GitHub Desktop.
Save syoyo/901a2a2d47b32834e917 to your computer and use it in GitHub Desktop.
None trial
$ cat test.n
(none
; This top-level code is dynamic and compiled to Lua code
(function printhello ()
; all statements are symbolic expressions
; known from Lisp and Scheme
(print "None is as dynamic as this!"))
(static mymul(a b)
: (float <- (float float))
(* a b))
(mymul --> (disas))
(print (mymul 2 3))
)
$ none test.n
definition {float,float} -> float
; Function Attrs: nounwind
define float @"$anon (/Users/syoyo/work/none/src/none/emit_terra.t:8)"(float, float) #0 {
entry:
%2 = fmul float %0, %1
ret float %2
}
assembly for function at address 0x85e0010
0x85e0010(+0): vmulss xmm0, xmm0, xmm1
0x85e0014(+4): ret
6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment