boost crowd.

2011-11-27 Thread so
, pushing language's capabilities. So, if someone is annoyed by the limits of C++, that would be them. Forget everything, i was thinking that the generic capabilities of D alone is enough to attract all the boost crowd. Phew, had to get it out.

Re: boost crowd.

2011-11-27 Thread Paulo Pinto
...). They are the top C++ developers, pushing language's capabilities. So, if someone is annoyed by the limits of C++, that would be them. Forget everything, i was thinking that the generic capabilities of D alone is enough to attract all the boost crowd. Phew, had to get it out. Why switch state o

Re: boost crowd.

2011-11-27 Thread so
On Sun, 27 Nov 2011 19:13:46 +0200, Paulo Pinto wrote: Why switch state of the art C++ compilers with years of optimizations built-in and tooling by D? Tool and compilers come eventually, especially after big players attend in discussions. I don't understand this reasoning really, what e

Re: boost crowd.

2011-11-27 Thread Andrei Alexandrescu
are the top C++ developers, pushing language's capabilities. So, if someone is annoyed by the limits of C++, that would be them. Forget everything, i was thinking that the generic capabilities of D alone is enough to attract all the boost crowd. Phew, had to get it out. The dynamic

Re: boost crowd.

2011-11-27 Thread Alexey Veselovsky
I'm trying to switch from C++ to D. But I can't find some things that I love in C++. For example in C++ I can separate module specification and implementation. Advertising article "The Case for D" says that it is real in D too: "D has a true module system that supports separate compilation and gen

Re: boost crowd.

2011-11-27 Thread Walter Bright
On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: "D has a true module system that supports separate compilation and generates and uses module summaries (highbrowspeak for "header files") automatically from source, so you don't need to worry about maintaining redundant files separately, unless you

Re: boost crowd.

2011-11-27 Thread Walter Bright
On 11/27/2011 9:53 AM, so wrote: Even Herb Sutter broke his silence and mentioned D here and there, Herb is a very nice (and very smart) guy, and when I've heard him talk about D he's been very complimentary about our efforts.

Re: boost crowd.

2011-11-27 Thread Jude
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/27/2011 06:44 PM, Alexey Veselovsky wrote: > I'm trying to switch from C++ to D. But I can't find some things > that I love in C++. For example in C++ I can separate module > specification and implementation. Advertising article "The Case for > D

Re: boost crowd.

2011-11-27 Thread Alexey Veselovsky
WB> How is it not true? J> dmd -H [file] -c generates the header file for you quite nicely. ok. Let's a see: C++ code. Specification: // test.hpp file #ifndef _test_hpp_ #define _test_hpp_ void foo(); struct Boo { public: void boo(); private: struct S {}; }; #endif Implementation:

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 03:44:23 +0200, Walter Bright wrote: On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: "D has a true module system that supports separate compilation and generates and uses module summaries (highbrowspeak for "header files") automatically from source, so you don't need to w

Re: boost crowd.

2011-11-28 Thread Maxim Fomin
2011/11/28 so : > On Mon, 28 Nov 2011 03:44:23 +0200, Walter Bright > wrote: > >> On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: >>> >>> "D has a true module system that supports separate compilation and >>> generates and uses module summaries (highbrowspeak for "header files") >>> automatically

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 11:01:31 +0200, Maxim Fomin wrote: In D, when compiler generate "interface" it effectively dumps implementation in .di file. This is what i meant by saying it doesn't make sense, it is an auto-generated file. You can argue about .di shortcomings but you can't compare t

Re: boost crowd.

2011-11-28 Thread Dejan Lekic
I come from the C++ world as well. I still do some C++ work, mostly related to my legacy applications... C++ has no modules. End of story. Header files are not modules, they are just... piece of source code. I also did some (toy) Modula-3 projects in the past, and must admit I adore the languag

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 11:01:31 +0200, Maxim Fomin wrote: It is true and makes sense until D will stop claiming .di files are interface files. I also was curious how should i replace C library style with .h and .c files. In D, when compiler generate "interface" it effectively dumps implementa

Re: boost crowd.

