a question for Fred
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Hello !!
You can write your own LIBs.
Examples (ASM + C) are included
in the Directory "Library SDK".
If you want to write new Funktions
(Procedures) in PureBasic, just
include the File "Proc.inc" with
your Procedures in it.
cya,
...Danilo
(registered PureBasic user)
Hello !!
You can write your own LIBs.
Examples (ASM + C) are included
in the Directory "Library SDK".
If you want to write new Funktions
(Procedures) in PureBasic, just
include the File "Proc.inc" with
your Procedures in it.
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
Hi,
Yes i know, i mean:
Did PureBasic will generate its own libs some day?
Without all those steps.
If i make some function (per example) maybe i want to 'compile' it like lib, it will be very nice to get this feature directly from PureBasic
Hi,
Yes i know, i mean:
Did PureBasic will generate its own libs some day?
Without all those steps.
If i make some function (per example) maybe i want to 'compile' it like lib, it will be very nice to get this feature directly from PureBasic
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Danilo, I suppose Ricardo knew what you said.
What he ask for is the possibility to write lib's with PureBasic instead of ASM or C!
So you don't need include files with a bunch of procedures.
If you look in the forum you will find several discussions about that topic.
Have a nice day...
Franco
Danilo, I suppose Ricardo knew what you said.
What he ask for is the possibility to write lib's with PureBasic instead of ASM or C!
So you don't need include files with a bunch of procedures.
If you look in the forum you will find several discussions about that topic.
Have a nice day...
Franco
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
I dont recommend that.
The LIBs should be optimized ASM only.
Anyway, if you write own Procedures
in an include file, its the same.
Your Procedure is CALLed by PureBasic,
same as a LIB routine...
So what ??
cya,
...Danilo
(registered PureBasic user)
I dont recommend that.
The LIBs should be optimized ASM only.
Anyway, if you write own Procedures
in an include file, its the same.
Your Procedure is CALLed by PureBasic,
same as a LIB routine...
So what ??
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
Yes Franco, you understand me.
I want to learn, thats all.
Maybe if i can make my LIBs directly from PB and see my commented ASM source,
then i can learn a lot, because every change i made i will check again, etc.
Because its easier (and maybe some other reasons)
I want to learn thats why i ask this feature.
I imagine that every new user want to learn and maybe a lot of them will think in the same way that im thinking now.
Thanks
Yes Franco, you understand me.
Well, let me make my own unoptimized LIbs ha haI dont recommend that.
The LIBs should be optimized ASM only.
I want to learn, thats all.
Maybe if i can make my LIBs directly from PB and see my commented ASM source,
then i can learn a lot, because every change i made i will check again, etc.
Yes, but if we think in that way, then why does PB uses LIBs instead include files?Anyway, if you write own Procedures
in an include file, its the same.
Your Procedure is CALLed by PureBasic,
same as a LIB routine...
Because its easier (and maybe some other reasons)
I want to learn thats why i ask this feature.
I imagine that every new user want to learn and maybe a lot of them will think in the same way that im thinking now.
Thanks
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Hello ricardo !!
I can understand you too.
But i think its not needed:
>Well, let me make my own unoptimized LIbs ha ha
>I want to learn, thats all.
Yeah, and everybody is writing LIBs then.
Professionals and Newbies too.
You loose 5 clocks here, 23 clocks there,
and 400 clocks in this Procedure.
I think thats not the thing PB is made for -
slow and bloated code.
If every Beginner can make own LIBs,
its the "start of the end" of the optimized
PureBasic.
>Maybe if i can make my LIBs directly from PB
>and see my commented ASM source, then i can learn a lot,
>because every change i made i will check again, etc.
Its the *same* if you put a procedure in
your Source and look at the generated
ASM-Output (if you can read it).
Look at the ASM-output and see what happens
if you use "a = a - 1" instead of "a-1"...
>Yes, but if we think in that way, then why
>does PB uses LIBs instead include files?
The PureBasic LIBs are only Assembly .OBJ-Files
and Description files for the Commands inside the LIB.
If you know ASM, you would understand how the
.OBJ-stuff works.
>Because its easier (and maybe some other reasons)
No, its not easier - its nearly the same.
Yes, there are 2 differences:
1.) you have to use the include command
for your Procedure-file (wow, big problem
2.) The Description file is missing, so you
dont get help for the new command/procedure (F1).
Point 2 is a seriously problem.
Forget point 1.
>I want to learn thats why i ask this feature.
>I imagine that every new user want to learn and
>maybe a lot of them will think in the same way
>that im thinking now.
Do you want PureBasic to become bloated
and slow like Visual Basic ??
If you dont want that, you should (try to)
understand why its not good that every
Beginner can code own LIBs.
I can understand your thinking
and you cant understand me.
If you were a Assembly programmer for a few
years you would understand my point here...
cya,
...Danilo
(registered PureBasic user)
Hello ricardo !!
I can understand you too.
But i think its not needed:
>Well, let me make my own unoptimized LIbs ha ha
>I want to learn, thats all.
Yeah, and everybody is writing LIBs then.
Professionals and Newbies too.
You loose 5 clocks here, 23 clocks there,
and 400 clocks in this Procedure.
I think thats not the thing PB is made for -
slow and bloated code.
If every Beginner can make own LIBs,
its the "start of the end" of the optimized
PureBasic.
>Maybe if i can make my LIBs directly from PB
>and see my commented ASM source, then i can learn a lot,
>because every change i made i will check again, etc.
Its the *same* if you put a procedure in
your Source and look at the generated
ASM-Output (if you can read it).
Look at the ASM-output and see what happens
if you use "a = a - 1" instead of "a-1"...
>Yes, but if we think in that way, then why
>does PB uses LIBs instead include files?
The PureBasic LIBs are only Assembly .OBJ-Files
and Description files for the Commands inside the LIB.
If you know ASM, you would understand how the
.OBJ-stuff works.
>Because its easier (and maybe some other reasons)
No, its not easier - its nearly the same.
Yes, there are 2 differences:
1.) you have to use the include command
for your Procedure-file (wow, big problem

2.) The Description file is missing, so you
dont get help for the new command/procedure (F1).
Point 2 is a seriously problem.
Forget point 1.
>I want to learn thats why i ask this feature.
>I imagine that every new user want to learn and
>maybe a lot of them will think in the same way
>that im thinking now.
Do you want PureBasic to become bloated
and slow like Visual Basic ??
If you dont want that, you should (try to)
understand why its not good that every
Beginner can code own LIBs.
I can understand your thinking
and you cant understand me.
If you were a Assembly programmer for a few
years you would understand my point here...
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
it so that any libs written in PureBasic must have a filename starting
with "PB_" so that we can identify and choose not to use them, and they should
not work if the user takes the "PB_" off the front of the name.
ASM and can't understand why it's the ultimate language for coding.
Edited by - PB on 14 December 2001 20:50:27
I agree. Libs should be ASM (and maybe C) only. Or, perhaps Fred could makeIf every Beginner can make own LIBs,
its the "start of the end" of the optimized
PureBasic.
it so that any libs written in PureBasic must have a filename starting
with "PB_" so that we can identify and choose not to use them, and they should
not work if the user takes the "PB_" off the front of the name.
I think that's the problem... too many PureBasic users have no experience withIf you were a Assembly programmer for a few
years you would understand my point here...
ASM and can't understand why it's the ultimate language for coding.
Edited by - PB on 14 December 2001 20:50:27
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
>Look at the ASM-output and see what happens
>if you use "a = a - 1" instead of "a-1"...
Sorry, bad example...
Look at this:
;-----
a.l = 12
a = a + 1
a+1
INC a
MessageRequester("15",Str(a),0)
;-----
ASM-Output:
;-----
; a.l = 12
MOV dword [v_a],12
; a = a + 1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; a+1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; INC a
INC dword [v_a]
;
; MessageRequester("15",Str(a),0)
[...]
;-----
"INC a" is inline Assembly
and the same as "a+1" or "a=a+1".
The difference is the produced
code...
cya,
...Danilo
(registered PureBasic user)
>Look at the ASM-output and see what happens
>if you use "a = a - 1" instead of "a-1"...
Sorry, bad example...

