suggestions for future QB64
#21
(04-27-2022, 04:27 PM)Tim Wrote:
(04-27-2022, 06:35 AM)admin Wrote: BAS, in this case is QB64 *.bas files.  You can find our source files inside the internal/source folder, and internal/c folders,  included with all versions of QB64.

Could QB64 be completely coded/recoded using QB64 only?

I don't develop QB64, but I don't see how it could be just QB64 statements. It translates code from QB64 to C/C++, and then uses an open source compiler to compile that code, and runs the program. So without any C/C++, how could it translate, right? I believe to covert to binary would mean translating to ASM or worse, machine code. Anyway, just spit-balling here. I've never really delved into it, but it will be interesting to see if this sparks some conversation from those who have.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply
#22
(04-27-2022, 04:38 PM)Pete Wrote:
(04-27-2022, 04:27 PM)Tim Wrote:
(04-27-2022, 06:35 AM)admin Wrote: BAS, in this case is QB64 *.bas files.  You can find our source files inside the internal/source folder, and internal/c folders,  included with all versions of QB64.

Could QB64 be completely coded/recoded using QB64 only?

I don't develop QB64, but I don't see how it could be just QB64 statements. It translates code from QB64 to C/C++, and then uses an open source compiler to compile that code, and runs the program. So without any C/C++, how could it translate, right? I believe to covert to binary would mean translating to ASM or worse, machine code. Anyway, just spit-balling here. I've never really delved into it, but it will be interesting to see if this sparks some conversation from those who have.

Pete

So, it would require a compiler to compile QB64 code directly, then?
Reply
#23
The only thing I can think of is a fix for the current audio bug on macOS Big Sur and above. I know it has something to do with OpenAL but beyond that idk. Smile
Reply
#24
(04-27-2022, 11:39 PM)Tim Wrote: So, it would require a compiler to compile QB64 code directly, then?


I think you misunderstand what QB64 actually is.  QB64 isn't a compiler -- we're a translator.  We turn BAS code into C code, and then compile that C code with the mingw compilers.  If you're ever curious about what the bad looking, machine translated, C code looks like once its translated from your programs, you can always find it in internal/temp, with the largest portion of your code being in main.txt.  

All QB64 does is translate BAS to C.  After that, g++ does the job of compiling that C code into an EXE for us.  Smile
Reply
#25
Code: (Select All)
For i = 1 To 10
    Print "hello"
Next i
End

resultas in the file main.txt :
Code: (Select All)
S_0:;
S_1:;
fornext_value2= 1 ;
fornext_finalvalue2= 10 ;
fornext_step2= 1 ;
if (fornext_step2<0) fornext_step_negative2=1; else fornext_step_negative2=0;
if (new_error) goto fornext_error2;
goto fornext_entrylabel2;
while(1){
fornext_value2=fornext_step2+(*__SINGLE_I);
fornext_entrylabel2:
*__SINGLE_I=fornext_value2;
if (fornext_step_negative2){
if (fornext_value2<fornext_finalvalue2) break;
}else{
if (fornext_value2>fornext_finalvalue2) break;
}
fornext_error2:;
if(qbevent){evnt(1);if(r)goto S_1;}
do{
tqbs=qbs_new(0,0);
qbs_set(tqbs,qbs_new_txt_len("hello",5));
if (new_error) goto skip3;
makefit(tqbs);
qbs_print(tqbs,0);
qbs_print(nothingstring,1);
skip3:
qbs_free(tqbs);
qbs_cleanup(qbs_tmp_base,0);
if(!qbevent)break;evnt(2);}while(r);
fornext_continue_1:;
}
fornext_exit_1:;
do{
sub_end();
if(!qbevent)break;evnt(4);}while(r);
sub_end();
return;
}
void SUB_VWATCH(){
qbs *tqbs;
ptrszint tmp_long;
int32 tmp_fileno;
uint32 qbs_tmp_base=qbs_tmp_list_nexti;
uint8 *tmp_mem_static_pointer=mem_static_pointer;
uint32 tmp_cmem_sp=cmem_sp;
#include "data1.txt"
mem_lock *sf_mem_lock;
new_mem_lock();
sf_mem_lock=mem_lock_tmp;
sf_mem_lock->type=3;
if (new_error) goto exit_subfunc;
exit_subfunc:;
free_mem_lock(sf_mem_lock);
#include "free1.txt"
if ((tmp_mem_static_pointer>=mem_static)&&(tmp_mem_static_pointer<=mem_static_limit)) mem_static_pointer=tmp_mem_static_pointer; else mem_static_pointer=mem_static;
cmem_sp=tmp_cmem_sp;
}

difficult to understand. it is not directly modifiable. it would be necessary to study the method used by the original author of qb64. well it works, it is the main thing.
Reply
#26
(04-27-2022, 04:38 PM)Pete Wrote:
(04-27-2022, 04:27 PM)Tim Wrote:
(04-27-2022, 06:35 AM)admin Wrote: BAS, in this case is QB64 *.bas files.  You can find our source files inside the internal/source folder, and internal/c folders,  included with all versions of QB64.

Could QB64 be completely coded/recoded using QB64 only?

I don't develop QB64, but I don't see how it could be just QB64 statements. It translates code from QB64 to C/C++, and then uses an open source compiler to compile that code, and runs the program. So without any C/C++, how could it translate, right? I believe to covert to binary would mean translating to ASM or worse, machine code. Anyway, just spit-balling here. I've never really delved into it, but it will be interesting to see if this sparks some conversation from those who have.

Pete

fyi, from Wikipedia:


Quote:QB64 was originally compiled with QuickBASIC 4.5. After significant development, Rob Galleon, the developer, became hindered by QuickBASIC's memory limitations and switched to Microsoft Basic PDS 7.1, which solved these problems for a short time.[5] After version 0.63, QB64 was able to compile itself so the conventional memory limitations no longer applied.

So it sniffs like QB64 is used, i.e. BASIC code, to create QB64.

QB64 compiles itself.  How it gets from point A-Z makes for interesting factoid, but that's pretty much it.  One doesn't need another language and compiler, in addition to QB64, to compile QB64.  A QB64 install, QB64 itself, doesn't need any extras.

Well, that's what I'm reading into it.
Reply
#27
I wonder how old your quote is @CharlieJV looks like Wikipedia needs an update, that was probably before the Sdl versions which is before current GL. I don't know, I'm waiting for Steve's "History of QB64" ;-))
b = b + ...
Reply
#28
(04-28-2022, 05:15 PM)bplus Wrote: I wonder how old your quote is @CharlieJV looks like Wikipedia needs an update, that was probably before the Sdl versions which is before current GL. I don't know, I'm waiting for Steve's "History of QB64" ;-))

That's right, hence my vernacular ("it sniffs", as in it smells like it, but I ain't gonna be the one to taste it and make sure.)  Ditto:  Wink
Reply
#29
Oh that's what sniff means, aha!

I was rereading it like crocodile tears because you were insulted or trolled.

BTW, a crocodile rock?
b = b + ...
Reply
#30
(04-28-2022, 05:15 PM)bplus Wrote: I wonder how old your quote is @CharlieJV looks like Wikipedia needs an update, that was probably before the Sdl versions which is before current GL. I don't know, I'm waiting for Steve's "History of QB64" ;-))

You guys will have to wait a while for me to write that book!  I've already got my hands full with everything else already!  Tongue
Reply




Users browsing this thread: 3 Guest(s)