digitalmars.D.announce - Rust vs Dlang
- Suliman (3/3) Mar 16 2013 Hi folks! I had wrote small article about Rust vs D. I hope that
- Andrej Mitrovic (38/41) Mar 16 2013 This code:
- Suliman (3/3) Mar 16 2013 Andrej Mitrovic, thanks! I will fix it!
- Steven Schveighoffer (9/33) Mar 17 2013 That is not a mistake in this code. In fact, your replacement still use...
- Andrej Mitrovic (5/7) Mar 17 2013 Hmm, I was expecting it to always be size_t. Apparently it's based on th...
- Andrej Mitrovic (3/4) Mar 17 2013 It likely wasn't located at the beginning. Anyway the samples now seem
- Andrei Alexandrescu (5/8) Mar 16 2013 Nice writeup. Could you please fix the code formatting? Indentation is
- Russel Winder (26/35) Mar 16 2013 =20
- JN (13/20) Mar 18 2013 Well, there is an advantage of having stuff built-in. Look at
- Russel Winder (26/35) Mar 17 2013 =20
- Suliman (3/6) Mar 17 2013 Andrei Alexandrescu, I redid it and put source code as files for
- Suliman (2/2) Mar 17 2013 Yesterday I had tried to put it reddit, but I have never used
- Walter Bright (2/4) Mar 17 2013 reddit.com/r/programming is where it should go.
- Andrei Alexandrescu (6/12) Mar 17 2013 It was at:
- Rob T (8/11) Mar 16 2013 I agree, only Rust seems to compete with D for the goal as being
- Paulo Pinto (18/25) Mar 17 2013 At least on Windows, C# would be an alternative the minute that
- Russel Winder (15/18) Mar 17 2013 [=E2=80=A6]
- Paulo Pinto (29/37) Mar 17 2013 The first known one is that Go is the only strong typed language to
- Walter Bright (14/30) Mar 17 2013 I'd like to add that D has:
- Russel Winder (25/39) Mar 17 2013 [=E2=80=A6]
- Dmitry Olshansky (4/31) Mar 17 2013 --
- Walter Bright (20/22) Mar 17 2013 It can be a bad thing, no doubt about it. On the other hand:
- Peter Sommerfeld (12/17) Mar 17 2013 Not everyone is. With its "scripting abilities" (fast compilation,
- 1100110 (2/26) Mar 17 2013 Soo... You're saying D is like Vim? =P
- Jonathan M Davis (13/14) Mar 17 2013 LOL. D's learning curve is nowhere near as steep as that. Almost nothing...
- Paul (14/22) Oct 04 2013 Jonathan you've answered some many of me questions and I wanted
- Rory McGuire (14/14) Mar 17 2013 The reason I use golang and not dlang for development at work is because
- Andrei Alexandrescu (6/20) Mar 18 2013 Could you please go into details on the debugging and benchmarking
- Paulo Pinto (10/19) Mar 18 2013 From the time I used Go.
- Walter Bright (3/21) Mar 18 2013 dmd has the -profile, to automatically generate a profile report, and -c...
- Paulo Pinto (11/44) Mar 19 2013 That was my point.
- Rory McGuire (25/27) Mar 25 2013 Hi Andrei,
- Andrei Alexandrescu (4/25) Mar 25 2013 Thanks, Rory, these are good reads. We should get some articles too, we
- Walter Bright (16/18) Mar 25 2013 What it says about profiling:
- Andrei Alexandrescu (3/23) Mar 25 2013 We need an article on that.
- Alan (17/17) Mar 25 2013 Whether it is Go or D, I wish one of you guys would fill the gap
- Alan (1/1) Mar 25 2013 edit: ditch both python and fortran.
- Geancarlo Rocha (5/5) Mar 25 2013 That's julia's(http://julialang.org/) goal, but of course it's
- Alan (31/36) Mar 25 2013 I have heard of Julia and have not really messed with it yet for
- Rory McGuire (12/19) Mar 26 2013 Hi Walter,
- Dmitry Olshansky (8/27) Mar 26 2013 What everybody in all other native languages use, for instance:
- Jacob Carlborg (4/9) Mar 26 2013 On Mac OS X there's Instruments. There's also dtrace.
- Walter Bright (7/11) Mar 26 2013 I've written memory usage profilers before, but haven't done one for D. ...
- Walter Bright (5/12) Mar 26 2013 Now that I think about it, it wouldn't be that hard to add memory alloca...
- Paulo Pinto (3/21) Mar 26 2013 Something like this?
- deadalnix (5/25) Mar 17 2013 It isn't guaranteed by the current type system.
- Russel Winder (48/76) Mar 17 2013 On the other hand, perhaps generics is not a good thing, yet has created
- Paulo Pinto (43/106) Mar 17 2013 I think for static strong type languages you need some kind of
- 1100110 (3/123) Mar 17 2013 The day I can compile pypy without needing 8Gb of memory is the day I'll...
- Paulo Pinto (6/156) Mar 17 2013 Uau, that much?!
- Russel Winder (17/25) Mar 18 2013 l
- Paulo Pinto (3/20) Mar 18 2013 Yeah, you are right. Compiling Firefox will even require more
- Walter Bright (4/6) Mar 17 2013 Segmented stacks have a significant performance cost to them, as well as...
- Paulo Pinto (2/8) Mar 17 2013 If I am not mistaken, Rust makes use of them as well.
- ponce (6/7) Nov 05 2013 Rust doesn't anymore:
- Russel Winder (19/26) Mar 18 2013 4 bits=20
- Walter Bright (3/16) Mar 18 2013 That's just not an issue when you have 64 bits of address space. You can...
- bearophile (6/9) Mar 18 2013 At this point I suggest you to study exactly why Rust developers
- Walter Bright (2/7) Mar 18 2013 If you know a reason, please post one.
- jokster (4/15) Aug 31 2013 I believe the Rust developers are also targeting embedded systems
- Dmitry Olshansky (19/26) Mar 18 2013 Walter's position is crystal clear.
- master (2/5) Mar 17 2013 This can see the D language is very good, I like the D language
- Don (9/12) Mar 18 2013 Your first Rust example has "100.times" instead of "10.times".
- Tommy McGuire (11/12) Mar 18 2013 I just saw this post on the Rust subreddit:
- Tyler Jameson Little (25/28) Aug 17 2013 I don't know if you still follow this, but there's a typo here:
- Paul Jurczak (6/9) Aug 23 2013 There is more online activity in Rust vs. D corner. See
Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-d
Mar 16 2013
On 3/16/13, Suliman <evermind live.ru> wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dThis code: ``` In D a similar code would look as follows: void main() { for (int i = 0; i < 10; i++) { writeln("Hello"); } } ``` Should really be: ``` foreach (i; 0 .. 10) writeln("Hello"); ``` It avoids the common mistake of using a signed 32-bit type for indexing. This: ``` void main() { foreach (i, val; taskPool.parallel(new int[10])) { writeln("Hello:", i); } } ``` Also very very wrong, you don't have to allocate, use iota: void main() { foreach (i, val; taskPool.parallel((iota(0, 10))) { writeln("Hello:", i); } } Also your example code seems to embed some strange hidden Unicode characters (Error: unsupported char 0xfeff) which make copy-pasting and running the examples not work. Anyway I don't agree with the conclusions, this is barely scratching the surface of either language.
Mar 16 2013
Andrej Mitrovic, thanks! I will fix it! yes look like bbcode put some crap in page body. We will try to fix it.
Mar 16 2013
On Sat, 16 Mar 2013 11:14:15 -0400, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:On 3/16/13, Suliman <evermind live.ru> wrote:That is not a mistake in this code. In fact, your replacement still uses signed types.Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dThis code: ``` In D a similar code would look as follows: void main() { for (int i = 0; i < 10; i++) { writeln("Hello"); } } ``` Should really be: ``` foreach (i; 0 .. 10) writeln("Hello"); ``` It avoids the common mistake of using a signed 32-bit type for indexing.Also your example code seems to embed some strange hidden Unicode characters (Error: unsupported char 0xfeff) which make copy-pasting and running the examples not work.feff is a BOM (byte order mark) which is typically at the beginning of a file to establish the number of bits per code point and the byte order of the code points. It is not strange, and it should be handled correctly by dmd. If not, that is a bug. -Steve
Mar 17 2013
On 3/17/13, Steven Schveighoffer <schveiguy yahoo.com> wrote:In fact, your replacement still uses signed types.Hmm, I was expecting it to always be size_t. Apparently it's based on the range: foreach (i; 0 .. int.max) { } // i is int foreach (i; 0 .. size_t.max) { } // i is size_t Well, we can put a 'size_t' in there so it's not too bad.
Mar 17 2013
On 3/17/13, Steven Schveighoffer <schveiguy yahoo.com> wrote:it should be handled correctly by dmd. If not, that is a bug.It likely wasn't located at the beginning. Anyway the samples now seem to be images.
Mar 17 2013
On 3/16/13 10:42 AM, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dNice writeup. Could you please fix the code formatting? Indentation is lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on reddit. Andrei
Mar 16 2013
On Sat, 2013-03-16 at 21:06 -0400, Andrei Alexandrescu wrote:On 3/16/13 10:42 AM, Suliman wrote:=20Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-d=20 Nice writeup. Could you please fix the code formatting? Indentation is=lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on==20reddit.Comments such as "There are no threads in D out of the box, but they can be implemented with the use of language libraries" seems unfair all round. The D platform is compiler + Phobos so there are threads out of the box. D also has spawn just as Rust does; out of the box.=20 Also all the imports for D are missing from the code.=20 The error handling example is unfair to D, it is not like Go where return codes are the sole mechanism of error handling, D has exceptions analogous to Rust. The switch example maximizes the number of write operations which is minimizing the "functional approach" that the article appears to be driving at. So does the switch statement return a value in either language? If not can maps/dictionaries be used so as to have a single output statement of a selected string? --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 16 2013
On Sunday, 17 March 2013 at 06:57:32 UTC, Russel Winder wrote:Comments such as "There are no threads in D out of the box, but they can be implemented with the use of language libraries" seems unfair all round. The D platform is compiler + Phobos so there are threads out of the box. D also has spawn just as Rust does; out of the box.Well, there is an advantage of having stuff built-in. Look at C++, it's annoying to type #include <string> whenever you want to use such a basic type as string. In D a basic program will also require multiple imports for usually the same basic behaviour. In list, in D we don't have it (yet ;)). Imagine if you had to import std.string; everytime you wanted to use a string type. It wouldn't be the most fun thing to use. IMHO there's nothing wrong in putting the basic functionality built-in. It doesn't matter if it's somehow baked into the language or as an auto-import library, it's a matter of convenience but in these cases it's worth it (IMHO).
Mar 18 2013
On Sat, 2013-03-16 at 21:06 -0400, Andrei Alexandrescu wrote:On 3/16/13 10:42 AM, Suliman wrote:=20Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-d=20 Nice writeup. Could you please fix the code formatting? Indentation is=lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on==20reddit.Sorry I forgot to add: Can either of the codes calculate: factorial(40) ? i.e. are the codes at all relevant given that 32-bit and 64-bit integers are useless for this calculation? Python happily and correctly calculates factorial(2000). Also if a functional approach is being advertised why use an imperative algorithm for factorial, with it's explicit iteration, why not use reduce so as to hide the itertation. In D: reduce!"a * b"(1L, iota(1, n+1)( It appears the 1L is needed here when using ulongs or type inference fails :-( --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 17 2013
Nice writeup. Could you please fix the code formatting? Indentation is lost at least on Chrome and Firefox on OSX. Then I'll be glad to post on reddit.Andrei Alexandrescu, I redid it and put source code as files for downloading till we will not fix or bbcode parser. You may check. I would thanks full if you will reddit it.
Mar 17 2013
Yesterday I had tried to put it reddit, but I have never used reddit before and do not sure that it was added at proper section.
Mar 17 2013
On 3/17/2013 8:58 AM, Suliman wrote:Yesterday I had tried to put it reddit, but I have never used reddit before and do not sure that it was added at proper section.reddit.com/r/programming is where it should go.
Mar 17 2013
On 3/17/13 4:44 PM, Walter Bright wrote:On 3/17/2013 8:58 AM, Suliman wrote:It was at: http://www.reddit.com/r/programming/comments/1aet4m/rust_vs_d/ Unfortunately reddit's fairness system has more popular submitters rank higher than new submitters. AndreiYesterday I had tried to put it reddit, but I have never used reddit before and do not sure that it was added at proper section.reddit.com/r/programming is where it should go.
Mar 17 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dI agree, only Rust seems to compete with D for the goal as being a real alternative to C/C++. Interesting read comparing the two. If I may critique, the section concerning error handling, the comparison is not accurate. The D equivalent of what was shown in Rust needs to show how try-catch-finally, or scope(...), is used to perform the equivalent error handling. --rt
Mar 16 2013
On 17.03.2013 07:25, Rob T wrote:On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Microsoft decides to offer a direct native code compiler instead of the AOT + JIT combo. They have done it for Singularity and part of that work is now being used in Windows Phone 8, where .NET applications are actually compiled to native code when uploaded to the Windows Store. Go could be an alternative, given the proofs given by Oberon and Active Oberon as system programming languages, which Go kind of follows. However the Go guys just don't agree with the progresses made in language abstractions in the last decades, which in my view is a plus point for D and Rust, and made me stop caring about Go. In Europe Ada seems to be picking up some users now that there is a good quality free compiler available (GNAT) and the public is more aware of the security issues created by C and C++ when used by junior developers. Anyway the more languages the better. -- PauloHi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dI agree, only Rust seems to compete with D for the goal as being a real alternative to C/C++. Interesting read comparing the two.
Mar 17 2013
On Sun, 2013-03-17 at 08:59 +0100, Paulo Pinto wrote: [=E2=80=A6]However the Go guys just don't agree with the progresses made in=20 language abstractions in the last decades, which in my view is a plus=20 point for D and Rust, and made me stop caring about Go.[=E2=80=A6] So what are the features that Go is ignoring that D has? An article on this would be good marketing for D just now. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 17 2013
On 17.03.2013 09:05, Russel Winder wrote:On Sun, 2013-03-17 at 08:59 +0100, Paulo Pinto wrote: […]The first known one is that Go is the only strong typed language to eschew generics in the 21st century. For the rest, copying from my discussion on Lambda the Ultimate about C++ developers not jumping into Go (http://lambda-the-ultimate.org/node/4554#comment-71504): - exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languages I know you can fake enumerations with typed consts, but it is not the same thing as real enumerations. My point about direct OS APIs is that while D and Rust follow the approach used by other languages where you just declare bindings, Go forces the use of the CGO tool and a C compiler that speaks Go ABI. Their talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that. Feel free to destroy. :) -- PauloHowever the Go guys just don't agree with the progresses made in language abstractions in the last decades, which in my view is a plus point for D and Rust, and made me stop caring about Go.[…] So what are the features that Go is ignoring that D has? An article on this would be good marketing for D just now.
Mar 17 2013
On 3/17/2013 1:17 AM, Paulo Pinto wrote:On 17.03.2013 09:05, Russel Winder wrote:I'd like to add that D has: - operator overloading - user defined attributes - dll's (coming soon) - vector operations - SIMD operations - scope guard - compile time function execution - true immutability and purity - inline assemblerSo what are the features that Go is ignoring that D has?- exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languagesTheir talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that.Andrei did some tests a while back showing that D compiles considerably faster than Go. High compilation speed has been a major factor among companies who have adopted D.
Mar 17 2013
On Sun, 2013-03-17 at 01:57 -0700, Walter Bright wrote: [=E2=80=A6]I'd like to add that D has: =20 - operator overloading - user defined attributes - dll's (coming soon) - vector operations - SIMD operations - scope guard - compile time function execution - true immutability and purity - inline assembler[=E2=80=A6] On the other hand "creeping featurism" can be a bad thing. Isn't the mantra "small language, large (properly indexed) library"?=20 Immutability though I like. Single assignment rules. Inline assembler is anathema.Andrei did some tests a while back showing that D compiles considerably f=aster=20than Go. High compilation speed has been a major factor among companies w=ho have=20adopted D.Excellent. Java / Scala is an interesting battle: Java is massively verbose, Scala is not; Java takes a while to compile, Scala takes eons. Hence static Groovy (as well as dynamic), and Kotlin. The jury is still out on whether Ceylon has any relevance to the universe. PS Can I have shared objects last week please ;-) --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 17 2013
17-Mar-2013 14:06, Russel Winder пишет:On Sun, 2013-03-17 at 01:57 -0700, Walter Bright wrote: […]Built-in channels and goroutines don't count as feature creep ? ;)I'd like to add that D has: - operator overloading - user defined attributes - dll's (coming soon) - vector operations - SIMD operations - scope guard - compile time function execution - true immutability and purity - inline assembler[…] On the other hand "creeping featurism" can be a bad thing. Isn't the mantra "small language, large (properly indexed) library"?Immutability though I like. Single assignment rules. Inline assembler is anathema.-- Dmitry OlshanskyAndrei did some tests a while back showing that D compiles considerably faster than Go. High compilation speed has been a major factor among companies who have adopted D.Excellent. Java / Scala is an interesting battle: Java is massively verbose, Scala is not; Java takes a while to compile, Scala takes eons. Hence static Groovy (as well as dynamic), and Kotlin. The jury is still out on whether Ceylon has any relevance to the universe. PS Can I have shared objects last week please ;-)
Mar 17 2013
On 3/17/2013 3:06 AM, Russel Winder wrote:On the other hand "creeping featurism" can be a bad thing. Isn't the mantra "small language, large (properly indexed) library"?It can be a bad thing, no doubt about it. On the other hand: When I was in London for the 2010 ACCU (when the volcano stranded me there), I took a chance to tour the Belfast cruiser sitting in the Thames. One interesting aspect of it was the ship's machine shop. It was full of carefully selected machine tools. It was pretty clear to me that an expert machinist could quickly and accurately make or repair about anything that broke on that ship. Sure, you can make do with fewer, more general purpose machines. But it'll take you considerably longer, and the result won't be as good. For example, I've used electric drills for years. I was never able to get it to drill a hole perfectly perpendicular. I finally got a drill press, and problem solved. Not only is it far more accurate, it's much faster when you've got a lot of holes to drill. I prefer to view D as a fully equipped machine shop with the right tools for the right job. Yes, it will take longer to master it than a simpler language. But we're professionals, we program all day. The investment of time to master it is trivial next to the career productivity improvement. And as for the library, yes that is crucial. A large part of D's feature set is there to enable more powerful libraries, such as the language support for ranges, and the language support for library-defined garbage collection.
Mar 17 2013
Walter Bright wrote: [snip]I prefer to view D as a fully equipped machine shop with the right tools for the right job. Yes, it will take longer to master it than a simpler language. But we're professionals, we program all day.Not everyone is. With its "scripting abilities" (fast compilation, a rich std lib, nice syntax) D is attractive for people which has used a scripting language + C/C++ before to get their job done and are frustrated by the limitations of such a combo.The investment of time to master it is trivial next to the career productivity improvement.IMHO the problem here is documentation and integration of the various aspects of the language. The learning curve is rather steep and takes (much) more time than is really needed. Of course, I agree with you on the bottom line to prefer a rich set of tools over overly simplification. Peter
Mar 17 2013
On 03/17/2013 03:44 PM, Walter Bright wrote:On 3/17/2013 3:06 AM, Russel Winder wrote:Soo... You're saying D is like Vim? =POn the other hand "creeping featurism" can be a bad thing. Isn't the mantra "small language, large (properly indexed) library"?It can be a bad thing, no doubt about it. On the other hand: When I was in London for the 2010 ACCU (when the volcano stranded me there), I took a chance to tour the Belfast cruiser sitting in the Thames. One interesting aspect of it was the ship's machine shop. It was full of carefully selected machine tools. It was pretty clear to me that an expert machinist could quickly and accurately make or repair about anything that broke on that ship. Sure, you can make do with fewer, more general purpose machines. But it'll take you considerably longer, and the result won't be as good. For example, I've used electric drills for years. I was never able to get it to drill a hole perfectly perpendicular. I finally got a drill press, and problem solved. Not only is it far more accurate, it's much faster when you've got a lot of holes to drill. I prefer to view D as a fully equipped machine shop with the right tools for the right job. Yes, it will take longer to master it than a simpler language. But we're professionals, we program all day. The investment of time to master it is trivial next to the career productivity improvement. And as for the library, yes that is crucial. A large part of D's feature set is there to enable more powerful libraries, such as the language support for ranges, and the language support for library-defined garbage collection.
Mar 17 2013
On Sunday, March 17, 2013 17:14:42 1100110 wrote:Soo... You're saying D is like Vim? =PLOL. D's learning curve is nowhere near as steep as that. Almost nothing has a learning curve as steep as vim... But on some level, the concept is the same. In order for something to be powerful enough to properly equip an experienced user, it usually ends up being more complicated for the newbie to learn. Making it super easy for the newbie to learn will just make it less useful for them in the long run, because the power just won't be there even when they're no longer a newbie. The trick is to make something which is powerful and flexible for the experienced user and yet not too daunting for the newbie. I don't know how well we've succeeded on that front, but I'm sure that more tutorials and better documentation and whatnot would help. - Jonathan M Davis
Mar 17 2013
The trick is to make something which is powerful and flexible for the experienced user and yet not too daunting for the newbie. I don't know how well we've succeeded on that front, but I'm sure that more tutorials and better documentation and whatnot would help. - Jonathan M DavisJonathan you've answered some many of me questions and I wanted to comment on this thought. I am a very poor programmer who has only used languages as needed to get a job done and never becoming good at any of them. I picked up D to start developing some text processing tools. I started with other guys in our office building these tools in Python but then learned I could actually generate tiny .exe's and not have to have Python installed on systems that I needed my tools on. The slices and associative arrays are awesome. I've acquired the habit of using the time functions and printing out how long it takes the program to do its work. 245ms! 657ms! LOL. D rocks! It is extremely complex and 90% of it is over my head but making my own little .exe's that blast through things orders of magnitude faster than the scripting languages is fun. Keep up the good work all!
Oct 04 2013
The reason I use golang and not dlang for development at work is because debugging is straightforward no weird segfaults after you program has been running for a couple of days. Their debugging and benchmark tools are really good and the documentation is fantastic. I haven't used dlang for a while now so I don't know how much that sort of thing is improved. I'm guessing from the fact that more companies are starting to use it, that it becoming more stable to use. I am a HUGE fan of D and hope to use it exclusively one day, but last I checked if you have 5 days to do a project in golang is more likely to get you results. One question, is there a place where I can see who is currently involved with D and what their primary roles are? -Rory
Mar 17 2013
On 3/18/13 1:46 AM, Rory McGuire wrote:The reason I use golang and not dlang for development at work is because debugging is straightforward no weird segfaults after you program has been running for a couple of days. Their debugging and benchmark tools are really good and the documentation is fantastic.Could you please go into details on the debugging and benchmarking tools? Thanks.I haven't used dlang for a while now so I don't know how much that sort of thing is improved. I'm guessing from the fact that more companies are starting to use it, that it becoming more stable to use. I am a HUGE fan of D and hope to use it exclusively one day, but last I checked if you have 5 days to do a project in golang is more likely to get you results. One question, is there a place where I can see who is currently involved with D and what their primary roles are?At this point roles are determined by what people work on, and how intensely. Andrei
Mar 18 2013
Am 18.03.2013 13:21, schrieb Andrei Alexandrescu:On 3/18/13 1:46 AM, Rory McGuire wrote:From the time I used Go. You can use gdb or if you prefer something like a debugger IDE, LiteIDE http://code.google.com/p/liteide/ For benchmarking there is an old blog entry about the tools. http://blog.golang.org/2011/06/profiling-go-programs.html Nothing that you cannot find in other languages, unless there is now something much better available. -- PauloThe reason I use golang and not dlang for development at work is because debugging is straightforward no weird segfaults after you program has been running for a couple of days. Their debugging and benchmark tools are really good and the documentation is fantastic.Could you please go into details on the debugging and benchmarking tools? Thanks.
Mar 18 2013
On 3/18/2013 12:08 PM, Paulo Pinto wrote:Am 18.03.2013 13:21, schrieb Andrei Alexandrescu:dmd has the -profile, to automatically generate a profile report, and -cov, to tell you which lines were executed and how many times.On 3/18/13 1:46 AM, Rory McGuire wrote:From the time I used Go. You can use gdb or if you prefer something like a debugger IDE, LiteIDE http://code.google.com/p/liteide/ For benchmarking there is an old blog entry about the tools. http://blog.golang.org/2011/06/profiling-go-programs.html Nothing that you cannot find in other languages, unless there is now something much better available.The reason I use golang and not dlang for development at work is because debugging is straightforward no weird segfaults after you program has been running for a couple of days. Their debugging and benchmark tools are really good and the documentation is fantastic.Could you please go into details on the debugging and benchmarking tools? Thanks.
Mar 18 2013
On Monday, 18 March 2013 at 19:39:38 UTC, Walter Bright wrote:On 3/18/2013 12:08 PM, Paulo Pinto wrote:That was my point. I was initially attracted to Go given its similarity with Oberon concepts and was even enthusiastic to try to contribute something. However the way some Go concepts are sold as being new, while other languages outside the C world have had them for years, and the resistance of Go community to anything new look elsewhere. This answer from one of their developers is a good example, http://9fans.net/archive/2008/08/134 -- PauloAm 18.03.2013 13:21, schrieb Andrei Alexandrescu:dmd has the -profile, to automatically generate a profile report, and -cov, to tell you which lines were executed and how many times.On 3/18/13 1:46 AM, Rory McGuire wrote:From the time I used Go. You can use gdb or if you prefer something like a debugger IDE, LiteIDE http://code.google.com/p/liteide/ For benchmarking there is an old blog entry about the tools. http://blog.golang.org/2011/06/profiling-go-programs.html Nothing that you cannot find in other languages, unless there is now something much better available.The reason I use golang and not dlang for development at work is because debugging is straightforward no weird segfaults after you program has been running for a couple of days. Their debugging and benchmark tools are really good and the documentation is fantastic.Could you please go into details on the debugging and benchmarking tools? Thanks.
Mar 19 2013
On Mon, Mar 18, 2013 at 2:21 PM, Andrei Alexandrescu < SeeWebsiteForEmail erdani.org> wrote:Could you please go into details on the debugging and benchmarking tools? Thanks.Hi Andrei, Apologies for not replying sooner. Perhaps it is actually just the "feel" of the debugging and benchmarking, and the general completeness of the *documentation*. This set of slides: http://talks.golang.org/2012/simple.slide introduces pretty much everything you need to know about Go. Graphs that show memory allocation by which function allocated, and the time taken of each function (d has a way to get the data as Walter points out). Ah the profiling was only mentioned in that slide set. The profiling doc is here: http://blog.golang.org/2011/06/profiling-go-programs.html It is all super easy, and documented so that you can do it now. All in one place. And I think possibly the most important thing about it is that it does what it says. The standard library all works together as a whole. Another thing which is different and makes Go easier or faster to pick up is that there is often only one way to do something. D excels in allowing a multitude of ways to do things. Do you know of any all encompassing slide set of document that one can pick up the information contained in http://talks.golang.org/2012/simple.slide? Is there an equivalent to http://blog.golang.org/2011/06/profiling-go-programs.html?
Mar 25 2013
On 3/25/13 8:02 AM, Rory McGuire wrote:Perhaps it is actually just the "feel" of the debugging and benchmarking, and the general completeness of the *documentation*. This set of slides: http://talks.golang.org/2012/simple.slide introduces pretty much everything you need to know about Go. Graphs that show memory allocation by which function allocated, and the time taken of each function (d has a way to get the data as Walter points out). Ah the profiling was only mentioned in that slide set. The profiling doc is here: http://blog.golang.org/2011/06/profiling-go-programs.html It is all super easy, and documented so that you can do it now. All in one place. And I think possibly the most important thing about it is that it does what it says. The standard library all works together as a whole. Another thing which is different and makes Go easier or faster to pick up is that there is often only one way to do something. D excels in allowing a multitude of ways to do things. Do you know of any all encompassing slide set of document that one can pick up the information contained in http://talks.golang.org/2012/simple.slide? Is there an equivalent to http://blog.golang.org/2011/06/profiling-go-programs.html?Thanks, Rory, these are good reads. We should get some articles too, we definitely have most of the technical pieces in place! Andrei
Mar 25 2013
On 3/25/2013 5:02 AM, Rory McGuire wrote:The profiling doc is here: http://blog.golang.org/2011/06/profiling-go-programs.html It is all super easy, and documented so that you can do it now.What it says about profiling: "To start tuning the Go program, we have to enable profiling. If the code used the Go testing package's benchmarking support, we could use gotest's standard -cpuprofile and -memprofile flags. In a standalone program like this one, we have to import runtime/pprof and add a few lines of code:" [... bunch of code you have to copy/pasta in ...] "After adding that code, we can run the program with the new -cpuprofile flag and then run gopprof to interpret the profile." How to do profiling with the dmd D compiler: 1. Add the -profile switch to the command line. 2. Read the report generated. To do coverage analysis: 1. Add the -cov switch to the command line. 2. Read the report generated. That's it.
Mar 25 2013
On 3/25/13 10:43 PM, Walter Bright wrote:On 3/25/2013 5:02 AM, Rory McGuire wrote:We need an article on that. AndreiThe profiling doc is here: http://blog.golang.org/2011/06/profiling-go-programs.html It is all super easy, and documented so that you can do it now.What it says about profiling: "To start tuning the Go program, we have to enable profiling. If the code used the Go testing package's benchmarking support, we could use gotest's standard -cpuprofile and -memprofile flags. In a standalone program like this one, we have to import runtime/pprof and add a few lines of code:" [... bunch of code you have to copy/pasta in ...] "After adding that code, we can run the program with the new -cpuprofile flag and then run gopprof to interpret the profile." How to do profiling with the dmd D compiler: 1. Add the -profile switch to the command line. 2. Read the report generated. To do coverage analysis: 1. Add the -cov switch to the command line. 2. Read the report generated. That's it.
Mar 25 2013
Whether it is Go or D, I wish one of you guys would fill the gap between the numeric work I need to do in fortran and the ui/string parsing/web work/plotting/animating I do in python. While working in two languages is realistically not a huge deal, it would be nice if there was something that bridged the gap for all of us people out there writing stuff for science so that we could just learn one and be done with it. the day a D program can begin with "import SciD; import Dplot;", and progress to "matrix.invert();" and "surf(matrix);", I will ditch both python and Go. I am being incredibly self-serving and am half-kidding on this post since other people use D for all sorts of other things and they probably outnumber me. Still, I would love to see a compiled language implement numeric libraries that worked as fluidly as numpy and matplotlib work with python. One reason I prefer D over Go is that the D community is so incredibly nice :)
Mar 25 2013
That's julia's(http://julialang.org/) goal, but of course it's not nearly polished. I'm interested in this as well, since I'm not totally comfortable about using a pirated MATLAB version and I hear that numpy can't match its performance on "macro" code.
Mar 25 2013
On Tuesday, 26 March 2013 at 04:11:05 UTC, Geancarlo Rocha wrote:That's julia's(http://julialang.org/) goal, but of course it's not nearly polished. I'm interested in this as well, since I'm not totally comfortable about using a pirated MATLAB version and I hear that numpy can't match its performance on "macro" code.I have heard of Julia and have not really messed with it yet for the reason you mentioned (it being in its early stages). I used MATLAB for a about a year before switching to numpy full time. I would totally recommend it. The performance loss (which I am not sure is actually there in all problems being solved) is really not that big of a deal unless you are doing some pretty heavy math, in which case MATLAB is slow compared to using C or fortran anyway. Another great thing is that numpy shares a lot of the same syntax as MATLAB, so the switch is fairly painless. If it were just numeric stuff, fortran would work okay (albeit it is a chore). I have a small collection of libraries I have written so I can execute MATLAB-esque commands for creating vectors and doing basic plotting. For example, this works: call linspace(0, pi, 100, x) y = sin(x) call plot2d(x,y) It's not the cleanest looking thing, but its better than doing it from scratch every time :P What if I wanted to plot a surface? Well, I need to write another fortran subroutine for that (which I have). The point is, it gets old having to write subroutines to do every little thing. Calculating an exponential integral requires me to link to the SLATEC library while MATLAB will do it with expint(x). There are so many things that are commonly used in numeric programming and not standard in fortran (or any compiled language). Is there some rule that only scripting languages are allowed to do these sorts of things easily? I would LOVE to see a compiled language that ran on par with C or fortran and had libraries that executed as cleanly as numpy and matplotlib do.
Mar 25 2013
On Tue, Mar 26, 2013 at 4:43 AM, Walter Bright <newshound2 digitalmars.com>wrote:How to do profiling with the dmd D compiler: 1. Add the -profile switch to the command line. 2. Read the report generated. To do coverage analysis: 1. Add the -cov switch to the command line. 2. Read the report generated. That's it.Hi Walter, Thanks I remember about the -profile switch but I don't see memory usage there. If you see your program using more and more memory even though it should not be how do you check where the problem is? In Go you generate a graph that shows the relationship between the various function calls their memory use and cpu time. Its not a flashy graph I think they use graphviz or something. What would I use in D to profile heap usage? Would I be able to find the problem area as quickly?
Mar 26 2013
26-Mar-2013 13:38, Rory McGuire пишет:On Tue, Mar 26, 2013 at 4:43 AM, Walter Bright <newshound2 digitalmars.com <mailto:newshound2 digitalmars.com>> wrote: How to do profiling with the dmd D compiler: 1. Add the -profile switch to the command line. 2. Read the report generated. To do coverage analysis: 1. Add the -cov switch to the command line. 2. Read the report generated. That's it. Hi Walter, Thanks I remember about the -profile switch but I don't see memory usage there. If you see your program using more and more memory even though it should not be how do you check where the problem is? In Go you generate a graph that shows the relationship between the various function calls their memory use and cpu time. Its not a flashy graph I think they use graphviz or something. What would I use in D to profile heap usage? Would I be able to find the problem area as quickly?What everybody in all other native languages use, for instance: valgrind --tool=massif, valgrind --tool=callgrind Any general purpose profiler works. I can confirm that e.g. AMD CodeAnalyst works just fine if application is compiled with symbols. Intel's Vtune also should work as well as many opensource tools. -- Dmitry Olshansky
Mar 26 2013
On 2013-03-26 10:49, Dmitry Olshansky wrote:What everybody in all other native languages use, for instance: valgrind --tool=massif, valgrind --tool=callgrind Any general purpose profiler works. I can confirm that e.g. AMD CodeAnalyst works just fine if application is compiled with symbols. Intel's Vtune also should work as well as many opensource tools.On Mac OS X there's Instruments. There's also dtrace. -- /Jacob Carlborg
Mar 26 2013
On 3/26/2013 2:38 AM, Rory McGuire wrote:Thanks I remember about the -profile switch but I don't see memory usage there.-profile and -cov do not track memory usage.If you see your program using more and more memory even though it should not be how do you check where the problem is?I've written memory usage profilers before, but haven't done one for D. You're the first to ask for one.What would I use in D to profile heap usage? Would I be able to find theproblem area as quickly? What you can do is use -cov and see how often particular calls to new are done. This will give a pretty good clue as to where memory consumption is coming from.
Mar 26 2013
On 3/26/2013 3:04 AM, Walter Bright wrote:On 3/26/2013 2:38 AM, Rory McGuire wrote:Now that I think about it, it wouldn't be that hard to add memory allocated per function when using -profile. But my larger point is how simple it is to use -cov and -profile; it's hard to imagine it being any easier.Thanks I remember about the -profile switch but I don't see memory usage there.-profile and -cov do not track memory usage.If you see your program using more and more memory even though it should not be how do you check where the problem is?I've written memory usage profilers before, but haven't done one for D. You're the first to ask for one.
Mar 26 2013
On Tuesday, 26 March 2013 at 10:08:30 UTC, Walter Bright wrote:On 3/26/2013 3:04 AM, Walter Bright wrote:Something like this? http://visualvm.java.net/features.htmlOn 3/26/2013 2:38 AM, Rory McGuire wrote:Now that I think about it, it wouldn't be that hard to add memory allocated per function when using -profile. But my larger point is how simple it is to use -cov and -profile; it's hard to imagine it being any easier.Thanks I remember about the -profile switch but I don't see memory usage there.-profile and -cov do not track memory usage.If you see your program using more and more memory even though it should not be how do you check where the problem is?I've written memory usage profilers before, but haven't done one for D. You're the first to ask for one.
Mar 26 2013
On Sunday, 17 March 2013 at 08:57:48 UTC, Walter Bright wrote:I'd like to add that D has: - operator overloading - user defined attributes - dll's (coming soon)So it doesn't.- vector operations - SIMD operations - scope guard - compile time function execution - true immutability and purityIt isn't guaranteed by the current type system.- inline assemblerIf you use some of the mentioned above features, resources required to compile can explode dramatically.Their talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that.Andrei did some tests a while back showing that D compiles considerably faster than Go. High compilation speed has been a major factor among companies who have adopted D.
Mar 17 2013
On Sun, 2013-03-17 at 09:17 +0100, Paulo Pinto wrote: [=E2=80=A6]The first known one is that Go is the only strong typed language to=20 eschew generics in the 21st century.On the other hand, perhaps generics is not a good thing, yet has created an unchallenged mindset? NB I am tainted by C++ templates and generics has much less of a problem here, and Scala hacks it's way around it. Also I use Python a lot which has only one variable type, reference to object. Heterogeneity is not your enemy. I like the experiment of objects as values with methods added as needed, very Pythonic. Go even makes this static compile time type checked; though I think they miss the underlying irony of this. Far too many "object oriented" languages have forgotten that the computational model is one of sending messages to objects asking them to undertake a behaviour. Statically typed languages constrain objects not to be able to evolve their behaviours.For the rest, copying from my discussion on Lambda the Ultimate about=20 C++ developers not jumping into Go=20 (http://lambda-the-ultimate.org/node/4554#comment-71504): =20 - exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party==20code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that==20similar features do exist as libraries for other languagesGo is a stripped down C with stronger type checking. memory management and CSP. This actually makes it an important language in the scheme of things, even if I agree with you that in so many way it is a regression into the 1960s. The major problem for all statically compiled languages is the reliance on hardware integers.I know you can fake enumerations with typed consts, but it is not the=20 same thing as real enumerations.On the other hand C and C++ enumerations are just syntactic sugar for the same thing so not real difference. In fact exactly the opposite, they are a delusion. Conversely Java enumerations are a bit heavyweight.My point about direct OS APIs is that while D and Rust follow the=20 approach used by other languages where you just declare bindings, Go=20 forces the use of the CGO tool and a C compiler that speaks Go ABI.I guess this is because of the segmented stacks architecture behind the realization of Go.Their talk about fast compilation is also quite effective with young=20 developers that did not grew up with Modula-2 and Mac/Turbo Pascal or=20 using other compiled languages with modules, so they think Go is the=20 first compiled language to offer that. =20 Feel free to destroy. :)Far from it. I think Go is a significant improvement over C, but that in 2013 applications programmers should be using something better. I continue to be surprised by Python people moving to Go. The only "positive" for Go is goroutines. Python's GIL's days are numbered at which point even that issue goes away. The issue is then how to make D appealing to Python programmers. People need to convince me why I should stop training people to use Python. This will be hard given that C/C++/Python is now the standard model for computational systems. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 17 2013
On 17.03.2013 11:01, Russel Winder wrote:On Sun, 2013-03-17 at 09:17 +0100, Paulo Pinto wrote: […]I think for static strong type languages you need some kind of genericity support like generics, parametric types or similar. There are many other ways to implement them. Eiffel, Modula-3, Ada and many other strong type languages also offer generics. Interfaces are halfway there, because if you are not allowed to use operators as functions, then there is always the need to write boilerplate code, even for basic types. Dynamic type languages don't require this of course, given the way their type systems work.The first known one is that Go is the only strong typed language to eschew generics in the 21st century.On the other hand, perhaps generics is not a good thing, yet has created an unchallenged mindset? NB I am tainted by C++ templates and generics much less of a problem here, and Scala hacks it's way around it. Also I use Python a lot which has only one variable type, reference to object. Heterogeneity is not your enemy. I like the experiment of objects as values with methods added as needed, very Pythonic. Go even makes this static compile time type checked; though I think they miss the underlying irony of this.Far too many "object oriented" languages have forgotten that the computational model is one of sending messages to objects asking them to undertake a behaviour. Statically typed languages constrain objects not to be able to evolve their behaviours.I might be brain damaged here, because I used OO in Object Pascal, C++, So I don't see the mainstream enterprise OO way of doing things as the only way of how OO is supposed to be. Sadly most developers in the enterprise world lack this kind of understanding and write the type of code that gives bad name to OO.Here they follow Niklaus Wirth, which I admire, school of though. When he went out to create Oberon, he decided to remove all language features he did not consider essential in a programming language. Actually all the successors, Oberon-2, Component Pascal and Active Oberon were created by his students or collaborators. In 2011 the last Oberon language report, Oberon-07, removes even a few more features. On his talk at HOPL-3 he recognizes that the industry did not follow his appreciation for smaller languages. http://www.inf.ethz.ch/personal/wirth/Articles/Modula-Oberon-June.pdf Go seems to be heading this way, as Rob Pike already wrote a blog entry about the same issue, where he mentions that Go only attracts Ruby and Python guys, but not the C++ one he expected to attract. Although I am a big fan of the Oberon operating systems and languages, I think we are no longer in the late 90's, and given the mainstream acceptance of many features that used to be only academic, why throw them away? Go's workarounds for lack of generics remind me of the time C++ still lacked generics and there were a few pre-processor tools to generate generic code. Borland used to ship one in their compilers. I don't miss those days.For the rest, copying from my discussion on Lambda the Ultimate about C++ developers not jumping into Go (http://lambda-the-ultimate.org/node/4554#comment-71504): - exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languagesGo is a stripped down C with stronger type checking. memory management and CSP. This actually makes it an important language in the scheme of things, even if I agree with you that in so many way it is a regression into the 1960s.The major problem for all statically compiled languages is the reliance on hardware integers.I prefer the enumerations the Pascal away, similar to what Java and .NET offer with primitives for generic manipulation of values.I know you can fake enumerations with typed consts, but it is not the same thing as real enumerations.On the other hand C and C++ enumerations are just syntactic sugar for the same thing so not real difference. In fact exactly the opposite, they are a delusion. Conversely Java enumerations are a bit heavyweight.Me too.My point about direct OS APIs is that while D and Rust follow the approach used by other languages where you just declare bindings, Go forces the use of the CGO tool and a C compiler that speaks Go ABI.I guess this is because of the segmented stacks architecture behind the realization of Go.Their talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that. Feel free to destroy. :)Far from it. I think Go is a significant improvement over C, but that in 2013 applications programmers should be using something better. I continue to be surprised by Python people moving to Go. The only "positive" for Go is goroutines. Python's GIL's days are numbered at which point even that issue goes away.The issue is then how to make D appealing to Python programmers. People need to convince me why I should stop training people to use Python. This will be hard given that C/C++/Python is now the standard model for computational systems.Actually I think the day PyPy becomes the main Python implementation there is hardly the need for Python developers to write C or C++ code. -- Paulo
Mar 17 2013
On 03/17/2013 07:09 AM, Paulo Pinto wrote:On 17.03.2013 11:01, Russel Winder wrote:The day I can compile pypy without needing 8Gb of memory is the day I'll consider it.On Sun, 2013-03-17 at 09:17 +0100, Paulo Pinto wrote: […]I think for static strong type languages you need some kind of genericity support like generics, parametric types or similar. There are many other ways to implement them. Eiffel, Modula-3, Ada and many other strong type languages also offer generics. Interfaces are halfway there, because if you are not allowed to use operators as functions, then there is always the need to write boilerplate code, even for basic types. Dynamic type languages don't require this of course, given the way their type systems work.The first known one is that Go is the only strong typed language to eschew generics in the 21st century.On the other hand, perhaps generics is not a good thing, yet has created an unchallenged mindset? NB I am tainted by C++ templates and generics much less of a problem here, and Scala hacks it's way around it. Also I use Python a lot which has only one variable type, reference to object. Heterogeneity is not your enemy. I like the experiment of objects as values with methods added as needed, very Pythonic. Go even makes this static compile time type checked; though I think they miss the underlying irony of this.Far too many "object oriented" languages have forgotten that the computational model is one of sending messages to objects asking them to undertake a behaviour. Statically typed languages constrain objects not to be able to evolve their behaviours.I might be brain damaged here, because I used OO in Object Pascal, C++, So I don't see the mainstream enterprise OO way of doing things as the only way of how OO is supposed to be. Sadly most developers in the enterprise world lack this kind of understanding and write the type of code that gives bad name to OO.Here they follow Niklaus Wirth, which I admire, school of though. When he went out to create Oberon, he decided to remove all language features he did not consider essential in a programming language. Actually all the successors, Oberon-2, Component Pascal and Active Oberon were created by his students or collaborators. In 2011 the last Oberon language report, Oberon-07, removes even a few more features. On his talk at HOPL-3 he recognizes that the industry did not follow his appreciation for smaller languages. http://www.inf.ethz.ch/personal/wirth/Articles/Modula-Oberon-June.pdf Go seems to be heading this way, as Rob Pike already wrote a blog entry about the same issue, where he mentions that Go only attracts Ruby and Python guys, but not the C++ one he expected to attract. Although I am a big fan of the Oberon operating systems and languages, I think we are no longer in the late 90's, and given the mainstream acceptance of many features that used to be only academic, why throw them away? Go's workarounds for lack of generics remind me of the time C++ still lacked generics and there were a few pre-processor tools to generate generic code. Borland used to ship one in their compilers. I don't miss those days.For the rest, copying from my discussion on Lambda the Ultimate about C++ developers not jumping into Go (http://lambda-the-ultimate.org/node/4554#comment-71504): - exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languagesGo is a stripped down C with stronger type checking. memory management and CSP. This actually makes it an important language in the scheme of things, even if I agree with you that in so many way it is a regression into the 1960s.The major problem for all statically compiled languages is the reliance on hardware integers.I prefer the enumerations the Pascal away, similar to what Java and .NET offer with primitives for generic manipulation of values.I know you can fake enumerations with typed consts, but it is not the same thing as real enumerations.On the other hand C and C++ enumerations are just syntactic sugar for the same thing so not real difference. In fact exactly the opposite, they are a delusion. Conversely Java enumerations are a bit heavyweight.Me too.My point about direct OS APIs is that while D and Rust follow the approach used by other languages where you just declare bindings, Go forces the use of the CGO tool and a C compiler that speaks Go ABI.I guess this is because of the segmented stacks architecture behind the realization of Go.Their talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that. Feel free to destroy. :)Far from it. I think Go is a significant improvement over C, but that in 2013 applications programmers should be using something better. I continue to be surprised by Python people moving to Go. The only "positive" for Go is goroutines. Python's GIL's days are numbered at which point even that issue goes away.The issue is then how to make D appealing to Python programmers. People need to convince me why I should stop training people to use Python. This will be hard given that C/C++/Python is now the standard model for computational systems.Actually I think the day PyPy becomes the main Python implementation there is hardly the need for Python developers to write C or C++ code. -- Paulo
Mar 17 2013
Am 17.03.2013 20:28, schrieb 1100110:On 03/17/2013 07:09 AM, Paulo Pinto wrote:Uau, that much?! I tend to use Python only for shell scripting type of tasks, so I wasn't aware that PyPy is so memory hungry. -- PauloOn 17.03.2013 11:01, Russel Winder wrote:The day I can compile pypy without needing 8Gb of memory is the day I'll consider it.On Sun, 2013-03-17 at 09:17 +0100, Paulo Pinto wrote: […]I think for static strong type languages you need some kind of genericity support like generics, parametric types or similar. There are many other ways to implement them. Eiffel, Modula-3, Ada and many other strong type languages also offer generics. Interfaces are halfway there, because if you are not allowed to use operators as functions, then there is always the need to write boilerplate code, even for basic types. Dynamic type languages don't require this of course, given the way their type systems work.The first known one is that Go is the only strong typed language to eschew generics in the 21st century.On the other hand, perhaps generics is not a good thing, yet has created an unchallenged mindset? NB I am tainted by C++ templates and generics much less of a problem here, and Scala hacks it's way around it. Also I use Python a lot which has only one variable type, reference to object. Heterogeneity is not your enemy. I like the experiment of objects as values with methods added as needed, very Pythonic. Go even makes this static compile time type checked; though I think they miss the underlying irony of this.Far too many "object oriented" languages have forgotten that the computational model is one of sending messages to objects asking them to undertake a behaviour. Statically typed languages constrain objects not to be able to evolve their behaviours.I might be brain damaged here, because I used OO in Object Pascal, C++, languages. So I don't see the mainstream enterprise OO way of doing things as the only way of how OO is supposed to be. Sadly most developers in the enterprise world lack this kind of understanding and write the type of code that gives bad name to OO.Here they follow Niklaus Wirth, which I admire, school of though. When he went out to create Oberon, he decided to remove all language features he did not consider essential in a programming language. Actually all the successors, Oberon-2, Component Pascal and Active Oberon were created by his students or collaborators. In 2011 the last Oberon language report, Oberon-07, removes even a few more features. On his talk at HOPL-3 he recognizes that the industry did not follow his appreciation for smaller languages. http://www.inf.ethz.ch/personal/wirth/Articles/Modula-Oberon-June.pdf Go seems to be heading this way, as Rob Pike already wrote a blog entry about the same issue, where he mentions that Go only attracts Ruby and Python guys, but not the C++ one he expected to attract. Although I am a big fan of the Oberon operating systems and languages, I think we are no longer in the late 90's, and given the mainstream acceptance of many features that used to be only academic, why throw them away? Go's workarounds for lack of generics remind me of the time C++ still lacked generics and there were a few pre-processor tools to generate generic code. Borland used to ship one in their compilers. I don't miss those days.For the rest, copying from my discussion on Lambda the Ultimate about C++ developers not jumping into Go (http://lambda-the-ultimate.org/node/4554#comment-71504): - exceptions; - enumerations; - generic types; - direct use of OS APIs, without the need of writing wrappers; - currently only static compilation is available; - due to static compilation only model, there are issues with 3rd party code; - no support for meta-programming; - rich set of available libraries; - the PR about go routines and channels, usually forgets to mention that similar features do exist as libraries for other languagesGo is a stripped down C with stronger type checking. memory management and CSP. This actually makes it an important language in the scheme of things, even if I agree with you that in so many way it is a regression into the 1960s.The major problem for all statically compiled languages is the reliance on hardware integers.I prefer the enumerations the Pascal away, similar to what Java and .NET offer with primitives for generic manipulation of values.I know you can fake enumerations with typed consts, but it is not the same thing as real enumerations.On the other hand C and C++ enumerations are just syntactic sugar for the same thing so not real difference. In fact exactly the opposite, they are a delusion. Conversely Java enumerations are a bit heavyweight.Me too.My point about direct OS APIs is that while D and Rust follow the approach used by other languages where you just declare bindings, Go forces the use of the CGO tool and a C compiler that speaks Go ABI.I guess this is because of the segmented stacks architecture behind the realization of Go.Their talk about fast compilation is also quite effective with young developers that did not grew up with Modula-2 and Mac/Turbo Pascal or using other compiled languages with modules, so they think Go is the first compiled language to offer that. Feel free to destroy. :)Far from it. I think Go is a significant improvement over C, but that in 2013 applications programmers should be using something better. I continue to be surprised by Python people moving to Go. The only "positive" for Go is goroutines. Python's GIL's days are numbered at which point even that issue goes away.The issue is then how to make D appealing to Python programmers. People need to convince me why I should stop training people to use Python. This will be hard given that C/C++/Python is now the standard model for computational systems.Actually I think the day PyPy becomes the main Python implementation there is hardly the need for Python developers to write C or C++ code. -- Paulo
Mar 17 2013
On Sun, 2013-03-17 at 22:13 +0100, Paulo Pinto wrote:Am 17.03.2013 20:28, schrieb 1100110:[=E2=80=A6]lThe day I can compile pypy without needing 8Gb of memory is the day I'l==20consider it.=20 Uau, that much?! =20 I tend to use Python only for shell scripting type of tasks, so I wasn't=aware that PyPy is so memory hungry.Using PyPy to execute Python scripts is not the problem, that is fast and efficient. 1100110 stated that it took 8GB to compile the PyPy system in his experience. Most people will never need to do that. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 18 2013
On Monday, 18 March 2013 at 09:18:38 UTC, Russel Winder wrote:On Sun, 2013-03-17 at 22:13 +0100, Paulo Pinto wrote:Yeah, you are right. Compiling Firefox will even require more than that.Am 17.03.2013 20:28, schrieb 1100110:[…]Using PyPy to execute Python scripts is not the problem, that is fast and efficient. 1100110 stated that it took 8GB to compile the PyPy system in his experience. Most people will never need to do that.The day I can compile pypy without needing 8Gb of memory is the day I'll consider it.Uau, that much?! I tend to use Python only for shell scripting type of tasks, so I wasn't aware that PyPy is so memory hungry.
Mar 18 2013
On 3/17/2013 3:01 AM, Russel Winder wrote:I guess this is because of the segmented stacks architecture behind the realization of Go.Segmented stacks have a significant performance cost to them, as well as making it hard to interface to other languages. I also think that the shift to 64 bits makes them obsolete anyway.
Mar 17 2013
Am 17.03.2013 21:56, schrieb Walter Bright:On 3/17/2013 3:01 AM, Russel Winder wrote:If I am not mistaken, Rust makes use of them as well.I guess this is because of the segmented stacks architecture behind the realization of Go.Segmented stacks have a significant performance cost to them, as well as making it hard to interface to other languages. I also think that the shift to 64 bits makes them obsolete anyway.
Mar 17 2013
On Sunday, 17 March 2013 at 21:13:48 UTC, Paulo Pinto wrote:If I am not mistaken, Rust makes use of them as well.Rust doesn't anymore: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006314.html The announcement also mentions performance problems related to Go segmented stacks: https://docs.google.com/document/d/1wAaf1rYoM4S4gtnPh0zOlGzWtrZFQ5suE8qr2sD8uWQ/pub
Nov 05 2013
On Sun, 2013-03-17 at 13:56 -0700, Walter Bright wrote:On 3/17/2013 3:01 AM, Russel Winder wrote:making=20I guess this is because of the segmented stacks architecture behind the realization of Go.=20 Segmented stacks have a significant performance cost to them, as well as =it hard to interface to other languages. I also think that the shift to 6=4 bits=20makes them obsolete anyway.I think this is possibly not the case or Go and Rust would not have gone this route =E2=80=93 which is the imperative native code equivalent of what= the functional languages and the dynamic languages do using the heap. The problem is to not have a single stack so that it becomes easy to manage 1,000+ threads within a single process. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Mar 18 2013
On 3/18/2013 2:22 AM, Russel Winder wrote:On Sun, 2013-03-17 at 13:56 -0700, Walter Bright wrote:That's just not an issue when you have 64 bits of address space. You can still have 4 billion stacks of 4 billion bytes each.On 3/17/2013 3:01 AM, Russel Winder wrote:I think this is possibly not the case or Go and Rust would not have gone this route – which is the imperative native code equivalent of what the functional languages and the dynamic languages do using the heap. The problem is to not have a single stack so that it becomes easy to manage 1,000+ threads within a single process.I guess this is because of the segmented stacks architecture behind the realization of Go.Segmented stacks have a significant performance cost to them, as well as making it hard to interface to other languages. I also think that the shift to 64 bits makes them obsolete anyway.
Mar 18 2013
Walter Bright:That's just not an issue when you have 64 bits of address space. You can still have 4 billion stacks of 4 billion bytes each.At this point I suggest you to study exactly why Rust developers have decided to use a segmented stack. It seems to work well for them. Bye, bearophile
Mar 18 2013
On 3/18/2013 3:25 AM, bearophile wrote:Walter Bright:If you know a reason, please post one.That's just not an issue when you have 64 bits of address space. You can still have 4 billion stacks of 4 billion bytes each.At this point I suggest you to study exactly why Rust developers have decided to use a segmented stack. It seems to work well for them.
Mar 18 2013
On Monday, 18 March 2013 at 19:05:09 UTC, Walter Bright wrote:On 3/18/2013 3:25 AM, bearophile wrote:I believe the Rust developers are also targeting embedded systems that may not have 64-bit virtual address spaces. Hence the spaghetti stacks.Walter Bright:If you know a reason, please post one.That's just not an issue when you have 64 bits of address space. You can still have 4 billion stacks of 4 billion bytes each.At this point I suggest you to study exactly why Rust developers have decided to use a segmented stack. It seems to work well for them.
Aug 31 2013
18-Mar-2013 14:25, bearophile пишет:Walter Bright:Walter's position is crystal clear. IMHO virtual memory was designed among other things to avoid piecing together segmented memory blocks by hand. Memory manager (OS) will od the whole dirty work for you and even hardware assists the process resulting in decent speed and complete transparency of operation. Why destroy this marvelous creation of hardware and OS developers? The whole segmented stack thing smells a lot like good ol' 16-bit days and is a step backwards unless you assume that: a) There is no virtual memory i.e. no MMU. Well, some MCU units are still like this but the trend goes towards having MMU even on tiny chips. b) Virtual ram / physical ram relation is close to 1 or even worse, like in 32-bit OS running on 8G desktops. As for virtual memory to be truly exploitable address space better be many times the total ram, the more the better. Both cases do not seem likely to be related to the future technology like at all.That's just not an issue when you have 64 bits of address space. You can still have 4 billion stacks of 4 billion bytes each.At this point I suggest you to study exactly why Rust developers have decided to use a segmented stack. It seems to work well for them.Bye, bearophile-- Dmitry Olshansky
Mar 18 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dThis can see the D language is very good, I like the D language
Mar 17 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dYour first Rust example has "100.times" instead of "10.times". Is factorial really a built-in Rust function?? If so, the text should say so. Might perhaps be worth noting that thread-local variables are built-in in D, so that D's support for threads is not entirely library-based. The core language is aware of threads, but thread creation etc is library based.
Mar 18 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:http://versusit.org/rust-vs-dI just saw this post on the Rust subreddit: http://www.reddit.com/r/rust/comments/1agj5i/rust_vs_dlang_d_programming_ anguage_discussion/ (that is, oddly, linking to this discussion and not the original post), and was very confused by the "Rust" code. Quoting kibwen on Reddit, "Not only are the Rust snippets using ancient 0.0 syntax, they are written such that they would never compile in the first place." The io module isn't in std, integers don't have a .times method (that I know about, anyway), "alt" is now "match" (I think), and there is no "try".
Mar 18 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dI don't know if you still follow this, but there's a typo here: Now, let’s see, how the code, outputting the word "Hello" 10 times, will look. In Rust it will look like this: fn main() { for 100.times { ... Should be: ... for 10.times { ... Also, the formatting still sucks and imports are missing for the D code, whereas imports are verbosely stated in Rust. FWIW, "std::io::println" can be stated as just "println", since it's available by default. Don't know if this was the case when you wrote the post though... Also, you don't mention the difference between D and Rust in switch statements (FWIW, Rust doesn't have switch statements, they're now "match" statements, which are closer to haskell's case statements than D's switch, because D's switch has optional fallthrough (goto case;) and Rust has no fallthrough. Also, I second the objection to your exception example. D does have exceptions and there are some very important differences between them and Rust's exception handling (which is more like Go's recover() than D's catch).
Aug 17 2013
On Saturday, 16 March 2013 at 14:42:58 UTC, Suliman wrote:Hi folks! I had wrote small article about Rust vs D. I hope that you will like it! http://versusit.org/rust-vs-dThere is more online activity in Rust vs. D corner. See http://relistan.com/a-week-with-mozilla-rust/, which is about Rust, but commentators inevitably end up making comparisons with D. More discussion on reddit: http://www.reddit.com/r/programming/comments/1kub90/a_week_with_mozillas_rust/.
Aug 23 2013