Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# The __foo stuff is a compiler hack for running raw instructions,
# so __foo runs the "foo" instruction. The single "_" stuff is to
# tell the compiler to automatically generate a register for a value.
class Pid:
def construct(id):
let @id = id
pub def id:
class Process:
pub def self.spawn(code):, code))
pub def self.receive:
pub def self.send(pid, message):
__send_process_message(_,, message)
pub def self.current:
let pong = Process.spawn:
let received = Process.receive
let pid = received[0]
let msg = received[1]
Process.send(pid, "pong")
Process.send(pong, [Process.current, "ping"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.