Re: Strong typing vs. strong testing [OT]

2010-10-29 Thread Gregory Ewing
Mark Wooding wrote: Would the world be a better place if we had a name for 2 pi rather than pi itself? I don't think so. The women working in the factory in India that makes most of the worlds 2s would be out of a job. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing [OT]

2010-10-23 Thread Mark Wooding
Steven D'Aprano steve-remove-t...@cybersource.com.au writes: Well, what is the definition of pi? Is it: the ratio of the circumference of a circle to twice its radius; the ratio of the area of a circle to the square of its radius; 4*arctan(1); the complex logarithm of -1 divided by the

Re: Strong typing vs. strong testing

2010-10-17 Thread Nick Keighley
On 10 Oct, 10:44, Lie Ryan lie.1...@gmail.com wrote: On 10/02/10 20:04, NickKeighleywrote: In a statically typed language, the of-the-wrong-type is something which can, by definition, be caught at compile time. Any time something is true by definition that is an indication that

Re: Strong typing vs. strong testing [OT]

2010-10-14 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 07:31:59PM +, Steven D'Aprano wrote: On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: The formula: circumference = 2 x pi x radius is

Re: Strong typing vs. strong testing [OT]

2010-10-14 Thread Gregory Ewing
Steven D'Aprano wrote: under Euclidean geometry, there was a time when people didn't know whether or not the ratio of circumference to radius was or wasn't a constant, and proving that it is a constant is non-trivial. I'm not sure that the construction you mentioned proves that either,

Re: Strong typing vs. strong testing [OT]

2010-10-14 Thread Arnaud Delobelle
Steven D'Aprano steve-remove-t...@cybersource.com.au writes: On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote: Given two circles with radii r1 and r2, circumferences C1 and C2, one is obviously the scaled-up version of the other, therefore the ratio of their circumferences is

Re: Strong typing vs. strong testing

2010-10-13 Thread Gregory Ewing
Tim Bradshaw wrote: In general any function which raises its argument to more than one power ... doesn't make much sense if its argument has units. That's not true. Consider the distance travelled by a falling object: y(t) = y0 + v0*t + 0.5*a*t**2. Here t has dimensions of time, and it's

Re: Strong typing vs. strong testing

2010-10-13 Thread Gregory Ewing
Pascal J. Bourguignon wrote: So the interesting thing is that some pseudo-units don't have dimensions. They only have the scale. I don't think the term pseudo-unit is particularly necessary. They're just units in which the powers of all the possible dimensions are zero. Calling them

Re: Strong typing vs. strong testing

2010-10-13 Thread Gregory Ewing
RG wrote: Even an interest rate of 0.1 radians makes sense if for some unfathomable reason you want to visualize your interest payment as the relative length of a line segment and an arc. It could even be quite reasonable if you're presenting it as a segment of a pie graph. For what it's

Re: Strong typing vs. strong testing

2010-10-13 Thread Gregory Ewing
Dann Corbit wrote: But in a very real sense it is a measure of rotation. We could call it a special measure, sort of like the way that e is a special base compared to all others. That's not the only thing that radians are useful for, though. Consider a weight bobbing up and down on a

Re: Strong typing vs. strong testing

2010-10-13 Thread RG
In article 8hl3grfh2...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: RG wrote: Even an interest rate of 0.1 radians makes sense if for some unfathomable reason you want to visualize your interest payment as the relative length of a line segment and an arc.

Re: Strong typing vs. strong testing

2010-10-13 Thread RG
In article 8hl2ucfdv...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Tim Bradshaw wrote: In general any function which raises its argument to more than one power ... doesn't make much sense if its argument has units. That's not true. Consider the distance

Re: Strong typing vs. strong testing

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 02:00:46 +0100, BartC said: But what exactly *is* this number? Is it 0.25, 1.57 or 90? Its pi/2, the same way 90% is 9/10. I can also write 12 inches, 1 foot, 1/3 yards, 1/5280 miles, 304.8 mm and so on. They are all the same number, roughly 1/13100 of the polar

