Brain dump some TODOs
This commit is contained in:
parent
22c87f3589
commit
9ea4774c64
74
TODO.org
Normal file
74
TODO.org
Normal file
|
@ -0,0 +1,74 @@
|
|||
#+TITLE: Where next for guile-prescheme?
|
||||
|
||||
* TODO guile repl integration
|
||||
|
||||
Currently the "prescheme" language definition is just scheme with a different
|
||||
default environment (aka. the "prelude", the stuff that's imported by default).
|
||||
|
||||
In the Guile REPL you can =,L prescheme= to switch language, but it's not very
|
||||
useful because you stay in the guile-user module, which is Guile's default
|
||||
environment, not Pre-Scheme's!
|
||||
|
||||
You can create a Pre-Scheme module and switch into it with some effort:
|
||||
|
||||
#+BEGIN_SRC scheme
|
||||
(use-modules (system base language))
|
||||
(set-module-name! (default-environment 'prescheme) '(prescheme-user))
|
||||
,module prescheme-user
|
||||
,language prescheme
|
||||
#+END_SRC
|
||||
|
||||
We need to make the process of "give me a Pre-Scheme REPL" easier. Maybe just
|
||||
ship a REPL launcher script which starts up in Pre-Scheme instead of Guile?
|
||||
|
||||
* TODO translate s48 macros to syntax-case
|
||||
|
||||
Scheme 48 uses "explicit renaming" macros, these should be ported to
|
||||
syntax-case.
|
||||
|
||||
#+BEGIN_SRC scheme
|
||||
;; scheme48-1.9.2/scheme/alt/define-macro-define-syntax.scm
|
||||
(define-macro (define-syntax macro-name transformer . stuff)
|
||||
`(define-macro (,macro-name . args)
|
||||
(,transformer (cons ',macro-name args)
|
||||
(lambda (x) x)
|
||||
eq?)))
|
||||
#+END_SRC
|
||||
|
||||
** TODO prescheme/s48-defenum.scm
|
||||
- define-enumeration
|
||||
** TODO prescheme/ps-defenum.scm
|
||||
- define-external-enumeration
|
||||
** TODO prescheme/prescheme.scm
|
||||
- goto
|
||||
- external
|
||||
|
||||
* TODO prepare some compatibility tests
|
||||
|
||||
We need to find collect all the "real-world" Pre-Scheme we can get our hands on,
|
||||
and test that our Guile Pre-Scheme produces identical output to Scheme 48
|
||||
Pre-Scheme.
|
||||
|
||||
Exhibit A is the "hello world" from the manual:
|
||||
|
||||
#+BEGIN_SRC scheme
|
||||
;; https://thintz.com/resources/prescheme-documentation#Example-Pre_002dScheme-compiler-usage
|
||||
(define (main argc argv)
|
||||
(if (= argc 2)
|
||||
(let ((out (current-output-port)))
|
||||
(write-string "Hello, world, " out)
|
||||
(write-string (vector-ref argv 1) out)
|
||||
(write-char #\! out)
|
||||
(newline out)
|
||||
0)
|
||||
(let ((out (current-error-port)))
|
||||
(write-string "Usage: " out)
|
||||
(write-string (vector-ref argv 0) out)
|
||||
(write-string " <user>" out)
|
||||
(newline out)
|
||||
(write-string " Greets the world & <user>." out)
|
||||
(newline out)
|
||||
-1)))
|
||||
#+END_SRC
|
||||
|
||||
* TODO write more TODOs
|
Loading…
Reference in a new issue