MAL implementation in Modula-2. #731
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implementation uses the GNU Modula2 compiler and it runs all sets and test suites. Dockerfile is availabe for systems without a gm2 compiler.
The implemention was harder than I expected. I worked with modula-2 twice in my early jobs. And I have fond memories of it. This work has also served as a reminder of those early days when everything was yet to be built, and we reinvented the wheel continously.
Summary
GM2 Compiler
Having a GM2 compiler was the key enabler of this implementation, furthermore it includes the PIM and ISO libraries.
I realized there was a modula-2 compiler two years ago, despite it have been available for more than ten years. Knowing the compiler was available, the only remaining challenge was finding enough time to dedicate to the project.
GM2 ALLOCATE/NEW
50% of the project was fighting with the ALLOCATE/NEW to reserve memory. It's slow. ALLOCATE / NEW also tracks every reserved object in a list. Some of the steps make heavy use of dynamic memory, and the ALLOCATE is really slow due to the objet tracking management. By step 5 i give up, and started using malloc. It was soo slow that the TCO test timeout despite the tail call optimization was workin was working..
Garbage collector
I intend to implement a Garbage Collector (Mark-and-Sweep or Cheney-style copying), if I can allocate additional time.
Run Suite
$ make "docker-build^modula2"
$ make DOCKERIZE=1 "test^modula2"
Thanks
Obviously this implementation wasn't posible without the work of Niklaus Wirth and Gaius Mulley.
Pull request requirements:
the implementation name.
Additional requirements if you are adding a new implementation (see FAQ for details):
impls/<IMPL>/Dockerfileimpls/<IMPL>/MakefileIMPLS.ymlMakefile.implsREADME.md