Discussion:
M2R10 Information & Documentation Wiki
(too old to reply)
trijezdci
2015-09-16 03:31:42 UTC
Permalink
Raw Message
Modula-2 R10 has a new (public) project wiki at the URL:

http://modula-2.net/m2r10

This was cloned from an internal-use wiki which was recovered from a server that had a faulty disk. Thus far the main page, goals, EBNF and syntax diagrams have been brought up to date. The specification will be next. While updating is in progress, some out-of-date artefacts will still be visible.

The wiki is for information and documentation. Library, compiler sources, the syntax diagram generator script and other source code will naturally remain on the Bitbucket repository (https://bitbucket.org/trijezdci/m2r10).
Gour
2015-09-16 08:08:11 UTC
Permalink
Raw Message
On Tue, 15 Sep 2015 20:31:42 -0700 (PDT)
Post by trijezdci
http://modula-2.net/m2r10
Nice.

I like FAQ and curious to see remaining 'todo' entried filled. ;)

One possible addition to the FAQ list: Why not (Object) Pascal?


Sincerely,
Gour
trijezdci
2015-09-20 18:35:34 UTC
Permalink
Raw Message
Post by Gour
One possible addition to the FAQ list: Why not (Object) Pascal?
We have got three questions of this type in the FAQ, that should suffice.

Mind you, Wirth published Modula-2 as an improvement over his earlier Pascal. Later Pascal implementations then adopted more and more features from Modula-2. These were bolted on, so the syntax is not as clean as it is in Modula-2. Leaving syntax aside, those Pascals are roughly comparable to classic or ISO Modula-2 or anywhere in between. It naturally follows that if you want to do a revision of Modula-2, then you would likewise want to do a revision of those Pascals. With the sole exception of Unicode support, choosing Pascal would not have alleviated the need for a revision.
Gour
2015-09-27 09:03:47 UTC
Permalink
Raw Message
On Sun, 20 Sep 2015 11:35:34 -0700 (PDT)
Post by trijezdci
Mind you, Wirth published Modula-2 as an improvement over his earlier
Pascal. Later Pascal implementations then adopted more and more
features from Modula-2. These were bolted on, so the syntax is not as
clean as it is in Modula-2. Leaving syntax aside, those Pascals are
roughly comparable to classic or ISO Modula-2 or anywhere in between.
It naturally follows that if you want to do a revision of Modula-2,
then you would likewise want to do a revision of those Pascals. With
the sole exception of Unicode support, choosing Pascal would not have
alleviated the need for a revision.
Thank you for the input.

My point was due to being told that considering today's Object Pascal,
there is not much (significant) difference between the two.


Sincerely,
Gour
--
Everyone is forced to act helplessly according to the qualities
he has acquired from the modes of material nature; therefore no
one can refrain from doing something, not even for a moment.
trijezdci
2015-09-29 05:19:12 UTC
Permalink
Raw Message
Post by Gour
My point was due to being told that considering today's Object Pascal,
there is not much (significant) difference between the two.
Please keep in mind that our FAQ is not about classic Modula-2 nor ISO Modula-2 but about our revision. If anybody made any claim that there is no significant difference between Object Pascal and our revised Modula-2 -- which I doubt -- then they would be very wrong. The differences are very significant.

I am in the process of transferring the language report onto the Wiki while updating it. There is already quite a bit of it on the wiki. You may want to read that and check back every few days for added content. This should give you a first hand insight into the differences.

http://modula-2.net/m2r10/pmwiki.php?n=Spec.LanguageReport

However, if you must rely on a reference point in form of any existing language out there to be able to categorise it, then the closest you might find is Ada, not Pascal. Not in terms of the syntax which is obviously Modula-2 but in terms of focus and philosophy.
Gour
2015-09-30 16:55:55 UTC
Permalink
Raw Message
On Mon, 28 Sep 2015 22:19:12 -0700 (PDT)
Post by trijezdci
Please keep in mind that our FAQ is not about classic Modula-2 nor
ISO Modula-2 but about our revision. If anybody made any claim that
there is no significant difference between Object Pascal and our
revised Modula-2 -- which I doubt -- then they would be very wrong.
The differences are very significant.
That's clear...but as Marco pointed out in another mail, it is the
question of pragmatism...Language-wise, I'm sure that R10 is superior
language, but for real work one has to consider the whole ecoystem
including build systems, compiler, libs etc.
Post by trijezdci
However, if you must rely on a reference point in form of any
existing language out there to be able to categorise it, then the
closest you might find is Ada, not Pascal. Not in terms of the syntax
which is obviously Modula-2 but in terms of focus and philosophy.
I did my 'excursion' with Ada, but I'm more attracted to simpler
languages like Pascal and Modula-2...howver, it seems that Modula-2
ecosystem won't be ready for practical work for some time unless some
man/money powered is poured on the project soon.


Sincerely,
Gour
--
Not by merely abstaining from work can one achieve freedom
from reaction, nor by renunciation alone can one attain perfection.
Martin Brown
2015-10-01 14:00:34 UTC
Permalink
Raw Message
Post by Gour
I did my 'excursion' with Ada, but I'm more attracted to simpler
languages like Pascal and Modula-2...howver, it seems that Modula-2
ecosystem won't be ready for practical work for some time unless some
man/money powered is poured on the project soon.
If you want something usable now and don't mind about lack of support
then the XDS compiler is free and surprisingly capable. It will even
support a lot of old Topspeed extensions if you download the libraries.

It has a rather quirky default compiler behaviour of coding references
to undefined variables as a hard trap. I prefer a warning. YMMV

It is astonishing how many bugs in large M2 codebases it can pick up
during the static analysis phase of the compiler execution. Typically
these are all on untravelled paths that almost never execute.
--
Regards,
Martin Brown
Marco van de Voort
2015-09-29 07:59:11 UTC
Permalink
Raw Message
Post by Gour
Post by trijezdci
alleviated the need for a revision.
Thank you for the input.
My point was due to being told that considering today's Object Pascal,
there is not much (significant) difference between the two.
Object Pascal is much more production oriented, and a different (OO)
paradigm.

M2 was always half research project, though with some important
applications in embedded.

I always liked M2 for its improvements over Pascal, but I always saw the
minimalist attitude only as a good starting point, not an all-overruling
vibe that must be maintained at all costs.

More modern Pascal with the M2 backports is slightly less elegant than
the M2 from the bottom. Some of the newer Delphi dialect is outright ugly.
Nobody designs a language with 22 string-like types from scratch.

But it is a production language with production quality tooling (ide,
compiler,libraries) both commercial and open source, and that is what
matters for me.
trijezdci
2015-09-29 17:11:11 UTC
Permalink
Raw Message
Post by Marco van de Voort
M2 was always half research project, though with some important
applications in embedded.
Modula-2 was designed and used as a production language at Xerox PARC. Only, there it was called Mesa. For all practical purposes classical Modula-2 is Mesa with revised syntax.

Mesa had some rather unusual punctuation in its syntax like square brackets instead of parentheses to delimit function call parameters etc. Wirth cast Mesa into Pascal style syntax to beget Modula-2.

The only other two changes were the introduction of pseudo-module SYSTEM as a container for built-in low-level features, in Mesa those were just ordinary built-ins. Further, Mesa's NEW and DISPOSE were built-in, Wirth made them into macros that call library implementations.

Mesa also had threads but so did Modula-2 implementations at ETHZ, they were just removed for the PIM book and in the compilers Wirth shipped because.

At the time Mesa was considered the ultimate production language and environment. The US Department of Defense wanted Xerox to provide it for a standard specification to be used for military projects and contracts, but Xerox felt that Mesa was a competitive advantage they would not want any competitor to be able to use so they declined and the DoD then commissioned what is now Ada.

It would be very difficult to argue that the very minor changes that Wirth made to Mesa turned the state of the art production language of its day into an academic language. Wirth's compilers didn't come with the libraries and debuggers that Xerox had but the language was not a research language.

Modula-2 even had the same purpose as its parent Mesa: To build the system software and applications for a graphic workstation. Wirth had asked Xerox to sell Alto workstations to ETHZ but Xerox refused. He had to change Mesa a bit and most importantly its name so that Xerox wouldn't come complaining. He wanted to build his own Alto workstations and he needed Mesa/Modula-2 to build the software for it.

Pascal was an academic language. Modula-2 was definitely not.
Post by Marco van de Voort
I always liked M2 for its improvements over Pascal, but I always saw the
minimalist attitude only as a good starting point, not an all-overruling
vibe that must be maintained at all costs.
We came to the same conclusion for the design principles of our revision. Simplicity is not a design goal in itself, but a means to help accomplish design goals such as correctness and reliability. It cannot be a goal for its own sake.

However, there is a definite benefit in erring on the side of simplicity. If you are too easily willing to add features you will soon pass a point where your design becomes too complex and it is difficult to go back and identify the exact point where it went too far and correct it. its like the proverbial frog in a pot of water slowly being brought to boiling temperature and boil the frog to death.
trijezdci
2015-09-29 18:25:44 UTC
Permalink
Raw Message
Post by trijezdci
Mesa also had threads but so did Modula-2 implementations at ETHZ, they were just removed for the PIM book and in the compilers Wirth shipped because.
Somehow the because part went missing.

Anyway, Wirth felt that the threads API at ETHZ was so specific to the underlying PDP-11 hardware that any implementation would end up being a custom design anyway and thus it wouldn't make sense to publish and ship it.
Marco van de Voort
2015-09-30 09:09:03 UTC
Permalink
Raw Message
Post by trijezdci
Post by Marco van de Voort
M2 was always half research project, though with some important
applications in embedded.
Modula-2 was designed and used as a production language at Xerox PARC.
(Mesa mumblings skipped) Ok, maybe I should have said post 1990 production
language for application development, not production language for 1980s Cold
War military products. To my defense, I said it today, not in 1980.

I agree though that M2 is a nice systems language, and I do embedded C work
daily, and IMHO M2 with the usual extensions (to define bit level registers)
would be a lot better. (that said, anything with a non fallthrough
case/switch and == vs = accident waiting to happen would already be better than C)

The problem with M2 is not what it does do, but what it doesn't, and the
parts beyond the language. (read up to date toolchains with non-trivial
libraries)

I regularly bring in M2 features in FPC discussions, it is not just the
other way around. At the very least I'd like a more M2 behaviour for module
system (qualified and unqualified support)
Post by trijezdci
Mesa also had threads but so did Modula-2 implementations at ETHZ, they
were just removed for the PIM book and in the compilers Wirth shipped
because.
True preemptive (p)threads or cooperative? I always considered the cooperative
process module a bit a historic artefact.
Post by trijezdci
any competitor to be able to use so they declined and the DoD then
commissioned what is now Ada.
I could get by with Ada, but IMHO it was overengineered.
Post by trijezdci
Modula-2 even had the same purpose as its parent Mesa: To build the system software and applications for a graphic workstation. Wirth had asked Xerox to sell Alto workstations to ETHZ but Xerox refused. He had to change Mesa a bit and most importantly its name so that Xerox wouldn't come complaining. He wanted to build his own Alto workstations and he needed Mesa/Modula-2 to build the software for it.
Pascal was an academic language. Modula-2 was definitely not.
I'm talking about the languages as they stand now, in a 2015 context. So
that means Delphi DX, and/or a recent Lazarus.
Post by trijezdci
Post by Marco van de Voort
I always liked M2 for its improvements over Pascal, but I always saw the
minimalist attitude only as a good starting point, not an all-overruling
vibe that must be maintained at all costs.
We came to the same conclusion for the design principles of our revision.
Simplicity is not a design goal in itself, but a means to help accomplish
design goals such as correctness and reliability. It cannot be a goal for
its own sake.
Those design rules still match the original system language concept though,
so purely embedded and not e.g. PC. (and no, mobile "apps" are not
embedded, unless you write the kernel of the phone)

While current versions of (Object) Pascal are driven more by utility in a
wide range of applications. From embedded to enterprise.
Post by trijezdci
However, there is a definite benefit in erring on the side of simplicity.
Yes, you shove the problems of the language designer's plate to the library
programmer and real programmer :-)
Post by trijezdci
If you are too easily willing to add features you will soon pass a point
where your design becomes too complex and it is difficult to go back and
identify the exact point where it went too far and correct it. its like
the proverbial frog in a pot of water slowly being brought to boiling
temperature and boil the frog to death.
Again either (nowadays0 a very embedded philosophy.
trijezdci
2015-09-30 14:57:13 UTC
Permalink
Raw Message
Post by Marco van de Voort
(Mesa mumblings skipped) Ok, maybe I should have said post 1990 production
language for application development, not production language for 1980s Cold
War military products. To my defense, I said it today, not in 1980.
Well, outdated production language, yes. After 30 years without maintenance this is hardly surprising. But this is precisely my point: Classic Modula-2 isn't lacking today because of an academic design concept but because it hasn't been maintained/updated in 30 years.

And that establishes the need for a revision.

Our revision is major, not minor, because it has been 30 years. Had there been revisions in between, these would have been more gradual, but the most recent one would likely have arrived at a comparable set of capabilities and revision points.
Post by Marco van de Voort
True preemptive (p)threads or cooperative? I always considered the cooperative
process module a bit a historic artefact.
It had both, but only coroutines made it into the PIM book and the publicly distributed compiler.

Even then, Modula-2's coroutine design was already outdated when it was designed. It was merely a 1:1 conversion of how coroutines were done in Assembly in the late 1950s when they were invented. The state of the art had already moved beyond that by 1978. In that sense, yes, you are spot on, the PIM coroutine design was already a historic artefact when it was published.

Modern coroutines are far more useful and versatile. They look and feel more like ordinary functions. Their uses are not limited to implementing multi-threading in applications but also for such things as iterators and generators.

Here is an example of a coroutine based iterator in Modula-2 R10 for illustration ...

PROCEDURE [COROUTINE] iterator ( valueList : ARRAY OF REAL ) : REAL;
VAR maxIndex : LONGCARD;
BEGIN
(* yield the leading n-1 values and suspend *)
FOR VALUE item IN valueList[0 .. -2] DO
YIELD item
END
(* return the final value and terminate *)
RETURN LAST(valueList)
END iterator;
Post by Marco van de Voort
I could get by with Ada, but IMHO it was overengineered.
During our review and design phase we discovered that Ada aligns very well with our design philosophy, it is just waaaaay too large. Overengineered may be another way to express that fact.
Post by Marco van de Voort
Post by trijezdci
Modula-2 even had the same purpose as its parent Mesa: To build the system software and applications for a graphic workstation. Wirth had asked Xerox to sell Alto workstations to ETHZ but Xerox refused. He had to change Mesa a bit and most importantly its name so that Xerox wouldn't come complaining. He wanted to build his own Alto workstations and he needed Mesa/Modula-2 to build the software for it.
Pascal was an academic language. Modula-2 was definitely not.
I'm talking about the languages as they stand now, in a 2015 context. So
that means Delphi DX, and/or a recent Lazarus.
Isn't it funny how the academic language designed with research and teaching intent tuns out a production language 40 years on, while the language that was a production language appeared to you like a research language when actually it wasn't?! Appearances can be misleading ;-)
Post by Marco van de Voort
Post by trijezdci
Post by Marco van de Voort
I always liked M2 for its improvements over Pascal, but I always saw the
minimalist attitude only as a good starting point, not an all-overruling
vibe that must be maintained at all costs.
We came to the same conclusion for the design principles of our revision.
Simplicity is not a design goal in itself, but a means to help accomplish
design goals such as correctness and reliability. It cannot be a goal for
its own sake.
Those design rules still match the original system language concept though,
so purely embedded and not e.g. PC. (and no, mobile "apps" are not
embedded, unless you write the kernel of the phone)
Are you saying that correctness and reliability is only worth having in embedded systems but not on desktops, phones and servers?
Post by Marco van de Voort
Post by trijezdci
However, there is a definite benefit in erring on the side of simplicity.
Yes, you shove the problems of the language designer's plate to the library
programmer and real programmer :-)
That's a deliberate misinterpretation.

If proper care is taken in the design, there will be no adverse impact on the utility. People are just too lazy to do proper design these days. Charles Babbage is spinning in his grave.
Post by Marco van de Voort
Post by trijezdci
If you are too easily willing to add features you will soon pass a point
where your design becomes too complex and it is difficult to go back and
identify the exact point where it went too far and correct it. its like
the proverbial frog in a pot of water slowly being brought to boiling
temperature and boil the frog to death.
Again either (nowadays0 a very embedded philosophy.
Not really, it is proper engineering and best practise to accept the fact that everything has limits and those limits need to be spelt out and respected. Anything else is quacksalvery and wishful thinking.
Gour
2015-09-30 17:03:47 UTC
Permalink
Raw Message
On Wed, 30 Sep 2015 07:57:13 -0700 (PDT)
Post by trijezdci
And that establishes the need for a revision.
Our revision is major, not minor, because it has been 30 years. Had
there been revisions in between, these would have been more gradual,
but the most recent one would likely have arrived at a comparable set
of capabilities and revision points.
Do you believe that revision for computer language which was unmaintained for 30
years can spark enough interest in the public in order to produce decent
ecosystem for it - compiler, libs, editor/IDE support etc. so it can be
used for real work before another huge span of time passes by?

It seems to me that Ada is much more widely used today, it's still
taught in some places, there is strong compiler (GNAT) available with
accompanying tools, but it looks as interest in the language is
declining despite commercial support...


Sincerely,
Gour
--
An intelligent person does not take part in the sources of misery,
which are due to contact with the material senses.
trijezdci
2015-10-01 05:00:05 UTC
Permalink
Raw Message
Post by Gour
Post by trijezdci
And that establishes the need for a revision.
Our revision is major, not minor, because it has been 30 years. Had
there been revisions in between, these would have been more gradual,
but the most recent one would likely have arrived at a comparable set
of capabilities and revision points.
Do you believe that revision for computer language which was unmaintained for 30
years can spark enough interest in the public in order to produce decent
ecosystem for it - compiler, libs, editor/IDE support etc.
I believe that naysaying and consumerism are like a contagious disease that has the destructive power to bring an end to our civilisation.

Take any item ever created by humans that is of any lasting value and you will find that if the creators had been lazy and listened to the naysayers then we would be living in caves. Do you believe the creators of any of the popular languages that didn't get started in large corporations asked themselves "Do I really believe that my effort will be successful?". If they had, they might never have started.

The "I want it all -- I want it now" attitude that is now so prevalent that most products are made for fast food consumption with little if any concern for quality. And most people are no longer willing to make an effort to design things for quality, save up to buy quality, even seek out quality.

It is precisely for this reason that a well designed product can make a difference. The competition is so incredibly bad that the benefits will be apparent outright. We have already seen this in the feedback from scholars and universities around the world. Once our revised Modula-2 enters the curricula, new generations of true software engineers who actually deserve to be called engineers will emerge and carry the mindset of engineering in software production into industry.

The Liechtenstein company Hilti is one of the very few companies left on this planet whose DNA is all about quality. Their power tools have established their own product category. Builders and construction workers all over the world won't ask "bring the drill", they ask "Get me the Hilti!". As China was building cities in droves, there was a huge demand for power tools and the Chinese plagiarists sold what looked just like Hiltis but with CHILTI written on them in the same style as HILTI. Visually they were near indistinguishable from the real deal.

Apart from the C in front of HILTI, the only apparent difference was that the Chinese copies broke down a lot when facing the heavy work that Hilitis are used for. Hilti received a flood of broken down CHILTI labelled machines with warranty claims. They replaced each one with a real Hilti and told the "customer" that the one they sent in was a fake and that it broke down because it wasn't the real thing. They also set up large mobile service stations in front of building sites where they lent out their tools and gave advice. Even though Hiltis are very expensive, this killed off the Chinese copies. The Chinese soon learned to look for the absence of the C and avoid the copies. When they couldn't afford to buy, they borrowed them at the service station. Hilti are the masters of quality and the masters of the professional power tool market, even in China.

Modula-2 R10 is designed like a Hilti and we are going to build and distribute it.
Post by Gour
so it can be
used for real work before another huge span of time passes by?
You think building things will take a huge amount of time because you have witnessed that with the usual banana software out there. This is a function of a bad software production process though.

We didn't use a banana approach. We took the opposite approach. We spent six years on design and refinement. Building things takes less time when there is a thorough design as you do not need to think about design issues and run into dead ends that require backtracking in the architecture. IOW, you make most of your mistakes already during the design phase and you fix them during the design phase.

Here is a book by Herbert Klaeren, a German scholar at the University of Tuebingen, published this year under CC license which talks about proper engineering and how it pays dividends later on. It is only available in German as of now but Google translate will do a reasonable job translating German to English. Although this is a 2015 publication, it features Modula-2 prominently.

http://pu.inf.uni-tuebingen.de/users/klaeren/sw.pdf
Post by Gour
It seems to me that Ada is much more widely used today, it's still
taught in some places, there is strong compiler (GNAT) available with
accompanying tools, but it looks as interest in the language is
declining despite commercial support...
The trouble with Ada is that the GNAT compiler makes all your work GPL encumbered and sales of commercial compilers follow the same business model as Bentleys. If you have to ask the price, you are unlikely to be able to afford it -- it keeps most folks from even entering the dealership to take a look at the car and ask for a test drive.

As for widely used, did you know that Modula-2 is widely used in ERP systems in Switzerland, only two or three places behind SAP? SAP (who use ABAP) have around 1200 installations, APlus (who use Modula-2 have around 400). Oracle are not even in the top ten. And the reason isn't national pride because most Swiss today never even heard of Modula-2.
Gour
2015-10-01 08:41:14 UTC
Permalink
Raw Message
On Wed, 30 Sep 2015 22:00:05 -0700 (PDT)
Post by trijezdci
I believe that naysaying and consumerism are like a contagious
disease that has the destructive power to bring an end to our
civilisation.
:-)
Post by trijezdci
Take any item ever created by humans that is of any lasting value and
you will find that if the creators had been lazy and listened to the
naysayers then we would be living in caves.
You might be interesting for this book:

http://www.amazon.com/gp/product/0892133341?*Version*=1&*entries*=0

showing that Evolution is maybe not the right word and, as 'progress'
with programming languages show, it is often just the opposite. :-)
Post by trijezdci
Do you believe the creators of any of the popular languages that
didn't get started in large corporations asked themselves "Do I really
believe that my effort will be successful?". If they had, they might
never have started.
That's true.
Post by trijezdci
The "I want it all -- I want it now" attitude that is now so
prevalent that most products are made for fast food consumption with
little if any concern for quality. And most people are no longer
willing to make an effort to design things for quality, save up to
buy quality, even seek out quality.
In my case, computing is neither my life nor my religion and in my
career I learnt to accept there is no perfection here, so I'm better to
live with some compromises...while using my tools.
Post by trijezdci
We have already seen this in the feedback from scholars and
universities around the world. Once our revised Modula-2 enters the
curricula, new generations of true software engineers who actually
deserve to be called engineers will emerge and carry the mindset of
engineering in software production into industry.
Don't forget that no matter how those engineers are good, at the end,
most of them have to bow their heads before the $-boss.
Post by trijezdci
The Liechtenstein company Hilti is one of the very few companies left
on this planet whose DNA is all about quality. Their power tools have
established their own product category. Builders and construction
workers all over the world won't ask "bring the drill", they ask "Get
me the Hilti!". As China was building cities in droves, there was a
huge demand for power tools and the Chinese plagiarists sold what
looked just like Hiltis but with CHILTI written on them in the same
style as HILTI. Visually they were near indistinguishable from the
real deal.
Apart from the C in front of HILTI, the only apparent difference was
that the Chinese copies broke down a lot when facing the heavy work
that Hilitis are used for. Hilti received a flood of broken down
CHILTI labelled machines with warranty claims. They replaced each one
with a real Hilti and told the "customer" that the one they sent in
was a fake and that it broke down because it wasn't the real thing.
They also set up large mobile service stations in front of building
sites where they lent out their tools and gave advice. Even though
Hiltis are very expensive, this killed off the Chinese copies. The
Chinese soon learned to look for the absence of the C and avoid the
copies. When they couldn't afford to buy, they borrowed them at the
service station. Hilti are the masters of quality and the masters of
the professional power tool market, even in China.
Thanks a lot for very instructive story...it's true that even here
people are saying:" Give me Hilti!" :-)
Post by trijezdci
Modula-2 R10 is designed like a Hilti and we are going to build and distribute it.
All the best!
Post by trijezdci
You think building things will take a huge amount of time because you
have witnessed that with the usual banana software out there. This is
a function of a bad software production process though.
No...there are good languages around - let's name Ada & Haskell - butnot
much is built with them since the language itself is not all in all
without support in the form of other factors already mentioned in other
email.

I am using computers since the time when one was supposed to build one's
own menu system (DOS) from the scratch, but today (almost) nobody has
time to tinker with such trivia.
Post by trijezdci
Here is a book by Herbert Klaeren, a German scholar at the University
of Tuebingen, published this year under CC license which talks about
proper engineering and how it pays dividends later on. It is only
available in German as of now but Google translate will do a
reasonable job translating German to English. Although this is a 2015
publication, it features Modula-2 prominently.
http://pu.inf.uni-tuebingen.de/users/klaeren/sw.pdf
I'll take a look.
Post by trijezdci
The trouble with Ada is that the GNAT compiler makes all your work
GPL encumbered and sales of commercial compilers follow the same
business model as Bentleys. If you have to ask the price, you are
unlikely to be able to afford it -- it keeps most folks from even
entering the dealership to take a look at the car and ask for a test
drive.
Very true.
Post by trijezdci
As for widely used, did you know that Modula-2 is widely used in ERP
systems in Switzerland, only two or three places behind SAP? SAP (who
use ABAP) have around 1200 installations, APlus (who use Modula-2
have around 400). Oracle are not even in the top ten. And the reason
isn't national pride because most Swiss today never even heard of
Modula-2.
I was not aware of it, but, I wonder what does it mean to me and my
potential use-case of attempt to build desktop GUI app in
not-so-distant-future. :-)

Of course, I understand that my use-case doe not have much with your
mission and that's perfectly OK: ,)


Sincerely,
Gour
--
A person who has given up all desires for sense gratification,
who lives free from desires, who has given up all sense of
proprietorship and is devoid of false ego — he alone can
attain real peace.
trijezdci
2015-10-01 15:30:56 UTC
Permalink
Raw Message
Post by Gour
Post by trijezdci
We have already seen this in the feedback from scholars and
universities around the world. Once our revised Modula-2 enters the
curricula, new generations of true software engineers who actually
deserve to be called engineers will emerge and carry the mindset of
engineering in software production into industry.
Don't forget that no matter how those engineers are good, at the end,
most of them have to bow their heads before the $-boss.
That is precisely what languages like Ada and Modula-2 tackle. The mindset, an ability to say "No".

A civil engineer will not design and build a bridge that he or she knows will collapse no matter how much financial pressure is put on them by their boss or client. They can also go to jail if they did.

An electrical engineer will be held liable for building a rig that electrocutes a client. It's a public safety issue. They'll go to jail for doing the wrong thing.

A mechanical engineer will be held liable for a machine that is unsafe and kills its operator or bystanders. This, too is a public safety issue. They too will go to jail for doing the wrong thing.

Only software producers claim the jail-free card for themselves, but they still want to be called software engineers. Since they want to be engineers, we should teach them engineering principles and how to adhere to them even under duress. It is a matter of attitude.

Harry Sneed even goes as far as to suggest that software developers should be made to pay for their sloppiness. He calls this technical debt: All the things that are done sloppily or are left out for doing later or fixing later. Check out a video with a talk he gave on the topic:



He also says that bad software is not related to what programming language the software is implemented in, he says that they root cause is lack of discipline.

In the video he jokes that there are no good software developers because anyone who is any good at it will become a professor or a consultant or a project manager.

However, in an interview I read, he said that Ada and Modula-2 were languages worth promoting because they teach the discipline that software developers generally lack.

So in the end it is about discipline, not language, even though the language can have a significant influence on bringing about the discipline and maintain it.

Now, for somebody like yourself, this means, watch discipline. If you can maintain discipline in a language that doesn't force you to, then you will be fine most of the time.

However, the trouble is that the less a language is designed to enforce discipline, the more effort it is for the developer to maintain discipline even if they really want to.

Pascal is still fairly strict and certainly much easier to maintain discipline with than C. But at the end of the day the question is how much you want to compromise. The trouble with compromising is that once you compromise, you are more likely to compromise a little more, and a little more, and a little more, until in the end you reach the point where nothing really matters any more.

Nevertheless, people who had been taught Ada, Modula-2 or Pascal and used any of those languages for a bit generally write the best C code when they are forced to write C. The habit of discipline shows through. But that takes a mindset not to want to compromise.
Post by Gour
Of course, I understand that my use-case doe not have much with your
mission and that's perfectly OK: ,)
I am not trying to "sell" you on our project, we don't have any working software to "sell" yet anyway.

I am talking about a much bigger thing that the compiler and library. I am talking about the modern (and flawed) software production process due to a worse-is-better mindset (google worse is better) and that one must choose between the worse-is-better and do-the-right things mindset. If you can do that regardless of whether enforces the discipline on you, your choice of language is not all that important, although it is more painful to use a lesser discipline language to do so.
Gour
2015-10-01 19:54:36 UTC
Permalink
Raw Message
On Thu, 1 Oct 2015 08:30:56 -0700 (PDT)
Post by trijezdci
Only software producers claim the jail-free card for themselves, but
they still want to be called software engineers. Since they want to
be engineers, we should teach them engineering principles and how to
adhere to them even under duress. It is a matter of attitude.
It's not (just) question of attitude since that virtue belongs to very
few people...unless there are going to be some financial or
forced-by-law sanctions for software developers for their sloppy work,
don't expect that teaching will have great impact.

Every constructing engineer is e.g. taught what is required to build
something that can last, but, otoh and at least in my country so many
building are so poorly built that after few years they start to fall
apart...and, as long as there are no penalties or jail sentence for such
practice, companies will continue with it in order to save some bucks.

It is simpy utopis to expect honesty, virtue etc. from many people since
it's the question of consciousness. In Vedic philosophy such people are
called brahmanas and are supposed to be natural leader of society in the
form of advisors, ministers etc.

Today's world is run by those having money which is the law, at least,
for majority of people.
I'll check it out.
Post by trijezdci
He also says that bad software is not related to what programming
language the software is implemented in, he says that they root cause
is lack of discipline.
Right.
Post by trijezdci
However, in an interview I read, he said that Ada and Modula-2 were
languages worth promoting because they teach the discipline that
software developers generally lack.
Discipline is the right word - it is required for most of devs...for
those rare souls who are self-discipline, the language does not matter
indeed - they will always produce quality code.
Post by trijezdci
So in the end it is about discipline, not language, even though the
language can have a significant influence on bringing about the
discipline and maintain it.
I admit that my paragraph above was written before I read yours....asthe
saying goes: "Great minds think alike..." ;)
Post by trijezdci
Now, for somebody like yourself, this means, watch discipline. If you
can maintain discipline in a language that doesn't force you to, then
you will be fine most of the time.
However, the trouble is that the less a language is designed to
enforce discipline, the more effort it is for the developer to
maintain discipline even if they really want to.
I fully agree.
Post by trijezdci
Pascal is still fairly strict and certainly much easier to maintain
discipline with than C. But at the end of the day the question is how
much you want to compromise. The trouble with compromising is that
once you compromise, you are more likely to compromise a little more,
and a little more, and a little more, until in the end you reach the
point where nothing really matters any more.
I'd like to receive help from the language/compiler for my eventual
sloppiness since who can claim to be perfect.
Post by trijezdci
I am not trying to "sell" you on our project, we don't have any
working software to "sell" yet anyway.
Frankly speaking, I'd be very happy if you have something to "sell".
:-)
Post by trijezdci
I am talking about a much bigger thing that the compiler and library.
I understand.
Post by trijezdci
If you can do that regardless of whether enforces the discipline on
you, your choice of language is not all that important, although it is
more painful to use a lesser discipline language to do so.
I will rephrase is as: "If I would be able to write dekstop GUI app
using Modula-2 (R10) without too much pain due to lack of appropriate
tooling/libs, I'd very gladly accept to be disciplined by Modula-2
language, but as far as I can tell, this is not possible to do it
cleanly without involvement of some workarounds which are not in the
same spirit of the language itself...so, atm, Pascal/Lazarus looks as
well-balanced choice."


Sincerely,
Gour
--
A person who has given up all desires for sense gratification,
who lives free from desires, who has given up all sense of
proprietorship and is devoid of false ego — he alone can
attain real peace.

http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
trijezdci
2015-10-02 05:13:38 UTC
Permalink
Raw Message
Post by Gour
Post by trijezdci
Only software producers claim the jail-free card for themselves, but
they still want to be called software engineers. Since they want to
be engineers, we should teach them engineering principles and how to
adhere to them even under duress. It is a matter of attitude.
It's not (just) question of attitude since that virtue belongs to very
few people...unless there are going to be some financial or
forced-by-law sanctions for software developers for their sloppy work,
don't expect that teaching will have great impact.
Teaching had great impact in the 1980s when most universities where teaching engineering principles using languages that impose discipline. Today, so called computer science education at universities has become vocational training. They produce software mechanics without the engineering foundation. That has a lot to do with those mechanics having the wrong attitude and lack the discipline and responsibility.

In his book "Softwaretechnik", Herbert Klaeren points out that the situation we see today in software is comparable with the situation in mechanical crafts prior to the discovery and acceptance of the laws of thermodynamics. Back then the mechanical field was awash with quacksalvers trying over and over and over again to build perpetual motion machines because they didn't understand the science and they wouldn't accept that what they were trying to do was futile to begin with, just like the software coders of today are trying over and over and over again to do the unattainable.

With proper education comes the enlightenment that certain things just should not be done.

Yes, indeed, this is an educational problem.
Post by Gour
Every constructing engineer is e.g. taught what is required to build
something that can last, but, otoh and at least in my country so many
building are so poorly built that after few years they start to fall
apart...and, as long as there are no penalties or jail sentence for such
practice, companies will continue with it in order to save some bucks.
In the field of software this is also an attitude and knowledge problem. If you sue a builder for neglect, the courts will generally accept that the builder has the ability to do it right and not having done it right is neglect.

In the field of software, we have been brainwashed into thinking that software is different, it cannot possible done right and therefore there must be no liability. The courts have swallowed that blue pill line, hook and sinker.

Again, an educational problem. If you can show that with the proper engineering it can be done right, when the knowledge becomes accepted just like the laws of thermodynamics, then the courts will also take the red pill. Patent law all over the world forbids the filing of patents for perpetual motion machines because it is recognised as a waste of public resources for no benefit.
Post by Gour
It is simpy utopis to expect honesty, virtue etc. from many people since
it's the question of consciousness. In Vedic philosophy such people are
called brahmanas and are supposed to be natural leader of society in the
form of advisors, ministers etc.
No, it is a matter of market forces. The market right now is rigged. Software coders have been brainwashed into believing that software cannot possibly be done reliably. The general public has accepted this falsehood for fact as well. Even the courts believe it.

Unrig the market and there will be a chance for competition on the basis of doing the right thing. Customers will abandon their fake CHILTIs for proper HILTIs. And the courts will be prepared to condemn the fraudsters who make and sell CHILTIs.
Post by Gour
I'll check it out.
You really should :-)
Post by Gour
Post by trijezdci
I am not trying to "sell" you on our project, we don't have any
working software to "sell" yet anyway.
Frankly speaking, I'd be very happy if you have something to "sell".
Perseverence shall get us there. And we are picking up momentum.
Post by Gour
I will rephrase is as: "If I would be able to write dekstop GUI app
using Modula-2 (R10) without too much pain due to lack of appropriate
tooling/libs, I'd very gladly accept to be disciplined by Modula-2
language, but as far as I can tell, this is not possible to do it
cleanly without involvement of some workarounds which are not in the
same spirit of the language itself
I think the suggestion by Martin Brown to try the XDS compiler is worth trying out.

From the Excelsior website:

"Native XDS-x86 is available for Windows and Linux, but the capabilities of these two versions are quite different:

Native XDS-x86 for Windows is a complete Modula-2 and Oberon-2 toolsuite that contains an IDE, highly optimized compiler, linker, ISO 10514 and other libraries, Win32 API definitions, interactive debugger, and more.

Native XDS-x86 for Linux contains only a command-line optimizing Modula-2/Oberon-2 compiler, an utility for conversion of C headers into Modula-2 definition modules, and nearly the same library set as its Windows counterpart. Also included are POSIX and X Window API definitions."

It's ISO M2, but when compared to Pascal, any Pascal, it will be more disciplined and most importantly, it is a lot cleaner as it doesn't have five different object models that you need to learn not to mix up nor 12 different string types and a host of different booleans etc etc etc.

I assume this is manageable when you know all the options by heart and are able to keep them apart and thus are able to ignore all but the one option you are interested in, but if you have to learn it first? Gosh.


...so, atm, Pascal/Lazarus looks as
Post by Gour
well-balanced choice."
I have my doubts about that. I have only experimented with it some and that was several years ago, but I soon found out that it is a huge amalgamation of dialects into a single hodge-podge language. Think of utopian Sci-Fi movies/novels where city folk have developed their own language that consists of English, Spanish, Arabic, Chinese and Japanese all mixed up.

Do I want to work with that? Rather not. I'd sooner stick with C and write pascal-like code in C, then use tools like lint to get the checks where the C compiler shirks its duties. In fact I would have continued doing so, but I need coroutines and in C that is just not feasible, at least not reliably.

If I have to learn a huge language and learn how to keep the tons of options doing the same kind of thing apart from each other so as to consistently use one and ignore all the others, then I might as well pick Ada. Of course with Ada, the licensing is a serious problem. So, back to Modula-2 and modernise.

