Re: python vs d

2014-04-29 Thread Kapps via Digitalmars-d
On Tuesday, 29 April 2014 at 14:50:38 UTC, Kagamin wrote: 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/Re

Re: python vs d

2014-04-29 Thread via Digitalmars-d
On Wednesday, 30 April 2014 at 01:46:21 UTC, Nick Sabalausky wrote: indentation rules. All it can do, and indeed all is *does* do, is blindly assume that the indentation as presented is correct and adheres to the universal style. If something is indented wrong, there is no enforcement, only bug

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Wednesday, 30 April 2014 at 05:25:15 UTC, Russel Winder via Digitalmars-d wrote: On Wed, 2014-04-30 at 04:52 +, Rikki Cattermole via Digitalmars-d wrote: […] I've been working on Cmsed/Dvorm/Dakka specifically in the mind of a rather (major) web service. Haven't started it yet, but poss

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

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 23:09:42 UTC, bearophile wrote: 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 name like "len" as in Python) to underline that walkLength could be O(n).

Re: D For A Web Developer

2014-04-29 Thread Russel Winder via Digitalmars-d
On Wed, 2014-04-30 at 04:52 +, Rikki Cattermole via Digitalmars-d wrote: […] > I've been working on Cmsed/Dvorm/Dakka specifically in the mind > of a rather (major) web service. Haven't started it yet, but > possibly next semester. > I'm of the opinion that we all need to work together to get

Re: D For A Web Developer

2014-04-29 Thread via Digitalmars-d
On Wednesday, 30 April 2014 at 04:42:09 UTC, Dicebot wrote: I have a friend who has switched to vibe.d after being Erlang Cowboy devoted user for years. Trying to convince him to write an article about it but no luck so far :( Reason to switch in two words : "static typing". Yes, static typin

Re: D For A Web Developer

2014-04-29 Thread via Digitalmars-d
On Wednesday, 30 April 2014 at 04:19:15 UTC, Russel Winder via Digitalmars-d wrote: Go has gained much of it's traction from provably and consistently producing simpler, faster and more reliable systems that C, C++, Python, etc. and getting articles about the success out there. Python is simp

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Wednesday, 30 April 2014 at 04:32:37 UTC, Russel Winder via Digitalmars-d wrote: On Wed, 2014-04-30 at 04:12 +, Adam D. Ruppe via Digitalmars-d wrote: […] Yea, I wrote my version several years ago (IIRC 2009 or early 2010) and since then D has grown as has my knowledge of it. I kinda wa

Re: D For A Web Developer

2014-04-29 Thread Dicebot via Digitalmars-d
On Wednesday, 30 April 2014 at 04:19:15 UTC, Russel Winder via Digitalmars-d wrote: On Tue, 2014-04-29 at 22:09 +, Adam D. Ruppe via Digitalmars-d wrote: […] I can just get stuff done in D in a fraction of a time it takes to do even less in RoR. This is the stuff marketing campaigns are m

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Wednesday, 30 April 2014 at 04:12:59 UTC, Adam D. Ruppe wrote: On Wednesday, 30 April 2014 at 03:20:16 UTC, Rikki Cattermole wrote: We should probably work together on this sort of stuff! As we seem to have similar ideas Yea, I wrote my version several years ago (IIRC 2009 or early 2010) a

Re: D For A Web Developer

2014-04-29 Thread Russel Winder via Digitalmars-d
On Wed, 2014-04-30 at 04:12 +, Adam D. Ruppe via Digitalmars-d wrote: […] > Yea, I wrote my version several years ago (IIRC 2009 or early > 2010) and since then D has grown as has my knowledge of it. I > kinda want to write a web.d 2.0 that cleans everything up but eh > I have a lot of thing

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
It may be a good time to repeat, we need a marketing manager for D! Somebody really really needs to focus on getting us out there.

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Wednesday, 30 April 2014 at 04:10:14 UTC, Dicebot wrote: On Wednesday, 30 April 2014 at 02:43:43 UTC, Rikki Cattermole wrote: 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

Re: D For A Web Developer

2014-04-29 Thread Russel Winder via Digitalmars-d
On Tue, 2014-04-29 at 22:09 +, Adam D. Ruppe via Digitalmars-d wrote: […] > I can just get stuff done in D in a fraction of a time it takes > to do even less in RoR. This is the stuff marketing campaigns are made from. As well as informing the cabal that is this mailing list, there needs to b

Re: D For A Web Developer

2014-04-29 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 30 April 2014 at 03:20:16 UTC, Rikki Cattermole wrote: We should probably work together on this sort of stuff! As we seem to have similar ideas Yea, I wrote my version several years ago (IIRC 2009 or early 2010) and since then D has grown as has my knowledge of it. I kinda want

Re: D For A Web Developer

2014-04-29 Thread Dicebot via Digitalmars-d
On Wednesday, 30 April 2014 at 02:43:43 UTC, Rikki Cattermole wrote: 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 us

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

2014-04-29 Thread via Digitalmars-d
On Tuesday, 29 April 2014 at 22:51:42 UTC, Andrei Alexandrescu wrote: 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 ort

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

2014-04-29 Thread Andrei Alexandrescu via Digitalmars-d
On 4/29/14, 4:09 PM, bearophile wrote: 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, cle

Re: D For A Web Developer

2014-04-29 Thread Rikki Cattermole via Digitalmars-d
On Wednesday, 30 April 2014 at 03:09:43 UTC, Adam D. Ruppe wrote: 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;

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

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 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 ranges

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. forum.dlang.org is written in HTML/JS too. Anything on the web involves HTML, the differen

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 the

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.

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)); au

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.

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 wrote: On 04/29/2014 10:49 PM, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 16:00:43 -0400, Steven Schveighoffer wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright wrote: Because the compiler would now issue an error for that, it's

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: 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 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: 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: 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: 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: 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 li

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: 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 wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright 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 might

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 wrote: On Tue, 29 Apr 2014 15:52:01 -0400, Walter Bright wrote: Because the compiler would now issue an error for that, it's its anti-hijacking feature. Try it and see! I agree! that was my central point, which Timon seemed to

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 e

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" " 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 …) … } framework2.d: import vec; extern(C++,gra

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 th

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 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(){ foo.func(); // now calls foo

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: 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. 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 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: 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" " 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 framework1; import framework2;

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 A

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 ketmar via Digitalmars-d
On Tue, 29 Apr 2014 11:55:11 -0400 Etienne via Digitalmars-d 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 pursue > existence. no, please

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 wrote: just show him vibe.d. it's what node.js wants to be, but failed. ;-) signature.asc Description: PGP signature

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 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 require someone to call a f

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 se

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: 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 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 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 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 ini

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: http://dlang.org/changelog#staticf

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 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 think possibly it has to do with

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 signi

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: 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 re

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 (https://

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 ru

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: 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: 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 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() { foo.func(); // works? } I

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 HTML5/

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. Wha

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 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 resolved by adding

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 o

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 t

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. foo.f

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 goo

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 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 go

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 zero-

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 starting

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 / https://shardsoft.com/docs/ShardTools/Reflect

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 i

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

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 of

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 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: 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 d

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 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: 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 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) func(); module prog; import foo;

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 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 i

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 comprehension

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 c

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 th

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 th

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 t

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 some

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 co

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 Tuple!(int,int

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 asked

  1   2   >