Page 17 of 22
Re: Blog post !
Posted: Fri Apr 23, 2021 12:03 pm
by skywalk
Why does
Goto end;
End:
Appear in the syntax conversion?
How does the debugger work with the C emit option vs FASM?
Re: Blog post !
Posted: Fri Apr 23, 2021 12:51 pm
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.
Re: Blog post !
Posted: Fri Apr 23, 2021 1:03 pm
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.
Re: Blog post !
Posted: Fri Apr 23, 2021 1:16 pm
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.
Re: Blog post !
Posted: Fri Apr 23, 2021 1:29 pm
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.
Re: Blog post !
Posted: Fri Apr 23, 2021 1:33 pm
by skywalk
Trust me, K&R is horrible when the code gets large and inline comments and multiple developers.
Allman solves all that noise.
Re: Blog post !
Posted: Fri Apr 23, 2021 1:36 pm
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

Re: Blog post !
Posted: Fri Apr 23, 2021 1:38 pm
by skywalk
Fred's code was Allman sooooo, 2=2, tie!
But look to the polling and see Allman wins there too.

Re: Blog post !
Posted: Fri Apr 23, 2021 1:45 pm
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.

Well, maybe the poll is that weird with its 7 digit percentage numbers because he uses Allman

Re: Blog post !
Posted: Fri Apr 23, 2021 2:08 pm
by Marc56us
I didn't know these styles had names

(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 ?

Re: Blog post !
Posted: Sat Apr 24, 2021 12:24 pm
by gekkonier
Hi!
I've just read about the plans to implement a c backend.
I enjoy!
Re: Blog post !
Posted: Sun Apr 25, 2021 3:52 pm
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.
Re: Blog post !
Posted: Sun Apr 25, 2021 4:19 pm
by skywalk
Do you suggest we collapse our lib's to a dll or can we create static libs in the future?
Re: Blog post !
Posted: Sun Apr 25, 2021 5:08 pm
by gekkonier
Will we be able to procedurereturn structs?
In C it's possible, so that could be a thing, or?
Re: Blog post !
Posted: Sun Apr 25, 2021 7:51 pm
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.