modula3 / cm3

Critical Mass Modula-3
http://modula3.github.io/cm3/
Other
133 stars 25 forks source link

Update the Qt headers to match modern Qt #1066

Closed ghost closed 2 years ago

ghost commented 2 years ago

As it seems they target Qt4. Qt4 has long EOL-ed. It's now the era of Qt5 and Qt6.

mikanystrom commented 2 years ago

Boehm's GC is closely related to the M3 GC.

Boehm's co-author was at PARC, and a lot of the M3 people came from PARC, so it's likely that both Boehm's GC and Modula-3's GC were based to some extent on Cedar's GC. Bringing in Cedar's GC was one of the big improvements over M2. 35 years ago...

I don't know if Boehm GC is still stop-and-copy (I don't code much C these days), but the M3 collector is concurrent and incremental, following the Dijkstra-Lamport-Martin paper with lots of enhancements.

Links:

https://hboehm.info/spe_gc_paper/preprint.pdf

https://lamport.azurewebsites.net/pubs/garbage.pdf

http://www.bitsavers.org/pdf/xerox/parc/techReports/CSL-84-7_On_Adding_Garbage_Collection_and_Runtime_Types_to_a_Strongly-Typed_Statically-Checked_Concurrent_Language.pdf

http://www.bitsavers.org/pdf/dec/tech_reports/SRC-RR-64.pdf

Obviously Modula-3 is a much friendlier language environment for a GC....

On Fri, Sep 16, 2022 at 4:58 PM jpgpng @.***> wrote:

Reference counting is fairly limited compared to "real" garbage collection...

BTW I always wanted to ask you how our GC compared to Boehm-GC? Most Oberon impl I know all use Boehm-GC.

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1066#issuecomment-1249943883, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKYNJL2BHI4XLWJHJ36QRDV6UCTLANCNFSM6AAAAAAQHSMZNM . You are receiving this because you were mentioned.Message ID: @.***>

mikanystrom commented 2 years ago

jpgpng:

I'm not sure who you are responding to, but you seem to be emailing me...? I didn't say any of that. I am not sure who "you" is in your emails. Certainly not me.

To each his own!

Personally, I find GC is absolutely necessary for the kind of work I do, when you write programs with complicated, dynamic data structures. Actually, it was the reason I got into M3 in the first place, that it's a safe language like Java (but much, much tidier). On the other hand, I have absolutely no interest in GUIs, I find they just get in the way of getting things done. On the "third" hand, the fact that M3 is GC'd and simple enough to be easily parsed, makes it possible to do things like write the Scheme interpreter that I use as an interface on many or most of the M3 programs I write these days. (In Java you can do similar things with reflection, but that requires that you have, well, reflection..!)

