PureBasic and C++

Everything else that doesn't fall into one of the other PB categories.
luke101
User
User
Posts: 36
Joined: Wed Sep 10, 2003 2:33 am

PureBasic and C++

Post 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++.
pentium 90mhz, 32mb ram, 1mb video ram, 1gb hd, windows 95.
If it can run on mine it can run on anything

Staight outta Compton
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I'd agree, the speed difference between PB and C++ is negligible.
--Kale

Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post 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) ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
luke101
User
User
Posts: 36
Joined: Wed Sep 10, 2003 2:33 am

Post 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?
pentium 90mhz, 32mb ram, 1mb video ram, 1gb hd, windows 95.
If it can run on mine it can run on anything

Staight outta Compton
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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 :)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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? :?
--Kale

Image
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

KarLKoX wrote:.. and show that "nothing" is not a PB keyword :lol:
:lol:
Dare2 cut down to size
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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.
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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!
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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:
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Post Reply