A guide to programming the Sinclair QL

Anything QL Software or Programming Related.
User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: A guide to programming the Sinclair QL

Post by XorA »

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
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: A guide to programming the Sinclair QL

Post by pjw »

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
dont be happy. worry
- ?
User avatar
Zarchos
Trump Card
Posts: 152
Joined: Mon May 08, 2017 11:49 am

Re: A guide to programming the Sinclair QL

Post by Zarchos »

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/Archimedes ... +%28100%25
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: A guide to programming the Sinclair QL

Post by pjw »

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
dont be happy. worry
- ?
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: A guide to programming the Sinclair QL

Post by swensont »

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
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: A guide to programming the Sinclair QL

Post by pjw »

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
dont be happy. worry
- ?
7alken
ROM Dongle
Posts: 18
Joined: Tue Apr 18, 2023 2:23 am

Re: A guide to programming the Sinclair QL

Post by 7alken »

hi guys, this entire thread was entertaining, last sentence most probably ))
I am new to QL (deep in love now) or perhaps more SMSQ/E on QPC2 (now, planning uQLux on RPi0 too)

I have now quite luxury of external view on this all and, ya, C is hardcore everywhere in embedded things and is portable and its best thing ever invented )) but guys have points about S*Basic fast/easy way, extensibility etc, but now as I want to write something simple to manipulate text, actually source code (bas) I am looking for some "string replace" thing, or, so, will need to write one )). My love started in QPC2 and I now see why - there is lot of extensions built-in, and the reference to S*Basic + all the toolkits is HUGE ... and there are no namespaces, at least mimicked in prefixes (can imagine simple approach to this, but it is as it is, okay...). What I love on SMSQ/E is how its all integrated, the language and the system, but this is of course reason why any plain simple porting to/from is not easy. Which is also now almost irrelevant, as emulators are everywhere... so thanks for them :-)

this is probably most confusing thing now - the lots of covered toolkits, where I am not sure which is in QPC2 or which is what most ppl have:
https://superbasic-manual.readthedocs.i ... lkits.html
(no rant, I was only very suprised by the complete list of toolkits ... and overlapings in them etc)

btw, I quite lot love C# :-) ... and java, the mother; you can quite easily write small things in java too, as this tiny MIDIPlayer;
https://1drv.ms/u/s!ApaaPymMAOU6qOdwDcp ... g?e=qXE9xx

fact is, world is now complicated, I wish to simplify things :-)


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: A guide to programming the Sinclair QL

Post by NormanDunbar »

7alket wrote:I was only very suprised by the complete list of toolkits ... and overlapings in them etc)
Yeah, that was my idea some time back. That documentation is quite simple to update if you know ReStructuredText which is what it's currently written with, but it can be done in Markdown too. I have yet to try a Markdown page, but hopefully soon.

Glad you liked the Toolkits page.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
7alken
ROM Dongle
Posts: 18
Joined: Tue Apr 18, 2023 2:23 am

Re: A guide to programming the Sinclair QL

Post by 7alken »

thanks Norm, ya, I already scanned everything and even bought from Amazon that Jan's book
what was entire week weak was those bad links everywhere, even in this thread...
... some global search/replace possible? (I see it now in forum heading menu as QL Homepage)
http://www.dilwyn.me.uk/docs/index.html


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: A guide to programming the Sinclair QL

Post by NormanDunbar »

Aye. The QL Homepage suffered from a number of problems that drove Dilwyn mad! The whole thing was migrated to our forum's hosting. There may still be some links pointing at the wrong place.

Hopefully, if there are links in the online documentation, I'll get around to fixing them soon. There's a bug in "ReadTheDocs" which is causing a build to fail at the moment.

I'm pretty sure I did a search and replace on the QLWiki though.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply