Page 1 of 1

Posted: Thu Oct 18, 2001 3:03 am
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.

Hi All PureBasic Users,

Please let me introduce myself for my first message on this forum...I am Roger Beausoleil, the first one who believes and helps Fred to create the main guide lines of PureBasic,... I remember when we started together ( Him in France and me in Canada )on our Old Amiga with something like 33mhz full ahead speed :wink:..., we used BlitzBasic for the elaboration of PureBasic.

Why I am talking you about all of this you gonna say... because I can't believe that if an old program like it can created its own libraries and worked on an old 33mhz, PureBasic Can't do it too with our new systems at 200mhz and more... WHY NOT WRITE LIBRARY WITH PUREBASIC?

I believe in past in the talent of Fred, And I still today! But I think that ASM speed can be replace by the speed of system or by the talent of other peoples that can optimize the source by some tips 'nd tricks... if coders let theirs sources as open source too...

I believe that... If all coders help each other in this kind of development... FRED will have more time to create a more flexible compiler for every kind of platforms or systems... as Windows 95/98 ME, Windows 2000, Windows XP, Linux and Amiga...

Thx... Roger

Posted: Thu Oct 18, 2001 3:26 am
by BackupUser
Restored from previous forum. Originally posted by PB.

The trouble is, libraries hand-written in ASM will ALWAYS be SMALLER and FASTER than those created by PB. It's a fact. It doesn't matter that newer PCs will make PB libraries faster. If you do libraries in PB, then PB becomes just like Visual Basic = bloated and yucky. One of the reasons I paid for PB is because I know it's made up of hand-optimized ASM routines, and not some bloated PB-written routines. :)

Edited by - PB on 18 October 2001 04:28:45

Posted: Thu Oct 18, 2001 4:30 am
by BackupUser
Restored from previous forum. Originally posted by Mr.Skunk.

Hi Roger, and welcome in the forum,

Yes, that's a very good question, with good arguments for and againts (and sorry for my bad english)...

Perhaps a good way might be to allow creation of libraries directly with PB, but having Functions with a special prefix or suffix that show the function had been written with PB.(PBCalendar or Calendar_PB for example.)

So everybody will be free to use them or not, and when an ASM coder see a good function and have time to code it, he could rewrite it in pure optimised ASM...

What do you think about this?


Mr Skunk

Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st

Edited by - mr.skunk on 18 October 2001 05:31:09

Posted: Thu Oct 18, 2001 7:08 am
by BackupUser
Restored from previous forum. Originally posted by Rings.

Mr.Skunk wrotes:
...that show the function had been written with PB.(PBCalendar or Calendar_PB for example.)

That's it Man !!!!
Anyone Can use selfmade Libs it Not.

I aggree.

Siggi

Posted: Thu Oct 18, 2001 11:10 am
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.

Hi Mr Skunk,

You understand the point very well... and, I would like to add this for users like PB who loves hand-writting ASM for every quality that it gives...

PureBasic is very powerfull and, gives to all users the possibilities to write code by using as well Basic Commands and Win32's... The only missing thing to PureBasic is its own possibilty to read and compile ASM! If Fred can add this lack to PureBasic everybody will can code libraries directly by using PureBasic...

Here's the real point that I would like to say... PureBasic... it's a very powerfull language... and, Its name is PUREBASIC and we should write ASM... I got hard time to understand...

And one of the most important thing is that we have to use OTHERS program to CODE and OPTIMIZE something that it CAN and SHOULD do by itself... as a language! I thing that PureBasic should still use asm for its libs, PureBasic should become a complete language by using asm itself... not a dialect!

Thx... Roger

Posted: Thu Oct 18, 2001 11:00 pm
by BackupUser
Restored from previous forum. Originally posted by PB.
The only missing thing to PureBasic is its own possibilty to read and compile ASM!
Do you want to write apps in ASM or PureBasic? :) In any event, I thought PureBasic fully supported inline ASM? Fred?

Mr Skunk: Yes, I like your idea of prefixing PB-written libraries with "PB" for identification. :)

Edited by - PB on 19 October 2001 00:02:03

Posted: Fri Oct 19, 2001 3:08 am
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.

[/quote]
Do you want to write apps in ASM or PureBasic?
[/quote]

Hi PB,

I think that PureBasic should accepts for a library coding as well the Basic, Win32/C, or asm as the user want or can use... I am gonna try to explain more clearly.

To create a lib PureBasic needs as a procedure ( as describe in the docs How to write libs ):

;- The header...
1) Library Name => PB_WindowLib
2) Return Argument => None
3) Arguments to be load => Long, String
4) External lib call => user32.lib
5) Name of Command => WindowTitle or PB_WindowTitle
6) Finaly The Code

Here and example of how Fred can adds this to PureBasic with the help of "Specifics Macro commands"... ( I Used Basic Mix with Win32... I do not know Asm )

LibraryName( "PB_WindowLib" )
CmdReturn ()
Argument_0 ( #PB_Long,#PB_String )
Argument_1 ( Arg_0, Arg_1 )
ExternalLib( "user32.lib", LibError )
CmdName ( "PB_WindowTitle" )

TheCode()
LibReturn SetWindowText_( Arg_0, Arg_1 )
EndCode()

LibError()
RequesterMessage( "Title","Lib not Load",#PB_RequesterMessage_Ok )
LibReturn 0
EndLibError()

EndOfLib()

When the lib sounds to be over, Maybe all written in Basic because the knowledge of the user... He/she can use Pure Basic to create a library file to be use later on... After some test, the coder can send the source to be optimize by anyone who have the time or the knowledge for it... to finally perhaps all be written in asm.

I think of the day that PureBasic will be able to creates its own library, We will see more specific commands for every systems without bugs... Because as you can see sometimes we send a source to everybody that works great with your Windows95/98 and bugs on version 2000. If Everybody can write library... we will see tons of commands like... WindowTitle_95 or WindowTitle_2000 and maybe PB_WindowTitle tested for all systems etc...

That's my vision for PureBasic...

Roger

Posted: Fri Oct 19, 2001 4:44 am
by BackupUser
Restored from previous forum. Originally posted by Mr.Skunk.

Hi,

To write libraries with PB, there is two method i think :

1- Fred can include these functions within the PBcompiler

2- As you write, Roger, we can use external libraries functions

I can't say anything about the first method, as i don't know how the PBcompiler is written, i don't know if it would be easy or not for Fred.

For the second method, there is some problems to solve :
As external libraries functions are always called by a CALL in the ASM source, the code is not linear in a PB program. So we can't really use external functions to really do libraries, but as faked functions. I'll explain.

1- compile the PB source with the PBcompiler.

2- launch an external program to read the ASM source.
This prog will look at the "faked" functions about libraries and thanks to these functions can "simply" extract all the info and code about the lib.
Then the program will write its own ASM file and descriptor file for the libraries.
The program has to take care about external calls of PB functions (extern), saving and restoring registers (or crash), flushing the stack at the end of the functions (or crash).
This part if not simple to do, as functions can be very complicated (a function can have more than one end point, and for each of this point, the stack and registers will be differents)
In fact, we need a little ASM parser to analyse the ASM source of the functions.
(or just to take care of registers and stack).

If you see another way (perhaps a simplier way) to do libraries with PB, tell me...


Mr Skunk

Mr Skunk's PureBasic Web Page
http://www.skunknet.fr.st

Posted: Tue Nov 06, 2001 12:36 pm
by BackupUser
Restored from previous forum. Originally posted by theogott.

Something to that topic:

1. The place to describe how fast or slow a library/Subprogram is, is not in the name of the library, but in the description/HTML-Help File.

2. To write programms in ASM is something special. Often people don't like Assembler, but an old saying is "Write in C and you get a Programm, write in ASM and you get MAGIC !".

3. For myself, I see Purebasic curretnly as an possibility, to write in ASM, but to make all I/O Operations, Screen-MenÜ's etc. "the easy way". And all that without long, endless headerfiles (C ... +++ ...). VB does not support any ASM currently :-(.

4. However, I think there could be added a Comment in the HTML-Help of an command which simply give a comment about what the programmer thinks "Low Level" or "Med.-Level" (=PB :) or "High-Level-Sub" (= C and up).

5. Also I'd prefer if there would be a programm/possibility, to combine the HELP-Files and the Libraries or any other idea to ensure, that I get also a working help file to any new library-command. Maybe an installer or checker-programm ?



*************************
The best time to do things is now !