application/octet-stream
•
1.10 KB
•
30 lines
#!/usr/bin/env nujel
[def new-env [ω]]
[def ext-nuj? [path/ext?! "nuj"]]
[def directory/read-relative [λ [path]
[map [λ [α] [cat path "/" α]]
[directory/read path]]
]]
[def stdlib-files [filter ext-nuj? [append [directory/read-relative "stdlib"]
[directory/read-relative "binlib"]]]]
[println [ansi-green "Starting the Eval Bootstrap phase!"]]
[try [λ [err] [println "Exception during stdlib eval"] [display/error err] [exit 1]]
[for-each [λ [cur-path]
[println [cat [ansi-yellow " [EVA] "] cur-path]]
[def file [compile [cons 'do [read [file/read cur-path]]]]]
[apply new-env `[[eval* ,file]]]
]
stdlib-files]
]
[println [ansi-green "Starting the Compile phase!"]]
[try [λ [err] [println "Exception during stdlib compilation"] [display/error err] [exit 2]]
[for-each [λ [cur-path]
[println [cat [ansi-green " [NUJ] "] cur-path]]
[apply new-env [list `[file/compile ,cur-path]]]
]
stdlib-files]
]