Part 3: The Key to Zen: A Nano Framework for Sequential Programming
The page Sequentially Programmed Web App Demo on Mashweb.Club goes into depth on the topics of web continuations and the sequential programming for web apps. The topics there must be understood by a programmer who wants to create web apps using Zen. The page Demo #2: Introduction to Zen sequential web app programming presents the same demo and one more, a calculator web app, whose body is just 18 lines. The brevity of such an app demonstrates the simplicity and straightforwardness of Zen web apps.
The way Zen uses call/cc is reminiscent of how the POSIX system calls select(2) and poll(2) work. Here is a Biwascheme code block using Zen’s with-handlers macro:
(with-handlers ((click-handler "#div1") (click-handler "#div2") (keydown-handler "#button1") (keydown-handler "#button2") (timeout-handler test-timeout 10000)) (display (get-input)) (display (get-input)) (display (get-input)) (display (get-input)) (display (get-input)))
Alexander Sukhoverkhov wrote the core of the nano framework (the macro with-handlers and the pieces of code that make it work. He told me he used a paper to implement shift and reset in jsScheme: https://www.deinprogramm.de/sperber/papers/shift-reset-direct.pdf
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.