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 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 negative of the complex square > r

Re: "Strong typing vs. strong testing"

2010-10-17 Thread Nick Keighley
On 10 Oct, 10:44, Lie Ryan 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 indicati

Re: "Strong typing vs. strong testing" [OT]

2010-10-14 Thread Arnaud Delobelle
Steven D'Aprano 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 equal to the ratio of their radi

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, becaus

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

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Paul Rubin
Steve Howell 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: http://mathworld.wolfram.com/FeigenbaumConstant.html I

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steve Howell
On Oct 13, 12:31 pm, Steven D'Aprano 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 interval to the > next approached a

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 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

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano 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 twenty", or 21, or 0x15,

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" [OT]

2010-10-13 Thread Arnaud Delobelle
Steven D'Aprano 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 primary >>> >> schools,

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Aleksej Saushev
"BartC" writes: > "Thomas A. Russ" 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 "w

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...

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

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"

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano 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" wrote in message >> news:rnospamon-20651e.17410012102...@news.alba

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Keith Thompson
RG writes: > In article <8hl2ucfdv...@mid.individual.net>, > Gregory Ewing 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 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 spec

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 definit

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"

2010-10-13 Thread Arnaud Delobelle
Tim Bradshaw 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 non-arbitrary as

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 circum

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" wrote in message > news:rnospamon-20651e.17410012102...@news.albasani.net... >> In article , "BartC"

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. -- http:

Re: "Strong typing vs. strong testing"

2010-10-13 Thread BartC
"RG" wrote in message news:rnospamon-ee76e8.18291912102...@news.albasani.net... In article , "BartC" wrote: "RG" wrote in message > 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

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Rob Warnock
RG 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 second | | Oh, t

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article , r...@rpw3.org (Rob Warnock) wrote: > RG 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 b

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Rob Warnock
RG 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 a second. | | Now th

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Chris Rebert
On Wed, Oct 13, 2010 at 12:31 AM, RG 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 a secon

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 circumf

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article <8hl2ucfdv...@mid.individual.net>, Gregory Ewing 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 travelled by a > fall

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article <8hl3grfh2...@mid.individual.net>, Gregory Ewing 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. > > It could even b

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 spring,

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 wor

Re: "Strong typing vs. strong testing"

2010-10-12 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 pseudo-

Re: "Strong typing vs. strong testing"

2010-10-12 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 bein

Re: "Strong typing vs. strong testing" [OT]

2010-10-12 Thread RG
In article , Peter Nilsson wrote: > Keith Thompson 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.

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 Peter Nilsson
Keith Thompson 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? > Mathematicians cou

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Pascal J. Bourguignon
Tim Bradshaw 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 them). 100%

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Dann Corbit
In article , b...@freeuk.com says... > > "RG" wrote in message > news:rnospamon-20651e.17410012102...@news.albasani.net... > > In article , > > "BartC" wrote: > > > >> "Thomas A. Russ" wrote in message > > >> > But radians are dimensionless. > >> > >> But they are still units > > > > No, the

Re: "Strong typing vs. strong testing"

2010-10-12 Thread MRAB
On 13/10/2010 02:36, Keith Thompson wrote: "BartC" writes: "RG" 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 circl

Re: "Strong typing vs. strong testing"

2010-10-12 Thread RG
In article , Keith Thompson wrote: > "BartC" writes: > > "RG" 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 Keith Thompson
"BartC" writes: > "RG" 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 >> 25% of a cir

Re: "Strong typing vs. strong testing"

2010-10-12 Thread RG
In article , "BartC" wrote: > "RG" wrote in message > news:rnospamon-20651e.17410012102...@news.albasani.net... > > In article , > > "BartC" wrote: > > > >> "Thomas A. Russ" wrote in message > > >> > But radians are dimensionless. > >> > >> But they are still units > > > > No, they aren't.

Re: "Strong typing vs. strong testing"

2010-10-12 Thread BartC
"RG" wrote in message news:rnospamon-20651e.17410012102...@news.albasani.net... In article , "BartC" wrote: "Thomas A. Russ" wrote in message > But radians are dimensionless. But they are still units No, they aren't. so that you can choose to use radians, degrees or gradians Those

Re: "Strong typing vs. strong testing"

2010-10-12 Thread RG
In article , "BartC" wrote: > "Thomas A. Russ" 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"

2010-10-12 Thread Erik Max Francis
Thomas A. Russ wrote: "BartC" writes: "Thomas A. Russ" 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

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Thomas A. Russ
"BartC" writes: > "Thomas A. Russ" 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 t

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 BartC
"Thomas A. Russ" 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. But radians are

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 s

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 non-

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 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)? > > Trigonometric functions

Re: "Strong typing vs. strong testing"

2010-10-11 Thread Vic Kelson
On Sep 28, 10:55 am, Tim Bradshaw 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 functions, for

Re: "Strong typing vs. strong testing"

2010-10-10 Thread Rob Warnock
Martin Gregorie 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 hardware virtualisation. +---

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. Bourguignon" wrote in message news:87zkuyjawh@kuiper.lan.informatimago.com... "BartC" writes: "Pascal J. Bourguignon" 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-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 a

Re: "Strong typing vs. strong testing"

2010-10-10 Thread Lie Ryan
On 10/01/10 23:56, BartC wrote: > > "Pascal J. Bourguignon" wrote in message > news:87zkuyjawh@kuiper.lan.informatimago.com... >> "BartC" writes: >> >>> "Pascal J. Bourguignon" 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-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

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. >

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- >> chemic

Re: "Strong typing vs. strong testing"

2010-10-06 Thread Pascal J. Bourguignon
Keith H Duggar writes: > On Sep 29, 9:01 pm, RG 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 >> >> int maximum(int a, int b) { return a > b ? a : b; } >> >> int main() { >>  

Re: "Strong typing vs. strong testing"

2010-10-06 Thread RG
In article <1a172248-8aab-42f0-a8a2-3f00168f9...@u13g2000vbo.googlegroups.com>, Keith H Duggar wrote: > On Sep 29, 9:01 pm, RG wrote: > > That the problem is "elsewhere in the program" ought to be small > > comfort.  But very well, try this instead: > > > > [...@mighty:~]$ cat foo.c > > #inclu

Re: "Strong typing vs. strong testing"

2010-10-06 Thread Keith H Duggar
On Sep 29, 9:01 pm, RG 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 > > int maximum(int a, int b) { return a > b ? a : b; } > > int main() { >   long x = 8589934592; >   printf("Max

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 Ryan 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'

Re: "Strong typing vs. strong testing"

2010-10-04 Thread salil
On Sep 30, 1:38 pm, Lie Ryan 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 > bounded by me

Re: "Strong typing vs. strong testing"

2010-10-04 Thread Aleksej Saushev
RG 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 no static type >

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 verificatio

Re: "Strong typing vs. strong testing"

2010-10-02 Thread Nick Keighley
On 1 Oct, 19:33, RG wrote: > In article , >  Seebs wrote: > > On 2010-10-01, RG wrote: > > >> Those goal posts are sorta red shifted at this point. [...] > > > Red shifted? > > > Moving away fast enough that their color has visibly changed. doppler shift for instance or one of them cosmologi

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 writes: > > On 2010-09-30, Ian Collins 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

Re: "Strong typing vs. strong testing"

2010-10-01 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 languag

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Paul Rubin
Raffael Cavallaro writes: >> prints appears to be the 2000th Fibonacci number rather than the 1000th. > I think you're mistaken. fib(0) = 0, fib(1) = 1, fib(2) = 1, fib(3) = > 2 ... fib(11)= 89 ... Whoops, you're right, I messed up my program while refactoring it. Sorry. > you like we can do i

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Raffael Cavallaro
On 2010-10-01 22:44:11 -0400, Paul Rubin said: I have no idea what that fancy algorithm is doing, but the number it prints appears to be the 2000th Fibonacci number rather than the 1000th. I think you're mistaken. fib(0) = 0, fib(1) = 1, fib(2) = 1, fib(3) = 2 ... fib(11)= 89 ... fib(1000) =

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Pascal J. Bourguignon
"BartC" writes: > "Pascal J. Bourguignon" wrote in message > news:877hi1iq2o@kuiper.lan.informatimago.com... >> "BartC" writes: > >>> (defun fib (n) >>> (if (< n 2) >>> n >>> (+ n (fib (- n 1)) (fib (- n 2)) ) >>> )) >>> >>> But it gave the wrong results and it took ages to fi

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Paul Rubin
Raffael Cavallaro writes: > CL-USER 119 > (defun fib (n) >(/ (loop for k from 1 to n by 2 > sum (/ (* (expt 5 (/ (1- k) 2)) (fact n)) >(fact k) (fact (- n k > (expt 2 (1- n > CL-USER 122 > (time (fib

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Raffael Cavallaro
On 2010-10-01 16:47:02 -0400, BartC said: I had a quick look at Lisp to see if your claims had any basis. I tried this program: (defun fib (n) (if (< n 2) n (+ n (fib (- n 1)) (fib (- n 2)) ) )) But it gave the wrong results and it took ages to figure out why. Even after dow

Re: "Strong typing vs. strong testing"

2010-10-01 Thread BartC
"Pascal J. Bourguignon" wrote in message news:877hi1iq2o@kuiper.lan.informatimago.com... "BartC" writes: (defun fib (n) (if (< n 2) n (+ n (fib (- n 1)) (fib (- n 2)) ) )) But it gave the wrong results and it took ages to figure out why. Even I thought you were saying t

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Pascal J. Bourguignon
"BartC" writes: > "Pascal J. Bourguignon" wrote in message > news:87sk0qkzhz@kuiper.lan.informatimago.com... > >> 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=114416

Re: "Strong typing vs. strong testing"

2010-10-01 Thread BartC
"Pascal J. Bourguignon" wrote in message news:87sk0qkzhz@kuiper.lan.informatimago.com... 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 Actually, it's hard to fin

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Keith Thompson
p...@informatimago.com (Pascal J. Bourguignon) writes: > Seebs writes: >> On 2010-10-01, Pascal J. Bourguignon wrote: >>> Seebs writes: On 2010-10-01, Pascal J. Bourguignon wrote: > compiler passes wrong type wrong resultfails at run-time >

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Keith Thompson
RG writes: > In article , > Seebs wrote: > >> On 2010-09-30, RG wrote: >> > That gives (what I would consider to be) false positives, e.g.: >> >> > [...@mighty:~]$ cat foo.c >> >> > void foo(long x) {} >> >> > int main() { foo(1); } >> > [...@mighty:~]$ gcc -Wconversion foo.c >> > foo.c: In

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Keith Thompson
TheFlyingDutchman writes: > On Sep 30, 10:37 pm, RG wrote: >> In article <87tyl63cag@mail.geddis.org>, >>  Don Geddis wrote: >> > Keith Thompson wrote on Thu, 30 Sep 2010: >> > > RG writes: >> > >> You're missing a lot of context.  I'm not trying to criticize C, just to >> > >> refute a fa

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Keith Thompson
Seebs writes: > On 2010-10-01, 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 a

Re: "Strong typing vs. strong testing"

2010-10-01 Thread RG
In article , Seebs wrote: > On 2010-10-01, RG 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

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Ian Collins
On 10/ 2/10 05:18 AM, Pascal J. Bourguignon wrote: Seebs writes: On 2010-10-01, Pascal J. Bourguignon wrote: static dynamic compiler detects wrong type fail at compile fails at run-time

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Pascal J. Bourguignon
Seebs writes: > On 2010-10-01, Pascal J. Bourguignon wrote: >> Seebs writes: >>> On 2010-10-01, Pascal J. Bourguignon wrote: compiler passes wrong type wrong resultfails at run-time (the programmer (with exception

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 senten

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Seebs
On 2010-10-01, Pascal J. Bourguignon wrote: > Seebs writes: >> On 2010-10-01, Pascal J. Bourguignon wrote: >>> compiler passes wrong type wrong resultfails at run-time >>> (the programmer (with exception >>> spends

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 be

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Pascal J. Bourguignon
Seebs writes: > On 2010-10-01, Pascal J. Bourguignon 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 Pascal J. Bourguignon
"BartC" writes: > "Pascal J. Bourguignon" wrote in message > news:87zkuyjawh@kuiper.lan.informatimago.com... >> "BartC" writes: >> >>> "Pascal J. Bourguignon" wrote in message > When Intel will realize that 99% of its users are running VM >>> >>> Which one? >> >> Any implementation of

Re: "Strong typing vs. strong testing"

2010-10-01 Thread rustom
On Oct 1, 7:17 pm, Rui Maciel 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 to believe the

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Seebs
On 2010-10-01, Steven D'Aprano 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 -- Copyright 2010, all wrongs rever

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Seebs
On 2010-10-01, RG 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 moving the goal post

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Seebs
On 2010-10-01, Pascal J. Bourguignon 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, Pascal J. Bourguignon wrote: > Seebs 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 contrast with several of the >> interpreted

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Seebs
On 2010-10-01, 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 se

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

  1   2   3   >