Hi,
I'm new to D. I tried the basic Hello World program ("dmd hello.d")
but it produced a 316 KB big binary. The same thing with C ("gcc
hello.c") is about 9 KB. Is there a way to reduce the size of the
produced binary?
Thanks,
Laszlo
In the off chance that some of you are running a Mac and using
CodeRunner to play around with D, I cooked up the files you need
for CodeRunner to highlight D's syntax:
https://github.com/jniehus/Dlang-for-CodeRunner
On 26 February 2012 21:28, Jabba Laci wrote:
> Hi,
>
> I'm new to D. I tried the basic Hello World program ("dmd hello.d")
> but it produced a 316 KB big binary. The same thing with C ("gcc
> hello.c") is about 9 KB. Is there a way to reduce the size of the
> produced binary?
>
> Thanks,
>
> Laszl
On 02/25/2012 05:04 PM, Robert Rouse wrote:
> On Saturday, 25 February 2012 at 23:10:51 UTC, Ary Manzana wrote:
>> On 2/25/12 7:31 PM, Robert Rouse wrote:
...
>>> This means that D can simulate Ruby blocks more than I thought. That's
>>> pretty awesome. I'm loving D more every day.
>>
>> How's t
On 02/25/2012 08:25 AM, Ashish Myles wrote:
> I want to define a general-purpose centroid computer for point containers
> and ran into a couple of challenges. Firstly, here is the basic code
>
> Point3 computeCentroid(PointContainer)(const ref PointContainer C)
> if (...)// want
On 2012-02-26 11:03, Ali Çehreli wrote:
On 02/25/2012 05:04 PM, Robert Rouse wrote:
> On Saturday, 25 February 2012 at 23:10:51 UTC, Ary Manzana wrote:
>> On 2/25/12 7:31 PM, Robert Rouse wrote:
...
>>> This means that D can simulate Ruby blocks more than I thought. That's
>>> pretty awesom
On 02/26/2012 12:18 AM, Jonathan M Davis wrote:
On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote:
This is useful:
struct S{
@disable enum init = 0;
}
I thought that the way that you were supposed to do that was
@disable this();
- Jonathan M Davis
struct S{@disable this();}
v
On 2012-02-26 10:26, Joshua Niehus wrote:
In the off chance that some of you are running a Mac and using
CodeRunner to play around with D, I cooked up the files you need for
CodeRunner to highlight D's syntax:
https://github.com/jniehus/Dlang-for-CodeRunner
I'm using TextMate on Mac with D, it
On Sunday, February 26, 2012 12:48:06 Timon Gehr wrote:
> On 02/26/2012 12:18 AM, Jonathan M Davis wrote:
> > On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote:
> >> This is useful:
> >>
> >> struct S{
> >>
> >> @disable enum init = 0;
> >>
> >> }
> >
> > I thought that the way tha
On 26-02-2012 12:53, Jonathan M Davis wrote:
On Sunday, February 26, 2012 12:48:06 Timon Gehr wrote:
On 02/26/2012 12:18 AM, Jonathan M Davis wrote:
On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote:
This is useful:
struct S{
@disable enum init = 0;
}
I thought that the way
On Sunday, February 26, 2012 13:15:51 Alex Rønne Petersen wrote:
> On 26-02-2012 12:53, Jonathan M Davis wrote:
> > On Sunday, February 26, 2012 12:48:06 Timon Gehr wrote:
> >> On 02/26/2012 12:18 AM, Jonathan M Davis wrote:
> >>> On Saturday, February 25, 2012 17:07:14 Timon Gehr wrote:
> Thi
You may try -L--gc-sections (in case of gdc in combination with
-ffunction-sections -fdata-sections) and -L-s
Le vendredi 24 février 2012 à 13:00 -0800, H. S. Teoh a écrit :
> On Fri, Feb 24, 2012 at 09:35:57PM +0100, Jordi Sayol wrote:
> > Al 24/02/12 20:45, En/na H. S. Teoh ha escrit:
> [...]
> > > I personally think that phobos *should* be a shared object at some
> > > point, but not everyone agrees wit
Le vendredi 24 février 2012 à 15:56 +0100, Mike Wey a écrit :
> On 02/23/2012 08:29 PM, bioinfornatics wrote:
> > Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
> >> On 02/23/2012 05:27 PM, bioinfornatics wrote:
> >>> dear,
> >>> for set soname with:
> >>> - gdc: -Xlinker -soname myLib.
On 02/25/2012 09:06 AM, Jacob Carlborg wrote:
_deh_beg and _deh_end is the start and end of the exception handling
tables. _tlsstart and _tlsend would be the start and end of the TLS
data. As far as I know druntime has not yet been adapted to handle
dynamic libraries.
I think there's a pull requ
bug.d
>8>8
@trusted:
import std.datetime : benchmark;
import std.stdio: writefln, writeln;
alias double Real;
void ben(alias fun)(string msg, uint n = 1_000_000) {
auto b = benchmark!fun(n);
writefln(" %s %s ms", msg, b[0].to!("msecs", int)
On 02/26/2012 09:06 PM, Caligo wrote:
Once you have those two files, compile with this:
dmd -unittest t1.d bug.d
and then run t1:
./t1
The output you get should look like this:
...
[0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 1, 2, 0, 1, 0, 0]
I get:
...
[0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 1, 2, 0, 1, 0, 0
Thanks. I have reported the bug:
http://d.puremagic.com/issues/show_bug.cgi?id=7595
On 02/26/2012 02:53 PM, bioinfornatics wrote:
Le vendredi 24 février 2012 à 15:56 +0100, Mike Wey a écrit :
On 02/23/2012 08:29 PM, bioinfornatics wrote:
Le jeudi 23 février 2012 à 19:46 +0100, Mike Wey a écrit :
On 02/23/2012 05:27 PM, bioinfornatics wrote:
dear,
for set soname with:
- gdc:
On 02/26/2012 03:45 AM, Jacob Carlborg wrote:
> On 2012-02-26 11:03, Ali Çehreli wrote:
>> On 02/25/2012 05:04 PM, Robert Rouse wrote:
>> > On Saturday, 25 February 2012 at 23:10:51 UTC, Ary Manzana wrote:
>> >> On 2/25/12 7:31 PM, Robert Rouse wrote:
>>
>> ...
>>
>> >>> This means that D can simu
Hello! OP here :)
I'm gonna be more precise why I want this.
I'm writing my own blog, I will write my own HTTP server etc. and
the saving of the data myself. Everything will be done in D! Why?
Learn D. I don't want to hear the reinvent the wheel :(, I think
you learn a lot by doing thing like t
So, here's my code, as it stands currently:
import std.stdio;
static enum Type {
request,
response
};
class Parser(Type t) {
static if (t == Type.request) {
string name = "request";
} else {
string name = "response";
}
string message;
this(string message) {
this.message = message;
}
}
voi
On 02/26/2012 03:22 PM, Chopin wrote:
> I don't want to hear the reinvent the wheel :(, I think you
> learn a lot by doing thing like this.
Agreed.
> So, when I POST a blog-entry, I will read it, and write it to a file. I
> don't want write strings in a file, like:
>
> 1--||--Title--||--The ent
On Sunday, 26 February 2012 at 02:01:17 UTC, Andrew Wiley wrote:
I recall having some issues because Winsock needs to be on the
linker
commandline *after* phobos. Try running with `gdc -v` to see
what the
linker commandline looks like.
That's it... any way to get it in the correct order, with
On 2/27/12, Ali Çehreli wrote:
> D is awesome compared to C as it enables serializing/deserializing data
> with its generic programming and compile-time reflection features like this:
>
>http://dlang.org/traits.html#allMembers
ae's json uses .tupleof, and does it in 40(!)* lines of code.
* W
The immutable is not necessary, use:
auto h = new Parser!(Type.request)("Hello world");
Otherwise, if you really want to declare the type instead of infering
it you can write:
Parser!(Type.request) h = new Parser!(Type.request)("Hello world");
You can also do:
Parser!(Type.request) h;
h = new typ
> Also, 'static' on the enum declaration doesn't really do anything. :)
but what if the immutable data changes?! :P
But yeah, D's type inference is reasonably good (not as good as
Haskell's, but nothing is as good as Haskell's), so doing what seems
like the best way is normally the right way arou
On Sun, Feb 26, 2012 at 5:25 AM, Ali Çehreli wrote:
> On 02/25/2012 08:25 AM, Ashish Myles wrote:
>> However the code above doesn't seem to work and requires me to
>> explicitly invoke the slice operator myself like
>> foreach(p; C[]) { ... }
>> when my data structure clearly defines
28 matches
Mail list logo