Closed const-rs closed 8 years ago
From my first review it looks good.
Maybe @melsman have a test-suite for .mlb files used in MLKit that you try your parser on. Because I would like mosml to be compatible with both MLTon and MLKit.
There seem to be some tests at https://github.com/melsman/mlkit/tree/master/test/mlbtest
Ken, actually we need to discuss the request - it is growing. :-) At some point it should be merged and mosmlb developed further. Do you agree to merge if if I add invocation of mosmlc and relative paths to current state of the program? Or you think that it should be merged only when it is absolutely complete? (i.e. can compile MLkit + MLton?)
Current state - correct parse of all VALID constructions (there are some extensions in MLkit), can substitute path variables, work with quoted paths, read recursively included .mlb files (though does not check if there are cycles).
Besides that I need you or me to update bootstrap versions of MosML compiler tools (src/{mosmlcmp,mosmllnk,mosmldep and etc) - currently present are really old and sometimes bootstrap compiler fails with Size exception (if sources have syntax errors). If I just recompile everything and replace these tools with new version, everything works smooth. Of course double recompilation is necessary - recompile, replace bootstrap by new ones, recompile and again replace.
I'd be perfectly happy to merge mosmlb, once you think it is in a state where it make sense to merge. The biggest thing I see missing is a README.md
file with an overview of what is done and what is missing. Once a minimal README file is added I'd be happy to merge.
From my own work on mlb support fo mosml, I don't think that you fully support all features .mlb files without extending mosmlc
. The main problem is that allows local hiding of compilation units/structures. That said I think that a version of mosmlb that support basic .mlb files would be a really valuable first step.
Second, updating the bootstrap versions of the compiler tools is a bit more intricate that it seems. It needs to be done on a 32-bit platform, because a compile-time dependency on the platform gets baked into the files. Maybe that's why you get a Size
exception. I'll look into it.
Great!
My target is as complete as possible implementation. But yes, this target requires extending mosmlc
.
At first I want to complete mosmlb
to the point where it can provide support for basic mlb
files - i.e. without transferring information to mosmlc
except list of files to compile and name of output file.
I will write TODO and README.md files and check everything above (except test suites - they will make PR less clear to read). Hope to complete it in couple days - this week was extremely busy.
I think it worth splitting this PR into:
mlb
semantics, no test suite (from ML kit).mlb
features handling.I just checked the version of bootstrap mosmlcmp - it is really outdated:
[const@altair mosmlb]$ ../camlrunm ../mosmlcmp -v Moscow ML compiler version 2.10 PRE-RELEASE SHOULD NOT BE DISTRIBUTED (May 2008) Based in part on Caml Light and the ML Kit
As promised, I've completed MosMLB to some checkpoint, where it can at least compile mosmlb-test (program to run MLB parser unit tests) on my machine. I added README.md file for MosMLB. First milestone - proof-of-concept is reached, so this PR can be merged.
The next target is to add all necessary features as mentioned in README.md. After merging current PR, I would like:
Ken, would you please merge this PR. There are already 20 files and 35 commits. The first goal in README.md is reached - mosmlb can compile itself (try ../camlrunm mosmlb mosmlb.mlb).
I have another patch for MosML pending (header for executables should be generated at the build stage, not installation stage, because RPM and DPKG use fake root directory to make a package).
Sorry, the last couple of weeks have been rather busy on my side.
Everything looks fine, I'll merge the PR right away,
Thanks!
This is a very preliminary version of the parsers to parse .mlb files.
Currently it can read all .mlb files from MLton, sml-nj and all but 4 files from MLkit distributions and correctly make Parse tree.
Files that break parser contain non-standard keywords.
Parser
Program