A guide to programming the Sinclair QL

Anything QL Software or Programming Related.
User avatar
XorA
Super Gold Card
Posts: 547
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: A guide to programming the Sinclair QL

Postby XorA » Sun Oct 29, 2017 2:25 pm

but I write PC C, not QL C


Its the same language, I assume you mean you use a lot of Windows specific functions when your on a PC, as I've previously discussed porting *nix CLI stuff to QL is mostly easy.

GFX stuff is fairly easy as long as original program was decently written and separates the output from the logic.

And luckily for people like me who are C programmers by trade the QL gods wrote the QL specific libraries and they are nicely on dilwyns page and other C68 related pages.


User avatar
pjw
Gold Card
Posts: 397
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway

Re: A guide to programming the Sinclair QL

Postby pjw » Sun Oct 29, 2017 4:26 pm

Had one invested as heavily in S*BASIC as the world has done with C, who knows where we'd be today? With decent editors, library management tools, GUIs for menus and the like, etc, it could have gone much further. Of course TT nailed his flag to the 68k mast, which may have been misguided. However, the MC68x is a programmer's CPU (as opposed to i86, which was designed by sadistic engineers for masochistic engineers) so today, instead of C, we might have had a sort of dual programming language, with high level programmers building applications in something akin to SBASIC, and low level programmers building libraries in 68x assembler.


Per
For every complex problem there is an answer that is clear, simple, and wrong.
- H. L. Mencken
User avatar
Zarchos
Trump Card
Posts: 152
Joined: Mon May 08, 2017 11:49 am

Re: A guide to programming the Sinclair QL

Postby Zarchos » Sun Oct 29, 2017 11:05 pm

Quite reminiscent of Acorn BBC Basic with built in ARM Assembler, to me ; although I do not know how QL Super Basic compares to the BBC Basic (which I do not find easy to read with all its VDU commands, for example).


Owner of various QLs including accelerated beasts, and also a happy Q68 owner ;)
Now porting SOTB to the Archies, to then port it to the Q68.
https://www.youtube.com/user/Archimedes75009/search?query=Acorn+Archimedes+Shadow+Of+The+Beast+%28100%25
User avatar
pjw
Gold Card
Posts: 397
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway

Re: A guide to programming the Sinclair QL

Postby pjw » Mon Oct 30, 2017 10:56 am

Zarchos wrote:Quite reminiscent of Acorn BBC Basic with built in ARM Assembler, to me ; although I do not know how QL Super Basic compares to the BBC Basic (which I do not find easy to read with all its VDU commands, for example).

I dont find SBASIC hard to read. But in my scenario (above) it would have to undergo some serious changes: Line numbers would be out, and the restriction of max 32k lines removed, for starters. Different number formats would have to be supported, and so on.. (Timothy Swenson would be a famous Silicon Valley billionaire with his Structured SuperBASIC V12.0, which already in its beta incarnation is miles easier to read. Wolfgang Lenerz would be another billionaire with his V10.x Basic_linker, and Tony Tebby would fly over to play $1 poker with Warren Buffet every other weekend.)

Outside the core SBASIC instruction set, libraries ("toolkits") could be added, depending on usage; database, math, graphics, etc. All modern CPUs would implement or emulate the mc68 CPU paradigm and be compatible, at the assembler level, with the 68k instruction set..

As they currently ARE, of course neither SMSQ/E, SBASIC or any other component in the QL duck pond would stand a chance in the modern world. But those of you with long memories, will recall the convoluted transformations that took place to morph MSDOS into Windows 10, or 68k Mac OS into i86 Linux with a pretty face, or AT&T mainframe Unix into the Android on your phone. So it isnt that unlikely that things could have looked very different.. if.. if.. and if..


Per
For every complex problem there is an answer that is clear, simple, and wrong.
- H. L. Mencken
swensont
Forum Moderator
Posts: 130
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: A guide to programming the Sinclair QL

Postby swensont » Mon Oct 30, 2017 6:50 pm

The computer language you want to use is usually related to the computer language that you know. For a SuperBasic programmer, moving over to C68 is not trivial. I've run into the problem of wanting more beginner documentation for C68 and have just used DP C instead. I just did not have the time to invest in getting C68 to do what I wanted.

I've learned a few other languages, besides SuperBasic, and I sometimes will use one of them when it is easier to code than SuperBasic. AWK is a good example. A few lines of AWK may take 20 lines of SuperBasic and then need troubleshooting.

Tim


User avatar
pjw
Gold Card
Posts: 397
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway

Re: A guide to programming the Sinclair QL

Postby pjw » Mon Oct 30, 2017 9:04 pm

swensont wrote:The computer language you want to use is usually related to the computer language that you know.<>

While I never became proficient in any computer language, S*BASIC is the one I know best - by choice.
But I did try a bunch of others over the years. I guess the instruction set of the HP calculator, HP41CX,
does not count as a real language, but I knew it pretty well, before the QL came into my life.

Then I learnt SuperBASIC, which was ok, but prior to SuperCharge and all that, it felt rather limiting. So
I studied Forth, which for me was a natural successor to the HP41's way of doing things. (Reverse
Polish Notation held no terrors for me in those days!) But after writing a few bad games, I abandoned
(Computer One's?) Forth due to its - and my - limitations at the time. I then tried BCPL <shudder> and
Prospero Pascal (much too weighty for a 8MHz, 512k machine, to my mind).

Once Id mastered the basics of assembler and QDOS, specifically to augment SuperBASIC's vocabulary,
and with the mighty Turbo arriving on the scene, I felt Id found my métier. (This crumbled again when
we got the Pointer Environment, as Turbo couldnt cope with it then, so Q_Liberator became the
compiler of choice, and still is.)

With that power-combination, it seemed pointless to learn C(68), which was still struggling to fit into
the QL environment. When I got my first Atari ST, C seemed the obvious choice. However, I didnt get
on with the ST paradigm at all, and so fled back to the comfort of the evolving QL emulator
environment. This is where the real bleeding edge of QL development was happening, with the full
backing of the genius and hard work of Tony, and the technical and commercial nous of Jochen.

Since then Ive worked with PHP + databases, and javascript, which on the surface are very C-like. But
by now its not only about the language, you have this whole virtual environment to learn and relate to.
And that seems too much like hard work to me! I pity those who have to start from scratch today. You
need to be a special kind of nerd to be self-taught now.

Mind you, its not all bad. While I was learning PHP on the job, I spent half a morning writing a
quicksort routine. A young kid, straight out of college came over to me to ask what I was doing. I told
him, and thinking I was doing him a favour by asking his advice, I said: "How would you do it?"
"Easy," quoth he, "I just type 'sort'."


Per
For every complex problem there is an answer that is clear, simple, and wrong.
- H. L. Mencken

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 1 guest