BBC BASIC for SDL 2.0 v0.18a released

discuss PC<>Acorn file transfer issues & the use of FDC, XFER, Omniflop/disk etc.
Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Tue Aug 01, 2017 9:56 am

I have updated BBCSDL, the cross-platform version of BBC BASIC for Windows, Linux, Mac-OS X, Raspberry Pi and Android. A major new feature is full support for 3D graphics programming on Android. Full details of the new release may be found at the forum.

Richard.

User avatar
bakoulis
Posts: 213
Joined: Wed Feb 08, 2012 9:45 pm
Location: Athens, Greece

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby bakoulis » Tue Aug 01, 2017 1:07 pm

Thank you Richard for the update. Very nice work.
A pure 64-bit Linux version will be very welcome.
:D
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.

Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Tue Aug 01, 2017 4:21 pm

bakoulis wrote:A pure 64-bit Linux version will be very welcome.

A 64-bit BBC BASIC raises a number of thorny issues, as I'm sure you're aware - not least that BBC BASIC's integer variables are 32-bits! There was a recent long thread on the subject at the BB4W Discussion Group, but without any firm conclusion other than that however one might tackle it, compatibility with existing programs could be a serious issue.

It irritates me that there seems to be a tacit assumption on the part of Apple (and others) that creating a 64-bit version of an app is just a case of re-compiling it with a few tweaks. Admittedly in many cases that may well be true, but if the application in question is a programming language - with its own set of data types - transitioning to a 64-bit address space may well be problematical.

Acorn were far-sighted in making BBC BASIC a 32-bit language from the start, more than 35 years ago. That has served us well to this day, but with Apple threatening to withdraw support for 32-bit Mac OS apps next year, and with some Linux users opting not to install 32-bit support (for 'strange' reasons, it seems to me), there is going to be a crunch at some point. I'd be very interested if you, or anybody else at this forum, have any contributions to make on the subject.

Richard.

User avatar
BigEd
Posts: 1326
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby BigEd » Tue Aug 01, 2017 4:23 pm

The idea of a 64-bit build of a 32-bit Basic is... consistent, I think? Using 32-bit ints and limiting Basic's memory arena to 4Gbyte.

Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Tue Aug 01, 2017 8:34 pm

BigEd wrote:limiting Basic's memory arena to 4Gbyte.

Limiting BBC BASIC's 'arena' to 4Gbytes is all very well, but as soon as you need to interact with the OS that scheme doesn't work. Most problematic in that respect is the SYS statement, used for calling API functions, which may need to be able to pass 64-bit addresses (pointers) as parameters and receive them back as returned values.

For example, consider the common situation when you need to pass a memory block (e.g. a structure) as a parameter to an API function. What you need to send is the 'true' memory address of that block; if BASIC is internally using 32-bit offsets within a 4 Gbyte 'arena' those values are not suitable. However you attempt to tackle this, it is going to be incompatible with existing programs.

Even something as simple as receiving from the OS a handle to a window, or a sprite, or some other resource and then passing that handle back to the OS in a subsequent API function cannot be achieved in a way that is compatible with existing programs, because they are almost certainly going to be expecting the handle to be a 32-bit value, not 64.

As I said, there was a long thread at the BB4W discussion group on this issue. There's no perfect solution and each possible approach has its own pros and cons. Preserving full compatibility with all existing programs is impossible, but it would be desirable to have a scheme which would allow programs to be written that would run on both 32-bit and 64-bit versions of BBC BASIC without alteration.

Richard.

User avatar
BigEd
Posts: 1326
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby BigEd » Tue Aug 01, 2017 8:57 pm

Ah yes, good point about interoperation with the 64 bit OS.

(Can you share a link to that long discussion? I found this one.)

Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Tue Aug 01, 2017 9:17 pm

BigEd wrote:Can you share a link to that long discussion?

https://groups.io/g/bb4w/message/21739

I found this one

Wow, a lot has happened since then (not least that I eventually did introduce 64-bit integers, using a %% suffix). The thread is a good illustration of how I have cycled between being optimistic and pessimistic about BBC BASIC; it was obviously a pessimistic period!

Richard.

User avatar
BigEd
Posts: 1326
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby BigEd » Tue Aug 01, 2017 9:47 pm

Thanks for the link - I'll have a good read of that discussion.

User avatar
BigEd
Posts: 1326
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby BigEd » Wed Aug 02, 2017 8:48 pm

That was an interesting read. I'm not sure I have anything to add! Evidently any kind of way to tackle the future will be some kind of compromise. The conservative tactic is to make a 32-bit Basic which works; the forward-looking tactic is to make a 64-bit Basic with the ability to reach more address space.

The idea of passing parameters in two places seems like a clever workaround.

Sorry to hear about your declining faculties - I do hope you still enjoy whatever you can still do, and I hope you do release some source code some day for future adventurers.

Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Thu Aug 03, 2017 9:02 am

BigEd wrote:The idea of passing parameters in two places seems like a clever workaround.

It quite literally came to me in the middle of the night. Persuading a C compiler to do it was challenging, and relies on a non-standard GCC extension (nested functions). I found it necessary to disable optimisation for that function and I'd be interested if any GCC experts can see a way in which that could be avoided.

Richard.

Richard Russell
Posts: 153
Joined: Sun Feb 27, 2011 10:35 am

Re: BBC BASIC for SDL 2.0 v0.18a released

Postby Richard Russell » Mon Aug 07, 2017 11:27 am

One of the new features of BBCSDL v0.18a is full support for 3D (OpenGL) graphics on the Raspberry Pi. Here's a video showing some of the supplied 3D example programs running on that platform.

Richard.


Return to “software & utilities for the pc, mac or unix”

Who is online

Users browsing this forum: No registered users and 2 guests