Discussion:
Modula-2 & GUI apps
(too old to reply)
Gour
2015-08-02 09:05:14 UTC
Permalink
Hello!

Recently I did exchange several emails with Benjamin - main developer
working on R10 revision of Modula-2 language and I'm really impressed!!

The language looks much better/nicer than many of so called 'modern' languages
like Rust, Go, Nim...Moreover, I also got confirmation that there is plan
to implement R10 into GM2 compiler.

Now I wonder what was/is situation in regard to GUI bindings?

I'd like to write multi-platform open-source desktop app, but it looks
like there are no bindings available for higher-level toolkits like
GTK+, wx, Qt...

Do you consider that Modula-2 (R10) is still viable option to write
desktop apps or to 'surrender' to some of the language from newer
generation?


Sincerely,
Gour
Marco van de Voort
2015-08-02 09:18:51 UTC
Permalink
Post by Gour
Now I wonder what was/is situation in regard to GUI bindings?
I'd like to write multi-platform open-source desktop app, but it looks
like there are no bindings available for higher-level toolkits like
GTK+, wx, Qt...
If it is build into gm2, I assume you can reuse whatever possibilities gm2
has?
Post by Gour
Do you consider that Modula-2 (R10) is still viable option to write
desktop apps
Since after adding to the compiler it will also take time to develop new
libraries that use R10's possibilities, I guess the abilities will be about
the same as gm2 now. That should be easily evaluated.
Post by Gour
or to 'surrender' to some of the language from newer
generation?
I went back to an older generation, Pascal/Delphi/Lazarus, though that was
straight from JPI before gm2 existed.
Gour
2015-08-02 10:07:22 UTC
Permalink
Post by Marco van de Voort
If it is build into gm2, I assume you can reuse whatever possibilities gm2
has?
Hmm, I do not expect compiler to have support for GUI bindings?
Post by Marco van de Voort
Since after adding to the compiler it will also take time to develop new
libraries that use R10's possibilities, I guess the abilities will be about
the same as gm2 now. That should be easily evaluated.
Well, I believe that GUI bindings simply do not have anything related to
GM2 compiler itself and are expected to be 3rd party project…
Post by Marco van de Voort
I went back to an older generation, Pascal/Delphi/Lazarus, though that was
straight from JPI before gm2 existed.
Well, FPC/Lazarus is definetely an option as well…Consiering Modula-2’s
strong(er) typing, how are you satisfied with Lazarus/Pascal? Do you use
Qt or GTK bindings?


Sincerely,
Gour
--
One is understood to be in full knowledge whose every endeavor
is devoid of desire for sense gratification.
Marco van de Voort
2015-08-02 15:37:45 UTC
Permalink
Post by Gour
Hmm, I do not expect compiler to have support for GUI bindings?
Well, I believe that GUI bindings simply do not have anything related to
GM2 compiler itself and are expected to be 3rd party project???
It depends a bit on the project which libraries belong to core, and which
not. I don't know if gm2 packages bindings and/or generates them on startup.
Post by Gour
Post by Marco van de Voort
I went back to an older generation, Pascal/Delphi/Lazarus, though that was
straight from JPI before gm2 existed.
Well, FPC/Lazarus is definetely an option as well???Consiering Modula-2???s
strong(er) typing, how are you satisfied with Lazarus/Pascal? Do you use
Qt or GTK bindings?
I have a Delphi day job, but for my own work I purely use Lazarus/FPC. The
more complex applications are nearly all on win32, but simpler stuff also
gets used on *nix, usually with GTK. More a habit than a deep choice though.

I never use GUI directly, always via the Lazarus LCL, so the bulk of the
code is cross-widget, and only detail fidgeting is widgetset specific.

One of the reasons to not stick it out with M2 were the fact that free tools
were hard to get, and the communities and scope of the tools were
lessening. Moreover going from 16 to 32-bit and from dos to gui meant a lot
of rewriting anyway, so I evaluated the options.

I changed in 1997, but kept various M2 codebases running till about
2000-2002 when the advent of Win2000 (in the job) forced me to update all
dos projects.

While I still stand by most M2 choices over Pascal, I considered them mostly
details rather than landslide changes. In the end the viability of the
platform won out. Half of the time I was doing something in M2, I was basing
myself on the vast Turbo Pascal source archives to start with.
Gour
2015-08-02 17:37:41 UTC
Permalink
Post by Marco van de Voort
I have a Delphi day job, but for my own work I purely use
Lazarus/FPC.
Ohh, that's very interesting...today I visited #fpc/lazarus and it seems
community is quite alive.
Post by Marco van de Voort
The more complex applications are nearly all on win32, but simpler
stuff also gets used on *nix, usually with GTK. More a habit than a
deep choice though.
Nice to hear.
Post by Marco van de Voort
I never use GUI directly, always via the Lazarus LCL, so the bulk of the
code is cross-widget, and only detail fidgeting is widgetset specific.
Afaik, using LCL one can decide to which toolkit one wants to link
depending on the target platform, right?
Post by Marco van de Voort
One of the reasons to not stick it out with M2 were the fact that free tools
were hard to get, and the communities and scope of the tools were lessening.
Yeah, community is not much alive. Gnu GM2 is alive, but what is the use
of plain compiler with additional libraries...
Post by Marco van de Voort
I changed in 1997, but kept various M2 codebases running till about
2000-2002 when the advent of Win2000 (in the job) forced me to update all
dos projects.
Thanks a lot for your input!
Post by Marco van de Voort
While I still stand by most M2 choices over Pascal, I considered them mostly
details rather than landslide changes.
I must admit I forgot most of Pascal - it was long ago, but, otoh, like
Modula-2 and R10 features, but without other parts of the ecosystem,
language itself does not mean much.
Post by Marco van de Voort
In the end the viability of the platform won out. Half of the time I
was doing something in M2, I was basing myself on the vast Turbo
Pascal source archives to start with.
It looks I'll also try FPC/Lazarus. Are you familiar with Lazarus
Complete Guide?
(http://www.blaisepascal.eu/index.php?actie=./subscribers/lazarusbookinfoEnglish)

I simply like to have concrete books for learning, if possible...

Sincerely,
Gour
Marco van de Voort
2015-08-02 20:51:23 UTC
Permalink
Post by Gour
Post by Marco van de Voort
I have a Delphi day job, but for my own work I purely use
Lazarus/FPC.
Ohh, that's very interesting...today I visited #fpc/lazarus and it seems
community is quite alive.
It is one of the bigger of the small communities, and the project is quite
complete.
Post by Gour
Post by Marco van de Voort
I never use GUI directly, always via the Lazarus LCL, so the bulk of the
code is cross-widget, and only detail fidgeting is widgetset specific.
Afaik, using LCL one can decide to which toolkit one wants to link
depending on the target platform, right?
Yes and no, it is not merely linking, but also a recompile of the LCL
itself. In practice not a problem though.
Post by Gour
Post by Marco van de Voort
One of the reasons to not stick it out with M2 were the fact that free tools
were hard to get, and the communities and scope of the tools were lessening.
Yeah, community is not much alive. Gnu GM2 is alive, but what is the use
of plain compiler with additional libraries...
It wasn't back then. There was Stony Brook and that was about it. But back
then I was not in professional programming, so I didn't want to spring for
expensive tools for what was a hobby back then.
Post by Gour
Post by Marco van de Voort
While I still stand by most M2 choices over Pascal, I considered them mostly
details rather than landslide changes.
I must admit I forgot most of Pascal - it was long ago, but, otoh, like
Modula-2 and R10 features, but without other parts of the ecosystem,
language itself does not mean much.
Mostly M2 does away with Pascal's begin, is casesensitive and the base type
is unsigned. The thing I missed the most though was M2's more precise
control over importing/exporting identifiers.

I didn't really care much about what R10 added, either dotting some
detail i's and a lot of objc borrow work. I'm not an Apple-ian, so not that
excited about that either.

IMHO people over obsess about language, and not enough about libraries
and the toolchain eco system in genera.
Post by Gour
It looks I'll also try FPC/Lazarus. Are you familiar with Lazarus
Complete Guide?
(http://www.blaisepascal.eu/index.php?actie=.....
Yes, all FPC devels got a copy, but it is more an collection of essays
interesting for people broading their scope of the project than a tutorial
for the uninitiated.
Post by Gour
I simply like to have concrete books for learning, if possible...
I would go to your nearest 2nd hand book store, and buy Delphi books,
specially from Marco Cantu's mastering.. series of older versions. (those
still have large sections on the language)

His free ebooks (essential pascal and essential delphi) are also good starts.

The very best is the language guide from D6/D7 period, so if your employer
owns/owned Delphi, it might be worth checking their library.
Gour
2015-08-03 04:50:56 UTC
Permalink
Post by Marco van de Voort
Yes and no, it is not merely linking, but also a recompile of the LCL
itself. In practice not a problem though.
Ahh, that’s not big problem, indeed.
Post by Marco van de Voort
It wasn't back then. There was Stony Brook and that was about it. But back
then I was not in professional programming, so I didn't want to spring for
expensive tools for what was a hobby back then.
I’m also not in pro programming, but looking for a semi-hobby project –
open-source.
Post by Marco van de Voort
The thing I missed the most though was M2's more precise
control over importing/exporting identifiers.
That’s similar to Ada, right?

How do you workaround this in practice?
Post by Marco van de Voort
I didn't really care much about what R10 added, either dotting some
detail i's and a lot of objc borrow work. I'm not an Apple-ian, so not that
excited about that either.
I also do not care about Obj-C, but here I think about the things which
are added more recently and which exists only in spec atm…
Post by Marco van de Voort
IMHO people over obsess about language, and not enough about libraries
and the toolchain eco system in genera.
You’re right.
Post by Marco van de Voort
Yes, all FPC devels got a copy, but it is more an collection of essays
interesting for people broading their scope of the project than a tutorial
for the uninitiated.
Thanks. The ’bundle offer’ contains: Learn to Program Using Lazarus by
2012 Howard Page-Clark. That’s better?

Another option which I’ve found is
http://www.amazon.co.uk/dp/1507632525/ref=rdr_ext_tmb#reader_1507632525
but it seems it is more into web stuff, while I still prefer to write
desktop app.
Post by Marco van de Voort
I would go to your nearest 2nd hand book store, and buy Delphi books,
specially from Marco Cantu's mastering.. series of older versions. (those
still have large sections on the language)
His free ebooks (essential pascal and essential delphi) are also good starts.
The very best is the language guide from D6/D7 period, so if your employer
owns/owned Delphi, it might be worth checking their library.
Thank you. Will researach what I can found…


Sincerely,
Gour
--
The senses are so strong and impetuous, O Arjuna,
that they forcibly carry away the mind even of a man
of discrimination who is endeavoring to control them.
trijezdci
2015-08-12 11:47:22 UTC
Permalink
Post by Marco van de Voort
I didn't really care much about what R10 added, either dotting some
detail i's and a lot of objc borrow work. I'm not an Apple-ian, so not that
excited about that either.
I can assure you that there is absolutely no borrowing from Objective-C nor any Apple technologies in Modula-2 R10, none whatsoever.

In fact one might debate whether it is even an object oriented language. If you consider Oberon to be OOP, then you may also consider M2 R10 to be OOP because we replaced variant record types with Oberon style extensible record types. But if you do not subscribe to Oberon's minimalist OOP definition, then you may not consider M2 R10 to be OOP either.

Perhaps you were confusing M2 R10 with an earlier publication for an OOP extension to Modula-2 called Objective Modula-2. That extension can be implemented on top of any Modula-2 dialect as a superset. In the M2 R10 specification we declared a number of reserved words of some Modula-2 supersets as taboo so as to guarantee there will be no name conflicts between M2 R10 and these supersets. Objective Modula-2 is one of those supersets. Other than that there is no connection.

The major differences between PIM and R10 are revised literals, a UNICHAR type, more explicit syntax; strict name equivalence; all unsafe features either removed or provided by pseudo module UNSAFE, formerly SYSTEM, a concept introduced in PIM but not consequently realised; variant records replaced by extensible records; FOR BY TO loop replaced by FOR IN loop; stricter and more fine grained control of mutability and immutability; ability to use built in syntax with user defined abstract data types; blueprints; a set of language defined pragmas; removal of local modules.

hope this clarifies
benjamin
trijezdci
2015-08-12 12:05:01 UTC
Permalink
Post by trijezdci
The major differences between PIM and R10 are revised literals, a UNICHAR type, more explicit syntax; strict name equivalence; all unsafe features either removed or provided by pseudo module UNSAFE, formerly SYSTEM, a concept introduced in PIM but not consequently realised; variant records replaced by extensible records; FOR BY TO loop replaced by FOR IN loop; stricter and more fine grained control of mutability and immutability; ability to use built in syntax with user defined abstract data types; blueprints; a set of language defined pragmas; removal of local modules.
Oh and I forgot to mention one more important difference: revised coroutines.

Coroutines in PIM resembled how coroutines were done in assembly in the 1950s. No possibility to pass in any data when first activating a coroutine and no possibility for coroutines to pass non-local data to each other. Initialisation and data sharing had to be done by hardcoding references to global variables. This is no longer acceptable in this day and age. It was already outdated when PIM was published.

We based our coroutine design on the findings presented in the paper "Revisiting Coroutines" by De Moura and Ierusalimschy of the University of Rio de Janeiro, also of Lua fame. The paper is at:

http://www.inf.puc-rio.br/~roberto/docs/MCC15-04.pdf

Our revised design can be seen in the coroutine pseudo module at our repo:

https://bitbucket.org/trijezdci/m2r10/src/tip/_PSEUDO_MODULES/COROUTINE.def
trijezdci
2015-08-12 12:21:23 UTC
Permalink
of course this should have been "non-global data", thus local variables and passed in parameters. Apologies.
Martin Brown
2015-08-03 08:56:38 UTC
Permalink
Post by Gour
Post by Marco van de Voort
If it is build into gm2, I assume you can reuse whatever possibilities gm2
has?
Hmm, I do not expect compiler to have support for GUI bindings?
It might be worth your while taking a look at the XDS compiler. Now
freeware and unsupported but it does have some GUI library bindings for
Windows and legacy ones for JPI/Topspeed (with some caveats).

My suggestion is to write a tool to rewrite C headers and code into as
close as you can manage nearly valid M2 then tweak to get conformance. I
think there is something like that included with XDS or its toolset.
Post by Gour
Post by Marco van de Voort
Since after adding to the compiler it will also take time to develop new
libraries that use R10's possibilities, I guess the abilities will be about
the same as gm2 now. That should be easily evaluated.
Well, I believe that GUI bindings simply do not have anything related to
GM2 compiler itself and are expected to be 3rd party project…
It can be very hard to do nice GUI bindings in a strongly typed
language. I still have the scars from doing it for OS/2 way back when.

Problem is that a lot of C code involves pointers to a "random object of
unknown length" that the recipient decodes based on data in the early
part of the structure. Getting everything aligned i a structure just
right for every possible case in Modula 2 is painful and tedious.

Sadly I think M2 has had its day.
--
Regards,
Martin Brown
Gour
2015-08-03 09:50:32 UTC
Permalink
Post by Martin Brown
Sadly I think M2 has had its day.
Thank you…well, I wish all success to M2 R10, but it seems if I want to use
something *today*, FPC is better option.


Sincerely,
Gour
--
Not by merely abstaining from work can one achieve freedom
from reaction, nor by renunciation alone can one attain perfection.
Pascal J. Bourguignon
2015-08-03 10:45:20 UTC
Permalink
Post by Martin Brown
It can be very hard to do nice GUI bindings in a strongly typed
language. I still have the scars from doing it for OS/2 way back when.
Problem is that a lot of C code involves pointers to a "random object
of unknown length" that the recipient decodes based on data in the
early part of the structure. Getting everything aligned i a structure
just right for every possible case in Modula 2 is painful and tedious.
Sadly I think M2 has had its day.
It's not exactly "random object of unknown length".
It's objects. As in OOP.

That said, if they are C++ objects, you have a two problems.

On the other hand, if they are Objective-C objects, then it would be
easier to design a clean Modula-2 API, because the Objective-C runtime
is defined thru normal C functions (and, granted, a few C macros, but
nothing evil). You can treat all the Objective-C objects as opaque
pointers (type id in Objective-C). Creating a window would be something
like (after the right imports):

id myWindow:=objc_send(objc_send(objc_class("NSWindow"),selector("alloc"))
selector("initWithContentRect:styleMask:backing:defer:"),
NSMakeRect(100,100,400,300),
(NSTitledWindowMask+NSClosableWindowMask+NSMiniaturizableWindowMask+NSResizableWindowMask),
NSBackingStoreBuffered,
nil);
id dummy;
dummy:=objc_send(myWindow,selector("setTitle:"),objcString("Hello World"));
dummy:=objc_send(myWindow,selector("makeKeyAndOrderFront:"),nil);

which is not too far from the Objective-C source.

