Page 1 of 1

PureBasic and C++

Posted: Sun Jul 30, 2006 4:51 am
by luke101
Hello, I am planning to purchase purebasic. I have read man posts regarding blitz and purebasics speed benchmarks. I have not found any benchmarks or tests with C++. Can someone comment speed differences with purebasic and C++.

Posted: Sun Jul 30, 2006 7:15 am
by KarLKoX
Purebasic produce asm code though you should compare asm <--> c++ and when you know the Fred's (Purebasic Author) skills in asm, you have an idea.
Personnaly, i do some c++ code and depending on the code quality (for both c++ and pb), the speed is identically.

Posted: Sun Jul 30, 2006 1:12 pm
by Kale
I'd agree, the speed difference between PB and C++ is negligible.

Posted: Sun Jul 30, 2006 1:25 pm
by Flype
So, does it makes sense to develop UserLibraries in C
when it's possible to do it in PureBasic itself (using TailBite) ?

Is a UserLib smaller if coded in C (for same code) ?

Posted: Sun Jul 30, 2006 1:34 pm
by KarLKoX
It depends, if you create a userlib from a opensource lib though not from your code, you have not the choice.
Then if you talk about choosing between creating a userlib from your code in C or PB, personnaly, i prefer to code it in PB, it save me a lot of time and show that "nothing" is not a PB keyword :lol: (except some very low level stuff like a OS)

Posted: Sun Jul 30, 2006 2:09 pm
by luke101
OK..since speed is the same in both c++ and pureB can I program a function like changing an IP address or computer name and have it reboot the system automatically? Can this type of stuff be done without reverting back to C++ dlls?

Posted: Sun Jul 30, 2006 2:53 pm
by KarLKoX
Infobyte (a PB member) is working on a Antivirus though it should be easy to do what you are asking for with a minimum amount of time :)

Posted: Sun Jul 30, 2006 2:59 pm
by Kale
luke101 wrote:OK..since speed is the same in both c++ and pureB can I program a function like changing an IP address or computer name and have it reboot the system automatically? Can this type of stuff be done without reverting back to C++ dlls?
Im sure it could easily, check this link out:
http://www.codeguru.com/Cpp/I-N/network ... php/c2473/

PB should be able to do these steps no problem, then use:

Code: Select all

ExitWindowsEx_(#EWX_SHUTDOWN, #Null)
EDIT: I hope you are not coding a malicious program? :?

Posted: Sun Jul 30, 2006 3:23 pm
by Dare
KarLKoX wrote:.. and show that "nothing" is not a PB keyword :lol:
:lol:

Posted: Sun Jul 30, 2006 8:27 pm
by va!n
@KarLKoX:
Sorry, i have to disagree about some infos. Since v4 nearly all PB libs are coded in C and no longer in ASM!

VC++ is able to produce smaller and more optimized output as some ASM written stuff. Btw, with VC++ you can produce smaller and better optimized stuff. (here the VC++ compiler is very intelligent to produce great output). ^^

@Flype:
Because you can create smaller and more optimized output code! Another and clean aspect is, coding stuff in VC++ may be more stable as coding stuff in PB (tailibite) where are "some hidden" compiler bugs inside and later inside your PB created libs ^^

@luke101:
you can do a lot stuff with purebasic. you can write some own routines using API calls and/or using DLLs.

Posted: Sun Jul 30, 2006 8:30 pm
by Num3
va!n wrote:@Flype:
Because you can create smaller and more optimized output code! Another and clean aspect is, coding stuff in VC++ may be more stable as coding stuff in PB (tailibite) where are "some hidden" compiler bugs inside and later inside your PB created libs ^^
Those ain't bugs! They are features ;)
Personaly i can't complain, all my libs work, and when they don't it's my own coding problem, not PB!

Posted: Sun Jul 30, 2006 9:10 pm
by KarLKoX
va!n wrote:@KarLKoX:
Sorry, i have to disagree about some infos. Since v4 nearly all PB libs are coded in C and no longer in ASM!

VC++ is able to produce smaller and more optimized output as some ASM written stuff. Btw, with VC++ you can produce smaller and better optimized stuff. (here the VC++ compiler is very intelligent to produce great output). ^^
You misunderstood what i was talking about, i am not talking about pb's libs, those wich are provided with purebasic but third parties userlib, those coded by you or me.
VC++ is not the best compiler for optimized code, just see the rounding stuff produced by it ! I am a very beginner in asm (i can read it) and i successfully coded a far better rounding asm routine ... this is just an example, VC++ do some weird things called optimisations but the best optimisations comes from the coder, i am not those who say they optimise their code when they only play with the compiler settings.
Btw, comparing a compiler wich is used for a longer time with a quite young one prove that PB is keeping the good way, i am confident that it will beat the master :lol: