Carmack about static analysis

2011-12-24 Thread bearophile
A new blog post by the very good John Carmack, I like how well readable this post is: http://altdevblogaday.com/2011/12/24/static-code-analysis/ If you don't know who he is: http://en.wikipedia.org/wiki/John_Carmack Beside the main point of the article that is to use more static analysis tools,

Re: Carmack about static analysis

2011-12-24 Thread Adam D. Ruppe
On Saturday, 24 December 2011 at 12:42:41 UTC, bearophile wrote: Printf format string errors were the second biggest issue in A problem that people didn't want to reduce in D. printf and writef are entirely different beasts.

Re: Carmack about static analysis

2011-12-24 Thread Derek
On Sat, 24 Dec 2011 23:42:41 +1100, bearophile wrote: A new blog post by the very good John Carmack, I like how well readable this post is: http://altdevblogaday.com/2011/12/24/static-code-analysis/ ... human minds and the logic of lint programs are two cognitive (or pre-cognitive) syste

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/2011 06:42 AM, bearophile wrote: A new blog post by the very good John Carmack, I like how well readable this post is: http://altdevblogaday.com/2011/12/24/static-code-analysis/ Nice! One nice snippet that I can't quote strongly enough: "Automation is necessary. It is common to take

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/2011 09:11 AM, Derek wrote: On Sat, 24 Dec 2011 23:42:41 +1100, bearophile wrote: In theory functional-style is a good to shrink the code, but in D functional-style code is a jungle of (({}){()}) so it's hard to write and hard to read. As I mentioned once, the proposition of writing

Re: Carmack about static analysis

2011-12-24 Thread Jakob Ovrum
On Saturday, 24 December 2011 at 15:33:04 UTC, Andrei Alexandrescu wrote: Anyhow, is there anything you have in mind that we have the chance of improving at this point? Thanks, Andrei For one, we should follow up on: foo!(a => a * 2)(bar); vs. foo!((a) { return a * 2; })(bar);

Re: Carmack about static analysis

2011-12-24 Thread Derek
On Sun, 25 Dec 2011 02:33:01 +1100, Andrei Alexandrescu wrote: We recently discussed this a bit in connection with the standard library. It definitely could be written in a manner that is easier to understand for the more casual reader, but that would mean reducing the capabilities (e.g

Re: Carmack about static analysis

2011-12-24 Thread Jacob Carlborg
On 2011-12-24 13:42, bearophile wrote: There was a paper recently that noted that all of the various code quality metrics correlated at least as strongly with code size as error rate, making code size alone give essentially the same error predicting ability. Shrink your important code.< In

Re: Carmack about static analysis

2011-12-24 Thread Walter Bright
On 12/24/2011 6:35 AM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 12:42:41 UTC, bearophile wrote: Printf format string errors were the second biggest issue in A problem that people didn't want to reduce in D. printf and writef are entirely different beasts. D's charter is not to

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/2011 11:30 AM, Walter Bright wrote: On 12/24/2011 6:35 AM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 12:42:41 UTC, bearophile wrote: Printf format string errors were the second biggest issue in A problem that people didn't want to reduce in D. printf and writef are entir

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/11 9:45 AM, Jakob Ovrum wrote: On Saturday, 24 December 2011 at 15:33:04 UTC, Andrei Alexandrescu wrote: Anyhow, is there anything you have in mind that we have the chance of improving at this point? Thanks, Andrei For one, we should follow up on: foo!(a => a * 2)(bar); vs. foo!

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/11 9:54 AM, Derek wrote: I'm sure you are totally correct; I'm not really a C++ coder. And I'm sure you also process the specialist/expert level of D knowledge to make reading contemporary D code a non-issue. Well I'm also a specialist in C++, actually more so than D as I have longer

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Andrei Alexandrescu: > the notion that people need to maintain, enhance, and modify a > large body of natural language text is quite foreign. http://www.wikipedia.org/ ? Bye, bearophile

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Derek Parnell: > But isn't lint written by humans? Right, but this doesn't mean a lot, because most programs don't work the same way humans and human brains think. >I'm under the impression that a //lint// program is an attempt to emulate a >very pedantic (if not anal-retentive) person who in

Re: Carmack about static analysis

2011-12-24 Thread Walter Bright
On 12/24/2011 12:38 PM, bearophile wrote: Andrei Alexandrescu: the notion that people need to maintain, enhance, and modify a large body of natural language text is quite foreign. http://www.wikipedia.org/ ? Wikipedia's text often shows an effect of maintenance similar to source code - add

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Andrei Alexandrescu: >Anyhow, is there anything you have in mind that we have the chance of >improving at this point?< Two things that I think are able to improve the D code (beside a shorter lambda syntax) are Python Lazy/eager array comps (I'd like to write a post about this...). If this is

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/11 2:55 PM, bearophile wrote: If this is not possible then I think introducing amap and afilter (that means array(map()) and array(filter())) in Phobos is able to remove several parentheses from my current D code. I've never gotten why you wouldn't define amap and afilter for your own

Re: Carmack about static analysis

2011-12-24 Thread Adam D. Ruppe
On Saturday, 24 December 2011 at 12:42:41 UTC, bearophile wrote: In theory functional-style is a good to shrink the code, but in D functional-style code is a jungle of (({}){()}) so it's hard to write and hard to read. I think code would have a lot fewer bugs if we forced all identifiers to

Re: Carmack about static analysis

2011-12-24 Thread Derek
On Sun, 25 Dec 2011 07:19:47 +1100, Andrei Alexandrescu wrote: On 12/24/11 9:54 AM, Derek wrote: I'm sure you are totally correct; I'm not really a C++ coder. And I'm sure you also process the specialist/expert level of D knowledge to make reading contemporary D code a non-issue. Well I'm

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Adam D. Ruppe: > I think code would have a lot fewer bugs if we forced all > identifiers > to be one character long. Then it'd be a lot shorter. I was talking about the abundance of (({}){()}) and not about identifiers length. When they think about code conciseness (that is quite correlated wit

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Andrei Alexandrescu: > I've never gotten why you wouldn't define amap and afilter for your own > code, thus avoiding parentheses. In D1 I did write a non-standard library to be used with Phobos. In D2 I'd like to avoid writing a dlibs2 that is used only by me. There are some functions that are

Re: Carmack about static analysis

2011-12-24 Thread Adam D. Ruppe
On Saturday, 24 December 2011 at 23:12:27 UTC, bearophile wrote: I was talking about the abundance of (({}){()}) and not about identifiers length. It's the same fallacy. I can't read Carmack's mind, but I'm sure he's talking about shortening code the same way I would mean it if I said it - simp

Re: Carmack about static analysis

2011-12-24 Thread Timon Gehr
On 12/25/2011 12:27 AM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:12:27 UTC, bearophile wrote: I was talking about the abundance of (({}){()}) and not about identifiers length. It's the same fallacy. Not really. Functional style code tends to be conceptually simpler. Having c

Re: Carmack about static analysis

2011-12-24 Thread bearophile
Adam D. Ruppe: > It's the same fallacy. I can't read Carmack's mind, but > I'm sure he's talking about shortening code the same way > I would mean it if I said it - simpler concepts, fewer cases, > less repetition. In a medium sized program there are many different ways to reduce redundancy and

Re: Carmack about static analysis

2011-12-24 Thread so
On Sun, 25 Dec 2011 01:51:57 +0200, bearophile wrote: But a problem is that such D code is full of braces and parentheses that make such code hard to read and write (I agree with Andrei that D is not very designed for such kind of code, but the fact doesn't change). Absolutely agree brac

Re: Carmack about static analysis

2011-12-24 Thread Adam D. Ruppe
On Saturday, 24 December 2011 at 23:44:11 UTC, Timon Gehr wrote: Functional style code tends to be conceptually simpler. I find bugs creep into things with lots of parameters or conditions. For instance: if((flag && request.isSomething()) || request.isSomethingElse()) {} If you have a lot o

Re: Carmack about static analysis

2011-12-24 Thread Adam D. Ruppe
On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote: Using certain abstractions sometimes helps to write one idea only once in a program. Etc. This is the biggest one, and applies to all kinds of code. I like to write little functions with meaningful names. bool isOdd(int i) { i

Re: Carmack about static analysis

2011-12-24 Thread Kapps
The two biggest things that I believe D would benefit from, in terms of readability, are UFCS and C#-style lambdas (which were already discussed). Something like 'array(find("test", select!("a.name")(filter!("a.num > 3")(Elements' Could be rewritten much cleaner as Elements.filter!"a.num > 3

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/2011 05:44 PM, Timon Gehr wrote: On 12/25/2011 12:27 AM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:12:27 UTC, bearophile wrote: I was talking about the abundance of (({}){()}) and not about identifiers length. It's the same fallacy. Not really. Functional style code

Re: Carmack about static analysis

2011-12-24 Thread Andrei Alexandrescu
On 12/24/2011 07:20 PM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote: Using certain abstractions sometimes helps to write one idea only once in a program. Etc. This is the biggest one, and applies to all kinds of code. I like to write little functions wi

Re: Carmack about static analysis

2011-12-24 Thread Chad J
On 12/24/2011 10:37 PM, Kapps wrote: > The two biggest things that I believe D would benefit from, in terms of > readability, are UFCS and C#-style lambdas (which were already discussed). > > Something like > 'array(find("test", select!("a.name")(filter!("a.num > 3")(Elements' > Could be rewri

Re: Carmack about static analysis

2011-12-25 Thread Kapps
Universal Function Call Syntax. C# calls them extension methods. Basically, the ability to call a method directly on a class (in the form of A.MyMethod) without it being declared in the class. Usually just a static/global method that gets rewritten. Instead of MyMethod(A), you can use A.MyMetho

Re: Carmack about static analysis

2011-12-25 Thread Chad J
On 12/25/2011 02:57 AM, Kapps wrote: > Universal Function Call Syntax. C# calls them extension methods. > Basically, the ability to call a method directly on a class (in the form > of A.MyMethod) without it being declared in the class. Usually just a > static/global method that gets rewritten. Inst

Re: Carmack about static analysis

2011-12-25 Thread SomeDude
On Saturday, 24 December 2011 at 20:19:48 UTC, Andrei Alexandrescu wrote: Analogies of programming language with human language are flawed and take nowhere interesting. The only text that gets close to the level of precision and non-ambiguity needed is legal text; reading any amount of legal te

Re: Carmack about static analysis

2011-12-25 Thread simendsjo
On 25.12.2011 00:44, Timon Gehr wrote: Not really. Functional style code tends to be conceptually simpler. Having code that is more readable can help. Getting rid of (({return {return}}){return()}) makes the code more readable, whereas excessively shortening identifiers does the opposite. See h

Re: Carmack about static analysis

2011-12-25 Thread Jacob Carlborg
On 2011-12-25 02:20, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote: Using certain abstractions sometimes helps to write one idea only once in a program. Etc. This is the biggest one, and applies to all kinds of code. I like to write little functions with

Re: Carmack about static analysis

2011-12-25 Thread Jacob Carlborg
On 2011-12-25 05:44, Andrei Alexandrescu wrote: On 12/24/2011 07:20 PM, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote: Using certain abstractions sometimes helps to write one idea only once in a program. Etc. This is the biggest one, and applies to all k

Re: Carmack about static analysis

2011-12-25 Thread Timon Gehr
On 12/25/2011 02:44 PM, simendsjo wrote: On 25.12.2011 00:44, Timon Gehr wrote: Not really. Functional style code tends to be conceptually simpler. Having code that is more readable can help. Getting rid of (({return {return}}){return()}) makes the code more readable, whereas excessively shorte

Re: Carmack about static analysis

2011-12-25 Thread Adam D. Ruppe
On Sunday, 25 December 2011 at 04:44:57 UTC, Andrei Alexandrescu wrote: I see every letter beyond this as a liability: Yeah, though like Jacob said, the implementation doesn't matter as much as the idea of giving it a name. But, if you're curious about why I wrote it long form, it's just a qui

Re: Carmack about static analysis

2011-12-25 Thread Timon Gehr
On 12/25/2011 11:53 PM, Timon Gehr wrote: On 12/25/2011 02:44 PM, simendsjo wrote: On 25.12.2011 00:44, Timon Gehr wrote: Not really. Functional style code tends to be conceptually simpler. Having code that is more readable can help. Getting rid of (({return {return}}){return()}) makes the cod

Re: Carmack about static analysis

2011-12-25 Thread bearophile
Timon Gehr: > > http://pastebin.com/C6vf9DQQ If possible I suggest to remove all the BigInt from the module, and put the bigint import into the main(): void main() { import std.bigint; auto h = hamming!BigInt(); writeln(take(20, h)); writeln(h()[1_691]); writeln(h()[1_000_00

Re: Carmack about static analysis

2011-12-25 Thread Timon Gehr
On 12/26/2011 12:30 AM, bearophile wrote: Timon Gehr: http://pastebin.com/C6vf9DQQ If possible I suggest to remove all the BigInt from the module, and put the bigint import into the main(): void main() { import std.bigint; auto h = hamming!BigInt(); writeln(take(20, h));

Re: Carmack about static analysis

2011-12-25 Thread Andrei Alexandrescu
On 12/25/11 5:13 PM, Adam D. Ruppe wrote: On Sunday, 25 December 2011 at 04:44:57 UTC, Andrei Alexandrescu wrote: I see every letter beyond this as a liability: Yeah, though like Jacob said, the implementation doesn't matter as much as the idea of giving it a name. But, if you're curious abou

Re: Carmack about static analysis

2011-12-25 Thread Jonathan M Davis
On Saturday, December 24, 2011 21:37:12 Kapps wrote: > The two biggest things that I believe D would benefit from, in terms of > readability, are UFCS and C#-style lambdas (which were already discussed). > > Something like > 'array(find("test", select!("a.name")(filter!("a.num > 3")(Elements'

Re: Carmack about static analysis

2011-12-25 Thread Adam D. Ruppe
On Monday, 26 December 2011 at 02:31:52 UTC, Adam D. Ruppe wrote: I like an individual line of code to be dumb as a rock anyway. I'm reminded of a discussion I had on another forum, where someone suggested this might be because I started with assembly language. It might be that those first few

Re: Carmack about static analysis

2011-12-25 Thread Adam D. Ruppe
On Monday, 26 December 2011 at 00:40:47 UTC, Andrei Alexandrescu wrote: I understand. Personally, I am unable to bring myself to fathom why writing this has any advantage: if(condition) return false just avoids a negation in the condition. It's easier to miss a "!" entirely than to miss a "ret

Re: Carmack about static analysis

2011-12-25 Thread deadalnix
Le 25/12/2011 05:27, Andrei Alexandrescu a écrit : Got the GC book this morning, already read 2.5 chapters :o). Andrei You'll find that you can do a lot when GC is aware of immutability (in functionnal languages, most things tends to be immutable). In the actual state of druntime, the GC

Re: Carmack about static analysis

2011-12-25 Thread Andrei Alexandrescu
On 12/25/11 8:56 PM, deadalnix wrote: Le 25/12/2011 05:27, Andrei Alexandrescu a écrit : Got the GC book this morning, already read 2.5 chapters :o). Andrei You'll find that you can do a lot when GC is aware of immutability (in functionnal languages, most things tends to be immutable). In

Re: Carmack about static analysis

2011-12-26 Thread Don
On 24.12.2011 16:33, Andrei Alexandrescu wrote: On 12/24/2011 09:11 AM, Derek wrote: On Sat, 24 Dec 2011 23:42:41 +1100, bearophile wrote: In theory functional-style is a good to shrink the code, but in D functional-style code is a jungle of (({}){()}) so it's hard to write and hard to read.

Re: Carmack about static analysis

2011-12-26 Thread Jacob Carlborg
On 2011-12-26 03:31, Adam D. Ruppe wrote: On Monday, 26 December 2011 at 00:40:47 UTC, Andrei Alexandrescu wrote: I understand. Personally, I am unable to bring myself to fathom why writing this has any advantage: if(condition) return false just avoids a negation in the condition. It's easier

Re: Carmack about static analysis

2011-12-26 Thread deadalnix
Le 26/12/2011 05:23, Andrei Alexandrescu a écrit : On 12/25/11 8:56 PM, deadalnix wrote: Le 25/12/2011 05:27, Andrei Alexandrescu a écrit : Got the GC book this morning, already read 2.5 chapters :o). Andrei You'll find that you can do a lot when GC is aware of immutability (in functionnal

Re: Carmack about static analysis

2011-12-26 Thread Jacob Carlborg
On 2011-12-26 05:23, Andrei Alexandrescu wrote: On 12/25/11 8:56 PM, deadalnix wrote: Le 25/12/2011 05:27, Andrei Alexandrescu a écrit : Got the GC book this morning, already read 2.5 chapters :o). Andrei You'll find that you can do a lot when GC is aware of immutability (in functionnal la