But hey, try Martin Brown's suggestion.
Gour
2015-10-02 07:02:05 UTC
Permalink
Raw Message
On Thu, 1 Oct 2015 22:13:38 -0700 (PDT)
Post by trijezdci
Teaching had great impact in the 1980s when most universities where
teaching engineering principles using languages that impose
discipline. Today, so called computer science education at
universities has become vocational training. They produce software
mechanics without the engineering foundation.
I'd say that the problem is deeper and it originates from an earlier
date...
Post by trijezdci
Yes, indeed, this is an educational problem.
If you're not already familiar, I suggest you to visit Gatto's web site
(https://www.johntaylorgatto.com/) and/or read https://www.johntaylorgatto.com/

He writes:

"Since bored people are the best consumers, school had to be a boring
place, and since childish people are the easiest customers to convince,
the manufacture of childishness, extended into adulthood, had to be the
first priority of factory schools. Naturally, teachers and
administrators weren't let in on this plan; they didn't need to be. If
they didn't conform to instructions passed down from increasingly
centralized school offices, they didn't last long.

In the new system, schools were gradually re-formed to meet the pressing
need of big businesses to have standardized customers and employees,
standardized because such people are predictable in certain crucial ways
by mathematical formulae. Business (and government) can only be
efficient if human beings are redesigned to meet simplified
specifications. As the century wore on, school spaces themselves were
opened bit by bit to commercialization."


So, I agree that is educatonal problem, but it is spread much wider than
the software industry only.
Post by trijezdci
Perseverence shall get us there. And we are picking up momentum.
I wish you all success!!
Post by trijezdci
Native XDS-x86 for Windows is a complete Modula-2 and Oberon-2
toolsuite that contains an IDE, highly optimized compiler, linker,
ISO 10514 and other libraries, Win32 API definitions, interactive
debugger, and more.
Native XDS-x86 for Linux contains only a command-line optimizing
Modula-2/Oberon-2 compiler, an utility for conversion of C headers
into Modula-2 definition modules, and nearly the same library set as
its Windows counterpart. Also included are POSIX and X Window API
definitions."
I'm using Linux since '99 and was never real Windows user, at least,
since Win3.1 which i used along with OS2, so I can't simply imagine to
go back to it.

Moreover, I'd like to write non only Win32 app, so GNU M2 or m2c is my
reality if I consider Modula-2.
Post by trijezdci
I have my doubts about that. I have only experimented with it some
and that was several years ago, but I soon found out that it is a
huge amalgamation of dialects into a single hodge-podge language.
I agree that it's noticeable that the language was 'patched' insted of
'designed'...
Post by trijezdci
Do I want to work with that? Rather not. I'd sooner stick with C and
write pascal-like code in C, then use tools like lint to get the
checks where the C compiler shirks its duties.
To write my app in plain C would be really surprising event after so
much research about adequate language to use. :-)
Post by trijezdci
If I have to learn a huge language and learn how to keep the tons of
options doing the same kind of thing apart from each other so as to
consistently use one and ignore all the others, then I might as well
pick Ada. Of course with Ada, the licensing is a serious problem.
Yes, it's...not only with compiler, but with GtkAda as well which is
practically the only viable option for GUI.
Post by trijezdci
So, back to Modula-2 and modernise.
I must admit, that if one does some closer inspection, there are not
many options to choose from...maybe Rust, but its syntax is so ugly...


Sincerely,
Gour

p.s. It's interesting to see where we have arrived with this topic and
I assume that other members of the group are either like it, or there
are not so many reading it to find it's worth to complain...Who knows,
maybe we're close to original topic as well. ;)
--
Even a man of knowledge acts according to his own nature, for
everyone follows the nature he has acquired from the three modes.
tbreeden
2015-10-02 16:15:31 UTC
Permalink
Raw Message
Post by Gour
p.s. It's interesting to see where we have arrived with this topic and
I assume that other members of the group are either like it, or there
are not so many reading it to find it's worth to complain...Who knows,
maybe we're close to original topic as well. ;)
I'm reading and finding the conversation very interesting. (not to mention
more rational than usually seen on the Internet).

If forced to think about it, I'd unfortunately probably fall into the
"you can't get there from here" cohort, at least with the
US economic structure.
But personally, just "keep on keeping on".

Tom
Martin Brown
2015-10-02 10:27:23 UTC
Permalink
Raw Message
Post by trijezdci
Post by Gour
Post by trijezdci
Only software producers claim the jail-free card for themselves, but
they still want to be called software engineers. Since they want to
be engineers, we should teach them engineering principles and how to
adhere to them even under duress. It is a matter of attitude.
It's not (just) question of attitude since that virtue belongs to very
few people...unless there are going to be some financial or
forced-by-law sanctions for software developers for their sloppy work,
don't expect that teaching will have great impact.
Teaching had great impact in the 1980s when most universities where teaching
engineering principles using languages that impose discipline.
That is my recollection too. Although I think one part of the problem is
that anyone with a talent for software development could hack typical
term projects out of the solid without any process at all.
Post by trijezdci
Today, so called computer science education at universities has become vocational training.
They produce software mechanics without the engineering foundation.
That has a lot to do
Post by trijezdci
with those mechanics having the wrong attitude and lack the
discipline and responsibility.

Unfortunately this is so true :(
Post by trijezdci
In his book "Softwaretechnik", Herbert Klaeren points out that the situation we see today
in software is comparable with the situation in mechanical crafts
prior to the discovery
Post by trijezdci
and acceptance of the laws of thermodynamics. Back then the
mechanical field was awash with
Post by trijezdci
quacksalvers trying over and over and over again to build perpetual
motion machines because
Post by trijezdci
they didn't understand the science and they wouldn't accept that what
they were trying to do
Post by trijezdci
was futile to begin with, just like the software coders of today are
trying over and over
Post by trijezdci
and over again to do the unattainable.
I think it is more like early medieval cathedral builders myself.
If it is still standing 5 years later then it was a good design.

Also the lack of standard off the shelf components that will plug and
play reliably according to detailed specifications in the same way as
nut & bolts in mechanical engineering or transistors in electronics.

Don't ignore the fact that even today there are still a range of various
"free energy" scams like the Hendershot Generator and Rossi's LENR
widely promoted on the internet by their advocates.
Post by trijezdci
With proper education comes the enlightenment that certain things just should not be done.
Yes, indeed, this is an educational problem.
And an attitude one in the commercial world where time to market is
everything and fixing bugs after shipping product to get the CEO his
quadratic bonus is more important than correctness.
Post by trijezdci
Post by Gour
Every constructing engineer is e.g. taught what is required to build
something that can last, but, otoh and at least in my country so many
building are so poorly built that after few years they start to fall
apart...and, as long as there are no penalties or jail sentence for such
practice, companies will continue with it in order to save some bucks.
In the field of software this is also an attitude and knowledge problem.
If you sue a builder for neglect, the courts will generally accept that
the builder has the ability to do it right and not having done it
right is neglect.

There is also a difference in that plans for a building are in general
terms understandable by a layman and they would rapidly question the
wisdom of putting a door on the third floor or no doors or staircase.

A customer for a new house would be immediately suspicious if his
architect started out by obsessing about a particularly fine solid gold
bathtap and then designed the entire house around it. Sadly that happens
all the time in software with the latest greatest silver bullet!
Post by trijezdci
In the field of software, we have been brainwashed into thinking that software is different,
It is different in the sense that it is much harder to communicate with
the customers about exactly what they want and when they see what they
have asked for delivered they invariably move the goal posts several
times. Couple that with mission creep caused by marketing men and you
have a recipe for disaster. The dodgy engine codecs on the UK delivery
of non-airworthy Chinook helicopters that wiped out an entire elite
military team shows the problems even in notionally controlled safety
critical environments. Shrink wrap software is 100x worse.

Strangely a lot of computer games are remarkably bug free considering
their intrinsic complexity. I suspect the core gaming engine is very
carefully crafted and tested and pretty robust wrt dodgy inputs.
Post by trijezdci
it cannot possible done right and therefore there must be no liability.
The courts have swallowed that blue pill line, hook and sinker.
I doubt that will last long once driverless cars are on the road.
Post by trijezdci
Again, an educational problem. If you can show that with the proper engineering
it can be done right, when the knowledge becomes accepted just like
the laws of
Post by trijezdci
thermodynamics, then the courts will also take the red pill. Patent
law all over
Post by trijezdci
the world forbids the filing of patents for perpetual motion machines
because it
Post by trijezdci
is recognised as a waste of public resources for no benefit.
USPTO accepted one by Rossi of LNER infamy only last month :(
Strictly it is a water heater of very dubious utility but the granting
of this patent allow him to make more grandiose claims for his scam.
Post by trijezdci
Post by Gour
It is simpy utopis to expect honesty, virtue etc. from many people since
it's the question of consciousness. In Vedic philosophy such people are
called brahmanas and are supposed to be natural leader of society in the
form of advisors, ministers etc.
No, it is a matter of market forces. The market right now is rigged.
Software coders have been brainwashed into believing that software
cannot possibly
Post by trijezdci
be done reliably. The general public has accepted this falsehood for
fact as well.
Post by trijezdci
Even the courts believe it.
Not convinced that is true. Everybody knows that best practice with
formal methods at NASA and a handful of other 6 sigma sites can deliver
(almost) bug free software but nobody wants to pay the high price.

Viper CPU is an example of how things can go pear shaped even in formal
methods environments once commercial reality sets in.
Post by trijezdci
Unrig the market and there will be a chance for competition on the basis of doing
the right thing. Customers will abandon their fake CHILTIs for proper
HILTIs.
Post by trijezdci
And the courts will be prepared to condemn the fraudsters who make
and sell CHILTIs.
Post by trijezdci
Post by Gour
I'll check it out.
You really should :-)
Post by Gour
Post by trijezdci
I am not trying to "sell" you on our project, we don't have any
working software to "sell" yet anyway.
Frankly speaking, I'd be very happy if you have something to "sell".
Perseverence shall get us there. And we are picking up momentum.
Post by Gour
I will rephrase is as: "If I would be able to write dekstop GUI app
using Modula-2 (R10) without too much pain due to lack of appropriate
tooling/libs, I'd very gladly accept to be disciplined by Modula-2
language, but as far as I can tell, this is not possible to do it
cleanly without involvement of some workarounds which are not in the
same spirit of the language itself
I think the suggestion by Martin Brown to try the XDS compiler is worth trying out.
I find it a useful tool for algorithm development since it is really
rather a good optimising compiler and it has excellent static analysis
capabilities at compile time. I think these should be built into any
modern compiler - there is no point in executing code that has latent
bugs in it that can be determined by dataflow analysis at compile time.

I haven't used the Windows GUI bindings extensively but those I have
tried did work OK.
I use the Windows one. I confess that mostly I have to do C/C++ as a
commercial reality but when I want to use Modula 2 I found XDS very good
as a modern compiler. I have various Topspeed and Logitech developed M2
code from way back that is still sometimes useful.

I have an M2 Chess program that is on my Roundtuit list and will one day
see the light of day. It would get nowhere against modern chess engines
but it is still better than most humans.
Post by trijezdci
But hey, try Martin Brown's suggestion.
I am a bit surprised you liked it. I wish you well with your project to
make a Rev10 Modula 2 compiler environment.

Incidentally is your SYSTEM module now renamed UNSAFE ?
--
Regards,
Martin Brown
Pascal J. Bourguignon
2015-10-02 14:39:46 UTC
Permalink
Raw Message
Post by Martin Brown
A customer for a new house would be immediately suspicious if his
architect started out by obsessing about a particularly fine solid
gold bathtap and then designed the entire house around it. Sadly that
happens all the time in software with the latest greatest silver
bullet!
I don't know about silver bullets (this is only marketting addressed to
programmers). But it seems to me that the gold bathtap is usually not a
programmer obsession, but a customer obsession.

The customer will obsess over his features, and silver bullet makers will
scheme while methodologies around this customer obsession, so that
programmers deliver only those customer obsessed features. Any sound
engineering, safety or resilience in the design (what design, it's
invisible to the customer, so it should not be worked on!) is totally
ignored (cf. agile, but not only).
Post by Martin Brown
Post by trijezdci
In the field of software, we have been brainwashed into thinking that software is different,
It is different in the sense that it is much harder to communicate
with the customers about exactly what they want and when they see what
they have asked for delivered they invariably move the goal posts
several times. Couple that with mission creep caused by marketing men
and you have a recipe for disaster. The dodgy engine codecs on the UK
delivery of non-airworthy Chinook helicopters that wiped out an entire
elite military team shows the problems even in notionally controlled
safety critical environments. Shrink wrap software is 100x worse.
Strangely a lot of computer games are remarkably bug free considering
their intrinsic complexity. I suspect the core gaming engine is very
carefully crafted and tested and pretty robust wrt dodgy inputs.
Since it runs 60 or 120 times a second, it gets tested a lot :-)
Post by Martin Brown
Post by trijezdci
it cannot possible done right and therefore there must be no liability.
The courts have swallowed that blue pill line, hook and sinker.
I doubt that will last long once driverless cars are on the road.
Not convinced that is true. Everybody knows that best practice with
formal methods at NASA and a handful of other 6 sigma sites can
deliver (almost) bug free software but nobody wants to pay the high
price.
Exactly.
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
trijezdci
2015-10-02 16:05:47 UTC
Permalink
Raw Message
Post by Martin Brown
I think it is more like early medieval cathedral builders myself.
If it is still standing 5 years later then it was a good design.
I am not that familiar with the history of that, but I somehow doubt that the state of the art in building was that dismal. I think the medieval builders had a lot of civil engineering knowledge from the Romans at their disposal and used that.
Post by Martin Brown
Don't ignore the fact that even today there are still a range of various
"free energy" scams like the Hendershot Generator and Rossi's LENR
widely promoted on the internet by their advocates.
True but I doubt they are anywhere near as ubiquitous as is bad software.
Post by Martin Brown
And an attitude one in the commercial world where time to market is
everything and fixing bugs after shipping product to get the CEO his
quadratic bonus is more important than correctness.
But therein also lies opportunity for those who want to gain advantage by going against the mainstream, compete on quality instead of participating in a race to the bottom. For those to emerge and become more numerous, there first needs to be a better supply of proper engineering resources.
Post by Martin Brown
There is also a difference in that plans for a building are in general
terms understandable by a layman and they would rapidly question the
wisdom of putting a door on the third floor or no doors or staircase.
A customer for a new house would be immediately suspicious if his
architect started out by obsessing about a particularly fine solid gold
bathtap and then designed the entire house around it. Sadly that happens
all the time in software with the latest greatest silver bullet!
And that is part of education. It's not only about educating engineers but also the public. And right now is actually a good time for this because people are slowly waking up to the fact that our computers and devices aren't safe from intruders who steal and sabotage.

