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

Xcode 15.0.1 - Integrated development en...
Xcode includes everything developers need to create great applications for Mac, iPhone, iPad, and Apple Watch. Xcode provides developers a unified workflow for user interface design, coding, testing... Read more
Google Chrome 120.0.6099.62 - Modern and...
Google Chrome is a Web browser by Google, created to be a modern platform for Web pages and applications. It utilizes very fast loading of Web pages and has a V8 engine, which is a custom built... Read more
Dropbox 188.4.6302 - Cloud backup and sy...
Dropbox is a file hosting service that provides cloud storage, file synchronization, personal cloud, and client software. It is a modern workspace that allows you to get to all of your files, manage... Read more
djay Pro 5.0 - Transform your Mac into a...
djay Pro provides a complete toolkit for performing DJs. Its unique modern interface is built around a sophisticated integration with iTunes and Spotify, giving you instant access to millions of... Read more
Things 3.19.4 - Elegant personal task ma...
Things is a task management solution that helps to organize your tasks in an elegant and intuitive way. Things combines powerful features with simplicity through the use of tags and its intelligent... Read more
Sublime Text 4169 - Sophisticated text e...
Sublime Text is a sophisticated text editor for code, markup, and prose. You'll love the slick user interface, extraordinary features, and amazing performance. Features Goto Anything. Use Goto... Read more
Typinator 9.1 - Speedy and reliable text...
Typinator turbo-charges your typing productivity. Type a little. Typinator does the rest. We've all faced projects that require repetitive typing tasks. With Typinator, you can store commonly used... Read more
ESET Cyber Security 6.11.414.0 - Basic i...
ESET Cyber Security provides powerful protection against phishing, viruses, worms, and spyware. Offering similar functionality to ESET NOD32 Antivirus for Windows, ESET Cyber Security for Mac allows... Read more
Opera 105.0.4970.29 - High-performance W...
Opera is a fast and secure browser trusted by millions of users. With the intuitive interface, Speed Dial and visual bookmarks for organizing favorite sites, news feature with fresh, relevant content... Read more
Quicken 7.4.1 - Complete personal financ...
Quicken makes managing your money easier than ever. Whether paying bills, upgrading from Windows, enjoying more reliable downloads, or getting expert product help, Quicken's new and improved features... Read more

Latest Forum Discussions

See All

‘Refind Self: The Personality Test Game’...
The last two months have been so busy that I’ve not been able to make time to play many games until recently. There are still new games coming out even as we head closer to the holidays, but I finally managed to play Playism and Lizardry’s recent... | Read more »
Experience the glory of the Northern Lig...
Dinosaur Polo Club, one of the best developer names out there, have recently announced the final update of 2023 for Mini Motorways. Instead of embracing Christmas, this event is instead inspired by one of the most beautiful natural phenomena, the... | Read more »
‘Disney Dreamlight Valley Arcade Edition...
After a bit of a delay, Disney Dreamlight Valley Arcade Edition () is now available on Apple Arcade worldwide. When Disney Dreamlight Valley Arcade Edition hit early access on PC and consoles including Nintendo Switch, I always assumed it would... | Read more »
‘Devil May Cry: Peak of Combat’ Releases...
It feels like we’ve been covering Devil May Cry: Peak of Combat (), the mobile entry in the superb Devil May Cry series, for as long as we were waiting for Devil May Cry 5. After trailers revealing gameplay, characters, controller support, betas,... | Read more »
‘Marvel Snap’ Dons Its Finest in the New...
It’s been quite a year for the card battler Marvel Snap (Free), which is still one of my favorite mobile games. There have been a bunch of interestingly-themed seasons, sometimes connected to the MCU and sometimes just doing their own thing. Plenty... | Read more »
SwitchArcade Round-Up: ‘A Highland Song’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for December 5th, 2023. It’s a bit of a short one today since I was busy with a variety of other things, but there are several new releases for us to summarize. There are some really... | Read more »
‘Metal Slug ACA NEOGEO’ Review – Another...
Well, here we go again. The latest addition to SNK and Hamster’s mobile Arcade Archives line is none other than Metal Slug ACA NEOGEO ($3.99), a second take on a game we got a mobile version of a decade back from Dotemu. That was a fine version for... | Read more »
‘Sonic Dream Team’ Apple Arcade Review –...
What an unusual day we have arrived upon today. Now, Sonic the Hedgehog games aren’t a new thing for iOS gaming. The original Sonic the Hedgehog appeared on the classic iPod, so the Blue Blur got in the doors as fast as you would expect him to. The... | Read more »
PvP Basketball Game ‘NBA Infinite’ Annou...
Level Infinite and Lightspeed Studios just announced a new real-time PvP basketball game for mobile in the form of NBA Infinite (). NBA Infinite includes solo modes as well, collecting and upgrading current NBA players, managing teams, and more. It... | Read more »
New ‘Dysmantle’ iOS Update Adds Co-Op Mo...
We recently had a major update hit mobile for the open world survival and crafting adventure game Dysmantle ($4.99) from 10tons Ltd. Dysmantle was one of our favorite games of 2022, and with all of its paid DLC and updates, it is even better. | Read more »

Price Scanner via MacPrices.net

Apple’s 14-inch M3 MacBook Pros are on Holida...
Best Buy is offering a $150-$200 discount on Space Gray or Silver 14″ M3 MacBook Pros on their online store with prices available starting at $1449 ($1399 for premium My Best Buy members). Prices... Read more
Holiday Sale: 128GB iPhone 15 Pro, 15 Plus, o...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 Pro, 128GB iPhone 15 Plus, or 128GB & 256GB iPhone 15 for $60 per month including... Read more
Clearance 12.9-inch iPad Pros with M1 CPUs av...
Apple has Certified Refurbished, previous-generation, 12″ M1 iPad Pros available in their online store in a variety of configurations. Models start at $889 and range up to $350 off Apple’s original... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Holiday sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
B&H is offering a $150 discount on 13-inc...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock today and on Holiday sale for $150 off Apple’s MSRP, only $949. Free 1-2 day delivery is available to most US addresses.... Read more
Apple is clearing out last year’s M1-powered...
Apple has Certified Refurbished 11″ M1 iPad Pros available starting at $639 and ranging up to $310 off Apple’s original MSRP. Each iPad Pro comes with Apple’s standard one-year warranty, features a... Read more
Save $50 on these HomePods available today at...
Apple has Certified Refurbished White and Midnight HomePods available for $249, Certified Refurbished. That’s $50 off MSRP and the lowest price currently available for a full-size Apple HomePod this... Read more
New 16-inch M3 Pro MacBook Pros are on sale f...
Holiday MacBook deals are live at B&H Photo. Apple 16″ MacBook Pros with M3 Pro CPUs are in stock and on sale for $200-$250 off MSRP. Their prices are among the lowest currently available for... Read more
Christmas Deal Alert! Apple AirPods Pro with...
Walmart has Apple’s 2023 AirPods Pro with USB-C in stock and on sale for $189.99 on their online store as part of their Holiday sale. Their price is $60 off MSRP, and it’s currently the lowest price... Read more
Apple has Certified Refurbished iPhone 12 Pro...
Apple has unlocked Certified Refurbished iPhone 12 Pro models in stock starting at $589 and ranging up to $350 off original MSRP. Apple includes a standard one-year warranty and new outer shell with... Read more

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Mobile Platform Engineer ( *Apple* /AirWatch)...
…systems, installing and maintaining certificates, navigating multiple network segments and Apple /IOS devices, Mobile Device Management systems such as AirWatch, and Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.