Making D Lang More easy.
Mafi
mafi at example.org
Wed May 11 07:22:26 PDT 2011
Am 11.05.2011 15:41, schrieb Matthew Ong:
> Hi All,
Hi
>
> Recently I have been looking into another alternative programming
> language to Java 1.6 and C++:
>
> I narrowed downed to 2: Google Go and D Programming.
> Preference has been given to D compare to Go for a few reasons like
> more keywords than java(superset) and supports build in
>
> I also downloaded the http://d-ide.sourceforge.net/.
> This IDE is small foot print and tries to be like visual studio.
> Why not someone in D consider porting this to a more mature IDE like:
>
> SharpDevelop
> http://sharpdevelop.net/OpenSource/SD/Default.aspx
> Or
> NetBeans or Eclipse
> Instead of re-inventing the wheel?
>
For Eclipse there is for example DDT and there are VisualD and Descent.
http://code.google.com/a/eclipselabs.org/p/ddt/
> 1) D is a feature rich and seems to generate a really small file size
> foot print for both *.dll and *.exe (Nice!!) compare to Google Go.
>
>
> 2) D Supports Interface and Class inheritance. (Nice!!)
> However I seems to have problem to model something like this in D:
>
> public class MyException extends Exception implements
> SomeInterface{
> }
>
> I tried:
> class MyException : Exception, SomeInterface{ //<< That cause
> compilation error. Why??? How to work around or solution?
> }
That is strange. Maybe you did something else wrong. The following works
on my machine and dmd 2.051 (not the newest!).
class C {}
interface I { void print(); }
abstract class D : C, I {}
void main() {}
>
> This allow me to move some of my library that I have build in java
> into D without much remodeling and refactoring lots of code. (Really
> nice!!!) compare to google go which build around a entirely different
> object modeling concept. (That concepts sounded good and uses a lot of
> interfaces and . Like java.sql.*)
>
> 3) As D seems to have direct support to C API which make direct OS
> resource access and writing cool OS level tool a really nice work.
> Have not tried anything yet, but seems to be more matured than Google
> Go.
>
> 4) Is there also a Code formatting tool like:
> gofmt Gofmt formats Go programs. // That save me a lot to time.
> The Netbeans and eclipse has this build in feature.
>
> 5) import std.stdio; // The imports seems to be more complex to use
> than java's import. There should be a tool to help resolved this and
> also makes the order of importing of not important like in java.
>
The module system has been given much attention so that the import order
doesn't matter and you cannot use an ambigous symbol without error.
Because there's no VM, you have to import everything you want to use.
If you know C++, think of it like #include and using namespace x; at the
same time.
http://d-programming-language.org/module.html#ImportDeclaration
> 6) Is there some build in source code checking command like:
> govet
> http://golang.org/cmd/
>
> 7) How about unit test, is there a library like junit or cppunit
> is there something similar that can allow code to be profile,
> tested and validated?
>
Simple unittesting is built in with the unittest block. Use -unittest to
compile a unit test version (dmd). D also supports contracts and asserts.
http://d-programming-language.org/dbc.html
http://d-programming-language.org/unittest.html
If you want to benchmark use std.datetime.StopWatch
(http://d-programming-language.org/phobos/std_datetime.html#StopWatch).
> May I also ask, does the compiler and linker highlight the unused
> import to the user so that they can be removed from source code.
>
That sounds like an interesting feature but is AFAIK not implemented yet.
>
> The have experienced with C++ and C since back in the turbo c dos day
> and Java. D seems to be promising. Overall nice and good. But can be
> improved more to simplified coding cycle.
>
I hope I could help you,
Mafi
More information about the Digitalmars-d
mailing list