Re: Carmack about static analysis

2011-12-26 Thread Andrei Alexandrescu
On 12/26/11 6:53 AM, Jacob Carlborg wrote: What about the parallel/concurrent collector that has been linked a couple of times in this newsgroup. Would that be possible and a good idea to implement? A parallel collector would be, of course, a valuable addition. Andrei

Re: Carmack about static analysis

2011-12-26 Thread Jacob Carlborg
On 2011-12-26 15:52, Andrei Alexandrescu wrote: On 12/26/11 6:53 AM, Jacob Carlborg wrote: What about the parallel/concurrent collector that has been linked a couple of times in this newsgroup. Would that be possible and a good idea to implement? A parallel collector would be, of course, a val

Re: Carmack about static analysis

2011-12-26 Thread deadalnix
Le 26/12/2011 05:23, Andrei Alexandrescu a écrit : I've gone through a larger portion of the book and one thing has become very clear to me: we must improve the precision of the collector. This would be a gating feature towards taking the GC pretty much anywhere. Do you know what is the impact

Re: Carmack about static analysis

2011-12-26 Thread Adam D. Ruppe
On Monday, 26 December 2011 at 00:40:47 UTC, Andrei Alexandrescu wrote: I might be biased, but I ask for it to be corrected if I see it during a code review at work, and if someones writes such during an interview, it doesn't gain them any points. To conclude our chat here too, I do think you

Re: Carmack about static analysis

2011-12-26 Thread Andrei Alexandrescu
On 12/26/11 10:29 AM, deadalnix wrote: Le 26/12/2011 05:23, Andrei Alexandrescu a écrit : I've gone through a larger portion of the book and one thing has become very clear to me: we must improve the precision of the collector. This would be a gating feature towards taking the GC pretty much any

Re: Carmack about static analysis

2011-12-26 Thread Walter Bright
On 12/26/2011 3:47 AM, Jacob Carlborg wrote: It's like when you see code like this (Ruby): unless !foo end Double negation. Code like the snippet above can be really annoying. In general, variables and conditions should never be labeled with negation: bool notFeature;

Re: Carmack about static analysis

2011-12-26 Thread Robert Jacques
On Mon, 26 Dec 2011 07:43:46 -0800, Jacob Carlborg wrote: On 2011-12-26 15:52, Andrei Alexandrescu wrote: On 12/26/11 6:53 AM, Jacob Carlborg wrote: What about the parallel/concurrent collector that has been linked a couple of times in this newsgroup. Would that be possible and a good idea to

Re: Carmack about static analysis

2011-12-26 Thread bearophile
Robert Jacques: > The C4 pause-less GC, while very cool, is its own operating system. > It doesn't run on-top of Windows, Linux, Mac, etc. I think that eventually Linux will have to include some of those ideas, to allow language designers or virtual machine designers, to implement better garba

Re: Carmack about static analysis

2011-12-26 Thread Walter Bright
On 12/26/2011 9:03 AM, Andrei Alexandrescu wrote: On 12/26/11 10:29 AM, deadalnix wrote: Do you know what is the impact of 64bits on false positive proportion when the GC isn't precise ? No. I would think it would dramatically reduce it.

Re: Carmack about static analysis

2011-12-26 Thread Andrei Alexandrescu
On 12/26/11 6:36 PM, Walter Bright wrote: On 12/26/2011 9:03 AM, Andrei Alexandrescu wrote: On 12/26/11 10:29 AM, deadalnix wrote: Do you know what is the impact of 64bits on false positive proportion when the GC isn't precise ? No. I would think it would dramatically reduce it. At the sa

Re: Carmack about static analysis

2011-12-26 Thread Manfred Nowak
Walter Bright wrote: > bool notFeature; Counterexample: | bool sense; I do not believe, that a majority of developers evaluates `nonsense' as being equal to `!sense'. -manfred

Re: Carmack about static analysis

2011-12-27 Thread deadalnix
Le 27/12/2011 02:07, Andrei Alexandrescu a écrit : On 12/26/11 6:36 PM, Walter Bright wrote: On 12/26/2011 9:03 AM, Andrei Alexandrescu wrote: On 12/26/11 10:29 AM, deadalnix wrote: Do you know what is the impact of 64bits on false positive proportion when the GC isn't precise ? No. I woul

