<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro for the D programming language.</title>
		<link>http://www.allegro.cc/forums/view/354471</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 28 Apr 2004 04:48:16 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you are interested in the programming language D, the attachment contains whatever one needs to use Allegro from D.</p><p>From those who don&#39;t know, D is a new programming language which combines the best parts of C/C++ and Java. It can be found here:</p><p>www.digitalmars.com
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Mon, 26 Apr 2004 03:19:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
... attachment?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Mon, 26 Apr 2004 03:20:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It seems that it was eaten. Was it too large (758K) ? anyway, i am reposting it.</p><p>EDIT: indeed, too large. I&#39;ve taken out the Allegro help and alleg40.dll (I wanted it to be complete for the D guys to download). Anyway, I hope it is ok now (83K).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Mon, 26 Apr 2004 03:30:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="quote_container"><div class="title">The page said:</div><div class="quote"><p>You can attach a small file <b>(less than 500KB)</b> to your post. It will not be displayed inline; only members will be able to download it. You should not select the file if you are spell checking or previewing.</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Mon, 26 Apr 2004 03:35:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It may be helpful to include a small bullet point list of how to set up the D environment, a simple Allegro hello world program, and a batch file that compiles it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Mon, 26 Apr 2004 04:08:18 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>It may be helpful to include a small bullet point list of how to set up the D environment, a simple Allegro hello world program, and a batch file that compiles it.</p></div></div><p>

Ok, here it is:</p><p>1) download the D compiler for WIN32 from here:</p><p><a href="ftp://ftp.digitalmars.com/dmd.zip">ftp://ftp.digitalmars.com/dmd.zip</a></p><p>2) download the D linker and utilities:</p><p><a href="ftp://ftp.digitalmars.com/dmc.zip">ftp://ftp.digitalmars.com/dmc.zip</a></p><p>3) unzip both packages at c:\.</p><p>4) download and install the D ide &quot;DIDE&quot; from here:</p><p><a href="http://www.atari-soldiers.com/dide.html">http://www.atari-soldiers.com/dide.html</a></p><p>5) set DIDE option Settings/DIDE settings/General Settings/DMD path to &quot;C:\dmd\bin&quot;</p><p>6) create a new project (option File/New Project). A hello world program will be created for you.</p><p>7) press F5 to compile and run the program.</p><p>8) read the D documentation from:</p><p>C:\dmd\html\d\index.html
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Mon, 26 Apr 2004 14:27:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Which improvements may I get from learning and using D instead of C?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Marco Radaelli)</author>
		<pubDate>Mon, 26 Apr 2004 16:13:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Which improvements may I get from learning and using D instead of C?</p></div></div><p>

You get to be a leet D-Dude?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nonnus29)</author>
		<pubDate>Mon, 26 Apr 2004 21:38:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Which improvements may I get from learning and using D instead of C?</p></div></div><p>

-garbage collection<br />-no separation between header and implementation<br />-standard sizes of data types across different architectures<br />-no include files; uses import instead; results in much faster compiles<br />-templates and template specialization, either partial or complete (VC++ does not handle this correctly)<br />-class properties<br />-threads and synchronization<br />-unit tests <br />-design by contract<br />-asm<br />-direct interfacing to C<br />-no -&gt;<br />-no ; after structs/classes</p><p>and lots of other things...</p><p>Generally, this language the best points of C/C++ and the best points of Java. You can code right to the metal, or as high level as Java.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Mon, 26 Apr 2004 21:53:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You can code right to the metal</p></div></div><p>

Yeah. Except for that pesky <i>memory management</i>. No coding &quot;right to the metal&quot; there <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Korval)</author>
		<pubDate>Tue, 27 Apr 2004 00:25:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Marco Radaelli said:</div><div class="quote"><p>
Which improvements may I get from learning and using D instead of C? 
</p></div></div><p>
</p><div class="quote_container"><div class="title">axilmar said:</div><div class="quote"><p>
-asm
</p></div></div><p>
Wait... since when does C/C++ not support assembly? Either inline or at link time?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Tue, 27 Apr 2004 01:50:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Speaking of which, how does C++ (let alone C itself) not offer &quot;direct interfacing to C&quot;?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Korval)</author>
		<pubDate>Tue, 27 Apr 2004 01:58:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
What&#39;s &quot;design by contract&quot; supposed to be, by the way?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Tue, 27 Apr 2004 02:02:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I hope axilmar doesn&#39;t get scared off, these are good questions.  One of the problems with java is loading a binary file and mapping it to a struct; you can&#39;t do it.  You have to load a byte array then step thru it and extract an int here, a float there etc... makes loading an MD2 file a pain the <span class="cuss"><span>ass</span></span>.  So how does D deal with that?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (nonnus29)</author>
		<pubDate>Tue, 27 Apr 2004 02:46:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>What&#39;s &quot;design by contract&quot; supposed to be, by the way?</p></div></div><p>
Design by contract allows you to check the in and out values of a method. You could for example specify that a certain parameter has to be in a certain range, and that values returned have to be in another range.</p><p>If this is a language feature, automated testing gets way more easy, since the test routine can use the provided info to create test cases.<br />It&#39;s also some sort of additional documentation.</p><p>It&#39;s comparable to assert() on all invalid values for your function parameters in c - and then assert on your return values as well.<br />With the difference that the code to do this is created by the compiler.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Tue, 27 Apr 2004 02:58:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
What&#39;s &quot;design by contract&quot; supposed to be, by the way?
</p></div></div><p>
I&#39;ve read it. It&#39;s similar to what the Eiffel language offers. You can implicitly define precondition, postconditions and bucle invariants. Preconditions and postconditions are inherited from the base class when you override a function. This info is also used by the compiler to make optimizations (lets say you say in the pre that the parameter <i>i</i> will be positive, maybe that leads to some optimization in some part of the code).</p><p>The tests to the pre/posts and invariants are also verified in debug builds, so they also act as ASSERT.</p><p>Here&#39;s a simple example in Eiffel:
</p><div class="source-code snippet"><div class="inner"><pre>set_type<span class="k2">(</span>type: INTEGER<span class="k2">)</span> is
require
  type <span class="k3">=</span> type_generic <span class="k1">or</span>
  type <span class="k3">=</span> type_terminal <span class="k1">or</span>
  type <span class="k3">=</span> type_out
<span class="k1">do</span>
  type_part <span class="k2">:</span><span class="k3">=</span> tipo<span class="k2">;</span>
ensure
  type_part <span class="k3">=</span> tipo
end
</pre></div></div><p>

[edit]<br />It may seem that the last check is stupid. But it&#39;s not. If someone inherits from the class this method is in, that postcondition must be true also for the inherited class.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Tue, 27 Apr 2004 03:07:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Speaking of which, how does C++ (let alone C itself) not offer &quot;direct interfacing to C&quot;?</p></div></div><p>

Name mangling.
</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">extern</span> <span class="s">"C"</span> <span class="k2">{</span>
...
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Paul Pridham)</author>
		<pubDate>Tue, 27 Apr 2004 05:19:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Yeah. Except for that pesky memory management. No coding &quot;right to the metal&quot; there</p></div></div><p>

You have direct control of the garbage collector: you can remove objects from garbage collection anytime. You can also delete objects as in C/C++, manually, or overload the new and delete operations for custom memory management.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Wait... since when does C/C++ not support assembly? Either inline or at link time? </p></div></div><p>

Most C/C++ compilers do, but with D you have it right there as standard, and there is no variation in syntax between Linux and Windows.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I hope axilmar doesn&#39;t get scared off</p></div></div><p>

Not at all. My first reaction was &quot;bah, C++ rules, I don&#39;t need another language&quot;. After a couple of weeks with D, I am at &quot;C++ ? what C++ ?&quot; :-)</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>So how does D deal with that?</p></div></div><p>

D provides unions and structs exactly like in C/C++, so you can load data and map them to structs directly. It also provides for user-controlled alignment of members.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>With the difference that the code to do this is created by the compiler.</p></div></div><p>

Another benefit of the compiler handling contracts is that all those checks can be removed by a compiler switch.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Speaking of which, how does C++ (let alone C itself) not offer &quot;direct interfacing to C&quot;?</p></div></div><p>

This comment is mainly aimed at Java, which can&#39;t do direct interfacing. This makes it difficult to use already existing code written with C. With D, it&#39;s a child&#39;s play.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (axilmar)</author>
		<pubDate>Tue, 27 Apr 2004 14:34:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>there is no variation in syntax between Linux and Windows.</p></div></div><p>
Nor is there with C.<br />There is difference in how things are handled by different compilers, but I can use the same inline assembler in Linux as in Windows.<br />I don&#39;t think it&#39;s much of a feature of a high-level language to have a standard way to inline assembler though, since assembler is by its very nature not portable and part of the rationale for using a high-level language is to hide the hardware specifics.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Another benefit of the compiler handling contracts is that all those checks can be removed by a compiler switch.</p></div></div><p>
Since assert isa a macro, this is true of C asserts as well. Not saying it&#39;s not a nifty language feature though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Tue, 27 Apr 2004 14:50:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I had a look at it, and it seems to be pretty neat. Not sure if I&#39;m going to use it as my new language of choice, but I&#39;ll play with it a couple of weekends... it&#39;s a slick language.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (spellcaster)</author>
		<pubDate>Tue, 27 Apr 2004 15:48:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Nor is there with C.
</p></div></div><p>
Doesn&#39;t the GNU compiler use asm (no underscore?). MSVC uses _asm. And they both use different syntaxes (GNU is AT&amp;T, MSVC is Intel).</p><p>Or are you comparing the two <i>ports</i> of the GNU compiler? In which case, I assume you&#39;d be right.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I don&#39;t think it&#39;s much of a feature of a high-level language to have a standard way to inline assembler though, since assembler is by its very nature not portable and part of the rationale for using a high-level language is to hide the hardware specifics.
</p></div></div><p>
Well, maybe it&#39;s whatever you want it to be. You could write very high level stuff, and have your renderer use very low level stuff, without having to use another language (excluding assembler, if you want it.) Leaving it up to smart people to make smart decisions, instead of forcing you do it their way. The one free of &quot;potental&quot; problems.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Chris Katko)</author>
		<pubDate>Tue, 27 Apr 2004 17:23:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Or are you comparing the two ports of the GNU compiler?</p></div></div><p>
Yes. The difference between GCC and MSVC is just that, a difference between compilers, not platforms. The same inline code works in DOS, Windows and Linux, using gcc.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 28 Apr 2004 04:48:16 +0000</pubDate>
	</item>
</rss>
