January 26, 2014 Re: Current state of "D as a better C" (Windows)? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | As you heard Andrei, too many *language features*, NOT *user code* rely on objects staying around till the GC collects them. It's not a matter of malloc/free everything in your user code. D as a language would not work with this little gcstub. |
January 26, 2014 Re: Current state of "D as a better C" (Windows)? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On Wednesday, 22 January 2014 at 02:18:43 UTC, Vladimir Panteleev wrote:
> Hi,
>
> What's the current situation of using D without Phobos/Druntime?
>
> Sometimes, it's quite useful to be able to use D to create tiny EXEs/DLLs. For example, create simple DLL plugins that will be loaded into non-D programs, or even not have a 50-line program take half a meg. Additionally, some tasks require injecting a DLL systemwide (into every running process), so it is critical to minimize the impact by being as unintrusive as possible and having a minimal overhead.
>
> I've started a "framework" for this purpose a while ago[1], but I heard of people starting similar projects since then and I think they've gotten further than me. Would there be any interest in collaborating and turning this into a community project?
>
> I think some goals would be:
> - A "runtime" (object.d) which provides either stubs for the current compiler hooks, or implementations with minimal dependencies
> - A "standard library" which does not require runtime support, but can also be used when using Druntime (as a GC-free alternative to Phobos)
> - Using MSVCRT on 32-bit as well
> - Options to enable/disable various runtime features? For example, a project may want to use exceptions (which requires ClassInfo) but not the GC.
> - Support for the Unilink linker? I think it is better at generating smaller binaries that OPTLINK.
>
> There is also some ongoing work on the -betterC switch[2], which I'm quite excited about, but it seems to be currently blocked on waiting for the next DMD release as the changes[3] might break a lot of code.
>
> [1]: https://github.com/CyberShadow/SlimD
> [2]: https://d.puremagic.com/issues/show_bug.cgi?id=11881
> [3]: https://github.com/D-Programming-Language/dmd/pull/2561
There was a minimal runtime library project somewhere on Bitbucket if I remember. I think the goal is the same. You could borrow some code from there perhaps.
In general I totally agree with you. I wanted to do the same, but decided to wait for allocators...
|
January 26, 2014 Re: Current state of "D as a better C" (Windows)? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Bauer | On Saturday, 25 January 2014 at 22:15:29 UTC, Frank Bauer wrote:
> D is NOT a systems language. So no point in application level
> comparison with C. Set aside syntactic similarities.
>
> If your language does not have the C / C++ *semantics* of new /
> delete, or, better yet, owned pointers in Rust that automatically
> free their memory when they go out of scope, but instead forces a
> GC down your throat for some of the most basic array and standard
> library functionality, you will never, ever write kernel level
> code that stands a chance against C, C++ or Rust.
>
> Other than that, a "D with owned pointers" and an opt-in GC
> relegated to a library implementation (maybe with some minimal
> language hooks) would be my language of choice. I love D's
> templates.
>
> I understand that this would be a complete redesign of the
> language and Phobos, and would break most of the D code out
> there. That's why it won't happen.
>
> Everybody seems to realize this, finally. Just have a look at the
> last (long) GC thread. Comparisons of D with Java and C# all over.
This post made me laugh. Thanks for the entertainment.
|
January 27, 2014 Re: Current state of "D as a better C" (Windows)? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike | On Sunday, 26 January 2014 at 08:24:55 UTC, Mike wrote:
> ... But as a rude janitor that barges into the party, orders the band to stop playing and the dancers to stop moving so he can sweep the floor (i.e. GC) ...
Nominated for best stop-the-world GC analogy 2014. Cannot unsee. (un-think?)
|
January 27, 2014 Re: Current state of "D as a better C" (Windows)? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Bauer | On 2014-01-26 16:18, Frank Bauer wrote: > As you heard Andrei, too many *language features*, NOT *user code* rely > on objects staying around till the GC collects them. It's not a matter > of malloc/free everything in your user code. D as a language would not > work with this little gcstub. Sure it would, it just wouldn't free everything as it should. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation