Shen-Language / shen-cl

Shen for Common Lisp (Unmaintained)
BSD 3-Clause "New" or "Revised" License
122 stars 11 forks source link

New compiler #44

Closed tizoc closed 5 years ago

tizoc commented 5 years ago

Still have to cleanup the bootstrapping process.

TODO:

Some notes:

rkoeninger commented 5 years ago

Compiler looks great and those unit tests are a good addition!

How does this relate to backend.shen and backend-boostrap.lsp? I take it they can be removed? Does this mean shen.exe is required for building now? Or will there be a compiler-bootstrap.lsp?

tizoc commented 5 years ago

@rkoeninger backend* goes away. A working Shen compiler will be needed to bootstrap Shen/CL from the repository (any compliant Shen should work, because no platform specific extensions are used -- I have been using Shen/Scheme to make sure it works), but source releases will include all the precompiled files, so in that case one of the supported Common Lisp implementations will be all one needs to build Shen/CL.

tizoc commented 5 years ago

Ok, this is almost ready for merging, and warrants a 3.0 release.

Something that is not working right now is that the new compiler cannot compiler itself, still trying to figure out why it is failing (it is related to how it generates factorised defuns, the NIL in the block expression is being quoted, but I don't understand why, and only happens when compiling the code using this version of the compiler).

tizoc commented 5 years ago

Ok, fixed that.

tizoc commented 5 years ago

I guess I should also lowercase the Common Lisp code too, upper-case is not necessary anymore.

rkoeninger commented 5 years ago

Force eol=lf, breaking build on travis

I don't remember line endings being an issue before. What changed?

tizoc commented 5 years ago

The build script extracts the license from the files it compiles instead of hardcoding it.

Edit: to elaborate bit more, the files are parsed as a list of bytes, and since git on windows changes the line endings, that breaks.

tizoc commented 5 years ago

@rkoeninger do you know if Windows (or the CL ports on Windows) do some automatic conversion from "\n" to "\r\n" when writing to a stream? Because this made me check the nl function in the kernel and it only writes the byte 10 (\n), not 13 + 10 (\r\n).

rkoeninger commented 5 years ago

I don't believe CL on Windows (and definitely not Windows itself) adds the "\r". CL on Windows will probably use "\r\n" when writing "~%" as part of a FORMAT.

nl only does "\n" but i think the parser handles both?

tizoc commented 5 years ago

Yes, the reader doesn't mind \r, because it doesn't mind newlines at all, they are just whitespace.

tizoc commented 5 years ago

@rkoeninger I updated the build script so that it handles CRLF and reverted the "eol=lf" attribute change.