Git Product home page Git Product logo

m2bsk's Introduction

M2BSK Modula-2 Bootstrap Kernel Project

Welcome to the M2BSK Modula-2 Bootstrap Kernel Project

Objective

The objective of this project is to develop a bootstrap compiler for the revised Modula-2 language described in

Modula-2 Revision 2010, Language Report for the Bootstrap Kernel Subset (BSK), by Kowarsch and Sutcliffe, July 2020.

Grammar

The grammar of the compiler's command line interface is in the project repository

https://github.com/m2sf/m2bsk/blob/master/grammar/m2cli-grammar.gll

The grammar of the compiler's input language is in the project repository

https://github.com/m2sf/m2bsk/blob/master/grammar/m2bsk-grammar.gll

For a graphical representation of the grammar, see section Syntax Diagrams.

Language Specification

An online version of the language specification is here:

https://github.com/m2sf/m2bsk/wiki/Language-Specification

The authoritative language specification (PDF) is available for download:

https://github.com/m2sf/PDFs/blob/master/M2BSK%20Language%20Description.pdf

Scope

The compiler supports the Bootstrap Kernel (BSK) subset of Modula-2 R10. It does not support earlier PIM or ISO dialects.

For a list of facilities that have been omitted in the subset, see Omissions

Targets

The compiler will generate classic Modula-2 sources that can be compiled with any Modula-2 compiler that meets the prerequisites for compiling M2BSK itself. An LLVM backend will be added later to generate LLVM IR.

License

M2BSK is licensed under the GNU Lesser General Public License (LGPL) both v.2.1 and v.3.

Prerequisites

M2BSK is written in a subset of the third and fourth editions of Niklaus Wirth's "Programming in Modula-2" that represents an intersection with ISO Modula-2 (IS 10514-1) in order to facilitate compilation with any classic Modula-2 compiler, regardless of dialect and platform.

Nevertheless, the host compiler needs to support one of the following memory models:

  • 16-bit CARDINAL type and 32-bit LONGINT type
  • 32-bit CARDINAL type and 32-bit LONGINT type
  • 32-bit CARDINAL type and 64-bit LONGINT type

Furthermore, the following libraries from Wirth's "Programming in Modula-2" are required.

  • Storage
  • Terminal
  • FileSystem

These libraries should be part of any PIM Modula-2 compiler's library. For use with ISO Modula-2 compilers, M2BSK provides shim libraries for adaptation to ISO Modula-2 libraries.

There are no dependencies on any third party libraries.

OS support

M2BSK will run on any operating system with target support by the host-compiler.

Development Languages

  • M2BSK itself is written in classic Modula-2
  • The syntax diagram generator script is written in TCL/TK (not required to build M2BSK)
  • Build configuration scripts are written in the prevalent shell language of the hosting platform

Contact

If you have questions or would like to contribute to the project, get in touch via

+++

m2bsk's People

Contributors

brianknoblauch avatar gitter-badger avatar m2sfpa avatar trijezdci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

m2bsk's Issues

Wiki TO DO

  • complete formal parameters section
  • add section for scoping rules
  • rename section type semantics to allocation, describe allocation for all types
  • add section on convertibility of types
  • add section on structured value constructors
  • move pragma semantics to a pragma section somewhere towards the end

loose ends:

  • explain rules for duplicate imports
  • unqualified name for types whose identifiers equal that of their module
  • dot notation procedure invocation for variables of module types
  • state that indeterminate records can only be targets of pointer types
  • array subscript notation can be used on instances of type address

Please tell how to build this with e.g. m2c

m2c-0.7 is the only Modula 2 compiler I can get to work (after some tweaking) here on Linux.

Please do add instructions. It isn't even apparent which is the program (not used module) file!

Is it possible to build the bootstrap compiler?

I've been using gnu modula-2 over vacation and enjoying it very much. I'm intrigued by some of the newer generic and object extensions mentioned on Rick Sutcliffe's excellent Modula-2: Abstractions for Data and Programming Structures but can't find a compiler that supports the full range of that document's content and am searching for a compiler that is up to the task.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.