<?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>JewelScript Blog</title>
	<atom:link href="http://blog.jewe.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.jewe.org</link>
	<description>The official JewelScript resource</description>
	<lastBuildDate>Tue, 01 Jun 2010 20:05:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>User signups disabled</title>
		<link>http://blog.jewe.org/?p=133</link>
		<comments>http://blog.jewe.org/?p=133#comments</comments>
		<pubDate>Mon, 31 May 2010 18:28:15 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=133</guid>
		<description><![CDATA[I&#8217;ve disabled user signups to this blog after it got hacked and produced nothing but a blank page for three days.

It&#8217;s sad that there seem to be more people interested in vandalism than contribution these days, but nevermind. I&#8217;ve deleted all user accounts since most of them were probably signups from spam-bots or hacking attempts.
If [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve disabled user signups to this blog after it got hacked and produced nothing but a blank page for three days.<br />
<span id="more-133"></span></p>
<p>It&#8217;s sad that there seem to be more people interested in vandalism than contribution these days, but nevermind. I&#8217;ve deleted all user accounts since most of them were probably signups from spam-bots or hacking attempts.</p>
<p>If <strong><em>your account</em></strong> got deleted too, and you had a sincere interest in the project, I apologize for this inconvenience. In any case I can be reached by email. It should be shown somewhere on the &#8216;Need Help?&#8217; Page above.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=133</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JewelScript code examples</title>
		<link>http://blog.jewe.org/?p=128</link>
		<comments>http://blog.jewe.org/?p=128#comments</comments>
		<pubDate>Sun, 14 Mar 2010 13:09:00 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[code examples]]></category>
		<category><![CDATA[example]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=128</guid>
		<description><![CDATA[What does the JewelScript language look like?


Functions
Classes
Interfaces
Delegates
Co-functions
Hybrid classes
Weak references
Exceptions

For something a little more complex:

Cosporen applet

]]></description>
			<content:encoded><![CDATA[<p>What does the JewelScript language look like?<br />
<span id="more-128"></span></p>
<ul>
<li><a title="Functions" href="http://blog.jewe.org/jewelscript/ex_functions.html" target="_self">Functions</a></li>
<li><a title="Classes" href="http://blog.jewe.org/jewelscript/ex_classes.html" target="_self">Classes</a></li>
<li><a title="Interfaces" href="http://blog.jewe.org/jewelscript/ex_interfaces.html" target="_self">Interfaces</a></li>
<li><a title="Delegates" href="http://blog.jewe.org/jewelscript/ex_delegates.html" target="_self">Delegates</a></li>
<li><a title="Co-functions" href="http://blog.jewe.org/jewelscript/ex_cofunctions.html" target="_self">Co-functions</a></li>
<li><a title="Hybrid classes" href="http://blog.jewe.org/jewelscript/hybrid.html" target="_self">Hybrid classes</a></li>
<li><a title="Weak references" href="http://blog.jewe.org/jewelscript/ex_weakrefs.html" target="_self">Weak references</a></li>
<li><a title="Exceptions" href="http://blog.jewe.org/jewelscript/exceptions.html" target="_self">Exceptions</a></li>
</ul>
<p>For something a little more complex:</p>
<ul>
<li><a title="Cosporen applet" href="http://blog.jewe.org/jewelscript/ex_cosporen.html" target="_self">Cosporen applet</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JewelScript current version changes log</title>
		<link>http://blog.jewe.org/?p=125</link>
		<comments>http://blog.jewe.org/?p=125#comments</comments>
		<pubDate>Sun, 14 Mar 2010 12:36:58 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=125</guid>
		<description><![CDATA[This post lists all changes made to the project since it&#8217;s last public release, version 1.0.3.0. The most recent change is at the top of this post.

Bugs fixed
hybrid and interface
A compiler bug has been fixed that prevented you from using the hybrid keyword together with an interface identifier.
interface IFoo { }
class Foo hybrid IFoo  [...]]]></description>
			<content:encoded><![CDATA[<p>This post lists all changes made to the project since it&#8217;s last public release, version 1.0.3.0. The most recent change is at the top of this post.<br />
<span id="more-125"></span></p>
<h3>Bugs fixed</h3>
<h4>hybrid and interface</h4>
<p>A compiler bug has been fixed that prevented you from using the <em>hybrid</em> keyword together with an interface identifier.</p>
<pre>interface IFoo { }
class Foo hybrid IFoo    // did not compile
{
}</pre>
<p>Creating a hybrid class from an interface can be quite useful, so this has now been fixed.</p>
<h4>operator typeof and <em>this</em></h4>
<p>A compiler bug has been fixed that prevented the expression typeof(this) to compile.</p>
<pre>class Foo
{
    method Foo() { }
    method int GetType() { return typeof(this); }    // did not compile
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=125</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JewelScript v1.0.3.0 released</title>
		<link>http://blog.jewe.org/?p=72</link>
		<comments>http://blog.jewe.org/?p=72#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:17:49 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=72</guid>
		<description><![CDATA[The initial release of JewelScript 1.0 is out.

You can grab it from the sourceforge site (see link above) or download it right off this site using this link.
For detailed information what has changed since the last public release (0.9.2.4), see this post.
If you would like to see and test a demo-application, I have also released [...]]]></description>
			<content:encoded><![CDATA[<p>The initial release of JewelScript 1.0 is out.<br />
<span id="more-72"></span><br />
You can grab it from the sourceforge site (see link above) or download it right off this site using <a title="jilruntime-1.0.3.0-src.zip" href="http://www.jewe.org/jewelscript/release/jilruntime-1.0.3.0-src.zip" target="_self">this link</a>.</p>
<p>For detailed information what has changed since the last public release (0.9.2.4), see <a title="change log" href="http://blog.jewe.org/?p=22" target="_self">this post</a>.</p>
<p>If you would like to see and test a demo-application, I have also released the JILRunOnly command-line tool. This tool is a simple console applicaton written in ANSI C that demonstrates how to embed the JewelScript library in an application.</p>
<p>A project and solution for VC 2008 Express is included in the package, users of other platforms unfortunately will need to create their own project / makefile. Simply do a search for all &#8220;.c&#8221; files and put all of them into the project. Set the include pathes to all directories that contain &#8220;.h&#8221; files.</p>
<p>When you&#8217;re done and it works, you can send me the file so I can include it in the next distribution.</p>
<p>The JILRunOnly source package contains everything you need to build the program, including the JILRuntime 1.0.3.0 sources. You can download the JILRunOnly package <a href="http://www.jewe.org/jewelscript/release/jilrunonly-0.3.1.45-src.zip" target="_self">here</a>.</p>
<p>Please report any bugs, problems or errors you may find.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Documentation for JewelScript 1.0</title>
		<link>http://blog.jewe.org/?p=53</link>
		<comments>http://blog.jewe.org/?p=53#comments</comments>
		<pubDate>Tue, 23 Feb 2010 22:00:53 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=53</guid>
		<description><![CDATA[I&#8217;ve uploaded the language and source code documentation for JewelScript 1.0.

The documentation is complete, though there still might be some corrections to it if something pops up.
Source code documentation
The plain HTML version (ZIP archive) can be downloaded here.
The compiled HTML version (.chm) can be downloaded here.
Language documentation
The language documentation (.pdf) can be downloaded here (right-click [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded the language and source code documentation for JewelScript 1.0.<br />
<span id="more-53"></span></p>
<p>The documentation is complete, though there still might be some corrections to it if something pops up.</p>
<h3>Source code documentation</h3>
<p>The plain HTML version (ZIP archive) can be downloaded <a title="JILRuntime source doc (zip)" href="http://www.jewe.org/jewelscript/docs/jilruntime.html.zip" target="_self">here</a>.</p>
<p>The compiled HTML version (.chm) can be downloaded <a title="JILRuntime source doc (chm)" href="http://www.jewe.org/jewelscript/docs/jilruntime.chm.zip" target="_self">here</a>.</p>
<h3>Language documentation</h3>
<p>The language documentation (.pdf) can be downloaded <a title="JewelScript reference (pdf)" href="http://www.jewe.org/jewelscript/docs/jewelscript.pdf" target="_self">here</a> (right-click to save).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=53</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JewelScript 1.0 feature freeze</title>
		<link>http://blog.jewe.org/?p=45</link>
		<comments>http://blog.jewe.org/?p=45#comments</comments>
		<pubDate>Thu, 18 Feb 2010 12:58:48 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=45</guid>
		<description><![CDATA[I&#8217;ve decided to stop adding new features for the upcoming release of version 1.0 and start the testing and bug fixing phase.

All of the planned new features and improvements to the language and API are implemented, so I&#8217;m preparing to get the project ready for release now. Of course everything has to be thoroughly tested to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided to stop adding new features for the upcoming release of version 1.0 and start the testing and bug fixing phase.<br />
<span id="more-45"></span><br />
All of the planned new features and improvements to the language and API are implemented, so I&#8217;m preparing to get the project ready for release now. Of course everything has to be thoroughly tested to make sure it&#8217;s stable before I&#8217;ll release it.</p>
<p>However, seeing how long it has been since I&#8217;ve released an update to the project, I really want this version &#8220;out of the door&#8221; soon now.</p>
<p>After the first release of 1.0 on sourceforge.net, I&#8217;ll subsequently update PCalc, NetRadio and AppletForge on the main site, which is only accessible through the &#8220;old site&#8221; link above at the moment, because it is hopelessly outdated.</p>
<p>Then I&#8217;ll also update or remove the old JewelScript material on that site. I&#8217;m planning to move most of it to the blog, because it&#8217;s easier to update posts here, than the HTML pages there.</p>
<p>Last but not least, the source code documentation and the JewelScript reference PDF have to be updated, so yeah, I guess even with 1.0 stable and released, it will still keep me busy for a while. ;-)</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing a programming language</title>
		<link>http://blog.jewe.org/?p=44</link>
		<comments>http://blog.jewe.org/?p=44#comments</comments>
		<pubDate>Tue, 16 Feb 2010 22:29:29 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=44</guid>
		<description><![CDATA[Expressions in an object-oriented programming language can become utterly complex, so how do you make sure that everything that should work does work? And how do you make sure that things that must not work, don&#8217;t? Here is how I do it.

Well, the first question is answered rather easily. Just make a file, or a [...]]]></description>
			<content:encoded><![CDATA[<p>Expressions in an object-oriented programming language can become utterly complex, so how do you make sure that everything that should work does work? And how do you make sure that things that must not work, don&#8217;t? Here is how I do it.<br />
<span id="more-44"></span></p>
<p>Well, the first question is answered rather easily. Just make a file, or a set of files, that use all possible kinds of language constructs &#8211; then compile them. If you don&#8217;t get an error and it runs, it&#8217;s an indicator that the tested features work.</p>
<p>I have collected a set of 60+ test scripts for exactly that purpose. They are automatically compiled and run by a command-line version of the JewelScript runtime, and I use it frequently after having made changes to the compiler, just to verify that everything still works like it should.</p>
<p>But there&#8217;s a slight problem: You just cannot think off <em>all of the possible combinations</em> of expressions and other language elements, so you have to generalize and simplify. Therefore, if your set of files compiles, it is only an indication that the features work. Sometimes just exchanging a discrete type declaration by a typeless one somewhere can make a big difference. Or a type-conversion invoked that you haven&#8217;t tried.</p>
<p>Therefore I have a few applications, real life ones, not ones written for the sole purpose of testing, that actually use JewelScript for some purpose. These are very important, especially to test the runtime environment, but also to proof the language.</p>
<p>These applications are for example PCalc, a programmable calculator, NetRadio, an internet-radio where JewelScript handles the GUI, and AppletForge, a &#8220;2D game construction kit&#8221; if you will. Its an application that offers graphics and sound / music services and allows to program applets in JewelScript &#8211; for example games or any other graphical application. All of these applications use the runtime in a different way and therefore test a different set of features.</p>
<p>Like I said, testing if something works is rather easy, you can just try and see what happens. Testing if something <em>does not work</em>, because it shouldn&#8217;t, is a whole different story.</p>
<p>It&#8217;s a bit trickier to verify, that doing something that shouldn&#8217;t be possible, really results in an error &#8211; and the correct one. This is mainly because JewelScript will stop compiling after the first error. So you would have to make an own test script for every single expression or statement you want to fail-proof.</p>
<p>For cases like that, JewelScript has an internal self-test statement. Basically it allows me to have the language compile a block of code and then compare the actual result with the one I expect. Here&#8217;s a code example:</p>
<pre>__selftest 0    { s = "hello"+"bye".toUpper(); }    // must compile to pass
__selftest 0    { s = ("hello"+"bye").toUpper(); }  // must compile
__selftest 1216 { i = ++1; }                        // must result in error 1216
__selftest 0    { i = {10,20,30}[1]++; }            // must compile
__selftest 0    { return {10,20,30}.format("%d,%d,%d"); } // must compile
__selftest 1216 { return 1++; }                     // must result in error 1216</pre>
<p>Dependent on the result, the compiler will notify me if the test passed or failed, but it will not stop compilation on such blocks. So all I have to do is compile the files and look at the log-output to see if everything has a PASS.</p>
<p>It doesn&#8217;t tell me all the combinations that someone somewhere probably might come up with, though. I still don&#8217;t have an automated solution to solve <em>that problem</em>, but i&#8217;m working on it. ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=44</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic exceptions added</title>
		<link>http://blog.jewe.org/?p=43</link>
		<comments>http://blog.jewe.org/?p=43#comments</comments>
		<pubDate>Mon, 15 Feb 2010 21:22:14 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[documentation]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=43</guid>
		<description><![CDATA[I&#8217;ve added basic support for exceptions to the language. Support for exceptions has been in the runtime from the beginning, however, it was never really used &#8211; except for the debugger which intercepts and shows them. But you had no way of using them from within the language. Until now.

In the new version, there is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added basic support for exceptions to the language. Support for exceptions has been in the runtime from the beginning, however, it was never really used &#8211; except for the debugger which intercepts and shows them. But you had no way of using them from within the language. Until now.<br />
<span id="more-43"></span></p>
<p>In the new version, there is basic support for exceptions, which means there is now a throw statement that lets you throw an exception.</p>
<p>There is also a built-in interface for exceptions.</p>
<pre>strict interface exception {
    method exception();
    method exception(int error);
    method int getError();
}
</pre>
<p>In order to throw an exception, you&#8217;ll have to make a class that  implements this interface. After that, you can use the throw statement to throw an instance of your exception class. Needless to say, you can add any amount of additional members to your exception class.</p>
<p>If you throw, the whole stack will automatically be unrolled to the most recent native entry-point. The JILCallFunction() method will return the handle to your exception object instead of the function&#8217;s result.</p>
<p>You can use the NTLHandleToError() function to test whether the result is an exception object or a regular function result. The function will actually call the getError() method of your script object and return it&#8217;s result as error code to the caller.</p>
<p>There is no way of catching exceptions from script code, yet. And I doubt there will be any for the release of version 1.0. However, I&#8217;m planning to add support for try / catch in a later release.</p>
<p>You probably wonder now what&#8217;s the use of the throw statement then. Well, it allows you to instantly end a call from the native world to the script world and pass an error object, no matter how deep inside nested function calls you currently are.</p>
<p>Of course this also works with multiple nested native -&gt; script -&gt; native -&gt; script calls, as long as the involved native code properly propagates the error status up to their caller. Therefore this is also useful to exit delegates that are executed from native type functions.</p>
<p>For an example, see <a title="this" href="http://www.jewe.org/jewelscript/exception.html" target="_self">this</a> small JewelScript file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Garbage collection in JewelScript</title>
		<link>http://blog.jewe.org/?p=40</link>
		<comments>http://blog.jewe.org/?p=40#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:05:16 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[documentation]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=40</guid>
		<description><![CDATA[The headline says it all, I&#8217;ve finally decided to add a garbage collector to the runtime.

Personally, I never liked the idea of a language that &#8220;cleans up after the programmer&#8221;, and in regard to JewelScript, it was always my opinion that with a bit of discipline and the correct use of weak references, reference cycles [...]]]></description>
			<content:encoded><![CDATA[<p>The headline says it all, I&#8217;ve finally decided to add a garbage collector to the runtime.<br />
<span id="more-40"></span></p>
<p>Personally, I never liked the idea of a language that &#8220;cleans up after the programmer&#8221;, and in regard to JewelScript, it was always my opinion that with a bit of discipline and the correct use of weak references, reference cycles &#8211; the only way to create memory leaks in JewelScript &#8211; could be avoided.</p>
<p>Just to recap, JewelScript uses reference counting to &#8220;know&#8221; when an object or value is no longer used and can safely be destroyed. However, the crux with reference counting is that you can create reference cycles. This happens when e.g. object A has a reference to object B, while object B also has a reference to object A.</p>
<p>In such a case, reference counting is actually useless and the two objects cannot be destroyed, unless one of them uses a <em>weak reference</em>, which is a reference that isn&#8217;t counted. So since JewelScript supports weak references, script programmers actually have a tool to avoid memory leaks.</p>
<p>On the other hand, avoiding reference cycles by using weak references or any other method requires that the script programmer actually has some fundamental knowledge of the inner workings of the script language, and that&#8217;s exactly the issue why I finally decided to add GC to JewelScript.</p>
<p>Because whether or not the script programmers are skilled and knowledgeable enough to avoid reference cycles, very much depends on the actual nature of application, and the scripting interfaces &#8220;target audience&#8221;.</p>
<p>For example, you could embed JewelScript in a book keeping or word processing software to allow <em>users</em> to program little automated tasks or &#8220;macros&#8221;. In such an application scenario, you wouldn&#8217;t want to ask that your users know all the finer details of weak references, reference counting, and reference cycles.</p>
<p>And the very idea of a &#8220;scripting language&#8221; as opposed to a &#8220;real&#8221; programming language probably is, that it should hide technical issues like that from the user, and make writing programs as easy and failsafe as possible.</p>
<h3>Garbage collection in JewelScript</h3>
<p>Anyway, so now JewelScript has an integrated garbage collector. However, this feature comes with a price. Because in order to use GC, all native types and, to some degree, also your application code needs to support the garbage collector by responding to it&#8217;s MARK message.</p>
<p>JewelScript&#8217;s GC is a simple &#8220;mark and sweep&#8221; garbage collector. The basic working principle is this: When the GC is run, it runs over all objects still on the VM&#8217;s stack, in registers and in global memory, sending them the MARK message. This will mark these objects as &#8220;still used&#8221;. Then these objects will propagate the MARK message down to the objects <em>they</em> still use, and so on. In the end, all of the objects that are still in use somewhere in the application will be marked. The GC will then run over all objects on the heap and find those that are not marked. Those will be considered &#8220;leaked&#8221; and destroyed.</p>
<p>Obviously, this would end up really messy if only one native type or application class would not propagate the MARK message on to the objects it still uses. This would cause the destruction of objects that are still in use and sooner or later lead to a crash. So if the GC is going to be used, it is imperative that all code properly supports the MARK message.</p>
<p>Note that using the GC in JewelScript is <em>optional</em>, your application is not forced to use it and GC is never run automatically. It is up to the application to decide whether memory leaks can be expected from the user or not. It is also up to the application to decide when it is time to run the garbage collector.</p>
<p>If you don&#8217;t want to use the GC, you don&#8217;t have to change any code. Note however, if your application should then run the GC, it will fail during the marking process, because your native types won&#8217;t respond to the NTL_MarkHandles message. That&#8217;s because usually type procs are written to return an error when they receive an unknown message.</p>
<p>If you do want to support the GC mechanism, then all of your native types need to correctly respond to the NTL_MarkHandles message by calling the new NTLMarkHandle() API function for every JILHandle pointer that your native class uses. Obviously, simple native classes that do not store any JILHandle pointers, don&#8217;t need to do anything, except return good status on that message.</p>
<p>With that, all native types are ready for GC, but what about your application itself?</p>
<p>There are cases, where one or more of your native C++ classes probably obtain JILHandle pointers from the runtime, but they don&#8217;t have a type proc, because they are not a native type for JewelScript. This applies for example to classes that obtain function references from the runtime in order to call script functions, or create script objects and store their reference.</p>
<p>These are classes that <em>have</em> objects from the VM, but they <em>cannot be</em> objects in the virtual machine, because they don&#8217;t have a type proc. Therefore, such classes won&#8217;t get the NTL_MarkHandles message from the GC. As a result, those JILHandle pointers would not get marked, regarded as unused, and destroyed by the GC.</p>
<p>To prevent this, I&#8217;ve added new application side functionality to the API, a mechanism to register for GC events, and unregister from them. Basically, if a C++ class obtains and stores handles from the runtime, it now has to register for GC events in order to get notified about the MARK message.</p>
<p>While I was adapting all my projects to support the GC, I even came across some hybrid types of native C++ classes - classes that <em>have</em> objects from the VM, and <em>can be</em> objects in the VM, because they implement a type proc.</p>
<p>In such a case it is best to handle both the MARK message sent to the type proc, and register for GC events. Because often there is no guarantee that a reference to such a class is currently on the VM&#8217;s stack when the GC runs.</p>
<p>As a rule of thumb, you cannot mark an object too often. It&#8217;s harmless to try to mark the same object twice, but it is fatal to not mark an object at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog reopened for subscribers</title>
		<link>http://blog.jewe.org/?p=39</link>
		<comments>http://blog.jewe.org/?p=39#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:13:09 +0000</pubDate>
		<dc:creator>jewe</dc:creator>
				<category><![CDATA[discussion]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://blog.jewe.org/?p=39</guid>
		<description><![CDATA[I have reopened the blog for subscribers. If you wish to comment or discuss JewelScript, you now have the option to subscribe again.

Subscribing is very simple. Just click on Register in the user block on the right, enter a user name and your email address, and click the register button. After that, you&#8217;ll receive an [...]]]></description>
			<content:encoded><![CDATA[<p>I have reopened the blog for subscribers. If you wish to comment or discuss JewelScript, you now have the option to subscribe again.<br />
<span id="more-39"></span></p>
<p>Subscribing is very simple. Just click on <a title="Register" href="http://blog.jewe.org/wp-login.php?action=register" target="_self">Register</a> in the user block on the right, enter a user name and your email address, and click the register button. After that, you&#8217;ll receive an email with your temporary password.</p>
<p>You can change your password and personal profile settings when you log in.</p>
<p>If you wish to be &#8220;promoted&#8221; to the role of &#8220;Author&#8221;, to be able to write your own posts, just post a comment and say so.</p>
<p>I kindly ask you to post only in the &#8220;discussion&#8221; category, and keep the post civilized and on-topic.</p>
<p><em>Update May 31, 2010: After having been hacked, the blog is no longer open for user subscriptions.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jewe.org/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
