native.aug
A native C boundary · Source and specification
Files in this project
Code
aug
// aug-spec: "native.aug.md" explains this file. Read it before changes; refresh with aug spec.
extern C puts(string message) returns c_int
announce():
unsafe:
puts(message="hello from C FFI")Compiled specification
puts · source
It takes message as a string. It returns c_int. Native C implementation; only its declared contract is visible here.
announce · source
It can call C.puts. Within an unsafe block, it calls puts with message "hello from C FFI". Native operations must satisfy their declared C contracts. source
Checked interface
text
announce() returns void uses C.putsIt can call C.puts.