But sure, Modula-3 is definitely not for everyone. If you want GUIs (and don't like Trestle :-)), "standard" OOP, or just want to call other people's libraries (which are rarely written in M3), then it probably makes sense to look elsewhere.

 Mika

On Fri, Sep 16, 2022 at 5:10 PM jpgpng @.***> wrote:

Delphi ( and FPC / Lasarus) don't have Garbage Collector.If You want try Oberon family language then see on Active Oberon, please.

IMO it's about the syntax and the language that is limited, it's nothing to do with it's being GC-ed or not. I personally liked the Delphi syntax for OOP more. It's closer to C#/C++/Java, with construtors, destructors, classes,... what I'm already familiar with as I learned Java on University days. Another point about language limitation, Delphi has function overloading. So far I don't know any Modula/Oberon dialects have this. Because of that on Modula/Oberon world we have the mess called WriteCard, WriteInt, WriteReal,... and PutInt, PutReal,... when on Delphi there is only need just one overloaded function for all of these things.

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1066#issuecomment-1249948339, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKYNJI2P5GRP7Q5QAH76HTV6UD67ANCNFSM6AAAAAAQHSMZNM . You are receiving this because you were mentioned.Message ID: @.***>

mikanystrom commented 2 years ago

Rodney wrote: I have often thought about picking, say, gcc's, implementation of C++ and its representations and ABI, putting knowledge thereof into Cm3, so the dynamic typing can be preserved both ways across a binding. This is a big job. Has anything like it been done elsewhere?

The Scheme interpreter under m3scheme does something vaguely similar, but uses Modula-3's representation as canonical. Of course it's an interpreted environment where I had complete freedom of design. Unfortunately, I think there are pieces missing. I am trying to get the right approvals at the office to spend some paid time cleaning this stuff up.

Mika

On Wed, Sep 14, 2022 at 9:49 AM Rodney M. Bates @.***> wrote:

On 9/14/22 04:57, jpgpng wrote:

About C libraries should be preferred, I don't really agree. C libraries are too low level that it's very difficult to use on M3 (and M2, too!). For example, they are using char in many places in their libraries. On M3 (and M2, too!), char can only be mapped to ADDRESS (which is a generic pointer type like void* on C I think?). Using C libraries with M3 (and M2, too!) is not safe at all IMO.

Well, there is no way to make inter-language bindings for any language pair type-safe by any reasonable definition, without resorting to a single compiler that is partially multi-language itself. It would have to know the high level-semantics of the types in both languages, the machine-level representations in both languages, and the ABI of both. Moreover, for the latter two, the word "language" would have to actually mean language plus compiler, since different compilers for the same langauge can use different representations and ABIs.

The likely representations used by a typical C compiler are usually fairly obvious, which makes C bindings relatively simple. But the representations and ABI for C++ dispatching virtual member functions (object type methods in Modula-3) are very much more complicated. And you sometimes really want to use these in a binding to C++ code.

This shows up in the bindings to LLVM's tree-building machinery, as used in Modula-3's LLVM backend. LLVM's developers have provided bindings in C to some of this. But by going through C, they completely lose the dynamically-typed pointers in LLVM, which are very extensively used. This makes the binding process really messy and a lot more unsafe, if you will grant me the iffy concept of degrees of unsafety.

I have often thought about picking, say, gcc's, implementation of C++ and its representations and ABI, putting knowledge thereof into Cm3, so the dynamic typing can be preserved both ways across a binding. This is a big job. Has anything like it been done elsewhere?

LLVM's developers are always keen to make earliest-possible, maximum use of C++'s ever widening ambiguities and semantic gaps between what something syntactically looks like and what it actually means. So this could be an exceptionally difficult moving target.

— Reply to this email directly, view it on GitHub < https://github.com/modula3/cm3/issues/1066#issuecomment-1246523820>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABSVZNC7DBLP53BSVWP467TV6GOPJANCNFSM6AAAAAAQHSMZNM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1066#issuecomment-1247042478, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKYNJPEBHFKAYMKLQGS3L3V6H6YHANCNFSM6AAAAAAQHSMZNM . You are receiving this because you were mentioned.Message ID: @.***>

jpgpng commented 2 years ago

jpgpng: I'm not sure who you are responding to, but you seem to be emailing me...? I didn't say any of that. I am not sure who "you" is in your emails. Certainly not me.

To Victor, not you. I'm using Github web interface (kind of a forum) and you are replying via emails (kind of a mailing lists). On Github web when you quote someone it seems there is no way to tell who you quoted. It only cares about the quoted text not who is the one posted it I think.

jpgpng commented 2 years ago

The Scheme interpreter under m3scheme does something vaguely similar, but uses Modula-3's representation as canonical. Of course it's an interpreted environment where I had complete freedom of design. Unfortunately, I think there are pieces missing.

It seems CM3 has two interpreters: one is your Scheme interpreter one is a TCL interpreter isn't it?

https://github.com/modula3/cm3/tree/master/m3-libs/tcl

jpgpng commented 2 years ago

Update:

https://github.com/modula3/cm3/tree/master/m3-libs/m3lua

https://github.com/modula3/cm3/tree/master/m3-libs/slisp

So far, there are Scheme, SLisp, TCL and Lua. Impressive.

VictorMiasnikov commented 2 years ago

2022-09-19: May be delete this test post / msg. ?.. 2022-09-18:

17.09.2022, 03:35, "Mika Nyström" @.***>: I'm not sure who you are responding to, but you seem to be emailing me...?

There is test message.  I send it by e-mail 

Best regards, Victor Miasnikov 

17.09.2022, 03:35, "Mika Nyström" @.***>: jpgpng:

I'm not sure who you are responding to, but you seem to be emailing me...? I didn't say any of that. I am not sure who "you" is in your emails. Certainly not me.

To each his own!

Personally, I find GC is absolutely necessary for the kind of work I do, when you write programs with complicated, dynamic data structures. Actually, it was the reason I got into M3 in the first place, that it's a safe language like Java (but much, much tidier). On the other hand, I have absolutely no interest in GUIs, I find they just get in the way of getting things done. On the "third" hand, the fact that M3 is GC'd and simple enough to be easily parsed, makes it possible to do things like write the Scheme interpreter that I use as an interface on many or most of the M3 programs I write these days. (In Java you can do similar things with reflection, but that requires that you have, well, reflection..!)

But sure, Modula-3 is definitely not for everyone. If you want GUIs (and don't like Trestle :-)), "standard" OOP, or just want to call other people's libraries (which are rarely written in M3), then it probably makes sense to look elsewhere.

 Mika

On Fri, Sep 16, 2022 at 5:10 PM jpgpng @.***> wrote:

Delphi ( and FPC / Lasarus) don't have Garbage Collector.If You want try Oberon family language then see on Active Oberon, please.

IMO it's about the syntax and the language that is limited, it's nothing to do with it's being GC-ed or not. I personally liked the Delphi syntax for OOP more. It's closer to C#/C++/Java, with construtors, destructors, classes,... what I'm already familiar with as I learned Java on University days. Another point about language limitation, Delphi has function overloading. So far I don't know any Modula/Oberon dialects have this. Because of that on Modula/Oberon world we have the mess called WriteCard, WriteInt, WriteReal,... and PutInt, PutReal,... when on Delphi there is only need just one overloaded function for all of these things.

VictorMiasnikov commented 2 years ago

17.09.2022, 02:58, "jpgpng" @.***>: Reference counting is fairly limited compared to "real" garbage collection... BTW I always wanted to ask you how our GC compared to Boehm-GC? Most Oberon impl I know all use Boehm-GC.

Both Modula-3 and Active Oberon use a "good Garbage Collector".

AO , looks like, have more advanced GC. Because AO doesn't have interoperability with C language.

P.S.

There is exist theory, that M3 have half-conservative GC, because stack is processing by conservative style.

VictorMiasnikov commented 2 years ago

} I found you have the habit to ignore other's arguments.

Absolutely there is not ignoring!

I need additional information for prepare detailed answer.

Output of m3swig should be { input for m3pp}.

On step N+1 output of m3pp stay(?) be { .i3 files}.

.i3 files used on step N+2 as "INTERFACE MODULE" for external library.

I ( V.V.M.) am not shue that You ( You eq jpgpng ) do all this.

17.09.2022, 03:04, "jpgpng" @.***>:

} m3swig can not generate human readable code.Are You run pretty print m3pp?P.S.Try convert by m3swig LLVM 9.0.1Or LLVM 10.0.1 headers. And compare results with my or demoitem.My LLVM10 / LLVMv10 public as pool request. After this convert QT 4.8.7 headers.And use this binding.

