TweetFollow Us on Twitter

About Modula-2
Volume Number:1
Issue Number:5
Column Tag:Modula-2

Modula-2

By John Bogan

Abstract: MODULA Corporation of Provo, Utah has shipped a $90.00 Beta site version of Modula-2 which runs reasonably well on a single disk 128K Macintosh. This paper attempts to make the case that Modula-2 deserves a thorough analysis to determine if it is the ideal standalone development language for serious commercial software on the Apple Macintosh. The conclusion of this paper is that Modula-2 will soon become the language of choice for farsighted software developers through the rest of the 1980’s and it is through the efforts of enlightened companies such as MODULA Corp. that this joyous result will come about.

A Short History of Modula-2

The history of Modula-2 is the history of its designer, Dr. Niklaus Wirth. We pick up the story in the late 1960’s when Dr. Wirth was a member of a large committee whose task was to design a successor to the language ALGOL-60, a highly popular language in Europe. ALGOL-60 is widely regarded as the inspiration for the discipline of Structured Programming which is the most significant breakthrough in software engineering in the past two decades. The result of this committee’s efforts was ALGOL-68, a kludge. No coherent design philosophy guided this effort resulting in a chaotic collection of features reminiscent of PL/I. In short, failure.

At this point Dr. Wirth abandoned the committee approach and decided to design his own language. Influenced by the structured programming theories of Dijkstra, Hoare and Dahl, Dr. Wirth set out to construct a language he could use to teach his own students the fundamentals of good programming. He began with some modest goals.

[“The development of the language Pascal is based on two principal aims. The first is to make available a language suitable to teach programming as a systematic discipline based on certain fundamental concepts clearly and naturally reflected by the language. The second is to develop implementations of this language which are both reliable and efficient on presently available computers.”] Pascal Report, page 1, 1974, Niklaus Wirth

The rest is history. As anyone who follows the computer industry well knows Pascal is one of the major influences on the software world today, particularly in the microcomputer world. To cite only one example the second largest manufacturer of personal computers in 1984 appears to have adopted Pascal as its standard design language. That company is, of course, Apple Computer, Inc. As I understand it most of the algorithms, data structures and techniques designed into the LISA and the Mac began life as Pascal programs.

But Pascal has significant flaws. Volumes have been written disparaging Pascal as a systems programming language and as a vehicle for writing applications of all stripes and colors. (Never mind that the language was never intended to do any of these things.) Further, and more disturbing, Pascal has been repeatly bastardized by its implementors with a wide variety of (incompatible) extensions. After a decade in the field there is no such thing as Standard Pascal any more than there is a tooth fairy. Nevertheless, many talented software people believe that even with its flaws Pascal is still the best practical general purpose language we have at our disposal. I believe this situation is about to change.

On with Wirth’s story. After largely washing his hands of Pascal Dr. Wirth turned his attention to multitasking and the problems of building large commercial programs using teams of programmers. As it happens Pascal is utterly unsuited for both of these activities. So Wirth designed himself a new, very simple language he called Modula. This language was never particularly practical it was more like a “hack” from one of the more gifted computer scientists around. However, it laid the groundwork for the concepts of seperate compilation, modularity and libraries.

In 1976 Dr. Wirth took a sabbatical from his mountain hideaway, Eidgenössische Technische Hochschule, Instut für Informatik, better known as ETH in Zürich, Switzerland and visited that fount of inspiration - Xerox PARC. As Mac enthusiasts we all know what that means. Personal workstations, high resolution bit maps, mice, windows, icons, Smalltalk etc. Less well known is the Xerox systems implementation language MESA. This language is a derivative of Pascal suitable for team implementation of low-level systems programs. The pieces were falling into place. Like many visitors to PARC Dr. Wirth came away with an inspiration.

Dr. Wirth was tired of the bitching and moaning surrounding Pascal.

[“If a language proves to be only marginally suitable for some application that was obviously not envisaged by its originator, we should muster the courage to build a new, truly adequate tool, instead of just grafting a fix onto the existing one.”] Byte, April 1983, pg. 386, Niklaus Wirth