id myWindow=[[NSWindow alloc]
initWithContentRect:NSMakeRect(100,100,400,300)
styleMask:(NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask)
backing:NSBackingStoreBuffered
defer:nil];
[myWindow setTitle:@"Hello World"];
[myWindow makeKeyAndOrderFront:nil];

It would also be quite easy to write a pre-processor to perform the same
transform as Objective-C pre-processors do on C sources (while nowadays,
compilers implement a native Objective-C parser, it is still
semantically possible to do it with a preprocessor).


But of course, one might prefer to use a GUI written in Modula-2
implemented using the native GUI as backend.

The point is that contrarily to other object systems, the object system
of Objective-C is easily accessible from any language that has a C FFI.


So you could use GNUstep as a GUI for Modula-2 programs (and of course,
Cocoa on MacOSX).

Cf. also http://c2.com/cgi/wiki?ObjectiveModulaTwo
--
__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
Marco van de Voort
2015-08-03 12:20:38 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Martin Brown
It can be very hard to do nice GUI bindings in a strongly typed
language. I still have the scars from doing it for OS/2 way back when.
Problem is that a lot of C code involves pointers to a "random object
of unknown length" that the recipient decodes based on data in the
early part of the structure. Getting everything aligned i a structure
just right for every possible case in Modula 2 is painful and tedious.
Sadly I think M2 has had its day.
It's not exactly "random object of unknown length".
It's objects. As in OOP.
That said, if they are C++ objects, you have a two problems.
[..]
Post by Pascal J. Bourguignon
So you could use GNUstep as a GUI for Modula-2 programs (and of course,
Cocoa on MacOSX).
Ten points for turning a discussion about windows api into a gnustep/Mac OS X
one, Steve Jobs would be proud :-)
Post by Pascal J. Bourguignon
Cf. also http://c2.com/cgi/wiki?ObjectiveModulaTwo
Nothing to download there, the only other link is dead (godaddy)
Pascal J. Bourguignon
2015-08-03 13:55:04 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Post by Martin Brown
It can be very hard to do nice GUI bindings in a strongly typed
language. I still have the scars from doing it for OS/2 way back when.
Problem is that a lot of C code involves pointers to a "random object
of unknown length" that the recipient decodes based on data in the
early part of the structure. Getting everything aligned i a structure
just right for every possible case in Modula 2 is painful and tedious.
Sadly I think M2 has had its day.
It's not exactly "random object of unknown length".
It's objects. As in OOP.
That said, if they are C++ objects, you have a two problems.
[..]
Post by Pascal J. Bourguignon
So you could use GNUstep as a GUI for Modula-2 programs (and of course,
Cocoa on MacOSX).
Ten points for turning a discussion about windows api into a gnustep/Mac OS X
one, Steve Jobs would be proud :-)
Nothing of the sort, there's Cocotron and GNUstep runs on MS-Windows
too. http://wiki.gnustep.org/index.php/GNUstep_on_MS_Windows
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Cf. also http://c2.com/cgi/wiki?ObjectiveModulaTwo
Nothing to download there, the only other link is dead (godaddy)
Dang!
--
__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
m***@gmail.com
2015-08-04 09:25:17 UTC
Permalink
I am one of the programmers who has used Modula-2 for giant commercial products. I built a clone of the OS 9 (also called Carbon) graphics system of the macintosh into a platform neutral layer, and have immense amounts of code that supports both Win32 (which still works perfectly well, thanks MS), and a Carbon OS9 era macintosh code base (which still runs thanks to Apple using carbon for iTunes!, so they still support carbon). However it is not a Cocoa interface nor does it support all the latest stuff in OSX. But as far as drawing ovals, rounded rectangles, lines, bitmaps, text, managing fonts, etc. it all works fine. I could donate much of this to open source, but it assumed 1) you used the p1 compiler on the mac, and 2) assumed the Stony Brook compiler on Windows. I wrote a conversion tool that converted Macintosh p1 syntax to stonybrook. There were slight differences in the preprocessor, with regards to how you do conditional compilation, and which flags had to be present to work on each platform. I wrote probably 200k lines of Modula-2 and dozens of projects that were fairly successful (and I still sell as the Discus labeling software one of the finest labelers to have ever been created.

Modula-2 was a tremendous platform for large projects, and although Wirth's simple system was never accepted by either Academia or the business world, that doesn't mean it wasn't great. There is no simpler language and it was amazing to turn off the runtime checks for the final shipment, and see the 30% drop in code size... that meant you had checks every 3rd line, for subscript ranges, overflows, null pointers, all the nasty things that C bites you in the ass on, and Modula-2 protected you.

In some ways python has a similar simplicity, and the interpreted nature of python makes modula-2 seem old fashioned. but it actually produced smaller code than C programs due to the higher level of code sharing achievable due to the clever module system, and most importantly it compiled 10 times faster than C because the headers (DEF files) compiled into SYM files, and if you didn't change a DEF file, then dependent modules didn't need to be recompiled. A simple C program that says hello world can require 500k lines of headers to be compiled! They are now, after decades, finally realizing they need a standard form for compiled definitions.. Modula-2 even though it is old is still ahead of many languages. And don't get me started on the horrors of object oriented programming and Java!

If you are starting today, and need graphical interaction, you can consider using Lua under the Corona environment, and Python with a graphic library, or Actionscript under Adobe AIR, which i am a big fan of because it delivers the mobile platforms, and makes a great deal of progress towards simplifying the GPU access, which is a weak spot on many platforms.

My particular product (discus) involved serious amounts of assembler code (almost 1%) on the windows platform to provide the missing masking operations that MS doesn't have in Win32. MS later added what they called GDI+ to provide some of this missing functionality, but they insisted on using their funky object oriented C++ interfaces which are not easy to connect to Modula-2. Later on they scrapped their original graphics environment, and replaced it with something so bizarre and complex, that the entire world more or less rejected it. The Apple graphical model is certainly very powerful, but frankly the iOS model was much simpler and that is one of the reason why so many Apps have been created, because the graphical model is very straightforward on iOS. the Quartz model on OSX is pretty nasty, but way simpler than MS Foundation system, which uses a display postscript model where you write XML code out and then it is interpreted. Boy was that a dumb idea. Anyway, the landscape today is dominated by HTML/CSS/Javascript on one hand, several completely incompatible camps like Android, IOS/OSX and Windows, or one of a few neutral zones where cross-platform work can be done. There are a bunch of cross platform tools, and i have seen good results from all of them, and certainly i wouldn't expect anyone to suffer like we did. When you want to rotate a 32 bit bitmap, scale it at the same time, and examine its pixels and tint it slightly you can get into some very tricky code on each platform.
Gour
2015-08-04 16:47:59 UTC
Permalink
Post by m***@gmail.com
I am one of the programmers who has used Modula-2 for giant commercial
products.
Do you still use Modula-2?
Post by m***@gmail.com
Modula-2 was a tremendous platform for large projects, and although
Wirth's simple system was never accepted by either Academia or the
business world, that doesn't mean it wasn't great.
I agree with you…it is great language.
Post by m***@gmail.com
There is no simpler language and it was amazing to turn off the
runtime checks for the final shipment, and see the 30% drop in code
size... that meant you had checks every 3rd line, for subscript
ranges, overflows, null pointers, all the nasty things that C bites
you in the ass on, and Modula-2 protected you.
Do you follow development of R10?
Post by m***@gmail.com
Modula-2 even though it is old is still ahead of many languages. And
don't get me started on the horrors of object oriented programming and
Java!
Heh, {C, C++, Java} are on the top of my ’excluded’ set of languages
which I do not want to even consider to use.
Post by m***@gmail.com
If you are starting today, and need graphical interaction, you can
consider using Lua under the Corona environment, and Python with a
graphic library, or Actionscript under Adobe AIR, which i am a big fan
of because it delivers the mobile platforms, and makes a great deal of
progress towards simplifying the GPU access, which is a weak spot on
many platforms.
Hmm…I’d prefer standard desktop app and e.g. Adobe AIR is not available
for the Linux, iirc.

Anyway, thank you you very much for your elaborate input!

Otoh, it’s sad that Modula-2 community is not bigger and/or more active
these days…


Sincerely,
Gour
--
A person is said to be elevated in yoga when, having renounced
all material desires, he neither acts for sense gratification
nor engages in fruitive activities.
Singh Du
2015-08-04 17:15:31 UTC
Permalink
Heh, {C, C++, Java} are on the top of my ???excluded??? set of languages
which I do not want to even consider to use.
I thought it was just me. But that kind of makes it much harder for us to
get anything done on the current sad crop of what passes for an OS.
Gour
2015-08-04 17:57:35 UTC
Permalink
Post by Singh Du
I thought it was just me. But that kind of makes it much harder for us to
get anything done on the current sad crop of what passes for an OS.
Well, for OS there is not much choice, but, at least for my own
development, although I do use no Java apps.


Sincerely,
Gour
--
Even if you are considered to be the most sinful of all sinners,
when you are situated in the boat of transcendental knowledge
you will be able to cross over the ocean of miseries.
m***@gmail.com
2015-08-05 08:07:40 UTC
Permalink
Unfortunately as desktop operating system linux is pretty dead. Android has completely taken over. If you did a market share comparison of all linux variants, Android must be over 95%. There is just no way the fragmented linux variants could continue to be viable, it was inevitable that someone would take linux, graft on a 2d/3d high frame-rate GPU enabled graphics pipeline on top of it, create an app store with millions of applications which run beautifully. That entity was Google, and they basically took over linux and rebranded it Android. Linux desktop is completely pointless, which is why my recommendation for Adobe AIR stands, because it is one of the few frameworks that gives you GPU access on both Android and IOS which together constitute most of the computers on the planet. Do you realize that something like 500 million smartphones were sold last quarter alone? And that more iPads exist than desktop macintosh computers? Linux desktop at this point is like sticking with the Amiga, or lovingly referring to your TRS-80. An antique.

for building quick tools, many people reach for Python/Perl. Modula-2 and all languages without an easy binding to the stupid object oriented API sets that abound today, are greatly hampered. This is why FORTRAN, COBOL, C, and so many other traditional languages have suffered, they don't bind that well to the API's that exist today, making it extremely difficult to build graphical interactive software. Frankly FORTRAN has improved to such a degree, it is a terrific language now, with fantastic libraries that make scientific programming easy, but the minute you try to program Pac-Man in FORTRAN all those wonderful libraries to compute Bessel functions and eigenvectors suddenly don't seem as useful.

This is the reason javascript/html/css is such a winner now; you get a huge reach with a browser based program, zero installation, etc, so even though Modula-2, Oberon, and 100 other languages are wonderful tools, because they can't access the drawing and event system easily, those languages regardless of their merits are put aside. Modula-2 suffered because the academics rejected its simplicity, and preferred Java, which was a tragic mistake. Java is a huge mess of a language, inferior in every aspect to Modula-2 from any practical ease-of-programming, ease-of-maintenance aspect.

So i continue to maintain my modula-2 products, i can't do any more development in the language. I haven't followed the R10 project. The stony brook compiler i believe was released to open source, that baby was incredible, one of the greatest compilers ever written. From R. Gogesch and Norman Black, it compiles hundreds of thousands of lines per minute. A real screamer, and it came with its own linker, because they didn't like the MS linker! when you write your own linker you know your stuff! not 100 people alive today know how the Windows linker works, and it did an amazing job.
Gour
2015-08-05 08:24:26 UTC
Permalink
Post by m***@gmail.com
Unfortunately as desktop operating system linux is pretty
dead. Android has completely taken over. If you did a market share
comparison of all linux variants, Android must be over 95%.
Well, as long as I can use it and serve *my needs*, I simply do not care
about market share. Before starting with Linux in ’99 I was OS2 user
which was also not big in market share, but I simply didn’t care.
Post by m***@gmail.com
Do you realize that something like 500 million smartphones were sold
last quarter alone? And that more iPads exist than desktop macintosh
computers?
If my living would depend on writing stupid apps for those ’smart’
phones, I’d probably care, but from the engineering point of view the
whole hype with those smartphones and similar gadgets and uttely
dependance on them is just another proof how mass of people are made
into folish sheeps buying quad-core-cpu-powered devices to browse the
web and/or send trillions of stupid messages.
Post by m***@gmail.com
This is the reason javascript/html/css is such a winner now; you get a
huge reach with a browser based program, zero installation, etc, so
even though Modula-2, Oberon, and 100 other languages are wonderful
tools, because they can't access the drawing and event system easily,
those languages regardless of their merits are put aside.
I pray that js/html/css hype die asap. :-)
Post by m***@gmail.com
Modula-2 suffered because the academics rejected its simplicity, and
preferred Java, which was a tragic mistake.
Well, not the only one… :-(
Post by m***@gmail.com
I haven't followed the R10 project. The stony brook compiler i believe
was released to open source, that baby was incredible, one of the
greatest compilers ever written.
Who knows, but maybe some more people will come to their senses and do
some revival..

Nevertheless, thank you for the input. ;)


Sincerely,
Gour
--
As a strong wind sweeps away a boat on the water,
even one of the roaming senses on which the mind
focuses can carry away a man's intelligence.
j***@gmail.com
2015-08-05 08:31:43 UTC
Permalink
Post by m***@gmail.com
Unfortunately as desktop operating system linux is pretty dead. Android has completely taken over. If you did a market share comparison of all linux variants,
The moment Debian was launched (around 1995), Linux died. Fragmentation of development instead of unified development. Five years later every mediocre programmer wanted to create his own distro.... and the momentum was gone. Unified development turned into disputes about personal preferences and the distro wars did the rest.

Of course american Google stepped in and hijacked the free and open source european project to create a first class commercial product, which big revenues but marketed as open source...

When Wirth and Gutknecht presented Oberon OS it was meant to be an OS that any ONE person could master and maintain. But even Oberon OS was so big that only few people on the planet could understand and maintain.
Pascal J. Bourguignon
2015-08-05 16:10:30 UTC
Permalink
Post by j***@gmail.com
Post by m***@gmail.com
Unfortunately as desktop operating system linux is pretty
dead. Android has completely taken over. If you did a market share
comparison of all linux variants,
The moment Debian was launched (around 1995), Linux
died. Fragmentation of development instead of unified
development. Five years later every mediocre programmer wanted to
create his own distro.... and the momentum was gone. Unified
development turned into disputes about personal preferences and the
distro wars did the rest.
The situation is still better than before, with the multiplicity of
different unices.

At least, while you have a choice of frameworks (plain X, motif,
GNUstep, Gtk, KDE, GNOME, etc), you can still write applications using
them (or not) that will run on "all" the GNU/linux systems around.

Perhaps it won't be as well integrated than a MacOSX application, but
users get quite a nice freedom along to compensate.
Post by j***@gmail.com
When Wirth and Gutknecht presented Oberon OS it was meant to be an OS
that any ONE person could master and maintain. But even Oberon OS was
so big that only few people on the planet could understand and
maintain.
Indeed, there's no reason why we shouldn't have our software needs
fulfilled by much smaller and much more understandable programs.
Imagine that the sources of Android are more than 3 times bigger than
the human genome! (11 GB vs. 3 GB).

Alan Kay "Programming and Scaling" 2011
http://www.tele-task.de/archive/video/flash/14029/




https://vimeo.com/82301919
--
__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
Singh Du
2015-08-05 11:52:35 UTC
Permalink
Post by m***@gmail.com
Unfortunately as desktop operating system linux is pretty dead.
You sound very confused. Linux although just as bad as virtually anything
else that can pass for a desktop "OS" is more alive than ever.
Post by m***@gmail.com
Android has completely taken over.
On phones. So what?
Post by m***@gmail.com
for building quick tools, many people reach for Python/Perl. Modula-2 and
all languages without an easy binding to the stupid object oriented API
sets that abound today, are greatly hampered.
Incomprehensible drivel. Machine-generated, perhaps?
Post by m***@gmail.com
This is why FORTRAN, COBOL, C, and so many other traditional languages
have suffered, they don't bind that well to the API's that exist today,
Uhm, again, no. First of all there is a very big problem putting C in that
list. C is part of the cause of the problem. The other languages are still
fine where they were designed to run. C was never designed to run
anywhere. It just happened. And now it runs badly everywhere. I would bet
money if you look over 1,000 security exploits and vulnerabilities C's total
lack of safety and design is directly responsible for 999 of them.
Post by m***@gmail.com
making it extremely difficult to build graphical interactive
software. Frankly FORTRAN has improved to such a degree, it is a terrific
language now, with fantastic libraries that make scientific programming
easy, but the minute you try to program Pac-Man in FORTRAN all those
wonderful libraries to compute Bessel functions and eigenvectors suddenly
don't seem as useful.
If you think programming is all about GUI then a) you're not a real
programmer and b) you would be better off with a TRS-80 or Atari.
NASA still runs on FORTRAN and some Fortran. All the financial industry
still runs 99% COBOL. What hasn't ever caught up is toy computers and broken
non-languages like C. A text interface is fine for 99% of all applications.
Microslob has duped every idiot into thinking he has to have graphical
malware with a EULA to do anything but it's actually quite wrong. It does
allow them to sell 100 apps based on the same internals with a different UI
but there is really not much value in any of that.
Post by m***@gmail.com
This is the reason javascript/html/css is such a winner now; you get a
huge reach with a browser based program, zero installation, etc, so even
though Modula-2, Oberon, and 100 other languages are wonderful tools,
because they can't access the drawing and event system easily, those
languages regardless of their merits are put aside.
Yeah but some of us really don't care about that. We write real software
with a text interface just like we've been doing for the last 50 years.