I think there are quite a few people who can guess on an intuition level what's wrong. They don't need to be brainwashed, they kind of know, they only need to receive affirmation of what they intuitively suspect already.

When I tried to explain the rationale for what I am doing to my mother who is long past retirement age and has absolutely no technology background whatsoever, I had only just started to set the stage with some comment how bad software is, when she interrupted and exclaimed "That's because these things are far too complicated, they have become so complicated that even the engineers who make them no longer understand them!".

I didn't have to explain anything to her. She already knew precisely what the root cause is.

I don't think she's alone. If you tell people, they will likely go "But of course! I had suspected as much".
Post by Martin Brown
Post by trijezdci
In the field of software, we have been brainwashed into thinking that software is different,
It is different in the sense that it is much harder to communicate with
the customers about exactly what they want and when they see what they
have asked for delivered they invariably move the goal posts several
times.
That's because neither software developers nor sales folks nor so called sales engineers ever get any training whatsoever in requirements solicitation. There are courses and certifications for every kind of useless nonsense, but there is next to nothing for requirements solicitation. A structured methodology called Volere exists and the consulting shop in the UK who developed it give seminars, but they are pretty much lone wolves.

Heck most developers never even heard of the MoSCoW method. Everything is a must-have item, they do not know how to distinguish between the essential, the important, the desirable and the undesirable. How can such folks possibly extract customer requirements if they do not have a clue how to do that. Being able to write code gives you absolutely zero qualification for requirements solicitation. ZERO.

Again, education in methodology paired with discipline.
Post by Martin Brown
Couple that with mission creep caused by marketing men and you
have a recipe for disaster.
With a proper structured methodology you can tell the marking men to go to hell because they signed the MoSCoW analysis which clearly states "WONT DO".

I have always been able to prevent feature creep in projects I managed because I made it a habit to extract a price for every change. If you want X in scope when it isn't on the list, then you must give up something in return. Take your pick. In the vast majority of cases, when you extract that price, they will retract and tell you that it wasn't really that important and accept that it will have to go into the requirements of the next phase.

If you don't manage priorities and scope yourself, then you can't blame your customers.
Post by Martin Brown
Post by trijezdci
it cannot possible done right and therefore there must be no liability.
The courts have swallowed that blue pill line, hook and sinker.
I doubt that will last long once driverless cars are on the road.
Yes, that's what I am expecting, too. It will be interesting to watch.
Post by Martin Brown
USPTO accepted one by Rossi of LNER infamy only last month :(
Strictly it is a water heater of very dubious utility but the granting
of this patent allow him to make more grandiose claims for his scam.
But that has nothing to do with patent law. It comes down to patent offices who are usually underfunded and overloaded accepting bogus patents that the law does not actually permit to be granted. Nowadays, the vast majority of patents, especially in software, are not actually grounded in patent law, that is to say, under the law, they shouldn't be granted.

Most patents already fail on the requirement that an invention must be described in sufficient detail that persons skilled in the art shall be able to carry out the invention, which means that the patent specification must have all the details for others to build the invention simply from the specification without doing any inventing on their own. Patents that actually satisfy this requirement are extremely rare. They are kept deliberately vague so as to cover a broader range of claims. Patent offices could reject the vast majority of patent applications on that ground alone. This is a political issue.

But the law does not actually permit it.
Post by Martin Brown
Post by trijezdci
Software coders have been brainwashed into believing that software
cannot possibly
Post by trijezdci
be done reliably. The general public has accepted this falsehood for
fact as well.
Post by trijezdci
Even the courts believe it.
Not convinced that is true. Everybody knows that best practice with
formal methods at NASA and a handful of other 6 sigma sites can deliver
(almost) bug free software but nobody wants to pay the high price.
I doubt that this is common knowledge. And the courts are happily rejecting malfeasance claims when software producers waive their EULA in the courts faces. That would be unthinkable for electrical, mechanical or civil engineering. This will have to change.
Post by Martin Brown
I have an M2 Chess program that is on my Roundtuit list and will one day
see the light of day. It would get nowhere against modern chess engines
but it is still better than most humans.
Nice.
Post by Martin Brown
Post by trijezdci
But hey, try Martin Brown's suggestion.
I am a bit surprised you liked it.
I do not exactly know what Gour's requirements are, only that it is going to be an application and he needs a GUI framework but doesn't like to write it in C/C++. I am not very fond of ISO Modula-2, in particular I do not like the ISO IO library but XDS does have GUI interfaces for both Windows and X11 and I think it is still going to be more pleasant to use than the hodge-podge of Pascal dialects.

I wouldn't use it for our project though because we don't want any dependency on any commercial compiler for bootstrapping because we have no control over how long the compiler will be around. And we don't want dependencies on the ISO library either. As for GM2, it is a fairly heavy environment that can be difficult to build and get working and therefore you wouldn't want that dependency either.

So I decided to try M2C for the bootstrap compiler and avoid the two or three features that are known to have bugs. Since it is only for bootstrapping I am willing to take the chance. Once the compiler is self-hosting none of the M2C quirks will matter. In return it is very small and lightweight and easy to build.

I also got M2M for PC working under DOSbox. That should do for bootstrapping as well, as a backup so to speak. The only inconvenience with that is that its PIM2 so you need EXPORT statements in your definition parts.
Post by Martin Brown
I wish you well with your project to
make a Rev10 Modula 2 compiler environment.
Thanks, we will eventually get there ;-)

We certainly didn't spend six years on revision and design to create a paper tiger.
Post by Martin Brown
Incidentally is your SYSTEM module now renamed UNSAFE ?
Yes, we had renamed it several years ago after discussing the matter with Wirth and Gutknecht.

http://modula-2.net/m2r10/pmwiki.php?n=Project.FAQ#SystemVersusUnsafe

see also

http://knightsoftype.blogspot.jp/2013/12/the-separation-of-safe-and-unsafe.html
Gour
2015-10-02 19:06:51 UTC
Permalink
Raw Message
On Fri, 2 Oct 2015 09:05:47 -0700 (PDT)
Post by trijezdci
I do not exactly know what Gour's requirements are, only that it is
going to be an application and he needs a GUI framework but doesn't
like to write it in C/C++.
Correct. Give me type-safe language not belonging to the {C,C++,Java}
set with decent GUI multi-platform support and I'll use it and preach
about it. ;)
Post by trijezdci
We certainly didn't spend six years on revision and design to create a paper tiger.
I hope so...


Sincerely,
Gour
--
As a blazing fire turns firewood to ashes, O Arjuna, so does the
fire of knowledge burn to ashes all reactions to material activities.
Chris Burrows
2015-10-02 23:46:11 UTC
Permalink
Raw Message
Post by Gour
Correct. Give me type-safe language not belonging to the {C,C++,Java}
set with decent GUI multi-platform support and I'll use it and preach
about it. ;)
More type-safe than Modula-2 good emough ;-)

https://gpcp.codeplex.com/

We have successfully used the .NET version as production language for several years. The Modula-2 programmers I know switched to Oberon / Component Pascal in the late 1990's

Regards,
Chris Burrows
CFB Software
http://www.cfbsoftware.com/modula2
Chris
trijezdci
2015-10-03 02:26:18 UTC
Permalink
Raw Message
Post by Chris Burrows
We have successfully used the .NET version as production language for several years. The Modula-2 programmers I know switched to Oberon / Component Pascal in the late 1990's
Many former Modulans feel that Oberon violates the Einsteinian simplicity principle.

The one thing I could never tolerate about Oberon is that it doesn't have enumeration types. This is a very important part of type safety and the lack thereof in Oberon is a really bad design flaw from a safety point of view.

Also, in this day and age, coroutines or actors are an important requirement for implementing highly scalable servers. Interfacing to C wasn't exactly a design objective either.

At the same time, Oberon/CP has features that shouldn't be there or should be optional only.

Most Oberon implementations are still using so called type inclusion which Wirth himself says "turned out to have been an extremely bad idea" and he has removed it since but I doubt any compilers other than his own have been updated. This is also a really bad design flaw from a safety point of view.

And for a large number of embedded real-time applications you need to be able to turn GC off. Again, a safety requirement.
Chris Burrows
2015-10-03 11:36:54 UTC
Permalink
Raw Message
Post by trijezdci
Most Oberon implementations are still using so called type inclusion
Every Oberon compiler that I know of that has been developed since 2007 when the latest major language revision was published does not use type inclusion. You can find a few amongst the compilers listed here:

http://oberon07.com/compilers.xhtml
Post by trijezdci
And for a large number of embedded real-time applications you need to be able to turn GC off. Again, a safety requirement.
A garbage collector is not a part of embedded Oberon systems. We have not implemented one in our ARM7, Cortex-M3 or Cortex-M4 Oberon compilers.

Chris Burrows
CFB Software
Astrobe: Oberon for ARM, Cortex-M and FPGA systems.
http://wwww.astrobe.com
Chris Burrows
2015-10-04 07:11:54 UTC
Permalink
Raw Message
Post by trijezdci
The one thing I could never tolerate about Oberon is that it doesn't have enumeration types.
C Lins wrote a good article on the subject "Programming Without Enumerations in Oberon". Anyone who is interested in the pros and cons should seek out a copy. It was published in SIGPLAN NOTICES V25, #7, July 1990.

Chris Burrows
http://www.astrobe.com
August Karlstrom
2015-10-04 14:11:01 UTC
Permalink
Raw Message
Post by Chris Burrows
Post by trijezdci
The one thing I could never tolerate about Oberon is that it
doesn't have enumeration types.
C Lins wrote a good article on the subject "Programming Without
Enumerations in Oberon". Anyone who is interested in the pros and
cons should seek out a copy. It was published in SIGPLAN NOTICES V25,
#7, July 1990.
A link to a PDF version shows up on the first result page when I search
for it:

https://www.google.com/search?q=Programming+Without+Enumerations+in+Oberon


-- August
trijezdci
2015-10-04 16:57:27 UTC
Permalink
Raw Message
Post by August Karlstrom
A link to a PDF version shows up on the first result page
A hell of a lot of boilerplate for a simple weekday enumeration type don't you think?

Extensibility is not an argument against enumeration types, one might as well argue against record type for lack of extensibility if one didn't know they can be designed extensibly, so can enumeration types:

TYPE WorkWeek = ( Mon, Tue, Wed, Thu, Fri );

TYPE FullWeek = ( +WorkWeek, Sat, Sun );

TYPE Weekend = [Sat..Sun] OF FullWeek;

et voila, three lines of code in revised Modula-2.
trijezdci
2015-10-04 17:22:51 UTC
Permalink
Raw Message
Post by trijezdci
TYPE WorkWeek = ( Mon, Tue, Wed, Thu, Fri );
TYPE FullWeek = ( +WorkWeek, Sat, Sun );
TYPE Weekend = [Sat..Sun] OF FullWeek;
and here is some more ...

GENLIB Weekdays FROM Dictionaries FOR
KeyType = <<FullWeek>>;
ValueType = <<UNISTRING>>
END;

IMPORT UNISTRING, Weekdays;

TYPE CONST ImmutableWeekdays;

VAR week : ImmutableWeekdays;

BEGIN
NEW week :=
{ Mon, "月曜日", Tue, "火曜日", Wed, "水曜日", Thu, "木曜日", Fri, "金曜日",
Sat, "土曜日", Sun, "日曜日" };

FOR day, name IN week DO
WRITE("day"); WRITE(ORD(day));
WRITE(" : " & name)
END;

FOR day IN [Mon..Thu] OF FullWeek DO
WRITE(week[day])
END;

week[Mon] := "Lundi"; (* compile time error: immutable L-value *)

...
trijezdci
2015-10-04 17:24:51 UTC
Permalink
Raw Message
Post by trijezdci
TYPE CONST ImmutableWeekdays;
doh

