A simple reference is here:
http://tunah.net/~tunah/d-string/doc.txt
And the code is here:
http://tunah.net/~tunah/d-string/string.d
If you try it, let me know what you think or any suggestions you have.
Sam
Check it out at http://www.scratch-ware.net/D/
A few months ago, I started working on a D front end for GCC. I didn't want to make any announcements until I was sure it was feasible. Well, I finally got it working. This first release is almost a complete implementation -- the only major features missing are inline assembler and volatile statements. Supported systems are x86 Linux and MacOS X with gcc 3.3 and 3.4.
You can download the files here:
http://home.earthlink.net/~dvdfrdmn/d
I'll post more about the implementation soon.
Enjoy!
David Friedman
I've ported glExcess into D.
http://yaneurao.zive.net/yaneSDK4D/glexcess002.zip
The latest version of 'glExcess into D' can download here:
http://www.sun-inet.or.jp/~yaneurao/dlang/english.html
(including source , opengl.d , glu.d , glut.d etc..)
yaneurao.
http://groups.yahoo.com/group/d_lab
You can read messages without joining. You have to join to post a message (I think there will be very little spam that way).
I've posted an updated version of dig that compiles with DMD 0.77. If you have suggestions for improvements, you can join and post messages and upload files.
If you want a place to upload some D source files, projects, etc. without the bother of creating a webpage, please feel free. (I'd prefer the material to be D-related, but it certainly doesn't have to be dig-related.)
--
Justin
http://jcc_7.tripod.com/d/
Here's a link:
http://www.sun-inet.or.jp/~yaneurao/dlang/lib/ddoc.zip
Hauke
Several weeks ago, I posted a link to one D based kernel I came across. I don't believe it's on Digitalmars D language Links page so it's not easy to come across. You have to search through the volumes of posts in this newsgroup to find it.
here it is:
http://www.geocities.com/one_mad_alien/dkernel.html
I haven't actually looked too much into this one, but the author seems to have a good base for an OS going (written using mostly D).
I think it would be great to have an OS with integrated garbage collection. And D would be a great language to program it in.
Later,
John
I've been doing it for ages. It's pretty straightforward.
The only thing is that it needs a filter - one slightly improved from Burton's original - used for the INPUT_FILTER, which I've attached.
Other than that, it's just like using it for C/C++
Add a key '.d' to HKLM/Software/Microsoft/VisualStudio/7.x/Languages/File Extensions and copy the value from .c into it. That'll make VS treat D as if it were C++.
To add user keywords, create a file called UserType.dat and put it in the same directory as msdev.exe. You can set the colour for the keywords in this file in the 'User Defined Keywords' subsection of the syntax highlighting settings.
All guidance and suggestions will be greatly appreciated. Code is attached.
import formatter; /* * the trailing () is needed to convert the formatter object to a * string, since implicit conversions are not possible */ char[] result = format("{0} + {1} = {2}") (5) (2) ("Spam") ();You can grab it at http://ikagames.com/andy/d/console-19-sep-2003.zip
NOT VERY MUCH
In order to customize SWIG for any given language, there is only one source file that needs to be created. For Java, it's a file called "java.cxx" for C#, it's a file called "csharp.cxx". Each of these files is moderately complex. The java file, with all of the comments and newlines stripped out, is about 1400 lines of code (in C++). The csharp file is about 1600 lines.
That's not very much code.
Plus, I'm guessing that much of the code for the D extension would look an awful lot like the code for the Java and C# extensions, so we could borrow heavily from the existing implementation.
However, this project is not for the faint of heart. Even if it only requires writing 1500 or so lines of code, the author will have to have a pretty good command of C++ (I'm already out of the running) and an excellent understanding of D semantics (that eliminately most of us).
But, on the upside, once it's done we'll have access to millions of lines of C++ code to use as imports and libraries for our own projects. I'm just giddy at the notion that we could suddenly have access to the entire wxWindows library, after writing only 1500 lines of code.
I've just spent the last 20 minutes or so reading up about swig ( http://www.swig.org ) and I'm impressed. Since there are already language bindings connecting C/C++ to Java, C#, Perl, Python, PHP, OCaml (and a few other languages), it shouldn't be too difficult to use those implementations as a reference for creating a D SWIG extension.
In my opinion, this is the most important project for D in the upcoming year. Because if we can assemble a general purpose method for creating bindings between C++ and D, we'll open up access to lots of existing libraries that we can't use now.
As soon as I've got the repository site up and running, this is one of the projects I'g going to create.
There are several new small housekeeping modules, along with the synsoft.win32.reg module that does registry stuff.
I've also changed the names of several methods in previous modules (I've decided to standardise on ThisKindOfMethodName, rather than this_kind_of_method_name()), but because of a linker weirdness - it wouldn't link when there were start() and Start() methods in the same class - the deprecated functions with the old names have had to be removed. Apologies if this causes problems. ;/
The registry library, like the other ones, is a header-only from a source-perspective (i.e. the method bodies are stripped). This is not because I'm being precious, just that I only want any attention you may give on the module's API, not the implementation. Once this module is matured, it may be going into Phobos, at which point, obviously, all source will be available.
Note that the reg module only does enumeration for the moment. I've not yet decided on the format for adding/deleting keys/values, and am happy to hear some suggestions from anyone.
Alas, there are still no test programs, but I'm including my test program for the registry module here. Version 1.3 of the libraries will have test and sample progs, I promise.
(I've got to toddle off and do some other things - deadlines, deadlines - but I'll be keeping an eye on the ng, and will try to respond to feedback/questions/abuse. ;) )
Enjoy!
GtkGLExt
http://gtkglext.sourceforge.net/
(I need to put a big digital mars logo on DUI home page, maybe a D logo...)
DUI
http://ca.geocities.com/duitoolkit/
A few pages ( D String/Complex/DbC vs C++'s ) are not done yet, but i'll finish them soon.
http://dlanguage.netunify.com/38
The basic support is for most of the syntax and keywords and font-lock for highlighting. Some D-specific constructs aren't supported like nested comments (I've been wrestling with cc-engine.el to figure out how cc-mode parses comments -ugh!), but in general I've found it does a reasonable job with most of the sample files and phobos.
Hopefully I'm not sucking up too much of the upload space. If I am I'll find another spot to park it. I also added an entry to that wiki for emacs. I've only tried it on Windows but I don't imagine linux emacs would have any problem.
enjoy,
-Ben Hinkle
- The link bar now contains Index and Folder links.
- I changed "Members" and "FolderMembers" to "Contributors" and "FolderContributors" which seems more approriate.
I may be a bit disappointing for some that Wikis grow slowly but in fact a Wiki is an invitation to join in for common writing and not the presentation of a sparkling and ready "product".
Some pages slowly begin to show shape, like e.g.: http://www.prowiki.org/wiki4d/wiki.cgi?FaqRoadmap
Things that would be needed but havn't yet evolved:
- a page for ongoing projects (although there is an incomplete list on the FrontPage)
- a page for wanted projects, although there is http://www.prowiki.org/wiki4d/wiki.cgi?SuggestedProjects
- a page for library design considerations and standards
Please take the Wiki as a public space that you are a co-owner of.
home page (temporary I hope):
http://ca.geocities.com/duitoolkit/index.html.
download page:
http://ca.geocities.com/duitoolkit/downloadPage.html
Some notes:
This is a very early alpha release to let interested people look at the options an directions DUI is taking. Comments and suggestions are welcome, if you are interested in using DUI this is the time to influence it's devel.
This is Linux only (other Un*x flavors might be easy to use)
My Makefiles knowleadge is limited so probably you have to change the Makefile to suit your environment
I see from microsofts site that a Quake2 in C# have just released (source and all) anyone fancy porting it to D ?
D syntax highlighting is to be incorporated with KDE as part of the Kate editor in the future.
Im planning on adding code browser soon (thanks to keith's great idea of CTAGS! ), and then a dialog editor.
I'm waiting on approval from sourceforge for DublN (CPAN like tool ), but they are taking a suspiciously long time to respond. I would host it but my hosting company doesnt offer mysql, does anyone have any room somewhere so we can get started on this ?
I noticed a link called D journal on the DM page, I have room to host it if someone wants to write it ?
Charles
That's a nice little library. The last one I tried to work with was Berkeley's in Python, and that soured me so bad on small database libraries (the format wasn't portable between Windows and Linux!) that I didn't think there could be a useful one.
So I'm working on a wrapper for SQLite that uses the DLL and supplies a class, including little niceties like buffered table modifications. A beta should be done in a couple of hours.
I've attached the import library and import headers for them. You'll need the DLL from the SQLite site. This should also work on the Linux side using the .so.
I've just started trying to learn the D language and I really like it so far. It seems that the example code included with the compiler is pretty short on language features and uses no OOP at all. So, I created another version of the wordcount program that uses every D feature I could learn.
I have attached the source code in case it might be of some value to Walter's effort.
Ps: I may have recreated the wheel in places, so any comments would be welcomed by this newbie.
Thanks
Here's a 1st cut at systax highlighting for the KDE Advance Text Editor.
d.xml needs to be placed in OME/.kde/share/apps/katepart/syntax
Simon
I've written a very basic cgi module. It parses headers, querystrings and forms as well as getting and settings cookies. It needs lots of more work, but is quite useful already. Anyway, I've tested it a little and was hoping that others might test it aswell so I can add useful stuff. I've only used PHP before and all this strong typing really hurts my brain! :-) So I could use some help..
Anyway, I'll send the module along and here's a small test program I wrote:
import cgi; void main() { Request req = new Request(); Response res = new Response(); if(req.serverVariable("REQUEST_METHOD") == "POST") { char[] name = req.formString("name"); // returns formfield value as string char[] comment = req.formString("comment"); res.cookie("name", name, "", "", "", 0); res.write("<html>\n<head>\n<title>CGI-test</title>\n</head>\n"); res.write("<body>\n"); res.write("Hello <b>"~name~"</b><p>\n"); res.write("You wrote:\n"); res.write("<blockquote><b>\""~comment~"\"</b></blockquote>\n"); res.write("<a href='cgitest.exe'>Back to form</a>"); res.write("</body></html>"); res.flush(); } else { char[] cookie; try { cookie = req.cookie("name"); } catch(CGIError) // cookie wasn't set! { cookie = ""; } printf(res.getHeaders()~"\n\n"); printf("<html>\n<head>\n<title>CGI-test</title>\n</head>\n"); printf("<body>\n"); printf("<form method='post' action='cgitest.exe'>\n"); printf("Name: <input type='text' name='name' value='%.*s'><br>\n",cookie); printf("Comment: <input type='text' name='comment'><br>\n"); printf("<input type='submit' value='Send!'>\n"); printf("</form></body></html"); } }
Not through direct syntax. You can synthesize one using a static member and function. You can also force memory recycling:
class Singleton { static Singleton singleton; new (uint size) { if (singleton === null) { singleton = (Singleton) new void * [(size + 3) / 4]; singleton.init (); } return singleton; } /* This is used instead of a constructor to avoid having the constructor called multiple times. */ void init () { /* Prepare the singleton. */ } } Singleton a = new Singleton (); /* Create the new singleton. */ Singleton b = new Singleton (); /* Recycle the old singleton. */Unfortunately one can't create a Singleton base class that would have the inherited property, because "new" isn't passed the ClassInfo.
One might ask what I'm doing using "new void * [size / 4]" instead of "new ubyte [size]". Once the GC is type-aware, casting between an array of values and an object reference will result in any pointers in the object being collected. I think I've advocated putting in casting limitations to prevent the problem before, but in any case I am now; you should not be able to cast between a value array and a pointer.
Link is now http://users.tpg.com.au/smackoz/projects/d/d_kde_support.tar.bz2
Simon J Mackenzie wrote:
> I've created some Linux mime type images for D. You can download the
> tar.bz2 files with all requred images, 16x16, 22x22, 32x32, 48x48,
> 64x64, 128x128 from http://users.tpg.com.au/smackoz/
>
> Use the dmd.png image to impove the appearance of your folder image for
> DMD (works with KDE, ??other desktops??).
>
> Simon
>
> Is it possible to download a file from the internet through a D program?
> Where might I find instructions on how to do such a thing?
I put up a library for doing this back in March. Here's a copy of the release notes:
I've put up a simple URL loading library at (http://www.opend.org/urllib.zip). It requires dig to be installed, although it doesn't use it, just digc. Comes with the documentation. It has the functions:
urlopen: Open a URL as a stream (http, file, ftp, nntp, and dict schema
supported).
urlread: Open a URL and read its contents.
urllistdir: List a directory, return an array of URLStat (file and ftp
schema supported).
urlencode, urldecode: Encode and decode the URL. The above functions
expect a decoded URL.
There's also a small, simple, not-thought-out sockets library.
I may be missing something, but I haven't found any information in the D documentation for how to declare associative array literal values all at once. For example, once I've declared an array as: char[char[]][] myArray; I can now only add values to that array one at a time, as follows: myArray["red"] = "ff0000"; myArray["green"] = "00ff00"; myArray["green"] = "0000ff"; What I'd like to be able to do (especially in cases where I have lots of values to add to the array) would look something like this: myArray = { "red" => "ff0000", "green" => "00ff00", "blue" => "0000ff" }; ..or something like that. I don't really care about the {} braces or the => operator, but I would like something that lets me declare an associative array literal, just like I can declare a static array using the code: int[] def = { 1, 2, 3 };
http://www.cs.utah.edu/impulse/
"Von Neumann's prediction of 1945 continues to hold true - memory is the primary system bottleneck."
The ICFP 2003 is coming ( http://icfpcontest.org/ ), going from
2003-06-28 to 2003-06-30. Are people here interested in losing a weekend for
it. I know I am ;)
As usual we have no idea about this year's task, but I think a team of 3
to 6 developers should be enough. Also if we give it a shot and get
ourselves a nice place we could get some attention for D.
i/ Huge play is made on the versatility of array type, which seems somewhat unfair to languages that explictly support the listed behaviour in their STANDARD libraries that are expected as part of a conforming implementation.
Specifically, C++ does not have 'resizable arrays' as a langauge feature because they are in the standard library, std::vector. There is no likelihood any proposal to add such a feature to the language would ever pass committee because it is already required to be present (in the library) in any conforming C++ implementation.
While I can understand your desire to show your own product in the best possible light, I would like to at least see a 3rd option between 'yes' and 'no' for features implemented in the standard library of other languages (rather than 3rd party libraries, no matter how common)
Suggest a 'LIB' cell coloured yellow.
[otherwise such clear bias on something I do know well will give me doubts about other items I am less clear on, see below]
Under OOP you say C++ has module support. News to me, this is one of the most requested extensions to the library and I still don't know anyone with a clear idea how to approach it! I suggest you change this to 'No'
Also, Covariant return types is duplicated in OOP and functions sections, is that intentional?
Under reliablility I am very surprised that only 'D' rates as unit testable. I would at least like a link to some material explaining why only 'D' qualifies here. A good opportunity for a sales pitch if ever I saw one, this is the detail that caught my attention most!! [Although I don't use Java, I was surprised that its extensive reflection API and unit-testing community did not qualify]
Again, a footnote explaining why C++ does not support all 'C' types would be useful. Do you mean C99 here, or are there even more obvious cases I am missing?
I would be happy to see 'struct member alignment control' dropped from
C++ (and presumably C) as this relies on common compiler extensions,
rather than true features of the language itself. If we are going to
permit extensions, there are several popular C++ variants supporting
delegates, but I would not suggest you add that to the list either
Last but not least, it would be really nice to turn the logic on the
Macro Preprocessor. The presence of this mis-feature is the cause of
endless annoyance to C++, and its lack is certainly another score for
'D'.
Oh, and as a cheeky new feature you might want to add 'reference
implementation available' given that I am not yet aware of a conforming
C++ implementation [although EDG-based solutions are getting very close
now]
Interesting chart though. If you can find the people to contribute I
would be interested in seeing how Eiffel, Python, Smalltalk and Haskell
score as well.
You can see an example of this here:
http://home.mindspring.com/~jonf4/d_docs/base.html
As I am not a D programmer, I used one of Daniel Yukio Yokomiso's Deimos
library files as an example.
So, is this a good idea ?
It seems like too much work to write the required HTML by hand. It ought to
be possible to use the D parser to create a d2html program that uses the
parse tree generate the HTML.
Any thoughts ?
5/23/03 Jon Frechette writes:
I have been trying to see how far one could go in creating source code
documentation by mixing D and DHTML. The idea is to turn the source code
into its own dynamic 'Table of Contents'.
February 2002 issue of Dr. Dobb's:
"The D Programming Language"
by Walter Bright
Feedback and Comments
Add feedback and comments regarding this
page.
Copyright © 1999-2005 by Digital Mars, All Rights Reserved