Singh
Gour
2015-08-05 12:38:03 UTC
Permalink
Post by Singh Du
Yeah but some of us really don't care about that. We write real software
with a text interface just like we've been doing for the last 50 years.
There are ncurses bindings available for Modula-2?


Sincerely,
Gour
--
One who sees inaction in action, and action in inaction,
is intelligent among men, and he is in the transcendental position,
although engaged in all sorts of activities.
j***@gmail.com
2015-08-05 13:25:42 UTC
Permalink
Post by Gour
There are ncurses bindings available for Modula-2?
That would be very easy to make. Just make a DEFINITION MODULE and a corresponding IMPLEMENTATION or FOREIGN module and you're done. Here's an example: http://fruttenboel.verhoeven272.nl/mocka/screen.html OK, not ncurses but you get the idea.

It's not rocket science. Anyone can do it. As long as you START OUT with a set of limitations and then program around these. If you want the world included in your library you soon will find out that 'the world is not eanuff' and you will end up with a beast like ncurses.h/c and then it IS rocket science.

But why limit yourself to ncurses while you can use the full x11? My x11 MODULE will enable you to draw lines and print text in ways that cannot even be imagined in ncurses. Have you looked at http://fruttenboel.verhoeven272.nl/mocka/simplex11.html ? You may have to juggle with the NextEvent function to get things on screen.
Marco van de Voort
2015-08-05 13:32:15 UTC
Permalink
Post by j***@gmail.com
But why limit yourself to ncurses while you can use the full x11? My x11
MODULE will enable you to draw lines and print text in ways that cannot
even be imagined in ncurses. Have you looked at
http://fruttenboel.verhoeven272.nl/mocka/simplex11.html ? You may have to
juggle with the NextEvent function to get things on screen.
Are you working on Wayland support (X11's sucessor?)
Singh Du
2015-08-05 15:07:23 UTC
Permalink
Post by Gour
Post by Singh Du
Yeah but some of us really don't care about that. We write real software
with a text interface just like we've been doing for the last 50 years.
There are ncurses bindings available for Modula-2?
I have no idea but there is a really nice one for Ada. I don't work in
Modula-2 and Ada is only a hobby for me. The point is properly designed text
interfaces are optimal for many things and very good for many others. The
GUIfication of computing is just another aspect of dumbing things down,
requiring more and more resources to run, more bloatware and layer and
layers of garbage services to write and execute. It's more burden than it's
worth.

Reading over the posts again I was probably too hard on magicmouse but he
seems to have trouble deciding whether to play the devil's advocate or
actually being one.

Singh
Pascal J. Bourguignon
2015-08-05 16:17:42 UTC
Permalink
Post by Gour
Post by Singh Du
Yeah but some of us really don't care about that. We write real software
with a text interface just like we've been doing for the last 50 years.
There are ncurses bindings available for Modula-2?
However there's an argument to be made, to rewrite curses in Modula-2.

First, ncurses brings along a lot of baggage and design decisions, meant
to support any and all the terminals every built, most of them not even
available anymore, or to be found only in museums. It's quite a feat to
have maintained the termcap database, and them upgraded it to terminfo,
but everybody use only xterm, linux, screen (mostly all kinds of vt100
or ANSI (ECMA-048 aka ISO/IEC 6429) and perhaps a few other virtual
terminals and that's it.

So you could redesign a similar package that would work on all current
standard virtual terminals getting a smaller library with much fewer
bugs. And you could also provide a "graphic" backend for textual
application interfaces, (like emacs is able to work both on a terminal
and in GUI windows, providing basically the same textual input and
output on both).
--
__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
Gour
2015-08-05 16:35:00 UTC
Permalink
Post by Pascal J. Bourguignon
So you could redesign a similar package that would work on all current
standard virtual terminals getting a smaller library with much fewer
bugs.
Something like this: https://github.com/nsf/termbox ?


Sincerely,
Gour
--
One must deliver himself with the help of his mind, and not
degrade himself. The mind is the friend of the conditioned soul,
and his enemy as well.
j***@gmail.com
2015-08-05 18:05:20 UTC
Permalink
Post by Gour
Something like this: https://github.com/nsf/termbox ?
No just make the definition module and next create the implementation module. You only need to InOut.WriteString a lot of escape sequences. No big deal.
j***@gmail.com
2015-08-05 18:56:07 UTC
Permalink
Even an ncurses module would be total overkill. Just try 'man ncurses' and shiver. 940 lines of documentation on a 120 char screen. I would focus on ANSI codes and extend my ANSI.MOD/DEF libraries. All terminals understand ANSI. And if your vterm doesn't, choose another vterm.
Pascal J. Bourguignon
2015-08-05 20:28:56 UTC
Permalink
Post by j***@gmail.com
Even an ncurses module would be total overkill. Just try 'man ncurses'
and shiver. 940 lines of documentation on a 120 char screen. I would
focus on ANSI codes and extend my ANSI.MOD/DEF libraries. All
terminals understand ANSI. And if your vterm doesn't, choose another
vterm.
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
Pascal J. Bourguignon
2015-08-05 15:45:37 UTC
Permalink
Post by m***@gmail.com
Unfortunately as desktop operating system linux is pretty
dead. Android has completely taken over. If you did a market share
comparison of all linux variants, Android must be over 95%. There is
just no way the fragmented linux variants could continue to be viable,
it was inevitable that someone would take linux, graft on a 2d/3d high
frame-rate GPU enabled graphics pipeline on top of it, create an app
store with millions of applications which run beautifully. That entity
was Google, and they basically took over linux and rebranded it
Android.
That's eery how you are precisely right and completely wrong at the same
time :-)

You're right, Android has probably the most users, of all the linux
kernels deployed in the world.

You're wrong, linux is not an operating system, it's a kernel, and what
you would call the linux operating system is actually the GNU operating
system.

It is precisely very telling, how few GNU software is distributed with
Android systems (none to my knowledge, given that GNU software is
generally distributed under the GPL, and given the user freedom
restrictions the Android system imposes onto users (they have to hack
their hand computers to gain (root) access to it!)).

http://www.gnu.org/philosophy/android-and-users-freedom.en.html

Considering it from the point of view of Modula-2, the Android system is
not even really a system running on linux, since to really run an
application on Android, you need to compile it to the dalvik VM.

Do you have a Modula-2 compiler able to generate dalvik code?
Until you write one, you are bared from Android development (again, a
privation of freedom, one would say).

All you can do is, indeed, to target the native hardware and the device
driver wrapper called the linux kernel. But while this will give a
program running on your hand computer, this doesn't give an Android
application.

Compare this with the situation on a GNU system, where you can write in
Modula-2 or any other programming language, all kind of programs and
full desktop applications.
Post by m***@gmail.com
Linux desktop is completely pointless, which is why my
recommendation for Adobe AIR stands, because it is one of the few
frameworks that gives you GPU access on both Android and IOS which
together constitute most of the computers on the planet. Do you
realize that something like 500 million smartphones were sold last
quarter alone? And that more iPads exist than desktop macintosh
computers? Linux desktop at this point is like sticking with the
Amiga, or lovingly referring to your TRS-80. An antique.
Apple definitely doesn't think like you.
Google, it's more dubious, and Microsoft I don't really know anything
about it.

But you definitely need a desktop or laptop computer to write iOS
applications. While there are IDEs to develop Android applications on
Android, they're not Google projects, and it's much easier to do so on a
desktop or laptop computer with more complete IDEs provided and
supported by Google. And I would guess that Microsoft provides
similarly good development environment only on its desktop/laptop OSes
for its handheld computer OSes (even if they're called the same, just
guess, sorry I don't know anything about Microsoft, one cannot know
everything).


Perhaps you have a view too restrictive considering user interfaces and
form factors. After all, the linux kernel runs on every computer, from
embedded devices to supercomputers, passing thru handheld, laptop and
desktop computers. You can write programs that can run everywhere. The
difference is the user interface. Some programs have none, some use a
"terminal", some some graphic output with various input devices, and you
can indeed choose amongst a number of frameworks to manage those various
user interface modes.

Write a good oral user interface (both input and output), and you will
displace Google and Apple and their lamentable attempts at it, and
foremost, distract users from their screens and free their fingers! (But
probably a little AI will be required to make it).

But the point, is that for some usages, the desktop form factor,
ie. physical user interface, ie. large screen and physical keyboard, is
the best (most productive, efficient, flowing) user interface there is.
And therefore there is definitely a place for GNU/Linux desktop
applications. Also it's on the desktop you can hook a variety of other
user interface devices. While a few of them are integrated into
handheld computers (eye trackers, 3d finger detection), you can more
easily hook and use new devices on desktops; after all you usually only
have two hands, and your backpack is already full.

You cannot say that the cooking batterie is a pointless antique, and
that all you need is a microwave to reheat your industrial frozen pizza
or a mixer to prepare your Soylent. The cooking batterie is an
important and featureful tool for the professional cook. Of course, the
microwave oven is much more popular, found in every house and office.
Nonetheless if you want to cook a real edible meal, a profesionnal cook
will prefer to work at a cooking batterie (even if, gun on the head, you
could make him something not too bad with a mixer and microwave).


Therefore the desktop/laptop computers will remain (at least until we
get eye-projected display and either a good mind reading device or a
brain connection that would allow you to believe you're typing on a real
physical keyboard when you're actually not moving at all (or perhaps
have just switched over the control of your body to your body trainer).

But until you can think of your programs and see them translated and
projected on your eyes, the desktop/laptop physical user interface
remains the best. (And I say, "programs", but any creative or design
work have similar requirements.
Post by m***@gmail.com
for building quick tools, many people reach for Python/Perl. Modula-2
and all languages without an easy binding to the stupid object
oriented API sets that abound today, are greatly hampered. This is why
FORTRAN, COBOL, C, and so many other traditional languages have
suffered, they don't bind that well to the API's that exist today,
making it extremely difficult to build graphical interactive
software. Frankly FORTRAN has improved to such a degree, it is a
terrific language now, with fantastic libraries that make scientific
programming easy, but the minute you try to program Pac-Man in FORTRAN
all those wonderful libraries to compute Bessel functions and
eigenvectors suddenly don't seem as useful.
This is not an intrinsic feature of those language, it's just that the
people who developped those framework and who implement those API cared
only for those few new languages, and didn't do the work to support any
other language. And in the case of things like iOS and Android, it is
done on purpose, so that the capitalist companies developping those
frameworks can control more easily the applications developped in them,
and extract enormous profits from it (30% on the Apple AppStore, how
much on the Google AppStore? Plus the advertising and other malware
introduced by the iOS and Android systems into your apps?).

But it is (still) possible to write a compiler backend to generate code
for those walled gardens, and to write API generators so that you may
easily program using those frameworks.
Post by m***@gmail.com
This is the reason javascript/html/css is such a winner now; you get a
huge reach with a browser based program, zero installation, etc, so
even though Modula-2, Oberon, and 100 other languages are wonderful
tools, because they can't access the drawing and event system easily,
those languages regardless of their merits are put aside.
On the browser side, it also always has been possible to write a
Modula-2 compiler backend to generate javascript, then asm.js, and now
WebAssembly, so ultimately even no performance difference would be
noticeable.

A majority of people discovered computing first with the web, so it's
natural that they would be introduced to programming by the BASIC of the
web, javascript. (Notice how iOS and Android do not contain a "BASIC",
an embedded programming language for the people).

It is obviously not impossible for an individual to push a programming
language toward popularity as python and clojure are witnesses.

You are identifying problems with the Modula-2 ecosystem regarding
popularity, so you already have done half of the work. Now implement
compiler backend and API generators to make it easy to use Modula-2 on
some popular platforms, and they shall come.
Post by m***@gmail.com
Modula-2 suffered because the academics rejected its simplicity, and
preferred Java, which was a tragic mistake. Java is a huge mess of a
language, inferior in every aspect to Modula-2 from any practical
ease-of-programming, ease-of-maintenance aspect.
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
https://github.com/Keith-S-Thompson/fizzbuzz-polyglot/blob/master/fizzbuzz.mod
http://paste.lisp.org/display/149906

I'll say no more.
Post by m***@gmail.com
So i continue to maintain my modula-2 products, i can't do any more
development in the language. I haven't followed the R10 project. The
stony brook compiler i believe was released to open source, that baby
was incredible, one of the greatest compilers ever written. From
R. Gogesch and Norman Black, it compiles hundreds of thousands of
lines per minute. A real screamer, and it came with its own linker,
because they didn't like the MS linker! when you write your own linker
you know your stuff! not 100 people alive today know how the Windows
linker works, and it did an amazing job.
Come on! It would be really nice and funny to write a Modula-2 compiler
backend of dalvik! If you've already written a compiler, it shouldn't
take more than a few week ends (or a summer vacation) to generate at
least executable code (speed optimization can came later).

And you can use Retrospection
http://code.tutsplus.com/tutorials/learn-java-for-android-development-reflection-basics--mobile-3203
to generate the API automatically, with a Modula-2 program! (You only
have to hand-write the Retrospection API module first).
Again a nice and fun project, that shouldn't take more than a few week
ends.
--
__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
Marco van de Voort
2015-08-06 08:22:23 UTC
Permalink
Post by Pascal J. Bourguignon
You're wrong, linux is not an operating system, it's a kernel, and what
you would call the linux operating system is actually the GNU operating
system.
1. No, that is HURD, since an operating system is userland + kernel, and Linux
is not GNU.

2. No, some popular linux distros do, but not all. There have been
experiments with BSD userland on Linux kernels etc, same for many
router/embedded versions etc. So the userland is not always GNU

3. More importantly Android isn't, since they don't use e.g. the base building
block glibc.

And even then I always thought that GNU spin belittled other contributors,
like e.g. BSD and X11, equally annoying to their silly little claim to the
English word "free".
Pascal J. Bourguignon
2015-08-06 08:49:52 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
You're wrong, linux is not an operating system, it's a kernel, and what
you would call the linux operating system is actually the GNU operating
system.
1. No, that is HURD, since an operating system is userland + kernel, and Linux
is not GNU.
2. No, some popular linux distros do, but not all. There have been
experiments with BSD userland on Linux kernels etc, same for many
router/embedded versions etc. So the userland is not always GNU
3. More importantly Android isn't, since they don't use e.g. the base building
block glibc.
And even then I always thought that GNU spin belittled other contributors,
like e.g. BSD and X11, equally annoying to their silly little claim to the
English word "free".
Who am I to believe me? But perhaps you'll believe RMS himself!

http://www.gnu.org/gnu/linux-and-gnu.en.html
--
__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
Marco van de Voort
2015-08-06 18:24:08 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Marco van de Voort
3. More importantly Android isn't, since they don't use e.g. the base building
block glibc.
And even then I always thought that GNU spin belittled other contributors,
like e.g. BSD and X11, equally annoying to their silly little claim to the
English word "free".
Who am I to believe me? But perhaps you'll believe RMS himself!
http://www.gnu.org/gnu/linux-and-gnu.en.html
A GNU centric point of view. On the GNU website. Who would have thought :-)
Pascal J. Bourguignon
2015-08-06 19:52:51 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Post by Marco van de Voort
3. More importantly Android isn't, since they don't use e.g. the base building
block glibc.
And even then I always thought that GNU spin belittled other contributors,
like e.g. BSD and X11, equally annoying to their silly little claim to the
English word "free".
Who am I to believe me? But perhaps you'll believe RMS himself!
http://www.gnu.org/gnu/linux-and-gnu.en.html
A GNU centric point of view. On the GNU website. Who would have thought :-)
But seriously, what you call "linux", as in GNU/linux distributions, most of
them do use almost exclusively, GNU software for the base unix system.

You can't be serious saying they use BSD unix code, when anything from
the compiler, make, sed, grep, awk, etc, are from GNU. For example:

$ for f in /bin/* ; do ( ($f --version ; $f --help) 2>/dev/null || true) | grep -q -e 'GNU\|Free Software Foundation'&&echo $f ; done|wc -l
61
ls -1 /bin/* |wc -l
142

reports 42% of /bin being from the FSF or the GNU project on this debian
system, and the remainer are mostly independent projects. Actually, I
hoped some network utilities in /bin to be from BSD, but I can't find
any confirmation of it.

There are obviously some programs coming from linux itself,
some that are still from GNU, but don't report it like all the commands
from hostname, and
some that are independent such as all the commands from bzip.


I've never seen a BSD system using the linux kernel.

Now, I'm not denying that from time to time, some specific BSD program
has been compiled and installed on a GNU/linux system, perhaps even
integrated into a GNU/linux distribution. I'm just saying that from the
origin, linux has used a GNU userspace system, and still does in what we
call "linux" distributions. They're actuallly GNU/linux.

Only Android is known to use a linux kernel without a GNU userspace,
since they mostly use restricted utilities and heavily sandboxed
environment, with Android specific unix tools, below the Android system
implemented in Java.


Can you cite any other distribution or system that use the linux kernel
and doesn't use the GNU system?
--
__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
Marco van de Voort
2015-08-07 07:08:28 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Marco van de Voort
A GNU centric point of view. On the GNU website. Who would have thought :-)
But seriously, what you call "linux", as in GNU/linux distributions, most of
them do use almost exclusively, GNU software for the base unix system.
As said the kernel isn't, X11 isn't, QT isn't. Anything that makes a full
distro isn't.

That GNU found some way around that for propaganda purposes and managed to
convinced Debian to regurgitate that is fine for them.

But the fact remains that a distro as users get their hands on it is for
the bulk of it NON gnu code.
Pascal J. Bourguignon
2015-08-07 07:31:59 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Post by Marco van de Voort
A GNU centric point of view. On the GNU website. Who would have thought :-)
But seriously, what you call "linux", as in GNU/linux distributions, most of
them do use almost exclusively, GNU software for the base unix system.
As said the kernel isn't, X11 isn't, QT isn't. Anything that makes a full
distro isn't.
That GNU found some way around that for propaganda purposes and managed to
convinced Debian to regurgitate that is fine for them.
But the fact remains that a distro as users get their hands on it is for
the bulk of it NON gnu code.
Why would you call it "linux" more than "QT" or "X11" then?

It's meaningless, you can see clearly that both are just components of a
GNU system, just like linux is also a component of an Android system,
and QT and X11 are (optional) components of a MacOSX system, with darwin
being another compound component, made of BSD and Mach. And notice here
how the BSD system under MacOSX doesn't run on a BSD kernel, but a Mach
kernel.


So the systems are GNU, Android, BSD, MacOSX,
and the components are linux, QT, X11, Mach.


(The difference between MacOSX and Android here, is that Android doesn't
use any unix feature, being implemented quasi entirely in Java, while
MacOSX, implemented in Objective-C still relies on BSD and and Mach
(even if it tries hard to provide pure Objective-C APIs for unix
features, so that application developers may target Cocoa without
thinking about BSD and even less about Mach).)
--
__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
Marco van de Voort
2015-08-07 07:49:04 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Marco van de Voort
But the fact remains that a distro as users get their hands on it is for
the bulk of it NON gnu code.
Why would you call it "linux" more than "QT" or "X11" then?
take your pick:

1) That was the original convention, before it was hijacked for propaganda
wordplays.
2) it is the non generic software part that differentiaties it from other
GNU using systems (like BeOS)
Post by Pascal J. Bourguignon
being another compound component, made of BSD and Mach. And notice here
how the BSD system under MacOSX doesn't run on a BSD kernel, but a Mach
kernel.
OS X basically has a BSD subsystem on top of a mach kernel. It is like that
the Linux subsystem on BSD allows to run Linux applications on top of BSD.
Post by Pascal J. Bourguignon
So the systems are GNU, Android, BSD, MacOSX,
and the components are linux, QT, X11, Mach.
BSD is both kernel and userland. In practice the various BSDs are internally
fragmented but the major ones are compatible and similar to a very high
degree. (in some ways more than two different major Linux versions), so for
the sake of argument I treat them as one. Even the OS X userland is very
compatible to FreeBSD.
Post by Pascal J. Bourguignon
(The difference between MacOSX and Android here, is that Android doesn't
use any unix feature, being implemented quasi entirely in Java,
Entirely in Java? So how do those native code apps run then? :-) They would
have no api or libs to point to.

From what I know there is a basic libc called "Bionic".

But yes, one could argue Android's recycling the Linux kernel makes that a
part rather than a defining factor, if it were for the simple fact that the
GNU/Linux rebadge is ten years older than Android.
Pascal J. Bourguignon
2015-08-07 08:17:07 UTC
Permalink
Post by Marco van de Voort
Entirely in Java? So how do those native code apps run then? :-) They would
have no api or libs to point to.
Yes, that's basically the case. The NDK provides some C API to access
the hardware (eg. drawing on the screen), but the Android stuff
(process lifecycle), still has to be written in Java. So what you write
in native code, are libraries, called from the real program that is
written in Java.

And if you just look the first page of the NDK:
https://developer.android.com/ndk/index.html
what you see, is Java code!

public class MyActivity extends Activity {
/**
* Native method implemented in C/C++
*/
public native void computeFoo();
}


and not something like:

void activity_callback(void* activity,int message,void* arguments){
switch(message){
case ON_CREATE: …; break;
case ON_START: …; break;
case ON_RESUME: …; break;
case ON_PAUSE: …; break;
case ON_STOP: …; break;
case ON_DESTROY: …; break;
}
}

int main(){
pthread_t android=android_initialize();
pthread_t main;
void* ret;
void* a=android_new_Activity(&activity_callback);
pthread_create(main,0,&do_native_stuff,a);
pthread_join(main,&ret);
android_terminate();
pthread_join(android,&ret);
exit(0);
}


Ie, there is no "native" API to the Android system. You have to write
Android code in Java.


On the other hand, with Cocoa, there is a native API, and you can write
Cocoa applications in any programming language (modulo some restrictions
on iOS, but not on MacOSX).
--
__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
Marco van de Voort
2015-08-07 08:33:20 UTC
Permalink
Post by Pascal J. Bourguignon
Post by Marco van de Voort
Entirely in Java? So how do those native code apps run then? :-) They would
have no api or libs to point to.
Yes, that's basically the case. The NDK provides some C API to access
the hardware (eg. drawing on the screen), but the Android stuff
(process lifecycle), still has to be written in Java. So what you write
in native code, are libraries, called from the real program that is
written in Java.
That is what is exposed for store apps yes. Native apps there are basically
libs that are loaded by a small java stub. It is one of the two ways FPC can
create android apps (the other is by generating jvm code, but that has
severe consequences for the dialect and libs)

But is that the OS, or only the published part that is exposed to the
general public?
Pascal J. Bourguignon
2015-08-07 09:40:14 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Post by Marco van de Voort
Entirely in Java? So how do those native code apps run then? :-) They would
have no api or libs to point to.
Yes, that's basically the case. The NDK provides some C API to access
the hardware (eg. drawing on the screen), but the Android stuff
(process lifecycle), still has to be written in Java. So what you write
in native code, are libraries, called from the real program that is
written in Java.
That is what is exposed for store apps yes. Native apps there are basically
libs that are loaded by a small java stub. It is one of the two ways FPC can
create android apps (the other is by generating jvm code, but that has
severe consequences for the dialect and libs)
But is that the OS, or only the published part that is exposed to the
general public?
All the question is what we call "Operating System".

The classic defintion: an operating system is the software that manages
the computer's memory, processes, and all of its software and hardware.
It also allows the users to communicate with the computer without
knowing how to speak the computer's language. Without an operating
system, a computer is useless.

This covers three things:

- manages resources (hardware, memory, processor time, but actually, any
lower abstraction on which the OS runs and that it has to use to
provide the computing services to the applications and users).

- manages the software (programs, data, etc; including
installation of software, development (compilation linking)).

- interfaces with the users: user interfaces, command languages, etc.


Now the common confusion is to believe that an OS always works on bare
hardware. Far from it. Hardware is just one kind of machine on which
an OS can be developed and that an OS can manage for the user. In
general, any virtual machine is as good a basis for an OS. And both the
physical hardware and virtual machines, actually are equivalent to a
programming _language_, and programming languages are equivalent to
machines, to processors. What we call interpreter of a language or
(compiler of a language + (runtime) machine) are processors, just like
hardware or virtual machines are processors. This is the trivial
consequence of the Turing Equivalence.

This is why you can have Operating Systems running in web browsers, or
running on virtualization monitor or hypervisors (Xen), or on emulators
and other plain virtual machines, which are just normal programs running
on another OS.

The three parts of an OS are as important, and notably if you don't have
all the utilities and user interfaces, you don't have an OS. In unix
systems, the kernel manages resources (hardware, memory, processor
time). But if you boot a kernel without anything else, you don't have a
computer, you have a dead box, just as if it was off, since there's no
program to be executed and no way for the user to do anything with the
hardware. You can try it, just boot linux with no /, therefore without
/bin/init and no bash, and see what you can do with it!

On the other hand, a unix system (or at minimum, a unix kernel) can
serve as a machine for an operating system to target, as is the case
when you implement a virtual machine in a unix process. In this case,
the OS in the virtual machine accesses the services of the underlying
unix kernel or unix system, as if they were hardware, and must still
manage the "devices" provided by the underlying system, memory, and its
internal processes. Take for example emacs (which is but a LispMachine,
including device drivers, compilers, tools, user interfaces, command
interpreters, and applications). emacs can run on a bare linux kernel,
and the user is at home (of course until he tries to do some remote work
on the underlying unix).
http://www.informatimago.com/linux/emacs-on-user-mode-linux.html
(here, it's emacs / (um-) linux / linux, not even emacs / linux, but the
later can be done as well).

Note that user interfaces and command languages don't have to be text-
or even graphic-based. Other input and output devices can be used by the OS to
obtain commands from the users, and to give back information. (take for
example Siri or "Ok Google". A microphone + loud speaker is as good a
user interface to give commands to an OS as a screen and a mouse, or a
terminal with a keyboard.



Now about Android, most of it is writte in Java, and the only C code is
used to interface with the hardware layer, the linux kernel, which is
used as a device driver library.


cd /src/android/google
for f in * ; do
printf "%-20s %6d %6d\n" $f \
$(find $f -type f -name \*.java |wc -l) \
$(find $f -type f -name \*.c |wc -l) ;
done

gives:
java c
----------------------------------
abi 0 0
art 630 2
bionic 1 599
bootable 0 35
build 31 6
cts 3861 8
dalvik 679 3
developers 1024 0
development 1790 76
device 27 187
docs 0 0
external 12909 17581
frameworks 7055 537
hardware 13 1019
libcore 4266 2
libnativehelper 0 0
ndk 1 373
packages 5508 32
pdk 39 0
prebuilts 17 206
sdk 1078 4
system 5 296
tools 39 0
----------------------------------
Total: 38973 20966

Removing the external libraries,
(/ (- 38973.0 12909) (+ (- 38973 12909) (- 20966 17581)))
--> 0.885

88.5% of the source files of Android is Java, vs. only 11.5% of C files.

Most of the C code is concentrated in device, hardware, bionic, system, and
of course, ndk, apart from the external libraries.
--
__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
Marco van de Voort
2015-08-07 10:26:54 UTC
Permalink
Post by Pascal J. Bourguignon
Most of the C code is concentrated in device, hardware, bionic, system, and
of course, ndk, apart from the external libraries.
Yeah, in other words, the OS :-)

By your reasoning when more and more code in Linux is C++ and
the kernel remains plain C, eventually KDE will be "the OS".
Pascal J. Bourguignon
2015-08-07 11:46:10 UTC
Permalink
Post by Marco van de Voort
Post by Pascal J. Bourguignon
Most of the C code is concentrated in device, hardware, bionic, system, and
of course, ndk, apart from the external libraries.
Yeah, in other words, the OS :-)
No, the hardware. You use assembler to access the hardware.

Operating systems are written in high level programming languages, like
Pascal (sol, MacOS, ucsd), Lisp (Genera, Mezzano), pl/1 (Multics), etc.
In the case of Cocoa, it's different, since it's written in Objective-C
which mix a high-level Smalltalk OOS, with low level C, you can write
the device drivers themselves in Objective-C.
Post by Marco van de Voort
By your reasoning when more and more code in Linux is C++ and
the kernel remains plain C, eventually KDE will be "the OS".
KDE is definitely part of the OS. It's part of the user interface and
support programs.

The best proof that GUI frameworks are OS stuff, is that in Microsoft
Windows all the primitives of the graphical user interfaces are normal
system calls.
--
__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
j***@gmail.com
2015-08-05 08:13:56 UTC
Permalink
Just my thirteen cents...

If you want SIMPLE graphics added to any Modula-2, just use my x11 library: http://fruttenboel.verhoeven272.nl/mocka/simplex11.html This is meant to be a graphic output for Modula-2. But I'm working on a simple buttonpress mechanism...

Yes, I too dislike OO languages with their silly constructors and destructors and pointers into black hole voids. In a way, an OO Object resembles a Modula-2 Module. And if you DO need inheritable objects, you can use obc, the free version and open source Oberon compiler of Oxford University.

About 20 years ago, Nicki of Switzerland (Freiburg) created XModula for the Mocka compiler. You can make serious X applications with XModula. See also http://fruttenboel.verhoeven272.nl/GUI/Xtest.html and http://fruttenboel.verhoeven272.nl/mocka/xmod.html

About 10 years ago, Dr Maurer of Berlin Free University created Murus, which was a FULL port of X11 towards Mocka Modula-2. See http://fruttenboel.verhoeven272.nl/Murus/index.html for a backup. Murus is 100% in german language. But you can use it out of the box for Mocka.

In the mean time Dr Maurer ported Murus to Java (which made him very Anti-Java) and he abandoned it within a few years. Then he ported Murus to GO. Dr Maurer, who is very fond of Modula-2, seems to like GO, which is a good sign. Check out the new GO based Murus in http://www.murus.org/

If you want to read up on my rants against 'modern candycane languages' take a minute to read http://fruttenboel.verhoeven272.nl/GUI/ I don't like GO.

I tried Pyffon. Pyffon is a hoax language. It's a joke in a computer language travesty: http://fruttenboel.verhoeven272.nl/Python/index.html
If you are serious into programmng, skip Pyffon. No Poofters! Sorry for that. The bastard from Pommyland made me do it...

All in all, if you want to do it in Modula-2, you CAN. It may need serious programming though. You can use Murus (use the sources backed up on my website). You can use my x11 modules (the source is 35 KB) as a start. You can use Nicki's XModula as a base

And for the rest: EnJoy!
Gour
2015-08-05 08:38:51 UTC
Permalink
Post by j***@gmail.com
If you want to read up on my rants against 'modern candycane
languages' take a minute to read
http://fruttenboel.verhoeven272.nl/GUI/ I don't like GO.
:-)

I considered Go for a short time, but gave up on it…
Post by j***@gmail.com
I tried Pyffon. Pyffon is a hoax language. It's a joke in a computer
http://fruttenboel.verhoeven272.nl/Python/index.html If you are
serious into programmng, skip Pyffon. No Poofters! Sorry for that. The
bastard from Pommyland made me do it...
Well, Python would be the path of least-resistance to put something
together GUI-wise, but writing tons of unitests and looking at
tracebacks is not my cop of coffee.
Post by j***@gmail.com
All in all, if you want to do it in Modula-2, you CAN. It may need
serious programming though. You can use Murus (use the sources backed
up on my website). You can use my x11 modules (the source is 35 KB) as
a start. You can use Nicki's XModula as a base
I believe I’ll try with FPC & fpGUI…it looks as the best compromise at
the moment without too much pain in buiding ecosystem.

However, I’ll continue to monitor what’s going on with Modula-2 R10…
Post by j***@gmail.com
And for the rest: EnJoy!
Thank you!


Sincerely,
Gour
--
When your intelligence has passed out of the dense forest
of delusion, you shall become indifferent to all that has
been heard and all that is to be heard.
Pascal J. Bourguignon
2015-08-05 16:20:25 UTC
Permalink
Post by j***@gmail.com
Just my thirteen cents...
If you want SIMPLE graphics added to any Modula-2, just use my x11
library: http://fruttenboel.verhoeven272.nl/mocka/simplex11.html This
is meant to be a graphic output for Modula-2. But I'm working on a
simple buttonpress mechanism...
Yes, I too dislike OO languages with their silly constructors and
destructors and pointers into black hole voids. In a way, an OO Object
resembles a Modula-2 Module. And if you DO need inheritable objects,
you can use obc, the free version and open source Oberon compiler of
Oxford University.
Personnaly, I like very much the benefits of inhertance in OO
(Smalltalk, CLOS), but you will notice that most "OO" "practicionners"
(C++, Java, etc) nowadays advise against inheriting, and promote instead
the use of "interfaces".

Ie. just modules :-)
--
__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
Nemo
2015-08-05 20:35:00 UTC
Permalink
On 05/08/2015 04:13, ***@gmail.com wrote (in part):
[...]
[...]
Post by j***@gmail.com
About 20 years ago, Nicki of Switzerland (Freiburg) created XModula for the Mocka compiler.
[...]
Post by j***@gmail.com
About 10 years ago, Dr Maurer of Berlin Free University created Murus,
[...]

GPM came with OpenGL examples (spinning cube, shaded cube bouncing off
walls,...)

N.
j***@gmail.com
2015-08-06 08:15:27 UTC
Permalink
Post by Nemo
GPM came with OpenGL examples (spinning cube, shaded cube bouncing off
walls,...)
FST Modula-2 had OO and classes incorporated... And it had an assembler inside that outperformed just about any real assembler...
It's not very important that outdated compilers already had special functions. I never got GPM to run for that matter. Unlike Mocka.

Mike Spivey's obc has an XYPlane module which is already pretty good. I used it as inspiration for my x11 module.
j***@gmail.com
2015-08-08 08:33:57 UTC
Permalink
And yet another zillion points go to Marco for cunningly stealing the topic and converting a GUI issue into a meaningless Yet Another Distro War. Bill Gates laughes his butt off... The GNU people prefer to fight eachother, to score some silly Pyrrhus victory, instead of combining efforts and fighting Windows version x.y...
Marco van de Voort
2015-08-08 09:14:25 UTC
Permalink
Post by j***@gmail.com
And yet another zillion points go to Marco for cunningly stealing the
topic and converting a GUI issue into a meaningless Yet Another Distro
War. Bill Gates laughes his butt off... The GNU people prefer to fight
eachother, to score some silly Pyrrhus victory, instead of combining
efforts and fighting Windows version x.y...
I'm not "GNU people", and merely reacting to silly propaganda is not
"cunningly stealing".

But it did take too long, so back to Modula2.
Gour
2015-08-08 09:18:13 UTC
Permalink
Post by Marco van de Voort
But it did take too long, so back to Modula2.
What do you think how much effort would be to e.g. port from FPC to
Modula-2 something like http://fpgui.sourceforge.net/ ?

It’s used in production (for proprietary apps) and does not depend on
external toolkits besides X11 etc.

Sincerely,
Gour
--
One must deliver himself with the help of his mind, and not
degrade himself. The mind is the friend of the conditioned soul,
and his enemy as well.
Marco van de Voort
2015-08-08 13:03:52 UTC
Permalink
Post by Gour
Post by Marco van de Voort
But it did take too long, so back to Modula2.
What do you think how much effort would be to e.g. port from FPC to
Modula-2 something like http://fpgui.sourceforge.net/ ?
Well, strictly speaking impossible since M2 is not an OO language and that
is an OO library. In theory you can of course try to flatten it to, but
then every userfriendliness (if any) goes out of the window, and you might
as well use gtk from gm2, which is basically a flattened library over X too.
Post by Gour
It???s used in production (for proprietary apps) and does not depend on
external toolkits besides X11 etc.
Yes, so one less than Lazarus. Never found that argument terribly
convincing. I've worked with fpgui and its predecessor fpgtk before Lazarus
became mature (and before Graeme took over fpgui's maintenance), but never
looked back. I still have to find a case where Lazarus doesn't work
sufficiently, and my code isn't directly tied to the underlying toolkit.

And the size argument is often cited, but I haven't frankly run into it
since I was still on dialup. (and probably then halving the size wouldn't
have saved me either, only marginally less painful)

I can imagine one would use it for POS and other fullscreen uses (when owner
drawn is less annoying), but tell the truth, as an owner drawn toolkit it is
philosophically dated. Most ownerdrawn toolkits nowadays go directly to
opengl and shaders as abstraction, rather than sticking to old desktop
canvas metaphores.

Personally I would avoid the vocal minorities and simply go with Lazarus.
Gour
2015-08-08 14:27:18 UTC
Permalink
Post by Marco van de Voort
Well, strictly speaking impossible since M2 is not an OO language and that
is an OO library.
Well, GTK is written in C which is also not OO… :-)
Post by Marco van de Voort
In theory you can of course try to flatten it to, but then every
userfriendliness (if any) goes out of the window,
However, I must admit I forgot Modula-2 is not OO language…too much
eading/researching in recent time, so I mixed few things.[1]

But that makes Modula-2 not really suitable for usage with any of ’big’
toolkits (GTK, wx, Qt,..) since or belong to OOP…although, there are
attempts to use those even in FP languages.
Post by Marco van de Voort
and you might as well use gtk from gm2, which is basically a flattened
library over X too.
But there are no gtk bindings for gm2, right?
Post by Marco van de Voort
Yes, so one less than Lazarus. Never found that argument terribly
convincing.
Well, the argument is there is no need to always runh behind upstream
trying to catch it.
Post by Marco van de Voort
I still have to find a case where Lazarus doesn't work sufficiently,
and my code isn't directly tied to the underlying toolkit.
You do not have problem with Lazarus’s inconsistency of widget behaviour
in different toolkits?
Post by Marco van de Voort
And the size argument is often cited, but I haven't frankly run into it
since I was still on dialup. (and probably then halving the size wouldn't
have saved me either, only marginally less painful)
I agree, these days, size is not the problem.
Post by Marco van de Voort
I can imagine one would use it for POS and other fullscreen uses (when owner
drawn is less annoying), but tell the truth, as an owner drawn toolkit it is
philosophically dated. Most ownerdrawn toolkits nowadays go directly to
opengl and shaders as abstraction, rather than sticking to old desktop
canvas metaphores.
I’m not so much concerned with ’philosophy’, iow. "It doesn't matter
whether a cat is white or black, as long as it catches mice."
Post by Marco van de Voort
Personally I would avoid the vocal minorities and simply go with Lazarus.
I plan to give it a fair try…similar to MSEgui, although I’m not very
excited about MSEide…


Sincerely,
Gour


Footnotes:
[1] It’s also very hot here and the brain does not function
optimally. :-)
--
He who is satisfied with gain which comes of its own accord, who
is free from duality and does not envy, who is steady in both
success and failure, is never entangled, although performing actions.
Pascal J. Bourguignon
2015-08-08 15:09:00 UTC
Permalink
Post by Gour
Post by Marco van de Voort
Well, strictly speaking impossible since M2 is not an OO language and that
is an OO library.
Well, GTK is written in C which is also not OO… :-)
Post by Marco van de Voort
In theory you can of course try to flatten it to, but then every
userfriendliness (if any) goes out of the window,
However, I must admit I forgot Modula-2 is not OO language…too much
eading/researching in recent time, so I mixed few things.[1]
I'm not sure. I would note that the MacOS (1984) GUI presented APIs that
nominally seemed to be non-OO (normal Pascal functions and procedure),
but when you looked at it more closely, you could see that it was
definitely an OO design, with multi-level hierarchies of classes and
subclasses (port <- window <- dialog, control <- button <- radio-button,
control <- scroll, etc). Also, not surprising given that they just
basically copied Smalltalk stuff from Xerox PARC. When OOP languages
were introduced on MacOS a few years later, they mapped objects quite
naturally to the structures of the GUI framework (the Toolbox).

This didn't go unnoticed of application programmers, who often applied
just the same technique as Apple, and defining "subclasses" in the same
way, in their non-OOP langages (Pascal, C) of the time.
I did precisely that on MacOS in Modula-2!

Ok, so you didn't have polymorphic methods, but a function defined to
work on a "superclass", like a Window, did work perfectly well on your
own "subclass" of a Window, (as long as you didn't expect it to also
affect the new fields of your "subclass". This used extensively pointer
casting, or opaque pointers in Modula-2.

I'm not saying that you should not try to avoid it nowadays, that we
have better OOP languages, but at least it's possible and not too
horrible.

And if you follow the example of Objective-C, and define your object
system to be 100% dynamic like Smalltalk, then you can have a complete
object system and do real OOP in Modula-2, with only syntactical
inconvenience (which can easily be masked with a pre-processor).
Post by Gour
But that makes Modula-2 not really suitable for usage with any of ’big’
toolkits (GTK, wx, Qt,..) since or belong to OOP…although, there are
attempts to use those even in FP languages.
What would make it unsuitable, is if they used an unsuitable "OO" model,
(ie. C++).
--
__Pascal Bourguignon__
Gour
2015-08-09 06:51:42 UTC
Permalink
Post by Pascal J. Bourguignon
This didn't go unnoticed of application programmers, who often applied
just the same technique as Apple, and defining "subclasses" in the same
way, in their non-OOP langages (Pascal, C) of the time.
I did precisely that on MacOS in Modula-2!
Yes, it’s possible, but at the moment do not have time to work on it
alone seeing not much is happening within Modula-2 world, what to speak
about GUI programming within it…so moving my focus to Free Pascal…


Sincerely,
Gour
--
As the ignorant perform their duties with attachment to results,
the learned may similarly act, but without attachment, for the
sake of leading people on the right path.
trijezdci
2015-08-12 13:55:02 UTC
Permalink
Post by Pascal J. Bourguignon
I would note that the MacOS (1984) GUI presented APIs that
nominally seemed to be non-OO (normal Pascal functions and procedure),
but when you looked at it more closely, you could see that it was
definitely an OO design,
Indeed, a design can be OO and it can be implemented in a language that is not.
Post by Pascal J. Bourguignon
Ok, so you didn't have polymorphic methods, but a function defined to
work on a "superclass", like a Window, did work perfectly well on your
own "subclass" of a Window, (as long as you didn't expect it to also
affect the new fields of your "subclass". This used extensively pointer
casting, or opaque pointers in Modula-2.
Obviously not ideal and some might consider it ugly.

In Oberon, Wirth replaced variant record types with extensible record types.

TYPE BaseType = RECORD
foo : Foo
END;

TYPE ExtendedType = RECORD ( BaseType )
bar : Bar;
baz : Baz
END;

Then instances of any extended type are upwards compatible with any type it is based on, directly or indirectly, but instances of base types are not downwards compatible with any of its extensions.

This is a very minimalist way of doing OOP and definitely nicer and safer than casting pointers. You will find that this simple modification alone applied to any Modula-2 dialect will make for a serious upgrade and will be sufficient to implement powerful object oriented GUI frameworks.

But yes, I agree, you can implement OO designs in PIM by casting opaque pointer types.
Pascal J. Bourguignon
2015-08-12 15:02:06 UTC
Permalink
Post by trijezdci
Post by Pascal J. Bourguignon
I would note that the MacOS (1984) GUI presented APIs that
nominally seemed to be non-OO (normal Pascal functions and procedure),
but when you looked at it more closely, you could see that it was
definitely an OO design,
Indeed, a design can be OO and it can be implemented in a language that is not.
Post by Pascal J. Bourguignon
Ok, so you didn't have polymorphic methods, but a function defined to
work on a "superclass", like a Window, did work perfectly well on your
own "subclass" of a Window, (as long as you didn't expect it to also
affect the new fields of your "subclass". This used extensively pointer
casting, or opaque pointers in Modula-2.
Obviously not ideal and some might consider it ugly.
In Oberon, Wirth replaced variant record types with extensible record types.
TYPE BaseType = RECORD
foo : Foo
END;
TYPE ExtendedType = RECORD ( BaseType )
bar : Bar;
baz : Baz
END;
Then instances of any extended type are upwards compatible with any
type it is based on, directly or indirectly, but instances of base
types are not downwards compatible with any of its extensions.
This is a very minimalist way of doing OOP and definitely nicer and
safer than casting pointers. You will find that this simple
modification alone applied to any Modula-2 dialect will make for a
serious upgrade and will be sufficient to implement powerful object
oriented GUI frameworks.
Definitely.
Post by trijezdci
But yes, I agree, you can implement OO designs in PIM by casting opaque pointer types.
And then, if you want OO, why not go to Modula-3?
--
__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-08-12 15:42:37 UTC
Permalink
Post by Pascal J. Bourguignon
And then, if you want OO, why not go to Modula-3?
Well, I was trying to relate to the topic along the lines of "how would you do GUI stuff in M2".
Pascal J. Bourguignon
2015-08-12 15:59:35 UTC
Permalink
Post by trijezdci
Post by Pascal J. Bourguignon
And then, if you want OO, why not go to Modula-3?
Well, I was trying to relate to the topic along the lines of "how would you do GUI stuff in M2".
Right, sorry, I get lost :-)
--
__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-08-12 16:52:11 UTC
Permalink
Post by Pascal J. Bourguignon
Post by trijezdci
Post by Pascal J. Bourguignon
And then, if you want OO, why not go to Modula-3?
Well, I was trying to relate to the topic along the lines of "how would you do GUI stuff in M2".
Right, sorry, I get lost :-)
I am not saying that Oberon style OOP is the one and only way to do OOP and everybody else is doing it wrong. In fact I quite liked the OOP side of Objective-C and even its OOP parent Smalltalk.

But if we look at OOP in the context of Modula-2, then the most obvious thing to do is to follow Oberon and replace variant record types with extensible record types. IIRC, the venerable Canterbury Modula-2 did just that. It is due to the controversial ISO M2 standard that this replacement did not become mainstream.

If you look at how Pascal developed after Modula-2 appeared, you will find that quite a number of ideas from Modula-2 were adopted into Pascal. Had there be a strong champion for Modula-2 like Borland was a strong champion for Pascal, and had compiler vendors not been sitting around waiting for ISO, you would likely have seen a de-facto Modula-2 standard emerge where variant record types had been replaced with Oberon style extensible record types.

Even if you don't like anything else about Oberon, this one feature simply makes perfect sense and it should have been adopted by all Modula-2 implementors. And to those who elevate Wirth to prophet status and reject anything that didn't come from him, I shall say, it was Wirth who came up with this replacement feature in the first place, so there is a perfect justification to adopt it into Modula-2.
j***@gmail.com
2015-08-12 18:07:26 UTC
Permalink
Post by trijezdci
the venerable Canterbury Modula-2 did just that.
MHC was a big disappointment to me.

ISO killed Modula-2. And then, NW and JG came along with their new Oberon language and OS and everybody forgot Modula2 AND Oberon....

I've been on the ETHZ Oberon mailinglist. Most people there see NW as a saint and a prophet, perhaps even as THE supreme being. Whereas NW sees himself more as an inspiration bringer. And that's how I like to see him. Compiler maker and writer of magnificent books. Data Structure + Algorithms = Programs...
Nemo
2015-08-12 18:25:51 UTC
Permalink
and had compiler vendors not been sitting around waiting for ISO,
you would likely hav> seen a de-facto Modula-2 standard emerge
where variant record types had been replaced with Oberon style
extensible record types.
For what it is worth, there is ISO/IEC 10514-2:1998 - Modula-2 (OO
extension).

N.
trijezdci
2015-08-12 19:05:01 UTC
Permalink
Post by Nemo
and had compiler vendors not been sitting around waiting for ISO,
you would likely hav> seen a de-facto Modula-2 standard emerge
where variant record types had been replaced with Oberon style
extensible record types.
For what it is worth, there is ISO/IEC 10514-2:1998 - Modula-2 (OO
extension).
I am aware of that, but I do not consider it a good piece of work.

In my opinion, Wirth's approach of extensible record types is superior. It simpler and more elegant, true to the spirit of the language. ISO is a true committee design, a product of horse trading and Arabian bazaar bargaining. I know this because I was present at a number of the ISO meetings.

Furthermore, once you have extensible record types, you no longer need variant records, they are obsolete. So you remove them. Not only does this remove unnecessary weight from the language, but variant records are an unsafe feature, they are hidden casts. If Wirth had consequently executed the policy that unsafe features must be imported from pseudo-module SYSTEM, variant records should have to have been imported from there. The beauty of replacing variant records with extensible records is that you no longer have to carry the ballast of an unsafe and obsolete feature in the language.

Yet, ISO still has variant records. In principle they could have been removed and replaced by the facilities provided in the OO extension but because its not a straightforward replacement and only an extension not part of the base language, they are still present. Committee design. Patchwork design.
Nemo
2015-08-13 02:42:54 UTC
Permalink
Post by trijezdci
Post by Nemo
For what it is worth, there is ISO/IEC 10514-2:1998 - Modula-2 (OO
extension).
I am aware of that, but I do not consider it a good piece of work.
Yes, I agree. I was using the English idiom "for what it is worth" that
really means "worthless".

N.
Marco van de Voort
2015-08-09 16:14:07 UTC
Permalink
Post by Marco van de Voort
Well, strictly speaking impossible since M2 is not an OO language and that
is an OO library.
Well, GTK is written in C which is also not OO??? :-)
I meant that it is also one procedural library between application and X11,
be it in C (GTK) or Pascal (fpgui). Of course GTK uses some more non visual
libs (for e.g. internationalization), but most of them for lofty goals.

So it would be weird to port a minority (pascal and one person maintainer)
fpgui to Modula2 and flatten it. You might as well write a bunch of headers
to GTK, and the result would mostly be the same or better.

Of course porting the library itself to M2 would be easier in fpgui's case
than in gtk's case, but would come close to rewriting it in M2while occasionally
looking at fpgui rather than "porting". (see also below for remarks about
more than just OO->procedural)
Post by Marco van de Voort
In theory you can of course try to flatten it to, but then every
userfriendliness (if any) goes out of the window,
However, I must admit I forgot Modula-2 is not OO language???too much
eading/researching in recent time, so I mixed few things.[1]
Note that the flattening was meant hypothetical.

Flattening the API from OO to procedural (as e.g. Pascal B. is suggesting) is
not that simple if the original library was not written with that in mind.
Stuff like string handling, dynamic and open arrays, default parameters etc
etc all interfere, and make the result often much harder to use.