Re: Strong typing vs. strong testing

2010-10-13 Thread Chris Rebert
On Wed, Oct 13, 2010 at 12:31 AM, RG rnospa...@flownet.com wrote: snip This reminds me of back when I was a kid and my dad was trying to teach me basic physics.  He kept saying that the acceleration of gravity was 9.8 meters per second squared and I just couldn't wrap my brain around what it

Re: Strong typing vs. strong testing

2010-10-13 Thread Rob Warnock
RG rnospa...@flownet.com wrote: +--- | This reminds me of back when I was a kid and my dad was trying to teach | me basic physics. He kept saying that the acceleration of gravity was | 9.8 meters per second squared and I just couldn't wrap my brain around | what it meant to square

Re: Strong typing vs. strong testing

2010-10-13 Thread RG
In article z9ednf_oe76e9cjrnz2dnuvz_vedn...@speakeasy.net, r...@rpw3.org (Rob Warnock) wrote: RG rnospa...@flownet.com wrote: +--- | This reminds me of back when I was a kid and my dad was trying to teach | me basic physics. He kept saying that the acceleration of gravity was

Re: Strong typing vs. strong testing

2010-10-13 Thread Rob Warnock
RG rnospa...@flownet.com wrote: +--- | r...@rpw3.org (Rob Warnock) wrote: | Write it our longhand and it's easier to grok: | 9.8 m/s^2 == 9.8 m/(s*s) == 9.8 m/(s*s) == | (9.8 meters per second) per second. | \ / |\__ speed added __/ per

Re: Strong typing vs. strong testing

2010-10-13 Thread BartC
RG rnospa...@flownet.com wrote in message news:rnospamon-ee76e8.18291912102...@news.albasani.net... In article i930ek$uv...@news.eternal-september.org, BartC b...@freeuk.com wrote: RG rnospa...@flownet.com wrote in message Likewise, all of the following are the same number written in

Re: Strong typing vs. strong testing

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 13:21:29 +0100, BartC said: My money would have been on 0.25, based on using 1.0 for a 360° circular angle. It seems far more attractive than using the arbitrary-looking 6.28... It may look arbitrary, but it isn't: it's about as non-arbitrary as it is possible to be. --

Re: Strong typing vs. strong testing

2010-10-13 Thread Steven D'Aprano
Hmmm, my ISP's news software really doesn't like it when I cross-post to more than three newsgroups. So, trying again without comp.lang.c. On Wed, 13 Oct 2010 02:00:46 +0100, BartC wrote: RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Steven D'Aprano
On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: The formula: circumference = 2 x pi x radius is taught in primary schools, yet it's actually a very difficult formula to prove! What's to prove? That's the definition of pi. Incorrect -- it's not necessarily so that the ratio of the

Re: Strong typing vs. strong testing

2010-10-13 Thread Arnaud Delobelle
Tim Bradshaw t...@tfeb.org writes: On 2010-10-13 13:21:29 +0100, BartC said: My money would have been on 0.25, based on using 1.0 for a 360° circular angle. It seems far more attractive than using the arbitrary-looking 6.28... It may look arbitrary, but it isn't: it's about as

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 14:20:30 +0100, Steven D'Aprano said: ncorrect -- it's not necessarily so that the ratio of the circumference to the radius of a circle is always the same number. It could have turned out that different circles had different ratios. But pi is much more basic than that, I think.

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: The formula: circumference = 2 x pi x radius is taught in primary schools, yet it's actually a very difficult formula to prove! What's to prove? That's the definition of pi.

Re: Strong typing vs. strong testing

2010-10-13 Thread Steve Schafer
On Wed, 13 Oct 2010 06:05:27 -0500, r...@rpw3.org (Rob Warnock) wrote: Why should it?!? If you look way under the covers, I suspect that even the c^2 in E = mc^2 is a collected term in the above sense [that is, if I recall my classes in introductory special relativity correctly]. In special