Dr. Wirth’s inspiration was to build a new computer system from the ground up. A machine which would be programmed in one language from soup to nuts. From OS to text editor to graphics editor to who-knows-what, databases, spreadsheets, adventure games, what- ever. Recognizing that a one language machine would require the use of dangerous low-level facilities as well as the safety, convenience and productivity of the high level structured features he sifted through his encyclopedic knowledge of Pascal, Modula and MESA and in 1978 he defined his new language. To quote:

[“Modula [1], a small language ...featured a facility to partition programs into modules with explicitly specified interfaces. This was precisely the facility needed to allow the introduction of so-called low-level facilities in the high-level language, because it allowed you to encapsulate them and to constrain their danger- ousness to clearly delineated parts of a program. Hence, the choice for the new language was Pascal, augmented by the module and a few other facilites, and regularized by a more systematic syntax. Thus was born Modula-2.”] Byte, August 1984, pg. 146, Niklaus Wirth

Dr. Wirth had his ideal language. He then sat down with a couple of hardware types and some graduate students and built a bit-slice (AM2901) single-user high resolution graphic workstation with windows, mouse and multiple font editor with laser printer long before the Macintosh ever saw the light of day! He called his machine Lilith. The sole American distributor for the Lilith and the Modula-2 compiler which this machine is built around is MODULA Corporation of Provo, Ut., makers of Modula for Mac.

Modula Benchmark

The following program is an imple- mentation of the Sieve of Eratosthenes expressed in Modula Corporation’s version of Modula-2 for the Apple Macintosh 128K. The following results were obtained when this program was compiled and executed.

The source (Prime.MOD) = 1,617 bytes.

Compile time was -1:45

The M-code (Prime.REL) = 324 bytes.

Link time was -1:20

The execution module = 4,348 bytes.

Execution time was -1:11 or 71 seconds.

Modula-2 Compiler,Interpreter Ver. 1.0.

MODULE Prime;  (* Sieve of Eratos. *)
(* $R-  disable subrange and type conv *)
(* $T-  disable index checking *)
FROM InOut IMPORT WriteLn, WriteCard, WriteString;
FROM Terminal IMPORT ClearScreen;
CONST Size = 8190;
VAR i, prime, k, count, iter : CARDINAL;
      Flags : ARRAY[0..Size] OF BOOLEAN;
BEGIN
      ClearScreen;
      WriteLn; WriteString(“10 Iterations”);
      FOR iter := 1 TO 10 DO
           count := 0;
         FOR i := 0 TO Size DO Flags[i] :=                           
                        TRUE END;
           FOR i := 0 TO Size DO
                IF Flags[i] THEN
                     prime := i + i + 3;
                     k := i + prime;
                    WHILE k <= Size DO
                           Flags[k] := FALSE;
                           INC(k,prime)
                    END;
                  INC(count)
            END;
       END;
   END;
   WriteLn; WriteCard(count,6); WriteString(‘ Primes’)
END Prime.

Modula-2 Benchmarks

A Comparison between versions and machines

LEGEND

Code System Seconds

1. Lilith 4.24

2. Hamburg Vax 11/750 4.64

3. Logitech Eagle 6.90

4. ETH LSI-11 8.78

5. Logitech IBM PC 15.80

6. Volition Sage 66.14

7. Modula Macintosh 71.00

8. MRI Eagle 90.70

9. MRI IBM PC 203.60

10. Volition IBM PC 209.50

11. Volition Apple II 377.00

Source: “Seven Modula-2 Compilers Reviewed” by Terry L. Anderson Journal of Pascal, Ada & Modula-2 Vol.3 No.2

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »
Explore some of BBCs' most iconic s...
Despite your personal opinion on the BBC at a managerial level, it is undeniable that it has overseen some fantastic British shows in the past, and now thanks to a partnership with Roblox, players will be able to interact with some of these... | Read more »

Price Scanner via MacPrices.net

You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices... Read more
Roundup of Verizon’s April Apple iPhone Promo...
Verizon is offering a number of iPhone deals for the month of April. Switch, and open a new of service, and you can qualify for a free iPhone 15 or heavy monthly discounts on other models: – 128GB... Read more

Jobs Board

Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.