SyntaxBomb - Indie Coders

Languages & Coding => PureBasic => Topic started by: ricardo_sdl on June 16, 2021, 14:01:13

Title: New PureBasic Backend - C
Post by: ricardo_sdl on June 16, 2021, 14:01:13
PureBasic has released an alpha version of their new backend: C:
https://www.purebasic.fr/blog/?p=502 (https://www.purebasic.fr/blog/?p=502)
The compiler generated code is C, which in turn will be compiled to the native machine language. This could allow the use PureBasic in many different processors and operating systems.
Title: Re: New PureBasic Backend - C
Post by: Amon on June 16, 2021, 16:59:47
This is an important move from the Purebasic developers. I'm going to keep an eye on this as I own Purebasic and would love it if it supported more platforms.
Title: Re: New PureBasic Backend - C
Post by: Skaven on June 16, 2021, 18:04:04
this is how blitzmax ng also works
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 18, 2021, 11:44:10
This is very interesting although it would be even better if they upgraded OGRE to the latest version as well . That was my major dislike of Pure Basic the Directx 9.0c needing to be installed to run on windows 10 and for the price tag I think it should be sorted. Apart from that it is a very good language just needs updating a bit that's all. Have a nice day.
Title: Re: New PureBasic Backend - C
Post by: MikeHart on June 18, 2021, 12:40:45
The price needs to be lowered????
You gotta be kidding. 79 Euro for a lifetime license is cheap as fuck. Don't be so cheap and give the developers what they deserve. Or use a different tool that fits your mindset of how things should be priced.
Title: Re: New PureBasic Backend - C
Post by: Steve Elliott on June 18, 2021, 13:15:01
I agree Mike.   :)
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 18, 2021, 13:28:47
I apologize it really is a great language.
Title: Re: New PureBasic Backend - C
Post by: Aurel [banned] on June 18, 2021, 13:39:39
QuoteI apologize it really is a great language
well i can agree with Mike about money ,i have old 4.5 version
but even is comercial it is not build in a proffesional way than in indie way...
Also is not the fastest among other basic compilers ,this one uses FASM as final builder.
But who i am ..i am not real user of PureBasic in any sense.
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 18, 2021, 13:49:49
I haven't used it much either but I did find it very fast compared to other basics I've tried. This C thing should prove interesting
Title: Re: New PureBasic Backend - C
Post by: ricardo_sdl on June 18, 2021, 13:55:09
Quote from: Aurel on June 18, 2021, 13:39:39
QuoteI apologize it really is a great language
well i can agree with Mike about money ,i have old 4.5 version
but even is comercial it is not build in a proffesional way than in indie way...
Also is not the fastest among other basic compilers ,this one uses FASM as final builder.
But who i am ..i am not real user of PureBasic in any sense.

You mean the code generated is not the fastest or the compiler speed to generate the code? For my use case I think both are good enough, using the fasm as the backend. With PureBasic generating C code we'll be able to get the the many and very efficient optimizations of a C compiler.
Title: Re: New PureBasic Backend - C
Post by: MikeHart on June 18, 2021, 14:10:24
That they went for a flat file approach is the main reason that compile times are higher with the c version. The Monkey languages and it's derivates suffer from a similar approach.
Title: Re: New PureBasic Backend - C
Post by: Aurel [banned] on June 18, 2021, 15:01:04
well ricardo
i just check your site games..
they are written using SDL with what?
Title: Re: New PureBasic Backend - C
Post by: ricardo_sdl on June 18, 2021, 15:37:32
They are written in PureBasic, which on default options uses DirectX on windows and SDL and OpenGL on Linux.
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 19, 2021, 14:30:33
@ Ricardo . Can I get Pure Basic to use open GL on windows instead of Directx 
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 19, 2021, 14:51:21
I've just answered my own question and it appears that I can use open GL instead of directx. So my next question is will it run on windows 10 without having to install Directx 9.0c  . I presume it will but would like to have it confirmed . Will Ogre work just the same with Open GL.
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 19, 2021, 15:17:54
I'm not switching to Pure Basic as am getting on with studio for the foreseeable but I do take an interest and it's an option and options are good .
I did make a game in it but wasn't great but for a first attempt was good . Not sure this backend C thing would make any difference to me. Got the demo installed right now and it's surprising what you can do in 800 lines of code . I might just buy it soon and get the full experience . Enjoy your weekend .
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 19, 2021, 15:27:09
I might just decide to use two languages . It is an interesting concept to write some code in Basic that then gets compiled into C . Could I then keep it in C and then compile it into machine code in any C compiler ? The reason I ask is if someone wanted  a program written in C and I produced it although written in Basic initially it would appear I'd written it in C.   Very interesting .
Title: Re: New PureBasic Backend - C
Post by: ricardo_sdl on June 19, 2021, 23:32:05
Quote from: Pfaber11 on June 19, 2021, 15:27:09
I might just decide to use two languages . It is an interesting concept to write some code in Basic that then gets compiled into C . Could I then keep it in C and then compile it into machine code in any C compiler ? The reason I ask is if someone wanted  a program written in C and I produced it although written in Basic initially it would appear I'd written it in C.   Very interesting .

From here (https://www.purebasic.fr/blog/?p=486) we can see that they tested GCC and Visual C++ 2015. Both very good compilers. And they mention that they are outputing clean C code, so it can be reused in other projects.
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on June 20, 2021, 20:36:26
I suppose if I can use Pure Basic I can practically program in C . If it comes out on demo I'm definitely gonna want to try it out and if I like it I will buy it . Hopefully won't be too long . I have a bit of experience with PB and think I can juggle 2 languages. Adding C to my bow would be awesome . Oh what I did want to know I've worked out I can use open GL in PureBasic with windows can I also use Ogre with openGL in windows and forget the Directx 9.0c api.
Title: Re: New PureBasic Backend - C
Post by: Pfaber11 on May 17, 2022, 15:39:28
You need Directx 9.0c and DXSDK_10june. This is so ogre meshy and Ogre assimp converter will work.ok