digitalmars.D - D language and .NET platform
- EngineerSpock (8/8) Jul 29 2012 There is a couple of questions.
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (9/17) Jul 29 2012 D for .NET is dead because .NET is too limited to represent the
- bearophile (4/5) Jul 29 2012 Can you tell us why?
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (9/14) Jul 29 2012 Array slices. The .NET type system has no way to represent them because
-
Simen Kjaeraas
(11/24)
Jul 29 2012
On Sun, 29 Jul 2012 18:32:08 +0200, Alex R=C3=B8nne Petersen
- =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= (6/24) Jul 29 2012 That could work, but it wouldn't be compatible with D as it is now.
- EngineerSpock (2/2) Jul 29 2012 And what can you say about this:
- Peter Alexander (3/5) Jul 29 2012 I can say the last commit was 3 years ago. Make your own
- ProHeckler (2/4) Jul 30 2012 You came to the right group: buy your dildo here.
- ProHeckler (3/21) Jul 30 2012 D is a programming language. Why don't you go to your metrosexual sushi ...
- Timon Gehr (15/28) Jul 29 2012 I think all of CTFE-D should map to .NET without much hassle.
- Timon Gehr (22/39) Jul 29 2012 This could get a little hairy:
- Chad J (5/46) Jul 29 2012 I still always thought it funny that we didn't reach for it anyways. It...
- ProHeckler (10/11) Jul 30 2012 "we"? Surely you meant you ("I"). Hmm? You saw the movie (?). "The Quick...
- Vladimir Panteleev (2/11) Jul 29 2012 How does C++ for .NET handle this?
- ProHeckler (3/16) Jul 30 2012 It didn't. Microsoft is about to do that. I'm thinking I should be a lit...
- ProHeckler (2/3) Jul 30 2012 A boy's dream?
- ProHeckler (4/21) Jul 30 2012 No, you cannot wank as an adolescent forever. There are too many males a...
- David Piepgrass (26/34) Jul 29 2012 D is theoretically designed for precise GC, too. But in .NET you
- ProHeckler (2/13) Jul 30 2012 That is to say it is non-designed.
- ProHeckler (2/5) Jul 30 2012 He's playing you, sucker.
- ProHeckler (22/31) Jul 30 2012 That is "a lie" (save for you may not know). .net is a Microsoft product...
- Mike Parker (11/14) Jul 29 2012 There are a number of libraries covering different domains, some active
- ProHeckler (2/8) Jul 30 2012 More ammo for a war that does not exist?
- ProHeckler (10/19) Jul 29 2012 There is no "D for .net". If you want that, pick your crime, do it, go t...
There is a couple of questions. 1. What about interoperability of D and .NET platform? 2. What is the difference between pure D and D for .NET? 3. Can I write code on pure D and then compile it to MSIL and use it further in .NET environment? 4. Are there many libraries for D? Can D just use C\C++ dll's without pain for programmer? Thank you in advance)))
Jul 29 2012
On 29-07-2012 17:30, EngineerSpock wrote:There is a couple of questions. 1. What about interoperability of D and .NET platform?You should be able to write C routines in D that .NET's P/Invoke can call.2. What is the difference between pure D and D for .NET?D for .NET is dead because .NET is too limited to represent the language, so describing this isn't really worthwhile. :)3. Can I write code on pure D and then compile it to MSIL and use it further in .NET environment?No. Sorry to ruin your hope, but D on .NET is a dead end.4. Are there many libraries for D? Can D just use C\C++ dll's without pain for programmer? Thank you in advance)))-- Alex Rønne Petersen alex lycus.org http://lycus.org
Jul 29 2012
Alex Rønne Petersen:.NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
On 29-07-2012 17:36, bearophile wrote:Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever). -- Alex Rønne Petersen alex lycus.org http://lycus.org.NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
On Sun, 29 Jul 2012 18:32:08 +0200, Alex R=C3=B8nne Petersen <alex lycus= .org> = wrote:On 29-07-2012 17:36, bearophile wrote:e =Alex R=C3=B8nne Petersen:Array slices. The .NET type system has no way to represent them becaus=.NET is too limited to represent the language,Can you tell us why? Bye, bearophileit's designed for precise GC, and array slices allow interior pointers==in the heap (as opposed to the stack when passing a field of an object==by reference to a function, or whatever).So one couldn't simply use a two-level system, with a slice referencing = an array, and holding an offset and a length? -- = Simen
Jul 29 2012
On 29-07-2012 18:51, Simen Kjaeraas wrote:On Sun, 29 Jul 2012 18:32:08 +0200, Alex Rønne Petersen <alex lycus..org> wrote:That could work, but it wouldn't be compatible with D as it is now. -- Alex Rønne Petersen alex lycus.org http://lycus.orgOn 29-07-2012 17:36, bearophile wrote:So one couldn't simply use a two-level system, with a slice referencing an array, and holding an offset and a length?Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
And what can you say about this: http://dnet.codeplex.com/
Jul 29 2012
On Sunday, 29 July 2012 at 17:36:51 UTC, EngineerSpock wrote:And what can you say about this: http://dnet.codeplex.com/I can say the last commit was 3 years ago. Make your own conclusions.
Jul 29 2012
EngineerSpock wrote:And what can you say about this: http://dnet.codeplex.com/You came to the right group: buy your dildo here.
Jul 30 2012
Simen Kjaeraas wrote:On Sun, 29 Jul 2012 18:32:08 +0200, Alex Rønne Petersen <alex lycus.org> wrote:D is a programming language. Why don't you go to your metrosexual sushi bar and "talk programming", bitch?On 29-07-2012 17:36, bearophile wrote:So one couldn't simply use a two-level system, with a slice referencing an array, and holding an offset and a length?Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 30 2012
On 07/29/2012 06:32 PM, Alex Rønne Petersen wrote:On 29-07-2012 17:36, bearophile wrote:I think all of CTFE-D should map to .NET without much hassle. struct ArraySlice<T>{ private T[] storage; private ulong start; private ulong len; public ArraySlice<T> slice(ulong a, ulong b){ if(a>b||b>len) throw new BoundsError("..."); return new ArraySlice<T>(storage, start+a, b-a); } public ulong length(){ return len; } public Pointer<T> ptr(){ return new Pointer<T>(storage, start); } // ... } Performance will suffer of course.Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
On 07/29/2012 07:00 PM, Timon Gehr wrote:On 07/29/2012 06:32 PM, Alex Rønne Petersen wrote:This could get a little hairy: struct S{ int x,y; } void main(){ S s; auto p = &s.y; // ... } It would have to be translated to something like (pseudo-code) class S{ int x; int y; S copy(){...} } class SyPointer : Pointer<int> { private S instance; override int deref(){ return instance.y; } override void derefAssign(int y){ instance.y = y; } } Out of the window goes native value type support.On 29-07-2012 17:36, bearophile wrote:I think all of CTFE-D should map to .NET without much hassle.Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
On 07/29/2012 01:11 PM, Timon Gehr wrote:On 07/29/2012 07:00 PM, Timon Gehr wrote:I still always thought it funny that we didn't reach for it anyways. It seems like the VMs can weaken performance significantly, but they should always be able to implement D's semantics. It's a matter of finding effective hacks.On 07/29/2012 06:32 PM, Alex Rønne Petersen wrote:This could get a little hairy: struct S{ int x,y; } void main(){ S s; auto p = &s.y; // ... } It would have to be translated to something like (pseudo-code) class S{ int x; int y; S copy(){...} } class SyPointer : Pointer<int> { private S instance; override int deref(){ return instance.y; } override void derefAssign(int y){ instance.y = y; } } Out of the window goes native value type support.On 29-07-2012 17:36, bearophile wrote:I think all of CTFE-D should map to .NET without much hassle.Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 29 2012
Chad J wrote:I still always thought it funny that we didn't reach for it anyways."we"? Surely you meant you ("I"). Hmm? You saw the movie (?). "The Quick, and the Dead". You cannot be quick, for you are not "quick". Thank you, you are not a gunslinger. (Romance, timeout please). "They" "love" the quick shooter, huh. Analogyy to "those who gab, have nothing to say"? (I don't know 'analogy' from 'metaphor'). What does "reach for it" mean? Something about 1984 chimes true. Oh, but "they" "didn't know". Isn't *that* convenient. Because if you as an individual don't know, it is a crime. But if those in on the take do wrong, it's a free ride to being the next horror, and it becomes "law".
Jul 30 2012
On Sunday, 29 July 2012 at 17:11:55 UTC, Timon Gehr wrote:This could get a little hairy: struct S{ int x,y; } void main(){ S s; auto p = &s.y; // ... }How does C++ for .NET handle this?
Jul 29 2012
Vladimir Panteleev wrote:On Sunday, 29 July 2012 at 17:11:55 UTC, Timon Gehr wrote:It didn't. Microsoft is about to do that. I'm thinking I should be a little asheamed. What do you think?This could get a little hairy: struct S{ int x,y; } void main(){ S s; auto p = &s.y; // ... }How does C++ for .NET handle this?
Jul 30 2012
Timon Gehr wrote:This could get a little hairy:A boy's dream?
Jul 30 2012
Timon Gehr wrote:On 07/29/2012 06:32 PM, Alex Rønne Petersen wrote:No, you cannot wank as an adolescent forever. There are too many males and you know it so you are afraid of "growing up", but it really is not up to you.On 29-07-2012 17:36, bearophile wrote:I think all of CTFE-D should map to .NET without much hassle.Alex Rønne Petersen:Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why? Bye, bearophile
Jul 30 2012
On Sunday, 29 July 2012 at 16:32:10 UTC, Alex Rønne Petersen wrote:On 29-07-2012 17:36, bearophile wrote:D is theoretically designed for precise GC, too. But in .NET you can only have a reference to an array as a whole, so a slice must be represented as an array, offset and length. The real problem I see is that in D you can have a slice that does *not* refer to an array on the GC heap, such as a slice on a non-GC heap, or on the stack (currently, in fact, in D you can easily make pointers and slices that point to stack data to outlive the stack frame, which the 'safe' .NET type system inherently prevents). .NET allows one to break the type system using pointers (in functions marked 'unsafe'), so as far as I can tell D for .NET could theoretically do everything that native D does, but with some annoying caveats mainly related to garbage collection. For instance, in a slice, I believe you can't use the same memory word to refer to an array on the GC heap OR an array that is not on the GC heap (unless you want to pin all your arrays, and you really don't). IIUC, doing so can crash the garbage collector. I'm thinking that a .NET D slice would be implemented as a reference to a GC array and two integers (start and length). If the slice refers to a non-GC array, it would be stored in the same space, as a null reference, a pointer cast to IntPtr, and a length. However, this would make the code for accessing a slice rather clumsy and/or inefficient. .NET has other limitations too, but again I expect there would be workarounds.Array slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why?
Jul 29 2012
David Piepgrass wrote:On Sunday, 29 July 2012 at 16:32:10 UTC, Alex Rønne Petersen wrote:That is to say it is non-designed.On 29-07-2012 17:36, bearophile wrote:D is theoretically designedArray slices. The .NET type system has no way to represent them because it's designed for precise GC, and array slices allow interior pointers in the heap (as opposed to the stack when passing a field of an object by reference to a function, or whatever)..NET is too limited to represent the language,Can you tell us why?
Jul 30 2012
bearophile wrote:Alex Rønne Petersen:He's playing you, sucker..NET is too limited to represent the language,Can you tell us why?
Jul 30 2012
Alex Rønne Petersen wrote:On 29-07-2012 17:30, EngineerSpock wrote:That is "a lie" (save for you may not know). .net is a Microsoft product at the API-ish level. It "strikes a cord" with "real" programmers, surely. Alex needs to be more careful when he posts. .net is not dead. Not even NOT relevant for D. D is at the language level. (AKA, "the language level"). "It", cannot address higher level concerns, for it is not even evolved or relevant as a child. "Lord of the Flies" and D, have something in common? Learning perhaps? Is D an island of childish thought "promogulated" with the zeal of an adolescent "guitar hero", "re"inventing "rock-n-roll" and wanking his pecker? The island is overloaded with comers. "freedom reigns", and then you grow up. Then what? The drug stops. You realize your enemy is formidable. Your scope has been small. But your enemy knew that all along. And you might even realize that pissing in the wind and beating it, was your same old spiel. The wind is not your enemy. And neither is time. You battle, and are too quick to battle, that which you do not know. I assure you that all you battle is time. And time is not interested in your childish games. You are going to lose. A war that does not exist, save for only your "lordness", which begs the question is D a lemon tree worthy of pissing on? I think it is dismissabke without conjecture. Exclude the masturbatory adolescnet males and you have... tada! What? Nothing? Guitar hero. Lord of the flies? Close this wank room.There is a couple of questions. 1. What about interoperability of D and .NET platform?You should be able to write C routines in D that .NET's P/Invoke can call.2. What is the difference between pure D and D for .NET?D for .NET is dead because .NET is too limited to represent the language, so describing this isn't really worthwhile. :)
Jul 30 2012
On 7/30/2012 12:30 AM, EngineerSpock wrote:There is a couple of questions.4. Are there many libraries for D? Can D just use C\C++ dll's without pain for programmer?There are a number of libraries covering different domains, some active some not. Also, D is binary compatible with C, so you can use existing C libraries with D (see Derelict[1] and Deimos[2] for examples). There's also some support for binding with C++, but AFAIK it's not as reliable as the C interface due to incompatibilities between C++ compilers. There are also going to be limitations regarding certain C++ features. I /assume/ it will mostly work with DMC and GCC. But someone else will have to tell you how usable it is. [1] https://github.com/aldacron/Derelict3 [2] https://github.com/D-Programming-Deimos
Jul 29 2012
Mike Parker wrote:On 7/30/2012 12:30 AM, EngineerSpock wrote:More ammo for a war that does not exist?There is a couple of questions.4. Are there many libraries for D? Can D just use C\C++ dll's without pain for programmer?There are a number of libraries covering different domains,
Jul 30 2012
EngineerSpock wrote:There is a couple of questions. 1. What about interoperability of D and .NET platform?What about "it"? Are you a software developer or a Microsoft bitch?2. What is the difference between pure D and D for .NET?There is no "D for .net". If you want that, pick your crime, do it, go to prison and ... nevermind.3. Can I write code on pure D and then compile it to MSIL and use it further in .NET environment?Lame try troll. Your point was: "Is .net formidable?". If you work for Microsoft you hope so.4. Are there many libraries for D?I can't answer that: I don't know.Can D just use C\C++ dll's without pain for programmer?Hopefully not. (I'll expect my check in the mail for such promotion Ders). :PThank you in advance)))That was trite.
Jul 29 2012