> I wonder why error messages are put in stdout instead of stderr.
For the bootstrap compiler, it was not worth adding support for stderr. Also, the surrounding context is often the best clue as to what's going on.
On 23 juil. 2011, at 14:13, Leledumbo wrote:
> I've just cloned the git repo, and try bootstrapping with MinGW (very
> latest version taken with latest mingw-get). However, upon compiling
> nxl, the generated compiler.xl.C has this line:
>
> [Compiler generated] Unable to load bytecode file "xl.bytecode"
What is interesting is that this message can only come from nxl. AFAICT, it doesn't exist in xl or bxl. So you compiled the C++ compiler, that compiler created and ran bxl, bxl created and ran nxl, and nxl fails to find the bytecode so it can't compile itself.
The culprit is somewhere around line 159 of xl.codegenerator.xl. Could you try adding some instrumentation code in there, so that it looks like this:
S : SC.scanner
DirName : text
for DirName in MACRO.include_path loop
// ADDED
IO.WriteLn "// DIR=", DirName
NormalizedName : text := PT.XLNormalize(filename)
NameInDir : text
Directory : string of text := FL.Directory(DirName)
for NameInDir in Directory loop
// ADDED
IO.WriteLn "// IN ", DirName, " FILE=", NameInDir
if PT.XLNormalize(NameInDir) = NormalizedName then
FullName : text := DirName + "/" + NameInDir
// ADDED
IO.WriteLn "// FULLNAME=", FullName
S := SC.Open (FullName)
exit if S <> nil and IO.valid S.input
exit if S <> nil and IO.valid S.input
if S = nil or not IO.valid S.input then
ERR.Error "Unable to load bytecode file $1",
PT.NewText(filename, '"', -1)
return
This may tell us why we have a problem looking for the file.
> I tried printing PT.XLNormalize(NameInDir) and NormalizedName and now
> I know where the problem is. NormalizedName contains no file extension
> while the result of PT.XLNormalize does (and so does NameInDir
> itself). It seems to be initialized in xl.translator.xs and indeed it
> has no extension.
It's interesting, but I don't think that's the issue here. From your earlier message :
// DIR=.
// IN . FILE=.
// IN . FILE=..
// IN . FILE=Makefile
// IN . FILE=TESTS
...
// DIR=library/runtime/default/.
[Compiler generated] Unable to load bytecode file "xl.bytecode"
Normally, "default" is a symbolic link to the C directory. I guess MinGW doesn't know about symbolic links. Try copying the contents of library/runtime/C into library/runtime/default. That should do it.
>
> Btw, I'm new to this language. What's the difference between .xl
> and .xs file conventionally? Both seems the same syntactically.
xs is for specifications of modules, and xl for implementations.
Thanks
Christophe
Christophe
> --
> You received this message because you are subscribed to the Google Groups "XL programming language and runtime" group.
> To post to this group, send email to xlr-...@googlegroups.com.
> To unsubscribe from this group, send email to xlr-talk+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xlr-talk?hl=en.
>