TYPE ImmutableWeekdays = CONST Weekdays;
trijezdci
2015-10-04 16:40:57 UTC
Permalink
Raw Message
Post by Chris Burrows
Post by trijezdci
The one thing I could never tolerate about Oberon is that it doesn't have enumeration types.
C Lins wrote a good article on the subject "Programming Without Enumerations in Oberon". Anyone who is interested in the pros and cons should seek out a copy. It was published in SIGPLAN NOTICES V25, #7, July 1990.
I have spent quite a bit of time writing and maintaining C code and have thus gained first hand pain experience from the absence of proper enumeration types. If you allow constants to be returned, people will make up their own values on the fly without documenting what the values mean and the code becomes more and more bug ridden when changes are made and less and less maintainable.

From my experience, lack of proper enumerations belongs to the top three root causes of bugs created by C programmers, the other two are lack of bounds checking and type inclusion. Why on earth would you want to use any language that doesn't have proper enumeration types? Its a recipe for bugs.

One more thing that makes Oberon error prone is its lack of structured literals -- something also missing in classic Modula-2 -- which Oberonistas say may easily be replaced by a technique that is reminiscent of a 1960s BASIC directive known as DATA where raw data is placed at the end of the source text from where it is read during runtime by the code within the source text above. Yikes.
Chris Burrows
2015-10-05 00:53:54 UTC
Permalink
Raw Message
Post by trijezdci
From my experience, lack of proper enumerations belongs to the top three root causes of bugs created by C programmers, the other two are lack of bounds checking and type inclusion.
For a comprehensive list of C language problems that can lead to bugs see:

http://www.literateprogramming.com/ctraps.pdf
j***@gmail.com
2015-10-02 10:24:06 UTC
Permalink
Raw Message
Post by trijezdci
I believe that naysaying and consumerism are like a contagious disease that has the destructive power to bring an end to our civilisation.
and it will. but nothing is built to last nowadays. not even the civilisation, since it was designed by politicians and built by opportunists seeking for eternal fame at any cost.
Post by trijezdci
The "I want it all -- I want it now" attitude
is what has been driving our development cycle for years, unfortunately. without this attitude, we still would be looking for ways to easily push a cart. it works in favor of us, but if you're not in the right subgroup, ypu get the feeling it works against us. hard to tell.
Post by trijezdci
It is precisely for this reason that a well designed product can make a difference. The competition is so incredibly bad that the benefits will be apparent outright. We have already seen this in the feedback from scholars and universities around the world. Once our revised Modula-2 enters the curricula, new generations of true software engineers who actually deserve to be called engineers will emerge and carry the mindset of engineering in software production into industry.
you seem to live in the past.... this attitude is what brought Philips almost to the knees. Philips used to overdesign and over-engineer products. I will only mention the V2000 video recording system. although superior in all aspects, it was a failure again. and the video longplay disc. and many others. Philips used to wait until all bugs were out of their products before going to market.
how can you explain the success of python, when universities are looking for first class bombproff programming languages? universities offer python as introductory language... students are spoiled for life when they take that course.
Post by trijezdci
The Liechtenstein company Hilti
The Hilti story shows that overpriced products stand a chance. cHilti tells us that Hilti was lucky that cHilti was incredibly bad quality, not 'only half as good as the original'.
The story is similar to the story: "Bill? What bill? A rolls royce never breaks down". I wouldn't build my product on it.

Remember WP (Word Perfect)? WP gave away free copies to end users so the end users forced their employers to BUY WP at work.
Remember MSDOS: Microsoft was able to charge for every PC an amount or money so it could be shipped with MS-DOS. No matter if you would use MS-DOS or not. In fact they imposed a tax on computers.... and we all accepted it. In fact, MS is still doing this with laptop computers: you always pay for windows 8, no matter if you are going to use it.

It's all about marketing. Can you market Mod2R10? You might have a chance. But engineers properties don't cut the cake.
Engineers like us will always seek for better things. We will use it when nobody is looking. But you need to be careful: the idiots around us will stick to the company standard environment and use our successes against us.

See Volkswagen: some smart motor control programmer found out a way to detect whether a car is being driven in accordance to a standardised test protocol. and when the software detects a testmode, it starts changing the values on the lcd display... this is a typical engineering joke. To have big consequences.
Post by trijezdci
Modula-2 R10 is designed like a Hilti and we are going to build and distribute it.
this means that you overpriced it.
Post by trijezdci
We didn't use a banana approach. We took the opposite approach. We spent six years on design and refinement.
The Philips approach: three years in the laboratory will easily save you two hours in the library.
Post by trijezdci
http://pu.inf.uni-tuebingen.de/users/klaeren/sw.pdf
a 262 page document telling us that microsoft is bad (we already knew this), modula is good and that square roots are slower than addition on a VAX.
Klaeren is not a student with a thesis but a professor that got frustrated with software design since all the world is against quality.
His PDf boils down to PIM, only wirth takes 45 pages and klaeren takes 260. I guess the google translated version will be nearly impossible to read snce the german version is also not meant to be read; it's a bookshelf item.
Post by trijezdci
As for widely used, did you know that Modula-2 is widely used in ERP systems in Switzerland,
and in luggage handling systems where zero tolerance really is zero tolerance. you don't want to end up with someone else's dirty underpants.
trijezdci
2015-10-02 14:47:04 UTC
Permalink
Raw Message
Post by j***@gmail.com
how can you explain the success of python, when universities are looking for first class bombproff programming languages? universities offer python as introductory language... students are spoiled for life when they take that course.
There are universities and then there are universities. It depends which ones you are looking at.

As for Python, bring it on, not afraid to compete on the user experience. Our syntax is cleaner, more expressive and also more intuitive.
Post by j***@gmail.com
Post by trijezdci
The Liechtenstein company Hilti
The Hilti story shows that overpriced products stand a chance. cHilti tells us that Hilti was lucky that cHilti was incredibly bad quality, not 'only half as good as the original'.
No, the CHILIT guys tried very hard to copy the whole thing, but they just couldn't get it working. There is an extreme amount of research that goes into such tools to make them withstand the high wear and tear they are exposed to. Hiltis are used when no other tools get the job done. The Hilti will always prevail, no matter how tough the material, the Hilti is stronger and tougher to defeat the strongest materials. If you use expose any other make to those harsh conditions it will soon break down.

The Chinese have also tried to copycat expensive high precision tool machinery from Southern Germany and Switzerland and they just can't get it right and continue to buy those machines from Germany and Switzerland to make stuff. Likewise, they are expensive but not overpriced.
Post by j***@gmail.com
It's all about marketing. Can you market Mod2R10?
R10 is a working name for the revision work.

That doesn't mean that compilers will have to be promoted by that moniker, just as no compiler has been marketed as an IS-10514 Compiler.
Post by j***@gmail.com
Post by trijezdci
Modula-2 R10 is designed like a Hilti and we are going to build and distribute it.
this means that you overpriced it.
The only thing that will cost any money is the book that Rick and I are working on for a renowned science publishing house. Not to make money but because having a book published by them will lend momentum to the project.

All else is being free of charge, including source code.
j***@gmail.com
2015-10-03 19:38:42 UTC
Permalink
Raw Message
Post by trijezdci
There are universities and then there are universities. It depends which ones you are looking at.
this one is world famous in its field of expertise.
Post by trijezdci
No, the CHILIT guys tried very hard to copy the whole thing, but they just couldn't get it working.
then how could they sell their equipment? did the box say "broken tool inside"? of course it worked. hammerdrills have been around since 1920 when Fein invented them. it's not rocket science.
Of course, hilti gained a lot of knowledge making parts for the nazi war effort. being downright lucky to be out of reach for the allied B17's in liechtenstein.
Post by trijezdci
There is an extreme amount of research that goes into such tools to make them withstand the high wear and tear they are exposed to.
hilti just used Fein's patent and over specified the parts. if that is 'an extreme amount of research' so be it. hilti did not invent the hammerdrill. they improved it the hillbilly way by making everything stronger. the japanese improved things by strengthening the loaded parts.
Post by trijezdci
Hiltis are used when no other tools get the job done. The Hilti will always prevail, no matter how tough the material, the Hilti is stronger and tougher to defeat the strongest materials. If you use expose any other make to those harsh conditions it will soon break down.
is this a hilti commercial? on youtube is a guy who takes apart powertools.


on the hilti everything is over engineered and over specified. driving up the price, but hey, everyone knows a hilti MUST be expensive.

don't watch this one:
it says that makita is at least as good, costing half as much.

if you are about to create a compiler of hilti-fame, it might be worth while to see if a compiler of makita fame wouldn't be better. you are addressing the masses. the masses have no need for hilti or bentley or whatever snobbish product. people want affordable products that are good enough for all tasks.

makita make tools that are strong as required. hilti make them stronger. that being said, hilti works contrary to einsteinian standards: as strong as required but not any stronger.

if the new compiler is of hilti quality it will be overqualified. is that what you want?
Waldek Hebisch
2015-10-20 02:14:11 UTC
Permalink
Raw Message
Post by trijezdci
Post by Gour
One possible addition to the FAQ list: Why not (Object) Pascal?
We have got three questions of this type in the FAQ, that should suffice.
Mind you, Wirth published Modula-2 as an improvement over his earlier Pascal. Later Pascal implementations then adopted more and more features from Modula-2. These were bolted on, so the syntax is not as clean as it is in Modula-2. Leaving syntax aside, those Pascals are roughly comparable to classic or ISO Modula-2 or anywhere in between.
Well, Extended Pascal has a lot of things beyond Modula-2. Most
notable are schema types, you can find them in Ada, but Extended
Pascal introduced uniform syntax and made them a bit more general.
Another thing is restriced types -- there is some similarity to
OPAQUE types in R10 report, but I did not check details. Anyway,
Extended Pascal restricted types allow implementtion of ADT, where
type rules ensure that only implementation of ADT has access to
representation.

Object Pascal adds to that a nice interface based OO, whith
single inheritance for implementations and multiple inheritance
for interfaces. And types views, so that you can restrict
exported interface.

I understand that you do not want historical luggage present in
Pascal. And you may decide that constructions presect in Pascal
are too complicated to implement. But saying that Pascal added
nothing more to Modula-2 is simply wrong.

BTW. Even if you do not want to borrow anything from Pascal
you may benefit from reading the Extended Pascal standard.
While standareze is hard to read at first, it is quite
precise and well though specification.

BTW2: You should make some distiction between language
specification and implementation. For example, limiting
sets to 256 elements or specifying that enumerated types
always takes 16 bit should not be part of specification:
they are choices of particular implementation.
--
Waldek Hebisch
trijezdci
2015-10-22 21:42:38 UTC
Permalink
Raw Message
Thank you for your interest in our revision of Modula-2.
Post by Waldek Hebisch
Well, Extended Pascal has a lot of things beyond Modula-2.
I said "roughly comparable", emphasis should naturally be on "roughly", in the sense give or take a few items, but under on the bottom line it is roughly comparable. In that sense, I stand by my statement.
Post by Waldek Hebisch
BTW. Even if you do not want to borrow anything from Pascal
you may benefit from reading the Extended Pascal standard.
While standareze is hard to read at first, it is quite
precise and well though specification.
We borrowed more from Pascal than Wirth did himself.

We removed INC and DEC and replaced them with PRED and SUCC for example. We have polymorphic READ and WRITE instead of the holy mess that was classic Modula-2's jungle of IO procedures. We also use NEW and RELEASE, not NEW and DISPOSE, which is also Pascalish. We use some VAX-Pascalisms too like the :: type conversion operator.

Apropos VAX-Pascal (not sure what HP calls it nowadays) ... Now there is a Pascal that, if I were to use any Pascal, that's the one I would want to use. Not any of the others I have seen.
Post by Waldek Hebisch
BTW2: You should make some distiction between language
specification and implementation. For example, limiting
sets to 256 elements or specifying that enumerated types
they are choices of particular implementation.
Bitsets are unlimited in M2 R10, you got enough memory, you get bitsets of 10 million or 100 million bits if you are so inclined. Dynamic sets of any base type are also only limited by available memory. Some are built-in, some are standard library, some you roll yourself. One type of built-in set is limited, so what? It's designed for portability with a rather large margin. Most Pascal and Modula and C implementations don't even give you that many bits, the best you can hope for is 32 bits. And its never portable across compilers.

As for enumeration types, which are static, it is nonsensical to assume that any enumeration would exceed 65000 enumerated names. Even 65000 would be a horrible abuse already because it is no longer in the spirit of the language to create such an unmanageable and unreadable type. It is thus perfectly reasonable to impose a limit and in the process gain portability between implementations.

The point is this, in a language that makes user defined ADTs first class, that is to say user defined ADTs are for all practical purposes indistinguishable from built-in types, in such a language the built-in types no longer reign supreme.

Instead, the built-in types only need to cover a limited number of important and frequent use cases, and serve as building blocks for building user definable types that cover the more specific cases. Consequently, you can afford to put some limits on built-in types that in turn give you some benefits elsewhere. You need a type with a larger range, use the library or roll your own.