2011-11-28 Thread Caligo
On Sun, Nov 27, 2011 at 6:44 PM, Alexey Veselovsky < alexey.veselov...@gmail.com> wrote: > I'm trying to switch from C++ to D. But I can't find some things that > I love in C++. For example in C++ I can separate module specification > and implementation. Advertising article "The Case for D" says t

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 11:42:24 +0200, Caligo wrote: On Sun, Nov 27, 2011 at 6:44 PM, Alexey Veselovsky < alexey.veselov...@gmail.com> wrote: I'm trying to switch from C++ to D. But I can't find some things that I love in C++. For example in C++ I can separate module specification and implementa

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
> The separation of specification and implementation in C/C++ is not some > feature that they came up.  I would call it a design defect.  Having to > split up code between header files and source files is one of the things I > dislike about C/C++.  As for why anyone would be in love with such a thi

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 09:40:06 +0200, Alexey Veselovsky wrote: Now, let's try this on D: // Implementation module test; public { void foo() {foo_helper();} struct Boo { public: void boo() {S ss; foo_helper();} private: struct S {}; } } private { s

Re: boost crowd.

2011-11-28 Thread Jude
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > > I tried to write a lib and a project, which used that lib > separately, but came to conclusion that the best choice it to pull > lib code to project one. And it is not a biggest problem, because > dmd produces 700 kb executable for hello word pro

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
I think that D should provide an opportunity for both styles: with or without specification separation from implementation. In some cases I prefer to not separate implementation (small programs / scripts), but in some projects I really need to separate implementation from manually written specifica

Re: boost crowd.

2011-11-28 Thread Walter Bright
On 11/27/2011 11:40 PM, Alexey Veselovsky wrote: Also I can't write method implementation in different (implementation) file (without inheritance). -- .di file module foo; int bar(); -- .d file - module foo; int bar() { return 3; }

Re: boost crowd.

2011-11-28 Thread Marco Leise
Am 28.11.2011, 11:02 Uhr, schrieb Jude <10equa...@gmail.com>: I tried to write a lib and a project, which used that lib separately, but came to conclusion that the best choice it to pull lib code to project one. And it is not a biggest problem, because dmd produces 700 kb executable for hello wo

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
>> Also I can't >> write method implementation in different (implementation) file >> (without inheritance). > > -- .di file > > module foo; > > int bar(); > > -- .d file - > > module foo; > > int bar() { return 3; } Method, not global function. struct Foo

Re: boost crowd.

