Go to advanced search

by ZXDunny
Mon Aug 12, 2019 9:59 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

SpecBAS also runs multi-threaded, but not for the language itself. I run a thread separately from the interpreter that renders the display at 50Hz, so I don't have to bother issuing commands to update the screen (it's analogous to the Spectrum's ULA in that regard). And there's various threads spawn...
by ZXDunny
Sun Aug 11, 2019 10:44 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

SpecBAS wouldn't translate well to other hardware, no. There are a lot of operations (such as matrix maths, graphics operations etc) that are performed as a single "opcode" in the VM, and there's the other issue that SpecBAS does not support integer types, only Doubles so the FPU would have to be en...
by ZXDunny
Sun Aug 11, 2019 9:51 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

That's not to rule out a proper compiler later on - it won't be terribly difficult to do but will be annoying having to support x86/x64 and ARM. Maybe you could target WASM web assembly and simultaneously reach near native speeds on both. SpecBAS is a self-contained environment - there's no need to...
by ZXDunny
Sun Aug 11, 2019 3:58 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

I was careful to keep the main interpreter function to less than 32Kb - it deals with the most common "opcodes" and then farms more complex stuff (like drawing/texturing etc) out to other procedures. But to be perfectly honest, I didn't notice much of a speed-up from when I was running then entire i...
by ZXDunny
Sun Aug 11, 2019 11:57 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

The EVAL() function doesn't use an interpreter, but it uses the compiler at runtime to compile a BASIC expression on demand, but the EVAL() function itself is only compiled once per program invocation. If one replaces the words 'compiler' and 'compiled' with 'tokenizer' and 'tokenized' then that ex...
by ZXDunny
Tue Jul 23, 2019 8:40 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

Imagine how much easier it would be if the tokenised form of 10 X=2^0.5 20 PRINT X 30 STOP automatically appeared as 10 X=2^0.5 20 लिखो X 30 विराम when edited with the correct localisation set. I suppose one could also render the numerals correctly and even the X. I am working on this exact system ...
by ZXDunny
Mon Jul 22, 2019 9:31 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

Do you know anyone that actually uses windows as anything other than a distraction now days (other than maybe Heater). Only about pretty much everyone. My father uses Windows. My Mother uses Windows. My Sister uses Windows. My Wife uses Windows. Pretty everyone other than me in my family uses Windo...
by ZXDunny
Thu Jul 18, 2019 6:56 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

What's really nice is that the shader code is contained within the BBC BASIC program, rather than loaded as an external resource :)

I'm firmly in the 256-colours only camp and will never add OpenGL to my BASIC, but Richard's work is exceptional.
by ZXDunny
Wed Jul 17, 2019 5:13 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

Not sure about Dartmouth BASIC, though it would stand to reason that there were integer types. All numeric variables in Dartmouth are floating-point representations. Dartmouth has nothing to say about the size, however. There are no suffixes to denote type other than "$" which indicates a string va...
by ZXDunny
Tue Jul 16, 2019 12:21 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

gives me a chance to fully grock the code A quick point of language - it's "grok", not "grock". Except...and I'm not totally sure on this, the Sinclair Spectrum had BASIC keywords on it's keyboard. I always imagined that hitting those keys produced their tokens directly. Never had a Speccy so I don...
by ZXDunny
Mon Jul 15, 2019 8:03 am
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

I wonder if interpretive tokenized code is worth the effort these days? I believe it is still a good way to make code smaller, and make the interpreter faster. Those are always good things no matter how fast a computer or how much memory you have. I also think it has the potential to make an interp...
by ZXDunny
Sun Jul 14, 2019 11:31 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

I expect that it was not stored as a jump table due to memory constraints. The 48k Spectrum had just that - 48kb of usable RAM, and a large program would need a largish table. And besides, Spectrum code lines were stored with a four byte header - two bytes for the line number, two bytes for the leng...
by ZXDunny
Sun Jul 14, 2019 9:47 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

Well, back in the day they were a lot faster than procedures, so maybe for speed? Or just convenience? In BBC BASIC, procedure calls (without parameters) are typically faster than GOSUB. Specifically, the destination of a procedure call is looked up in the same way as variables are, in a relatively...
by ZXDunny
Sun Jul 14, 2019 8:04 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