I don't want to argue with you as I found you have the habit to ignore other's arguments. I will only tell you that with these tools you have an almost 1-1 very clean and compact mapping of the original C headers, no additional source files/headers are added and absolutely no Swig* types mess. Swig is about wrapping C++. These tools are specific to wrap plain C. Let it be clear.

jpgpng commented 2 years ago

Well, you edited your message on github web @VictorMiasnikov so they are a bit better now. Your new email client is not any better than the old one you used to use I afraid.

VictorMiasnikov commented 2 years ago

Well, you edited your message on github web @VictorMiasnikov so they are a bit better now. Your new email client is not any better than the old one you used to use I afraid.

I always say that Github engine's broken my "HTML formated" e-mail messages...

P.S. This is "non-email way" test

jpgpng commented 2 years ago

BTW, I decided to give a try to Ada and Eiffel. Goodbye everyone.

Update: sorry Victor, didn't see your message above.

VictorMiasnikov commented 2 years ago

3oheicrw }} To anyone interested. For Qt (and the FOX Toolkit too), you have to wait for @demoitem's CppBind adventure. 3oheicrw }} If you want C based GUI libraries bindings, you could try porting these Pascal bindings of them to Modula 3. 3oheicrw }} But I will not do it for you. Keep that in mind. 3oheicrw }} 3oheicrw }} https://github.com/3oheicrw/dwindows-win32-pascal 3oheicrw }} 3oheicrw }} https://github.com/ruanjiaxing/iup_pascal 3oheicrw }} 3oheicrw }} https://github.com/ruanjiaxing/iup-fpc 3oheicrw }} 3oheicrw }} This library needs a more complete Windows API headers that Modula 3 currently lacks: 3oheicrw }} 3oheicrw }} https://github.com/3oheicrw/SGL-Pascal 3oheicrw }} 3oheicrw }} This is the original C library: https://github.com/3oheicrw/SGL

