New libraries wave-d and y4m-d

2014-04-29 Thread ponce via Digitalmars-d-announce
wave-d is a library for reading and writing WAV format (range-based). https://github.com/p0nce/wave-d --- y4m-d is a library for reading and writing Y4M files. https://github.com/p0nce/wave-d Y4M is one of the simplest uncompressed video format, it's designed to

Re: New libraries wave-d and y4m-d

2014-04-29 Thread ponce via Digitalmars-d-announce
There was a typo error: https://github.com/p0nce/y4m-d On Tuesday, 29 April 2014 at 18:46:51 UTC, ponce wrote: y4m-d is a library for reading and writing Y4M files. https://github.com/p0nce/wave-d

Re: New libraries wave-d and y4m-d

2014-04-29 Thread Rikki Cattermole via Digitalmars-d-announce
On Tuesday, 29 April 2014 at 18:48:33 UTC, ponce wrote: There was a typo error: https://github.com/p0nce/y4m-d On Tuesday, 29 April 2014 at 18:46:51 UTC, ponce wrote: y4m-d is a library for reading and writing Y4M files. https://github.com/p0nce/wave-d I checked out y4m-d when it went up on

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread via Digitalmars-d
On Monday, 28 April 2014 at 23:57:36 UTC, Walter Bright wrote: First off, I expect std to be put in core.stdcpp.std, and then imported. So this issue would only happen if 3rd party A and 4th party B each imported 5th party C. Yeah, it'll happen, and it'll still work, as the import system

listing template function overloads for use in compile time decisions

2014-04-29 Thread Atash via Digitalmars-d
Let's say that we have a struct `A` that contains some template function named `fn` template-parameterized on its argument types: struct A { ... void fn(A)(auto ref A a) { ... } ... } I cannot get a handle on `fn` as an alias when searching for overloads of the string fn in `A` via

Re: listing template function overloads for use in compile time decisions

2014-04-29 Thread Atash via Digitalmars-d
On Tuesday, 29 April 2014 at 06:22:34 UTC, Atash wrote: Let's say that we have a struct `A` that contains some template function named `fn` template-parameterized on its argument types: struct A { ... void fn(A)(auto ref A a) { ... } ... } I cannot get a handle on `fn` as an alias when

Re: python vs d

