mirror of
https://github.com/janet-lang/janet
synced 2024-11-18 14:44:48 +00:00
3a782d27b1
Allows for in memory linking.
20 lines
366 B
Plaintext
20 lines
366 B
Plaintext
(def ir-asm
|
|
'((link-name "add_vectorp")
|
|
(parameter-count 2)
|
|
|
|
# Types
|
|
(type-prim Double f64)
|
|
(type-array BigVec Double 100)
|
|
(type-pointer BigVecP BigVec)
|
|
|
|
# Declarations
|
|
(bind 0 BigVecP)
|
|
(bind 1 BigVecP)
|
|
(bind 2 BigVecP)
|
|
(add 2 0 1)
|
|
(return 2)))
|
|
|
|
(def ctx (sysir/context))
|
|
(sysir/asm ctx ir-asm)
|
|
(print (sysir/to-c ctx))
|