<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DelphiTools.info &#187; News</title>
	<atom:link href="http://delphitools.info/category/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://delphitools.info</link>
	<description>SamplingProfiler, DWS and other Delphi tools</description>
	<lastBuildDate>Thu, 02 Feb 2012 11:33:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Meanwhile, in the DWScript SVN&#8230;</title>
		<link>http://delphitools.info/2012/02/02/meanwhile-in-the-dwscript-svn/</link>
		<comments>http://delphitools.info/2012/02/02/meanwhile-in-the-dwscript-svn/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 11:30:19 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[DWS]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1611</guid>
		<description><![CDATA[This summary of recent DWS changes is coming a bit late, and there is quite a bit to cover. Here is a quick, partial roundup of what changed since the last update. Language changes: Initial support for overloads (currently limited to standalone functions/procedures). New operator &#8220;sar&#8221; for bitwise shift arithmetic right. Delphi-like &#8220;dotted unit names&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://delphitools.info/dwscript"><img class="alignright size-full wp-image-1473" title="Logo DWScript" src="http://delphitools.info/wp-content/uploads/2011/11/logoDWS.gif" alt="" width="253" height="92" /></a>This summary of recent DWS changes is coming a bit late, and there is quite a bit to cover. Here is a quick, partial roundup of what changed since the last update.</p>
<p><strong>Language changes:</strong></p>
<ul>
<li>Initial support for overloads (currently limited to standalone functions/procedures).</li>
<li>New operator &#8220;<strong>sar</strong>&#8221; for bitwise shift arithmetic right.</li>
<li>Delphi-like &#8220;<em>dotted unit names</em>&#8221; are now supported.</li>
<li>Support for classic Delphi-style local procedures declaration in units (before the &#8220;begin&#8221;).</li>
<li>Support <em>const</em> &#8220;blocks&#8221; in units.</li>
<li>Support for <em>&#8220;array [TEnumeratedType] of</em>&#8221; short declaration for static arrays.</li>
<li>New hints for unused private symbols and redundant scope specifiers.</li>
<li>New built-in functions: <em>LastDelimiter</em>, dynamic array&#8217;s <em>Insert()</em>, <em>Min()</em>/<em>Max</em>() overloads.</li>
</ul>
<p><strong>Library and script engine changes:</strong></p>
<ul>
<li><em>TContextMap</em> &amp; <em>TSymbolDictionary</em> were renamed to <em>TdwsSourceContextMap</em> &amp; <em>TdwsSymbolDictionary</em>.</li>
<li>The context map content has been significantly reorganized, fixed and is now more detailed.</li>
<li><em>TdwsSuggestions</em> can now optionally suggest keywords too.</li>
<li>Random functions <a href="http://delphitools.info/2011/12/13/pimp-your-random-numbers-with-xorshift/">now based on XorShift</a>, with independent random per execution.</li>
<li>New demo/sample: simple web server based on Indy with multi-threaded server-side script execution.</li>
<li>Faster DWS SynEdit highlighter.</li>
<li>Improved documentation.</li>
<li>Various minor fixes and improvements.</li>
</ul>
<p><strong>JavaScript &amp; CodeGen changes:</strong></p>
<ul>
<li><a href="http://delphitools.info/2012/01/21/closures-in-dwscript-op4js/">Closures</a> are now supported by the JavaScript CodeGen.</li>
<li>Added Smart-Linking capabilities to the CodeGen when program is compiled with context map &amp; symbol dictionary. Its capabilities and limitations are currently roughly similar to Delphi&#8217;s.</li>
<li>Improved JavaScript CodeGen for various code generation cases (faster and smaller, as measured through <a href="http://jsperf.com/">jsperf</a> benchmarking on various browser engines).</li>
<li>Improved JavaScript obfuscator.</li>
<li>Improved JavaScript minifier.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/02/02/meanwhile-in-the-dwscript-svn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Closures in DWScript / OP4JS</title>
		<link>http://delphitools.info/2012/01/21/closures-in-dwscript-op4js/</link>
		<comments>http://delphitools.info/2012/01/21/closures-in-dwscript-op4js/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 15:31:07 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[DWS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[OP4JS]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1598</guid>
		<description><![CDATA[Closures, also known as &#8220;anonymous methods&#8221; in Delphi, are now supported by DWScript for the JavaScript CodeGen, with the same syntax as in Delphi: myObject.MyEvent := procedure (Sender : TObject); begin ... end; There are of course some extensions that go beyond what Delphi supports You are allowed to use a named local procedure as [...]]]></description>
			<content:encoded><![CDATA[<p>Closures, also known as &#8220;anonymous methods&#8221; in Delphi, are now supported by DWScript for the JavaScript CodeGen, with the same syntax as in Delphi:</p>
<pre>myObject.MyEvent := <strong>procedure</strong> (Sender : TObject);
                    <strong>begin</strong>
                       ...
                    <strong>end</strong>;</pre>
<p>There are of course some extensions that go beyond what Delphi supports <img src='http://delphitools.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>You are allowed to use a named local procedure as a closure / anonymous method, with optional capture of local variables, allowing for neater layout of code, for instance:</p>
<pre><strong>begin</strong>
   ...
   <strong>procedure</strong> MyLocalProc(Sender : TObject);
   <strong>begin</strong>
      ...
   <strong>end</strong>;
   ...
   myObject.MyEvent := MyLocalProc;
   ...
<strong>end</strong>;</pre>
<p>The function pointers and closures are unified, you did not have to distinguish between a &#8220;<em>procedure</em>&#8221; and a &#8220;<em>procedure of object</em>&#8220;, and you don&#8217;t have to distinguish a &#8220;<em>reference to procedure</em>&#8221; either, ie. if you declare</p>
<pre><strong>type</strong> TNotifyEvent = procedure (Sender : TObject);</pre>
<p>as long as the parameters match (and result type for a function) , the above type will accept standalone functions, object methods, interface methods, and now closures/anonymous methods (and even record methods, which are just syntax sugar for standalone function with an implicit parameter).</p>
<p>PS: DWScript (as a scripting engine), will very likely evolve (in time) from a stack based-engine to a closure-based engine, so the above syntax will be supported for scripting purposes too, and not just when compiling to JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/21/closures-in-dwscript-op4js/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SOPA blackout day</title>
		<link>http://delphitools.info/2012/01/18/sopa-blackout-day/</link>
		<comments>http://delphitools.info/2012/01/18/sopa-blackout-day/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 08:13:32 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[SOPA]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1585</guid>
		<description><![CDATA[Great SOPA blackout page from Wikipedia, being one the top worldwide site, this should generate more awareness than any other! I usually avoid posting non-technical stuff, let SOPA be the exception that confirms the rule! As for a description of the problems of SOPA, see: Electronic Frontier Foundation blog post on the problems with SOPA/PIPA]]></description>
			<content:encoded><![CDATA[<p>Great SOPA blackout page from Wikipedia, being one the top worldwide site, this should generate more awareness than any other!</p>
<div id="attachment_1586" class="wp-caption aligncenter" style="width: 310px"><a href="http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more"><img class="size-medium wp-image-1586" title="Wikipedia SOPA" src="http://delphitools.info/wp-content/uploads/2012/01/WikipediaSOPA-300x216.jpg" alt="" width="300" height="216" /></a><p class="wp-caption-text">Wikipedia&#39;s SOPA blackout page</p></div>
<p  style="padding-top: 10px;">I usually avoid posting non-technical stuff, let SOPA be the exception that confirms the rule! As for a description of the problems of SOPA, see:</p>
<div  style="padding-left: 30px;"><a href="https://www.eff.org/deeplinks/2012/01/how-pipa-and-sopa-violate-white-house-principles-supporting-free-speech">Electronic Frontier Foundation blog post on the problems with SOPA/PIPA</a></div></p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/18/sopa-blackout-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OP4JS: &#8220;How do I&#8230;&#8221;</title>
		<link>http://delphitools.info/2012/01/06/op4js-how-do-i/</link>
		<comments>http://delphitools.info/2012/01/06/op4js-how-do-i/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 14:41:35 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[OP4JS]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1561</guid>
		<description><![CDATA[Jon Lennart Aasenden just posted on G+ several links to new &#8220;How do I&#8221; entries in the OP4JS Documentation: Working with controls, the boxing model Using the TW3HttpRequest object Add a new form to my application Create and use a timer object Rotate a control by X degrees Plot pixels on a off-screen bitmap You [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Rotate a control" src="http://op4js.optimalesystemer.no/wp-content/uploads/2012/01/angle.png" alt="" width="175" height="206" />Jon Lennart Aasenden just <a href="https://plus.google.com/u/0/s/OP4JS">posted on G+</a> several links to new &#8220;How do I&#8221; entries in the <a href="http://op4js.optimalesystemer.no/documentation/">OP4JS Documentation</a>:</p>
<ul>
<li><a href="http://op4js.optimalesystemer.no/2012/01/05/working-with-controls-the-boxing-model/">Working with controls, the boxing model</a></li>
<li><a href="http://op4js.optimalesystemer.no/2012/01/05/using-the-tw3httprequest-object/">Using the TW3HttpRequest object</a></li>
<li><a href="http://op4js.optimalesystemer.no/2012/01/05/add-a-new-form-to-my-application/">Add a new form to my application</a></li>
<li><a href="http://op4js.optimalesystemer.no/2012/01/05/how-do-i-create-and-use-a-timer/">Create and use a timer object</a></li>
<li><a href="http://op4js.optimalesystemer.no/2012/01/05/how-do-i-rotate-a-control-by-x-degrees/">Rotate a control by X degrees</a></li>
<li><a href="http://op4js.optimalesystemer.no/2012/01/06/how-do-i-plot-pixels-on-a-offscreen-bitmap/">Plot pixels on a off-screen bitmap</a></li>
</ul>
<p>You may also want to read Primoz Gabrijelcic&#8217;s article &#8220;<a href="http://www.thedelphigeek.com/2012/01/first-steps-with-smart-mobile-studio.html">First Steps with Smart Mobile Studio</a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/06/op4js-how-do-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DelphiTools.info relocated</title>
		<link>http://delphitools.info/2012/01/04/delphitools-info-relocated/</link>
		<comments>http://delphitools.info/2012/01/04/delphitools-info-relocated/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 14:17:10 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1551</guid>
		<description><![CDATA[The DelphiTools.info website has just been relocated, it also transitioned from a Linux host to a Windows one. There were a few glitches with WordPress during the transfer, but they should hopefully have been solved, if not, feel free to post about them here!]]></description>
			<content:encoded><![CDATA[<p>The DelphiTools.info website has just been relocated, it also transitioned from a Linux host to a Windows one.</p>
<p>There were a few glitches with WordPress during the transfer, but they should hopefully have been solved, if not, feel free to post about them here!</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/04/delphitools-info-relocated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SynEdit performance bragging rights?</title>
		<link>http://delphitools.info/2011/12/29/synedit-performance-bragging-rights/</link>
		<comments>http://delphitools.info/2011/12/29/synedit-performance-bragging-rights/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 06:56:47 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[SynEdit]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1532</guid>
		<description><![CDATA[Committed another round of speedups in the SynEdit SVN, and AFAICT SynEdit is now amongst the fastest text and highlighting editors out there! To benchmark it yourself, if you don&#8217;t have a large text file hanging around, you can make a &#8220;meaningful&#8221; one easily: just go to Delphi&#8217;s source\rtl\win directory and enter the following command-line: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sourceforge.net/projects/synedit/"><img class="alignright size-full wp-image-1527" title="SynEditLogo" src="http://delphitools.info/wp-content/uploads/2011/12/SynEditLogo.png" alt="SynEdit Logo" width="150" height="120" /></a>Committed another round of speedups in the SynEdit SVN, and AFAICT SynEdit is now amongst the fastest text and highlighting editors out there!</p>
<p>To benchmark it yourself, if you don&#8217;t have a large text file hanging around, you can make a &#8220;meaningful&#8221; one easily: just go to Delphi&#8217;s <em>source\rtl\win</em> directory and enter the following command-line:</p>
<pre>type *.pas &gt; c:\winall.pas</pre>
<p>That should give you f.i. with  Delphi XE an 11 MB file, with 280k lines. Using the following file, here are my rough findings, for an executable compiled with Delphi XE, by order of decreasing performance:</p>
<div align="center">
<table style="border-collapse: collapse;" border="1">
<tbody>
<tr>
<th>Editor</th>
<th>Time to load</th>
<th>Time to reach last line</th>
<th>Total</th>
</tr>
<tr>
<td><a href="https://sourceforge.net/projects/synedit/">SynEdit</a></td>
<td align="right">&lt;&lt; 1 sec</td>
<td align="right">0 sec</td>
<td align="right">&lt;&lt; 1 sec</td>
</tr>
<tr>
<td><a href="http://www.embarcadero.com/products/delphi">Delphi</a> XE</td>
<td align="right">&lt; 1 sec</td>
<td align="right">&lt;&lt; 1 sec</td>
<td align="right">&lt; 1 sec</td>
</tr>
<tr>
<td><a href="http://www.emeditor.com/">EmEditor</a> (11.0.2)</td>
<td align="right">0 sec</td>
<td align="right">1* sec</td>
<td align="right">1* sec</td>
</tr>
<tr>
<td>Scintilla <a href="http://www.scintilla.org/SciTE.html">SciTe</a></td>
<td align="right">0 sec</td>
<td align="right">2 sec</td>
<td align="right">2 sec</td>
</tr>
<tr>
<td><a href="http://www.eclipse.org/">Eclipse</a> (Indigo)</td>
<td align="right">3 sec</td>
<td align="right">0 sec</td>
<td align="right">3 sec</td>
</tr>
<tr>
<td>Notepad (Win7)</td>
<td align="right">3 sec</td>
<td align="right">0 sec</td>
<td align="right">3 sec</td>
</tr>
<tr>
<td><a href="http://notepad-plus-plus.org/">Notepad++</a> (5.9.6.2)</td>
<td align="right">0 sec</td>
<td align="right">16 sec</td>
<td align="right">16 sec</td>
</tr>
</tbody>
</table>
</div>
<p>*: EmEditor  does its line indexing work in a background task, so the 1 sec delay to reach the last line is only visible if you try to reach it just after having opened the file.</p>
<p>Once you&#8217;ve reached the last line at least once, entering text at the top or the bottom of the file, selecting blocks, copy-pasting etc. is instantaneous enough in all above editors. Memory usage is roughly comparable, except for Eclipse, which is the worst by far.</p>
<p>Notepad++ is using Scintilla, but performs much worse than SciTe (Scintilla minimalistic text editor/demo), so there must be a glitch somewhere in Notepad++ (which I personally didn&#8217;t expect, must have been a regression of some sort in recent versions).</p>
<p>SynEdit also seems to scale better than  all the others above on even larger files (as tested on 100MB+ files).</p>
<p>For bragging rights, what other fast editors do you know of? <img src='http://delphitools.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2011/12/29/synedit-performance-bragging-rights/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Christmas present for SynEdit users</title>
		<link>http://delphitools.info/2011/12/26/christmas-present-for-synedit-users/</link>
		<comments>http://delphitools.info/2011/12/26/christmas-present-for-synedit-users/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 14:47:03 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[DWS]]></category>
		<category><![CDATA[Profiler]]></category>
		<category><![CDATA[SynEdit]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1525</guid>
		<description><![CDATA[Just committed to the SynEdit SVN a few enhancements: much improved performance for long &#38; large files, still not quite notepad++-class just yet, but my profiler tells me there are many juicy low-hanging candies left improvements to the TSynGeneralSyn highlighter (single &#38; double quote mode, token callback, and a few other niceties) DWScript syntax highlighter [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://synedit.sourceforge.net/"><img class="alignright size-full wp-image-1527" title="SynEditLogo" src="http://delphitools.info/wp-content/uploads/2011/12/SynEditLogo.png" alt="SynEdit Logo" width="150" height="120" /></a>Just committed to the <a href="https://sourceforge.net/projects/synedit/">SynEdit SVN</a> a few enhancements:</p>
<ul>
<li><strong>much</strong> improved performance for long &amp; large files,<del> still not quite <a href="http://notepad-plus-plus.org/">notepad++</a>-class just yet</del>, but my <a href="http://delphitools.info/samplingprofiler/">profiler</a> tells me there are many juicy low-hanging candies left <img src='http://delphitools.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>improvements to the <em>TSynGeneralSyn</em> highlighter (single &amp; double quote mode, token callback, and a few other niceties)</li>
<li>DWScript syntax highlighter has been moved to the SynEdit SVN, the copy in the DWScript SVN will no longer be the primary reference</li>
</ul>
<p><strong>edit 27/12</strong>: committed another optimization, AFAICT, when working on large files, SynEdit is now faster than the Delphi IDE code editor and *way* faster than Scintilla/notepad++ 5.9.6.2 (with and without a syntax highlighter like DWS&#8217;s)</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2011/12/26/christmas-present-for-synedit-users/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>DWS news + OP4JS aka SmartMobileStudio</title>
		<link>http://delphitools.info/2011/12/23/dws-news-op4js-aka-smartmobilestudio/</link>
		<comments>http://delphitools.info/2011/12/23/dws-news-op4js-aka-smartmobilestudio/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 09:01:12 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[DWS]]></category>
		<category><![CDATA[OP4JS]]></category>
		<category><![CDATA[SmartMobileStudi]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1498</guid>
		<description><![CDATA[A quick news roundup before Christmas. &#160; OP4JS Alpha aka SmartMobileStudio is in the wild Jørn Einar Angeltveit  -  Dec 21, 2011  -  Public We&#8217;ve now sent &#8220;Smart Mobile Studio&#8221; Alpha version to 50 testers. Did you miss the beta invite? Visit www.SmartMobileStudio.com to participate. SmartMobileStudio leverages DWScript&#8217;s JavaScript CodeGen. My first test app with [...]]]></description>
			<content:encoded><![CDATA[<div>A quick news roundup before Christmas.</div>
<div>&nbsp;</div>
<h4>OP4JS Alpha aka SmartMobileStudio is in the wild</h4>
<blockquote>
<div><a href="https://plus.google.com/u/0/104972328326990693699/posts/8vqFYwv6kku">Jørn Einar Angeltveit  -  Dec 21, 2011  -  Public</a></div>
<p>We&#8217;ve now sent &#8220;Smart Mobile Studio&#8221; Alpha version to 50 testers.</p>
<p>Did you miss the beta invite?</p>
<p>Visit <a href="http://www.smartmobilestudio.com/">www.SmartMobileStudio.com</a> to participate.</p></blockquote>
<p>SmartMobileStudio leverages DWScript&#8217;s JavaScript CodeGen.</p>
<p>My first test app with the alpha was a clock, check it in your <a href="http://www.op4js.com/SmartDemo/GalaxyClock/">iOS or Android Browser</a> or in the <a href="https://market.android.com/details?id=no.optimalesystemer.SmartMobileStudio_GalaxyClock">Android market</a>. Source is included in the alpha. Will be beautified it later on <img src='http://delphitools.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I&#8217;ve been playing on another one, head over to YouTube to see <a href="http://www.youtube.com/watch?v=Y01RielSxJ0">a small video</a>, you can also <a title="MissileCommand early alpha" href="/wp-content/uploads/2011/12/MissileCommand_earlyalpha.apk">get the apk</a> (47 kB), but beware it&#8217;s basic, ugly, and definitely early alpha, but it&#8217;s coded in Pascal!</p>
<p>Below is a snippet of the source code (using DWS inline implementations for illustration and compactness purposes, most of OP4JS is written in the more classic interface/implementation style), it&#8217;s a snip of the root class of the mini-engine of the game (yes, virtual methods are supported):</p>
<pre><strong>type</strong>
   TEntity = <strong>class</strong>
      X, Y : Float;

      <strong>function</strong> Progress : Boolean; <strong>virtual</strong>;
      <strong>begin</strong>
         // does nothing by default
      <strong>end</strong>;

      <strong>constructor</strong> Create(aX, aY : Float);
      <strong>begin</strong>
         X := aX;
         Y := aY;
      <strong>end</strong>;

      <strong>function</strong> Dist2(entity : TEntity) : Float;
      <strong>begin</strong>
         Result := Sqr(X-entity.X)+Sqr(Y-entity.Y);
      <strong>end</strong>;
   <strong>end</strong>;</pre>
<div>&nbsp;</div>
<h4>Other recent changes to the DWScript SVN</h4>
<ul>
<li>Added sample/simple <em>IndyWebServer</em> demo, implements basic <strong>&#8220;pascal server pages</strong>&#8221; and demonstrates <strong>how to use DWS in a multi-threaded environment</strong>. Makes use of RTTI Environment class to expose WebRequest &amp; WebResponse. Expect more details in a future post.</li>
<li><em>TTerminatorThread</em> has been replaced by <em>TGuardianThread</em>, which can &#8220;guard&#8221; multiple executions</li>
<li>Dotted unit names are now supported</li>
<li>Random no longer uses the Delphi RTL but <a href="http://delphitools.info/2011/12/13/pimp-your-random-numbers-with-xorshift/">XorShift</a></li>
<li>unit name symbols are now included in the Symbol Dictionary</li>
<li>include references are now included in the Symbol Dictionary</li>
<li><em>TdwsSuggestions</em> can now optionally suggest reserved words (begin, procedure, etc.)</li>
<li>fixes for <em>Inc()</em> &amp; <em>Dec()</em> when operating on references with side-effects.</li>
<li>improved several error messages related to parameter passing.</li>
<li>other misc. fixes and optimizations, more unit tests.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2011/12/23/dws-news-op4js-aka-smartmobilestudio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pimp your random numbers with XorShift!</title>
		<link>http://delphitools.info/2011/12/13/pimp-your-random-numbers-with-xorshift/</link>
		<comments>http://delphitools.info/2011/12/13/pimp-your-random-numbers-with-xorshift/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 09:07:45 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[DWS]]></category>
		<category><![CDATA[LCG]]></category>
		<category><![CDATA[Mersenne Twister]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[XorShift]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1492</guid>
		<description><![CDATA[A 64bit XorShift is now used to generate random numbers in DWScript, and there is a now a separate random number generator per-execution, which is auto-randomized when an execution is created. Previously, the RTL random generator was used, this was &#8220;okay&#8221; when you had only one script using random numbers at a time, but multiple [...]]]></description>
			<content:encoded><![CDATA[<p>A 64bit <a href="http://en.wikipedia.org/wiki/Xorshift">XorShift</a> is now used to generate random numbers in <a href="http://code.google.com/p/dwscript/">DWScript</a>, and there is a now a separate random number generator per-execution, which is auto-randomized when an execution is created.</p>
<p>Previously, the RTL random generator was used, this was &#8220;okay&#8221; when you had only one script using random numbers at a time, but multiple scripts running at the same time would interfere (<em>Randomize</em> calls would affect each others f.i.), and <em>Random</em> isn&#8217;t really thread-safe.</p>
<p>Performance fo <em>XorShift</em> is roughly comparable to the Delphi RTL&#8217;s <a href="http://en.wikipedia.org/wiki/Linear_congruential_generator">linear congruential generator</a>, but with much better statistical random properties and a very long period, without the overhead of a <a href="http://en.wikipedia.org/wiki/Mersenne_twister#Alternatives">Mersenne Twister</a>. For those interested in the mathematical details, see &#8220;<a href="http://www.jstatsoft.org/v08/i14/paper">XorShift RNGs</a>&#8221; paper by G. Marsagalia.</p>
<p>As an illustration of the improved random properties, consider filling a bitmap with &#8220;random&#8221; RGB colors for each pixel:</p>
<pre><strong>var</strong> x, y : Integer;
<strong>for</strong> x := 0 <strong>to</strong> bmp.Width-1 <strong>do</strong>
   <strong>for</strong> y := 0 <strong>to</strong> bmp.Height-1 <strong>do</strong>
      bmp.Pixel[x, y] := RandomInt($1000000);</pre>
<p>Using the Delphi built-in <em>Random</em>, you&#8217;ll get something like the image below (generated at 512&#215;512, then halved and downgraded to 4bpp for web consumption)</p>
<div id="attachment_1496" class="wp-caption aligncenter" style="width: 266px"><a href="http://delphitools.info/wp-content/uploads/2011/12/rand-rtl-half.png"><img class="size-full wp-image-1496 " title="rand-rtl-half" src="http://delphitools.info/wp-content/uploads/2011/12/rand-rtl-half.png" alt="" width="256" height="256" /></a><p class="wp-caption-text">Delphi RTL Random</p></div>
<p>Oooh&#8230; the horizontal scratch lines! Not so random after all&#8230; I don&#8217;t know if the Delphi LCG is as biased as <a href="http://en.wikipedia.org/wiki/RANDU">RANDU</a>, but visibly, it is probably not something you want to rely upon too much.</p>
<p>And now, the same but with the <em>XorShift</em> implementation now used in DWS:</p>
<div id="attachment_1495" class="wp-caption aligncenter" style="width: 266px"><a href="http://delphitools.info/wp-content/uploads/2011/12/rand-dws-half.png"><img class="size-full wp-image-1495 " title="rand-dws-half" src="http://delphitools.info/wp-content/uploads/2011/12/rand-dws-half.png" alt="" width="256" height="256" /></a><p class="wp-caption-text">DWScript XorShift Random</p></div>
<p>The  <em>XorShift</em> implementation is very simple, fast, and doesn&#8217;t require much memory: a single 64bit value is enough to get good random, use two if you want longer periods that won&#8217;t have a chance to loop before the universe ends.</p>
<p>Last but not least, 64bit <em>XorShift</em> may be fast in 32bit binaries, but it practically walks on water in 64bit binaries <img src='http://delphitools.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2011/12/13/pimp-your-random-numbers-with-xorshift/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>DWS news roundup</title>
		<link>http://delphitools.info/2011/12/03/dws-news-roundup/</link>
		<comments>http://delphitools.info/2011/12/03/dws-news-roundup/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 09:10:54 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[DWS]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1469</guid>
		<description><![CDATA[Here is a quick summary of recent additions to DWScript: exit, break and continue are now reserved keyword (and highlighted as such), previously they weren&#8217;t (as in Delphi), but having variables or functions named that way just &#8220;breaks&#8221; (pun intended) those language features (as it does in Delphi) new TdwsRTTIEnvironment, fields and properties of a [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick summary of recent additions to <a href="http://code.google.com/p/dwscript/">DWScript</a>:</p>
<ul>
<li><strong>exit</strong>, <strong>break</strong> and <strong>continue</strong> are now reserved keyword (and highlighted as such), previously they weren&#8217;t (as in Delphi), but having variables or functions named that way just &#8220;breaks&#8221; (pun intended) those language features (as it does in Delphi)</li>
<li>new <strong><em>TdwsRTTIEnvironment</em></strong>, fields and properties of a class exposed this way are directly accessible in scripts, more details on that one in a future post.</li>
<li>support passing constant arrays to dynamic array parameters (automatic conversion).</li>
<li>improved the <a href="http://code.google.com/p/dwscript/wiki/Language">language documentation</a>.</li>
<li>added ability for custom extension of <em>Abs()</em> special function (now supported by <em>TComplex</em>).</li>
<li>added <em>Clamp()</em> floating-point function.</li>
<li>added <em>Gcd()</em>, <em>Lcm()</em>, <em>IsPrime()</em> and <em>LeastFactor()</em> integer functions.</li>
<li>fixed an issue that prevented conditional directives from being supported in all portions of the code, they can now properly be used anywhere.</li>
<li>JavaScript codegen optimization for variable symbol lookup.</li>
<li>minor tokenizer speedup, compile speed should now be close to 200k LOC/sec*.</li>
<li>more test cases, minor fixes.</li>
</ul>
<p>*: FWIW since the <a href="http://delphitools.info/2010/10/26/why-no-bytecode-format/">old benchmark</a>, compile and execution performance almost tripled and memory requirements were cut by approx 30%. At the same time the language became quite a bit <a href="http://delphitools.info/2011/11/02/time-for-dwscript-v2-3/">richer</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2011/12/03/dws-news-roundup/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.delphitools.info/category/news/feed/ ) in 0.94183 seconds, on Feb 4th, 2012 at 12:36 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 12:36 pm UTC -->
