MO

mo is an attempt to copy node.js's architecture based on guile and libuv.


Project maintained by wehu Hosted on GitHub Pages — Theme by mattgraham

Welcome to mo.

mo(re) = guile + libuv.

mo is an attempt to copy node.js's architecture based on guile and libuv. On top of guile and libuv, have a fun to program in scheme in a platform like node.js. User will benefit from both scheme language features and asynchronous IO.

This project is incomplete and under heavy development.

Example

(require-mo "http" 'http)

(http/start-server "0.0.0.0" 8080
  (lambda (req resp)
    (hashq-set! resp 'body "<b>hello world!</b>")
    resp)

Features:

APIs:

Module system:

mo's module system is like node.js's. A mo file is a module. 'require-mo' is to load/evaluate file and 'export-mo' is to export functions in a module, so that other modules can access the functions.

example:

file: m1.mo

(define (foo)
  (display "foo\n"))
(export-mo 'foo)

file: m2.mo

(require-mo "m1.mo" 'm)
(m/foo)

Tick:

example:

(next-tick 
  (lambda ()
    (display "hi\n")))

Timer:

example:

(set-timeout (lambda ()
  (display "timeout\n"))
  100)

example:

(define timer (set-timeout
  (lambda ()
    (display "hi\n"))
      1000))
(clear-timer timer)

Process:

More...