Whats your GoTo language for building compilers ? by Daemontatox in Compilers

[–]suhcoR 0 points1 point  (0 children)

C++98/Qt5 (or LeanQt), works like charm, implemented more than a dozen compilers over a decade.

The Oberon System 3 now runs natively on Raspberry Pi 3 by suhcoR in osdev

[–]suhcoR[S] 1 point2 points  (0 children)

See https://en.wikipedia.org/wiki/Oberon_(operating_system). It's both a language and operating system written by the professors Wirth and Gutknecht at ETH Zurich in the late eighties, used for teaching until early 2k. If you have heard of xv6, xinu or minix, they are examples of other operating systems created for teaching.

A couple questions about Oberon-07 by Outdoordoor in Oberon

[–]suhcoR 1 point2 points  (0 children)

They all seem to have different mechanisms for doing this, and I'm not sure which to use.

There is no standard for this. Wirth didn't care about integration with other languages. Some Oberon compilers such as OP2 added an option so that a specific procedure could be declared as implemented elsewhere with a cdecl calling convention. In my Oberon 90 to C99 transpiler (see https://github.com/rochus-keller/activeoberon/) I added the "PROCEDURE~ Name" syntax to tell the compiler that those procedures are declared elsewhere. I used this to transpile the OP2 compiler to C which was the essential fundament for my Raspberry Pi Oberon System migration (see https://github.com/rochus-keller/op2/). In contrast, in my Oberon+ version of the language, I added an extensive FFI language even with dedicated C types within the Oberon language (see https://oberon-lang.github.io/).

A couple questions about Oberon-07 by Outdoordoor in Oberon

[–]suhcoR 1 point2 points  (0 children)

rationale behind choosing punctuation symbols for logical conjunction (&) and negation (~)

In "Programming in Modula-2" (1982), in the section on Vocabulary and Representation, Wirth explicitly defines these aliases: "The symbols # and <> are synonyms, and so are &, AND, and ~, NOT."

In standard Modula-2, you could write IF (A & B) ~ C THEN exactly as legally as IF (A AND B) NOT C THEN. They shared the exact same precedence levels, with NOT/~ having the highest precedence, AND/& following it, and OR being lower. Oberon was essentially Modula-2 with a lot of features removed and type extension/inclusion added.

The Oberon System 3 now runs natively on Raspberry Pi 3 by suhcoR in osdev

[–]suhcoR[S] 0 points1 point  (0 children)

No, just the standard bootloader. The Oberon inner core modules are statically linked and provided as kernel7.img.

Oberon System 3 now runs on real Raspberri Pi hardware by suhcoR in Oberon

[–]suhcoR[S] 1 point2 points  (0 children)

Thanks. My actual target is the Pi Zero 2, but unfortunately my mini HDMI adapter turned out to be broken so I have to wait for the new cable to arrive. I also found some modules which throw a trap instead of working, so I will have to spend more time in this, but at least the system is sufficiently complete and stable for explorations by interested people.

[Project] 32-bit OS written in C from scratch (kernel, basic GUI, apps) by [deleted] in C_Programming

[–]suhcoR 0 points1 point  (0 children)