fpgui might use interface based forms of multiple inheritance even.
But that makes Modula-2 not really suitable for usage with any of ???big???
toolkits (GTK, wx, Qt,..) since or belong to OOP???although, there are
attempts to use those even in FP languages.
GTK is OO-centric model, but flattened to procedural api. Still it is not
really userfriendly. Some parts of Qt are not even strictly C++, since they
require a custom preprocessor (MOC)
Post by Marco van de Voort
and you might as well use gtk from gm2, which is basically a flattened
library over X too.
But there are no gtk bindings for gm2, right?
I assumed there were, but I'm not sure. Still if you decede to stick to M2,
that is the better route IMHO, and not porting fpgui, unless you do it for
fun.
Post by Marco van de Voort
Yes, so one less than Lazarus. Never found that argument terribly
convincing.
Well, the argument is there is no need to always runh behind upstream
trying to catch it.
So is walking. You are never without transportation because your car broke
down. It can be all fine if you do short distances (read: your apps as your
minimalistic as your tools). But if you must cover distance you get sore
feet.

Better make sure that everything is in walking distance.
Post by Marco van de Voort
I still have to find a case where Lazarus doesn't work sufficiently,
and my code isn't directly tied to the underlying toolkit.
You do not have problem with Lazarus???s inconsistency of widget behaviour
in different toolkits?
No. I usually have one main target (sometimes Linux, but most times windows),
and the app might have small visual problems on a non default target, but is
always functional, and that is enough for me.

But most, most importantly, I don't like the feel of most owner drawn
widgetsets. It takes a lot of work to make everything right. (keyboard
control etc).

It always gets said "yeah we will emulate stuff target dependently to
improve look and feel", but these small projects somehow never manage it.

That's the killing blow for me, personally.

And then of course fpgui chains you to Graeme and all his quirks, including
his OS/2 helpformat and that helpfile compiler for it that must be run in an
emulator. (watcom dosextender iirc) Not healthy, and it will be my way or
the highway at every point.
Post by Marco van de Voort
I can imagine one would use it for POS and other fullscreen uses (when owner
drawn is less annoying), but tell the truth, as an owner drawn toolkit it is
philosophically dated. Most ownerdrawn toolkits nowadays go directly to
opengl and shaders as abstraction, rather than sticking to old desktop
canvas metaphores.
I???m not so much concerned with ???philosophy???, iow. "It doesn't matter
whether a cat is white or black, as long as it catches mice."
It probably is only a problem if you get sucked into developing it or
otherwise invest heavily in it.
Post by Marco van de Voort
Personally I would avoid the vocal minorities and simply go with Lazarus.
I plan to give it a fair try???similar to MSEgui, although I???m not very
excited about MSEide???
MSEGUI is about the same. Also mostly a one person show, and that person is
spread too thin. Martin has some more credit with me though because he has
helped out in the past heavily e.g. in the object persistence and resource
streaming.
Gour
2015-08-09 16:54:39 UTC
Permalink
Post by Marco van de Voort
I meant that it is also one procedural library between application and X11,
be it in C (GTK) or Pascal (fpgui).
OK.
Post by Marco van de Voort
So it would be weird to port a minority (pascal and one person maintainer)
fpgui to Modula2 and flatten it. You might as well write a bunch of headers
to GTK, and the result would mostly be the same or better.
You’re right…Otoh, it was more ’conceptual’ question in regard to having
native GUI toolkit written in M2.
Post by Marco van de Voort
I assumed there were, but I'm not sure. Still if you decede to stick to M2,
that is the better route IMHO, and not porting fpgui, unless you do it for
fun.
In my case ’fun’ would be writing app itself and not building (GUI)
ecosystem. ;)

I admit that M2 sounds very cool language-wise, but the language itself
it not enough these days…
Post by Marco van de Voort
So is walking. You are never without transportation because your car broke
down. It can be all fine if you do short distances (read: your apps as your
minimalistic as your tools). But if you must cover distance you get sore
feet.
:-)
Post by Marco van de Voort
No. I usually have one main target (sometimes Linux, but most times windows),
That’s good point!
Post by Marco van de Voort
and the app might have small visual problems on a non default target, but is
always functional, and that is enough for me.
OK. Thanks.
Post by Marco van de Voort
And then of course fpgui chains you to Graeme and all his quirks, including
his OS/2 helpformat and that helpfile compiler for it that must be run in an
emulator. (watcom dosextender iirc) Not healthy, and it will be my way or
the highway at every point.
I admit that using toolkit written & maintained by single person is not
comfortable…I was exploring OS2’s *.INF a bit (it was long ago when I was
using that OS) and decided that CHM is better option for me - it allows
me to write reST using Emacs editor and then convert to htmlhelp with
Sphinx and finally chmcmd to build *.chm.

Moreover reST/Sphinx gives more possibilities in regard to output
format, bette quality PDF output and ability to convert from/to which is
not the case with INF…and I mentioned it in my post to fpGUI group.
Post by Marco van de Voort
MSEGUI is about the same. Also mostly a one person show, and that person is
spread too thin. Martin has some more credit with me though because he has
helped out in the past heavily e.g. in the object persistence and resource
streaming.
Don’t know about that, but, after trying it briefle, somehow I do not
like it and since I’ll use Start Programming using Object Pascal book
(for the beginning), I’ll go along with Lazarus.

Btw, what do you think about this newly released book:

http://www.marcocantu.com/objectpascalhandbook/

Is it better to buy that instead of Lazarus ’bundle’ and then use online
docs for learning Lazarus?


Sincerely,
Gour
--
The humble sages, by virtue of true knowledge, see with equal
vision a learned and gentle brāhmana, a cow, an elephant, a dog
and a dog-eater.
j***@gmail.com
2015-08-11 23:49:21 UTC
Permalink
I'll use Start Programming using Object Pascal book
(for the beginning), I'll go along with Lazarus.
I hope you got the free ebook version since the book is VERY simple... It explains about the Pascal language syntax but any Wirth/Reiser book is magnitudes better.
The section about GUI's is about how to drag 'n drop buttons into a field.
http://www.marcocantu.com/objectpascalhandbook/
Is it better to buy that instead of Lazarus 'bundle' and then use online
docs for learning Lazarus?
If I see your demands it is better to get yourself a VERY good book about C++ and learn that. As a language, Modula-2 and Oberon are far superior to any modern OOP language, but you seem to need ready made libraries that you can use out of the box.
Gour
2015-08-12 05:48:01 UTC
Permalink
Post by j***@gmail.com
I hope you got the free ebook version since the book is VERY
simple...
Yes, it’s free download available online.
Post by j***@gmail.com
If I see your demands it is better to get yourself a VERY good book
about C++ and learn that.
Many years ago I did my thesis on the university usng (Zortech) C++
compiler, but these days I’m simply not enthusiastic to use C(++) for my
hobby project...
Post by j***@gmail.com
As a language, Modula-2 and Oberon are far superior to any modern OOP
language, but you seem to need ready made libraries that you can use
out of the box.
There are several languages more attractive than C(++), but, more or
less, they’re lacking in GUI part…it looks everyone is just pushing web
with html/css/js. :-(

That’s why FPC/Lazarus looks as good compromise.

If I’d have to write compiler Modula-2 would be great, but,
(un)fortunately I wrote that in the school using TP and now need/want
simple desktop app…


Sincerely,
Gour
--
One who restrains his senses, keeping them under full control,
and fixes his consciousness upon Me, is known as a man of
steady intelligence.
j***@gmail.com
2015-08-12 08:36:37 UTC
Permalink
Post by Gour
Many years ago I did my thesis on the university usng (Zortech) C++
compiler, but these days I'm simply not enthusiastic to use C(++) for my
hobby project...
C++ is just 'Modula-2 for C'. Although Stroustrup categorically denies he had any knowledge of Modula-2.
Post by Gour
most compilers lacking in GUI part... it looks everyone is just pushing web
with html/css/js. :-(
If you use the CGI you can do an awful lot with any compiled language.
You will have to learn to understand how things work, but it won't be that difficult.
Post by Gour
now need/want simple desktop app...
Now we're talking... what exactly do you want to make? perhaps we can give you some clues where to look for solutions.

I read the foreword of the ebook on object pascal. the author graduated from university only knowing BASIC....
Post by Gour
Sincerely,
Gour
--
One who restrains his senses, keeping them under full control,
and fixes his consciousness upon Me, is known as a man of
steady intelligence.
Gour
2015-08-12 09:44:16 UTC
Permalink
Post by j***@gmail.com
C++ is just 'Modula-2 for C'. Although Stroustrup categorically denies
he had any knowledge of Modula-2.
Can’t comment on it not being familiar enough with Modula, but today’s
C++ is simply ugly to me.
Post by j***@gmail.com
Now we're talking... what exactly do you want to make? perhaps we can
give you some clues where to look for solutions.
Well, I want to write desktop GUI application, something like
http://saravali.de/maitreya.html

And based on the research what I’ve done so far, using FPC with some of
its GUI options seems as the most pragmatic solution., iow. language is
acceptable, active community, available docs in the form of online
tutorials, reference manuals, paper books etc.
Post by j***@gmail.com
I read the foreword of the ebook on object pascal. the author
graduated from university only knowing BASIC....
Well, that ebook is just to refresh a Pascal syntax since it was long
ago when I was using it…I’m also considering this one
http://www.marcocantu.com/objectpascalhandbook/ written by
well-known Delphiy author.

Otoh, if there would be something similar to FPC/Lazarus for Modula-2, I
am sure there would not be any need for this thread at all. ;)

Btw, I wonder about your “GNU M2 is a downright disaster to work with….”
statement?

There is easily available *.deb package based on gcc-4.7 and its
maintainer wrote me that soon he will update it to gcc-trunk (5.2).

Moreover, he also wrote me that he is planning to to support for R10
when it becomes available.

Community around GM2 is not big, but there is mailing list dedicated to
it, public git repo etc.

Otoh, I do not see similar things in regard to Mocka compiler, link at
http://fruttenboel.verhoeven272.nl/modula-2/index.html for ’Home of
the…’ is dead?

Link for MHC compiler is also dead - which is even more depressive
than the state of GM2. :-(

So, I’m not sure I want to delve into it since I have time only to build
something out of established ecosystem and not to do pioneering
work…maybe if I’d be 30 yrs younger with lot of free time. :-)

I wish all success to R10, but, atm, it seems that Modula-2 is mostly
dead language for practical work to be done *today*.


Sincerely,
Gour
--
As the ignorant perform their duties with attachment to results,
the learned may similarly act, but without attachment, for the
sake of leading people on the right path.
j***@gmail.com
2015-08-12 13:41:31 UTC
Permalink
Post by Gour
Well, I want to write desktop GUI application, something like
http://saravali.de/maitreya.html
I saw the screenshots. What I would do:

- create a graphical control front-end in Tcl/Tk with buttons, dropdowns, input fields, whatever

- create the main program in Modula-2 or Oberon

- output graphs and data to windows you build up with my x11 module
Post by Gour
Btw, I wonder about your "GNU M2 is a downright disaster to work with...."
statement?
GM2 needed me to install VERY backdated versions of gcc and glib and when I finally succeeded it was slow as a turtle crawling in molasses. So I gave up. I already had Mocka running stable. It's been stable now for 20 years....
Post by Gour
There is easily available *.deb package based on gcc-4.7
I run Slackware so I do not use deb packages.
Post by Gour
maintainer wrote me that soon he will update it to gcc-trunk (5.2).
If I want to do that I will use p2c translator.
Post by Gour
Otoh, I do not see similar things in regard to Mocka compiler, link at
http://fruttenboel.verhoeven272.nl/modula-2/index.html for 'Home of
the...' is dead?
Yes. Karlsruhe University stopped support of it. But even ETOZ stopped with it.
Post by Gour
Link for MHC compiler is also dead - which is even more depressive
than the state of GM2. :-(
MHC was a commercial product. I bought it, expressed my opinion to the developer and since then the product is offline. The link is there for historical reasons.
Post by Gour
I wish all success to R10, but, atm, it seems that Modula-2 is mostly
dead language for practical work to be done *today*.
All wirthian languages are dead as a dodo. Wirth's purposes for these language was not to make good languages but to show what a good language can do. Many aspects from his languages are incorporated in 'modern' languages.
Only afficionado's like us will use Wirthian languages because of their intrinsic beauty.
Gour
2015-08-12 13:51:44 UTC
Permalink
Post by j***@gmail.com
- create a graphical control front-end in Tcl/Tk with buttons,
dropdowns, input fields, whatever
- create the main program in Modula-2 or Oberon
In the meantime I got idea to use Modula-2 + python…what do you think?
Post by j***@gmail.com
GM2 needed me to install VERY backdated versions of gcc and glib and
when I finally succeeded it was slow as a turtle crawling in
molasses. So I gave up. I already had Mocka running stable. It's been
stable now for 20 years....
I see…
Post by j***@gmail.com
If I want to do that I will use p2c translator.
You mean m2c or?
Post by j***@gmail.com
All wirthian languages are dead as a dodo. Wirth's purposes for these
language was not to make good languages but to show what a good
language can do.
Hm…my feeling was that Modula-2 was meant for ’real’ work fixing
problems spotted in Pascal?
Post by j***@gmail.com
Many aspects from his languages are incorporated in 'modern'
languages.
Can you list some?

I did spent some time investigating those ’modern’ languages, but,
somehow was not impressed with what I have seen…
Post by j***@gmail.com
Only afficionado's like us will use Wirthian languages because of their intrinsic beauty.
:-)


Sincerely,
Gour
--
Therefore, without being attached to the fruits of activities,
one should act as a matter of duty, for by working without
attachment one attains the Supreme.
j***@gmail.com
2015-08-12 17:43:07 UTC
Permalink
In the meantime I got idea to use Modula-2 + python...what do you think?
It may be better than using the CGI. There's only one problem: M2 is ultra structured. Python is total chaos.
http://fruttenboel.verhoeven272.nl/Python/index.html
Post by j***@gmail.com
If I want to do that I will use p2c translator.
You mean m2c or?
No, P2C is Pascal to C and it can handle Modula-2 as well.

***@nitrogen:~$ m2c
bash: m2c: command not found
***@nitrogen:~$ p2c
^C
Hm...my feeling was that Modula-2 was meant for 'real' work fixing
problems spotted in Pascal?
When Modula-2 was catching on, Wirth came up with Oberon.... In Russia M2 was a success. May that's why the yanks didn't overly like it.
Post by j***@gmail.com
Many aspects from his languages are incorporated in 'modern'
languages.
Can you list some?
Strong typing, speed, ease of use, structured programming, modules, operating systems, the lot. He needed a language for his ETHZ classes. Just like AST needed Minix. AST and NW invented their own toolsets. Do you know the ACK compiler? Pascal, C and Modula-2 frontends for one compiler. And a damn good one too. The Pascal frontend makes the smallest executables.

http://fruttenboel.verhoeven272.nl/ack/index.html
Gour
2015-08-12 17:53:25 UTC
Permalink
Post by j***@gmail.com
It may be better than using the CGI. There's only one problem: M2 is
ultra structured. Python is total chaos.
Well, the essence would be written in M2, only GUI in Python…
Post by j***@gmail.com
No, P2C is Pascal to C and it can handle Modula-2 as well.
Ahh, OK. I was thinking about http://nongnu.org/m2c/
Post by j***@gmail.com
May that's why the yanks didn't overly like it.
Well, they anyway mostly do not like anything which is not part of their
“culture”. :-)
Post by j***@gmail.com
Strong typing, speed, ease of use, structured programming, modules,
operating systems, the lot.
I’,m aware of those, but was curious about the list of languages where,
according to your belief, those features are successfully
implemented. ;)


Nope. Never used it…


Sincerely,
Gour
--
It is far better to discharge one's prescribed duties, even though
faultily, than another's duties perfectly.
Marco van de Voort
2015-08-12 14:03:34 UTC
Permalink
You???re right???Otoh, it was more ???conceptual??? question in regard to having
native GUI toolkit written in M2.
If your M2 target is solid enough it could be done I guess.
Post by Marco van de Voort
I assumed there were, but I'm not sure. Still if you decede to stick to M2,
that is the better route IMHO, and not porting fpgui, unless you do it for
fun.
In my case ???fun??? would be writing app itself and not building (GUI)
ecosystem. ;)
Yes. It is so easy to get sucked in. That isn't bad, I've been sucked in to
FPC development for 15 years now, but it must be a choice, not a necessity.
I admit that M2 sounds very cool language-wise, but the language itself
it not enough these days???
As said, in general I think that the language is overrated in programming related
discussions. Yes, language matters, but so does the rest.
Don???t know about that, but, after trying it briefle, somehow I do not
like it and since I???ll use Start Programming using Object Pascal book
(for the beginning), I???ll go along with Lazarus.
http://www.marcocantu.com/objectpascalhandbook/
Is it better to buy that instead of Lazarus ???bundle??? and then use online
docs for learning Lazarus?
I don't have it, but in my experience older Delphi books are better suitable
for learning the dialect. Later ones tend to overfocus on later additions in
the hope some people that already have experience buy it for that.
Pascal J. Bourguignon
2015-08-08 10:11:09 UTC
Permalink
Post by j***@gmail.com
And yet another zillion points go to Marco for cunningly stealing the
topic and converting a GUI issue into a meaningless Yet Another Distro
War. Bill Gates laughes his butt off... The GNU people prefer to fight
eachother, to score some silly Pyrrhus victory, instead of combining
efforts and fighting Windows version x.y...
You're missing the point. Microsoft Windows is irrelevant in all this,
because it's closed source containing malware and backdoors that nobody
in his right mind would ever use.

