C2 forum

General Category => Ideas => Topic started by: bas on March 05, 2014, 10:11:00 AM

Title: D-language Modules/Imports
Post by: bas on March 05, 2014, 10:11:00 AM
Hi,

I've studied the Module/Import system of the D language (dlang.org). D is a
language that tries to be a better C++. It's good to see that there are lots
of similarities between D and C2. This means that more people make the same
choices, which probably means that can't be that bad.

Similarities are:

Differences are:
I'm very interested in the public import feature. Does anyone have experience with this
(drawbacks, large-scale problems, advantages?)

Another think I'm still thinking about is the concept of something bigger than
C2 Packages. In D these are called Modules, but D also has a concept of Package.
The only use I discovered was that the compiler automatically looks for pkg.module
in pkg/module.d. But maybe in C2 we can use this for something else..

Finally, I think 'Module' reflects the meaning a bit better than 'Package', so
maybe C2 will also follow this. Package was currently chosen to create distinction
from clang's 'Modules' concept.

Anymore?

Bas

Title: Re: D-language Modules/Imports
Post by: DerSaidin on March 24, 2014, 12:06:44 PM
The differences you list are mainly syntax. In the interest of exploring more significant differences:

What are C2's advantages compared to D?
What is a project that you think C2 would be a better choice than D?
Title: Re: D-language Modules/Imports
Post by: bas on March 27, 2014, 08:02:58 AM
I did not have the intention to compare C2 to D here; just compare the import system, since that is very similar in
need/purpose. D can be seen as a 'replacement' for C++. C2 is covering the same domain is C. So whenever you
would use C for something, you could use C2. But for software that usually written in C++ now, maybe D can be
used. So the domains are different. C2 is a lower-level language than D, with all advantages/disadvantages.