Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:31 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : could mmb be compiled?

Author Message
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 08:13pm 19 Sep 2024
Copy link to clipboard 
Print this post

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9105
Posted: 08:14pm 19 Sep 2024
Copy link to clipboard 
Print this post

If you write a compiler for it
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2120
Posted: 08:27pm 19 Sep 2024
Copy link to clipboard 
Print this post

  matherp said  If you write a compiler for it

oops messed up. was going to say used great cow basic and it's got a compiler so produces fast code for 8 bit.
but would a mmbasic "compiler" make it faster?
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 368
Posted: 09:02pm 19 Sep 2024
Copy link to clipboard 
Print this post

I'm of the mindset that it wouldn't make as much of an impact as you might think (but I could be wrong).

If you're talking about games, then sure it would speed up the loops and if statements, but the bulk of the time in a game loop is copying graphics between memory locations, rotating them etc. Those are already written in highly efficient compiled/machine code. Most other intensive tasks (enemy AI) can be split over multiple game loop iterations.

If it's for very fast I/O, then chances are that you will want more granular control over the timing than a compiler would allow for.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6778
Posted: 09:22pm 19 Sep 2024
Copy link to clipboard 
Print this post

It could be compiled if you rewrote most of it from the bottom up, I suppose. I doubt if there's any other way as it was written purely as an interpreter.

If you absolutely *have* to have some lightning fast sections then you cam use (well commented) CSUBs. ;)  

Remember that even compiled programs usually spend lots of time waiting for something to happen. They just do nothing faster. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 857
Posted: 09:55pm 19 Sep 2024
Copy link to clipboard 
Print this post

I think the nearest you can get is B4R, part of the B4X suite.

They're doing ESP and there has been a limited amount of Pico stuff. I haven't checked in a while.

Basic syntax but kinda event driven which I have never really taken to.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3800
Posted: 10:11pm 19 Sep 2024
Copy link to clipboard 
Print this post

Some parts would be "awkward", such as EVAL & EXECUTE.

Others would stretch a lexer/parser.

And... why do it?

John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024