Re: Carmack about static analysis

2011-12-27 Thread Sean Cavanaugh
On 12/25/2011 10:23 PM, Andrei Alexandrescu wrote: As a first step, we must make all allocations except stack type-aware, and leave only the stack to be imprecise. Couldn't the GC'ing the stack be handled in a similar style to how the Windows x64 ABI functions with respect to exception handl

Re: Carmack about static analysis

2011-12-27 Thread Jacob Carlborg
On 2011-12-26 21:55, Walter Bright wrote: On 12/26/2011 3:47 AM, Jacob Carlborg wrote: It's like when you see code like this (Ruby): unless !foo end Double negation. Code like the snippet above can be really annoying. In general, variables and conditions should never be labeled with negatio

Re: Carmack about static analysis

2011-12-27 Thread Jacob Carlborg
On 2011-12-27 00:23, Robert Jacques wrote: On Mon, 26 Dec 2011 07:43:46 -0800, Jacob Carlborg wrote: On 2011-12-26 15:52, Andrei Alexandrescu wrote: On 12/26/11 6:53 AM, Jacob Carlborg wrote: What about the parallel/concurrent collector that has been linked a couple of times in this newsgroup

Re: Carmack about static analysis

2011-12-27 Thread Robert Jacques
On Tue, 27 Dec 2011 10:35:02 -0800, Sean Cavanaugh wrote: On 12/25/2011 10:23 PM, Andrei Alexandrescu wrote: As a first step, we must make all allocations except stack type-aware, and leave only the stack to be imprecise. Couldn't the GC'ing the stack be handled in a similar style to how

Re: Carmack about static analysis

2012-02-09 Thread Bruno Medeiros
On 24/12/2011 12:42, bearophile wrote: A new blog post by the very good John Carmack, I like how well readable this post is: http://altdevblogaday.com/2011/12/24/static-code-analysis/ Nice article! I particularly liked this comment: "The classic hacker disdain for “bondage and discipline lang

Re: Carmack about static analysis

2012-02-09 Thread Bruno Medeiros
On 24/12/2011 23:27, Adam D. Ruppe wrote: On Saturday, 24 December 2011 at 23:12:27 UTC, bearophile wrote: I was talking about the abundance of (({}){()}) and not about identifiers length. It's the same fallacy. I can't read Carmack's mind, but I'm sure he's talking about shortening code the s

Re: Carmack about static analysis

