Modula and Modula-2 went nowhere not because they’re particularly high level languages (they’re not much higher than C!) but because they didn’t have a quasi-free operating system spreading like a virus to bolster their popularity. At the time Unix was almost unique in being a semi-capable operating system written in a portable language that wasn’t wrapped up in billions of proprietary licensing arrangements (because AT&T didn’t notice there was a potential market for it until after the cat had escaped the bag).

source

#modula #modula-2 #modula2 #c #programming-languages #programming_languages #unix

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

Various dialects of Pascal, such as UCSD Pascal, provide the separate compilation unit, called UNIT, as a half-way measure in the right direction. Unfortunately, the Pascal UNIT facility (interface portion) does not allow a physical separation between specification and implementation, which are tied together in the same compilation unit.

Because the interface section and the implementation section of a Pascal compilation unit are required to be in the same physical unit, the data structure for any Pascal data type must be completely specified in the interface portion except when only one variable of such data type is to be allowed. In such a case the data structure can be hidden in the implementation portion of the compilation unit. This restriction is rather severe. For example, only one complex number variable, only one stack variable, only one string variable, only one list variable, could exist in a program at a given time. This is unrealistic in most cases.

In the Modula-2 dynamic string abstraction presented in section 1.3, each procedure contains a parameter of type string. This permits many string variables to coexist in a program. Each individual string variable may be manipulated independent of the others. The data structure for the type string is not specified in the interface unit (definition module) because of Modula-2’s opaque type facility and the separation between specification and implementation.

To allow each Pascal procedure in the interface portion of a string compilation unit to contain a parameter of type string, the data structure for string must be completely specified before the first parameter reference to type string is given. Thus the essential feature of data hiding is lost in Pascal, even with the limited facility of separate compilation available in some dialects of Pascal.

#pascal #modula-2 #modula #encapsulation #interface

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

very interesting discussion for me https://github.com/modula3/cm3/issues/12

What do you think about implementing properties in Objects?

OBJECT
...
PROPERTIES
intValue : INTEGER READ GetIntValue() WRITE SetIntValue();

I wouldn’t mind adding some things like this as long as they are very obviously simple syntactic sugar for existing operations. This looks like something like that…

shouldn’t it be, though

PROPERTIES
intValue : INTEGER
READ := GetIntValue() : INTEGER
WRITE := SetIntValue(to : INTEGER);

to more closely match the syntax for methods.

Also it won’t work on RECORDs, which is a bit odd.

I suppose it follows the existing property (which I would not want to break) that you can almost always change a T = REF RECORD … to T = OBJECT … without breaking anything, but not the other way around.

#modula #programming #programming_languages #modula-3 #cm3 #modula3 #compiler

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)