2011-11-28 Thread Walter Bright
On 11/28/2011 3:19 AM, Alexey Veselovsky wrote: Also I can't write method implementation in different (implementation) file (without inheritance). -- .di file module foo; struct Foo { void foo(); } -- .d file - module foo; struct Foo {

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
>  module foo; > >  struct Foo { >       void foo(); >  } > >  -- .d file - > >  module foo; > >  struct Foo { >       void foo() { ... code ... } >  } ok. What about: struct Foo { int a; int b; // 100 more fields ... void foo(); } Did I must write in impl

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 13:32:12 +0200, Walter Bright wrote: On 11/28/2011 3:19 AM, Alexey Veselovsky wrote: Also I can't write method implementation in different (implementation) file (without inheritance). -- .di file module foo; struct Foo { void foo();

Re: boost crowd.

2011-11-28 Thread Max Samukha
On 11/28/2011 11:44 AM, so wrote: On Mon, 28 Nov 2011 11:42:24 +0200, Caligo wrote: On Sun, Nov 27, 2011 at 6:44 PM, Alexey Veselovsky < alexey.veselov...@gmail.com> wrote: I'm trying to switch from C++ to D. But I can't find some things that I love in C++. For example in C++ I can separate

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
ok. I just removed from test.di all non public entities. // D import file generated from 'test.d' module test; public { void foo(); struct Boo { public { void boo(); } } } Now, let's build it: $ dmd test.di test.d main.d test.d: Error: module t

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 13:58:25 +0200, Max Samukha wrote: How would you write libraries? The way they do, for example, in C# - interface definitions are stored in the library, no need for separate headers. Are we talking about the same thing? Something like http://msdn.microsoft.com/en-us/

Re: boost crowd.

2011-11-28 Thread Jacob Carlborg
On 2011-11-28 10:01, Maxim Fomin wrote: I tried to write a lib and a project, which used that lib separately, but came to conclusion that the best choice it to pull lib code to project one. And it is not a biggest problem, because dmd produces 700 kb executable for hello word program. Neither t

Re: boost crowd.

2011-11-28 Thread Max Samukha
On 11/28/2011 02:29 PM, so wrote: On Mon, 28 Nov 2011 13:58:25 +0200, Max Samukha wrote: How would you write libraries? The way they do, for example, in C# - interface definitions are stored in the library, no need for separate headers. Are we talking about the same thing? Something like h

Re: boost crowd.

2011-11-28 Thread Maxim Fomin
2011/11/28 Marco Leise : > Am 28.11.2011, 11:02 Uhr, schrieb Jude <10equa...@gmail.com>: > >>> I tried to write a lib and a project, which used that lib >>> separately, but came to conclusion that the best choice it to pull >>> lib code to project one. And it is not a biggest problem, because >>> d

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 15:34:19 +0200, Max Samukha wrote: No, it has nothing to do with the IDE. The article describes a visual tool for viewing meta-data stored in a .NET binary. You don't have to use it. Specially for you, die-hard IDE haters, this is how to use the terminal to create a m

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 15:52:51 +0200, so wrote: Now how do you know you have a "Lib", and it implements "hello", what rule enforces that? If this is all it does, you are overlooking the most important point of header files. It was obscure. A header enforces its contents for both library writ

Re: boost crowd.

2011-11-28 Thread Maxim Fomin
2011/11/28 Max Samukha : > On 11/28/2011 02:29 PM, so wrote: >> >> On Mon, 28 Nov 2011 13:58:25 +0200, Max Samukha >> wrote: >> How would you write libraries? >>> >>> The way they do, for example, in C# - interface definitions are stored >>> in the library, no need for separate headers. >> >>

Re: boost crowd.

2011-11-28 Thread Max Samukha
On 11/28/2011 03:52 PM, so wrote: On Mon, 28 Nov 2011 15:34:19 +0200, Max Samukha wrote: No, it has nothing to do with the IDE. The article describes a visual tool for viewing meta-data stored in a .NET binary. You don't have to use it. Specially for you, die-hard IDE haters, this is how to u

Re: boost crowd.

2011-11-28 Thread Max Samukha
On 11/28/2011 04:05 PM, so wrote: For the second part if library writer changes anything with "implementation", that would not affect the user. In your case it does, because there is no distinction between specification and implementation There is, but the specification is bundled with the impl

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 18:21:03 +0200, Max Samukha wrote: Could you clarify what is the most important part? As i tried in the above post, header files are specs, a contract between library writer and the user. A dll itself is not a spec, it is the implementation. If you want to use a libra

Re: boost crowd.

2011-11-28 Thread Alexey Veselovsky
Separate hand written specification is rulez for human. It is best short module description (with some useful manually written comments). I like it more then autogenerated docs (by doxygen and so on). Autogenerated specifications (headers and so on) are worst and ugly. But in language like java an

Re: boost crowd.

2011-11-28 Thread Max Samukha
On 11/28/2011 06:07 PM, Maxim Fomin wrote: In conclusion, I find D module support the worst one. Sad but true.

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 18:41:30 +0200, Alexey Veselovsky wrote: Separate hand written specification is rulez for human. It is best short module description (with some useful manually written comments). I like it more then autogenerated docs (by doxygen and so on). I agree for C/C++ and even fo

Re: boost crowd.

2011-11-28 Thread Adam Ruppe
Do you think it'd be a good thing to put the .di file in the generated compiled lib? That'd be somewhat similar to the c# example. dmd myprog.d something.dll searches something.dll for a .di reference, and adds it to the compile command line if it's there.

Re: boost crowd.

2011-11-28 Thread Timon Gehr
On 11/28/2011 09:01 AM, so wrote: On Mon, 28 Nov 2011 03:44:23 +0200, Walter Bright wrote: On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: "D has a true module system that supports separate compilation and generates and uses module summaries (highbrowspeak for "header files") automatically fr

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 19:26:23 +0200, Timon Gehr wrote: Nobody stops you from hand crafting *.di files. My point exactly.

Re: boost crowd.

2011-11-28 Thread Maxim Fomin
2011/11/28 Timon Gehr : > On 11/28/2011 09:01 AM, so wrote: >> >> On Mon, 28 Nov 2011 03:44:23 +0200, Walter Bright >> wrote: >> >>> On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: "D has a true module system that supports separate compilation and generates and uses module summaries

Re: boost crowd.

2011-11-28 Thread Timon Gehr
On 11/28/2011 05:41 PM, Alexey Veselovsky wrote: Separate hand written specification is rulez for human. It is best short module description (with some useful manually written comments). I like it more then autogenerated docs (by doxygen and so on). Autogenerated specifications (headers and so o

Re: boost crowd.

2011-11-28 Thread Timon Gehr
On 11/28/2011 05:07 PM, Maxim Fomin wrote: 2011/11/28 Max Samukha: On 11/28/2011 02:29 PM, so wrote: On Mon, 28 Nov 2011 13:58:25 +0200, Max Samukha wrote: How would you write libraries? The way they do, for example, in C# - interface definitions are stored in the library, no need for sepa

Re: boost crowd.

2011-11-28 Thread Timon Gehr
On 11/28/2011 06:41 PM, Maxim Fomin wrote: 2011/11/28 Timon Gehr: On 11/28/2011 09:01 AM, so wrote: On Mon, 28 Nov 2011 03:44:23 +0200, Walter Bright wrote: On 11/27/2011 4:44 PM, Alexey Veselovsky wrote: "D has a true module system that supports separate compilation and generates and us

Re: boost crowd.

2011-11-28 Thread Kagamin
so Wrote: > http://cpp-next.com/archive/2011/11/having-it-all-pythy-syntax/ o.O overload a lambda?

Re: boost crowd.

2011-11-28 Thread Kagamin
Alexey Veselovsky Wrote: > ok. What about: > > struct Foo { > int a; > int b; > // 100 more fields > ... > void foo(); > } > > Did I must write in implementation all this 100+ fields in implementation? > > In Ada and Modula there is 2 languages: one for implementation and >

Re: boost crowd.

2011-11-28 Thread so
On Mon, 28 Nov 2011 21:12:32 +0200, Kagamin wrote: In Java separation is done with interfaces. I think it is right. For Java, yes.

Re: boost crowd.

2011-11-28 Thread Walter Bright
On 11/28/2011 3:41 AM, Alexey Veselovsky wrote: ok. What about: struct Foo { int a; int b; // 100 more fields ... void foo(); } Did I must write in implementation all this 100+ fields in implementation? Yes. (Unless you decide to use the PIMPL idiom.)

Re: boost crowd.

2011-11-28 Thread Walter Bright
On 11/28/2011 4:00 AM, Alexey Veselovsky wrote: ok. I just removed from test.di all non public entities. // D import file generated from 'test.d' module test; public { void foo(); struct Boo { public { void boo(); } } } Now, let's bui

Re: boost crowd.

2011-11-28 Thread Kagamin
so Wrote: > On Mon, 28 Nov 2011 21:12:32 +0200, Kagamin wrote: > > > In Java separation is done with interfaces. I think it is right. > > For Java, yes. Java, D or C++, classes and structs are not a separation. Want a real separation? See COM: it doesn't even have notion of a field.

Re: boost crowd.

2011-11-28 Thread bearophile
Walter: > On 11/28/2011 4:00 AM, Alexey Veselovsky wrote: > > Compiler doesn't know anything about "specification" files. So, he > > did't check specification&implementation conformance. > > Yes, that's correct. And this is positive because? See also Timon answer: http://www.digitalmars.com/web

Re: boost crowd.

2011-11-28 Thread Kagamin
bearophile Wrote: > And this is positive because? You say it as if it's negative.

Re: boost crowd.

2011-11-28 Thread Jude
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/28/2011 12:37 PM, Kagamin wrote: > so Wrote: > >> http://cpp-next.com/archive/2011/11/having-it-all-pythy-syntax/ > > o.O > > overload a lambda? And now I see what all the hype is about with D's template system. Good lord. I've never rea

Re: boost crowd.

2011-11-28 Thread Marco Leise
Am 28.11.2011, 14:42 Uhr, schrieb Maxim Fomin : 2011/11/28 Marco Leise : Am 28.11.2011, 11:02 Uhr, schrieb Jude <10equa...@gmail.com>: I tried to write a lib and a project, which used that lib separately, but came to conclusion that the best choice it to pull lib code to project one. And it i

Re: boost crowd.

2011-11-29 Thread Paulo Pinto
Kagamin Wrote: > bearophile Wrote: > > > And this is positive because? > > You say it as if it's negative. For me it is negative as what I understood from this discussion is that contrary to what is described in TDPL, D modules are not ready to prime time. At least at the level Modula-2(3),

Re: boost crowd.

2011-11-29 Thread Peter Alexander
On 29/11/11 2:12 AM, Marco Leise wrote: Am 28.11.2011, 14:42 Uhr, schrieb Maxim Fomin : 2011/11/28 Marco Leise : Am 28.11.2011, 11:02 Uhr, schrieb Jude <10equa...@gmail.com>: I tried to write a lib and a project, which used that lib separately, but came to conclusion that the best choice it

Re: boost crowd.

2011-11-29 Thread Kagamin
Paulo Pinto Wrote: > Kagamin Wrote: > > > bearophile Wrote: > > > > > And this is positive because? > > > > You say it as if it's negative. > > > For me it is negative as what I understood from this discussion is that > contrary to what is described in TDPL, D modules are not ready to prime

Re: boost crowd.

2011-11-29 Thread Kagamin
Maxim Fomin Wrote: > C#: as example above. No headers. Private members are not known. Maxim Fomin Wrote: > C#: as example above. No headers. Private members are not known. Hmm... Really? Though I remember something about "can't access private member" errors. And yes, metadata sells you everyth

Re: boost crowd.

2011-11-29 Thread Timon Gehr
On 11/28/2011 08:40 PM, Walter Bright wrote: On 11/28/2011 4:00 AM, Alexey Veselovsky wrote: ok. I just removed from test.di all non public entities. // D import file generated from 'test.d' module test; public { void foo(); struct Boo { public { void boo(); } } } Now, let's build it: $ dmd t

Re: boost crowd.

2011-12-01 Thread Walter Bright
On 11/29/2011 1:46 AM, Peter Alexander wrote: Which means you also get a horrible O(n) algorithm for something that should be a couple of compares. Why DMD does this is beyond me. I did it to get it up and running, and haven't revisited that yet. Global float arrays can bloat executables as

Re: boost crowd.

2011-12-02 Thread Hans Uhlig
On 11/28/2011 9:40 AM, Timon Gehr wrote: On 11/28/2011 05:41 PM, Alexey Veselovsky wrote: Separate hand written specification is rulez for human. It is best short module description (with some useful manually written comments). I like it more then autogenerated docs (by doxygen and so on). Auto

Re: boost crowd.

2011-12-02 Thread Walter Bright
On 11/28/2011 8:07 AM, Maxim Fomin wrote: Probably i am mistaken that this post supports D modules (in a way, showing that header files are crap), but ... In C# no headers are required, because it includes metadata in dynamic library. In your example you link code to compiled library without hea

Re: boost crowd.

2011-12-02 Thread Adam D. Ruppe
Walter Bright Wrote: > It's too bad there's no way to 'bind' arbitrary data to shared executable > library files Would using the resource compiler work on Windows? I'm pretty sure dlls have icon resources just like exes, so having a string resource in there might work too. (I don't know that mu

Re: boost crowd.

2011-12-02 Thread Walter Bright
On 12/2/2011 5:44 PM, Adam D. Ruppe wrote: Walter Bright Wrote: It's too bad there's no way to 'bind' arbitrary data to shared executable library files Would using the resource compiler work on Windows? I'm pretty sure dlls have icon resources just like exes, so having a string resource in the

Re: boost crowd.

2011-12-04 Thread Jacob Carlborg
On 2011-12-03 02:44, Adam D. Ruppe wrote: Walter Bright Wrote: It's too bad there's no way to 'bind' arbitrary data to shared executable library files Would using the resource compiler work on Windows? I'm pretty sure dlls have icon resources just like exes, so having a string resource in ther