The point is that since a kernel doesn't make an OS and that you can
even write an OS, without implementing what's implemented in eg. the
Linux kernel, you can implement an OS in Modula-2! And have it run,
eg. in browser, so people could use your Modula-2 OS anywhere with just
a browser, without having to "install" anything!

All you need, is a Modula-2 backend generating javascript (or soon,
WebAssembly), and you're all set to implement process management, memory
management, object persistency, implement or port a graphic framework,
and write applications, all that in Modula-2, easily accessible to any
newbie.

As long as it's AGPL3, and you provide the sources with ;-)
--
__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
j***@gmail.com
2015-08-08 19:24:02 UTC
Permalink
Post by Gour
Now I wonder what was/is situation in regard to GUI bindings?
Question: do you need the GUI bindings?

You could create a front-end in Tcl/Tk that totally relies on a bunch of Modula-2 programs. I did something similar in http://fruttenboel.verhoeven272.nl/Prog/chall2.html where the IOrd2 program is called by the Tcl/Tk program.

You would just use the Tcl/Tk program for handling the buttons and let Modula-2 take care of the (inter)actions at lightning speed.

teaching an old dog some new tricks is easier than genetically re-engineering a new dog.

And again: take a look at my ultra simple x11 module. It can be extended but not by me. Classes and objects are very close to Modula-2 modules. Function overloading was first successfully introduced in Modula-2 only there it is called a 'Qualified import'... InOut.Write performs different from Terminal.Write. Remember, Dr Maurer ported X11 to mocka... And mocka is neither OO nor class oriented. It's just a PIM3 compiler.
Gour
2015-08-09 06:49:27 UTC
Permalink
Post by j***@gmail.com
Question: do you need the GUI bindings?
Yes.
Post by j***@gmail.com
You could create a front-end in Tcl/Tk that totally relies on a bunch
of Modula-2 programs. I did something similar in
http://fruttenboel.verhoeven272.nl/Prog/chall2.html where the IOrd2
program is called by the Tcl/Tk program.
You would just use the Tcl/Tk program for handling the buttons and let
Modula-2 take care of the (inter)actions at lightning speed.
teaching an old dog some new tricks is easier than genetically
re-engineering a new dog.
And again: take a look at my ultra simple x11 module. It can be
extended but not by me.
Well, I believe I’ll continue watching this space if something happens
with R10 in the future, but for now I’ll focus on FPC and its GUI
options simply not having time to build ecosystem myself and/or play
with things which are not actively developed/maintained.

For the similar reasons I gave up on languages which belong to stronger
communites than the Modula-2 one.


Sincerely,
Gour

--
j***@gmail.com
2015-08-10 19:57:59 UTC
Permalink
Have you considered using web interface instead of textmode GUI interface? If you create a webbased interface, you have a cross platform solution. It will work in Win, Lin, Mac, Android, smartphone, whatever.
Gour
2015-08-12 05:50:00 UTC
Permalink
Post by j***@gmail.com
Have you considered using web interface instead of textmode GUI
interface? If you create a webbased interface, you have a cross
platform solution. It will work in Win, Lin, Mac, Android, smartphone,
whatever.
I did and was advised several times, but I simply do not like it,
neither believe the techology is appropriate or good-enough for my
needs.

Moreover, I do not see how web interface would help me using Modula-2?


Sincerely,
Gour
--
One who sees inaction in action, and action in inaction,
is intelligent among men, and he is in the transcendental position,
although engaged in all sorts of activities.
j***@gmail.com
2015-08-12 08:26:08 UTC
Permalink
Post by Gour
Moreover, I do not see how web interface would help me using Modula-2?
You will program for the CGI (Common Gateway Interface) where your compiled program will create HTML source on the fly. Some examples: http://fruttenboel.verhoeven272.nl/cgi/

It will open up the gates for you to use ANYTHING that can be done in a webpage. Just like when you use JavaScript. With one difference: lightning speed, meaning less server load meaning a better climate.
Gour
2015-08-12 09:23:14 UTC
Permalink
Post by j***@gmail.com
You will program for the CGI (Common Gateway Interface) where your
http://fruttenboel.verhoeven272.nl/cgi/
That’s OK for simple scripts, but what about widget set which can
replace desktop GUI toolkit?


Sincerely,
Gour
--
One is understood to be in full knowledge whose every endeavor
is devoid of desire for sense gratification.
Gour
2015-08-12 11:58:59 UTC
Permalink
Post by j***@gmail.com
It will open up the gates for you to use ANYTHING that can be done in
lightning speed, meaning less server load meaning a better climate.
I’m not so easily giving up and still looking for possibility to use
finer/nicer language like Modula-2 (R10) than FPC…

By investigating GM2 site more thoroughly, I’ve stumbled upon this
slides (http://floppsie.comp.glam.ac.uk/Papers/paper20/talk.pdf) from
the talk about creating Python modules with Modula-2, so I wonder what
do you think about the following approach: using Modula-2 to write app+s
back-ed end in the forms of libraries used by GUI front-end coded
written in Python by one of it GUI bindings (wxPython, PyQt…)?

Is it “best of both worlds” considering current lack of bindings and/or
native GUI toolkit for Modula-2 or it’s simply ’bad combination’ by
which one loses type-safety of Modula-2 and not taking advantage of
Python’s features?


Sincerely,
Gour
--
Before giving up this present body, if one is able to tolerate
the urges of the material senses and check the force of desire and
anger, he is well situated and is happy in this world.
Marco van de Voort
2015-08-14 12:29:03 UTC
Permalink
Is it ???best of both worlds???
Or the worst? Needing two languages where only one is needed. Doing project
A in a mix that favours python, and then having to port and synchronize that
same code to Modula2 for a different project that favors M2. Ugh.
considering current lack of bindings and/or
native GUI toolkit for Modula-2 or it???s simply ???bad combination??? by
which one loses type-safety of Modula-2 and not taking advantage of
Python???s features?
If you need "Python's features", it sounds like you expect to use it more
than just the most minimal gui skeleton. Which is a bit strange when you
are jumping through hoops to stick with Modula-2.

Personally I'd rather move to C++ than use such patchy construct.
Gour
2015-08-14 12:48:39 UTC
Permalink
Post by Marco van de Voort
Or the worst? Needing two languages where only one is needed.
Well, there are no real GUIs for Modula-2…
Post by Marco van de Voort
Doing project A in a mix that favours python, and then having to port
and synchronize that same code to Modula2 for a different project that
favors M2. Ugh.
Python is favoured only due to having choice of GUIs to use, nothing
else.
Post by Marco van de Voort
If you need "Python's features", it sounds like you expect to use it more
than just the most minimal gui skeleton. Which is a bit strange when you
are jumping through hoops to stick with Modula-2.
No, Python would be used just for GUI, while back-end could be done in
M2.
Post by Marco van de Voort
Personally I'd rather move to C++ than use such patchy construct.
Heh, that’s something I’d like to avoide.

Otoh, I admit that it’s maybe better to accept that M2 is simply not up
to the task or writing GUI app *today*[1] and using FPC/Lazarus is maybe
compromised solution, but, at least, not so convoluted as other
’options’. :-)


Sincerely,
Gour

Footnotes:
[1] Dunno how M2 did behave in the past or what will be in the future
in regard.
--
One who restrains the senses of action but whose mind dwells on
sense objects certainly deludes himself and is called a pretender.
Marco van de Voort
2015-08-14 13:47:17 UTC
Permalink
Post by Marco van de Voort
Or the worst? Needing two languages where only one is needed.
Well, there are no real GUIs for Modula-2???
Yes. But if I were in your shoes I wouldn't consider constructs like with
foreign an option.

It does touch a pet thoughtexperiment of mine though, bindings for M2 might
be easier generated by parsing other languages' bindings than from the
original C headers.

Some ambiguity and a more wirthian compatible philosohpy have already been
fixed, and hopefully most remaining issues might be resolved in either the
converter in combination with an exceptions. The automated conversion
option also would take care of updates.

I was thinking about FPC/Lazarus headers of course, but that is because I
know that best. Maybe something is doable from Python too.

There are some issues though, like FPC having 8 boolean types or so
(Wirthian (0=false 1=true rest=undefined), and C style (0=false true is not
false) in 4 sizes each).
Post by Marco van de Voort
Doing project A in a mix that favours python, and then having to port
and synchronize that same code to Modula2 for a different project that
favors M2. Ugh.
Python is favoured only due to having choice of GUIs to use, nothing
else.
So does nearly every other language that is not in the ultra obscure corner.
I don't really see anything special there. Maybe the existence of a bridge.
Post by Marco van de Voort
If you need "Python's features", it sounds like you expect to use it more
than just the most minimal gui skeleton. Which is a bit strange when you
are jumping through hoops to stick with Modula-2.
No, Python would be used just for GUI, while back-end could be done in
M2.
If that is the case, consider writing a generator to generate the UI from
templates or so, with glue python code included. If you start really coding
in it, you will face the pains of dual language projects (sometimes it is easier
to have logic close to GUI, sometimes not).
Post by Marco van de Voort
Personally I'd rather move to C++ than use such patchy construct.
Heh, that???s something I???d like to avoide.
Yes, but in this case the cure sounds worse than the disease to me. And then
I mean both Python, its interpreted nature, its deployment issues AND the
more general dual code angle.

To everyone his own of course, but that's how I feel about it.

It's different of course if you are in an environment with a lot of Python,
and you have to interface it anyway, but to chose it just because there is
sb that has interfaced it, and Python has gui bindings (and I assume it is
unproven that a gui that way is workable?). One might as well start
translation GTK++ headers to gm2.
Otoh, I admit that it???s maybe better to accept that M2 is simply not up
to the task or writing GUI app *today*[1] and using FPC/Lazarus is maybe
compromised solution, but, at least, not so convoluted as other
???options???. :-)
I'm biassed there, but I agree ;-) Still even if you don't choose
Lazarus I would avoid such constructs, since you will be the only one doing
such things.
Gour
2015-08-14 15:43:29 UTC
Permalink
Post by Marco van de Voort
Yes. But if I were in your shoes I wouldn't consider constructs like with
foreign an option.
What to do when there are non ative GUI options?
Post by Marco van de Voort
It does touch a pet thoughtexperiment of mine though, bindings for M2 might
be easier generated by parsing other languages' bindings than from the
original C headers.
That would be possibility, but it means that the burden of
creating/maintaining them would be solely on myself ’cause interest to
write GUI desktop apps in M2 is zero.
Post by Marco van de Voort
Some ambiguity and a more wirthian compatible philosohpy have already been
fixed, and hopefully most remaining issues might be resolved in either the
converter in combination with an exceptions. The automated conversion
option also would take care of updates.
I I can remember times when playing with Haskell’s c2hs tool…
Post by Marco van de Voort
I was thinking about FPC/Lazarus headers of course, but that is because I
know that best. Maybe something is doable from Python too.
Well, Python and it GUI are interested only because binding work is
finished or done by 3rd party. Otherwise, I do no consider at all to
write app the language without static typing.
Post by Marco van de Voort
There are some issues though, like FPC having 8 boolean types or so
(Wirthian (0=false 1=true rest=undefined), and C style (0=false true is not
false) in 4 sizes each).
Ohh, I haven’t encountered thme yet. :-)
Post by Marco van de Voort
So does nearly every other language that is not in the ultra obscure corner.
Well, most of the folks are today interested only for so called ’web
apps’.

The rest of those in static-typing-and-compiled-language camp are also
not much into providing GUI support (although e.g. recently I discovered
there is work on wxNim bindings by its main dev) - just check Ada, D,
Haskell, OCaml…

And even when GUI is option, then mostly only GTK which does not look
too good outside of Linux.

It seems that FPC/Lazarus folks are the only ones doing GUI apps!!
Post by Marco van de Voort
If that is the case, consider writing a generator to generate the UI
from templates or so, with glue python code included. If you start
really coding in it, you will face the pains of dual language projects
(sometimes it is easier to have logic close to GUI, sometimes not).
It’s convoluted like idea to e.g. call T cl/Tk from M2 code and it looks
to me that the advantage of productivity achieved by using M2 would melt
with some obscured solutions…
Post by Marco van de Voort
Yes, but in this case the cure sounds worse than the disease to me. And then
I mean both Python, its interpreted nature, its deployment issues AND the
more general dual code angle.
I did some more thinking and it really seems that Python is not good
idea along with M2.
Post by Marco van de Voort
To everyone his own of course, but that's how I feel about it.
I’m thankful for you input!
Post by Marco van de Voort
One might as well start translation GTK++ headers to gm2.
If I’d be (more) experienced with both Modula-2 & GM2 knowing that
e.g. GTK3 bindings can be generated in one-month-time and seeing some
life in M2, that would be path worthy to be explored. Here, of course,
I’m thinking to not provide just thin wrapper over C API, but to have
thick bindings using some of M2’s idioms and/or static-typing, ala Ada’s
GtkAda.
Post by Marco van de Voort
I'm biassed there, but I agree ;-)
No problem. I do expect to hear bias wherever I ask.

Let me ask you one thing considering you’re familiar with both FPC & M2:
what are the things you’re missing the most from M2 whne using
Object/FPC Pascal and how much does it matter when using Lazarus?


Sincerely,
Gour
--
In this endeavor there is no loss or diminution,
and a little advancement on this path can protect
one from the most dangerous type of fear.
Marco van de Voort
2015-08-15 11:27:57 UTC
Permalink
Post by Gour
Post by Marco van de Voort
Yes. But if I were in your shoes I wouldn't consider constructs like with
foreign an option.
What to do when there are non ative GUI options?
Create them or move on.
Post by Gour
That would be possibility, but it means that the burden of
creating/maintaining them would be solely on myself ???cause interest to
write GUI desktop apps in M2 is zero.
Post by Marco van de Voort
Some ambiguity and a more wirthian compatible philosohpy have already been
fixed, and hopefully most remaining issues might be resolved in either the
converter in combination with an exceptions. The automated conversion
option also would take care of updates.
I I can remember times when playing with Haskell???s c2hs tool???
Well the whole point is that C is a horrible language to convert from.
Converting from Pascal would be easier. Specially since the library to
actually parse the pascal and build a tree is already there. So generation
is left.

That doesn't mean that it is totally trivial though. Free Pascal is a
production compiler with many extensions and options, even more than e.g.
Topspeed Modula2 had. Many were added to actually be able to write headers
and/or interface COM. Finding a mapping to M2 each of those features will
be a challenge.

But the features used in headers directly mirror the C features, so those
challenges will also be there with the original headers.
Post by Gour
Post by Marco van de Voort
I was thinking about FPC/Lazarus headers of course, but that is because I
know that best. Maybe something is doable from Python too.
Well, Python and it GUI are interested only because binding work is
finished or done by 3rd party. Otherwise, I do no consider at all to
write app the language without static typing.
So is Pascal, so you will bridge Pascal from M2 and have fairly static typing?
Post by Gour
Post by Marco van de Voort
There are some issues though, like FPC having 8 boolean types or so
(Wirthian (0=false 1=true rest=undefined), and C style (0=false true is not
false) in 4 sizes each).
Ohh, I haven???t encountered thme yet. :-)
Or the count of stringtypes or types compatible to them? See

http://www.stack.nl/~marcov/delphistringtypes.txt

(though if you count that way, M2 has 4 string types too I guess, char,
literal, array of char and the same as open array variant)
Post by Gour
Post by Marco van de Voort
So does nearly every other language that is not in the ultra obscure corner.
Well, most of the folks are today interested only for so called ???web
apps???.
Depends on how you define "folks". But it is popular, but partially also
because the term is so broadly defined. Ranging from multibillion website
like Google to the amateur making what is actually a local app in a "web"
language (like javascript)
Post by Gour
The rest of those in static-typing-and-compiled-language camp are also
not much into providing GUI support (although e.g. recently I discovered
there is work on wxNim bindings by its main dev) - just check Ada, D,
Haskell, OCaml???
So, more freaks and ghouls :-)
Post by Gour
And even when GUI is option, then mostly only GTK which does not look
too good outside of Linux.
It seems that FPC/Lazarus folks are the only ones doing GUI apps!!
I think that mostly stems from the philosophy to build a production compiler
and to take compatibility and usability very seriously.
For the same reason there is also an integrated linker and assembler on
Windows. In the old days the smartlinking on Windows was horribly slow
otherwise. And having a legacy (read:Linux/Unix/POSIX philosophy and
technology) free compiler=library on Windows is of course a requirement for
taking the next step and applying that to GUI too.

