#langscheme/base;; The restricted language we're writing our compiler in.
;; Part of the self-hosting. The Javascript compiler will be written
;; in a small superset of intermediate-level scheme, so we can then
;; bootstrap things.
(require (prefix-inbase:scheme/base)
scheme/contractlang/htdp-intermediate-lambda
(for-syntaxscheme/base)
"error-struct.ss")
(provide (except-out (all-from-outlang/htdp-intermediate-lambda)
define-structdefinequoteletletreclet*image?image=?))
(define-syntax (my-define-structstx)
(syntax-casestx ()
[(_id (fields...))
(syntax/locstx
(base:define-structid (fields...)
#:prefab#:mutable))]))
(base:define (syntax-errormsg . stx)
(raise (make-exn:fail:moby-syntax-errormsg (current-continuation-marks) stx)))
;; The following primitives will need support in the runtime,
;; or be handled specially by the preprocessor.
(provide (rename-out (base:provideprovide)
(base:quotequote)
(my-define-structdefine-struct)
(base:definedefine))
;; Contract-related stuff: the following will be erased on
;; javascript bootstrapping time.
provide/contract->any/clistoflist/cor/cfalse/cnatural-number/chash?beginvoidset!build-vectormake-vectorvectorvector-lengthvector-refvector-set!vector?caseletlet*letrec;; The rest of these primitives will be implemented for the kernel.
;; Hash stuff
;; FIXME: the hash in javascript only accepts strings as keys.
;; We should use contracts here.
hash-sethash-refhash-removemake-immutable-hasheqhash-mapsyntax-error;path->string normalize-path path? resolve-module-path build-path
)