<?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</title>
	<atom:link href="http://delphitools.info/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>What do you think of function overloads?</title>
		<link>http://delphitools.info/2012/01/26/what-do-you-think-of-functions-overloads/</link>
		<comments>http://delphitools.info/2012/01/26/what-do-you-think-of-functions-overloads/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 07:32:20 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[overload]]></category>
		<category><![CDATA[Poll]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1602</guid>
		<description><![CDATA[In Delphi, you can overload functions, but doing so requires using the overload directive explicitly, f.i. the following code declares two functions with the same name, one that will be invoked if you pass an integer, another that will be invoked you pass a string: function MyFunc(a : Integer) : String; overload; function MyFunc(s : [...]]]></description>
			<content:encoded><![CDATA[<p>In Delphi, you can <em>overload</em> functions, but doing so requires using the <strong>overload</strong> directive explicitly, f.i. the following code declares two functions with the same name, one that will be invoked if you pass an integer, another that will be invoked you pass a string:</p>
<pre><strong>function</strong> MyFunc(a : Integer) : String; <strong>overload</strong>;
<strong>function</strong> MyFunc(s : String) : String; <strong>overload</strong>;</pre>
<p>In many other languages, the <em>overload</em> directive is implicit, you don&#8217;t have to type it and you can always overload. On the other hand, it means that as long as your parameters differ, you can end up overloading an existing function without noticing, which can lead to confusion.<br />
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/26/what-do-you-think-of-functions-overloads/feed/</wfw:commentRss>
		<slash:comments>27</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>Good Practices for JavaScript &#8220;asm&#8221; sections in DWS/OP4JS</title>
		<link>http://delphitools.info/2012/01/16/good-practices-for-javascript-asm-sections-in-dwsop4js/</link>
		<comments>http://delphitools.info/2012/01/16/good-practices-for-javascript-asm-sections-in-dwsop4js/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 07:57:19 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[DWS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[OP4JS]]></category>

		<guid isPermaLink="false">http://delphitools.info/?p=1571</guid>
		<description><![CDATA[The compiler supports writing &#8220;asm&#8221; aka JavaScript section in the middle of Object Pascal, there are a few good practices as well as tips to keep in mind, let&#8217;s review the menu: Name conflicts and obfuscation support Do you really need an &#8220;asm&#8221; section? Don&#8217;t rely on implicit parameters structure Handling callbacks with &#8220;Variant&#8221; methods [...]]]></description>
			<content:encoded><![CDATA[<p>The compiler supports writing &#8220;asm&#8221; aka JavaScript section in the middle of Object Pascal, there are a few good practices as well as tips to keep in mind, let&#8217;s review the menu:</p>
<ol>
<li><a href="#1">Name conflicts and obfuscation support</a></li>
<li><a href="#2">Do you really need an &#8220;asm&#8221; section?</a></li>
<li><a href="#3">Don&#8217;t rely on implicit parameters structure</a></li>
<li><a href="#4">Handling callbacks with &#8220;Variant&#8221; methods</a></li>
<li><a href="#5">Handling callbacks in an &#8220;asm&#8221; section</a></li>
<li><a href="#6">Current limitations</a></li>
</ol>
<h4><a name="#1"></a>1. Name conflicts and obfuscation support</h4>
<p>This should be a point zero actually, but the first thing to have in mind is that you are allowed in Pascal to use as names identifiers that are reserved in JavaScript. Those can be language keywords (&#8220;this&#8221;, &#8220;delete&#8221;, etc.) or common DOM objects and properties (&#8220;document&#8221;, &#8220;window&#8221;).</p>
<p>The compiler automatically protects you from such conflicts by transparently renaming your identifiers (currently by adding a &#8220;$&#8221;+number at the end).</p>
<p>Then there is the obfuscator, which will basically rename everything to short, meaningless names. That&#8217;s good for more than obfuscation: it reduces the size of the JavaScript, improves the parsing and lookup-based performance in the browser.</p>
<p>The consequence is that in an &#8220;asm&#8221; section, you should prefix all Pascal identifiers with an &#8216;@&#8217;, so the compiler can correctly compile your asm. For instance in:</p>
<pre><strong>var</strong> window : <strong>String</strong>;
...
<strong>asm</strong>
   @window = window.name
<strong>end</strong>;</pre>
<p>The &#8216;@window&#8217; refers to the &#8216;window&#8217; string variable (which the compiler will rename), while &#8216;window.name&#8217; will be compiled &#8220;as is&#8221;, as it reads the &#8216;name&#8217; property of the global &#8216;window&#8217; JavaScript object.</p>
<h4><a name="#2"></a>2. Do you really need an &#8220;asm&#8221;&#8216; section?</h4>
<p>Though for some weird cases you might (like this <a href="http://stackoverflow.com/questions/7202157/can-you-explain-why-10">gem</a>), there are many cases in which you don&#8217;t need &#8220;asm&#8221;, as the language supports a &#8220;Variant&#8221; type which is a raw JavaScript object, and upon which you can call methods, read properties directly or via indexes.</p>
<p>For instance, with v a Variant, the following code:</p>
<pre>v := v.getNext();
v['hello'] := v.space + 'world';</pre>
<p>will get compiled (almost) straight into</p>
<pre>v = v.getNext();
v['hello'] = v.space + 'world';</pre>
<p>When using Variant, you don&#8217;t have strong compile-time checks (it&#8217;s just you vs JavaScript), property and function names are case-sensitive, so use them with care. This is similar in syntax and essence to using OLE Variants and Delphi.</p>
<p>On the other hand, you have compiler support, and you get automatic casts when assigning a variant to a strong type (Integer, String, etc.), and you also get name conflict protection &amp; obfuscation support without having to &#8216;@&#8217; your Pascal references.</p>
<h4><a name="#3"></a>3. Don&#8217;t rely on implicit parameters structure</h4>
<p>Because they may change in future compiler revisions!</p>
<p>For instance, methods are currently invoked with an implicit &#8220;Self&#8221; parameters, and the others behind, so currently &#8220;arguments[0]&#8221; is Self, and everything else if after that. But don&#8217;t rely on it.</p>
<p>Future compiler revisions may change that parameter&#8217;s name, may obfuscate it, may remove it entirely in favor of an implicit &#8220;this&#8221;, may inline your function, etc.</p>
<p>So if you need explicit parameters, declare them, if you&#8217;re in a method and need to access the object (Self), use &#8220;@Self&#8221;, if you need to access a field of the current object use &#8220;@Self.FieldName&#8221;, etc. That will keep working.</p>
<h4><a name="#4"></a>4. Avoid declaring variables in &#8220;asm&#8221; sections</h4>
<p>Declare them in the parent function/method instead, and reference them with the &#8216;@&#8217; prefix.</p>
<p>There are three main reasons for that, the first is that doing so means they&#8217;ll be case-insensitive, the second is that it will allow the obfuscator to obfuscate them reason for that, and the third is that you&#8217;ll get compiler warnings if you declare a variable but do not use it (or if you forgot to @-prefix it).</p>
<p>So don&#8217;t write that:</p>
<pre><strong>asm</strong>
   var myTemp;
   myTemp = ...whatever...;
   ...
<strong>end</strong>;</pre>
<p>But write this instead:</p>
<pre><strong>var</strong> myTemp : Variant;
...
<strong>asm</strong>
   @myTemp = ...whatever...;
   ...
<strong>end</strong>;</pre>
<h4><a name="#5"></a>5. Handling callbacks with &#8220;Variant&#8221; methods</h4>
<p>A common occurrence is to register a callback to a JavaScript object, when that object is hosted in a Variant, that&#8217;s fairly simple to achieve:</p>
<pre><strong>procedure</strong> DoImageLoaded;
<strong>begin</strong>
   ...
<strong>end</strong>;
...
<strong>var</strong> myImage : Variant; // will refer to an image object
...
myImage.onload(@DoImageLoaded);</pre>
<p>There we use the &#8216;@&#8217; operator Pascal-side, to make it explicit that we want a function pointer, and not call the function. The &#8216;@&#8217; isn&#8217;t necessary when the function is declared Pascal-side, as the compiler can figure it out, but when invoking a Variant method, it doesn&#8217;t know the parameters type.</p>
<p>Note that since function pointers are unified, you can get a function pointer from an object method or an interface method in the same fashion:</p>
<pre>myImage.onload(@myObject.DoImageLoaded);
myImage.onload(@myInterface.DoImageLoaded);</pre>
<h4><a name="#6"></a>6. Handling callbacks in an &#8220;asm&#8221; section</h4>
<p>If you want to register the callback in an &#8220;asm&#8221; section, the situation is a little more complex, as &#8220;@myObject.myMethod&#8221; will refer to the function prototype, outside of its context. It means it&#8217;s okay for standalone functions or procedures, but may not do what you&#8217;re expecting for object or interface methods.</p>
<p>The solution is to acquire the function pointer outside of the &#8220;asm&#8221; section:</p>
<pre><strong>var</strong> myCallback : Variant;
...
myCallback := @myObject.DoImageLoaded;
<strong>asm</strong>
   @myImage.onload(@myCallback);
<strong>end</strong>;</pre>
<h4><a name="#7"></a>7. Current limitations</h4>
<p>Currently the parser for &#8220;asm&#8221; sections doesn&#8217;t really understand JavaScript:</p>
<ul>
<li>it&#8217;s still treating JS as a weird invalid form of Pascal, and notably {} define comments for it, so it will pass whatever is inside curlies &#8220;as is&#8221;, and will annoyingly ignore @ signs inside curlies</li>
<li>some weird operator combos (but valid JS)  may throw off the parser, if that happens, place that code in between curlies, and post a bug report</li>
</ul>
<p>Hopefully in time, there will be a proper JS parser, but currently the focus is more on the Pascal side, and &#8220;asm&#8221; sections are intended for handling corner cases more than as a main workhorse.</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitools.info/2012/01/16/good-practices-for-javascript-asm-sections-in-dwsop4js/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>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.delphitools.info/feed/ ) in 1.02458 seconds, on Feb 4th, 2012 at 11:39 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 11:39 am UTC -->