But credit for the GUI part mainly goes to the lazarus team. It is hard
building on something for years and being ridiculed. They started in the
late nineties and it took to 2004-2005 to become usable.

On one side one would consider manpower (Pascal/Delphi is still a top 10-20
language, even more so 15-20 years ago), but on the other side there isn't
really that much of a flux. For a very large part the teams have the same
people as in 2005, and 70-80% goes back even to before 2000.

I have no real explanation for that.

Some other language do support native windows development, but drop back to
plain Windows API programming or with minimal OO layers over that. (e.g. I
monitor Free Basic too, and there wxwidgets is most popular followed by GTK
and several ownerdrawn and light OO wrappers over windows api)

With ownerdrawn I mean like "GUI" programs on dos, not something like fpgui
which takes the next step and builds a framework on top of that.
Post by Gour
Post by Marco van de Voort
If that is the case, consider writing a generator to generate the UI
from templates or so, with glue python code included. If you start
really coding in it, you will face the pains of dual language projects
(sometimes it is easier to have logic close to GUI, sometimes not).
It???s convoluted like idea to e.g. call T cl/Tk from M2 code and it looks
to me that the advantage of productivity achieved by using M2 would melt
with some obscured solutions???
I don't think there are productivity gains with M2 at all for GUI
development at the moment. The language gains, while true, are faint, and
outstripped by toolchain immaturity and incompleteness. Even Lazarus/FPC
struggles there relative to commercial offerings and even open source
offerings with money behind them.

I do a lot of embedded C programming, and if I want to use M2 somewhere then
it would be there. (if toolchains were there I mean).

The main weakness that M2 has relative to Pascal is IMHO the manual string
types. Yes it is pure and safe, but I found it to be horribly
counterproductive, and the resulting code often has unexpected string size
limits. Even C++ improved in that regard over M2.

But on the embedded targets that matters less than e.g. some target specific
enhancements (like bitaddressing etc). And M2 was developed as a Systems
language :_)
Post by Gour
Post by Marco van de Voort
To everyone his own of course, but that's how I feel about it.
I???m thankful for you input!
You are welcome. It is nice sometimes to discuss something else then
language purity.
Post by Gour
Post by Marco van de Voort
One might as well start translation GTK++ headers to gm2.
If I???d be (more) experienced with both Modula-2 & GM2 knowing that
e.g. GTK3 bindings can be generated in one-month-time and seeing some
life in M2, that would be path worthy to be explored. Here, of course,
I???m thinking to not provide just thin wrapper over C API, but to have
thick bindings using some of M2???s idioms and/or static-typing, ala Ada???s
GtkAda.
My experience there says if it isn't there now, it won't be there in a short
time.

The crux is simple: is M2 your everything, just join Gaius and help out
every way you can with M2. And be persistent. That's what we did with FPC
years ago, and look where we are now relative to similar projects back in
the day.

If not, don't let language determine everything and pick something that
fits your actual purpose. Based on all factors (language and its aspects,
toolchain maturity and library/gui) and reevaluate every few years.
Post by Gour
Post by Marco van de Voort
I'm biassed there, but I agree ;-)
No problem. I do expect to hear bias wherever I ask.
what are the things you???re missing the most from M2 whne using
Object/FPC Pascal and how much does it matter when using Lazarus?
As said mostly the control over (un)qualified import and export of
identifiers. Borland style Pascal only have "uses". I also missed some
topspeed specific features like the calling convention control it had
(assigning registers to parameters, more or less declaring custom
callingconvenntions).

The other thing I missed is end "functionname";. I can remember errors
flabbergasting me for short whiles going back to TP because they spilled
over procedure bounderies because of unbalanced blocks. I do have mixed
feelings about the need for repeating the procedure name there. Yes, it
maybe has utility in deeply nested function blocks, but I feel simply end
proc; or something would have sufficed.

The semicomma shenigans that is dangling else confused sometimes too, but
was less important. I stand by the M2 block structure decisions.

What I was relieved was to have a proper stringtype again. I realized that
writing M2 stringcode was simply too much work. (specially for the more
trial-and-error programmer I was back then). And also the case
insensitivity of Pascal felt like a blessing.

So while my heart is with M2, I always considered M2 always more refinement
then fundamental change over Pascal.

At least from the view of a programmer/user of it. From an educational
perpective, M2 is much better for a beginning student compiler builder.
Gour
2015-08-15 12:04:10 UTC
Permalink
Post by Marco van de Voort
Create them or move on.
Correct and that’s what I’ve decided. ;)
Post by Marco van de Voort
I think that mostly stems from the philosophy to build a production compiler
and to take compatibility and usability very seriously.
Indeed.

Today I was skimming over FPC - docs…serious work behind it!!
Post by Marco van de Voort
But credit for the GUI part mainly goes to the lazarus team. It is hard
building on something for years and being ridiculed.
I could imagine…lot of people are laughing at Pascal today, but it is
practical language…
Post by Marco van de Voort
On one side one would consider manpower (Pascal/Delphi is still a top 10-20
language, even more so 15-20 years ago), but on the other side there isn't
really that much of a flux. For a very large part the teams have the same
people as in 2005, and 70-80% goes back even to before 2000.
I have no real explanation for that.
Hmm…very strange. I’ll try to help as much as I can.

Btw, I see you’re behind FreeBSD port…tried several times to move to
Free/PC-BSD, but still have some issues and it always seems that it’s
more work to tweak than actually needed, so for now I’m settled on
Debian (testing).

However, it’s interesting to see development for Open/NetBSD as well.
Post by Marco van de Voort
Some other language do support native windows development, but drop back to
plain Windows API programming or with minimal OO layers over that. (e.g. I
monitor Free Basic too, and there wxwidgets is most popular followed by GTK
and several ownerdrawn and light OO wrappers over windows api)
wxWidgets seems to be almost one man show (VZ)… :-(
Post by Marco van de Voort
I don't think there are productivity gains with M2 at all for GUI
development at the moment. The language gains, while true, are faint, and
outstripped by toolchain immaturity and incompleteness.
Correct. Ecosystem is simply not there.
Post by Marco van de Voort
You are welcome. It is nice sometimes to discuss something else then
language purity.
:-)
Post by Marco van de Voort
The crux is simple: is M2 your everything, just join Gaius and help out
every way you can with M2. And be persistent.
Simply - it’s not since I do not have legacy code to think about and
that’s why I prefer to work within productive environment. I have enoug
of pioneering work, at least, when it comes to computing. :-)
Post by Marco van de Voort
If not, don't let language determine everything and pick something that
fits your actual purpose. Based on all factors (language and its aspects,
toolchain maturity and library/gui) and reevaluate every few years.
Sure. That’s what I wrote in previous message - if Modula-2 will get
some significant gain, then I’m sure that rewriting won’t be as painful
as it could be with some other options.
Post by Marco van de Voort
So while my heart is with M2, I always considered M2 always more refinement
then fundamental change over Pascal.
That’s good point, moreover if we consider that Object Pascal has added
lot of things to Pascal itself.

Thank you for elaborate answer and see you in FPC/Lazarus. ;)


Sincerely,
Gour
--
Whatever action a great man performs, common men follow. And
whatever standards he sets by exemplary acts, all the world pursues.
August Karlstrom
2015-08-15 16:27:11 UTC
Permalink
Let me ask you one thing considering you???re familiar with both
FPC & M2: what are the things you???re missing the most from M2
whne using Object/FPC Pascal and how much does it matter when using
Lazarus?
[...]
I do have mixed feelings about the need for repeating the procedure
name there. Yes, it maybe has utility in deeply nested function
blocks, but I feel simply end proc; or something would have
sufficed.
With this approach we cannot tell if a programmer forgot to end P or Q
in the following declaration sequence:

PROCEDURE P;

PROCEDURE Q;

END PROC;

However, with repeated procedure names it is obvious:

PROCEDURE P;

PROCEDURE Q;

END P;

An added bonus with the repeated name is also that you can always tell
which procedure is declared before a given procedure without having to
scroll up to the heading of the previous procedure.


-- August
trijezdci
2015-08-15 17:08:41 UTC
Permalink
Post by August Karlstrom
I do have mixed feelings about the need for repeating the procedure
name there. Yes, it maybe has utility in deeply nested function
blocks, but I feel simply end proc; or something would have
sufficed.
With this approach we cannot tell if a programmer forgot to end P or Q
PROCEDURE P;
PROCEDURE Q;
END PROC;
PROCEDURE P;
PROCEDURE Q;
END P;
I realise this is off-topic, but I wholeheartedly agree.

As a general rule of thumb, the more explicit a syntax, the less opportunity for ambiguity or misinterpretation and thereby the less opportunity for error.

Explicit rather than implicit is key to readability, maintainability, verifiability and ultimately reliability.

Consequently, this has been one of the guiding principles in our revision.

Examples:

TYPE Foo = OPAQUE;

instead of

TYPE Foo;
(* is something missing here or is it magic syntax? *)

TYPE INT = ALIAS OF INTEGER;

instead of

TYPE INT = INTEGER;
(* is it a derived type or an alias type? *)


TYPE Hours = [0..23] OF CARDINAL;

instead of

TYPE Hours = [0..23];
(* what is the base type? *)

PROCEDURE Foo ( VAR bar : CAST ARRAY OF OCTET );

instead of

PROCEDURE Foo ( VAR bar : ARRAY OF BYTE );
(* do you realise this is a hidden cast? *)

NEW immutable := { a, b, c };

instead of

NEW(foo); foo := { a, b, c };
(* how to enforce immutability? initialisation vs destructive write *)

COPY mutable := immutable;

instead of

foo := bar;
(* when is an assignment a deep or shallow copy? *)

etc etc etc

j***@gmail.com
2015-08-15 08:06:12 UTC
Permalink
Just use Tcl/Tk as your front-end, let ANY compiled language do the math and pump out the graphics with your own x11 implementation. Just borrow my x11 module for inspiration. It's not rocket science...

This topic is now close to 2 weeks old and in the same time you could have made the foreign module....

You are looking for a five legged horse with wings and a snorkel. It doesn't exist. Bolting on a set of eagle wings to a horse won't work. The snorkel may be able to be fixed but the horse will be too stupid to use it.

You may take a well endowed stallion for the horse so it looks like a five legged horse but it will in fact be a crippled normal horse.

You are setting out for the holy grail. But the grail does not exist despite some silly movies claiming the opposite. You have many options. But a Pegasus with a snorkel and an extra leg is not one of them.
Marco van de Voort
2015-08-15 11:28:55 UTC
Permalink
Post by j***@gmail.com
You are setting out for the holy grail.
I think he is looking for a cup and you are offering him a sieve :-)
Gour
2015-08-15 11:29:32 UTC
Permalink
Post by j***@gmail.com
You are setting out for the holy grail. But the grail does not exist
despite some silly movies claiming the opposite. You have many
options. But a Pegasus with a snorkel and an extra leg is not one of
them.
Well, maybe it’s not a holy grail, but FPC/Lazarus is very close. (Free)
Pascal is still invention by Niklaus Wirth, compiler is actively
developed, more than thousand pages of freely available documentation
available online for free, active forums/mailing_lists/IRC…everything
what is missing within Modula-2 community.

There is no question that M2 is better language, but today it is an
isolated island without community.

So, to close this topic - I’ll not any longer explore different,
sometimes strange/obscure possibilites to use M2 language to write
multi-platform open-source GUI apps, when FPC/Lazarus are used in
production today.

Of course, if/when something is going to change with M2 (R10), I’ll be
happy to consider it even if it achieves a fraction of FPC/Lazarus’
ecosystem completeness.

Thank you all for your input…lot of useful info and insight, but now let
me be more pragmatic…


Sincerely,
Gour
--
Whatever action a great man performs, common men follow. And
whatever standards he sets by exemplary acts, all the world pursues.
Pascal J. Bourguignon
2015-08-15 12:10:50 UTC
Permalink
Post by Gour
Post by j***@gmail.com
You are setting out for the holy grail. But the grail does not exist
despite some silly movies claiming the opposite. You have many
options. But a Pegasus with a snorkel and an extra leg is not one of
them.
Well, maybe it’s not a holy grail, but FPC/Lazarus is very close. (Free)
Pascal is still invention by Niklaus Wirth, compiler is actively
developed, more than thousand pages of freely available documentation
available online for free, active forums/mailing_lists/IRC…everything
what is missing within Modula-2 community.
There is no question that M2 is better language, but today it is an
isolated island without community.
So, to close this topic - I’ll not any longer explore different,
sometimes strange/obscure possibilites to use M2 language to write
multi-platform open-source GUI apps, when FPC/Lazarus are used in
production today.
Of course, if/when something is going to change with M2 (R10), I’ll be
happy to consider it even if it achieves a fraction of FPC/Lazarus’
ecosystem completeness.
Thank you all for your input…lot of useful info and insight, but now let
me be more pragmatic…
Don't be defeatist. People are starting to realize that C and C++ are
very bad programming languages, causing most important security bugs
around. Some will switch to controlled programming languages (lisp,
clojure, ruby, python), but those who still want to avoid run-time
typing, they might come to Modula-2, Modula-3 or Oberon.

http://schierlm.github.io/OberonEmulator/

As I said, there's asm.js and webassembly. Writing a Modula-2
webassembly backend would let you write Modula-2 programs in the
browser (therefore using the browser GUI, available everywhere).

So, very little might be needed to be done on the tools and libraries.
Adding a couple of killer applications would also help. The point here
is to actually write some useful application that users want to use.
Then, it will have to be maintained, and this will push programmers
toward Modula-2.

Also, in the case of Modula-2, you could write libraries usable in other
programming languages. For example, if you provided a bug-free ssl
library written in Modula-2, that would be 100 times shorter than the C
mess that openssl is, people would not hesitate to replace openssl with
it, and start maintain it in Modula-2. And so on.
--
__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
Gour
2015-08-15 12:29:43 UTC
Permalink
Post by Pascal J. Bourguignon
Don't be defeatist. People are starting to realize that C and C++ are
very bad programming languages, causing most important security bugs
around.
If you recall my previous messages, I did explicitly say that {C, C++,
Java} are in my set of excluded languages, so I’m aware of it.
Post by Pascal J. Bourguignon
Some will switch to controlled programming languages (lisp, clojure,
ruby, python),
I explored those as well (e.g. Racket, Python), but prefer static-typing
and native code.
Post by Pascal J. Bourguignon
but those who still want to avoid run-time typing, they might come to
Modula-2, Modula-3 or Oberon.
I’d say that the remaining number of M2/M3/Oberon users are simply too
scattered instead of focusing on one thing, maybe R10 and do something
together.
Post by Pascal J. Bourguignon
As I said, there's asm.js and webassembly. Writing a Modula-2
webassembly backend would let you write Modula-2 programs in the
browser (therefore using the browser GUI, available everywhere).
I am against using browser to render my output and do not like web
technology.
Post by Pascal J. Bourguignon
So, very little might be needed to be done on the tools and libraries.
I agree, but community has to come together first.
Post by Pascal J. Bourguignon
Adding a couple of killer applications would also help. The point here
is to actually write some useful application that users want to use.
My primarily interest is hobby project for niche market.
Post by Pascal J. Bourguignon
Then, it will have to be maintained, and this will push programmers
toward Modula-2.
It sounds good, let’s see what will happen with R10…
Post by Pascal J. Bourguignon
Also, in the case of Modula-2, you could write libraries usable in other
programming languages. For example, if you provided a bug-free ssl
library written in Modula-2, that would be 100 times shorter than the C
mess that openssl is, people would not hesitate to replace openssl with
it, and start maintain it in Modula-2. And so on.
If I’d be younger and with much more free time, I’d consider spending
time on such projects, but now need something which is simply useful and
can be used in production.

Just check the number of posts here - rsutc with its FAQ post is the
most frequent poster. :-)


Sincerely,
Gour
--
Not by merely abstaining from work can one achieve freedom
from reaction, nor by renunciation alone can one attain perfection.
trijezdci
2015-08-15 12:50:06 UTC
Permalink
I do not often agree with Jan or the strong language he tends to use, but in the case of his post below, I can only laugh at the colourful language and funny metaphors and wholeheartedly agree with the message.

:-D
Post by j***@gmail.com
Just use Tcl/Tk as your front-end, let ANY compiled language do the math and pump out the graphics with your own x11 implementation. Just borrow my x11 module for inspiration. It's not rocket science...
This topic is now close to 2 weeks old and in the same time you could have made the foreign module....
You are looking for a five legged horse with wings and a snorkel. It doesn't exist. Bolting on a set of eagle wings to a horse won't work. The snorkel may be able to be fixed but the horse will be too stupid to use it.
You may take a well endowed stallion for the horse so it looks like a five legged horse but it will in fact be a crippled normal horse.
You are setting out for the holy grail. But the grail does not exist despite some silly movies claiming the opposite. You have many options. But a Pegasus with a snorkel and an extra leg is not one of them.
Loading...