Wishlist for PureBasic v4.0
I'm all for speed and saving of resources but I just ran into the 64k limit a few days ago with a SQL query (yes, that's one mother of an SQL query I realize...)
What I don't like about the hard 64k limit is that I don't want to have to bounds check every single string variable to make sure that user-entered data isn't going to bomb out my application. I'm fine with a fixed limit but 64k just seems low. It's entirely possible for me to have a single text variable at approach 64k to the point that I need to add several checks (like my SQL query I mentioned).. The worst part about what happened today is that since the SQLite exec procedure expects the query to be in a single string there is no workaround except to increase the amount of data that string variable can hold. Same is probably true for the ODBC procedures I'd expect.. I can increase string size now so I'll try it and see what happens..
If the default size was 500k or a meg then I'd probably never worry about it but until then it's a small but bothersome little issue.
What I don't like about the hard 64k limit is that I don't want to have to bounds check every single string variable to make sure that user-entered data isn't going to bomb out my application. I'm fine with a fixed limit but 64k just seems low. It's entirely possible for me to have a single text variable at approach 64k to the point that I need to add several checks (like my SQL query I mentioned).. The worst part about what happened today is that since the SQLite exec procedure expects the query to be in a single string there is no workaround except to increase the amount of data that string variable can hold. Same is probably true for the ODBC procedures I'd expect.. I can increase string size now so I'll try it and see what happens..
If the default size was 500k or a meg then I'd probably never worry about it but until then it's a small but bothersome little issue.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
- newtheogott
- Enthusiast
- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
>Ok, just to get this straight: You guys are asking for a much slower string management, so you don't have to care about anything, and then you want to use that allready slow system, to handle a big amout of data...
Exactly.
"WE guys" have a Pentium IV or a AMD 2000+ and we as you say, we "don't want to have to care about anything". Thats just what we want.
I guess you can understand the point. SPEED is not our problem when we design a sollution, we accept that actual hardware IS fast enough for nearly anything. IF NOT we can still use a method where we use "lower level functions".
And as I said, I personally do not like C for some personal reasons. And though I (and many other Ex-Atari C-64, and other Home-Computer Users) have done things in that ways allways, we would like to do things in that way in future, too.
Much slower?
Depends on how often you change string-lenght.
I am just thinking IF it would be possible to implement "LongStrings" as a user-defined Datatype (with a Library?). can anyone of the Purebasic-Experts make a statement about that?
It may use commands like L_MID$ or L_STR$ or L_LEN() etc.
Exactly.
"WE guys" have a Pentium IV or a AMD 2000+ and we as you say, we "don't want to have to care about anything". Thats just what we want.
I guess you can understand the point. SPEED is not our problem when we design a sollution, we accept that actual hardware IS fast enough for nearly anything. IF NOT we can still use a method where we use "lower level functions".
And as I said, I personally do not like C for some personal reasons. And though I (and many other Ex-Atari C-64, and other Home-Computer Users) have done things in that ways allways, we would like to do things in that way in future, too.
Much slower?
Depends on how often you change string-lenght.
I am just thinking IF it would be possible to implement "LongStrings" as a user-defined Datatype (with a Library?). can anyone of the Purebasic-Experts make a statement about that?
It may use commands like L_MID$ or L_STR$ or L_LEN() etc.
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
> allocation and deallocation. Then why don't you do so? It
> actually works,
sorry but you are wrong, as soon as there is a zero somewhere in the string it is truncated, nah, let me put that different: to me it appears to be truncated, and i would assume that garbage collection would truncate it
i could be wrong, of course...
are you telling me now that a string is not truncated, unless i do something with it? but then, what's the point of using it as a buffer as i cannot touch it? or fill it with a string in another way than poke the string into it, which defies the purpose
> Ok, some people now say: But i want to put a 5MB file in my string,
> and manipulate it from there.
an often used practice in (older / other) basics
> Ok, just to get this straight: You guys are asking for a much slower
> string management, so you don't have to care about anything, and
> then you want to use that allready slow
> system, to handle a big amout of data...
why would it be slower? anyway, it would be easier
and that's what basic is all about to me! 
but about speed... if fixed length strings existed, there would be no speed issue...
> offers easy to use memory management functions. What is so damn
> complicated about
> the AllocateMemory() command?
the command itself is not, the way to fill the memory is to me... to fill a string field in a struct i have to POKE it ?!?!? brrrr
> actually works,
sorry but you are wrong, as soon as there is a zero somewhere in the string it is truncated, nah, let me put that different: to me it appears to be truncated, and i would assume that garbage collection would truncate it
i could be wrong, of course...
are you telling me now that a string is not truncated, unless i do something with it? but then, what's the point of using it as a buffer as i cannot touch it? or fill it with a string in another way than poke the string into it, which defies the purpose

> Ok, some people now say: But i want to put a 5MB file in my string,
> and manipulate it from there.
an often used practice in (older / other) basics
> Ok, just to get this straight: You guys are asking for a much slower
> string management, so you don't have to care about anything, and
> then you want to use that allready slow
> system, to handle a big amout of data...
why would it be slower? anyway, it would be easier


