QL / PASCAL

Anything QL Software or Programming Related.
Post Reply
User avatar
Sparrowhawk
Super Gold Card
Posts: 624
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: QL / PASCAL

Post by Sparrowhawk »

Hi Chain-Q. I can't add anything to the technical discussion, not being a low-level developer (I write business apps and databases, so am very much several layers away from the amazing stuff you do), but I just wanted to say thank you for creating this cross-compiler, and I hope you are able to complete it - Pascal is a lovely language, IMO. Good luck :)

Re OOP. I'm in the Pro camp, but that is because of the nature of the work I do, where business entities lend themselves to being modelled that way. Currently using Python which has a rather odd OOP implementation, but my favourite OOP system I used was Smalltalk which I coded with when I worked for a UK investment bank way back in the 90s and at a few other places too. Best version was Visual Smalltalk Enterprise on OS/2. The new Pharo variant looks very good, but I have not had time to try it yet.

I suspect OOP gets less useful/appropriate the nearer the bear metal one gets, which is, I guess, why Tony Tebby did not like it.


a.k.a. Jean-Yves
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL / PASCAL

Post by mk79 »

Chain-Q wrote:Sounds cool. Now I see there's a macOS bundle even? Somehow the name "QPC" put me off, and expected there's only a Windows version available, or something, and I do not have a Windows PC at hand. But will definitely check it out.
Well, it was named QPC when it was still DOS software ;) It is Windows software now, but I try to ensure that it plays nice with WINE. The bundle was made by a user using WineBottler I think. Alternatively there is also SMSQmulator, which has a similar feature set (but 68000 only IIRC) and was written in Java (blargh :-P )
I'm also one of the main developers of the SMSQ/E operating system and happy to help out.
That sounds great that an OS developer is available for questions, who even knows and understands Pascal, or doesn't downright dismiss it (been there)...
TurboPascal was one of the first languages I used on the PC and I was an avid Delphi 1 fan afterwards, even made some commercial database applications with it. I only learned C to develop QPC2 actually. C is still my day job and my Pascal is a bit rusty these days, but it would be the most modern compiler we have for the platform, so that in itself is pretty exciting :)
As soon as the entire target is in the SVN and can be compiled by other people too, some code review and feedback regarding the library code would be nice. Maybe we can patch up some chat or a Zoom/Skype/etc call for that one evening, so I can also explain what's what in the target.
Sure!

Cheers, Marcel


User avatar
Peter
QL Wafer Drive
Posts: 1953
Joined: Sat Jan 22, 2011 8:47 am

Re: QL / PASCAL

Post by Peter »

Chain-Q wrote:
Peter wrote:Recently I had a short but fascinated look at NetBSD/68k, because it supports a plain 68000 target with a primitive MMU. And not only that, but it even has a complete distro - which would save much work compared to Linux if I want it on the Q68. (Easier to add a primitive MMU than dealing with ucLinux.)
That sounds interesting. What is this primitive MMU? Because the Linux/68k guys are trying to "beat" some sense into the Vampire/Apollo core people, to support some kind of MMU, so they can run Linux on the thing. I'm not a big fan of the Vampire for several reasons, but regardless, if there's a shortcut for them to still get something working that might be interesting for the whole m68k community.
My idea was inspired by the Sun-2 series, which is already supported by NetBSD. It used a 68010 CPU with a proprietary external Sun-2 Memory Management Unit (MMU). I did not find full documentation of that MMU, but what I saw, was potentionally much simpler to implement than the later Motorola MMUs. For various reasons (e.g. inclusion of some retro QLers) I want the keep the CPU core (a TG68K.C) running as 68010 eqivalent for now. So the Sun-2 approach would be nearest to the current architecture.

As for Vampire, the Q68 is far from that speed, although I'm a little proud to have the TG68K.C at 40 MHz on a low-speedgrade 10 year old FPGA. Linux on a Q68 would only be a gimmick - for real fun I'd have to design some sort of Q60 successor. I'm not working on an MMU for the Q68 at the moment, cache and varirous other projects have higher priority, when there is a little spare time at all.
Chain-Q wrote:But I checked the Q68, it's a nice little board, I like it. Lets see later how this goes, and thanks for the possibility/offer/mention regardless.
You're welcome and thanks. The Q68 was more an artwork, than just a functional design. A high frequency layout with SDRAM and ethernet on a two layer PCB. It is QL specific inasmuch it is tailored for what QL drivers could likely support, and being manufactured in very small numbers. Lets see how long you remain interested in the QL, and at which point some QL hardware makes sense. I'm working on some new stuff also, but no decisions yet on releasing them. I have a functional board with medium size Lattice ECP5 FPGA and VRAM separate from main SDRAM, just so you know the direction.
Maybe 64? It certainly works for single-person projects, but it's not fast.
64 MB instead of 32 MB would just be a placement issue. But to be honest, I find a native compiler is not needed at all. Running the compiler and other development tools inside a QL emulator is totally pointless as it only brings disadvantages over running them directly. And native hardware is too slow. Investing time toward graphics/GUI support, would in my opinion be more helpful.


User avatar
Chain-Q
Chuggy Microdrive
Posts: 62
Joined: Mon Nov 16, 2020 1:10 pm
Location: Berlin, DE, EU
Contact:

Re: QL / PASCAL

Post by Chain-Q »

tofro wrote:In case anyone wants to get rid of the prejudice "OOP == bloated", have a look at this presentation. The guy writes (and explains what he's doing) a game for a Commodore C64 in an hour.
I think he proves a point :)
Yes, I know this talk. It's really impressive, but I think the only point he proves if you ever try to use C++ this way, you're probably a bit nuts. :D To put it another way, whatever he's doing requires such intimate familiarity with the compiler behavior and the corner-cases of the language that only a very few people can master on this level, especially in everyday work, and while working in a large team. At least the code he writes is certainly write only. I challenge anyone to understand _why_ the code was written that way, what are the assumptions it makes about compiler behavior, then modify it, just by reading it without his explanations.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL / PASCAL

Post by mk79 »

Chain-Q wrote:The good news, is, it doesn't get much worse with slightly more complex projects either. But do not expect something like Lazarus or even FPC itself to compile on that system. :) Talking about vlink, a QL-native Free Pascal will also need vlink/vasm ported, because the internal assembler is not there for 68k yet and the internal linker would need specific QL support added anyway.
Unlike Peter who is generally annoyed by the existence of emulators I think a native compiler could help adoption quite a bit. For once there is a large group of people that has left behind the limitations of native hardware a long time ago and purely enjoy the software ecology of the QL, secondly it's much easier to distribute a native version ready-to-run for inexperienced user.
In any case, if it ever comes to that point I volunteer to have a look at porting vasm/vlink. Though I guess vlink will need some changes anyway to support the QL executable format, no matter if cross or native compilation, right?

Cheers, Marcel


User avatar
Chain-Q
Chuggy Microdrive
Posts: 62
Joined: Mon Nov 16, 2020 1:10 pm
Location: Berlin, DE, EU
Contact:

Re: QL / PASCAL

Post by Chain-Q »

mk79 wrote:In any case, if it ever comes to that point I volunteer to have a look at porting vasm/vlink.
They're pretty much ANSI C with POSIX. So a sufficiently advanced libc and GCC 2.95.3 should be enough for it. Maybe. :) The only problem I see maybe is path handling differences, the QL seems to use the "_" character for paths, and I'm not sure if vlink has expectations about which character is the path separator or so.
Though I guess vlink will need some changes anyway to support the QL executable format, no matter if cross or native compilation, right?
I'm sure Frank Wille, the author of vlink would be open to add a Sinclair QL target if it really comes to that. I'm in regular contact with him, and he's generally very open and helpful, and the QL binary format seems reasonably simple. In fact I already talked with him about this. But for now it wasn't needed. I use a custom linker script with vlink's "rawseg" mode, which combines .text (code) and .data and .bss sections into one using that linker script, then just writes two separate files with the the combined raw .text/.data (while omitting the zeroes for the .bss), and the relocation table for them. I then post-process these files by copying them together after the linking has been done, and in this step I think I can write additional executable headers or suffixes if needed. I already write the BASIC loader here too, so...


User avatar
Peter
QL Wafer Drive
Posts: 1953
Joined: Sat Jan 22, 2011 8:47 am

Re: QL / PASCAL

Post by Peter »

mk79 wrote:Unlike Peter who is generally annoyed by the existence of emulators I think a native compiler could help adoption quite a bit.
Well I use emulators and even gave my recommendation for an emulator. No idea what the purpose of such obviously wrong remarks is.


swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: QL / PASCAL

Post by swensont »

I think another Pascal compiler would be a good idea. Computer One Pascal really only works on QDOS. ProPascal has the limitation of new windows are for output only. When I was in college, Pascal was the primary language for all my programming classes. I still have my copy of Dale & Orshalick's Pascal book (the bible for Pascal at my college). My graphics class even used TurboPascal 3.5 for CP/M.

It's not my favorite language, but it is not bad and there is a lot of source code out there that can be ported over. I look forward to see progress on this compiler.

I am also a fan of emulators and primarily use SMSQmulator on Linux. QPCII does run fine with Wine, but SMSQmulator just feels a little more native on Linux.

Tim


Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: QL / PASCAL

Post by Derek_Stewart »

Hi,

The Introduction to Structured Pascal is available on Archive.org to borrow or read on line.

I always use real hardware and all emulation systems, paid or free. Including the minimal subscription for Q-emulator

It seems all the software I bought for the QLis now free.

I do not discriminate from emulator or hardware.

When QPC2 was not free and I was been put down in QL Today, Quanta and other QL related press, I still supported and bought paid software for the QL.

I tried to port over FreePacsal to the QL, but my limited skills in C programming make me struggle with this task.

The other C projects I am looking at are SQLite, Ncurses2 which nearly compile in C68, but require some minor changes for the QL

So I can assist with the FPC port if required.


Regards,

Derek
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL / PASCAL

Post by mk79 »

swensont wrote:I think another Pascal compiler would be a good idea.
"Another" sounds like we already have some usable ones. When was the last one released, 30 years ago? ;)


Post Reply