Look at this:
;-----
a.l = 12
a = a + 1
a+1
INC a
MessageRequester("15",Str(a),0)
;-----
ASM-Output:
;-----
; a.l = 12
MOV dword [v_a],12
; a = a + 1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; a+1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; INC a
INC dword [v_a]
;
; MessageRequester("15",Str(a),0)
[...]
;-----
"INC a" is inline Assembly
and the same as "a+1" or "a=a+1".
The difference is the produced
code...
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Paul.
I agree with Danilo...
Libraries should only be created using optimized ASM.
I use PB because of its speed and small file size.
If someone wants to write their own PB libraries then they should learn ASM, if not, there is nothing wrong with using Includes. Like Danilo said, an Include would really be no different than if PB could create its own libraries.
Why would anyone want bloated code if it could be avoided?
I agree with Danilo...
Libraries should only be created using optimized ASM.
I use PB because of its speed and small file size.
If someone wants to write their own PB libraries then they should learn ASM, if not, there is nothing wrong with using Includes. Like Danilo said, an Include would really be no different than if PB could create its own libraries.
Why would anyone want bloated code if it could be avoided?
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
To all ASM coder, I can understand your opinions but:
Now imagine this scenario - there are some users that use PureBasic and think:
"Hey this is great stuff..., let's start to learn ASM to make libs..." (like me...)
and everybody with more brain that I have, is starting to make libs... and they say:
"Well I don't know exactly why it works (found some asm snippets in the net...) but, what the... it works! - Great!"
I hope I have made my point clear.
I don't know who in this forum (except Fred) is a asm guru (they dreams are in pure inline ASM...) and is able to code really optimized code!
But on the other hand I hope that many users with a bit asm knowledge participate with libs, because Fred has only 24 hours a day to improve PureBasic with tons of commands and bugfixes.
I'm not a ASM coder and I can't say if a lib is coded from a 'experienced' asm coder or not and is really optimized or not!
As an example the Registry lib is not working anymore, why?
It's bad code? Is the PureBasic compiler guilty? Well I don't know.
My conclusion:
The more I use a users handmade lib, the more it can be that my programs don't work properly in the future - with a new release of PureBasic!
And what if a user don't want to use PureBasic anymore (or has no time anymore...) if he is not releasing the asm code of his libs, nobody can make changes, if they don't work someday!
The only thing that can help to know if a library is optimized or not is if the source code is open source and fred can take a look at it and say:
"This library is Fantaisie Software certified!"
Am I totally wrong?
Have a nice day...
Franco
Edited by - Franco on 14 December 2001 23:50:07
To all ASM coder, I can understand your opinions but:
Now imagine this scenario - there are some users that use PureBasic and think:
"Hey this is great stuff..., let's start to learn ASM to make libs..." (like me...)
and everybody with more brain that I have, is starting to make libs... and they say:
"Well I don't know exactly why it works (found some asm snippets in the net...) but, what the... it works! - Great!"
I hope I have made my point clear.
I don't know who in this forum (except Fred) is a asm guru (they dreams are in pure inline ASM...) and is able to code really optimized code!
But on the other hand I hope that many users with a bit asm knowledge participate with libs, because Fred has only 24 hours a day to improve PureBasic with tons of commands and bugfixes.
I'm not a ASM coder and I can't say if a lib is coded from a 'experienced' asm coder or not and is really optimized or not!
As an example the Registry lib is not working anymore, why?
It's bad code? Is the PureBasic compiler guilty? Well I don't know.
My conclusion:
The more I use a users handmade lib, the more it can be that my programs don't work properly in the future - with a new release of PureBasic!
And what if a user don't want to use PureBasic anymore (or has no time anymore...) if he is not releasing the asm code of his libs, nobody can make changes, if they don't work someday!
The only thing that can help to know if a library is optimized or not is if the source code is open source and fred can take a look at it and say:
"This library is Fantaisie Software certified!"
Am I totally wrong?
Have a nice day...
Franco
Edited by - Franco on 14 December 2001 23:50:07
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
Fred - AlphaSND
Hum, this recall me than I've turned off some optimieation in the compiler pipeline.. Must be fixed, hey this code is VB like (Hum, not really..).Look at this:
;-----
a.l = 12
a = a + 1
a+1
INC a
MessageRequester("15",Str(a),0)
;-----
ASM-Output:
;-----
; a.l = 12
MOV dword [v_a],12
; a = a + 1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; a+1
MOV ebx,dword [v_a]
ADD ebx,1
PUSH ebx
POP dword [v_a]
; INC a
INC dword [v_a]
;
; MessageRequester("15",Str(a),0)
[...]
;-----
Fred - AlphaSND
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
. Improved editor (Procedures or label jump in a combobox (Thx PB for the idea)), new Sprite3D library (realtime zooming, transform, alphablending etc... if 3D card is available), all know bugs fixed...
Enjoy !
Fred - AlphaSND
This makes me think to Microsoft.. Anyway, if anyone want, I'm ready to check/optimize some asm code. Even if ASM is the 'Pure' power I understand the Franco point of view and I will may be add a way to build PB lib inside PB, by using a compiler switch to enable/disable the use (load) of such libraries. Not for now tough, as I've lot of things to do before. Next release planned for the end of the next week (Christmas releaseThe only thing that can help to know if a library is optimized or not is if the source code is open source and fred can take a look at it and say:
"This library is Fantaisie Software certified!"

Enjoy !
Fred - AlphaSND
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
Hi,
I don't think that a begginer in LIBs will distribute his libs.
Maybe we want to make our own libs and we have the right to make unoptimized libs, just like we can make more or less optimized basic code.
I don't think that the users libs will be included on the PureBasic package, then everybody will be free to download it (if the user distributes it) or not.
I don't get why are some so concern about it
Everybody here are learning in some way and that is the point.
Hi,
I don't think that a begginer in LIBs will distribute his libs.
Maybe we want to make our own libs and we have the right to make unoptimized libs, just like we can make more or less optimized basic code.
I don't think that the users libs will be included on the PureBasic package, then everybody will be free to download it (if the user distributes it) or not.
I don't get why are some so concern about it
Everybody here are learning in some way and that is the point.