@ RichardRussell : I am looking at a bit of BBC BASIC code by you, and it uses GOSUB a lot, as well as GOTO. Kind of curious of why? In a language that has structured parameterised procedures and functions why are you using so much GOSUB and GOTO? I had not seen anyone use those two kewords in BBC ...
by ZXDunny
Sun Jul 14, 2019 7:05 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

What? We called it "Assembly Language" back in 1974. Assembler had symbolic names for memory addresses and mnemonics for machine instructions and registers etc. "machine code" is that binary stuff you put into memory. Or more likely, later, enter as hexadecimal. Yes, that was what we did. Assembler...
by ZXDunny
Sun Jul 14, 2019 6:49 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

Richard said it best - SpecBAS (by me, Paul Dunn - no idea how this Dunning chap is) is as tightly tied to Sinclair BASIC as I can make it. That means line numbers, string slicing Sinclair-style, UDG character sets and even using the same algorithms to generate graphics primitives as the original z8...
by ZXDunny
Thu Jul 11, 2019 4:29 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

And the reason I am hesitant to make a submission, as I would be using native code and doing so in BBC BASIC V on RISC OS. Unless you want to use embedded assembler code, it ought to be relatively easy to write it in 'generic' BBC BASIC so that it will run in BBC BASIC for Windows , BBC BASIC for S...
by ZXDunny
Thu Jul 11, 2019 3:40 pm
Forum: Other programming languages
Topic: Introduction to BBC BASIC
Replies: 551
Views: 31251

Re: Introduction to BBC BASIC

In another thread, about another BASIC (!), there are some examples of how to incorporate GUI features from a toolkit like GTK or IUP. Whilst you can do that (in BBC BASIC too if you want to) it seems to me that it's neither a good demonstration of the capabilities of your BASIC nor conducive to gu...
by ZXDunny
Wed Jul 03, 2019 9:36 am
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

I would love to add an OpenGL shader to SpecBAS. Not for the display per-se, but for scaling to an integer multiple before using bilinear to get the rest of the way up to the screen size. Much nicer to look at than a straight bilinear filter :) Is there no way you can achieve that by judiciously sw...
by ZXDunny
Tue Jul 02, 2019 9:58 pm
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

one core to render the graphics and have the interpreter running on a separate core That's the BBC BASIC for SDL 2.0 structure too, but with the addition of the GPU (which has hundreds or thousands of 'cores'). Admittedly where the benefit of the hardware acceleration really kicks in is in things l...
by ZXDunny
Tue Jul 02, 2019 6:40 pm
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

Yeah, SpecBAS has twelve modes in all (so far). That all the graphics are 8bpp doesn't help either. Tbh, I think it's probably gonna be fine leaving one core to render the graphics and have the interpreter running on a separate core as I am now - hardware acceleration isn't likely to help, I fear. A...
by ZXDunny
Tue Jul 02, 2019 12:54 pm
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

Interesting. I wonder if it can be made to work with SpecBAS's blend modes too (OVER command). I think at the very least I should be able to replace the window and sprite compositor, though at the expense of needing SDL dlls bundled with it.
by ZXDunny
Tue Jul 02, 2019 9:28 am
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

RichardRussell wrote:
Tue Jul 02, 2019 9:16 am
ZXDunny wrote:
Tue Jul 02, 2019 9:11 am
why do I want GPU acceleration?
I assume for the same reason I do in BBC BASIC, to make graphics faster! If you don't care about speed, it's a moot point.
Graphics? You mean things like drawing lines and circles?
by ZXDunny
Tue Jul 02, 2019 9:11 am
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

Because windows in SpecBAS are not SDL surfaces and may be hidden Well, OK, to be able to clip writes to a hidden window (whilst allowing concurent writes to a visible window) you would either have to treat that as a special case (I imagine it's uncommon) or make each window a separate SDL surface ...
by ZXDunny
Tue Jul 02, 2019 8:22 am
Forum: Other programming languages
Topic: Searching for BASIC
Replies: 126
Views: 5803

Re: Searching for BASIC

I support multiple windows (within the SDL surface, I only use one of those) so clipping has to be done manually - also there's the clipping commands which allow you to set your own custom clipping region. I don't see why either of those has any impact on whether SDL does the clipping or you do. In...

Go to advanced search