Re: Fact checking for my talk

2016-08-17 Thread Jacob Carlborg via Digitalmars-d
On 2016-08-16 17:08, ZombineDev wrote: Swift developers, on the other hand, explicitly state that they don't want to support any form compile-time metaprogramming: [5]. Ironically they make heavy use of it in their standard-library. However instead of writing the meta code in Swift, they use

Re: Fact checking for my talk

2016-08-16 Thread Chris Wright via Digitalmars-d
On Tue, 16 Aug 2016 10:24:38 +, Kagamin wrote: > On Monday, 15 August 2016 at 14:40:14 UTC, Chris Wright wrote: >> You still haven't defined the term "design by introspection". Some >> searching around says it's the pattern of: >> >> template Foo(T) { >> static if (is(typeof(T.bar)) { >>

Re: Fact checking for my talk

2016-08-16 Thread ZombineDev via Digitalmars-d
On Monday, 15 August 2016 at 14:40:14 UTC, Chris Wright wrote: On Mon, 15 Aug 2016 06:43:11 +, ZombineDev wrote: Well, I guess it would hard for me to convince you if you don't know what Design by Introspection means. Some years ago I was on #d on freenode and someone made a reference to

Re: Fact checking for my talk

2016-08-16 Thread ZombineDev via Digitalmars-d
On Tuesday, 16 August 2016 at 06:13:18 UTC, Ethan Watson wrote: [snip] At this point, the only thing I still haven't found concrete information on is function inspection in Swift and Rust, which should be a mark against the languages if it's not easily Googlable. From what I could find,

Re: Fact checking for my talk

2016-08-16 Thread Kagamin via Digitalmars-d
On Monday, 15 August 2016 at 14:40:14 UTC, Chris Wright wrote: You still haven't defined the term "design by introspection". Some searching around says it's the pattern of: template Foo(T) { static if (is(typeof(T.bar)) { // preferred implementation takes advantage of T.bar } else {

Re: Fact checking for my talk

2016-08-16 Thread Ethan Watson via Digitalmars-d
On Tuesday, 16 August 2016 at 06:36:25 UTC, Jacob Carlborg wrote: On 2016-08-16 08:13, Ethan Watson wrote: For Objective-C it's possible to use the Objective-C runtime functions to access some of this information. Based on a method you can access the types of the arguments and the return

Re: Fact checking for my talk

2016-08-16 Thread Jacob Carlborg via Digitalmars-d
On 2016-08-16 08:13, Ethan Watson wrote: At this point, the only thing I still haven't found concrete information on is function inspection in Swift and Rust, which should be a mark against the languages if it's not easily Googlable. For Objective-C it's possible to use the Objective-C

Re: Fact checking for my talk

2016-08-16 Thread Ethan Watson via Digitalmars-d
On Saturday, 13 August 2016 at 19:34:42 UTC, Walter Bright wrote: It's risky to compare with languages you aren't strongly familiar with. All it takes is one mistake and one audience member who knows more than you about it, and it can seriously derail and damage the entire presentation. I

Re: Fact checking for my talk

2016-08-15 Thread Ethan Watson via Digitalmars-d
On Sunday, 14 August 2016 at 18:05:12 UTC, ZombineDev wrote: Rust stugg Exactly what I was after, thanks.

Re: Fact checking for my talk

2016-08-15 Thread Seb via Digitalmars-d
On Monday, 15 August 2016 at 14:40:14 UTC, Chris Wright wrote: You still haven't defined the term "design by introspection". Some searching around says it's the pattern of: template Foo(T) { static if (is(typeof(T.bar)) { // preferred implementation takes advantage of T.bar } else {

Re: Fact checking for my talk

2016-08-15 Thread Chris Wright via Digitalmars-d
On Mon, 15 Aug 2016 06:43:11 +, ZombineDev wrote: > Well, I guess it would hard for me to convince you if you don't know > what Design by Introspection means. Some years ago I was on #d on freenode and someone made a reference to high-order functions. I hadn't encountered the term, so I

Re: Fact checking for my talk

2016-08-15 Thread ZombineDev via Digitalmars-d
On Sunday, 14 August 2016 at 23:50:23 UTC, Enamex wrote: On Sunday, 14 August 2016 at 18:57:14 UTC, ZombineDev wrote: Ok, maybe it's a matter of taste and opinion, but I consider them to be bad design (idea-wise, not implementation-wise) because they're sort of the opposite of DbI and

Re: Fact checking for my talk

2016-08-14 Thread Enamex via Digitalmars-d
On Sunday, 14 August 2016 at 18:57:14 UTC, ZombineDev wrote: Ok, maybe it's a matter of taste and opinion, but I consider them to be bad design (idea-wise, not implementation-wise) because they're sort of the opposite of DbI and compile-time duck-typing. Maybe they fit nicely in Rust's world

Re: Fact checking for my talk

2016-08-14 Thread ZombineDev via Digitalmars-d
On Sunday, 14 August 2016 at 18:17:58 UTC, Enamex wrote: On Sunday, 14 August 2016 at 18:05:12 UTC, ZombineDev wrote: [...] OTOH, they're used in more places in their standard library, than mixins are used in Phobos, because of the lack of variadic templates, because in Rust you can't

Re: Fact checking for my talk

2016-08-14 Thread Enamex via Digitalmars-d
On Sunday, 14 August 2016 at 18:05:12 UTC, ZombineDev wrote: [...] OTOH, they're used in more places in their standard library, than mixins are used in Phobos, because of the lack of variadic templates, because in Rust you can't generalize over mutability, like you can in D with `inout` and

Re: Fact checking for my talk

2016-08-14 Thread ZombineDev via Digitalmars-d
On Saturday, 13 August 2016 at 12:47:40 UTC, Ethan Watson wrote: So I fly to Cologne tomorrow morning, and will be presenting on Tuesday. Got my talk written, gave it a dry run at the office and got feedback on it. Seems to be in a good spot. But before I go up and feature compare to other

Re: Fact checking for my talk

2016-08-13 Thread Chris Wright via Digitalmars-d
On Sat, 13 Aug 2016 17:21:37 +, Ethan Watson wrote: > On Saturday, 13 August 2016 at 17:19:42 UTC, Chris Wright wrote: >> C# can do this. Check System.Reflection.MethodInfo and >> System.Reflection.ParameterInfo. > > Runtime only? I'll make the distinction on my slides. Runtime only, but

Re: Fact checking for my talk

2016-08-13 Thread Walter Bright via Digitalmars-d
On 8/13/2016 9:19 AM, Ethan Watson wrote: I believe Swift has something like Objective C does but I did not find concrete info on it. No idea about Rust. It's risky to compare with languages you aren't strongly familiar with. All it takes is one mistake and one audience member who knows more

Re: Fact checking for my talk

2016-08-13 Thread Walter Bright via Digitalmars-d
On 8/13/2016 5:47 AM, Ethan Watson wrote: [2] Mixins in swift are essentially traits and protocol extentions, not like D mixins at all s/extentions/extensions/

Re: Fact checking for my talk

2016-08-13 Thread Marc Schütz via Digitalmars-d
On Saturday, 13 August 2016 at 12:47:40 UTC, Ethan Watson wrote: | Rust | Swift |C# | -|-+-+-| Template Constraints |Y|Y| where | [1]

Re: Fact checking for my talk

2016-08-13 Thread Lodovico Giaretta via Digitalmars-d
On Saturday, 13 August 2016 at 17:27:35 UTC, Chris Wright wrote: On Sat, 13 Aug 2016 16:28:57 +, deadalnix wrote: C# use generic (aka type erasure) for objects Incorrect: --- public class Foo {} var fooList = new List(); var objectList = (List)(object)fooList; --- This throws

Re: Fact checking for my talk

2016-08-13 Thread Chris Wright via Digitalmars-d
On Sat, 13 Aug 2016 16:28:57 +, deadalnix wrote: > C# use generic (aka type erasure) for objects Incorrect: --- public class Foo {} var fooList = new List(); var objectList = (List)(object)fooList; --- This throws InvalidCastException. Which isn't possible with type erasure. The equivalent

Re: Fact checking for my talk

2016-08-13 Thread Ethan Watson via Digitalmars-d
On Saturday, 13 August 2016 at 17:19:42 UTC, Chris Wright wrote: C# can do this. Check System.Reflection.MethodInfo and System.Reflection.ParameterInfo. Runtime only? I'll make the distinction on my slides.

Re: Fact checking for my talk

2016-08-13 Thread Chris Wright via Digitalmars-d
On Sat, 13 Aug 2016 16:19:08 +, Ethan Watson wrote: > On Saturday, 13 August 2016 at 15:51:18 UTC, Jacob Carlborg wrote: >> What is "Deep function inspection"? > > In the context of my talk, a collection of methods to inspect all > function traits including parameter types and defaults etc.

Re: Fact checking for my talk

2016-08-13 Thread deadalnix via Digitalmars-d
On Saturday, 13 August 2016 at 13:02:09 UTC, Liam McSherry wrote: On Saturday, 13 August 2016 at 12:47:40 UTC, Ethan Watson wrote: | Rust | Swift |C# | -|-+-+-| Template Constraints |Y|

Re: Fact checking for my talk

2016-08-13 Thread Ethan Watson via Digitalmars-d
On Saturday, 13 August 2016 at 15:51:18 UTC, Jacob Carlborg wrote: What is "Deep function inspection"? In the context of my talk, a collection of methods to inspect all function traits including parameter types and defaults etc. C++ can do type inspection. I believe Swift has something like

Re: Fact checking for my talk

2016-08-13 Thread Jacob Carlborg via Digitalmars-d
On 13/08/16 14:47, Ethan Watson wrote: So I fly to Cologne tomorrow morning, and will be presenting on Tuesday. Got my talk written, gave it a dry run at the office and got feedback on it. Seems to be in a good spot. But before I go up and feature compare to other languages, it'll be a good

Re: Fact checking for my talk

2016-08-13 Thread Ethan Watson via Digitalmars-d
On Saturday, 13 August 2016 at 13:02:09 UTC, Liam McSherry wrote: For "static if," C# also has a very limited conditional compilation system that is barely comparable. This is covered in more detail in the talk itself when I compare static if to C style preprocessors. I would hope everyone in

Re: Fact checking for my talk

2016-08-13 Thread Ethan Watson via Digitalmars-d
On Saturday, 13 August 2016 at 12:58:36 UTC, ag0aep6g wrote: What's a 'template "if" constraint'? Template constraints already use the `if` keyword. This is a template constraint: template Foo(T) if (is(T : int)) {/* ... */} Other than those, there are template specializations. Example:

Re: Fact checking for my talk

2016-08-13 Thread Liam McSherry via Digitalmars-d
On Saturday, 13 August 2016 at 12:47:40 UTC, Ethan Watson wrote: | Rust | Swift |C# | -|-+-+-| Template Constraints |Y|Y| where | [1]

Re: Fact checking for my talk

2016-08-13 Thread ag0aep6g via Digitalmars-d
On 08/13/2016 02:47 PM, Ethan Watson wrote: | Rust | Swift |C# | -|-+-+-| Template Constraints |Y|Y| where | [1] -|-+-+-|

Fact checking for my talk

2016-08-13 Thread Ethan Watson via Digitalmars-d
So I fly to Cologne tomorrow morning, and will be presenting on Tuesday. Got my talk written, gave it a dry run at the office and got feedback on it. Seems to be in a good spot. But before I go up and feature compare to other languages, it'll be a good idea to get my facts right. There's