Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Swift as a C Language REPL.
https://www.reddit.com/r/lisp/comments/bgwtsh/fun_ecl_hack/
It can be as simple as:
(defun c-repl () (loop (fresh-line) (princ "c99> ") (let* ((form (read-line)) (func (eval `(let ((*compile-verbose* nil)) (compile nil (lambda () (ffi:c-inline nil nil :void ,form))))))) (funcall func)))) > (c-repl) c99> printf("HELLO world!\n"); HELLO world! c99> { for(int i=0; i<4; i++) printf("*"); printf("\n"); } ****
Fun thing is, you can just paste the above defun into your ECL REPL and execute it :).
There are no comments on this comment yet.
https://www.reddit.com/r/lisp/comments/bgwtsh/fun_ecl_hack/
It can be as simple as:
(Though that doesn't expose all features of C. More work is required to turn it into complete REPL.)Fun thing is, you can just paste the above defun into your ECL REPL and execute it :).