2012-02-09 Thread bearophile
Bruno Medeiros: > the needs of large, long-lived, multi-programmer > projects are just different than the quick work you do for yourself." > that throws a jab at a lot of the obsession with dynamic languages that > goes on out there. > It's something I've echoed in the past, especially when peop

Re: Carmack about static analysis

2012-02-09 Thread Walter Bright
On 2/9/2012 12:09 PM, Bruno Medeiros wrote: Nice article! I particularly liked this comment: "The classic hacker disdain for “bondage and discipline languages” is short sighted – the needs of large, long-lived, multi-programmer projects are just different than the quick work you do for yourself."

Re: Carmack about static analysis

2012-02-10 Thread deadalnix
Le 10/02/2012 05:37, Walter Bright a écrit : On 2/9/2012 12:09 PM, Bruno Medeiros wrote: Nice article! I particularly liked this comment: "The classic hacker disdain for “bondage and discipline languages” is short sighted – the needs of large, long-lived, multi-programmer projects are just diffe

Re: Carmack about static analysis

2012-02-10 Thread Walter Bright
On 2/10/2012 3:10 AM, deadalnix wrote: Typeless is great when sketching some piece of code, but you'll way more problem at the end. I've heard people say that typeless is just as good, because you load them up with unit tests that verify the types. To me, this doesn't seem like any advantage.

Re: Carmack about static analysis

2012-02-10 Thread H. S. Teoh
On Fri, Feb 10, 2012 at 10:19:11AM -0800, Walter Bright wrote: > On 2/10/2012 3:10 AM, deadalnix wrote: > >Typeless is great when sketching some piece of code, but you'll way more > >problem > >at the end. > > I've heard people say that typeless is just as good, because you > load them up with un

Re: Carmack about static analysis

2012-02-10 Thread Bruno Medeiros
On 10/02/2012 18:19, Walter Bright wrote: On 2/10/2012 3:10 AM, deadalnix wrote: Typeless is great when sketching some piece of code, but you'll way more problem at the end. I've heard people say that typeless is just as good, because you load them up with unit tests that verify the types. To

Re: Carmack about static analysis

2012-02-10 Thread Brad Anderson
On Fri, Feb 10, 2012 at 11:19 AM, Walter Bright wrote: > On 2/10/2012 3:10 AM, deadalnix wrote: > >> Typeless is great when sketching some piece of code, but you'll way more >> problem >> at the end. >> > > I've heard people say that typeless is just as good, because you load them > up with unit t

Re: Carmack about static analysis

2012-02-10 Thread Bruno Medeiros
On 09/02/2012 22:34, bearophile wrote: Comparing languages with small code snippets doesn't tell you all you want to know about how a language scales for very large programs, of course, so they aren't enough. But such small snippets are very useful any way because large programs are mostly mad

Re: Carmack about static analysis

2012-02-10 Thread Jonathan M Davis
On Friday, February 10, 2012 12:08:19 Brad Anderson wrote: > I actually read an article recently from someone who had written large > applications in dynamic languages and had come to the conclusion that the > productivity gains you have with the dynamic typing are pretty much lost to > the additio

Re: Carmack about static analysis

2012-02-10 Thread Jacob Carlborg
On 2012-02-10 20:08, Brad Anderson wrote: On Fri, Feb 10, 2012 at 11:19 AM, Walter Bright mailto:newshou...@digitalmars.com>> wrote: On 2/10/2012 3:10 AM, deadalnix wrote: Typeless is great when sketching some piece of code, but you'll way more problem at the end.

Re: Carmack about static analysis

2012-02-10 Thread bearophile
Jonathan M Davis: > I just can't stand the idea that whether an if statement is true or not could > change the type of a variable (e.g. it's set to a string in one branch and an > int in the other). You have found something that sometimes I like to do in Python, that I can't do in D, a reduced

Re: Carmack about static analysis

2012-02-13 Thread James Miller
I find that dynamic typing is useful sometimes and static typing other times. Certainly dynamic (duck) typing is useful for scripts and similar, and static typing is certainly better for writing code that is especially picky about its values. I liken it to the way I write code in PHP, the front-end