Blog post !

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Blog post !

Post by skywalk »

Why does
Goto end;
End:
Appear in the syntax conversion?

How does the debugger work with the C emit option vs FASM?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Blog post !

Post by Fred »

goto end: is always generated when using ProcedureReturn, even if there is no code in between (last statement of the procedure). It is suppressed by the C optimizer, don't worry. The debugger works the same, but some functions/check are not yet supported.
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Blog post !

Post by NicTheQuick »

If you have a bigger project with lots of includes, is the Purebasic compiler going to crunch that into a single C code file? Or will the include structure persists? Because only that way you will have fast compiling times when you change just one file.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Blog post !

Post by skywalk »

Yes, makes sense for the C optimizer.
I also like the C format you showed. Allman style is by far the easiest to read.

NicTheQuick - SQLite also does an amalgamated C file prior to compilation and it is indeed slow to compile.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Blog post !

Post by NicTheQuick »

skywalk wrote: Fri Apr 23, 2021 1:16 pmI also like the C format you showed. Allman style is by far the easiest to read.
Nice. I didn't know about the names of these styles. I prefer K&R. It's more compact and also easy to read.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Blog post !

Post by skywalk »

Trust me, K&R is horrible when the code gets large and inline comments and multiple developers.
Allman solves all that noise.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Blog post !

Post by Kiffi »

NicTheQuick wrote: Fri Apr 23, 2021 1:29 pmI prefer K&R. It's more compact and also easy to read.
+1

@skywalk: 2:1 :P
Hygge
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Blog post !

Post by skywalk »

Fred's code was Allman sooooo, 2=2, tie!
But look to the polling and see Allman wins there too. :P
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
NicTheQuick
Addict
Addict
Posts: 1224
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Blog post !

Post by NicTheQuick »

skywalk wrote: Fri Apr 23, 2021 1:38 pmFred's code was Allman sooooo, 2=2, tie!
But look to the polling and see Allman wins there too. :P
Well, maybe the poll is that weird with its 7 digit percentage numbers because he uses Allman :P
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Blog post !

Post by Marc56us »

I didn't know these styles had names :shock: (thanks skywalk)
I also still prefer Allman to K&R although the latter is more readable when folded.
However, when I look at the examples from a distance, GNU indent style seems to be the best (PB display vertical lines, so more easy to read).

@Fred: Do you have tested with PellesC compiler (for Windows version). It's very fast but is he compatible with libs ? and is license and author agree ?

:wink:
gekkonier
User
User
Posts: 78
Joined: Mon Apr 23, 2007 9:42 am

Re: Blog post !

Post by gekkonier »

Hi!
I've just read about the plans to implement a c backend.
I enjoy!
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Blog post !

Post by Fred »

NicTheQuick wrote: Fri Apr 23, 2021 1:03 pm If you have a bigger project with lots of includes, is the Purebasic compiler going to crunch that into a single C code file? Or will the include structure persists? Because only that way you will have fast compiling times when you change just one file.
Unfortuntately, PureBasic is not built at all to generate several objs, so it is not possible.
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Blog post !

Post by skywalk »

Do you suggest we collapse our lib's to a dll or can we create static libs in the future?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
gekkonier
User
User
Posts: 78
Joined: Mon Apr 23, 2007 9:42 am

Re: Blog post !

Post by gekkonier »

Will we be able to procedurereturn structs?
In C it's possible, so that could be a thing, or?
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Blog post !

Post by User_Russian »

skywalk wrote: Sun Apr 25, 2021 4:19 pmDo you suggest we collapse our lib's to a dll or can we create static libs in the future?
Static libraries can be created even now.
This is done by the tools TailBite, coffit and etc. But unfortunately they are very dependent on the PB static libraries.
Switching to C won't change anything and the dependencies will remain.
Post Reply