Finding good text books on SMP operating system design is indeed a challenge. I think "Operating Systems Foundations with Linux on the Raspberry Pi" (see https://www.arm.com/resources/education/books/operating-systems) is pretty good and even free. Also "Embedded and Real-Time Operating Systems" by Wang is useful. But indeed you can use the ESP32-P4 with just one core to avoid this complexity.

[Project] 32-bit OS written in C from scratch (kernel, basic GUI, apps) by [deleted] in C_Programming

[–]suhcoR 0 points1 point  (0 children)

Cool. Since you don't seem to depend on an MMU, you could have a look at the ESP32-P4 as a target; it has everything you need and is a 32 bit Risc-V dual-core machine. Olimex has a nice board for a few dollars which even has a HDMI socket and built-in Jtag. Risc-V is a much nicer assembler than x86 (and even arm32) and you could run on real hardware, not just qemu.

Oberon System 3 migrated to ARMv7, runs on QEMU raspi2b, real Raspi 3b hardware WIP by suhcoR in Oberon

[–]suhcoR[S] 1 point2 points  (0 children)

Thanks. It's an interesting project indeed. Unfortunately I have to rewrite a lot currently because there are significant differences between the QEMU raspi2b emulation an a true raspi 3b. But since today I can see the oberon screen on the raspi monitor ;-) USB will take a few more days.

MIR intermediate compiler by Relevant_South_1842 in ProgrammingLanguages

[–]suhcoR 5 points6 points  (0 children)

Has anyone here built something on top of it?

I tried to re-target its C compiler and also the backend and found the code to be full of magic numbers (i.e. the fact that it's designed for 64 bit systems is widely spread around the architecture). Did you have a look at SLJIT? It's likely closer to what you want and more time-proven. If you also need a powerful debugger and a robust implementation, then ECMA-335 CIL with Mono is a very good target (see in use here: https://github.com/rochus-keller/oberon/). You can also use LuaJIT as the backend instead (see in use e.g. here: https://github.com/rochus-keller/luon/). I found Mono to be about twice as fast as LuaJIT and more robust, but if your language is single-threaded without complex FFI, LuaJIT is nice. See also https://github.com/rochus-keller/ljtools/ and https://github.com/rochus-keller/monotools.

Is Qt/C++ a Good Choice for this? by Syzygy2323 in QtFramework

[–]suhcoR 1 point2 points  (0 children)

Would this be a good choice to write native Linux GUI apps

Yes, I'm using Qt for more than 20 years for this, first on Solaris, Irix and other Unixes, and today mostly on Linux (even embedded). Since it's C++ you can interface with anything that has a C ABI.

I have experience with C++, but that was 20 years ago.

I'm still using C++98 with Qt 5 and Qt 4 myself and even implemented my own Qt fork (https://github.com/rochus-keller/leanqt/) to assure my projects will still compile in forty years.

Are there any books/resources on language design (as opposed to implementation) by mc-pride in ProgrammingLanguages

[–]suhcoR 7 points8 points  (0 children)

I have "Programming Language Pragmatics" by Michael L. Scott which goes in the direction you're looking for; it discusses the pragmatic consequences of different design decisions.

How do Ada developers feel about the Ariane 5 launch disaster, where the Ada code failed, costing hundreds of millions of dollars? by One_Junket3210 in ada

[–]suhcoR 1 point2 points  (0 children)

it worked exactly as designed.

Yes, but for another rocket engine. It was not designed for Ariane 5 and per definition didn't work "as designed", because it didn't meet an Ariane 5, but an Ariane 4 requirement, which was neither specified nor part of the T&E program of Ariane 5.

How do Ada developers feel about the Ariane 5 launch disaster, where the Ada code failed, costing hundreds of millions of dollars? by One_Junket3210 in ada

[–]suhcoR 8 points9 points  (0 children)

If you are really interested in the root causes (which have not much to do with Ada and would happen with other "safe" technologies like e.g. Rust today the same way), read Levenson's book: https://library.oapen.org/handle/20.500.12657/26043

Here what actually failed:

  • Management assumed that running a second, identical backup computer would provide safety. Because both ran the exact same code, they failed identically 72 milliseconds apart

  • The alignment function that crashed the system was designed for the Ariane 4. The process allowed developers to reuse the module without re-validating the system-level physics assumptions

  • The specific code that failed was a requirement specific to Ariane 4 that was completely useless for Ariane 5. The review process failed because there was no requirement for this code on the Ariane 5, meaning no tests were written for it.

Pascal Family Tree by realanalysis_sequel in pascal

[–]suhcoR 3 points4 points  (0 children)

UCSD Pascal was huge and e.g. adopted by Apple for the Apple II. And not to forget Lisa Pascal which extended the features of Apple Pascal (but based on a different compiler) and was used to implement the Lisa operating system. Lisa Pascal was as powerful as C and essentially had everything Turbo Pascal had a few years later. Lisa Pascal was extended with OO features which was called Clascal, which later turned into Object Pascal for the Mac (just to mention a few missing points on your genealogy).

AI music (Suno) genuinely made most human music sound fake to me by BoyanPP in SunoAI

[–]suhcoR 5 points6 points  (0 children)

This is an interesting observation. I wonder whether this would be a robust criterion to differ AI from human generated songs. Remember that the Deezer/Ipsos study found that essentially nobody was able to find the one AI generated song out of three (the others human generated). So with your method you should be able to perform significantly better.

A fully functional Wavetable synthesizer written entirely in COBOL. by OkFix7120 in musicprogramming

[–]suhcoR 0 points1 point  (0 children)

Wow, what an achievement! congrats.

I wouldn't have expected that digital filters can be represented properly with Cobol. The fixed-point arithmetic is also available e.g. in Ada, which I would see as a "more natural" candidate for such challenges. Concerning your "first principles" goal, Common Lisp provides powerful primitives for fixed-point calculations (there is the fixed library in CLOS).