We support numeric types with up to 4000 digits precision. That too is an arbitrary limit that could one day be raised. But if you need a type with such a precision, you have to use the library or roll your own. When I say roll your own, in most cases that is as simple as a one line directive that will generate the type for you. You put an import directive right after that and the type is ready for use in our local scope.

We also dictate that programmers cannot use more than 10 levels of nested comments. There has to be some limit, even if the limit is determined by the memory of the system the compiler is running on, there always is a limit. If you leave that limit open, then portability cannot be guaranteed. If there is a limit anyway, you may as well dictate some reasonable limit and gain portability in the process. Interoperability is also sometimes involved in the equation.

This is a matter of design philosophy.

I hope this makes more sense now.
Waldek Hebisch
2015-10-23 06:19:50 UTC
Permalink
Raw Message
Post by trijezdci
Thank you for your interest in our revision of Modula-2.
Post by Waldek Hebisch
Well, Extended Pascal has a lot of things beyond Modula-2.
I said "roughly comparable", emphasis should naturally be on "roughly", in the sense give or take a few items, but under on the bottom line it is roughly comparable. In that sense, I stand by my statement.
Post by Waldek Hebisch
BTW. Even if you do not want to borrow anything from Pascal
you may benefit from reading the Extended Pascal standard.
While standareze is hard to read at first, it is quite
precise and well though specification.
We borrowed more from Pascal than Wirth did himself.
We removed INC and DEC and replaced them with PRED and SUCC for example. We have polymorphic READ and WRITE instead of the holy mess that was classic Modula-2's jungle of IO procedures. We also use NEW and RELEASE, not NEW and DISPOSE, which is also Pascalish. We use some VAX-Pascalisms too like the :: type conversion operator.
Apropos VAX-Pascal (not sure what HP calls it nowadays) ... Now there is a Pascal that, if I were to use any Pascal, that's the one I would want to use. Not any of the others I have seen.
Post by Waldek Hebisch
BTW2: You should make some distiction between language
specification and implementation. For example, limiting
sets to 256 elements or specifying that enumerated types
they are choices of particular implementation.
Bitsets are unlimited in M2 R10, you got enough memory, you get bitsets of 10 million or 100 million bits if you are so inclined. Dynamic sets of any base type are also only limited by available memory. Some are built-in, some are standard library, some you roll yourself. One type of built-in set is limited, so what? It's designed for portability with a rather large margin. Most Pascal and Modula and C implementations don't even give you that many bits, the best you can hope for is 32 bits. And its never portable across compilers.
Turbo Pascal had 256 bit limit. Gnu Pascal limits size to signed
integer, that is 2^31 elements on 32-bit machine. On 64-bit machines
Gnu Pascal imposed limit of 6^63 elements, but there were extra
limitations due to linker.

Can you form literals of user defined set types? Can user defined
type be optimezed as well as the buit in one? If not, then
set size limitation is serious. If yes, then I do not see why
you specify built-in set type at all.
Post by trijezdci
As for enumeration types, which are static, it is nonsensical to assume that any enumeration would exceed 65000 enumerated names. Even 65000 would be a horrible abuse already because it is no longer in the spirit of the language to create such an unmanageable and unreadable type. It is thus perfectly reasonable to impose a limit and in the process gain portability between implementations.
Well, I do not want to write myself big enumerations. But I may
wish to write program that generates code using such big enumarations.
Hower, upper limit is little issue. I would hope that elements of
small enumerations fit in 8 bits. OTOH, if machine can only read
memory in say 32-bit units (like some DSP) then I want compiler
to choose efficient size (which may be 32-bits).
Post by trijezdci
The point is this, in a language that makes user defined ADTs first class, that is to say user defined ADTs are for all practical purposes indistinguishable from built-in types, in such a language the built-in types no longer reign supreme.
I think you need to make this clearer in your specification. You
mention collections in decription of for loop, but I saw no way
for user to define a collection type. Is set a collection?

Do you have generic types? For example, can you define a list
type such that you can store on the list elements of some
family of types and retain type safety. More precisely, can
you define list type that one specialization is list
of integers and another is list of say strings. The point
is having single definition of list type, but avoid
mixing element types.
Post by trijezdci
Instead, the built-in types only need to cover a limited number of important and frequent use cases, and serve as building blocks for building user definable types that cover the more specific cases. Consequently, you can afford to put some limits on built-in types that in turn give you some benefits elsewhere. You need a type with a larger range, use the library or roll your own.
Well, if user defined types are as capable as you say, then
builtin types beside beeing building blocks also serve as
a common ground. Namely, in language that is serious about
there is always risk that you have routine doing what you
need but on incompatible type. So you want buit in types
to be widely applicable. Arbitrary limits go against
such purpose.
Post by trijezdci
We support numeric types with up to 4000 digits precision. That too is an arbitrary limit that could one day be raised. But if you need a type with such a precision, you have to use the library or roll your own. When I say roll your own, in most cases that is as simple as a one line directive that will generate the type for you. You put an import directive right after that and the type is ready for use in our local scope.
We also dictate that programmers cannot use more than 10 levels of nested comments. There has to be some limit, even if the limit is determined by the memory of the system the compiler is running on, there always is a limit. If you leave that limit open, then portability cannot be guaranteed. If there is a limit anyway, you may as well dictate some reasonable limit and gain portability in the process. Interoperability is also sometimes involved in the equation.
This is a matter of design philosophy.
I hope this makes more sense now.
That still looks very arbitrary. For example, nestable comments
are useful to comment out sections of code. But once you allow
them any fixed limit causes trouble. In case of comment the
compile can just count nesting level, so you can make it practically
unlimited (have limit bigger than maximal allowed file size).
Parsers need to use stack, but for example Gnu Pascal used
parser with dynamically allocated stack, so limits were
quite high.

I do not think you can get real portablity via limits. Modula-2
in principle should be usable for embedded programming. So
you may get 8-bitter with 1 kilobyte of RAM and 16 kilobyte
flash. Compilcated code simply is to big to fit into such
machine. OTOH on big machines people routinely generate
huge surce files: GNU C folks get bug reports about files
bigger than half milion lines.

I understand the mindset, but I do not agree. As a little
anecdote: Pascal standard simply says that compilers may
have limits. Effectively legal Pascal compiler may
refuse to compile anything claiming it to be above limits.
C-90 standard specified that compiler should allow at least
this of one kind etc. But if you look carefully what this
really meant then in plain language C compiler was obliged
to compile a single sufficiently large program. In other
word C compiler could still reject user programs claiming
that they exceed limits. So despite effort C formal
guaranty was meaningless. Of course one could try harder
to give better specifikation. But IMO limits are better
left to common sense and market.

Anyway, even if you decide to specify a lot of small
limits it still makes sense to divide a specification
into parts, one written as for unlimited world and
other comtaining limits.
--
Waldek Hebisch
trijezdci
2015-10-23 10:52:04 UTC
Permalink
Raw Message
Post by Waldek Hebisch
Turbo Pascal had 256 bit limit. Gnu Pascal limits size to signed
integer, that is 2^31 elements on 32-bit machine. On 64-bit machines
Gnu Pascal imposed limit of 6^63 elements, but there were extra
limitations due to linker.
The situation today is this. If I want to write a recursive descent parser in Modula-2 and I want to use enumerated sets of all tokens for FIRST, FOLLOW and skip sets (resync points after an error), then I cannot be sure that the set will work across compilers because the number of tokens may exceed what the compiler will handle, precisely because it is completely left up to implementers.

In other words, the advantage that Modula-2 as an implementation language for such a parser has over C which lacks sets, is diminished because to be sure, I will have to roll my own set library anyway.

Specifying this in a language specification makes sense. Yet, if you pick a value that is too large, then you may run into trouble with compilers targeting small architectures such as micro controllers.
Post by Waldek Hebisch
Can you form literals of user defined set types?
Yes
Post by Waldek Hebisch
Can user defined type be optimezed as well as the buit in one?
In two ways yes.

First, since Modula-2 was designed as a systems implementation language, you have all the means necessary to map out the data of your ADT as you wish, the language doesn't abstract this away.

Second, since M2 R10 is more explicit than most other languages and the syntax is designed to convey the intent of the author where possible, you can pass information to an optimising back end that will usually not be available when using other languages and the optimiser will then have to collect the information (often by heuristics which is nothing more than guessing) or back off.

In M2 R10 all bitset types are library defined, even the ones that look like built-ins such as BITSET and LONGBITSET (they are alias types). The library defined bitsets are generated from templates. In our implementation we will use the exact same templates for the built-in enumerated set types.

There is thus no difference between the IR of a code snippet that handles a built-in enumerated set and that of a bitset of an imported bitset type. The optimisation done on that IR is whatever it is. If the compiler doesn't do any optimisation then it applies to both built-in and library defined sets. If the compiler does optimise or hook into an optimising back end infrastructure, then both are optimised in the same way. The optimiser doesn't ask "Is this a built-in type so I need to do more work on it?".
Post by Waldek Hebisch
... I do not see why you specify built-in set type at all.
We have pondered this. At the extreme, we could have designed the dialect with only BOOLEAN and OCTET, no other predefined built-in types, and only ARRAY, RECORD and POINTER as built-in type constructors. All else could have been left for user defined ADTs to handle.

The reason why we didn't quite go that far is mostly convenience and .

Most people are used to and find

TYPE ColourSet = SET OF Colour;

more palatable than

GENLIB ColourSet FROM Sets FOR baseType = <<Colour>> END;
IMPORT ColourSet;

At one point we experimented with the idea to simply treat a TYPE definition/declaration as a directive to kick off the template engine on a library template, but this runs counter to our design objective of transparency, "no invisible magic" and "implicit-rather-than-explicit" which is important to show author intent and ultimately for readability and maintainability.
Post by Waldek Hebisch
Well, I do not want to write myself big enumerations. But I may
wish to write program that generates code using such big enumarations.
Even then we would consider it an abuse. The output of any generator should always be palatable and comprehensible to a human reader. This is very important for correctness, reliability and safety because it impacts verifiability and maintainability.
Post by Waldek Hebisch
Hower, upper limit is little issue. I would hope that elements of
small enumerations fit in 8 bits. OTOH, if machine can only read
memory in say 32-bit units (like some DSP) then I want compiler
to choose efficient size (which may be 32-bits).
For that we have pragmas that tell the compiler or optimiser to pack data.
Post by Waldek Hebisch
Post by trijezdci
The point is this, in a language that makes user defined ADTs first class, that is to say user defined ADTs are for all practical purposes indistinguishable from built-in types, in such a language the built-in types no longer reign supreme.
I think you need to make this clearer in your specification.
Correct. You will find that the wiki says update is in progress.

I think I had explained this before. We had initially started out with a wiki but I had to leave Japan after the Fukushima earthquake in a hurry because I had just switched jobs and my new job was to start the Monday after the earthquake and my new employer told me all changed I couldn't start and they had no idea how long this situation would persist, so I accepted another offer in Europe and had to leave Japan within a few days, leaving our wiki server unattended in my apartment in Tokyo where it collected more and more dust and eventually stopped working.

At that point I had already started drafting a PDF from the wiki content and so we simply kept using that PDF as a basis for recording of revisions. At some point I had (prematurely) put in quite a bit of work on layout and formatting so it would look nice, but we still had changes which then messed up the layout and I spent more time on layout than documenting. We then recorded our decisions in a scratch file in plain text, not necessarily in a form that was ready for publication. After we got the wiki back, I decided to build the specification from the earlier PDF and the scratch notes on the wiki first and update a new PDF later because on the wiki I don't need to spend much time on layout and formatting.

This is why the PDF is out of date and the wiki is not yet complete. I am working on that.
Post by Waldek Hebisch
mention collections in decription of for loop, but I saw no way
for user to define a collection type. Is set a collection?
Yes. I am sure the data type section in the PDF says that sets are collections but that isn't on the wiki yet and next on my to do list. Apologies for that.

Perhaps I may also mention that it has been a challenge to organise the document such that a human reader can read it from start to end without running into situations where a terminology or concept is mentioned that has not yet been explained but sits in a later part of the document.

Especially the blueprint compilation unit did not seem to fit in anywhere. If you build your own ADT and want it to use built-in syntax in the way a built in type does, then you need to declare conformance to a blueprint. Our standard library comes with a complete set of blueprints for common use, so you could just treat them as black boxes at the point where you explain libraries, but since the blueprint defines constraints and requirements that the ADT must follow, you cannot completely ignore blueprints.

But if you start out explaining blueprints first, then you may lose your reader because you are one level above what they may expect. They want to know how do I write a library, and you talk about how to write a specification for writing a certain kind of library.

It has turned out that it is best to organise the document without going into blueprints at first and introduce all else first, then explain them at the end. It also turned out best to order the grammar in the same way as the document and to structure both grammar and document by compilation unit, that is to say first everything relating to definition parts of libraries, then implementation parts, etc.

All this is a side effect of having facilities that make user defined ADTs first class. Since this is a new facility, it was not entirely clear how to order and structure the material when we started out. We had to find out what works by trial and error from the feedback of peer reviewers.