2014-04-29 Thread Paulo Pinto via Digitalmars-d
On Monday, 28 April 2014 at 22:31:58 UTC, bearophile wrote: Paulo Pinto: Pascal expatriates like myself won't consider indexes from 1 a design mistake. :) What's the good of having all arrays always start from index 1 (this is different from Ada, where you can choose the indexing range and

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/28/2014 11:06 PM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Monday, 28 April 2014 at 23:57:36 UTC, Walter Bright wrote: First off, I expect std to be put in core.stdcpp.std, and then imported. So this issue would only happen if 3rd party A and 4th party B each

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 06:50:19 UTC, Walter Bright wrote: No, it'll happen if they use the same vector library an #include the same vector3D and independently specify their own binding? But if they cooperate and use the same binding, then you are ok? That makes no sense. I simply don't

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 12:10 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Tuesday, 29 April 2014 at 06:50:19 UTC, Walter Bright wrote: No, it'll happen if they use the same vector library an #include the same vector3D and independently specify their own binding? But if they

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
Basically, Ola, if you could write a piece of sample D code that you feel will not work, please do so.

Re: python vs d

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/28/2014 7:02 PM, bearophile wrote: Nick Sabalausky: VB6 let you choose your starting index, too. It was rarely useful and constantly made array-handling code a pain in the ass. Of course, VB made pretty much everything a PITA...(I used to work at a VB6 house. *shudder*) (As far as I

Re: python vs d

2014-04-29 Thread John Colvin via Digitalmars-d
On Monday, 28 April 2014 at 23:02:03 UTC, bearophile wrote: I think it could be a good idea to add something intermediate to D: optional strong typing for array indexing. I'd like to write a DIP on this someday (note that this does not mean I am suggesting D array indexes to optionally start

Re: STUN/TURN servers

2014-04-29 Thread Radu via Digitalmars-d
On Tuesday, 29 April 2014 at 01:21:36 UTC, Vladimir Panteleev wrote: On Monday, 28 April 2014 at 18:36:59 UTC, Radu wrote: Every time I read anything related to STUN/TURN, it becomes obvious that these technologies were designed by some committee. Metric tons of technical jargon and

Re: python vs d

2014-04-29 Thread Paulo Pinto via Digitalmars-d
On Tuesday, 29 April 2014 at 08:21:04 UTC, John Colvin wrote: On Monday, 28 April 2014 at 23:02:03 UTC, bearophile wrote: I think it could be a good idea to add something intermediate to D: optional strong typing for array indexing. I'd like to write a DIP on this someday (note that this does

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 07:50:41 UTC, Walter Bright wrote: Basically, Ola, if you could write a piece of sample D code that you feel will not work, please do so. But I did? framework1.d: extern(C++,veclib){ struct … vec4 …; } extern(C++,physics){ vec4 f(vec4 …) … } framework2.d:

tuple can write [],but can't read []

2014-04-29 Thread FrankLike via Digitalmars-d
Hi,erveryone, type Tuple!(int,int,int,string) can write[],but can't read[]; module main; import std.stdio,std.typecons,std.conv; void main(string[] argv) { alias Tuple!(int,int,string) tuple2; alias Tuple!(int,int,string)[10] tupleS2; void bbx(tupleS2 x) {

Re: tuple can write [],but can't read []

2014-04-29 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 29 April 2014 at 09:23:03 UTC, FrankLike wrote: Hi,erveryone, [...] xy2[1][0]=100; // can write [...] writeln(xy2[0][i]); // can't read [...] If I'm right, index should be a compile-time value.

Re: tuple can write [],but can't read []

2014-04-29 Thread bearophile via Digitalmars-d
Andrea Fontana: If I'm right, index should be a compile-time value. Right. Because tuples in general don't contain N values of the same type (as in your case), so the compiler has to know statically the index to compute their position efficiently. Further similar questions are better

Re: tuple can write [],but can't read []

2014-04-29 Thread FrankLike via Digitalmars-d
On Tuesday, 29 April 2014 at 09:38:45 UTC, Andrea Fontana wrote: On Tuesday, 29 April 2014 at 09:23:03 UTC, FrankLike wrote: Hi,erveryone, [...] xy2[1][0]=100; // can write [...] writeln(xy2[0][i]); // can't read [...] If I'm right, index should be a compile-time value.

Re: tuple can write [],but can't read []

2014-04-29 Thread John Colvin via Digitalmars-d
On Tuesday, 29 April 2014 at 09:23:03 UTC, FrankLike wrote: Hi,erveryone, type Tuple!(int,int,int,string) can write[],but can't read[]; module main; import std.stdio,std.typecons,std.conv; void main(string[] argv) { alias Tuple!(int,int,string) tuple2; alias

Re: STUN/TURN servers

2014-04-29 Thread John Colvin via Digitalmars-d
On Tuesday, 29 April 2014 at 08:42:53 UTC, Radu wrote: On Tuesday, 29 April 2014 at 01:21:36 UTC, Vladimir Panteleev wrote: On Monday, 28 April 2014 at 18:36:59 UTC, Radu wrote: Every time I read anything related to STUN/TURN, it becomes obvious that these technologies were designed by some

Default arguments in function callbacks not taken into account when instantiating templates has huge security implications

2014-04-29 Thread Andrej Mitrovic via Digitalmars-d
- import std.traits; import std.stdio; void handler(C)(C callback) { callback(John); } void main() { auto safeCallback = (string user, string pass = hunter2) { writefln(The password is: '%s', pass); }; handler(safeCallback); someOtherFunc(); } void

Re: python vs d

2014-04-29 Thread via Digitalmars-d
On Monday, 28 April 2014 at 18:45:54 UTC, John Colvin wrote: Libraries. not part of the language (unless you count the standard library. I don't see anything particularly special about python's standard library). Hmm… I think that for Python, Ruby and Perl, the libraries and the ecosystems

Re: python vs d

2014-04-29 Thread John Colvin via Digitalmars-d
On Tuesday, 29 April 2014 at 10:51:26 UTC, Ola Fosheim Grøstad wrote: On Monday, 28 April 2014 at 18:45:54 UTC, John Colvin wrote: Libraries. not part of the language (unless you count the standard library. I don't see anything particularly special about python's standard library). Hmm… I

Re: python vs d

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 11:04:38 UTC, John Colvin wrote: My bet is that D users will be able to produce the same sort of quick-fix libraries. The newsgroups are dominated by systems-type people and there is a serious emphasis on super-low-cost abstractions, but in my opinion D is a more

Re: python vs d

2014-04-29 Thread Russel Winder via Digitalmars-d
On Mon, 2014-04-28 at 18:07 +, John Colvin via Digitalmars-d wrote: […] What features does python, as a language (syntactical preferences aside), actually have to recommend it over D (assuming drepl* or similar became full-featured)? This is definitely not a rhetorical question, it

Re: python vs d

2014-04-29 Thread Russel Winder via Digitalmars-d
On Tue, 2014-04-29 at 10:51 +, via Digitalmars-d wrote: […] I used the wrong term, I meant list comprehensions. The most important feature in Python for me. I find it very powerful in combination with tuples, lists and dicts. Don't forget dictionary comprehensions and set comprehensions.

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Simen Kjærås via Digitalmars-d
On 2014-04-28 21:06, Walter Bright via Digitalmars-d wrote: On 4/28/2014 2:00 PM, Simen Kjærås via Digitalmars-d wrote: I believe Steven expects things to work this way: module bar; extern(C++, foo) void func(); module prog; import bar; void main() { foo.func(); // Calls bar.func (or

More on Heartbleed and related matters

2014-04-29 Thread bearophile via Digitalmars-d
Through Reddit I've found a nice blog post, Using Static Analysis And Clang To Find Heartbleed: http://blog.trailofbits.com/2014/04/27/using-static-analysis-and-clang-to-find-heartbleed/ The part about the range analysis is nice: Ranges of symbol values: conj_$2{int} : { [-2147483648, -2],

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Mon, 28 Apr 2014 17:00:11 -0400, Simen Kjærås via Digitalmars-d digitalmars-d@puremagic.com wrote: On 2014-04-28 20:50, Walter Bright via Digitalmars-d wrote: On 4/28/2014 7:27 AM, Steven Schveighoffer wrote: Consider this code: module foo; void func() {} module bar; extern(C)

Re: python vs d

2014-04-29 Thread bearophile via Digitalmars-d
John Colvin: Any reason why this needs language support? I haven't tried it, but I can't see why it can't be trivially done in a library. I don't yet know the answer. I have to think more about the topic, and to try to implement something in library code. And then I can judge (a bit) if the

Re: STUN/TURN servers

2014-04-29 Thread Radu via Digitalmars-d
On Tuesday, 29 April 2014 at 09:56:18 UTC, John Colvin wrote: No, he means that WormNAT2 is written in D1 and doesn't used Vibe.d Vibe.d is D2 only. Thanks for the clarification :). It seems my English is a bit rusty.

Re: python vs d

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 11:31:11 UTC, Russel Winder via Digitalmars-d wrote: Don't forget dictionary comprehensions and set comprehensions. Yes, I use dict comprehensions a lot too. I have never used set comprehensions. And definitely don't forget generator expressions. Actually, I

Re: python vs d

2014-04-29 Thread Chris via Digitalmars-d
On Tuesday, 29 April 2014 at 11:28:07 UTC, Russel Winder via Digitalmars-d wrote: Principally there are a large number of users and installation and there is a wealth of support for different user bases from sys admins to quants. Python is a relatively small language that is easy to learn.

Re: More on Heartbleed and related matters

2014-04-29 Thread Kagamin via Digitalmars-d
Though, here size of data_array is known at compile time, so the analyzer is sure that it can complain without risk of a false positive. In real code knowing the size of array is not that easy.

Re: python vs d

2014-04-29 Thread logicchains via Digitalmars-d
On Tuesday, 29 April 2014 at 13:05:34 UTC, Chris wrote: As opposed to the fascist intransigence of the Python interpreter with its ridiculous indent-mania. Maybe you are only referring to static vs. dynamic typing. Be it a compiler or an interpreter, they are all inherently stubborn and fond

Re: Poll - How long have you been in D?

2014-04-29 Thread MGW via Digitalmars-d
I started using D2 about a year ago. Now all projects make to D2 along with the GUI QtE (Qt bindings own production). http://qte.ucoz.ru/index/screenshots/0-6

D For A Web Developer

2014-04-29 Thread James via Digitalmars-d
I have a friend that is a web developer. I, however want to collaborate with him, so I am trying to get him to learn D. I don't know how to persuade him! How can D be used to greatly assist an HTML5/JavaScript web developer? I decided to go here to get some good answers. How can D be used to

Re: python vs d

2014-04-29 Thread Kagamin via Digitalmars-d
On Monday, 28 April 2014 at 19:34:38 UTC, Kapps wrote: D can actually do a rather good job of runtime reflection. I made a runtime reflection module (https://shardsoft.com/stash/projects/SHARD/repos/shardtools/browse/source/ShardTools/Reflection.d /

Re: python vs d

2014-04-29 Thread Kagamin via Digitalmars-d
On Monday, 28 April 2014 at 22:31:58 UTC, bearophile wrote: What's the good of having all arrays always start from index 1 (this is different from Ada, where you can choose the indexing range and type)? I'd say, for a math-oriented language starting position 1 is more meaningful than

Re: python vs d

2014-04-29 Thread logicchains via Digitalmars-d
On Tuesday, 29 April 2014 at 14:53:48 UTC, Kagamin wrote: I'd say, for a math-oriented language starting position 1 is more meaningful than starting offset 0, the latter is an idiom for system programming language, the former better corresponds to mathematical formalism. An argument for

Re: D For A Web Developer

2014-04-29 Thread Etienne via Digitalmars-d
On 2014-04-29 10:41 AM, James wrote: I have a friend that is a web developer. I, however want to collaborate with him, so I am trying to get him to learn D. I don't know how to persuade him! How can D be used to greatly assist an HTML5/JavaScript web developer? I decided to go here to get some

Re: D For A Web Developer

2014-04-29 Thread Adam D. Ruppe via Digitalmars-d
I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. (And, of course, a dynamic site in D runs about 3x faster out of the box than hello world served by Rails, zero effort in optimization. And rake test, just shoot me,

Re: D For A Web Developer

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 10:41 AM, James wrote: I have a friend that is a web developer. I, however want to collaborate with him, so I am trying to get him to learn D. I don't know how to persuade him! How can D be used to greatly assist an HTML5/JavaScript web developer? I decided to go here to get some

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Timon Gehr via Digitalmars-d
On 04/29/2014 01:34 PM, Simen Kjærås via Digitalmars-d wrote: Building on this knowledge: module foo; void func(); module bar; extern(C++, foo) void func(); module prog; import foo; import bar; void main() { // Seems like it's ambiguous between foo.func and bar.foo.func.

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Timon Gehr via Digitalmars-d
On 04/29/2014 02:01 PM, Steven Schveighoffer wrote: That is what the DIP says: Declarations in the namespace can be accessed without qualification in the enclosing scope if there is no ambiguity. Ambiguity issues can be resolved by adding the namespace qualifier Which then proceeds to show

Re: D For A Web Developer

2014-04-29 Thread Etienne via Digitalmars-d
On 2014-04-29 11:27 AM, Adam D. Ruppe wrote: I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. (And, of course, a dynamic site in D runs about 3x faster out of the box than hello world served by Rails, zero effort in

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 11:47:28 -0400, Timon Gehr timon.g...@gmx.ch wrote: On 04/29/2014 02:01 PM, Steven Schveighoffer wrote: That is what the DIP says: Declarations in the namespace can be accessed without qualification in the enclosing scope if there is no ambiguity. Ambiguity issues can be

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Timon Gehr via Digitalmars-d
On 04/29/2014 05:52 PM, Steven Schveighoffer wrote: I am not familiar with the rules. Perhaps you can just outline for me: module bar; extern(C++, foo) void func(); module prog; import bar; void main() { foo.func(); // works? } If this works, then we have a problem. It does work.

Re: D For A Web Developer

2014-04-29 Thread Chris via Digitalmars-d
On Tuesday, 29 April 2014 at 15:17:10 UTC, Etienne wrote: On 2014-04-29 10:41 AM, James wrote: I have a friend that is a web developer. I, however want to collaborate with him, so I am trying to get him to learn D. I don't know how to persuade him! How can D be used to greatly assist an

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 12:03:02 -0400, Timon Gehr timon.g...@gmx.ch wrote: On 04/29/2014 05:52 PM, Steven Schveighoffer wrote: I am not familiar with the rules. Perhaps you can just outline for me: module bar; extern(C++, foo) void func(); module prog; import bar; void main() {

Re: python vs d

2014-04-29 Thread Meta via Digitalmars-d
On Tuesday, 29 April 2014 at 10:51:26 UTC, Ola Fosheim Grøstad wrote: For closures for arrays and dicts. I don't understand I used the wrong term, I meant list comprehensions. The most important feature in Python for me. I find it very powerful in combination with tuples, lists and dicts.

Re: Default arguments in function callbacks not taken into account when instantiating templates has huge security implications

2014-04-29 Thread Wyatt via Digitalmars-d
On Tuesday, 29 April 2014 at 10:38:24 UTC, Andrej Mitrovic via Digitalmars-d wrote: void main() { auto safeCallback = (string user, string pass = hunter2) { writefln(The password is: '%s', pass); }; I'm sorry, but can you explain how this lets an attacker learn anything

Re: D For A Web Developer

2014-04-29 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 29, 2014 at 11:55:11AM -0400, Etienne via Digitalmars-d wrote: On 2014-04-29 11:27 AM, Adam D. Ruppe wrote: I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. (And, of course, a dynamic site in D runs

Re: More on Heartbleed and related matters

2014-04-29 Thread Meta via Digitalmars-d
On Tuesday, 29 April 2014 at 11:52:04 UTC, bearophile wrote: Instead of the ugly and bug-prone mess of read(fd, size, sizeof(int)); I have used something nicer. tryRead!uint tries to read an uint, and returns a Nullable!uint. The Maybe is a function currently missing in Phobos

Re: D For A Web Developer

2014-04-29 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 29 April 2014 at 15:55:13 UTC, Etienne wrote: That's funny b/c most people say RoR made them love web development. That's probably because they went into it with very little experience with the alternatives. I was spoiled by my web.d and friends, as well as knowing how to use a

Why are immutable fields with initializers deprecated?

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields that are immutable and have initializer are deprecated. Why? Andrei

Re: Default arguments in function callbacks not taken into account when instantiating templates has huge security implications

2014-04-29 Thread Kenji Hara via Digitalmars-d
This is a compiler bug. When template parameter C is deduced from the call handler(safeCallback), the default argument `= hunter2 should be stripped from the deduced function pointer type. Then, the call callback(John); in handler template function body should fail to compile always, because

Re: python vs d

2014-04-29 Thread Brian Rogoff via Digitalmars-d
On Tuesday, 29 April 2014 at 14:01:44 UTC, logicchains wrote: As someone who only occasionally uses D and Python, I just wanted to add as a datapoint that I find the D compilers an order of magnitude more agreeable than the Python interpreter. The thought that anybody could actually enjoy

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 13:09:01 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields that are immutable and have initializer are deprecated. Why? I

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Kenji Hara via Digitalmars-d
In future release, non-static const or immutable field will be made an instance field. struct S { immutable int x = 1; } static assert(S.sizeof == int.sizeof); // will succeed in the future So current implicit static behavior is now deprecated. Related:

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Nick Treleaven via Digitalmars-d
On Tuesday, 29 April 2014 at 17:11:50 UTC, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 13:09:01 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: A recent discussion https://github.com/D-Programming-Language/dmd/pull/3452 brought up a matter I'd forgotten - struct fields

Re: D For A Web Developer

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 11:55 AM, Etienne wrote: On 2014-04-29 11:27 AM, Adam D. Ruppe wrote: I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. (And, of course, a dynamic site in D runs about 3x faster out of the box than hello

Re: Why are immutable fields with initializers deprecated?

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 10:18 AM, Kenji Hara via Digitalmars-d wrote: In future release, non-static const or immutable field will be made an instance field. struct S { immutable int x = 1; } static assert(S.sizeof == int.sizeof); // will succeed in the future So current implicit static behavior is

Re: D For A Web Developer

2014-04-29 Thread Paulo Pinto via Digitalmars-d
Am 29.04.2014 19:45, schrieb Nick Sabalausky: On 4/29/2014 11:55 AM, Etienne wrote: On 2014-04-29 11:27 AM, Adam D. Ruppe wrote: I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. (And, of course, a dynamic site in D

Re: What's the deal with Warning: explicit element-wise assignment...

2014-04-29 Thread bearophile via Digitalmars-d
Steven Schveighoffer: On Tue, 15 Apr 2014 13:46:11 -0400, bearophile What do you think are the reasons I suggested the enhancement for? To make people write code the way you like? :) Honestly, it's like you require someone to call a function like: T foo(T)(T t){return t;} Just so you can

Re: What's the deal with Warning: explicit element-wise assignment...

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 14:08:59 -0400, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: On Tue, 15 Apr 2014 13:46:11 -0400, bearophile What do you think are the reasons I suggested the enhancement for? To make people write code the way you like? :) Honestly, it's like you

Re: D For A Web Developer

2014-04-29 Thread ketmar via Digitalmars-d
On Tue, 29 Apr 2014 11:55:11 -0400 Etienne via Digitalmars-d digitalmars-d@puremagic.com wrote: That's funny b/c most people say RoR made them love web development. If the D community could organize itself the same way RoR is around web dev, I doubt any other web scripting language could

Re: D For A Web Developer

2014-04-29 Thread ketmar via Digitalmars-d
On Tue, 29 Apr 2014 14:41:17 + James via Digitalmars-d digitalmars-d@puremagic.com wrote: just show him vibe.d. it's what node.js wants to be, but failed. ;-) signature.asc Description: PGP signature

Re: D For A Web Developer

2014-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2014-04-29 17:27, Adam D. Ruppe wrote: I recently started a Ruby on Rails job and using it makes me really, really miss the high productivity and ease of use D offers. I'm curious to why you think D is more productive and easier to use. -- /Jacob Carlborg

Re: D For A Web Developer

2014-04-29 Thread Russel Winder via Digitalmars-d
On Tue, 2014-04-29 at 20:04 +0200, Paulo Pinto via Digitalmars-d wrote: […] I was already doing RoR back in 1999, but it was with our own in-house TCL Apache/IIS module in a Portuguese startup, far far away from Silicon Valley and loosely based in AOL Server concepts. […] We already had

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 2:01 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: framework1.d: extern(C++,veclib){ struct … vec4 …; } extern(C++,physics){ vec4 f(vec4 …) … } framework2.d: extern(C++,veclib){ struct … vec4 …; } extern(C++,graphics){ void g(vec4 …) … } application1.d: import

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 8:43 AM, Timon Gehr wrote: as the DIP _does not actually introduce any new lookup rules_ [...] In particular, any problems you find with symbol lookup are actually orthogonal to the DIP. Yes!

Re: D For A Web Developer

2014-04-29 Thread JN via Digitalmars-d
On Tuesday, 29 April 2014 at 15:28:00 UTC, Nick Sabalausky wrote: Show him forum.dlang.org (written in D) and point out that modern HTML5/JS sites are freaking horrid. /admitted-curmudgeon forum.dlang.org is written in HTML/JS too.

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 9:13 AM, Steven Schveighoffer wrote: But what happens when you add another import that conflicts? module foo; void func() {} module prog; // updated import bar; import foo; void main(){ foo.func(); // now calls foo.func, and not bar.func as it originally did, right? } So by

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright newshou...@digitalmars.com wrote: On 4/29/2014 9:13 AM, Steven Schveighoffer wrote: But what happens when you add another import that conflicts? module foo; void func() {} module prog; // updated import bar; import foo; void main(){

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 19:48:36 UTC, Walter Bright wrote: I'd do your example as: vec.d: extern(C++,veclib){ struct … vec4 …; } framework1.d: import vec; extern(C++,physics){ vec4 f(vec4 …) … } framework2.d: import vec; extern(C++,graphics){ void g(vec4 …) … } Yes, but that requires

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 1:23 PM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Tuesday, 29 April 2014 at 19:48:36 UTC, Walter Bright wrote: I'd do your example as: vec.d: extern(C++,veclib){ struct … vec4 …; } framework1.d: import vec; extern(C++,physics){ vec4 f(vec4 …) … }

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 1:33 PM, Walter Bright wrote: On 4/29/2014 1:23 PM, Ola Fosheim Grøstad With graphics::g(physics::f(…)) this would not have been an issue. It does occur to me that two C++ symbols in the same namespace may be regarded as the same by the lookup code. That may be a reasonable

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 16:00:43 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright newshou...@digitalmars.com wrote: Because the compiler would now issue an error for that, it's its anti-hijacking feature. Try it and see! I agree!

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 20:33:07 UTC, Walter Bright wrote: Not really. It is reasonable to expect that when Framework1 and Framework2 each import 4th party Vec, that they do it with an import rather than inlining Vec's declarations. Vectors are not the best example since one library

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Timon Gehr via Digitalmars-d
On 04/29/2014 10:49 PM, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 16:00:43 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright newshou...@digitalmars.com wrote: Because the compiler would now issue an error for that, it's its

Re: Distributing implib?

2014-04-29 Thread Jeremy DeHaan via Digitalmars-d
On Monday, 28 April 2014 at 03:09:32 UTC, Trent Forkert wrote: On Sunday, 27 April 2014 at 17:53:18 UTC, Jeremy DeHaan wrote: Hi all, I am doing some updates to the C back end of my binding, and I wanted to know what it would entail to be able to distribute implib along with my CMake things.

Re: D For A Web Developer

2014-04-29 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 29 April 2014 at 19:06:59 UTC, Jacob Carlborg wrote: I'm curious to why you think D is more productive and easier to use. A lot of things, mostly focusing around having the compiler to help refactor with confidence (the importance of this really can't be understated) and having

Re: What's the deal with Warning: explicit element-wise assignment...

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 11:08 AM, bearophile wrote: In Phobos there are awkward names like walkLength Love it. -- Andrei

Re: What's the deal with Warning: explicit element-wise assignment...

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 11:08 AM, bearophile wrote: In Phobos there are awkward names like walkLength Love it. -- Andrie

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 12:49 PM, Walter Bright wrote: On 4/29/2014 8:43 AM, Timon Gehr wrote: as the DIP _does not actually introduce any new lookup rules_ [...] In particular, any problems you find with symbol lookup are actually orthogonal to the DIP. Yes! This is a biggie. KISS etc. -- Andrei

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Brian Schott via Digitalmars-d
On Monday, 28 April 2014 at 01:18:04 UTC, Walter Bright wrote: This is the new grammar? LinkageAttribute: 'extern' '(' identifier '++'? (',' identifier)? ')' You can also have N.M I've updated the DIP page to include documentation of the change to the language grammar.

Re: What's the deal with Warning: explicit element-wise assignment...

2014-04-29 Thread bearophile via Digitalmars-d
Andrei Alexandrescu: On 4/29/14, 11:08 AM, bearophile wrote: In Phobos there are awkward names like walkLength Love it. -- Andrei The name like walkLength was chosen (by you?), instead of a more natural name like length (or even a nice, short, clean, readable, handy and easer to write

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Walter Bright via Digitalmars-d
On 4/29/2014 4:08 PM, Brian Schott wrote: I've updated the DIP page to include documentation of the change to the language grammar. thanks!

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-29 Thread Steven Schveighoffer via Digitalmars-d
On Tue, 29 Apr 2014 17:38:07 -0400, Timon Gehr timon.g...@gmx.ch wrote: On 04/29/2014 10:49 PM, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 16:00:43 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright newshou...@digitalmars.com wrote:

Re: tuple can write [],but can't read []

2014-04-29 Thread FrankLike via Digitalmars-d
On Tuesday, 29 April 2014 at 09:53:29 UTC, John Colvin wrote: foreach(i; TypeTuple!(0,1,2)) { writeln(xy2[0][i]); } } Thank you,John Colvin, It works very good. Frank.

D vs Rust: function signatures

2014-04-29 Thread Narrator via Digitalmars-d
The unbelievable amount of time and energy that's been spent discussing the smallest syntax, you would think that D would, at the very least, have better looking function signatures, but it doesn't. auto zip(Ranges...)(Ranges ranges) if (Ranges.length allSatisfy!(isInputRange, Ranges));

Re: D vs Rust: function signatures

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 9:38 PM, Narrator wrote: fn map'r, B(self, f: |A|: 'r - B) - Map'r, A, B, Self That looks like line noise.

Re: python vs d

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 1:05 PM, Brian Rogoff wrote: The argument is roughly like this: if we accept that it would be a good thing if there was a universal indentation/code formatting standard that everyone followed (like gofmt for Go) then punctuation is redundant and the remaining question is whether

Re: D For A Web Developer

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 3:48 PM, JN wrote: On Tuesday, 29 April 2014 at 15:28:00 UTC, Nick Sabalausky wrote: Show him forum.dlang.org (written in D) and point out that modern HTML5/JS sites are freaking horrid. /admitted-curmudgeon forum.dlang.org is written in HTML/JS too. Anything on the web

Re: D vs Rust: function signatures

2014-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 30 April 2014 at 01:38:46 UTC, Narrator wrote: The unbelievable amount of time and energy that's been spent discussing the smallest syntax, you would think that D would, at the very least, have better looking function signatures, but it doesn't. auto zip(Ranges...)(Ranges

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Tuesday, 29 April 2014 at 14:41:19 UTC, James wrote: I have a friend that is a web developer. I, however want to collaborate with him, so I am trying to get him to learn D. I don't know how to persuade him! How can D be used to greatly assist an HTML5/JavaScript web developer? I decided to

Re: D For A Web Developer

2014-04-29 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 30 April 2014 at 02:43:43 UTC, Rikki Cattermole wrote: All I'm saying is, if you ever not want to write ajax code again, Cmsed is your friend [1]. My web.d does some javascript generation too. D: import arsd.web; class Foo : ApiProvider { export int add(int a, int b) { return

  1   2   >