mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 04:55:04 +02:00
WIP
This commit is contained in:
parent
3d2fdb36d9
commit
f88016eb3e
1 changed files with 25 additions and 10 deletions
35
cyclone.scm
35
cyclone.scm
|
@ -216,15 +216,30 @@
|
||||||
(trace:info "---------------- after alpha conversion:")
|
(trace:info "---------------- after alpha conversion:")
|
||||||
(trace:info input-program) ;pretty-print
|
(trace:info input-program) ;pretty-print
|
||||||
|
|
||||||
;;; EXPERIMENTAL CODE
|
;; EXPERIMENTAL CODE
|
||||||
;;; TODO: extend this initially by, for each import, invoking that module's inlinable_lambdas function
|
;; TODO: extend this initially by, for each import, invoking that module's inlinable_lambdas function
|
||||||
;;; behind an exception handler (in case the compiler does not have that module loaded).
|
;; behind an exception handler (in case the compiler does not have that module loaded).
|
||||||
;;;
|
;;
|
||||||
;;; Longer term, need to test if module is loaded (maybe do that in combo with exception handler above)
|
;; Longer term, need to test if module is loaded (maybe do that in combo with exception handler above)
|
||||||
;;; and if not loaded, eval/import it and try again.
|
;; and if not loaded, eval/import it and try again.
|
||||||
;;;
|
;;
|
||||||
;;; assumes (scheme base) is available to compiler AND at runtime in the compiled module/program
|
;; assumes (scheme base) is available to compiler AND at runtime in the compiled module/program
|
||||||
;;; TODO: probably not good enough since inlines are not in export list
|
;; TODO: probably not good enough since inlines are not in export list
|
||||||
|
|
||||||
|
;(for-each
|
||||||
|
; (lambda (import)
|
||||||
|
; (let* ((lib-name-str (lib:name->string (lib:list->import-set import)))
|
||||||
|
; (inlinable-lambdas-fnc
|
||||||
|
; (string->symbol
|
||||||
|
; (string-append "c_" lib-name-str "_inlinable_lambdas"))))
|
||||||
|
;TODO: no, only import if not previously loaded. may need a new export for this
|
||||||
|
; #t ;(eval `(import ,import))
|
||||||
|
; (%import import)
|
||||||
|
; ;(define vars/inlines (eval `( ,inlinable-lambdas-fnc )))
|
||||||
|
; ;(trace:info `(DEBUG ,import ,vars/inlines))
|
||||||
|
; ))
|
||||||
|
; imports)
|
||||||
|
|
||||||
;(for-each
|
;(for-each
|
||||||
; (lambda (psyms)
|
; (lambda (psyms)
|
||||||
; (let ((var (car psyms)) (inline (cdr psyms)))
|
; (let ((var (car psyms)) (inline (cdr psyms)))
|
||||||
|
@ -241,7 +256,7 @@
|
||||||
; (lambda (psyms)
|
; (lambda (psyms)
|
||||||
; (list (cdr psyms) 'scheme 'base))
|
; (list (cdr psyms) 'scheme 'base))
|
||||||
; (eval '(c_schemebase_inlinable_lambdas)))))
|
; (eval '(c_schemebase_inlinable_lambdas)))))
|
||||||
;;; END
|
;; END
|
||||||
|
|
||||||
;; Convert some function calls to primitives, if possible
|
;; Convert some function calls to primitives, if possible
|
||||||
(set! input-program
|
(set! input-program
|
||||||
|
|
Loading…
Add table
Reference in a new issue