This is likely to be moved to "Other" by a moderator.
Sorry if I was a bit brutal earlier, I was intentionally goading you.
Quoting selectively:
My end goal is to create a system that runs on modern hardware that can produce text-based programs that run on modern and retro hardware. ...
The main target audience for this system would be those who own retro 8-bit home computers or use emulators for them (possibly because they no longer own such machines).
Interpreters were common for these devices and compilers were much less so. Including one with the front end of the system seems natural, especially if the process for translating and compiling the code has several stages.
BASIC would have been the most commonly used language on these retro machines, as it was inluded with most of them. Pascal and C compilers were available, but much less widely used.
HiSoft sold versions of BASIC, Pascal and C, for example.
If you owned a Z80 machine with a disk drive (rare in the UK), you could use more languages via CP/M. I'm reasonably sure that this was how Turbo Pascal was made available for 8-bit micros.
I think that a sufficient proportion of retro users cut their teeth on BASIC machines such as the Spectrum and BBC Micro that selling any other language would be quite a job /unless/ it was as well integrated as the original Turbo Pascal. And for similar reasons that makes using a PC-hosted cross-compiler unrealistic, /unless/ you produced an entire product range of physical and emulated micros with some sort of "tube" arrangement to the host for program download (precedent:
https://hackaday.io/Just4Fun for a recently-designed range of boards from the same stable, plus the Arduino IDE (which I'm sure you're aware supports multiple targets) for a way of developing using a slightly-cut-down C++ and downloading over a USB serial link).
I was, for a long time, an outspoken critic of BASIC and C. But the truth is that both language families have inherited a lot of features from Pascal and its successor Modula-2, notably strong type checking and the extension of that across compilation units. And even if BASIC is now, like just about everything else, compiled, the retro community still yearns for something with the immediate response of the classical implementations... I won't go on, you probably know that better than I do.
The only other things that give you that kind of immediacy are environments such as Lisp, Forth or Smalltalk... and quite frankly I think they're non-starters for what you're trying to do. There was at one time an incrementally-compiled Pascal called Mystic Pascal, I think I saw one copy sold and that it ended up on magazine-cover collections.
These days, there are far more people who know how to write a half-decent compiler than there were in the '80s. Unfortunately, they are intent on doing it "properly" by the standard of their computer science courses, and... well, even if they insist that they're using all the right techniques don't expect the result to be compact.
I'm pretty sure that you will not get FPC running on an 8-bit system. I've been trying during the day to remember whether Turbo Pascal on a CP/M-80 system actually switched between editor and compiler using an overlay... without success although I'd throw in that the much later VB for DOS did.
My suspicion is that it's easier to write a Pascal compiler than a BASIC one: recursive descent is adequate, and generally speaking it's possible to avoid having to consider the sort of hoops discussed in the well-regarded
https://moam.info/writing-interactive-compilers-and-interpreters-pj-wiley-online-library_59b149bf1723ddd7c686d281.htmlHowever, you need to consider two things: (a) do you need the level of immediacy that only BASIC really gives you and (b) if you decide to use Pascal are you prepared to stick to the language handled by the early versions (short strings, no try-finally construct, no exceptions, no objects and so on).
Oh, and I knew Hisoft and Dave Nutkins fairly well, as well as some of the people who wrote stuff for them.
The upshot of this is, that more users would know BASIC than any other language, so the system should use something similar. Pascal would be close enough for those used to structured BASIC.
But Structured BASIC is much younger than the 8-bit micros you're talking about: it's a 16-bit thing (QB4?).
Languages with a C-style syntax would be harder to adjust to. I know it caused me issues when I tried learning it.
There is very little difference between Pascal and C: both are direct descendants of ALGOL-60. I'd suggest that the problem you had with C was the number of idioms you were forced to learn- iterating a string using a pointer etc.- that were quite simply hidden in Pascal.
I'd suggest focussing not on what language you want, but on the degree of immediacy: what sort of IDE, and what sort of debugger. Compared with those, writing a compiler will be trivial.
MarkMLl