digitalmars.D - D-
- Tim Krimm (30/30) Feb 10 2012 We have C and C++
- Zachary Lund (6/32) Feb 10 2012 I would love this as well. I *think* you wouldn't have to recreate the
- Jacob Carlborg (5/48) Feb 11 2012 No need to restrict yourself yo static functions. Functions in structs
- Piotr Szturmaj (2/22) Feb 11 2012 Virtual functions don't require the GC either.
- Jacob Carlborg (4/28) Feb 11 2012 No they don't, but the will add other overhead.
- Andrei Alexandrescu (3/5) Feb 10 2012 No please.
- Tim Krimm (3/9) Feb 10 2012 Please elaborate.
- Andrei Alexandrescu (6/16) Feb 10 2012 The last thing we need is balkanization of the community. You are of
- Tim Krimm (12/31) Feb 10 2012 It seems like D would catch on faster if it could be used more
- maarten van damme (6/6) Feb 10 2012 I would love to be able to use D on memory limited devices like arduino ...
- Tim Krimm (5/24) Feb 10 2012 Can we minimize the fragmentation issues by handling this with a
- Nick Sabalausky (3/27) Feb 11 2012 VOTE++!!!!
- H. S. Teoh (13/29) Feb 10 2012 [...]
- Jonathan M Davis (9/19) Feb 10 2012 I think that the only switch even vaguely like that which has any chance...
- Jacob Carlborg (5/24) Feb 11 2012 It's possible to remove the GC and you'll get linker errors when the GC
- Nick Sabalausky (4/19) Feb 11 2012 I absolutely agree: We've learned a very hard lession from the
- Piotr Szturmaj (2/23) Feb 11 2012 So now SafeD is only thing of the past?
- Timon Gehr (2/27) Feb 11 2012 Nick was quite obviously being sarcastic. ;)
- Andrei Alexandrescu (3/4) Feb 11 2012 oops...
- Tim Krimm (4/8) Feb 11 2012 I am sorry Andrei, I think I stirred up a rats nest with this D-
- Andrei Alexandrescu (4/25) Feb 11 2012 Not sure what you mean there. As far as I can tell SafeD did not fail
- H. S. Teoh (8/14) Feb 11 2012 [...]
- Andrei Alexandrescu (3/14) Feb 11 2012 That is correct. A nicer way to put it is @safe needs more work.
- Paulo Pinto (5/20) Feb 12 2012 Andrei, what would be needed to improve it? Just submitting patches to
- Daniel Murphy (4/19) Feb 12 2012 I don't know why people keep saying this. Most of safeD is implemented ...
- Timon Gehr (3/30) Feb 11 2012 He was setting up an analogy between SafeD and 'EmbedD' in a satirical
- Norbert Nemec (13/28) Feb 12 2012 In my understanding, balkanization would begin only if D- would stop
- Zach the Mystic (11/14) Feb 13 2012 I think this might be going a little bit too far. In other posts on this...
- Andrei Alexandrescu (6/21) Feb 13 2012 I just find it difficult to imagine things that way. Tiny devices are
- Zach the Mystic (8/13) Feb 13 2012 From a practical standpoint, you are correct, and I won't argue.
- Andrei Alexandrescu (9/23) Feb 13 2012 Agreed. There are two issues I see here in my opinion. First, putting
- Zach the Mystic (13/21) Feb 13 2012 Once again, you're correct. I have little to add to this, except to say
- Don (22/24) Feb 15 2012 Andrei, can I ask you to please never mention D1 again? You seem to have...
- Andrei Alexandrescu (8/32) Feb 15 2012 All of this is in agreement with my understanding of the situation, so I...
- H. S. Teoh (7/10) Feb 10 2012 [...]
- Jesse Phillips (7/9) Feb 10 2012 There has been discussion of having a compiler switch that flags
- Marco Leise (3/4) Feb 10 2012 There is no way you get a D application into 64K. The language is not
- Era Scarecrow (19/22) Feb 10 2012 I'll need to agree. Porting D to a smaller memory space and with
- Tim Krimm (14/17) Feb 10 2012 Yes and that probably would be better than what I have now.
- Xinok (6/20) Feb 10 2012 That hardly seems like a good enough reason to create a second language....
- Bernard Helyer (2/20) Feb 10 2012 "I'm incompetent so I want to fork the language"
- Tim Krimm (9/33) Feb 10 2012 Also computer chips are becoming more powerful every day.
- Era Scarecrow (10/21) Feb 10 2012 Interesting and curious. I've wondered if you could string a
- Nick Sabalausky (19/40) Feb 11 2012 That would *still* be a very notable improvement over C. Hell, if you as...
- Jacob Carlborg (5/39) Feb 11 2012 I think slicing is quite difficult without a GC. Not the actual slicing
- Nick Sabalausky (5/49) Feb 11 2012 Those are orthogonal concerns. Just because you're taking a slice doesn'...
- q66 (4/63) Feb 11 2012 What's so difficult on that? Slices do not require the GC, you
- Jonathan M Davis (20/22) Feb 11 2012 With dynamic arrays, the GC owns the memory, and _all_ dynamic arrays ar...
- Piotr Szturmaj (6/27) Feb 11 2012 Delphi has dynamic arrays and appendable strings without a GC. In Delphi...
- Zachary Lund (6/53) Feb 11 2012 It's possible that we just create our own dynamic array similar
- Nick Sabalausky (9/44) Feb 11 2012 But not all slices are slices of dynamic arrays.
- Jonathan M Davis (13/17) Feb 11 2012 But all slices are still dynamic arrays, even if they refer to a static ...
- Zachary Lund (9/30) Feb 11 2012 Btw, I'm not very fluent in the inner workings of a garbage
- Jonathan M Davis (12/19) Feb 11 2012 Read this:
- Zachary Lund (4/23) Feb 13 2012 Right but they use the same semantics and the information to do either
- Jonathan M Davis (5/35) Feb 13 2012 I'm not sure what you're saying. All dynamic arrays are slices and _none...
- Artur Skawina (31/41) Feb 11 2012 I assumed the poster you're replying to was not being serious.
- Iain Buclaw (27/47) Feb 11 2012 features in all of this is not going to be good no matter how you look ...
- Tim Krimm (9/13) Feb 10 2012 It seems to me that if you are only using the D constructs that
- bcs (6/32) Feb 10 2012 If it's strict subset of D, then it could be done in a lint-esqu fashion...
- Paulo Pinto (20/46) Feb 11 2012 I don't see the point.
- Nick Sabalausky (17/31) Feb 11 2012 You're looking at it backwards. The whole point is for places where you
- Paulo Pinto (15/37) Feb 12 2012 The reason being that if you remove the GC, then you end up with some
- Nick Sabalausky (9/12) Feb 12 2012 Where are you getting the crazy idea that the GC is the only non-syntact...
- Paulo Pinto (8/23) Feb 13 2012 Because I see it as a wasted effort that could be better spent in other
- bcs (5/62) Feb 11 2012 Systems programming in the MacOS X and Windows world isn't real systems
- Paulo Pinto (9/62) Feb 11 2012 Systems programming is everything you need to get an OS up and running.
- bcs (3/20) Feb 11 2012 OK then there may be some people doing systems programming for MacOS X
- Paulo Pinto (7/25) Feb 12 2012 So do you mean everyone doing device driver development are also working
- bcs (15/39) Feb 14 2012 I've never worked on them but I seem to recall from somewhere that
- Daniel Murphy (9/9) Feb 11 2012 This is actually probably not that difficult to do.
- Paulo Pinto (12/18) Feb 12 2012 If you remove all of that then how good would D- be in regard with
- Daniel Murphy (8/11) Feb 12 2012 You still have all of D's compile-time magic, which I miss every time I ...
- Paulo Pinto (13/24) Feb 12 2012 Overloading is also possible with C++.
- Daniel Murphy (18/35) Feb 12 2012 Having D able to work on embedded platforms isn't going to enable anythi...
- Daniel Murphy (18/18) Feb 12 2012 Turns out I can't help myself:
- Iain Buclaw (8/26) Feb 13 2012 h
- Daniel Murphy (59/60) Feb 13 2012 =) Which bit's making you pull that face? Is it the fact I think it mig...
- Iain Buclaw (12/19) Feb 13 2012 It's the fact that it does *nothing* to change code generation, as D
- Daniel Murphy (5/11) Feb 13 2012 Isn't that what a C backend is supposed to do?
- Iain Buclaw (12/23) Feb 13 2012 My point is that D is low level / slick enough, that it generates
- Daniel Murphy (13/16) Feb 13 2012 Is the compiler really ready?
- Adam D. Ruppe (6/8) Feb 13 2012 hmmm....
- Daniel Murphy (12/21) Feb 13 2012 C works because you can build all the high level features of D (classes,...
- Timon Gehr (6/35) Feb 12 2012 I wouldn't go as far as to call it magic.
- Nick Sabalausky (3/11) Feb 12 2012 Plus a module system that's actually sane.
- Paulo Pinto (7/20) Feb 12 2012 +1 on this one actually.
We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?
Feb 10 2012
On 02/10/2012 01:02 PM, Tim Krimm wrote:We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I would love this as well. I *think* you wouldn't have to recreate the language, just recreate the runtime. You can currently use D and can completely avoid the use of the GC by just using static functions. From what I understand, dynamic arrays are also controlled and provided through the runtime. You can also export C symbols if you wanted to.
Feb 10 2012
On 2012-02-10 20:23, Zachary Lund wrote:On 02/10/2012 01:02 PM, Tim Krimm wrote:No need to restrict yourself yo static functions. Functions in structs are not virtual and doesn't require the GC. -- /Jacob CarlborgWe have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I would love this as well. I *think* you wouldn't have to recreate the language, just recreate the runtime. You can currently use D and can completely avoid the use of the GC by just using static functions. From what I understand, dynamic arrays are also controlled and provided through the runtime. You can also export C symbols if you wanted to.
Feb 11 2012
Jacob Carlborg wrote:On 2012-02-10 20:23, Zachary Lund wrote:Virtual functions don't require the GC either.On 02/10/2012 01:02 PM, Tim Krimm wrote:No need to restrict yourself yo static functions. Functions in structs are not virtual and doesn't require the GC.This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I would love this as well. I *think* you wouldn't have to recreate the language, just recreate the runtime. You can currently use D and can completely avoid the use of the GC by just using static functions. From what I understand, dynamic arrays are also controlled and provided through the runtime. You can also export C symbols if you wanted to.
Feb 11 2012
On 2012-02-11 18:40, Piotr Szturmaj wrote:Jacob Carlborg wrote:No they don't, but the will add other overhead. -- /Jacob CarlborgOn 2012-02-10 20:23, Zachary Lund wrote:Virtual functions don't require the GC either.On 02/10/2012 01:02 PM, Tim Krimm wrote:No need to restrict yourself yo static functions. Functions in structs are not virtual and doesn't require the GC.This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I would love this as well. I *think* you wouldn't have to recreate the language, just recreate the runtime. You can currently use D and can completely avoid the use of the GC by just using static functions. From what I understand, dynamic arrays are also controlled and provided through the runtime. You can also export C symbols if you wanted to.
Feb 11 2012
On 2/10/12 11:02 AM, Tim Krimm wrote:We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
On 2/10/12 12:54 PM, Tim Krimm wrote:On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction. Thanks, AndreiOn 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
On Friday, 10 February 2012 at 21:04:26 UTC, Andrei Alexandrescu wrote:On 2/10/12 12:54 PM, Tim Krimm wrote:It seems like D would catch on faster if it could be used more places, but at the same time I do understand your concern about the language fragmentation that could occur. That is a major, major issue. D is superior to C and C++ but D is fighting an up hill battle when it comes to market share. Unfortunately, I guess for now, I am stuck using the C/C++ tools that are available for all of the different microcontrollers out there.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction. Thanks, AndreiOn 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
I would love to be able to use D on memory limited devices like arduino but creating a whole new language would certainly add up to the confusion for many new potential users (they can't deal with two standard library's, let alone two language named nearly the same) if one were to do such project I would certainly hope he'd keep nearly everything the same and only strip out what's really necessary.
Feb 10 2012
On Friday, 10 February 2012 at 21:04:26 UTC, Andrei Alexandrescu wrote:On 2/10/12 12:54 PM, Tim Krimm wrote:Can we minimize the fragmentation issues by handling this with a flag in the front end of the compiler, similar to the way we handle "The SafeD Subset".On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction. Thanks, AndreiOn 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
"Tim Krimm" <twkrimm yahoo.com> wrote in message news:kwweecfnvetseprndtjw dfeed.kimsufi.thecybershadow.net...On Friday, 10 February 2012 at 21:04:26 UTC, Andrei Alexandrescu wrote:VOTE++!!!!On 2/10/12 12:54 PM, Tim Krimm wrote:Can we minimize the fragmentation issues by handling this with a flag in the front end of the compiler, similar to the way we handle "The SafeD Subset".On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction. Thanks, AndreiOn 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
On Fri, Feb 10, 2012 at 01:04:26PM -0800, Andrei Alexandrescu wrote:On 2/10/12 12:54 PM, Tim Krimm wrote:[...] Perhaps one solution is to simply have the compiler recognize all valid D constructs, but to give an error when it sees a construct not supported by the target platform. For example: input.d(123): Error: dynamic arrays not supported by target platform. This way, we don't cause fragmentation of D, and at the same time users will know which constructs should be avoided due to target platform limitations. T -- Never trust an operating system you don't have source for! -- Martin SchulzeOn Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 10 2012
On Friday, February 10, 2012 13:54:49 H. S. Teoh wrote:Perhaps one solution is to simply have the compiler recognize all valid D constructs, but to give an error when it sees a construct not supported by the target platform. For example: input.d(123): Error: dynamic arrays not supported by target platform. This way, we don't cause fragmentation of D, and at the same time users will know which constructs should be avoided due to target platform limitations.I think that the only switch even vaguely like that which has any chance of making it into the compiler is one which makes any constructs which use the GC illegal. And no one has been able to get Walter to even put _that_ in yet. For the most part, I'd argue that if you don't want to use all of D's features, then just don't use them all. The only major issue that I'm aware of is if you want to avoid the GC entirely (either for performance reasons or paranoia), you're probably going to have to forgoe using a lot of Phobos. - Jonathan M Davis
Feb 10 2012
On 2012-02-10 23:06, Jonathan M Davis wrote:On Friday, February 10, 2012 13:54:49 H. S. Teoh wrote:It's possible to remove the GC and you'll get linker errors when the GC is used. This is a hack but it works today. -- /Jacob CarlborgPerhaps one solution is to simply have the compiler recognize all valid D constructs, but to give an error when it sees a construct not supported by the target platform. For example: input.d(123): Error: dynamic arrays not supported by target platform. This way, we don't cause fragmentation of D, and at the same time users will know which constructs should be avoided due to target platform limitations.I think that the only switch even vaguely like that which has any chance of making it into the compiler is one which makes any constructs which use the GC illegal. And no one has been able to get Walter to even put _that_ in yet. For the most part, I'd argue that if you don't want to use all of D's features, then just don't use them all. The only major issue that I'm aware of is if you want to avoid the GC entirely (either for performance reasons or paranoia), you're probably going to have to forgoe using a lot of Phobos. - Jonathan M Davis
Feb 11 2012
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:jh40oq$26p0$1 digitalmars.com...On 2/10/12 12:54 PM, Tim Krimm wrote:I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
Nick Sabalausky wrote:"Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:jh40oq$26p0$1 digitalmars.com...So now SafeD is only thing of the past?On 2/10/12 12:54 PM, Tim Krimm wrote:I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
On 02/11/2012 06:43 PM, Piotr Szturmaj wrote:Nick Sabalausky wrote:Nick was quite obviously being sarcastic. ;)"Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:jh40oq$26p0$1 digitalmars.com...So now SafeD is only thing of the past?On 2/10/12 12:54 PM, Tim Krimm wrote:I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
On 2/11/12 12:28 PM, Timon Gehr wrote:Nick was quite obviously being sarcastic. ;)oops... Andrei
Feb 11 2012
On Saturday, 11 February 2012 at 18:53:13 UTC, Andrei Alexandrescu wrote:On 2/11/12 12:28 PM, Timon Gehr wrote:I am sorry Andrei, I think I stirred up a rats nest with this D- or EmbeddedD stuff.Nick was quite obviously being sarcastic. ;)oops... Andrei
Feb 11 2012
On 2/11/12 8:48 AM, Nick Sabalausky wrote:"Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:jh40oq$26p0$1 digitalmars.com...Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it. AndreiOn 2/10/12 12:54 PM, Tim Krimm wrote:I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
On Sat, Feb 11, 2012 at 11:55:07AM -0600, Andrei Alexandrescu wrote:On 2/11/12 8:48 AM, Nick Sabalausky wrote:[...][...] AFAIK, SafeD is just incompletely implemented, right? But it exists and it will be done one day. T -- Жил-был король когда-то, при нём блоха жила.I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it.
Feb 11 2012
On 2/11/12 12:07 PM, H. S. Teoh wrote:On Sat, Feb 11, 2012 at 11:55:07AM -0600, Andrei Alexandrescu wrote:That is correct. A nicer way to put it is safe needs more work. AndreiOn 2/11/12 8:48 AM, Nick Sabalausky wrote:[...][...] AFAIK, SafeD is just incompletely implemented, right? But it exists and it will be done one day.I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it.
Feb 11 2012
Am 11.02.2012 19:50, schrieb Andrei Alexandrescu:On 2/11/12 12:07 PM, H. S. Teoh wrote:Andrei, what would be needed to improve it? Just submitting patches to existing open issues or is some kind of redesign also needed? -- PauloOn Sat, Feb 11, 2012 at 11:55:07AM -0600, Andrei Alexandrescu wrote:That is correct. A nicer way to put it is safe needs more work. AndreiOn 2/11/12 8:48 AM, Nick Sabalausky wrote:[...][...] AFAIK, SafeD is just incompletely implemented, right? But it exists and it will be done one day.I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it.
Feb 12 2012
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:jh6daf$1vq7$1 digitalmars.com...On 2/11/12 12:07 PM, H. S. Teoh wrote:I don't know why people keep saying this. Most of safeD is implemented as of about six months ago.On Sat, Feb 11, 2012 at 11:55:07AM -0600, Andrei Alexandrescu wrote:That is correct. A nicer way to put it is safe needs more work. AndreiOn 2/11/12 8:48 AM, Nick Sabalausky wrote:[...][...] AFAIK, SafeD is just incompletely implemented, right? But it exists and it will be done one day.I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it.
Feb 12 2012
On 02/11/2012 06:55 PM, Andrei Alexandrescu wrote:On 2/11/12 8:48 AM, Nick Sabalausky wrote:He was setting up an analogy between SafeD and 'EmbedD' in a satirical attempt to ridicule non-uniform treatment of the concepts."Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:jh40oq$26p0$1 digitalmars.com...Not sure what you mean there. As far as I can tell SafeD did not fail and there was no community fragmentation at any point because of it. AndreiOn 2/10/12 12:54 PM, Tim Krimm wrote:I absolutely agree: We've learned a very hard lession from the community-fragmenting failure that was known as SafeD.On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 11 2012
On 10.02.2012 22:04, Andrei Alexandrescu wrote:On 2/10/12 12:54 PM, Tim Krimm wrote:In my understanding, balkanization would begin only if D- would stop being a pure subset of D "Safe D" is already one kind of subset that you can use for a large class of real-world problems. Maybe, the new concept could be communicated as "Embedded D" in a very similar way, prohibiting certain language features by a compiler switch and making sure that a meaningful subset of the runtime library can still be used. In fact, the concept of such a restricted subset of D could be quite useful for hard real-time code that has been discussed on this list recently. Perhaps the requirements are slightly different, but why not expand the concept of restricting D for various purposes? (real-time, embedded systems, memory-safe programming, maybe others will come up too?)On Friday, 10 February 2012 at 20:21:53 UTC, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.On 2/10/12 11:02 AM, Tim Krimm wrote:Please elaborate.We have C and C++ How about D- and D?No please. Andrei
Feb 12 2012
On 2/10/12 4:04 PM, Andrei Alexandrescu wrote:The last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.I think this might be going a little bit too far. In other posts on this thread, is has been clearly shown that D isn't afraid run with a design even though the implementation may be quite a ways into the future. As you yourself said, " safe needs more work". The reason I'm saying this is because I don't think that a subset of D which is good for tiny devices breaks the language itself. And it would also showcase D's versatility. In other words, the community may actually *gain* followers when people using other languages start to think to themselves, "You know, I can't do that in my language, not even in principle. That's pretty cool."
Feb 13 2012
On 2/13/12 10:45 AM, Zach the Mystic wrote:On 2/10/12 4:04 PM, Andrei Alexandrescu wrote:I just find it difficult to imagine things that way. Tiny devices are confined to small programs by definition, and at that magnitude the field is quite leveled; for a 3K-lines program, C is just fine and many of D's (and other languages') advantages are at best minor. AndreiThe last thing we need is balkanization of the community. You are of course free to initiate such a project but if you care about D it would be great to apply your talent in a different direction.I think this might be going a little bit too far. In other posts on this thread, is has been clearly shown that D isn't afraid run with a design even though the implementation may be quite a ways into the future. As you yourself said, " safe needs more work". The reason I'm saying this is because I don't think that a subset of D which is good for tiny devices breaks the language itself. And it would also showcase D's versatility. In other words, the community may actually *gain* followers when people using other languages start to think to themselves, "You know, I can't do that in my language, not even in principle. That's pretty cool."
Feb 13 2012
On 2/13/12 11:54 AM, Andrei Alexandrescu wrote:I just find it difficult to imagine things that way. Tiny devices are confined to small programs by definition, and at that magnitude the field is quite leveled; for a 3K-lines program, C is just fine and many of D's (and other languages') advantages are at best minor. AndreiFrom a practical standpoint, you are correct, and I won't argue. But from an idealistic standpoint, D stands as one of the few languages (the only language?) which really has a finger in every pie. So we seek a compromise answer. How to manage D's current limited manpower effectively while still holding true to a few ideals. Ideals do matter, and in that sense they are, ironically, practical, because they motivate people.
Feb 13 2012
On 2/13/12 11:46 AM, Zach the Mystic wrote:On 2/13/12 11:54 AM, Andrei Alexandrescu wrote:Agreed. There are two issues I see here in my opinion. First, putting some of our manpower in a small subset of D for tiny embedded systems is a misplaced investment because it would make a small impact at best. Second, coming up with another D-derived brand is a bad marketing move. We've been hurt for too long a time by D1/D2. With that in mind, if working on D for small embedded systems is what you like, I encourage you to go down that path and see what you discover. AndreiI just find it difficult to imagine things that way. Tiny devices are confined to small programs by definition, and at that magnitude the field is quite leveled; for a 3K-lines program, C is just fine and many of D's (and other languages') advantages are at best minor. AndreiFrom a practical standpoint, you are correct, and I won't argue. But from an idealistic standpoint, D stands as one of the few languages (the only language?) which really has a finger in every pie. So we seek a compromise answer. How to manage D's current limited manpower effectively while still holding true to a few ideals. Ideals do matter, and in that sense they are, ironically, practical, because they motivate people.
Feb 13 2012
On 2/13/12 1:17 PM, Andrei Alexandrescu wrote:Agreed. There are two issues I see here in my opinion. First, putting some of our manpower in a small subset of D for tiny embedded systems is a misplaced investment because it would make a small impact at best. Second, coming up with another D-derived brand is a bad marketing move. We've been hurt for too long a time by D1/D2. With that in mind, if working on D for small embedded systems is what you like, I encourage you to go down that path and see what you discover. AndreiOnce again, you're correct. I have little to add to this, except to say that when I first read the topic I was rather excited, and I read on hoping to see a discussion of what exactly would be involved in stripping out a chunk of D that it might produce extremely small programs. I wonder if my desire to read these threads for educational purposes is at odds with their other functions, such as internal debates about where the language should be headed. I don't know what to say about the D1/D2 debacle. It seems like D's extraordinary dedication to "getting it right" has had some unfortunate side effects. Perhaps it's possible to interpret D's past as a sort of "nekyia" on D's way to a more glorious future: http://en.wikipedia.org/wiki/Nekyia
Feb 13 2012
On 13.02.2012 19:17, Andrei Alexandrescu wrote:Second, coming up with another D-derived brand is a bad marketing move. We've been hurt for too long a time by D1/D2.Andrei, can I ask you to please never mention D1 again? You seem to have _fundamental_ misconceptions about it. It's obvious that D1 was exceedingly poorly explained, to the extent that even you didn't understand it, and you've spread your misunderstandings everywhere. And THAT has been a marketing disaster. To try to set the record straight: The D language has been developed continuously since the beginning. "D1" is a stability snapshot of DMD 1.015. "D2" is the continued development of D after 1.015. There was no change in the rate of language development before the stability snapshot (ie, what went into D1) vs after the stability snapshot (what has gone into D2). There was no decision "1.015 is a good enough language, let's stabilize on this". It was essentially a freezing of the language development at a largely arbitrary point, for purposes of stability. Most importantly, note that "D1" was not planned. It's not a language that anyone wanted. It's just a snapshot. And it was successful - 75% of the open bugs are D2-only. Any mention of D1 as if it were the "first attempt" of the D language is offensive, and wrong. Here's the original announcement of D1: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Stick_a_fork_in_it_8521.html
Feb 15 2012
On 2/15/12 4:40 PM, Don wrote:On 13.02.2012 19:17, Andrei Alexandrescu wrote:All of this is in agreement with my understanding of the situation, so I fail to see where my fundamental misconceptions would be. Is it possible that your perception of my view of D1 is inaccurate? As a simple starting point, note that none of the above contradicts, either directly or indirectly, my assertion. Thanks, AndreiSecond, coming up with another D-derived brand is a bad marketing move. We've been hurt for too long a time by D1/D2.Andrei, can I ask you to please never mention D1 again? You seem to have _fundamental_ misconceptions about it. It's obvious that D1 was exceedingly poorly explained, to the extent that even you didn't understand it, and you've spread your misunderstandings everywhere. And THAT has been a marketing disaster. To try to set the record straight: The D language has been developed continuously since the beginning. "D1" is a stability snapshot of DMD 1.015. "D2" is the continued development of D after 1.015. There was no change in the rate of language development before the stability snapshot (ie, what went into D1) vs after the stability snapshot (what has gone into D2). There was no decision "1.015 is a good enough language, let's stabilize on this". It was essentially a freezing of the language development at a largely arbitrary point, for purposes of stability. Most importantly, note that "D1" was not planned. It's not a language that anyone wanted. It's just a snapshot. And it was successful - 75% of the open bugs are D2-only. Any mention of D1 as if it were the "first attempt" of the D language is offensive, and wrong. Here's the original announcement of D1: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Stick_a_fork_in_it_8521.html
Feb 15 2012
On Fri, Feb 10, 2012 at 08:02:52PM +0100, Tim Krimm wrote:We have C and C++ How about D- and D?[...] Great, just what I need: a D- in programming! :-P T -- PNP = Plug 'N' Pray
Feb 10 2012
On Friday, 10 February 2012 at 19:02:54 UTC, Tim Krimm wrote:We have C and C++ How about D- and D?There has been discussion of having a compiler switch that flags use of the GC. I'm pretty sure Walter agreed it would be good to have. So someone needs to create a pull request so he can pull it in. Then a runtime and standard library could be created for the needed device/purpose.
Feb 10 2012
Am 10.02.2012, 20:02 Uhr, schrieb Tim Krimm <twkrimm yahoo.com>:What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 10 2012
I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 10 2012
If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.Yes and that probably would be better than what I have now. Going back and forth programming in C/C++ today, and then switching back to D tomorrow. Let me see if I remember again, classes and structures are almost the same in C++ but different in D. Well I did the assignment A=B, if I change A will it also change B, or is B a copy of A. Is A a class or a structure that is an important distinction in D. Today, Oh crap I forgot the #include Tomorrow, Oh crap I forgot the import Oh crap what was that syntax for initializing the class variables again.
Feb 10 2012
On 2/10/2012 8:13 PM, Tim Krimm wrote:That hardly seems like a good enough reason to create a second language. The community has enough to work on from the standard library to squashing bugs to writing literature and much more. I think a more practical idea would be to write a utility which translates a subset of D's features to equivalent C code.If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.Yes and that probably would be better than what I have now. Going back and forth programming in C/C++ today, and then switching back to D tomorrow. Let me see if I remember again, classes and structures are almost the same in C++ but different in D. Well I did the assignment A=B, if I change A will it also change B, or is B a copy of A. Is A a class or a structure that is an important distinction in D. Today, Oh crap I forgot the #include Tomorrow, Oh crap I forgot the import Oh crap what was that syntax for initializing the class variables again.
Feb 10 2012
On Saturday, 11 February 2012 at 02:13:19 UTC, Tim Krimm wrote:"I'm incompetent so I want to fork the language"If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.Yes and that probably would be better than what I have now. Going back and forth programming in C/C++ today, and then switching back to D tomorrow. Let me see if I remember again, classes and structures are almost the same in C++ but different in D. Well I did the assignment A=B, if I change A will it also change B, or is B a copy of A. Is A a class or a structure that is an important distinction in D. Today, Oh crap I forgot the #include Tomorrow, Oh crap I forgot the import Oh crap what was that syntax for initializing the class variables again.
Feb 10 2012
On Saturday, 11 February 2012 at 01:46:26 UTC, Era Scarecrow wrote:Also computer chips are becoming more powerful every day. I think we will soon be needing better tools. example: Microchip PIC32MX795F512L 32 bit MIPS architecture 512K flash, 128K RAM priced less than $10I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 10 2012
Interesting and curious. I've wondered if you could string a hundred such processors onto a board and have it work properly at a fast speed, but obviously there's issues with that. (No need to explain the problems) Just think though; What if they had this back when they were still making atari800 PCs? Since the Atari was only at about 3Mhz, then this would be supped up, on steroids, crack, and maybe a few other illegal drugs as well :P Now if only I had the expertise... then I might make one just for the hell of it.This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.Also computer chips are becoming more powerful every day. I think we will soon be needing better tools. example: Microchip PIC32MX795F512L 32 bit MIPS architecture 512K flash, 128K RAM priced less than $10
Feb 10 2012
"Era Scarecrow" <rtcvb32 yahoo.com> wrote in message news:jzavmzbmjoyujhqyfvhp dfeed.kimsufi.thecybershadow.net...That would *still* be a very notable improvement over C. Hell, if you ask me, a proper module system alone is one of the killer features of D over C. Header files? Seriously? Fuck that shit. What the hell is this, 1970? And then there's other things that are *at the very least* icing on the cake: Faster compilation, slicing, better safety, metaprogramming (esp CTFE) that whups C's ass and makes it much less less tempting to do things at runtime that don't need to be done at runtime. That's all just off the top of my head. I find it an absolute enigma that anyone would even consider that wouldn't be worthwhile. Ok, so it wouldn't add *all* of D's features...so the fuck what? The ones it would add would be more than enough to beat the shit out of C. And like I've said before, why should we be focusing so exclusivly on desktop/web developers who *already* have five billion fucking languages to choose from, when we're already in the extremely unique position of actually having some potential to provide an alternative to areas that *don't* have many (or any) language choices available.I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 11 2012
On 2012-02-11 15:36, Nick Sabalausky wrote:"Era Scarecrow"<rtcvb32 yahoo.com> wrote in message news:jzavmzbmjoyujhqyfvhp dfeed.kimsufi.thecybershadow.net...I think slicing is quite difficult without a GC. Not the actual slicing but freeing the memory. -- /Jacob CarlborgThat would *still* be a very notable improvement over C. Hell, if you ask me, a proper module system alone is one of the killer features of D over C. Header files? Seriously? Fuck that shit. What the hell is this, 1970? And then there's other things that are *at the very least* icing on the cake: Faster compilation, slicing, better safety, metaprogramming (esp CTFE) that whups C's ass and makes it much less less tempting to do things at runtime that don't need to be done at runtime. That's all just off the top of my head.I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 11 2012
"Jacob Carlborg" <doob me.com> wrote in message news:jh63p2$17li$1 digitalmars.com...On 2012-02-11 15:36, Nick Sabalausky wrote:Those are orthogonal concerns. Just because you're taking a slice doesn't mean you aren't still using the rest. And if you're not using the rest, then the problem just reduces to the classic old "GC vs manual" issue."Era Scarecrow"<rtcvb32 yahoo.com> wrote in message news:jzavmzbmjoyujhqyfvhp dfeed.kimsufi.thecybershadow.net...I think slicing is quite difficult without a GC. Not the actual slicing but freeing the memory.That would *still* be a very notable improvement over C. Hell, if you ask me, a proper module system alone is one of the killer features of D over C. Header files? Seriously? Fuck that shit. What the hell is this, 1970? And then there's other things that are *at the very least* icing on the cake: Faster compilation, slicing, better safety, metaprogramming (esp CTFE) that whups C's ass and makes it much less less tempting to do things at runtime that don't need to be done at runtime. That's all just off the top of my head.I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 11 2012
On Saturday, 11 February 2012 at 16:08:02 UTC, Jacob Carlborg wrote:On 2012-02-11 15:36, Nick Sabalausky wrote:What's so difficult on that? Slices do not require the GC, you allocate once, slice many times, deallocate once."Era Scarecrow"<rtcvb32 yahoo.com> wrote in message news:jzavmzbmjoyujhqyfvhp dfeed.kimsufi.thecybershadow.net...I think slicing is quite difficult without a GC. Not the actual slicing but freeing the memory.That would *still* be a very notable improvement over C. Hell, if you ask me, a proper module system alone is one of the killer features of D over C. Header files? Seriously? Fuck that shit. What the hell is this, 1970? And then there's other things that are *at the very least* icing on the cake: Faster compilation, slicing, better safety, metaprogramming (esp CTFE) that whups C's ass and makes it much less less tempting to do things at runtime that don't need to be done at runtime. That's all just off the top of my head.I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 11 2012
On Saturday, February 11, 2012 19:00:51 q66 wrote:What's so difficult on that? Slices do not require the GC, you allocate once, slice many times, deallocate once.With dynamic arrays, the GC owns the memory, and _all_ dynamic arrays are slices. _None_ of them own their own memory. The GC keeps track of whether you have any slices for a particular memory block and deals with freeing up wth the block if you don't. However, if you allocate a dynamic array without the GC, then all of a sudden, it effectively owns its own memory, so the semantics of dealing with arrays and memories changes drastically. What happens when you slice it? Which one owns the memory? What happens when you try and do stuff like popFront on an array? All of a sudden, you have memory which is no longer referenced. It's been leaked. If you have a very careful scheme for handling memory, you _can_ slice arrays without a GC, but you have to worry about all the bookkeeping of keeping track of the originally allocated memory and how many slices reference it so that you can free it when appropriate. Also, you can't concatenate to arrays at all, because that requires the GC. So, you're dealing with a mine field if you try and use D's array capabilities without a GC. Yes, you _can_ use some of them if you're _very_ careful, but I'd seriously advise just sticking to using arrays like you would in C except for the fact that arrays know their length. - Jonathan M Davis
Feb 11 2012
Jonathan M Davis wrote:On Saturday, February 11, 2012 19:00:51 q66 wrote:Delphi has dynamic arrays and appendable strings without a GC. In Delphi pointers and objects are managed manually, but arrays and strings are managed automatically (ref counted with Copy-On-Write). Take a look at http://www.codexterity.com/delphistrings.htm. Maybe some Delphi solutions may be used in NoGcD?What's so difficult on that? Slices do not require the GC, you allocate once, slice many times, deallocate once.With dynamic arrays, the GC owns the memory, and _all_ dynamic arrays are slices. _None_ of them own their own memory. The GC keeps track of whether you have any slices for a particular memory block and deals with freeing up wth the block if you don't. However, if you allocate a dynamic array without the GC, then all of a sudden, it effectively owns its own memory, so the semantics of dealing with arrays and memories changes drastically. What happens when you slice it? Which one owns the memory? What happens when you try and do stuff like popFront on an array? All of a sudden, you have memory which is no longer referenced. It's been leaked. If you have a very careful scheme for handling memory, you _can_ slice arrays without a GC, but you have to worry about all the bookkeeping of keeping track of the originally allocated memory and how many slices reference it so that you can free it when appropriate. Also, you can't concatenate to arrays at all, because that requires the GC. So, you're dealing with a mine field if you try and use D's array capabilities without a GC. Yes, you _can_ use some of them if you're _very_ careful, but I'd seriously advise just sticking to using arrays like you would in C except for the fact that arrays know their length.
Feb 11 2012
On Saturday, 11 February 2012 at 19:21:49 UTC, Piotr Szturmaj wrote:Jonathan M Davis wrote:It's possible that we just create our own dynamic array similar to that of std::vector from C++ except using cleaner syntax available in D. I'd really rather not do that though since it feels redundant.On Saturday, February 11, 2012 19:00:51 q66 wrote:Delphi has dynamic arrays and appendable strings without a GC. In Delphi pointers and objects are managed manually, but arrays and strings are managed automatically (ref counted with Copy-On-Write). Take a look at http://www.codexterity.com/delphistrings.htm. Maybe some Delphi solutions may be used in NoGcD?What's so difficult on that? Slices do not require the GC, you allocate once, slice many times, deallocate once.With dynamic arrays, the GC owns the memory, and _all_ dynamic arrays are slices. _None_ of them own their own memory. The GC keeps track of whether you have any slices for a particular memory block and deals with freeing up wth the block if you don't. However, if you allocate a dynamic array without the GC, then all of a sudden, it effectively owns its own memory, so the semantics of dealing with arrays and memories changes drastically. What happens when you slice it? Which one owns the memory? What happens when you try and do stuff like popFront on an array? All of a sudden, you have memory which is no longer referenced. It's been leaked. If you have a very careful scheme for handling memory, you _can_ slice arrays without a GC, but you have to worry about all the bookkeeping of keeping track of the originally allocated memory and how many slices reference it so that you can free it when appropriate. Also, you can't concatenate to arrays at all, because that requires the GC. So, you're dealing with a mine field if you try and use D's array capabilities without a GC. Yes, you _can_ use some of them if you're _very_ careful, but I'd seriously advise just sticking to using arrays like you would in C except for the fact that arrays know their length.
Feb 11 2012
"Jonathan M Davis" <jmdavisProg gmx.com> wrote in message news:mailman.242.1328986002.20196.digitalmars-d puremagic.com...On Saturday, February 11, 2012 19:00:51 q66 wrote:But not all slices are slices of dynamic arrays.What's so difficult on that? Slices do not require the GC, you allocate once, slice many times, deallocate once.With dynamic arrays, the GC owns the memory, and _all_ dynamic arrays are slices._None_ of them own their own memory. The GC keeps track of whether you have any slices for a particular memory block and deals with freeing up wth the block if you don't. However, if you allocate a dynamic array without the GC, then all of a sudden, it effectively owns its own memory, so the semantics of dealing with arrays and memories changes drastically. What happens when you slice it? Which one owns the memory? What happens when you try and do stuff like popFront on an array? All of a sudden, you have memory which is no longer referenced. It's been leaked. If you have a very careful scheme for handling memory, you _can_ slice arrays without a GC, but you have to worry about all the bookkeeping of keeping track of the originally allocated memory and how many slices reference it so that you can free it when appropriate.Yea, manual memory management is hard and you have to be careful. That's true slices or not.Also, you can't concatenate to arrays at all, because that requires the GC.That's true (at least without providing some way to provide an alternate concatenation allocator). But nobody said that all D features would be usable.So, you're dealing with a mine field if you try and use D's array capabilities without a GC. Yes, you _can_ use some of them if you're _very_ careful, but I'd seriously advise just sticking to using arrays like you would in C except for the fact that arrays know their length.Arrays knowing their own length *is* a notable improvement over C.
Feb 11 2012
On Saturday, February 11, 2012 18:01:05 Nick Sabalausky wrote:But not all slices are slices of dynamic arrays.But all slices are still dynamic arrays, even if they refer to a static array. They just have a capacity of 0, so any appending will result in them being reallocated. And slicing static arrays is one of those things that you generally have to be careful about precisely because they aren't managed by the GC and can go out of scope before their slices do.Yea, manual memory management is hard and you have to be careful. That's true slices or not.Yes, but in this case, you're dealing with a language feature which is _designed_ to be managed by the GC. It's not designed for manual memory management at all. It's a completely different situation when you're dealing with user-defined types.Arrays knowing their own length *is* a notable improvement over C.Indeed, but that's pretty much the only improvement that D makes to arrays which is safe to use without a GC without being _very_, _very_ careful. - Jonathan M Davis
Feb 11 2012
On Sunday, 12 February 2012 at 00:29:35 UTC, Jonathan M Davis wrote:On Saturday, February 11, 2012 18:01:05 Nick Sabalausky wrote:Btw, I'm not very fluent in the inner workings of a garbage collector implementation but how does one go about concatenating to an array in a garbage collector as compared to manual memory management? I believe array concatenation can be done in std::vector with the insert() function just fine. Isn't it as simple as determining both array sizes and allocating enough memory for both arrays? I could be oversimplifying things...But not all slices are slices of dynamic arrays.But all slices are still dynamic arrays, even if they refer to a static array. They just have a capacity of 0, so any appending will result in them being reallocated. And slicing static arrays is one of those things that you generally have to be careful about precisely because they aren't managed by the GC and can go out of scope before their slices do.Yea, manual memory management is hard and you have to be careful. That's true slices or not.Yes, but in this case, you're dealing with a language feature which is _designed_ to be managed by the GC. It's not designed for manual memory management at all. It's a completely different situation when you're dealing with user-defined types.Arrays knowing their own length *is* a notable improvement over C.Indeed, but that's pretty much the only improvement that D makes to arrays which is safe to use without a GC without being _very_, _very_ careful. - Jonathan M Davis
Feb 11 2012
On Sunday, February 12, 2012 01:40:50 Zachary Lund wrote:Btw, I'm not very fluent in the inner workings of a garbage collector implementation but how does one go about concatenating to an array in a garbage collector as compared to manual memory management? I believe array concatenation can be done in std::vector with the insert() function just fine. Isn't it as simple as determining both array sizes and allocating enough memory for both arrays? I could be oversimplifying things...Read this: http://www.dsource.org/projects/dcollections/wiki/ArrayArticle Appending to vectors is very different from appending to dynamic arrays because dynamic arrays do _not_ own their own memory (the GC does) and not only could other slices refer the same memory (in which case, you can't just free that memory when an array gets reallocated due to running out of space to append to), but they could already refer to the memory one past the end of the array, making it so that it can't expand into that memory. Slices change the entire equation. And the way slices are designed, they require the GC. - Jonathan M Davis
Feb 11 2012
On 02/11/2012 07:00 PM, Jonathan M Davis wrote:On Sunday, February 12, 2012 01:40:50 Zachary Lund wrote:Right but they use the same semantics and the information to do either seems to be present. I'm not sure why an abstraction between the two cannot be made.Btw, I'm not very fluent in the inner workings of a garbage collector implementation but how does one go about concatenating to an array in a garbage collector as compared to manual memory management? I believe array concatenation can be done in std::vector with the insert() function just fine. Isn't it as simple as determining both array sizes and allocating enough memory for both arrays? I could be oversimplifying things...Read this: http://www.dsource.org/projects/dcollections/wiki/ArrayArticle Appending to vectors is very different from appending to dynamic arrays because dynamic arrays do _not_ own their own memory (the GC does) and not only could other slices refer the same memory (in which case, you can't just free that memory when an array gets reallocated due to running out of space to append to), but they could already refer to the memory one past the end of the array, making it so that it can't expand into that memory. Slices change the entire equation. And the way slices are designed, they require the GC. - Jonathan M Davis
Feb 13 2012
On Monday, February 13, 2012 20:41:01 Zachary Lund wrote:On 02/11/2012 07:00 PM, Jonathan M Davis wrote:I'm not sure what you're saying. All dynamic arrays are slices and _none_ of them own their own memory. As such, you need a way to manage their memory. Vectors, on the other hand, own their memory and do not allow slicing at all. - Jonathan M DavisOn Sunday, February 12, 2012 01:40:50 Zachary Lund wrote:Right but they use the same semantics and the information to do either seems to be present. I'm not sure why an abstraction between the two cannot be made.Btw, I'm not very fluent in the inner workings of a garbage collector implementation but how does one go about concatenating to an array in a garbage collector as compared to manual memory management? I believe array concatenation can be done in std::vector with the insert() function just fine. Isn't it as simple as determining both array sizes and allocating enough memory for both arrays? I could be oversimplifying things...Read this: http://www.dsource.org/projects/dcollections/wiki/ArrayArticle Appending to vectors is very different from appending to dynamic arrays because dynamic arrays do _not_ own their own memory (the GC does) and not only could other slices refer the same memory (in which case, you can't just free that memory when an array gets reallocated due to running out of space to append to), but they could already refer to the memory one past the end of the array, making it so that it can't expand into that memory. Slices change the entire equation. And the way slices are designed, they require the GC. - Jonathan M Davis
Feb 13 2012
On 02/11/12 02:46, Era Scarecrow wrote:I assumed the poster you're replying to was not being serious. There's absolutely no difference between the code generated from C and D, unless you use a few D-only concepts; ignoring compiler issues. Having several levels of modules and templates, that in the end emit single CPU instructions is not only possible, it lets you write completely generic code that's both safer and not less efficient than writing the equivalent in assembler. I can easily see D being acceptable for 8K projects, 64K would probably allow for a mostly complete runtime. The answer isn't to butcher the language, it's to fix the shortcomings. So, for example: all array ops need to be lowered and mapped to D code so that they can be intercepted. Then you can either disallow everything not supported or allow some subset and fail for every other operation. Slicing probably counts too, as you may want to disallow or limit its use. (Intercepted) pseudo-GC allocation might even work for some cases, even if i'm not sure that it would be very useful, w/o things like scoped args and more compiler support. "synchronized" needs to accept anything that implements opLock() and opUnlock(). Not only does that let you change the locking primitives, it also lets you use it for things like CLI/STI-type UP exclusion, since I doubt the 64K machine would be MP. "synchronized" is better than RAII/scope because it gives the compiler more information; once it knows that the code inside the critical region is much more expensive to run, it can more aggressively move certain parts outside, keeping the critical region as small as possible (think "immutable" accesses, that are hidden under a layer of functions/templates). Classes are probably not a good idea in such a small system, yes. A compiler option to turn off the default TLS model would help too. What did I miss? arturThere is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.I'll need to agree. Porting D to a smaller memory space and with cramped features in all of this is not going to be good no matter how you look at it. I'm sure it's similar to comparing using perl in something with only 64k of memory, one must ask where you can put the interpreter, decoding and working with the source text, and many other things, not to mention even if you pulled it off, the speed penalty. With only 64k, you aren't going to need anything extremely complex or elaborate. You MIGHT get away with exporting D code to using C symbols, but you'll likely be stuck working with structs, no library support, no heap, no memory management, and fixed-sized arrays. I doubt you'd need templates, or any of the higher functions. All structures and types must be basic or known statically at compile time. Unlikely for lambdas to be used, and a score of other features. This is all just speculation, but I think you get the picture. If you make a subset of D, it would most likely be named Mini-D. But at that point you've got an enhanced C without going C++.
Feb 11 2012
On 11 February 2012 17:47, Artur Skawina <art.08.09 gmail.com> wrote:On 02/11/12 02:46, Era Scarecrow wrote:owerful enough. Only C can achieve that.There is no way you get a D application into 64K. The language is not p=features in all of this is not going to be good no matter how you look at = it. I'm sure it's similar to comparing using perl in something with only 64= k of memory, one must ask where you can put the interpreter, decoding and w= orking with the source text, and many other things, not to mention even if = you pulled it off, the speed penalty.I'll need to agree. Porting D to a smaller memory space and with cramped=aborate.With only 64k, you aren't going to need anything extremely complex or el=likely be stuck working with structs, no library support, no heap, no memor= y management, and fixed-sized arrays. I doubt you'd need templates, or any = of the higher functions. All structures and types must be basic or known st= atically at compile time. Unlikely for lambdas to be used, and a score of o= ther features.You MIGHT get away with exporting D code to using C symbols, but you'll =ke a subset of D, it would most likely be named Mini-D. But at that point y= ou've got an enhanced C without going C++.This is all just speculation, but I think you get the picture. If you ma=I'd imagine the general idea is, just how much of druntime can we strip away and still have the compiler be happy with all it's implicit library calls. After that, then decide what we don't *need*, or could do in an alternative way and achieve the same result (without loosing safeness). I'd imagine there's quite a few things that could be done differently depending on whether the compiler is building with the assumption the program is going to be free standing environment, or will depend on some sort of runtime existing that we'll link to. What can't be done may most likely be an error. --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';I assumed the poster you're replying to was not being serious. There's absolutely no difference between the code generated from C and D, unless you use a few D-only concepts; ignoring compiler issues. Having several levels of modules and templates, that in the end emit single CPU instructions is not only possible, it lets you write completely generic code that's both safer and not less efficient than writing the equivalent in assembler. I can easily see D being acceptable for 8K projects, 64K would probably allow for a mostly complete runtime.
Feb 11 2012
On Saturday, 11 February 2012 at 00:58:53 UTC, Marco Leise wrote:Am 10.02.2012, 20:02 Uhr, schrieb Tim Krimm <twkrimm yahoo.com>:It seems to me that if you are only using the D constructs that are similar to C, then you should probably be generating similar assembly code. It also seems to me that if you are only using the D constructs that are similar to C, then you could rather easily convert the D into equivalent C code. Then you could use the existing C compiler to compile the code for your Microchip, Ardinuo, Zilog, ARM, Intel, Propeller, etc.What are your thoughts?There is no way you get a D application into 64K. The language is not powerful enough. Only C can achieve that.
Feb 10 2012
On 02/10/2012 11:02 AM, Tim Krimm wrote:We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?If it's strict subset of D, then it could be done in a lint-esqu fashion by statical checking for anything not in the subset. I could see this as a patch to DMD that makes no modifications to the processing aside from adding extra errors. Any legal D- should be legal D and do exactly the same thing.
Feb 10 2012
Am 10.02.2012 20:02, schrieb Tim Krimm:We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I don't see the point. C++ was the last systems programming language without GC getting market share. I seriously doubt any new systems programming language without GC will ever suceed. Specially since systems programming in MacOS X and Windows world is slowly meaning the use of reference counting or GC in the vendor supported systems programming languages. Objective-C in MacOS X supports GC and Reference Counting (GC). C++ in Windows has the std::*ptr and used in context of Microsoft Research projects like Singularity. So sum this up. If you need a languague without GC, C and C++ are quite good, have lots of tools and excellent compilers available. Do you need a very simple C like language, but with GC and a few improvements, Go might be an option. Do you need a language with GC, that is C++ done right and quite capable for systems programming, pick D. There is no need to D-. -- Paulo
Feb 11 2012
"Paulo Pinto" <pjmlp progtools.org> wrote in message news:jh5aip$1qma$1 digitalmars.com...I don't see the point. C++ was the last systems programming language without GC getting market share. I seriously doubt any new systems programming language without GC will ever suceed.You're looking at it backwards. The whole point is for places where you wouldn't want GC. Those people are currently limited to the rotting, antiquated C and...that's about it. Nobody said this "D-" would need to take over the world. It can still succeed in a niche, and that niche is the whole point here.Specially since systems programming in MacOS X and Windows world isNobody's talking about Mac and Windows here.So sum this up. If you need a languague without GC, C and C++ are quite good,That's laughable. C and C++ are convoluted anachronistic crap. The only reason anyone still uses them is because 99.99% of language designers feel the way you do, and as a reasult, C/C++ remain the *only* options for certain uses.have lots of tools and excellent compilers available. Do you need a very simple C like language, but with GC and a few improvements, Go might be an option.First of all, Issue 9 is shit. Secondly, we're talking systems/embedded here, and Issue 9 is nowhere remotely near the same planet. That's like suggesting Perl or PHP.Do you need a language with GC,Not the scenario we're talking about.that is C++ done right and quite capable for systems programming, pick D. There is no need to D-.Poppycock.
Feb 11 2012
Am 11.02.2012 15:46, schrieb Nick Sabalausky:"Paulo Pinto"<pjmlp progtools.org> wrote in message news:jh5aip$1qma$1 digitalmars.com...The reason being that if you remove the GC, then you end up with some kind of C, C++, Pascal or Ada flavour, because there is only so much you can do without a GC. So in the end you just get an already existing language, but with different syntax. So it is not worth the effort designing such languages. More to the point, research has proven that system programming languages with GC is possible, they have yet not become mainstream because for a systems programming language to become mainstream it has to be choosen from a major OS company. Singularity version but open source. -- PauloI don't see the point. C++ was the last systems programming language without GC getting market share. I seriously doubt any new systems programming language without GC will ever suceed.You're looking at it backwards. The whole point is for places where you wouldn't want GC. Those people are currently limited to the rotting, antiquated C and...that's about it. Nobody said this "D-" would need to take over the world. It can still succeed in a niche, and that niche is the whole point here.Specially since systems programming in MacOS X and Windows world isNobody's talking about Mac and Windows here.So sum this up. If you need a languague without GC, C and C++ are quite good,That's laughable. C and C++ are convoluted anachronistic crap. The only reason anyone still uses them is because 99.99% of language designers feel the way you do, and as a reasult, C/C++ remain the *only* options for certain uses.
Feb 12 2012
"Paulo Pinto" <pjmlp progtools.org> wrote in message news:jh7tvk$29sv$1 digitalmars.com...So in the end you just get an already existing language, but with different syntax. So it is not worth the effort designing such languages.Where are you getting the crazy idea that the GC is the only non-syntactic improvement D has vs C/C++? Additionally, you keep implying that the syntactic improvements are unimportant, or at least insignificant. Rediculous. Even if the GC were the only non-syntactic improvement and all the other changes were syntax (which isn't even true anyway), the syntax alone would absolutely be a worthwhile improvement over C or C++.
Feb 12 2012
Am 12.02.2012 15:23, schrieb Nick Sabalausky:"Paulo Pinto"<pjmlp progtools.org> wrote in message news:jh7tvk$29sv$1 digitalmars.com...Because I see it as a wasted effort that could be better spent in other areas D needs. There already other languages with manual memory management like Ada or Pascal, which in my personal opinion have a much better syntax and module systems than C or C++. -- PauloSo in the end you just get an already existing language, but with different syntax. So it is not worth the effort designing such languages.Where are you getting the crazy idea that the GC is the only non-syntactic improvement D has vs C/C++? Additionally, you keep implying that the syntactic improvements are unimportant, or at least insignificant. Rediculous. Even if the GC were the only non-syntactic improvement and all the other changes were syntax (which isn't even true anyway), the syntax alone would absolutely be a worthwhile improvement over C or C++.
Feb 13 2012
On 02/11/2012 12:58 AM, Paulo Pinto wrote:Am 10.02.2012 20:02, schrieb Tim Krimm:Systems programming in the MacOS X and Windows world isn't real systems programming. The closest you get is kernel and driver work but even there you have most of an OS to work with. I think the kind of systems programming being considered is embedded work and/or things like BIOS work.We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I don't see the point. C++ was the last systems programming language without GC getting market share. I seriously doubt any new systems programming language without GC will ever suceed. Specially since systems programming in MacOS X and Windows world isslowly meaning the use of reference counting or GC in the vendor supported systems programming languages. Objective-C in MacOS X supports GC and Reference Counting (GC). C++ in Windows has the std::*ptr and used in context of Microsoft Research projects like Singularity. So sum this up. If you need a languague without GC, C and C++ are quite good, have lots of tools and excellent compilers available. Do you need a very simple C like language, but with GC and a few improvements, Go might be an option. Do you need a language with GC, that is C++ done right and quite capable for systems programming, pick D. There is no need to D-. -- Paulo
Feb 11 2012
Am 11.02.2012 18:00, schrieb bcs:On 02/11/2012 12:58 AM, Paulo Pinto wrote:Systems programming is everything you need to get an OS up and running. At least it was so a few decades back when I attended computer science and informatics engineering course. Regarding embedded and BIOS work, many systems being used today still required a custom C compiler without full ANSI C support, so how would such systems support a D- implementation? -- PauloAm 10.02.2012 20:02, schrieb Tim Krimm:Systems programming in the MacOS X and Windows world isn't real systems programming. The closest you get is kernel and driver work but even there you have most of an OS to work with. I think the kind of systems programming being considered is embedded work and/or things like BIOS work.We have C and C++ How about D- and D? D- would be the have a similar use as today's C compilers. =========================== Why create this language? =========================== Well I would love to have a D compiler that supports microcontrollers. The ones that have say 32 K of RAM and 64K of FLASH. A language that is targeted for embedded and/or low resource environments. It would be nice to have a modern language for low resource environments. A potential way to implement this language is to use the DMD frontend, then flag the unsupported features of D, Next create a backend, like "C front" that outputs C code instead of assembler. =========================== What do I envision with D-, D-- or Dm or what ever you want to call it. =========================== This language would basically be D without the garbage collection. For example there would be structures but no classes. There would be regular arrays but no dynamic arrays. Code that is mostly equivalent to C, but you would still have structures with functions and overloading support, and other features like templates etc. I think you get the idea. What are your thoughts?I don't see the point. C++ was the last systems programming language without GC getting market share. I seriously doubt any new systems programming language without GC will ever suceed. Specially since systems programming in MacOS X and Windows world is
Feb 11 2012
On 02/11/2012 09:19 AM, Paulo Pinto wrote:Am 11.02.2012 18:00, schrieb bcs:OK then there may be some people doing systems programming for MacOS X and Windows, but they all work for Apple and MS.On 02/11/2012 12:58 AM, Paulo Pinto wrote:Systems programming is everything you need to get an OS up and running. At least it was so a few decades back when I attended computer science and informatics engineering course.Specially since systems programming in MacOS X and Windows world isSystems programming in the MacOS X and Windows world isn't real systems programming. The closest you get is kernel and driver work but even there you have most of an OS to work with. I think the kind of systems programming being considered is embedded work and/or things like BIOS work.Regarding embedded and BIOS work, many systems being used today still required a custom C compiler without full ANSI C support, so how would such systems support a D- implementation? -- Paulo
Feb 11 2012
Am 12.02.2012 03:03, schrieb bcs:On 02/11/2012 09:19 AM, Paulo Pinto wrote:So do you mean everyone doing device driver development are also working for them? As well as all the companies writing services/daemons with low level protocols for optimal perfomance? -- PauloAm 11.02.2012 18:00, schrieb bcs:OK then there may be some people doing systems programming for MacOS X and Windows, but they all work for Apple and MS.On 02/11/2012 12:58 AM, Paulo Pinto wrote:Systems programming is everything you need to get an OS up and running. At least it was so a few decades back when I attended computer science and informatics engineering course.Specially since systems programming in MacOS X and Windows world isSystems programming in the MacOS X and Windows world isn't real systems programming. The closest you get is kernel and driver work but even there you have most of an OS to work with. I think the kind of systems programming being considered is embedded work and/or things like BIOS work.
Feb 12 2012
On 02/12/2012 12:32 AM, Paulo Pinto wrote:Am 12.02.2012 03:03, schrieb bcs:I've never worked on them but I seem to recall from somewhere that Windows drivers operate in an environment that has a lot of "supporting infrastructure". Assuming that's not off in the weeds, I suspect the cases is not to different for OS-x.On 02/11/2012 09:19 AM, Paulo Pinto wrote:So do you mean everyone doing device driver development are also working for them?Am 11.02.2012 18:00, schrieb bcs:OK then there may be some people doing systems programming for MacOS X and Windows, but they all work for Apple and MS.On 02/11/2012 12:58 AM, Paulo Pinto wrote:Systems programming is everything you need to get an OS up and running. At least it was so a few decades back when I attended computer science and informatics engineering course.Specially since systems programming in MacOS X and Windows world isSystems programming in the MacOS X and Windows world isn't real systems programming. The closest you get is kernel and driver work but even there you have most of an OS to work with. I think the kind of systems programming being considered is embedded work and/or things like BIOS work.As well as all the companies writing services/daemons with low level protocols for optimal perfomance?If you are working in user mode your claim to doing systems programming is weakened. The same goes if any part of your program can afford to use a GC. I will grant that there is a lot of ground between that and the "very much not systems programming" type of work that goes into a things like web apps. However, I would assert that a formal D- sub-set/dialect would mostly be of use on the core kernel development and embedded-systems/micro-controllers end of things. Outside that, I suspect that >90% of the advantage can be had via a well selected style guide.
Feb 14 2012
This is actually probably not that difficult to do. A C backend for dmd would be quite difficult to make - but if you strip out most of the complex features that make it to code generation (exceptions, garbage collected memory, tls, classes, array ops, threading, floating point, typeinfo, destructors, postblits etc) then the actual code generated doesn't need to be that complex. This could be (well, it _should_ be, stuff like array ops currently happens in the frontend) implemented completely in the glue layer of the compiler, with everything not supported just stubbed out.
Feb 11 2012
Am 11.02.2012 16:32, schrieb Daniel Murphy:This is actually probably not that difficult to do. A C backend for dmd would be quite difficult to make - but if you strip out most of the complex features that make it to code generation (exceptions, garbage collected memory, tls, classes, array ops, threading, floating point, typeinfo, destructors, postblits etc) then the actual code generated doesn't need to be that complex.If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks? For example, MikroEletronica sells C, Basic and Pascal compilers that target everything from a small PIC up to big ARMs. http://www.mikroe.com/eng/products/view/754/mikropascal-pro-for-arm/ I can also get Ada for embedded systems programming, which was actually one of Ada's design goals, http://www.adacore.com/home/products/gnatpro/development_solutions/embedded/?gclid=CJ-7yNeImK4CFUGIDgodXT4CJQ So what does D- bring to the table, besides fragmenting the community? -- Paulo
Feb 12 2012
"Paulo Pinto" <pjmlp progtools.org> wrote in message news:jh7v08$2chs$1 digitalmars.com...If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks?You still have all of D's compile-time magic, which I miss every time I need to do embedded programming. You still have the simple syntax improvement. I would love to be able to do away with the preprocessor and stupidly_long_method_names_because_of_no_overloading_or_method_syntax.So what does D- bring to the table, besides fragmenting the community?No need to fork the lanugage - just add a couple of pragmas and a basic C backend.
Feb 12 2012
Am 12.02.2012 11:55, schrieb Daniel Murphy:"Paulo Pinto"<pjmlp progtools.org> wrote in message news:jh7v08$2chs$1 digitalmars.com...Overloading is also possible with C++. I know compile-time magic is messy (to say the least) with C++, still it is already there.If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks?You still have all of D's compile-time magic, which I miss every time I need to do embedded programming. You still have the simple syntax improvement. I would love to be able to do away with the preprocessor and stupidly_long_method_names_because_of_no_overloading_or_method_syntax.How basic would this C backend be? Specially taking into account it would be one extra backend to support and not all embedded processors are even able to support full ANSI C even on this day and age. I am just playing a bit the devil's advocate here, as I think our industry suffers a lot from the "Worse is Better" principle, and as such one really needs to think about ROI when proposing new solutions for problems with existing solutions, even if they aren't the best ones. -- PauloSo what does D- bring to the table, besides fragmenting the community?No need to fork the lanugage - just add a couple of pragmas and a basic C backend.
Feb 12 2012
"Paulo Pinto" <pjmlp progtools.org> wrote in message news:jh87aj$2upa$1 digitalmars.com...Overloading is also possible with C++. I know compile-time magic is messy (to say the least) with C++, still it is already there.Having D able to work on embedded platforms isn't going to enable anything that wasn't possible, it will just make it easier and more pleasant.Honestly, I don't really know. I've never written a C backend before. I know the compiler already has code to print expressions and statements back out as D code, and this is not incredibly complex. I don't know if it's possible to really keep it simple, but if it is... The great thing about it only being a backend is that it benefits from all the work that goes into the frontend, and that is where most of the development is these days. Not trying to support all D features means a lot of code can be directly mapped to C code - if you take out everything on my list, how much stuff in D is actually not supported by C?How basic would this C backend be? Specially taking into account it would be one extra backend to support and not all embedded processors are even able to support full ANSI C even on this day and age.So what does D- bring to the table, besides fragmenting the community?No need to fork the lanugage - just add a couple of pragmas and a basic C backend.I am just playing a bit the devil's advocate here, as I think our industry suffers a lot from the "Worse is Better" principle, and as such one really needs to think about ROI when proposing new solutions for problems with existing solutions, even if they aren't the best ones.Yeah well, I'm not really discussing this as a solution to anything, just something interesting to try out. Nobody sane would try to make something that works on every microprocessor out there, but if it was pluggable and open source, maybe people would rather be writing D than C? I know I would, even for extremely low-level stuff.
Feb 12 2012
Turns out I can't help myself: https://github.com/yebblies/dmd/tree/microd (the makefile changes are win32 only, but aren't very compilcated) It compiles the following into cryptic c full of mangled names just fine: __gshared int global = 3; int main() { uint x; foreach(i; 0..20) { x += i; } return 0; } Doesn't seem that hard. Dmd would need support for 8/16 bit pointers and a few other things, but I think most of the customization could be done with some well-defined macros and per-architecture header files. Some features are implemented in wrong part of the compiler, and will cause problems.
Feb 12 2012
On 12 February 2012 17:45, Daniel Murphy <yebblies nospamgmail.com> wrote:Turns out I can't help myself: https://github.com/yebblies/dmd/tree/microd (the makefile changes are win32 only, but aren't very compilcated) It compiles the following into cryptic c full of mangled names just fine: __gshared int global =3D 3; int main() { =A0 =A0uint x; =A0 =A0foreach(i; 0..20) =A0 =A0{ =A0 =A0 =A0 =A0x +=3D i; =A0 =A0} =A0 =A0return 0; } Doesn't seem that hard. =A0Dmd would need support for 8/16 bit pointers a=nd afew other things, but I think most of the customization could be done wit=hsome well-defined macros and per-architecture header files. =A0Some featu=resare implemented in wrong part of the compiler, and will cause problems.O_O --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';
Feb 13 2012
"Iain Buclaw" <ibuclaw ubuntu.com> wrote in message news:mailman.287.1329145247.20196.digitalmars-d puremagic.com...O_O=) Which bit's making you pull that face? Is it the fact I think it might be a good idea or the fact I think it wouldn't be that hard? It currently can translate: import core.stdc.stdio; __gshared int global = 3; struct S { int a; void fun() { printf("member a: %d\n", a); } } int main() { uint x; foreach(i; 0..20) { x += i; } printf("%d\n", x); S y = S(7); y.a += 5; y.fun(); return 0; } into typedef struct __d_5testx1S __d_5testx1S; __d_int _D5testx6globali; struct __d_5testx1S { __d_int _D5testx1S1ai; }; __d_int _Dmain(); __d_void _D5testx1S3funMFZv(__d_5testx1S* _D5testx1S3funMFZv4thisS5testx1S); __d_int _D5testx6globali = 3; __d_int _Dmain() { __d_uint _D5testx4mainFZi1xk = 0u; for (__d_int _D5testx4mainFZi1ii = 0, _D5testx4mainFZi8__limit3i = 20; (_D5testx4mainFZi1ii < _D5testx4mainFZi8__limit3i); (_D5testx4mainFZi1ii += 1)) (_D5testx4mainFZi1xk += ((__d_uint)_D5testx4mainFZi1ii)); printf("%d\x0a", _D5testx4mainFZi1xk); __d_5testx1S _D5testx4mainFZi1yS5testx1S = {7}; ((_D5testx4mainFZi1yS5testx1S)._D5testx1S1ai += 5); _D5testx1S3funMFZv(&_D5testx4mainFZi1yS5testx1S); return 0; } __d_void _D5testx1S3funMFZv(__d_5testx1S* _D5testx1S3funMFZv4thisS5testx1S) { &*_D5testx1S3funMFZv4thisS5testx1S || __d_assert_msg(__d_array("null this", 9), __d_array("testx.d", 7), 9);; printf("member a: %d\x0a", (*_D5testx1S3funMFZv4thisS5testx1S)._D5testx1S1ai); } Looking at that, it seems I'd forgotten just how ugly C really is.
Feb 13 2012
On 13 February 2012 15:31, Daniel Murphy <yebblies nospamgmail.com> wrote:"Iain Buclaw" <ibuclaw ubuntu.com> wrote in message news:mailman.287.1329145247.20196.digitalmars-d puremagic.com...mightO_O=3D) Which bit's making you pull that face? =A0Is it the fact I think it =be a good idea or the fact I think it wouldn't be that hard?It's the fact that it does *nothing* to change code generation, as D code compiles down to the same as C equivalent. /* SNIP */Looking at that, it seems I'd forgotten just how ugly C really is.Code represented like that is exactly what gdc emits to it's backend for your example, albeit, a in a little bit more simplified language (and a little bit more optimized once it goes through all codegen passes =3D) --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';
Feb 13 2012
"Iain Buclaw" <ibuclaw ubuntu.com> wrote in message news:mailman.288.1329151783.20196.digitalmars-d puremagic.com...It's the fact that it does *nothing* to change code generation, as D code compiles down to the same as C equivalent.Isn't that what a C backend is supposed to do?Code represented like that is exactly what gdc emits to it's backend for your example, albeit, a in a little bit more simplified language (and a little bit more optimized once it goes through all codegen passes =)That's a good point. Maybe this effort would be better spent trying to build avr-gdc instead of the compiler centipede.
Feb 13 2012
On 13 February 2012 17:22, Daniel Murphy <yebblies nospamgmail.com> wrote:"Iain Buclaw" <ibuclaw ubuntu.com> wrote in message news:mailman.288.1329151783.20196.digitalmars-d puremagic.com...My point is that D is low level / slick enough, that it generates near-identical code to C/C++ in comparison benchmarks - recent example I can recall, someone did a speed test on vectors in GDC vs G++, and found both to be pretty much on par with each other. Then again, I wouldn't expect less when both use the same backend.It's the fact that it does *nothing* to change code generation, as D code compiles down to the same as C equivalent.Isn't that what a C backend is supposed to do?I think it starts with a runtime library that is written for the given architecture in mind. The compiler is already there in my opinion, and I have seen little reason for it not to be. --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';Code represented like that is exactly what gdc emits to it's backend for your example, albeit, a in a little bit more simplified language (and a little bit more optimized once it goes through all codegen passes =3D)That's a good point. =A0Maybe this effort would be better spent trying to build avr-gdc instead of the compiler centipede.
Feb 13 2012
"Iain Buclaw" <ibuclaw ubuntu.com> wrote in messageI think it starts with a runtime library that is written for the given architecture in mind. The compiler is already there in my opinion, and I have seen little reason for it not to be.Is the compiler really ready? Assuming that it's possible to build gdc as (for eg) an avr cross compiler, you'll still need support for: - 16 bit pointers - program memory - interrupts - IO registers - stripping out typeinfo/moduleinfo - issuing errors for unsupported features - inline assembler If gdc can do most of this already, that's great - but I doubt it can do all of it.
Feb 13 2012
On Sunday, 12 February 2012 at 17:45:46 UTC, Daniel Murphy wrote:Turns out I can't help myself: https://github.com/yebblies/dmd/tree/microdhmmm.... Do you see anything wrong with using a similar strategy to It might be a relatively easy way to get (a subset of) D integrated into those environments.
Feb 13 2012
"Adam D. Ruppe" <destructionator gmail.com> wrote in message news:rdluxkzwxsxlxfgcaqle dfeed.kimsufi.thecybershadow.net...On Sunday, 12 February 2012 at 17:45:46 UTC, Daniel Murphy wrote:C works because you can build all the high level features of D (classes, exceptions, etc) out of C and assembler. You can build high-level features out of low-level ones, but not the other way around. I don't know how pointers etc. I'm not sure, but I think there might be some limitations in the underlying bytecode that prevents some of these things, and unlike C you can't drop down to assembler to fill in the gaps. So I guess it depends on which features you want - you'd lose some of the low-level features, and might be unable to build the high-level features without them.Turns out I can't help myself: https://github.com/yebblies/dmd/tree/microdhmmm.... Do you see anything wrong with using a similar strategy to It might be a relatively easy way to get (a subset of) D integrated into those environments.
Feb 13 2012
On 02/12/2012 12:20 PM, Paulo Pinto wrote:Am 12.02.2012 11:55, schrieb Daniel Murphy:So is garbage collection."Paulo Pinto"<pjmlp progtools.org> wrote in message news:jh7v08$2chs$1 digitalmars.com...Overloading is also possible with C++.If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks?You still have all of D's compile-time magic, which I miss every time I need to do embedded programming. You still have the simple syntax improvement. I would love to be able to do away with the preprocessor and stupidly_long_method_names_because_of_no_overloading_or_method_syntax.I know compile-time magic is messy (to say the least) with C++, still it is already there.I wouldn't go as far as to call it magic.Very true and very sad.How basic would this C backend be? Specially taking into account it would be one extra backend to support and not all embedded processors are even able to support full ANSI C even on this day and age. I am just playing a bit the devil's advocate here, as I think our industry suffers a lot from the "Worse is Better" principle,So what does D- bring to the table, besides fragmenting the community?No need to fork the lanugage - just add a couple of pragmas and a basic C backend.and as such one really needs to think about ROI when proposing new solutions for problems with existing solutions, even if they aren't the best ones.The D philosophy is "The Right Thing". Therefore it is adequate to discuss better solutions for 'solved' problems on this NG.
Feb 12 2012
"Daniel Murphy" <yebblies nospamgmail.com> wrote in message news:jh85rp$2rs4$1 digitalmars.com..."Paulo Pinto" <pjmlp progtools.org> wrote in message news:jh7v08$2chs$1 digitalmars.com...Plus a module system that's actually sane.If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks?You still have all of D's compile-time magic, which I miss every time I need to do embedded programming. You still have the simple syntax improvement. I would love to be able to do away with the preprocessor and stupidly_long_method_names_because_of_no_overloading_or_method_syntax.
Feb 12 2012
Am 12.02.2012 15:27, schrieb Nick Sabalausky:"Daniel Murphy"<yebblies nospamgmail.com> wrote in message news:jh85rp$2rs4$1 digitalmars.com...+1 on this one actually. C, C++ and Objective-C are the only languages without proper module support. I really miss my Turbo Pascal days, where compilation was just instantanious. -- Paulo"Paulo Pinto"<pjmlp progtools.org> wrote in message news:jh7v08$2chs$1 digitalmars.com...Plus a module system that's actually sane.If you remove all of that then how good would D- be in regard with existing languages being used for the same tasks?You still have all of D's compile-time magic, which I miss every time I need to do embedded programming. You still have the simple syntax improvement. I would love to be able to do away with the preprocessor and stupidly_long_method_names_because_of_no_overloading_or_method_syntax.
Feb 12 2012