Thank! I going to download ( for reading source code in Far Manager, etc. )

VictorMiasnikov commented 2 years ago

BTW, I decided to give a try to Ada and Eiffel. Goodbye everyone.

Please, do not "kill" GitHub account: we already have 1 Ghost.

( and we have second ghost "at global scope" as ex. account of Eric S. )

VictorMiasnikov commented 2 years ago

( . . .) Goodbye everyone.

Ok...

Update: sorry Victor, didn't see your message above.

It's not be a problem -)

Problem is style of naming of "killed acounts"

jpgpng commented 2 years ago

BTW, I decided to give a try to Ada and Eiffel. Goodbye everyone.

Please, do not "kill" GitHub account: we already have 1 Ghost.

( and second ghost as ex. account of Eric S. )

I do not have the habit of deleting github account :smile:

VictorMiasnikov commented 2 years ago

BTW, I decided to give a try to Ada and Eiffel. Goodbye everyone.

Please, do not "kill" GitHub account: we already have 1 Ghost. ( and second ghost as ex. account of Eric S. )

I do not have the habit of deleting github account 😄

Thank You!

VictorMiasnikov commented 2 years ago

} There are plenty of awesome programming languages ( . . .) And?.. ( if list doesn't contain M3 and ( or) Active Oberon then it is simply wrong)

P.S. 2022-09-20: List is relative good, but I don't understand "how it made" / "principles of creating"

19.09.2022, 18:39, "3oheicrw" @.***>: There are plenty of awesome programming languages to choose from! https://github.com/ChessMax/awesome-programming-languages

jpgpng commented 2 years ago

And?..( if list doesn't contain M3 and ( or) Active Oberon is simply wrong

Or because M3 and Active Oberon are boring and not awesome? :smile:

jpgpng commented 2 years ago

BTW, don't take this as serious. You could submit a bug report asking them to add M3 and Active Oberon to the list :smile:

jpgpng commented 2 years ago

I'm currently messing with Vector Pascal. The approach to generics is very similar to M3 even though the syntax is Turbo Pascal/Delphi based.

http://www.dcs.gla.ac.uk/~wpc/reports/compilers/compilerindex/x25.html

jpgpng commented 2 years ago

The latest endeavor is with PascalABC.NET but it seems I don't want to depend on .NET, so I came back.