<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Forum du club des développeurs et IT Pro - PureBasic</title>
		<link>https://www.developpez.net/forums/</link>
		<description />
		<language>fr</language>
		<lastBuildDate>Fri, 17 Apr 2026 09:26:28 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>15</ttl>
		<image>
			<url>https://forum.developpez.be/images/misc/rss.png</url>
			<title>Forum du club des développeurs et IT Pro - PureBasic</title>
			<link>https://www.developpez.net/forums/</link>
		</image>
		<item>
			<title>PureBasic 6.40 alpha 1 est disponible, avec une surprise !</title>
			<link>https://www.developpez.net/forums/showthread.php?t=2181686&amp;goto=newpost</link>
			<pubDate>Fri, 23 Jan 2026 17:56:28 GMT</pubDate>
			<description><![CDATA[Hi everyone ! 
 
That's it,...]]></description>
			<content:encoded><![CDATA[<div>Hi everyone !<br />
<br />
That's it, we finally decided to rework the internal stringmanager from the ground up ! The stringmanager hasn't changed since the PureBasic<br />
creation almost 30 years ago, so it wasn't an easy decision to make because major modification for the compilers were needed and all the functions returning a string were impacted. But it's here with the 6.40 alpha 1, only available for the C back-end on Windows x64. The idea is to validate the new stringmanager to see if there is any showstopper before porting the modification to the x86 and x64 asm compilers which will takes time.<br />
<br />
I will share some internal information about it:<br />
<br />
- It should be 99% backward compatible. We will discuss edge case below.<br />
<br />
- All strings are now prefixed by their length (except the strings in DataSection). The last bit of this prefix is used for a temporary flag.<br />
That means than all string operation will have instant length information resulting in faster operation as iterating byte by byte on the string to find the null terminated char is no more needed.<br />
The strings are still null terminated, so no change are needed in client code.<br />
<br />
- Still no garbage collector<br />
<br />
- The string manager doesn't have a per thread shared buffer anymore for temporary strings. That means there is no global variable to save the current position and the thread mode will have no performance hit. All is now done as new temporary string which will be used as final string if assigned. That removes useless string copy and is much more streamlined.<br />
<br />
Example:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">a$ = b$+c$</code><hr />
</div>Old:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br /></div></td><td valign="top"><pre style="margin: 0">SYS_PushStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span>; // current position <span style="color: #0000ff;">in</span> the <span style="color: #0000ff;">shared</span> buffer <span style="color: #0000ff;">is</span> saved <span class="br0">&#40;</span>costly <span style="color: #0000ff;">in</span> threaded mode<span class="br0">&#41;</span>
SYS_CopyString<span class="br0">&#40;</span>v_bS<span class="br0">&#41;</span>; // <span style="color: #0000ff;">string</span> <span style="color: #0000ff;">is</span> copied <span style="color: #0000ff;">on</span> the per thread <span style="color: #0000ff;">shared</span> buffer 
SYS_CopyString<span class="br0">&#40;</span>v_cS<span class="br0">&#41;</span>;
SYS_AllocateString4<span class="br0">&#40;</span>&amp;v_aS,SYS_PopStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; // Position <span style="color: #0000ff;">is</span> restored <span style="color: #0000ff;">and</span> <span style="color: #0000ff;">string</span> <span style="color: #0000ff;">is</span> allocated</pre></td></tr></table></code><hr />
</div><br />
New:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br /></div></td><td valign="top"><pre style="margin: 0">s1=SYS_ConcatString<span class="br0">&#40;</span>v_cS,v_bS<span class="br0">&#41;</span>; // A temporary <span style="color: #0000ff;">string</span> <span style="color: #0000ff;">is</span> created here
SYS_NewString<span class="br0">&#40;</span>&amp;v_aS,s1<span class="br0">&#41;</span>; // The temporary <span style="color: #0000ff;">string</span> <span style="color: #0000ff;">is</span> directly used <span class="br0">&#40;</span>temporary bit removed<span class="br0">&#41;</span></pre></td></tr></table></code><hr />
</div><br />
It's a very basic case, but it shows the improvement by avoiding useless string copy and global variable preservation<br />
<br />
- Optimized procedure parameters passing. If a string parameter isn't modified in the procedure, it will not be duplicated in the procedure. For example<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br /></div></td><td valign="top"><pre style="margin: 0">Procedure.s a<span class="br0">&#40;</span>a$, b$<span class="br0">&#41;</span>
  ProcedureReturn UCase<span class="br0">&#40;</span>a$<span class="br0">&#41;</span> + LCase<span class="br0">&#40;</span>b$<span class="br0">&#41;</span>
EndProcedure</pre></td></tr></table></code><hr />
</div>Here the a$ and b$ are just referenced and won't be duplicated. In the older system, all the string parameters were duplicated.<br />
<br />
Even better, the procedure 'a()' will return a temporary string which will be directly assigned to Result$ (no extra allocation/copy):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Result$ = a<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Hello&quot;</span>, <span style="color: #FF0000;">&quot;World&quot;</span><span class="br0">&#41;</span></code><hr />
</div>Here are the case where the parameters will be duplicated<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td valign="top"><pre style="margin: 0">Procedure.s a<span class="br0">&#40;</span>a$, b$<span class="br0">&#41;</span>
  a$ = <span style="color: #FF0000;">&quot;-&quot;</span>+a$ ; Here, the a$ will be duplicated at procedure start, <span style="color: #0000ff;">as</span> it<span style="color: #808080;">'s modified.</span>
  ProcedureReturn UCase<span class="br0">&#40;</span>a$<span class="br0">&#41;</span> + LCase<span class="br0">&#40;</span>b$<span class="br0">&#41;</span>
EndProcedure
&nbsp;
Procedure.s a<span class="br0">&#40;</span>a$, b$<span class="br0">&#41;</span>
  *Cursor = @a$ ; Will also be duplicated <span style="color: #0000ff;">as</span> getting the pointer allow modification
  ProcedureReturn UCase<span class="br0">&#40;</span>a$<span class="br0">&#41;</span> + LCase<span class="br0">&#40;</span>b$<span class="br0">&#41;</span>
EndProcedure</pre></td></tr></table></code><hr />
</div>- The string functions don't have an hidden parameter anymore, allowing better code generation<br />
<br />
c$ = Str(150)<br />
<br />
Old:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br /></div></td><td valign="top"><pre style="margin: 0">SYS_PushStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span>;
SYS_PushStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span>;
PB_Str<span class="br0">&#40;</span><span style="color: #cc66cc;">150</span>LL,SYS_PopStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;
SYS_AllocateString4<span class="br0">&#40;</span>&amp;v_cS,SYS_PopStringBasePosition<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</pre></td></tr></table></code><hr />
</div>New:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br /></div></td><td valign="top"><pre style="margin: 0">void *r5=PB_Str<span class="br0">&#40;</span><span style="color: #cc66cc;">150</span>LL<span class="br0">&#41;</span>;
SYS_NewString<span class="br0">&#40;</span>&amp;v_cS,r5<span class="br0">&#41;</span>;</pre></td></tr></table></code><hr />
</div>- For PureBasic function returning a string, it's possible to tag a parameter as 'reusable' to avoid extra allocation when a temporary string is passed. For now, only LCase() and UCase() uses this, but it greatly improves their performances:<br />
<br />
Ex:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">a$ = UCase<span class="br0">&#40;</span>b$ + c$<span class="br0">&#41;</span></code><hr />
</div>The allocation is done when concatenating 'b$' + 'c$', then the UCase() function directly change the buffer with upper case character and returns the same buffer which is assigned to a$. So only one allocation occurred and no extra copy were performed.<br />
<br />
- The 'mimalloc' memory manager has been integrated in PureBasic for all dynamic allocation to have a very fast and optimized memory allocator for all internal functions. More info here: <a rel="nofollow" href="https://github.com/microsoft/mimalloc" target="_blank">https://github.com/microsoft/mimalloc</a><br />
<br />
- Overall the performances should be much better, but there will be probably some case were it won't ! Feel free to test it and bench it with your own code (my speed test suite show major improvement (up to 10x) on most tests). For example this one is 9x faster:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="26"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td valign="top"><pre style="margin: 0">Start = ElapsedMilliseconds<span class="br0">&#40;</span><span class="br0">&#41;</span>
a$ = <span style="color: #FF0000;">&quot;World WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld WorldWorld World&quot;</span>
<span style="color: #0000ff;">For</span> l = <span style="color: #cc66cc;">0</span> <span style="color: #0000ff;">To</span> <span style="color: #cc66cc;">1000</span>
  b$ = b$ + a$ 
<span style="color: #0000ff;">Next</span>
&nbsp;
PrintN<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Final length = &quot;</span> + Str<span class="br0">&#40;</span>Len<span class="br0">&#40;</span>b$<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
PrintN<span class="br0">&#40;</span><span style="color: #FF0000;">&quot;Large concat: &quot;</span>+Str<span class="br0">&#40;</span>ElapsedMilliseconds<span class="br0">&#40;</span><span class="br0">&#41;</span> - Start<span class="br0">&#41;</span> + <span style="color: #FF0000;">&quot; ms&quot;</span><span class="br0">&#41;</span></pre></td></tr></table></code><hr />
</div>- Edge cases:<br />
<br />
We tried to do the migration as painless as possible, but there is some case where code change will be required. Basically if you patch a string by putting a zero in it, the Len() function will be wrong, and the concat functions will fail. You will need to use PeekS() for this.<br />
You can take a look to the needed modification for the IDE to work with the new stringmanager, it's very light: <a rel="nofollow" href="https://github.com/fantaisie-software/purebasic/pull/344/files" target="_blank">https://github.com/fantaisie-software/p ... /344/files</a><br />
<br />
Using Win32 API with Space() for example will require an extra PeekS(). If you find other issues, don't hesitate to share it, so I can take a look if it can be addressed or not.<br />
<br />
We hope this major rework will increase the PureBasic app efficiency. Don't hesitate to test it but don't use this build in prod, it's indeed not production ready yet !<br />
<br />
Have fun,<br />
<br />
The Fantaisie Software Team<br />
<br />
<a rel="nofollow" href="https://www.purebasic.fr/english/viewtopic.php?t=88238" target="_blank">Source de l'information</a></div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f911/autres-langages/autres-langages/basic/purebasic/">PureBasic</category>
			<dc:creator>comtois</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2181686/autres-langages/autres-langages/basic/purebasic/purebasic-6-40-alpha-1-disponible-surprise/</guid>
		</item>
		<item>
			<title>PureBasic 6.30 beta 1 est disponible sur votre compte</title>
			<link>https://www.developpez.net/forums/showthread.php?t=2178968&amp;goto=newpost</link>
			<pubDate>Mon, 01 Sep 2025 19:14:29 GMT</pubDate>
			<description>---Citation--- 
Hello...</description>
			<content:encoded><![CDATA[<div><div class="bbcode_container">
	<div class="bbcode_description">Citation:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			Hello everyone,<br />
<br />
I hope the holidays season was good ! The brand new beta of PureBasic is available on your online account. It mostly has features which were hanging on my TODO list since a while, and fix a few long time bugs in the process :). Here we go:<br />
<ul><li style=""> Added: Brand new HID library !</li><li style=""> Added: Add #PB_ListIcon_NoHeaders flag ListIconGadget()</li><li style=""> Added: Add #PB_Explorer_NoHeaders flag ExplorerListGadget()</li><li style=""> Added: Add Unicode() to create a dynamic unicode string like Ascii() and UTF8()</li><li style=""> Added: HeaderSection/EndHeaderSection to put C or ASM code outside the main() function</li><li style=""> Added: #PB_InputRequester_HandleCancel to have a special return for InputRequester() if the user cancelled it</li><li style=""> Added: Gzip encoding support for HttpRequest(), HttpRequestMemory(), RecieveHTTPFile() and RecieveHTTPMemory()</li><li style=""> Added: #PB_Menu_NativeImageSize tot CreateImageMenu() and CreatePopupImageMenu() to allow larger icons in menus (Windows)</li><li style=""> Added: #PB_2DDrawing_FastText for DrawingMode() to use have a faster text rendering (Windows).</li><li style=""> Added: #PB_Mail_NoSSLCheck and #PB_Mail_WeakSSL flags for SendMail() to ease tests.</li><li style=""> Added: Automatic BOM handling to CreateFile() and ReadFile()/OpenFile() with #PB_File_BOM flag</li><li style=""> Added: Changed x,y type for DisplaySprite/DisplayTransparentSprite() from integer to float (Not supported on DX9 or DX11 subsystem)</li><li style=""> Added: Placeholder support for StringGadget() with #PB_String_PlaceHolder flag</li><li style=""> Added: PackerCallback() to monitor and abort compression.</li><li style=""> Updated: Splitted the 2DDrawing lib with function which doesn't needed dependencies (<a rel="nofollow" href="https://www.purebasic.fr/english/viewtopic.php?t=87034" target="_blank">https://www.purebasic.fr/english/viewtopic.php?t=87034</a>)</li><li style=""> Changed: CreateImage() background color now takes full RGBA() color for 32-bit picture. #PB_Image_Transparent and #PB_Image_TransparentBlack can be used to set a transparent background with white or black antialising.</li></ul><br />
<br />
<br />
Have fun !<br />
<br />
The Fantaisie Software Team
			
		<hr />
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_description">Citation:</div>
	<div class="bbcode_quote printable">
		<hr />
		
			Here is an HID small example, but I don't have an HID device to test, so may be someone can test it. It's based on hidapi: <a rel="nofollow" href="https://github.com/libusb/hidapi" target="_blank">https://github.com/libusb/hidapi</a> . On Linux, it needs udev and libusb1.0 package to work:<br />
sudo apt install libusb-1.0-0-dev libudev-dev
			
		<hr />
	</div>
</div><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><table cellspacing="0" cellpadding="0"><tr><td valign="top" width="33"><div style="border: 1px dashed gray; padding-left: 5px; padding-right: 5px; margin-right: 5px; text-align: right; font-family: monospace">1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td valign="top"><pre style="margin: 0">#PB_HID_Path             = <span style="color: #cc66cc;">1</span>
#PB_HID_VendorId         = <span style="color: #cc66cc;">2</span>
#PB_HID_ProductId        = <span style="color: #cc66cc;">3</span>
#PB_HID_SerialNumber     = <span style="color: #cc66cc;">4</span>
#PB_HID_ReleaseNumber    = <span style="color: #cc66cc;">5</span>
#PB_HID_Manufacturer     = <span style="color: #cc66cc;">6</span>
#PB_HID_Product          = <span style="color: #cc66cc;">7</span>
#PB_HID_UsagePage        = <span style="color: #cc66cc;">8</span>
#PB_HID_Usage            = <span style="color: #cc66cc;">9</span>
#PB_HID_InterfaceNumber  = <span style="color: #cc66cc;">10</span>
#PB_HID_BusType          = <span style="color: #cc66cc;">11</span>
OpenConsole<span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
ExamineHIDs<span class="br0">&#40;</span><span class="br0">&#41;</span>
<span style="color: #0000ff;">While</span> NextHID<span class="br0">&#40;</span><span class="br0">&#41;</span>
&nbsp;
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_Product<span class="br0">&#41;</span>
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_Manufacturer<span class="br0">&#41;</span>
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_VendorId<span class="br0">&#41;</span>
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_ProductId<span class="br0">&#41;</span>
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_Path<span class="br0">&#41;</span>
  Debug HIDInfo<span class="br0">&#40;</span>#PB_HID_SerialNumber<span class="br0">&#41;</span>
<span style="color: #0000ff;">Wend</span></pre></td></tr></table></code><hr />
</div><a rel="nofollow" href="https://www.purebasic.fr/english/viewtopic.php?p=644806&amp;sid=3abd7d1e26787b34326bf06cf750a0ac#p644806" target="_blank">Source de l'information</a></div>

]]></content:encoded>
			<category domain="https://www.developpez.net/forums/f911/autres-langages/autres-langages/basic/purebasic/">PureBasic</category>
			<dc:creator>comtois</dc:creator>
			<guid isPermaLink="true">https://www.developpez.net/forums/d2178968/autres-langages/autres-langages/basic/purebasic/purebasic-6-30-beta-1-disponible-compte/</guid>
		</item>
	</channel>
</rss>