but about speed... if fixed length strings existed, there would be no speed issue...
> offers easy to use memory management functions. What is so damn
> complicated about
> the AllocateMemory() command?
the command itself is not, the way to fill the memory is to me... to fill a string field in a struct i have to POKE it ?!?!? brrrr
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
You are in the case of Windows anyway. All memory allocation sizes are tracked so you do not need to try to figure out the length of the string before freeing its memory, just call the deallocation function. You can stick as many Chr(0) into your string, it really all will be freed :)blueznl wrote:> allocation and deallocation. Then why don't you do so? It
> actually works,
sorry but you are wrong, as soon as there is a zero somewhere in the string it is truncated, nah, let me put that different: to me it appears to be truncated, and i would assume that garbage collection would truncate it
i could be wrong, of course...
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Is this a wishlist for PB 4.0?
Then i want an speed increment for ASM execution.
Are there a potentiometer for the machine code speed and only Fred knows it?
Who is able to explain me this phenomen?:
Then i want an speed increment for ASM execution.
Are there a potentiometer for the machine code speed and only Fred knows it?

Who is able to explain me this phenomen?:
Code: Select all
r.l=-234.234234
ff=gettickcount_()
For t=0 To 10000000
Abs(r)
Next
Debug gettickcount_()-ff
; ---------------------------------
ff=gettickcount_()
For t=0 To 10000000
!fld dword[v_r]
!fabs
Next
Debug gettickcount_()-ff
You're not clearing the FPU stack between operations, that's why your version is slower than the PB one! BTW have you looked at the asm output of PB for this command? You will see that it's already as fast as it gets because the command Abs() is translated into asm directly(inline) so there isn't any call to a function at all.
- newtheogott
- Enthusiast
- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
Go and buy an Athlon 64FX
>Then i want an speed increment for ASM execution.
The speed-incremet is builtin the new Athlon 64 FX.
Get it and fly.
The speed-incremet is builtin the new Athlon 64 FX.
Get it and fly.

--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
bluenzl wrote:sorry but you are wrong, as soon as there is a zero somewhere in the string it is truncated, nah, let me put that different: to me it appears to be truncated, and i would assume that garbage collection would truncate it
i could be wrong, of course...
But isn't blueznl's point that the string may be truncated before you want it to be?tinman wrote:You are in the case of Windows anyway. All memory allocation sizes are tracked so you do not need to try to figure out the length of the string before freeing its memory, just call the deallocation function. You can stick as many Chr(0) into your string, it really all will be freed
Whether it is truncated or not is only part of the problem really. You need to know for sure what the OS will do with language constructs both now and in the future on whatever OS you are using. Isn't that the point of using a high level language? To transfer this sort of detail to the compiler writer and away from the application writers?
> You need to know for sure what the OS will do with language constructs
> both now and in the future on whatever OS you are using.
If you want to achieve this, you have to use the proper functions. Misusing
Strings for data storage out of COMPLETE LAZYNESS is the wrong way here.
Timo
> both now and in the future on whatever OS you are using.
If you want to achieve this, you have to use the proper functions. Misusing
Strings for data storage out of COMPLETE LAZYNESS is the wrong way here.
Timo
quidquid Latine dictum sit altum videtur
- newtheogott
- Enthusiast
- Posts: 120
- Joined: Sat Apr 26, 2003 2:52 pm
- Location: Germany, Karlsruhe
- Contact:
... is the wrong place here ti use standard BASIC?
Thats not a thing like the GOTO.
To use strings on Binary or lets talk about BIG Text-Files
is not a question of missuse or Lazyness.
Its just a question of "ease-of doing". However if you never
used the normal string-possibilities on Textfiles you wont
understand.
A$=LEN(B)
C$=Left$(A$,2)
Replace T$ in A$ with D$
Thats just more elegant then doing it in any other way. Besides
the word STRINGS and the sign $ -as its used in common BASIC Languages - implies that you could do this.
To use strings on Binary or lets talk about BIG Text-Files
is not a question of missuse or Lazyness.
Its just a question of "ease-of doing". However if you never
used the normal string-possibilities on Textfiles you wont
understand.
A$=LEN(B)
C$=Left$(A$,2)
Replace T$ in A$ with D$
Thats just more elegant then doing it in any other way. Besides
the word STRINGS and the sign $ -as its used in common BASIC Languages - implies that you could do this.
--Theo Gottwald
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
-----------------------------------------
http://www.it-berater.org * http://www.fa2.de * http://www.smart-package.com
It's a programming language Timo, not a fundamentalist religion, stay cool.freak wrote:
If you want to achieve this, you have to use the proper functions. Misusing
Strings for data storage out of COMPLETE LAZYNESS is the wrong way here
People have been processing binary data using Basic strings for several decades.
Where are your "tablets of stone" that say this is now considered "misuse".
for a small fee i can provide you all with some stone tablets 
if you keep your final words somewhat short (less than 64000 characters please) that will do fine...


if you keep your final words somewhat short (less than 64000 characters please) that will do fine...

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )