Blog post !

Developed or developing a new product in PureBasic? Tell the world about it.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: Blog post !

Post by BarryG »

A question: since PureBasic will be based on C, and it used to be based on Assembler, does this mean it won't create a FASM output anymore for compilation, and therefore our apps will run slower?
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Blog post !

Post by Keya »

BarryG wrote:A question: since PureBasic will be based on C, and it used to be based on Assembler, does this mean it won't create a FASM output anymore for compilation, and therefore our apps will run slower?
On the contrary, C compilers tend to produce some of the best/fastest/optimised assembly output, so our apps should run even faster
Rinzwind
Enthusiast
Enthusiast
Posts: 679
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Blog post !

Post by Rinzwind »

Sooo we get support for proper unsigned data types?
Still hoping that PB structs also get an upgrade with procedure support (group data+behavior), so instead of just copying plain c structs, improve and ease 8)
User_Russian
Addict
Addict
Posts: 1517
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Blog post !

Post by User_Russian »

Keya wrote:On the contrary, C compilers tend to produce some of the best/fastest/optimised assembly output, so our apps should run even faster
This is if compiling with the -Ofast and -flto flags. If compiling with the -O0 flag and without the -flto flag, then it run be slow.
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Blog post !

Post by Lord »

That whole thing means that PB is going to be PC,
which is a bad thing.
Image
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Blog post !

Post by Keya »

Lord wrote:That whole thing means that PB is going to be PC, which is a bad thing.
How is it a bad thing??? If you mean PC as in desktop computer, that's what PB already is, and changing from fasm to C compiler doesn't change that... in fact it also means it can support other architectures such as ARM/ARM64, as Fred wrote in the blog post.
Or if you meant "PureBasic becomes PureC", no you'll still be writing in Basic code, not C. (You won't need to learn C, just as you haven't had to learn asm to use Purebasic in its current form)
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Blog post !

Post by luis »

Well, I'm very cautiously optimistic.

It's possible (even if it's not automatically guaranteed) some of the long standing compiler bugs could go away with this.

Also it will be interesting to see what is the C (or C++ ?) compiler used on the various platform.
This could mean better interoperability with C/C++ libraries... possibly.

Another good thing is the code will be generated by a modern C compiler and should be possible to get a higher level of optimizations, and maybe even a larger support of ASM instructions (SSE/SSE2 at least ?)
PB currently generates basically 80386 code.

It remain to be seen the effect of a heavier C compiler instead of a fast assembler on the edit -> compile -> run -> edit cycle.
Last edited by luis on Sun Mar 14, 2021 1:11 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
useful
Enthusiast
Enthusiast
Posts: 402
Joined: Fri Jul 19, 2013 7:36 am

Re: Blog post !

Post by useful »

There's a lot of hope for this news!
But questions about how it will be implemented, will there be a binding to a specific compiler or will we be able to choose in the settings, will the libraries be open, will there be changes in licensing, ..... ?

P.s. Will typed pointers appear? :)

C

Code: Select all

int *p;
PB

Code: Select all

*p.i
Dawn will come inevitably.
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Blog post !

Post by Lord »

https://www.purebasic.com/ wrote:Very fast BASIC compiler ...
Will this be true with a C back-end?
https://www.purebasic.com/ wrote:Using PureBasic is no brainer: you install the program, run the IDE and start developing your application.
Will this be true with a C back-end?

Doubts are quite appropriate.
Image
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Blog post !

Post by Keya »

Lord wrote:
https://www.purebasic.com/ wrote:Very fast BASIC compiler ...
Will this be true with a C back-end?
Yes. The current form of PB is "Basic -> assembly -> executable"
The next form will be "Basic -> C -> assembly -> executable"
Again, don't worry, you won't need to learn C to program in the next version of PB, just as nobody needs to learn assembly to program in its current form. But you will be able to enjoy the benefits of a powerful and mature optimising compiler 'under the hood' creating even more efficient executables for you!

If you're worried about compilation speed, I really don't think that's going to be an issue, especially with gcc (which I'm guessing/assuming will be the C compiler). And if you don't want optimisations that can slow down compilation, you'll be able to set it to -O0 (no optimisation) during development, and only set it to -O1 or -O2 or -O3 etc for your Release build, if you wish. (I say with confidence that these options will be available to us because it's literally just a C compiler parameter flag - trivial for Fred to add support for)
For info about optimisation levels see https://www.linuxtopia.org/online_books ... ro_49.html

I couldn't be more happier or excited :)
User_Russian
Addict
Addict
Posts: 1517
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Blog post !

Post by User_Russian »

Keya wrote:I say with confidence that these options will be available
I'm not sure about this.
The higher the level of optimization, the more rights the optimizer has to throw out code. If this is not foreseen when translating from basic to C, the code will be inoperative!
Now we do not know anything about the translation from basic to C. I hope Fred comments on this somehow?
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: Blog post !

Post by Keya »

User_Russian wrote:I'm not sure about this. The higher the level of optimization, the more rights the optimizer has to throw out code.
Yes, just as they already do with software written in C ... and PB will become C code, so I don't see how it's a problem!? And if the developer experiences problems with say -O3 they can drop back to -O2 or -O1 or -O0 etc :)
Although, perhaps there might be certain functions used in PB where Fred might want to say "you can't use these (...) particular compiler flags with this particular function" though, for whatever reason, and I'm ok with that
But we're both just speculating here :)
User avatar
useful
Enthusiast
Enthusiast
Posts: 402
Joined: Fri Jul 19, 2013 7:36 am

Re: Blog post !

Post by useful »

Dawn will come inevitably.
User avatar
STARGÅTE
Addict
Addict
Posts: 2226
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Blog post !

Post by STARGÅTE »

I have a lot of include and modules in which I use inline ASM code for speed optimization.
Can I still use them for x86 and x86-64 processor architecture or do they become invalid in future PB versions?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Axolotl
Enthusiast
Enthusiast
Posts: 798
Joined: Wed Dec 31, 2008 3:36 pm

Re: Blog post !

Post by Axolotl »

Hi folks,

I love reading your speculative thoughts. We should perhaps keep in mind that there is still quite little to be gleaned from the official blog.
I think that too high expectations now are just as premature as concerns or fears.
Let's wait for the first BETA or ALPHA version.

As an optimistic realist, i am looking forward to this new development.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Post Reply