Re: Strong typing vs. strong testing

2010-10-13 Thread Keith Thompson
RG rnospa...@flownet.com writes: In article 8hl2ucfdv...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Tim Bradshaw wrote: In general any function which raises its argument to more than one power ... doesn't make much sense if its argument has units. That's

Re: Strong typing vs. strong testing

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano st...@remove-this-cybersource.com.au writes: Hmmm, my ISP's news software really doesn't like it when I cross-post to more than three newsgroups. So, trying again without comp.lang.c. On Wed, 13 Oct 2010 02:00:46 +0100, BartC wrote: RG rnospa...@flownet.com wrote in message

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 15:07:07 +0100, Tim Bradshaw wrote: On 2010-10-13 14:20:30 +0100, Steven D'Aprano said: ncorrect -- it's not necessarily so that the ratio of the circumference to the radius of a circle is always the same number. It could have turned out that different circles had

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: The formula: circumference = 2 x pi x radius is taught in primary schools, yet it's actually a very difficult formula to

Re: Strong typing vs. strong testing

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 17:28:42 +0200, Pascal J. Bourguignon wrote: But what exactly *is* this number? Is it 0.25, 1.57 or 90? That's the wrong question. It's like asking, what exactly is the number twenty-one -- is it one and twenty, or 21, or 0x15, or 0o25, or 21.0, or 20.999... recurring, or

Re: Strong typing vs. strong testing

2010-10-13 Thread Aleksej Saushev
BartC b...@freeuk.com writes: Thomas A. Russ t...@sevak.isi.edu wrote in message news:ymi1v7vgyp8@blackcat.isi.edu... torb...@diku.dk (Torben ZÆgidius Mogensen) writes: Trigonometric functions do take arguments of particular units: radians or (less often) degrees, with conversion needed

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Arnaud Delobelle
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: The formula: circumference = 2 x pi x radius is taught in

Re: Strong typing vs. strong testing

2010-10-13 Thread Gregory Ewing
RG wrote: I just couldn't wrap my brain around what it meant to square a second. That's nothing. Magnetic permeability is measured in newtons per square amp... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Wed, 13 Oct 2010 17:28:42 +0200, Pascal J. Bourguignon wrote: But what exactly *is* this number? Is it 0.25, 1.57 or 90? That's the wrong question. It's like asking, what exactly is the number twenty-one -- is it one and

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 21:52:54 +0100, Arnaud Delobelle wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote:

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Steve Howell
On Oct 13, 12:31 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: 0.2141693770623265 Perhaps this will help illustrate what I'm talking about... the mathematician Mitchell Feigenbaum discovered in 1975 that, for a large class of chaotic systems, the ratio of each bifurcation

Re: Strong typing vs. strong testing [OT]

2010-10-13 Thread Paul Rubin
Steve Howell showel...@yahoo.com writes: And yet nobody can recite this equally interesting ratio to thousands of digits: 0.2141693770623265... That is 1/F1 where F1 is the first Feigenbaum constant a/k/a delta. The mathworld article is pretty good:

Re: Strong typing vs. strong testing

2010-10-12 Thread Ben
On Oct 12, 8:45 am, torb...@diku.dk (Torben Ægidius Mogensen) wrote: Vic Kelson vic.kel...@gmail.com writes: That said, I'm having a hard time thinking of a transcendental function that doesn't take a dimensionless argument, e.g. what on earth would be the units of ln(4.0 ft)?

Re: Strong typing vs. strong testing

