Contents
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
Better C
- Simplifying the process of integration at the build-system level
- Removing the need to ensure that Druntime is properly initialized on calls to the library, when an initialization step is not performed before the library is used.
- Mixing memory management strategies (GC + manual memory management) can sometimes be tricky, hence removing D's GC from the equation may be a good solution
extern(C) void main() { import core.stdc.stdio : printf; printf("Hello betterC\n"); }
> dmd -betterC hello.d && ./hello Hello betterC
Consequences
As no Druntime is available, many D features won't work. For example:- Garbage Collection
- Thread-local storage
- TypeInfo and ModuleInfo
- Classes
- Built-in threading (e.g. core.thread)
- Dynamic arrays (but not slices) and associative arrays
- Exceptions
- switch with strings
- final switch
- synchronized and core.sync
- Static module constructors or deconstructors
- Struct deconstructors
- unittest (testing can be done without the -betterC flag)
Copyright © 1999-2018 by the D Language Foundation | Page generated by
Ddoc on Fri Feb 23 19:35:22 2018