Skip to content

Conversation

@zawaza-blog
Copy link

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

  • All steps implemented, Pass all tests.
  • Do not use modula2 ALLOCATE, details below.
  • Do not have a garbage collector.

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:

  • Commits are well written and well organized.
  • Commits for a specific implementation should be prefixed with
    the implementation name.
  • Github Actions CI passes all checks (including self-host)

Additional requirements if you are adding a new implementation (see FAQ for details):

  • Follow incremental structure (no common eval code)
  • Add impls/<IMPL>/Dockerfile
  • Add impls/<IMPL>/Makefile
  • Update IMPLS.yml
  • Update Makefile.impls
  • Update README.md

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
-------

* All steps implemented, Pass all tests.
* Do not use modula2 ALLOCATE, details below.
* Do not have a garbage collector.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant