Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Black

< >

Black is a programming language created in 2014 by Kenichi Asai.

#2760on PLDB 11Years Old
Homepage

Black is an extension of Scheme with a reflective construct exec-at-metalevel. It executes its argument at the metalevel where the interpreter that executes user programs is running. There, one can observe, access, and even modify the metalevel interpreter in any way. Because the metalevel interpreter determines the operational semantics of the language, Black effectively allows us to observe, access, and modify the language semantics from within the same language framework.


Example from the web:
(define eval-instr (lambda (exp env cont) (let ((original-eval-application eval-application) (instr-counter 0)) (set! eval-application (lambda (exp env cont) (set! instr-counter (+ instr-counter 1)) (original-eval-application exp env cont))) (base-eval exp env (lambda (ans) (set! eval-application original-eval-application) (display "#app: ") (write instr-counter) (newline) (cont ans)))))) (let ((original-eval-application eval-application)) (set! eval-application

- Build the next great programming language Add Add Prompt Issues About Search Keywords Livestreams Labs Resources Acknowledgements

Built with Scroll v178.0.0

(lambda (exp env cont)

(cond ((eq? (car exp) 'instr)

(eval-instr (car (cdr exp)) env cont))

(else

(original-eval-application exp env cont))))))