To make matters even worse, what seemed to be the best presentation order changed as a result of certain design decisions along the way.

These factors have also contributed to the specification not being in one piece yet.
Post by Waldek Hebisch
Do you have generic types? For example, can you define a list
type such that you can store on the list elements of some
family of types and retain type safety.
Yes.

Although we do not accomplish this by what you might think of as a "generic type".

What you might call a generic type is not part of the type system in M2 R10.
Post by Waldek Hebisch
More precisely, can
you define list type that one specialization is list
of integers and another is list of say strings.
Yes.
Post by Waldek Hebisch
The point is having single definition of list type,
but avoid mixing element types.
I am not sure what you mean by mixing element types, but I think I understand what your concern is.

What you call a definition in this context is not a type definition in M2 R10. Instead it is a blueprint which is a compilation unit of its own that imposes constraints and requirements on libraries that declare conformance to it.

The concept is somewhat similar to what Smalltalk calls protocols and Java calls interfaces, but there are significant differences. It would be incorrect to consider them equivalent.

For example some of the requirements in a blueprint are only intended for the compiler to be able to synthesise certain operations, a client library would never ever need to use those facilities directly.

Also, an ADT doesn't define its own literal compatibility because this is something that can be specified at the blueprint level and the ADTs inherits that from the blueprint without the need to restate it.
Post by Waldek Hebisch
... Namely, in language that is serious about
there is always risk that you have routine doing what you
need but on incompatible type. So you want buit in types
to be widely applicable. Arbitrary limits go against
such purpose.
Well, this is too generic for me to comment on, but suffice it to say: our limits don't.
Post by Waldek Hebisch
... nestable comments
are useful to comment out sections of code.
No, they are not.

The practise you describe leads to what is known as technical debt.

It needs to be machine readable/identifiable so it can be found if forgotten and flagged in reports.

To satisfy that need, sections of code should be disabled by means that make it visible and obvious. We have a pragma for that.
Post by Waldek Hebisch
But once you allow
them any fixed limit causes trouble. In case of comment the
compile can just count nesting level, so you can make it practically
unlimited (have limit bigger than maximal allowed file size).
Parsers need to use stack, but for example Gnu Pascal used
parser with dynamically allocated stack, so limits were
quite high.
We disagree on the level of "freedom".

Our philosophy is essentially about extreme strictness.

I once read a usenet posting many many many years ago where somebody was comparing operating systems or computer platforms to political isms. People then commented by offering alternative isms.

One such comment was either about VAX/VMS or MacOS -- I don't remember those particulars now, but I remember the comment as saying "XYZ is not ***, it is fascism, but GOOD fascism".

Although the whole comparison may be objectionable on the grounds of political correctness. I believed back then and I do believe now that -- leaving political correctness aside -- there was a great deal of truth in that statement.

I would rather call it extreme strictness but essentially quality assurance in software is first and foremost about restrictions imposed on programmers who all too often don't follow good practise, whatever the reasons may be -- they may be under pressure, they may be tired or in some cases they may not anticipate the negative consequences of their actions.

It is no accident that Modula-2, although essentially based on a Xerox PARC design, arose out of Switzerland, where people can be rather stubborn about rules they like to impose on themselves.

It is also no accident that Swiss watches emerged in that environment.
Post by Waldek Hebisch
I do not think you can get real portablity via limits.
I am not saying that portability is a result of limits, at least not limits alone, but leaving limits to implementors is a pretty sure way of not having portability.
Post by Waldek Hebisch
Modula-2
in principle should be usable for embedded programming.
Our design is very much influenced by the desire to target embedded device controllers. The notion to move larger stuff into library is rather more helpful in this context.
Post by Waldek Hebisch
you may get 8-bitter with 1 kilobyte of RAM and 16 kilobyte
flash. Compilcated code simply is to big to fit into such
machine.
Hence the move into a library. Don't use the "large stuff" libraries on a small target.
Post by Waldek Hebisch
OTOH on big machines people routinely generate
huge surce files: GNU C folks get bug reports about files
bigger than half milion lines.
Just because this is done doesn't mean it is a good practise.
Post by Waldek Hebisch
I understand the mindset, but I do not agree.
There are cases where things should be left to implementation, there are other cases where this is not so. I do not think that there can be one blanket rule for all cases.
Post by Waldek Hebisch
But IMO limits are better
left to common sense and market.
I do not believe in feature evolutionism.

If we leave software features to (consumer) markets we get precisely the kind of lousy quality we have now. Features, features, features, ship early, fix later.

As for common sense, all the limits we set are common sense in the context I have explained.

If you wrote a generator that generates source code with a 65000 value enumeration type, I wouldn't do any further business with you. Our mission is not about nostalgia, it is not about giving geeks a new toy, it is ultimately about telling folks "YOU ARE DOING IT WRONG".

Call us stubborn old farts if you like. We are in good company. Niklaus Wirth would be a stubborn old fart by this definition, too. So would renowned software quality assurance experts like Harry Sneed.

We are all stubborn old farts who are telling the rest of the IT world that they are doing it wrong.

So be it.
Martin Brown
2015-10-26 14:24:44 UTC
Permalink
Raw Message
Post by Waldek Hebisch
Post by trijezdci
Thank you for your interest in our revision of Modula-2.
Post by Waldek Hebisch
Well, Extended Pascal has a lot of things beyond Modula-2.
I said "roughly comparable", emphasis should naturally be on "roughly",
in the sense give or take a few items, but under on the bottom line it is
roughly comparable. In that sense, I stand by my statement.
Post by Waldek Hebisch
BTW. Even if you do not want to borrow anything from Pascal
you may benefit from reading the Extended Pascal standard.
While standareze is hard to read at first, it is quite
precise and well though specification.
We borrowed more from Pascal than Wirth did himself.
We removed INC and DEC and replaced them with PRED and SUCC for example.
I can't really get excited about that either way. Even ++ and -- are OK.
Post by Waldek Hebisch
Post by trijezdci
We have polymorphic READ and WRITE instead of the holy mess that was
classic Modula-2's jungle of IO procedures.
So long as it remains type safe I prefer that. Though I would like to
have some equivalent of FORMAT that yields a string representation.
Post by Waldek Hebisch
Post by trijezdci
We use some VAX-Pascalisms too like the :: type conversion operator.
Personally I prefer conversion as TYPE(var) to var :: TYPE.
Post by Waldek Hebisch
Post by trijezdci
Post by Waldek Hebisch
BTW2: You should make some distiction between language
specification and implementation. For example, limiting
sets to 256 elements or specifying that enumerated types
they are choices of particular implementation.
Bitsets are unlimited in M2 R10, you got enough memory, you get bitsets
of 10 million or 100 million bits if you are so inclined. Dynamic sets
of any base type are also only limited by available memory.
Turbo Pascal had 256 bit limit. Gnu Pascal limits size to signed
integer, that is 2^31 elements on 32-bit machine. On 64-bit machines
Gnu Pascal imposed limit of 6^63 elements, but there were extra
limitations due to linker.
JPI and later Topspeed was the only one I recall with upto 65536 length
bitsets. All others had BITSET limit of 16 or 32 bits max.

For embedded work having a compiler directive to pack byte length
variables together and/or pad things to fast boundaries is helpful.
--
Regards,
Martin Brown
trijezdci
2015-10-26 23:46:35 UTC
Permalink
Raw Message
Post by Martin Brown
Post by trijezdci
We removed INC and DEC and replaced them with PRED and SUCC for example.
I can't really get excited about that either way. Even ++ and -- are OK.
INC and DEC are machine level instructions. they belong into pseudo-module UNSAFE (formerly SYSTEM) and that's where they moved. They also have their equally named cousins in pseudo-module ATOMIC which are, no surprise, atomic versions.

PRED and SUCC are safer alternatives because they are non-destructive and there was no non-destructive increment/decrement in Modula-2. If you wanted to roll your own from INC and DEC you had to introduce a temporary variable.

As for ++ and --, they are available as statements.
Post by Martin Brown
Post by trijezdci
We have polymorphic READ and WRITE instead of the holy mess that was
classic Modula-2's jungle of IO procedures.
So long as it remains type safe I prefer that. Though I would like to
have some equivalent of FORMAT that yields a string representation.
I think I had already responded to that before. Yes, they are type safe, and the formatting to a string is a library function without binding to a predefined name in the language.
Post by Martin Brown
Personally I prefer conversion as TYPE(var) to var :: TYPE.
That is rather problematic because you are using the same identifier for a type and for a function, both of which are library defined and typically reside in the same module.

TYPE Foo = ... ;

PROCEDURE Foo ( source : SourceType ) : Foo;


And since we need polymorphism, it gets even worse ...

PROCEDURE Foo ( source : Bar ) : Foo;

PROCEDURE Foo ( source : Baz ) : Foo;

PROCEDURE Foo ( source : Bam ) : Foo;


With an operator this is easy and intuitive ...

PROCEDURE [::] fromBar ( bar : Bar ) : Foo;

PROCEDURE [::] fromBaz ( baz : Baz ) : Foo;

PROCEDURE [::] fromBam ( bam : Bam ) : Foo;
Post by Martin Brown
JPI and later Topspeed was the only one I recall with upto 65536 length
bitsets. All others had BITSET limit of 16 or 32 bits max.
You can have a bitset type of 64K bits or even bytes in M2 R10, too. But it's not built-in, so you have to import it and you cannot use it in compile time expressions (for example for conditional compilation). Other than that it will look and feel like it was built-in.

What is limited to 256 bits are bitmapped enumerated sets using the built-in SET OF type constructor. You can still roll your own large set type whose element type is an enumeration type and whose element limit is user defined (static or dynamic).
Post by Martin Brown
For embedded work having a compiler directive to pack byte length
variables together and/or pad things to fast boundaries is helpful.
<*ALIGN=0*>

Marco van de Voort
2015-10-24 19:39:25 UTC
Permalink
Raw Message
Post by trijezdci
We also use NEW and RELEASE, not NEW and DISPOSE, which is also Pascalish.
It's mark/release or new/dispose.

But they are different things. mark/release work on heap level (mark a
position on a heap, and then release all allocations after being marked).

new/dispose are the functions (typed) dynamic memory allocation.
(getmem/freemem are the untyped ones, at least in Borland dialects)

(Waldek:)
Post by trijezdci
Post by Waldek Hebisch
BTW2: You should make some distiction between language
specification and implementation.
Seconded.
Post by trijezdci
We also dictate that programmers cannot use more than 10 levels of nested
comments. There has to be some limit, even if the limit is determined by
the memory of the system the compiler is running on, there always is a
limit. If you leave that limit open, then portability cannot be
guaranteed. If there is a limit anyway, you may as well dictate some
reasonable limit and gain portability in the process. Interoperability is
also sometimes involved in the equation.
This is a matter of design philosophy.
Or having less machine limitations to contend with 30 years later.
trijezdci
2015-10-25 11:55:53 UTC
Permalink
Raw Message
Post by Marco van de Voort
Post by trijezdci
We also use NEW and RELEASE, not NEW and DISPOSE, which is also Pascalish.
It's mark/release or new/dispose.
But they are different things. mark/release work on heap level (mark a
position on a heap, and then release all allocations after being marked).
new/dispose are the functions (typed) dynamic memory allocation.
(getmem/freemem are the untyped ones, at least in Borland dialects)
Well, in the original Pascal it was NEW and RELEASE and the semantics of RELEASE matched those of Modula-2's DISPOSE, except that Pascal's RELEASE was firmly built-in while Modula-2's DISPOSE is a macro that expands to a call of a library defined DEALLOCATE procedure.


In any event, the RELEASE operation can be viewed as a generalisation of DISPOSE whereby the DISPOSE operation deallocates unconditionally and the RELEASE operation deallocates conditionally.

(1) in cases where a RETAIN operation is available

RELEASE cancels an outstanding retain.
it checks if there are any further outstanding retains,
if no further retains are outstanding, it deallocates, otherwise not

(2) in cases where a RETAIN operation is not available

RELEASE deallocates unconditionally

Under this model, there is no need for separate DISPOSE and RELEASE operations.

This is the model we use in M2 R10.

By default all types are unmanaged, thus RELEASE behaves just like DISPOSE did in classic Modula-2.

However, a library defined ADT may implement RETAIN. In this case it must also implement an associated RELEASE that satisfies the above description and RELEASE then behaves accordingly.

An attempt to invoke RETAIN on an instance of an unmanaged data type causes a compile time error.
Post by Marco van de Voort
Or having less machine limitations to contend with 30 years later.
While I do not advocate changing languages following fashionable trends, I don't think a language should be viewed as static either. Within a period of 30 years, there ought to be some maintenance.
Chris Burrows
2015-10-26 09:23:34 UTC
Permalink
Raw Message
Post by trijezdci
Well, in the original Pascal it was NEW and RELEASE
In original Pascal (both Jensen & Wirth and Standard Pascal) it was 'new' and 'dispose' NOT 'release'.
Loading...