On Thursday, 31 August 2017 at 13:17:36 UTC, Claude wrote:
I think "betterC" can be a good tool to use D on embedded
systems, keep as few dependencies as possible, a low ROM
footprint and a good C interoperability.
I'll try to find some time to play with it.
I agree, embedded systems is one
On Monday, 28 August 2017 at 22:45:01 UTC, Parke wrote:
When I write "hello world" in C, the executable is 8,519 bytes.
When I write "hello world" in D, the executable is 100 times
larger: 865,179 bytes.
Interestingly, "hello world" in C, compiled statically, yields
908,608 bytes. And
On Wednesday, 30 August 2017 at 22:48:45 UTC, Adam D. Ruppe wrote:
On Wednesday, 30 August 2017 at 22:22:23 UTC, Azi Hassan wrote:
extern(C) int main(int argc, char*[] argv, char*[] env)
That's a D array of pointers. A D array is larger than a C
"array" argument, thus you're skipping past
I think "betterC" can be a good tool to use D on embedded
systems, keep as few dependencies as possible, a low ROM
footprint and a good C interoperability.
I'll try to find some time to play with it.
On Wednesday, 30 August 2017 at 22:22:23 UTC, Azi Hassan wrote:
extern(C) int main(int argc, char*[] argv, char*[] env)
That's a D array of pointers. A D array is larger than a C
"array" argument, thus you're skipping past it.
The correct declaration is (int argc, char** argv, char** env).
On Wednesday, 30 August 2017 at 22:22:23 UTC, Azi Hassan wrote:
How should command-line arguments be used in better C ? Looping
through argv seems to print environment variables :
import core.stdc.stdio;
extern(C) int main(int argc, char*[] argv, char*[] env)
{
foreach(i; 0 .. argc)
How should command-line arguments be used in better C ? Looping
through argv seems to print environment variables :
import core.stdc.stdio;
extern(C) int main(int argc, char*[] argv, char*[] env)
{
foreach(i; 0 .. argc)
printf("arg %d: %s\n", i, argv[i]);
return
On Wednesday, 30 August 2017 at 02:19:21 UTC, Michael V. Franklin
wrote:
As you can see it is not a polished experience and gets much
worse when you start employing more features of D. This could
be improved, and in fact, with GDC you need even less useless
boilerplate in object.d and may end
On Wednesday, 30 August 2017 at 00:29:19 UTC, Parke wrote:
But my original question was about what you (Kagamin) called
"intermediate D". I was trying to understand what
"intermediate D"
is, and whether or not I could use "intermediate D" (whatever
it is)
to produce small(er) executables.
On Tue, Aug 29, 2017 at 7:19 PM, Michael V. Franklin via
Digitalmars-d-announce wrote:
> For example, the following is the most minimal "Hello World" I can make with
> D that does not require the -betterC switch, and does not use the official D
> runtime.
On Wednesday, 30 August 2017 at 00:29:19 UTC, Parke wrote:
But my original question was about what you (Kagamin) called
"intermediate D". I was trying to understand what
"intermediate D"
is, and whether or not I could use "intermediate D" (whatever
it is)
to produce small(er) executables.
On Wednesday, 30 August 2017 at 00:29:19 UTC, Parke wrote:
The above D code yields 445,187 bytes when compiled with
-release -betterC.
DMD64 D Compiler 2.075.0-b2 on Linux on x86-64.
-betterC does virtually nothing on that version of dmd...
But my original question was about what you
> On Monday, 28 August 2017 at 22:45:01 UTC, Parke wrote:
>> When I write "hello world" in C, the executable is 8,519 bytes.
>> When I write "hello world" in D, the executable is 100 times larger:
>> 865,179 bytes.
On Tue, Aug 29, 2017 at 8:26 AM, Kagamin via Digitalmars-d-announce
On Monday, 28 August 2017 at 22:45:01 UTC, Parke wrote:
When I write "hello world" in C, the executable is 8,519 bytes.
When I write "hello world" in D, the executable is 100 times
larger: 865,179 bytes.
You mean the examples from the blog post
> On Friday, 25 August 2017 at 18:08:06 UTC, Parke wrote:
>> Is there any documentation on how to access and use the minimal runtime?
On Mon, Aug 28, 2017 at 5:22 AM, Kagamin via Digitalmars-d-announce
wrote:
> Runtime implements language features like
On Friday, 25 August 2017 at 18:08:06 UTC, Parke wrote:
Is there any documentation on how to access and use the minimal
runtime?
Runtime implements language features like boundschecking, it's
not used explicitly in the code.
On Friday, 25 August 2017 at 23:13:53 UTC, Mengu wrote:
On Friday, 25 August 2017 at 00:24:14 UTC, Michael V. Franklin
wrote:
On Thursday, 24 August 2017 at 19:21:31 UTC, Walter Bright
wrote:
[...]
Great! I look forward to seeing improvements and hope to help.
[...]
i believe that should
On Friday, 25 August 2017 at 00:24:14 UTC, Michael V. Franklin
wrote:
On Thursday, 24 August 2017 at 19:21:31 UTC, Walter Bright
wrote:
[...]
Great! I look forward to seeing improvements and hope to help.
[...]
i believe that should be an opt-out. what about newcomers? will
they have to
On Friday, 25 August 2017 at 15:29:54 UTC, Swoorup Joshi wrote:
On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
5 years later...
D - BetterC++ (no gc)
D - BetterJava (full
> On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
>> What is "intermediate D"?
On Fri, Aug 25, 2017 at 1:54 AM, Kagamin via Digitalmars-d-announce
wrote:
> D with minimal runtime.
Is there any documentation on how to access and use the minimal
On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
5 years later...
D - BetterC++ (no gc)
D - BetterJava (full on gc + other goodie tissue)
D - BetterRust (full
On Friday, 25 August 2017 at 10:01:25 UTC, Basile B. wrote:
On Friday, 25 August 2017 at 09:50:39 UTC, Suliman wrote:
On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
How
On Friday, 25 August 2017 at 09:50:39 UTC, Suliman wrote:
On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
How to pass to dub -betterC flag?
{
...
"dflags" :
On Friday, 25 August 2017 at 08:54:02 UTC, Kagamin wrote:
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
How to pass to dub -betterC flag?
On Thursday, 24 August 2017 at 19:09:58 UTC, Parke wrote:
What is "intermediate D"?
D with minimal runtime.
On Thursday, 24 August 2017 at 19:21:31 UTC, Walter Bright wrote:
On 8/24/2017 11:56 AM, Walter Bright wrote:
I find -betterC to be somewhat of a copout for avoiding the
hard work of improving D's implementation.
On the contrary, I view it as providing motivation for dealing
with those
On Thursday, 24 August 2017 at 18:26:37 UTC, H. S. Teoh wrote:
For instance, a D project targeting STM board, makes heavy use
of classes and templates, resultant code segment is 3k.
https://github.com/JinShil/stm32f42_discovery_demo#the-good
To be fair, though, the above-mentioned project
On Thursday, 24 August 2017 at 18:56:25 UTC, Walter Bright wrote:
There is a PR to make it only on demand,
https://github.com/dlang/dmd/pull/6561
but it is mired in problems that are not in the D test suite
and for which no test cases exist.
C++ compilers also have a switch, like
On 8/24/2017 11:56 AM, Walter Bright wrote:
I find -betterC to be somewhat of a copout for avoiding the hard work of
improving D's implementation.
On the contrary, I view it as providing motivation for dealing with those
issues. The PR above is stalled for lack of motivation.
-betterC also
On Wed, Aug 23, 2017 at 10:17 AM, Kagamin via Digitalmars-d-announce
wrote:
> Not a better C, but intermediate D has small footprint for me too.
What is "intermediate D"?
-Parke
> 7.5kb totext.exe (encodes stdin to base64 and writes to stdout) - wrote it
>
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
On 8/23/2017 5:35 PM, Michael V. Franklin wrote:
Consider this: Rust doesn't need a special switch to make it interoperable with
C. What's wrong with D's implementation that requires such things? Granted, D
is not Rust, but D's implementation could be improved to make it more
competitive
On Thu, Aug 24, 2017 at 08:13:29PM +0200, Iain Buclaw via
Digitalmars-d-announce wrote:
[...]
> The GDC camp concurs with the sentiment of betterC being a waste of
> time. My particular stance on the matter is that it should not be an
> all or nothing switch, granular control is fine. The
On 23 August 2017 at 19:44, Jonathan M Davis via
Digitalmars-d-announce wrote:
> On Wednesday, August 23, 2017 13:12:04 Mike Parker via Digitalmars-d-
> announce wrote:
>> To coincide with the improvements to -betterC in the upcoming DMD
>> 2.076, Walter has
On Thursday, 24 August 2017 at 03:31:02 UTC, Swoorup Joshi wrote:
On Wednesday, 23 August 2017 at 17:44:31 UTC, Jonathan M Davis
wrote:
On Wednesday, August 23, 2017 13:12:04 Mike Parker via
Digitalmars-d- announce wrote:
[...]
I confess that I tend to think of betterC as a waste of time.
On 2017-08-24 02:55, H. S. Teoh via Digitalmars-d-announce wrote:
One thing that would help is if things like TypeInfo, ModuleInfo, etc.,
are only emitted on-demand
I think that would be quite difficult if we want to keep all the
existing features. Combining separate compilation, runtime
On Wednesday, 23 August 2017 at 17:43:27 UTC, Steven
Schveighoffer wrote:
I thought "closure" means allocating the stack onto the heap so
you can return the delegate with its context intact.
I understood closure as capture of variables from external
context. They are divided into upward
On Wednesday, 23 August 2017 at 22:45:27 UTC, sarn wrote:
I haven't tried the latest iteration of betterC yet, but the
longstanding problem is that the compiler generates TypeInfo
instances for structs
LDC doesn't generate TypeInfo for structs until it's required for
some features like array
On Wednesday, 23 August 2017 at 17:44:31 UTC, Jonathan M Davis
wrote:
On Wednesday, August 23, 2017 13:12:04 Mike Parker via
Digitalmars-d- announce wrote:
[...]
I confess that I tend to think of betterC as a waste of time.
Clearly, there are folks who find it useful, but it loses so
much
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
On Thu, Aug 24, 2017 at 12:35:22AM +, Michael V. Franklin via
Digitalmars-d-announce wrote:
[...]
> Consider this: Rust doesn't need a special switch to make it
> interoperable with C. What's wrong with D's implementation that
> requires such things? Granted, D is not Rust, but D's
On Wednesday, 23 August 2017 at 17:44:31 UTC, Jonathan M Davis
wrote:
I confess that I tend to think of betterC as a waste of time.
Clearly, there are folks who find it useful, but it loses so
much that I see no point in using it for anything unless I have
no choice. As long as attempts to
On Wednesday, 23 August 2017 at 17:44:31 UTC, Jonathan M Davis
wrote:
I confess that I tend to think of betterC as a waste of time.
The overwhelming majority of programmers don't need betterC. At
all. But today we live in a world where practically everything
just builds on top of C, and we
On Wednesday, 23 August 2017 at 16:17:57 UTC, SrMordred wrote:
No structs in -betterC ???
I haven't tried the latest iteration of betterC yet, but the
longstanding problem is that the compiler generates TypeInfo
instances for structs, and TypeInfos are classes, which inherit
from Object,
On Wednesday, 23 August 2017 at 17:43:27 UTC, Steven
Schveighoffer wrote:
On 8/23/17 11:59 AM, Walter Bright wrote:
On 8/23/2017 7:37 AM, Steven Schveighoffer wrote:
How do dynamic closures work without the GC?
They don't allocate the closure on the GC heap. (Or do I have
static/dynamic
On Wednesday, 23 August 2017 at 17:39:00 UTC, Walter Bright wrote:
On 8/23/2017 10:26 AM, jmh530 wrote:
Am I correct that betterC requires main to be extern(C) and
must act like a C main (i.e. no void return)?
Yes.
This might be added to
http://dlang.org/dmd-windows.html#switch-betterC
or
On 8/23/17 11:59 AM, Walter Bright wrote:
On 8/23/2017 7:37 AM, Steven Schveighoffer wrote:
How do dynamic closures work without the GC?
They don't allocate the closure on the GC heap. (Or do I have
static/dynamic closures backwards?)
I thought "closure" means allocating the stack onto the
On 8/23/2017 10:17 AM, Kagamin wrote:
Also how assert failure works in C?
It calls the C assert failure function.
On Wednesday, August 23, 2017 13:12:04 Mike Parker via Digitalmars-d-
announce wrote:
> To coincide with the improvements to -betterC in the upcoming DMD
> 2.076, Walter has published a new article on the D blog about
> what it is and why to use it. A fun read. And I'm personally
> happy to see
On 8/23/2017 10:26 AM, jmh530 wrote:
Am I correct that betterC requires main to be extern(C) and must act like a C
main (i.e. no void return)?
Yes.
Is that something that can be changed in the future?
Yes, but I don't see a need for it.
On 8/23/17 11:52 AM, Walter Bright wrote:
On 8/23/2017 7:24 AM, Steven Schveighoffer wrote:
Looks like there are some outstanding requests to be fulfilled before
it's pulled.
I don't agree that the requests improve matters.
You may want to mention that in the PR. Right now it just looks
On 8/23/17 11:56 AM, Walter Bright wrote:
On 8/23/2017 7:10 AM, Steven Schveighoffer wrote:
Nope.
A ModuleInfo is generated, as well as FMB/FM/FME sections. Those
sections may not work with the C runtime.
My point was simply that your small example doesn't cause any runtime or
link time
On Wednesday, 23 August 2017 at 14:01:30 UTC, jmh530 wrote:
Great piece.
It might be useful to beef up the documentation on some of the
things that betterC changes. For instance, here
http://dlang.org/dmd-windows.html#switch-betterC
links to TypeInfo, which has like one line of explanation
On Wednesday, 23 August 2017 at 14:00:34 UTC, Walter Bright wrote:
One of the reasons people use C is to get that small footprint.
This has been a large barrier to C programs making use of D.
Not a better C, but intermediate D has small footprint for me too.
7.5kb totext.exe (encodes stdin to
On 8/23/2017 6:12 AM, Mike Parker wrote:
The blog:
https://dlang.org/blog/2017/08/23/d-as-a-better-c/
Reddit:
https://www.reddit.com/r/programming/comments/6viswu/d_as_a_better_c/
Now on the front page of news.ycombinator.com !
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it.
I like this concept of "upward compatibility," -- although
opposed to
On Wednesday, 23 August 2017 at 16:17:57 UTC, SrMordred wrote:
On Wednesday, 23 August 2017 at 15:53:11 UTC, Walter Bright
wrote:
On 8/23/2017 7:10 AM, Steven Schveighoffer wrote:
It's only if you do something that needs the runtime, such as
static ctors, or use the GC.
Or use asserts, or
On Wednesday, 23 August 2017 at 15:53:11 UTC, Walter Bright wrote:
On 8/23/2017 7:10 AM, Steven Schveighoffer wrote:
It's only if you do something that needs the runtime, such as
static ctors, or use the GC.
Or use asserts, or even declare a struct.
No structs in -betterC ???
On 8/23/2017 7:37 AM, Steven Schveighoffer wrote:
How do dynamic closures work without the GC?
They don't allocate the closure on the GC heap. (Or do I have static/dynamic
closures backwards?)
On 8/23/2017 8:05 AM, John Colvin wrote:
"D polymorphic classes will not, as they rely on the garbage collector."
They do? Don't have to allocate classes on the GC heap.
Using them without the GC is a fairly advanced technique, and I don't want to
deal with people writing:
C c = new
On 8/23/2017 7:10 AM, Steven Schveighoffer wrote:
Nope.
A ModuleInfo is generated, as well as FMB/FM/FME sections. Those sections may
not work with the C runtime.
On 8/23/2017 7:10 AM, Steven Schveighoffer wrote:
It's only if you do something that needs the runtime, such as static ctors, or
use the GC.
Or use asserts, or even declare a struct.
On 8/23/2017 7:24 AM, Steven Schveighoffer wrote:
Looks like there are some outstanding requests to be fulfilled before it's
pulled.
I don't agree that the requests improve matters.
On Wednesday, 23 August 2017 at 15:17:31 UTC, Moritz Maxeiner
wrote:
On Wednesday, 23 August 2017 at 14:37:19 UTC, Steven
Schveighoffer wrote:
On 8/23/17 9:12 AM, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
On Wednesday, 23 August 2017 at 14:37:19 UTC, Steven
Schveighoffer wrote:
On 8/23/17 9:12 AM, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
On 8/23/17 9:12 AM, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming DMD 2.076,
Walter has published a new article on the D blog about what it is and
why to use it. A fun read. And I'm personally happy to see the love this
feature is getting. I have a project
On Wednesday, 23 August 2017 at 14:00:34 UTC, Walter Bright wrote:
On 8/23/2017 6:28 AM, Moritz Maxeiner wrote:
I've been mixing C and full D for a while now (on Linux) by
either having the main C program call rt_init/rt_term directly
(if druntime is linked in when building a mixed C/D
On 8/23/17 10:11 AM, Walter Bright wrote:
On 8/23/2017 7:01 AM, jmh530 wrote:
ModuleInfo isn't linked to at all (and I'm still a little unclear on
what that does).
That's because ModuleInfo doesn't appear in the online documentation due
to having a malformed Ddoc comment. I fixed it here:
On Wednesday, 23 August 2017 at 14:01:30 UTC, jmh530 wrote:
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read.
On 8/23/2017 7:01 AM, jmh530 wrote:
ModuleInfo isn't linked to at all (and I'm still a little unclear on what that
does).
That's because ModuleInfo doesn't appear in the online documentation due to
having a malformed Ddoc comment. I fixed it here:
On 8/23/17 10:00 AM, Walter Bright wrote:
On 8/23/2017 6:28 AM, Moritz Maxeiner wrote:
Interesting article, though one thing that I'm confused by is
Hence D libraries remain inaccessible to C programs, and chimera
programs (a mix of C and D) are not practical. One cannot
pragmatically “try
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
On 8/23/2017 6:28 AM, Moritz Maxeiner wrote:
Interesting article, though one thing that I'm confused by is
Hence D libraries remain inaccessible to C programs, and chimera programs (a
mix of C and D) are not practical. One cannot pragmatically “try out” D by
add D modules to an existing C
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote:
To coincide with the improvements to -betterC in the upcoming
DMD 2.076, Walter has published a new article on the D blog
about what it is and why to use it. A fun read. And I'm
personally happy to see the love this feature is
76 matches
Mail list logo