2010-10-12 Thread Tim Bradshaw
On 2010-10-12 11:16:09 +0100, Ben said: Angles aren't true units, as they are ratios of two lengths. They are more of a pseudo unit. That's right, in fact angles are pure numbers. In general any function which raises its argument to more than one power (for instance anything with a

Re: Strong typing vs. strong testing

2010-10-12 Thread Thomas A. Russ
torb...@diku.dk (Torben ŽÆgidius Mogensen) writes: Trigonometric functions do take arguments of particular units: radians or (less often) degrees, with conversion needed if you use the wrong unit. But radians are dimensionless. The definition of a radian is length/length (or m/m) which

Re: Strong typing vs. strong testing

2010-10-12 Thread BartC
Thomas A. Russ t...@sevak.isi.edu wrote in message news:ymi1v7vgyp8@blackcat.isi.edu... torb...@diku.dk (Torben ZÆgidius Mogensen) writes: Trigonometric functions do take arguments of particular units: radians or (less often) degrees, with conversion needed if you use the wrong unit.

Re: Strong typing vs. strong testing

2010-10-12 Thread Tim Bradshaw
On 2010-10-12 20:46:26 +0100, BartC said: You can't do all that if angles are just numbers. I think that the discussion of percentages is relevant here: angles //are// just numbers, but you're choosing a particular way of displaying them (or reading them). 100% //is// 1, and 360° //is// 2π.

Re: Strong typing vs. strong testing

2010-10-12 Thread Thomas A. Russ
BartC b...@freeuk.com writes: Thomas A. Russ t...@sevak.isi.edu wrote in message news:ymi1v7vgyp8@blackcat.isi.edu... torb...@diku.dk (Torben ZÆgidius Mogensen) writes: Trigonometric functions do take arguments of particular units: radians or (less often) degrees, with conversion

Re: Strong typing vs. strong testing

2010-10-12 Thread Erik Max Francis
Thomas A. Russ wrote: BartC b...@freeuk.com writes: Thomas A. Russ t...@sevak.isi.edu wrote in message news:ymi1v7vgyp8@blackcat.isi.edu... torb...@diku.dk (Torben Z??gidius Mogensen) writes: Trigonometric functions do take arguments of particular units: radians or (less often) degrees,

Re: Strong typing vs. strong testing

2010-10-12 Thread RG
In article i92dvd$ad...@news.eternal-september.org, BartC b...@freeuk.com wrote: Thomas A. Russ t...@sevak.isi.edu wrote in message news:ymi1v7vgyp8@blackcat.isi.edu... torb...@diku.dk (Torben ZÆgidius Mogensen) writes: Trigonometric functions do take arguments of particular units:

Re: Strong typing vs. strong testing

2010-10-12 Thread BartC
RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In article i92dvd$ad...@news.eternal-september.org, BartC b...@freeuk.com wrote: Thomas A. Russ t...@sevak.isi.edu wrote in message But radians are dimensionless. But they are still units

Re: Strong typing vs. strong testing

2010-10-12 Thread RG
In article i930ek$uv...@news.eternal-september.org, BartC b...@freeuk.com wrote: RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In article i92dvd$ad...@news.eternal-september.org, BartC b...@freeuk.com wrote: Thomas A. Russ

Re: Strong typing vs. strong testing

2010-10-12 Thread Keith Thompson
BartC b...@freeuk.com writes: RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... [...] Likewise, all of the following are the same number written in different notations: pi/2 pi/2 radians 90 degrees 100 gradians 1/4 circle 0.25 circle

Re: Strong typing vs. strong testing

2010-10-12 Thread RG
In article ln8w22euvp@nuthaus.mib.org, Keith Thompson ks...@mib.org wrote: BartC b...@freeuk.com writes: RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... [...] Likewise, all of the following are the same number written in different

Re: Strong typing vs. strong testing

2010-10-12 Thread MRAB
On 13/10/2010 02:36, Keith Thompson wrote: BartCb...@freeuk.com writes: RGrnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... [...] Likewise, all of the following are the same number written in different notations: pi/2 pi/2 radians 90 degrees

Re: Strong typing vs. strong testing

2010-10-12 Thread Dann Corbit
In article i930ek$uv...@news.eternal-september.org, b...@freeuk.com says... RG rnospa...@flownet.com wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In article i92dvd$ad...@news.eternal-september.org, BartC b...@freeuk.com wrote: Thomas A. Russ

Re: Strong typing vs. strong testing

2010-10-12 Thread Pascal J. Bourguignon
Tim Bradshaw t...@tfeb.org writes: On 2010-10-12 20:46:26 +0100, BartC said: You can't do all that if angles are just numbers. I think that the discussion of percentages is relevant here: angles //are// just numbers, but you're choosing a particular way of displaying them (or reading

Re: Strong typing vs. strong testing [OT]

2010-10-12 Thread Peter Nilsson
Keith Thompson ks...@mib.org wrote: The radian is defined as a ratio of lengths. That ratio is the same regardless of the size of the circle.  The choice of 1/(2*pi) of the circumference isn't arbitrary at all; there are sound mathematical reasons for it. Yes, but what is pi then?  

Re: Strong typing vs. strong testing

2010-10-12 Thread RG
In article 87mxqin49o@kuiper.lan.informatimago.com, p...@informatimago.com (Pascal J. Bourguignon) wrote: There's a notion of angle that is different from the notion of interest rate. Only because of how they are conventionally used. There's no difference between sin(0.1) and sin(10%).

Re: Strong typing vs. strong testing [OT]

2010-10-12 Thread RG
In article f15c3684-97b3-4605-a6d0-eb6b8aaf2...@a7g2000prb.googlegroups.com, Peter Nilsson ai...@acay.com.au wrote: Keith Thompson ks...@mib.org wrote: The radian is defined as a ratio of lengths. That ratio is the same regardless of the size of the circle.  The choice of 1/(2*pi) of the

Re: Strong typing vs. strong testing

2010-10-11 Thread Vic Kelson
On Sep 28, 10:55 am, Tim Bradshaw t...@tfeb.org wrote: There's a large existing body of knowledge on dimensional analysis (it's a very important tool for physics, for instance), and obviously the answer is to do whatever it does.  Raising to any power is fine, I think (but transcendental

Re: Strong typing vs. strong testing

2010-10-10 Thread Lie Ryan
On 10/01/10 00:24, TheFlyingDutchman wrote: If I had to choose between blow up or invalid answer I would pick invalid answer. there are some application domains where neither option would be viewed as a satisfactory error handling strategy. Fly-by-wire, petro- chemicals, nuclear power

Re: Strong typing vs. strong testing

2010-10-10 Thread Lie Ryan
On 10/02/10 20:04, Nick Keighley wrote: In a statically typed language, the of-the-wrong-type is something which can, by definition, be caught at compile time. Any time something is true by definition that is an indication that it's not a particularly useful fact. I'm not sure I

Re: Strong typing vs. strong testing

2010-10-10 Thread Lie Ryan
On 10/05/10 14:36, salil wrote: So, the programmer who specifically mentions Int in the signature of the function, is basically overriding this default behavior for specific reasons relevant to the application, for example, for performance. I think Haskell's way is the right. I agree that

Re: Strong typing vs. strong testing

2010-10-10 Thread Lie Ryan
On 10/01/10 23:56, BartC wrote: Pascal J. Bourguignon p...@informatimago.com wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message When Intel will realize that 99% of its users are

Re: Strong typing vs. strong testing

2010-10-10 Thread Martin Gregorie
On Sun, 10 Oct 2010 21:38:11 +1100, Lie Ryan wrote: Virtual Machine in Hardware... isn't that a contradiction? Nope. Several mainframes did that. Two that I knew well were both British - the ICL 1900 and 2900. The Burroughs x700 series also used hardware virtualisation. Both Burroughs and

Re: Strong typing vs. strong testing

2010-10-10 Thread Dave Angel
On 2:59 PM, Lie Ryan wrote: On 10/01/10 23:56, BartC wrote: Pascal J. Bourguignonp...@informatimago.com wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... BartCb...@freeuk.com writes: Pascal J. Bourguignonp...@informatimago.com wrote in message When Intel will realize

Re: Strong typing vs. strong testing

2010-10-10 Thread Rob Warnock
Martin Gregorie mar...@address-in-sig.invalid wrote: +--- | Lie Ryan wrote: | Virtual Machine in Hardware... isn't that a contradiction? | | Nope. Several mainframes did that. | | Two that I knew well were both British - the ICL 1900 and 2900. | The Burroughs x700 series also used

Re: Strong typing vs. strong testing

2010-10-06 Thread Keith H Duggar
On Sep 29, 9:01 pm, RG rnospa...@flownet.com wrote: That the problem is elsewhere in the program ought to be small comfort.  But very well, try this instead: [...@mighty:~]$ cat foo.c #include stdio.h int maximum(int a, int b) { return a b ? a : b; } int main() {   long x = 8589934592;

Re: Strong typing vs. strong testing

2010-10-06 Thread RG
In article 1a172248-8aab-42f0-a8a2-3f00168f9...@u13g2000vbo.googlegroups.com, Keith H Duggar dug...@alum.mit.edu wrote: On Sep 29, 9:01 pm, RG rnospa...@flownet.com wrote: That the problem is elsewhere in the program ought to be small comfort.  But very well, try this instead:

Re: Strong typing vs. strong testing

2010-10-06 Thread Pascal J. Bourguignon
Keith H Duggar dug...@alum.mit.edu writes: On Sep 29, 9:01 pm, RG rnospa...@flownet.com wrote: That the problem is elsewhere in the program ought to be small comfort.  But very well, try this instead: [...@mighty:~]$ cat foo.c #include stdio.h int maximum(int a, int b) { return a b ? a :

Re: Strong typing vs. strong testing

2010-10-05 Thread Pascal Costanza
On 05/10/2010 05:36, salil wrote: On Sep 30, 1:38 pm, Lie Ryanlie.1...@gmail.com wrote: The /most/ correct version of maximum() function is probably one written in Haskell as: maximum :: Integer - Integer - Integer maximum a b = if a b then a else b Integer in Haskell has infinite

Re: Strong typing vs. strong testing

2010-10-04 Thread Aleksej Saushev
RG rnospa...@flownet.com writes: There are only two possibilities: either you have a finite-state machine, or you have a Turning machine. (Well, OK, you could have a pushdown automaton, but there are no programming languages that model a PDA. Well, OK, there's Forth, but AFAIK there are

Re: Strong typing vs. strong testing

2010-10-04 Thread salil
On Sep 30, 1:38 pm, Lie Ryan lie.1...@gmail.com wrote: The /most/ correct version of maximum() function is probably one written in Haskell as: maximum :: Integer - Integer - Integer maximum a b = if a b then a else b Integer in Haskell has infinite precision (like python's int, only

Re: Strong typing vs. strong testing

2010-10-03 Thread guthrie
An interesting archive article on the topic of correctness, and the layers thereof: Program verification: the very idea; Communications of the ACM Volume 31 , Issue 9 (September 1988) Pages: 1048 - 1063 Year of Publication: 1988 ISSN:0001-0782 The notion of program

Re: Strong typing vs. strong testing

2010-10-02 Thread Steven D'Aprano
On Fri, 01 Oct 2010 11:56:24 +0200, Pascal J. Bourguignon wrote: Actually, it's hard to find a language that has no compiler generating faster code than C... Perl. Python. Ruby. Applescript. Hypertalk. Tcl. RPL. Frink. Inform 7. ActionScript. Dylan. Emerald. And hundreds more serious

Re: Strong typing vs. strong testing

2010-10-02 Thread Nick Keighley
On 1 Oct, 11:02, p...@informatimago.com (Pascal J. Bourguignon) wrote: Seebs usenet-nos...@seebs.net writes: On 2010-09-30, Ian Collins ian-n...@hotmail.com wrote: Which is why agile practices such as TDD have an edge.  If it compiles *and* passes all its tests, it must be right. So

Re: Strong typing vs. strong testing

2010-10-02 Thread Nick Keighley
On 1 Oct, 19:33, RG rnospa...@flownet.com wrote: In article slrniabt2j.1561.usenet-nos...@guild.seebs.net,  Seebs usenet-nos...@seebs.net wrote: On 2010-10-01, RG rnospa...@flownet.com wrote: snip Those goal posts are sorta red shifted at this point. [...] Red shifted? Moving away

Re: Strong typing vs. strong testing

2010-10-01 Thread TheFlyingDutchman
        in C I can have a function maximum(int a, int b) that will always         work. Never blow up, and never give an invalid answer. If someone         tries to call it incorrectly it is a compile error. I would agree that the third sentence is arguably wrong, simply because there's

Re: Strong typing vs. strong testing

2010-10-01 Thread TheFlyingDutchman
On Sep 30, 10:37 pm, RG rnospa...@flownet.com wrote: In article 87tyl63cag@mail.geddis.org,  Don Geddis d...@geddis.org wrote: Keith Thompson ks...@mib.org wrote on Thu, 30 Sep 2010: RG rnospa...@flownet.com writes: You're missing a lot of context.  I'm not trying to criticize

Re: Strong typing vs. strong testing

2010-10-01 Thread Antony
On 9/30/2010 9:06 AM, Seebs wrote: At $dayjob, they give us months between feature complete and shipping, Lucky you -Antony -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
Gene gene.ress...@gmail.com writes: The FA or TM dichotomy is more painful to contemplate than you say. Making appropriate simplifications for input, any modern computer is a FA with 2^(a few trillion) states. Consequently, the gestalt of computer science seems to be to take it on faith that

Re: Strong typing vs. strong testing

2010-10-01 Thread Steven D'Aprano
On Thu, 30 Sep 2010 21:27:03 +, Seebs wrote: On 2010-09-30, Ian Collins ian-n...@hotmail.com wrote: Which is why agile practices such as TDD have an edge. If it compiles *and* passes all its tests, it must be right. So far as I know, that actually just means that the test suite is

Re: Strong typing vs. strong testing

2010-10-01 Thread Nick Keighley
On 27 Sep, 18:46, namekuseijin namekusei...@gmail.com wrote: snip Fact is:  almost all user data from the external words comes into programs as strings.  No typesystem or compiler handles this fact all that graceful... snobol? -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
Seebs usenet-nos...@seebs.net writes: On 2010-10-01, Don Geddis d...@geddis.org wrote: in C I can have a function maximum(int a, int b) that will always work. Never blow up, and never give an invalid answer. If someone tries to call it incorrectly it is a compile

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
rustom rustompm...@gmail.com writes: Some points that seem to be missed (or Ive missed them?) 1. A dichotomy is being made between 'static' languages like C and 'dynamic' languages like python/lisp. This dichotomy was valid 30 years ago, not today. In Haskell for example - static checking

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
Seebs usenet-nos...@seebs.net writes: On 2010-09-30, Ian Collins ian-n...@hotmail.com wrote: Which is why agile practices such as TDD have an edge. If it compiles *and* passes all its tests, it must be right. So far as I know, that actually just means that the test suite is insufficient.

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
Pascal J. Bourguignon p...@informatimago.com wrote in message news:87sk0qkzhz@kuiper.lan.informatimago.com... rustom rustompm...@gmail.com writes: Much more mainstream, C# is almost as 'managed' as dynamic languages and has efficiency comparable to C. Nothing extraordinary here. Common

Re: Strong typing vs. strong testing

2010-10-01 Thread Rui Maciel
namekuseijin wrote: in C I can have a function maximum(int a, int b) that will always work. Never blow up, and never give an invalid answer. If someone tries to call it incorrectly it is a compile error. In a dynamic typed language maximum(a, b) can be called with incorrect datatypes. Even

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message news:87sk0qkzhz@kuiper.lan.informatimago.com... rustom rustompm...@gmail.com writes: Much more mainstream, C# is almost as 'managed' as dynamic languages and has efficiency comparable to C.

Re: Strong typing vs. strong testing

2010-10-01 Thread Rui Maciel
George Neuner wrote: That's true. But it is a situation where the conversion to SI units loses precision and therefore probably shouldn't be done. snip/ I don't care to check it ... the fact that the SI unit involves 12 decimal places whereas the imperial unit involves 3 tells me the

Re: Strong typing vs. strong testing

2010-10-01 Thread BartC
Pascal J. Bourguignon p...@informatimago.com wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message When Intel will realize that 99% of its users are running VM Which one? Any

Re: Strong typing vs. strong testing

2010-10-01 Thread Rui Maciel
Pascal J. Bourguignon wrote: Nothing extraordinary here. Common Lisp is more efficient than C. http://www.lrde.epita.fr/~didier/research/verna.06.ecoop.pdf http://portal.acm.org/citation.cfm?id=1144168 I don't know if you are intentionally trying to be deceitful or if you honestly didn't

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, TheFlyingDutchman zzbba...@aol.com wrote: ? ? ? ? in C I can have a function maximum(int a, int b) that will always ? ? ? ? work. Never blow up, and never give an invalid answer. If someone ? ? ? ? tries to call it incorrectly it is a compile error. I would agree that the

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: Seebs usenet-nos...@seebs.net writes: The obvious simple maximum() in C will not raise an exception nor return something which isn't an int in any program which is not on its face invalid in the call. This is by definite

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: static dynamic compiler detects wrong type fail at compile fails at run-time (with exception

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, RG rnospa...@flownet.com wrote: Again, you can't have it both ways. Either a warning is a compiler error according to the claim at issue (see below) or it is not. If it is, then this is a false positive. No, it isn't. It's a correctly identified type mismatch. You keep

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Now can we (by which I mean *you*) stop cross-posting C talk to multiple newsgroups that don't have anything to do with C? Fair enough. The original thread does seem to have been crossposted in an innovative way. -s

Re: Strong typing vs. strong testing

2010-10-01 Thread rustom
On Oct 1, 7:17 pm, Rui Maciel rui.mac...@gmail.com wrote: a) no language is inherently more or less efficient than any other language.   The efficiency aspect is only related to how those languages are implemented (i.e., the investments made in optimizing the compilers/interpreters) I used

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... BartC b...@freeuk.com writes: Pascal J. Bourguignon p...@informatimago.com wrote in message When Intel will realize that 99% of its users are

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
Seebs usenet-nos...@seebs.net writes: On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: static dynamic compiler detects wrong type fail at compile fails at run-time (with

Re: Strong typing vs. strong testing

2010-10-01 Thread John Nagle
On 10/1/2010 7:17 AM, Rui Maciel wrote: Pascal J. Bourguignon wrote: Nothing extraordinary here. Common Lisp is more efficient than C. http://www.lrde.epita.fr/~didier/research/verna.06.ecoop.pdf http://portal.acm.org/citation.cfm?id=1144168 I don't know if you are intentionally trying to

Re: Strong typing vs. strong testing

2010-10-01 Thread Seebs
On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: Seebs usenet-nos...@seebs.net writes: On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: compiler passes wrong type wrong resultfails at run-time (the programmer

Re: Strong typing vs. strong testing

2010-10-01 Thread Terry Reedy
On 10/1/2010 2:28 AM, TheFlyingDutchman wrote: in C I can have a function maximum(int a, int b) that will always work. Never blow up, and never give an invalid answer. If someone tries to call it incorrectly it is a compile error. I would agree that the third

Re: Strong typing vs. strong testing

2010-10-01 Thread Pascal J. Bourguignon
Seebs usenet-nos...@seebs.net writes: On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: Seebs usenet-nos...@seebs.net writes: On 2010-10-01, Pascal J. Bourguignon p...@informatimago.com wrote: compiler passes wrong type wrong resultfails at run-time

  1   2   3   >