Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13103 > unrolled thread

Mathematica and Lisp

Started byamzoti <amzoti@gmail.com>
First post2013-01-12 03:23 +0000
Last post2013-02-26 06:09 +0000
Articles 20 on this page of 64 — 18 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Mathematica and Lisp amzoti <amzoti@gmail.com> - 2013-01-12 03:23 +0000
    Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-01-13 02:51 +0000
      Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-14 05:01 +0000
        Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-01-15 04:28 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-17 04:15 +0000
            Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-01-18 05:49 +0000
              Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-22 07:40 +0000
                Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-01-23 04:18 +0000
                  Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-24 06:17 +0000
                  Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-25 06:33 +0000
                  Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-01-26 06:37 +0000
                  Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-01-26 06:37 +0000
                  Re: Mathematica and Lisp "W. Craig Carter" <ccarter@MIT.EDU> - 2013-01-26 21:58 +0000
        Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-01-16 06:39 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-17 04:14 +0000
          Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-01-17 04:14 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@eecs.berkeley.edu> - 2013-01-18 05:50 +0000
          Re: Mathematica and Lisp W Craig Carter <ccarter@MIT.EDU> - 2013-01-18 05:50 +0000
          Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-01-18 05:50 +0000
          Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-01-18 05:49 +0000
          Re: Mathematica and Lisp W Craig Carter <ccarter@MIT.EDU> - 2013-01-18 05:49 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-01 01:46 +0000
        Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-02 06:15 +0000
          Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-03 07:52 +0000
            Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-05 08:06 +0000
              Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-06 10:52 +0000
                Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-07 02:28 +0000
        Re: Mathematica and Lisp danl@wolfram.com - 2013-02-02 06:15 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-03 07:51 +0000
        Re: Mathematica and Lisp Andrzej Kozlowski <akozlowski@gmail.com> - 2013-02-03 07:52 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-05 08:06 +0000
            Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-06 10:52 +0000
            Palette problem with Feynman slash notation "Dave Snead" <dsnead6@charter.net> - 2013-02-08 10:10 +0000
      Re: Mathematica and Lisp Matthias Bode <lvsaba@hotmail.com> - 2013-02-04 01:19 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-04 01:20 +0000
        Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-06 06:51 +0000
          Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-06 10:52 +0000
          Re: Mathematica and Lisp "mathgroup " <fizzymath@knology.net> - 2013-02-07 02:27 +0000
      Re: Mathematica and Lisp Alex Krasnov <akrasnov@eecs.berkeley.edu> - 2013-02-05 03:23 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-07 02:28 +0000
        Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-08 10:10 +0000
        Re: Mathematica and Lisp ?iso-8859-1?Q?J=E1nos_L=F6bb?= <janos@lobb.com> - 2013-02-09 05:42 +0000
        Re: Mathematica and Lisp Richard Fateman <fateman@eecs.berkeley.edu> - 2013-02-09 05:43 +0000
      Re: Mathematica and Lisp Andrzej Kozlowski <akozlowski@gmail.com> - 2013-02-08 10:10 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-08 10:10 +0000
        Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-09 05:43 +0000
        Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-10 08:34 +0000
      Re: Mathematica and Lisp Matthias Bode <lvsaba@hotmail.com> - 2013-02-09 05:43 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-15 06:56 +0000
        Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-17 09:08 +0000
          Re: Mathematica and Lisp Joe Gwinn <joegwinn@comcast.net> - 2013-02-18 10:59 +0000
        Re: Mathematica and Lisp "djmpark" <djmpark@comcast.net> - 2013-02-18 11:00 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-22 06:05 +0000
            Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-23 12:01 +0000
              Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-24 04:31 +0000
                Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-02-25 07:19 +0000
                  Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-26 06:09 +0000
    Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-13 02:51 +0000
    Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-01-16 06:38 +0000
      Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-01-17 04:15 +0000
        Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-01-18 05:50 +0000
    Re: Mathematica and Lisp Peter Klamser <klamser@googlemail.com> - 2013-02-24 04:31 +0000
      Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-02-25 07:19 +0000
      Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-02-26 06:09 +0000

Page 3 of 4 — ← Prev page 1 2 [3] 4  Next page →


#13415

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-02-08 10:10 +0000
Message-ID<kf2iuf$3nn$1@smc.vnet.net>
In reply to#13412
On 2/6/2013 6:28 PM, John Doty wrote:
=\... snip...
>
> All this demonstrates is that you don't understand how to use Mathematica. > All you know how to do is fight against it. You don't understand when to use rules versus when to use the various algebraic tools. Your code is pointless: no trajectories calculated, no bridges designed, and it doesn't enable anything that Mathematica can't already do.

There is nothing that cannot be done in assembler that can be done in 
Mathematica.  By your reasoning Mathematica itself is pointless.

There are deficiencies in Mathematica, as demonstrated by questions posted
in this very newsgroup.  You can dismiss all such questions as claptrap
because people are misusing it, and that is certainly the view of some
contributors.  I think that such a view is unhelpful, at a minimum.

>
>>> Considered as software failures, both of these occurred in application code and were not the result of programming language deficiencies.
>>
>>
>>
>> Was the code not written in a programming language?
>>
>> Even if it was written in assembler, that too is
>>
>> a programming language.  I expect that the bug
>>
>> occurred because the programmer did not realize the
>>
>> semantics of the code.
>
> In the Theravac case, the coders appeared not to understand the operation and hazards of the radiation therapy machinery very well.

That's not my understanding at all.

  In Ariane case, I 
> have heard that the coders concluded that overflow was impossible in the context of Ariane IV, but that analysis was not redone for Ariane V when the software was reused.

The re-use of software is usually tied to the programming language.

In any case, the fundamental failure in both cases was in systems engineering, not code.

The language of the system engineering was programming languages.  A
better programming language might have provided a more reliable framework
for construction or re-use.


  You shouldn't place much blame on the spark that sets you on fire when you walk around in clothes soaked with gasoline.

I think I agree with what you said here, in reverse. that is ...using 
Mathematica is like walking around with your clothes soaked in gasoline.
>
>>> Not all bugs are of equal importance. An error of 5.5E-79 in a Bessel function is very unlikely

If that were the only bug or the most significant one, you might have a 
point.  Except:
1. There are many errors that can be prompted at the 1st decimal digit of
an answer.
2.  There are other numbers around.  If A is supposed to be equal to B,
but A-B  is 5e-79,   you can with one operation make that error much bigger.
Just multiply by 10e79.    Now you could say that 10e79 is an unlikely
number, but how would you know?

>>
>>   >to cause trouble in a practical application.
>>
>>
>>
>> One of the marvels of computing today is that it is possible to do so
>>
>> much in such a short time.
>>
>> One can execute billions of instructions a second.  If only
>>
>> one in a million does the wrong thing, and is wrong only
>>
>> by a tiny percent,  you can accumulate a whopping mistake
>>
>> in a second.
>
> 5.5E-79 is rather smaller than a tiny percent. The best physical measurements are good to a few parts in 10^16. Assuming teraflop arithmetic, adding numbers with errors of 5.5E-79, it'll take you about 4E45 times the age of the universe to have errors add up to 1E-16.

Ah yes. assuming you don't multiply or divide.
>
>
>>    I've been using Mathematica to do practical work since version 1,
>>
>>   > and I've never encountered a bug in its numerics.
>>
>> I guess it is my turn to wonder if YOU know much about Mathematica.
>
> The difference is that I *use* it. You *fight* it.

If finding bugs is fighting, sure.  If criticizing design features and
sometimes suggesting changes is fighting, sure.
>
>>> Crazy results from numerical codes are a normal occurrence,
>>
>>   > I don't find Mathematica to be unusually hazardous here.
>>
>> I guess I disagree on this point.
>
> But you don't actually use numerical codes. You don't design bridges, compute trajectories, or study turbulence. So your opinion is uninformed.

Um, who is uninformed?
See
http://adsabs.harvard.edu/abs/1998IJMPC...9..509F

a paper entitled

Symbolic Computation of Turbulence and Energy Dissipation in the Taylor 
Vortex Model



>
> Well, I'm not so sure that using Scheme is so good: it means that few potential collaborators are willing to try to read my code. To the average engineer or scientist, Lisp screams "forget your application and pay attention to the cool computer science".

Just suggests that the average engineer is a sucky programmer.  That's
not so surprising.

  Now, I actually know enough of that CS crap that I can see past it to reality, but most don't. I primarily use Scheme to access a collection of useful functions that are actually written in C, but have Scheme (Guile) interfaces. I think it would be much better if those interfaces were in a language friendlier to engineers, like Python. Scheme's fine for me, with my eccentric background, but not for most others.
>
>> Though
>> Common Lisp  (a Lisp dialect) is used in space computations --
>> the Hubble telescope.
>
> My old colleague Mark Johnston developed SPIKE for Hubble, but it has been and is used for other missions as well. I was involved in getting the ASCA and Chandra space observatories to adopt it for their operational planning. The last time I talked to Mark (a long time ago), he seemed rather unhappy with CL as an implementation language for a practical AI application. I don't think he'd choose CL again if he had to rewrite SPIKE.
>
I think the phrase "practical AI application" is still, for most people, 
an oxymoron.  There are plenty of practical CL applications.
While people differ on their favorite languages for different
purposes, my experience with students at Berkeley is that the
time for them to write major parts of a compiler in C or C++ is
LONGER than the time for them to learn Lisp and then write the same
program in Lisp.  That's not rocket science, though.

But then they are probably not average engineers.




[toc] | [prev] | [next] | [standalone]


#13422

From?iso-8859-1?Q?J=E1nos_L=F6bb?= <janos@lobb.com>
Date2013-02-09 05:42 +0000
Message-ID<kf4nl0$8r1$1@smc.vnet.net>
In reply to#13412
On Feb 8, 2013, at 5:10 AM, Richard Fateman wrote:

> On 2/6/2013 6:28 PM, John Doty wrote:
> =\... snip...
>>
>> All this demonstrates is that you don't understand how to use 
Mathematica. > All you know how to do is fight against it. You don't 
understand when to use rules versus when to use the various algebraic 
tools. Your code is pointless: no trajectories calculated, no bridges 
designed, and it doesn't enable anything that Mathematica can't already 
do.
>
> There is nothing that cannot be done in assembler that can be done in
> Mathematica.  By your reasoning Mathematica itself is pointless.
>
> There are deficiencies in Mathematica, as demonstrated by questions posted
> in this very newsgroup.  You can dismiss all such questions as claptrap
> because people are misusing it, and that is certainly the view of some
> contributors.  I think that such a view is unhelpful, at a minimum.
>
>>
>>>> Considered as software failures, both of these occurred in application code and were not the result of programming language deficiencies.
>>>
>>>
>>>
>>> Was the code not written in a programming language?
>>>
>>> Even if it was written in assembler, that too is
>>>
>>> a programming language.  I expect that the bug
>>>
>>> occurred because the programmer did not realize the
>>>
>>> semantics of the code.
>>
>> In the Theravac case, the coders appeared not to understand the operation and hazards of the radiation therapy machinery very well.
>
> That's not my understanding at all.

My understanding is that in the Theravac case when a counter overflew a higher energy dose - a lethal one - was administered by the operator of the machine unknowingly.  On one side it was a clear programming error either do not understanding that the 8 bit counter will overflow sooner or later, or negligence not doing an error checking before incrementing the counter.  On the other side it was also a clear systems engineering error, by relying only on the software control and taking out all the hardware stops that otherwise would have prevented the administration of the lethal dosage.
So I think both of you are right in some sense and both of you are wrong in another :-)
The best to both of you from Nemo :-)
J=E1nos

>
>  In Ariane case, I
>> have heard that the coders concluded that overflow was impossible in the context of Ariane IV, but that analysis was not redone for Ariane V when the software was reused.
>
> The re-use of software is usually tied to the programming language.
>
> In any case, the fundamental failure in both cases was in systems engineering, not code.
>
> The language of the system engineering was programming languages.  A
> better programming language might have provided a more reliable framework
> for construction or re-use.
>
>
>  You shouldn't place much blame on the spark that sets you on fire when you walk around in clothes soaked with gasoline.
>
> I think I agree with what you said here, in reverse. that is ...using
> Mathematica is like walking around with your clothes soaked in gasoline.
>>
>>>> Not all bugs are of equal importance. An error of 5.5E-79 in a Bessel function is very unlikely
>
> If that were the only bug or the most significant one, you might have a
> point.  Except:
> 1. There are many errors that can be prompted at the 1st decimal digit of
> an answer.
> 2.  There are other numbers around.  If A is supposed to be equal to B,
> but A-B  is 5e-79,   you can with one operation make that error much bigger.
> Just multiply by 10e79.    Now you could say that 10e79 is an unlikely
> number, but how would you know?
>
>>>
>>>> to cause trouble in a practical application.
>>>
>>>
>>>
>>> One of the marvels of computing today is that it is possible to do so
>>>
>>> much in such a short time.
>>>
>>> One can execute billions of instructions a second.  If only
>>>
>>> one in a million does the wrong thing, and is wrong only
>>>
>>> by a tiny percent,  you can accumulate a whopping mistake
>>>
>>> in a second.
>>
>> 5.5E-79 is rather smaller than a tiny percent. The best physical measurements are good to a few parts in 10^16. Assuming teraflop arithmetic, adding numbers with errors of 5.5E-79, it'll take you about 4E45 times the age of the universe to have errors add up to 1E-16.
>
> Ah yes. assuming you don't multiply or divide.
>>
>>
>>>   I've been using Mathematica to do practical work since version 1,
>>>
>>>> and I've never encountered a bug in its numerics.
>>>
>>> I guess it is my turn to wonder if YOU know much about Mathematica.
>>
>> The difference is that I *use* it. You *fight* it.
>
> If finding bugs is fighting, sure.  If criticizing design features and
> sometimes suggesting changes is fighting, sure.
>>
>>>> Crazy results from numerical codes are a normal occurrence,
>>>
>>>> I don't find Mathematica to be unusually hazardous here.
>>>
>>> I guess I disagree on this point.
>>
>> But you don't actually use numerical codes. You don't design bridges, compute trajectories, or study turbulence. So your opinion is uninformed.
>
> Um, who is uninformed?
> See
> http://adsabs.harvard.edu/abs/1998IJMPC...9..509F
>
> a paper entitled
>
> Symbolic Computation of Turbulence and Energy Dissipation in the Taylor
> Vortex Model
>
>
>
>>
>> Well, I'm not so sure that using Scheme is so good: it means that few potential collaborators are willing to try to read my code. To the average engineer or scientist, Lisp screams "forget your application and pay attention to the cool computer science".
>
> Just suggests that the average engineer is a sucky programmer.  That's
> not so surprising.
>
>  Now, I actually know enough of that CS crap that I can see past it to reality, but most don't. I primarily use Scheme to access a collection of useful functions that are actually written in C, but have Scheme (Guile) interfaces. I think it would be much better if those interfaces were in a language friendlier to engineers, like Python. Scheme's fine for me, with my eccentric background, but not for most others.
>>
>>> Though
>>> Common Lisp  (a Lisp dialect) is used in space computations --
>>> the Hubble telescope.
>>
>> My old colleague Mark Johnston developed SPIKE for Hubble, but it has been and is used for other missions as well. I was involved in getting the ASCA and Chandra space observatories to adopt it for their operational planning. The last time I talked to Mark (a long time ago), he seemed rather unhappy with CL as an implementation language for a practical AI application. I don't think he'd choose CL again if he had to rewrite SPIKE.
>>
> I think the phrase "practical AI application" is still, for most people,
> an oxymoron.  There are plenty of practical CL applications.
> While people differ on their favorite languages for different
> purposes, my experience with students at Berkeley is that the
> time for them to write major parts of a compiler in C or C++ is
> LONGER than the time for them to learn Lisp and then write the same
> program in Lisp.  That's not rocket science, though.
>
> But then they are probably not average engineers.
>
>
>
>
>

[toc] | [prev] | [next] | [standalone]


#13423

FromRichard Fateman <fateman@eecs.berkeley.edu>
Date2013-02-09 05:43 +0000
Message-ID<kf4nln$8rg$1@smc.vnet.net>
In reply to#13412
Regarding the Therac-25  (not theravac);
you can read about it on Wikipedia.
http://en.wikipedia.org/wiki/Therac-25
and also look at the links, especially Nancy Leveson's report
http://sunnyday.mit.edu/papers/therac.pdf
especiall page 7, top.
which I think is the most significant.

As I recall,  the operator editing the display screen used
carriage returns etc to go between fields and thought that
the actual settings were reflected  by what appeared on the screen.
This was not the case.

There are other factors too. Lack of hardware interlocks, certainly
a systems design error,  also
meaningless error messages (how could THAT happen?)
hard to debug programming language (assembler).


[toc] | [prev] | [next] | [standalone]


#13416

FromAndrzej Kozlowski <akozlowski@gmail.com>
Date2013-02-08 10:10 +0000
Message-ID<kf2iuq$3nt$1@smc.vnet.net>
In reply to#13124
On 7 Feb 2013, at 03:29, John Doty <noqsiaerospace@gmail.com> wrote:

> All this demonstrates is that you don't understand how to use Mathematica. > All you know how to do is fight against it. You don't understand when to use rules versus when to use the various algebraic tools. Your code is pointless: no trajectories calculated, no bridges designed, and it doesn't enable anything that Mathematica can't already do.

You have failed to appreciate the motives have made RJF devote so much 
time and effort to this ungrateful task. It is, of course, pure altruism 
and deeply felt sympathy for the poor Mathematica user confused by the 
mysterious and buggy features of this so undeservedly successful 
program. For a quarter of a century RJF has been diligently searching 
for this user, pouncing on any unsuspecting innocent novice and 
introducing him to exactly the same examples of Mathematica's supposed 
confusion, complexity and unreliability, including, of course, the 
notorious "non-recommendation" of Mathematica in instances where it 
could "threaten" =85 "injury, or significant loss". Practically every 
thing RJF has written concerning Mathematica on this forum he has posted 
numerous times over many years - yet what an ungrateful and Sisyphus 
like work it has been. The "confused user" for whose sake RJF must have 
abandoned or delayed serious work of the kind that computer science 
professors are overloaded with, never seems to acknowledge being 
"confused", nor does he ever appear to be grateful for the attempted 
rescue from the clutches of the charlatans at Wolfram Research. RJF's 
"improvements" to Mathematica are being ignored by both Wolfram and 
ordinary users, out of pure spite or perhaps inability to appreciate 
genuinely advanced "computer science". Instead of appreciating the kind 
heart and intellectual brilliance RJF has been gracing our forum with 
for so many years you write about petty and mundane subjects like 
"calculating trajectories" and "building bridges", which, along with 
mathematics, physics etc, etc,  are obviously beneath RJF's concerns. 
Which, of course, proves that you, like the rest of us, are a typical 
Mathematica user, too confused by Wolfram to know what's good for you 
and the world.

Andrzej Kozlowski

[toc] | [prev] | [next] | [standalone]


#13418

FromJohn Doty <noqsiaerospace@gmail.com>
Date2013-02-08 10:10 +0000
Message-ID<kf2iv5$3o7$1@smc.vnet.net>
In reply to#13124
On Wednesday, February 6, 2013 9:28:00 PM UTC-5, Richard Fateman wrote:

> I personally find the debugging facilities in Mathematica to be quite
>
> difficult to use.

I personally don't use them, but I personally find Mathematica programs easy to debug.

>  I speculate that it is because the "working model"
>
> I have in my mind (and I suspect others share it) is that I am writing
>
> programs, composing them in various ways.  In reality, the internal
>
> evaluation strategy of Mathematica is to apply rules to transform
>
> expressions.  So while I'm looking for a clue as to which "program"
>
> has the bug, the debugging info shows transformations of expressions.

Yes! Now, we're getting someplace.

>
> This jerking back into the reality of Mathematica's actual nature
>
> of evaluation generally prompts me to shy away from the use of Trace.

If you're using Mathematica, why ever leave that reality? Why not stay in it and use its power? If that's not working for you, why use Mathematica in the first place?

>
> I don't know if it is inevitable, but Trace in particular, and debugging
>
> in general in Mathematica seem to me to be quite weak.

Trying to figure out what Mathematica's doing using Trace[] is like trying to figure out what a 1960's mainframe was doing from the blinking lights on the console. Useful in special circumstances, but too much detail in general.

> To the
>
> extent that some people might like Mathematica for debugging, it may be
>
> that they are comparing it to a non-interactive system (like batch
>
> FORTRAN) which will crash and print out a hexadecimal core dump.

Not really. Where Mathematica shines is test-driven development. Whenever you complete a definition, try it on a test case or a few. That finds most bugs quickly, and it also encourages good factoring. That good factoring helps out later when you discover a bug has slipped through, making it easy to isolate the definition responsible.

> There is a profiler in the Mathematica Workbench.  I have not tried
>
> to use it but from the documentation it seems to suffer from the same
>
> viewpoint as Trace.  It also requires running Mathematica in "debug"
>
> mode; I don't know how that affects timings.

When I reach the point where I care enough about timing of numerical code that judicious use of Timing[] isn't providing enough insight, I generally declare the Mathematica code to be a finished prototype and move on to a more suitable language for production code.

> So in regard to item 5, nearly any alternative system that has an
>
> appealing debugging framework.  Which would be almost anything that
>
> is not bound up in the rule-based paradigm of Mathematica.

But the rule-based paradigm is fundamental here. Formal proof in mathematics is rule-based.  Mathematica implements a formalist vision of mathematics filtered through a physicist's pragmatism. That's why it's so good at mathematics, especially the applied mathematics of science and engineering. In Mathematica, programming is secondary: partly emergent and partly added on. If programming is your primary focus, Mathematica should probably not be your language of choice.

[toc] | [prev] | [next] | [standalone]


#13424

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-02-09 05:43 +0000
Message-ID<kf4nm3$8rp$1@smc.vnet.net>
In reply to#13418
On 2/8/2013 2:10 AM, John Doty wrote:

<big snip, most of which suggest we agree on some things>

>
> But the rule-based paradigm is fundamental here.
>Formal proof in mathematics is rule-based.

Not necessarily.  There's a substantial literature that
shows how to prove theorems by algebraic construction.
For example, geometry theorems are often convertible to
algebraic system solution.

I think the reality of rules is that too many of them are
confusing as a programming paradigm.  Few people have the
knowledge and discipline to write rule sets which are
defined without overlaps, in a more-or-less unstructured
problem domain, where the solution is, as you say, "emergent".

> Mathematica implements a formalist vision of mathematics filtered
> through a physicist's pragmatism. That's why it's so good at mathematics
>, especially the applied mathematics of science and engineering.
That's partly why it fails so spectacularly on the mathematics examples
which I've pointed out again and again.

In
>Mathematica, programming is secondary: partly emergent and partly added on.
> If programming is your primary focus, Mathematica should probably not be your language of choice.

And so we agree, that if programming a solution to a problem
is the key to reaching your goal, perhaps you should not be
using Mathematica.

RJF

>

[toc] | [prev] | [next] | [standalone]


#13445

FromDavid Bailey <dave@removedbailey.co.uk>
Date2013-02-10 08:34 +0000
Message-ID<kf7m3a$fg9$1@smc.vnet.net>
In reply to#13418
On 08/02/2013 10:10, John Doty wrote:
> On Wednesday, February 6, 2013 9:28:00 PM UTC-5, Richard Fateman wrote:
>
>> I personally find the debugging facilities in Mathematica to be quite
>>
>> difficult to use.
>
> I personally don't use them, but I personally find Mathematica programs easy to debug.
>
>>   I speculate that it is because the "working model"
>>
>> I have in my mind (and I suspect others share it) is that I am writing
>>
>> programs, composing them in various ways.  In reality, the internal
>>
>> evaluation strategy of Mathematica is to apply rules to transform
>>
>> expressions.  So while I'm looking for a clue as to which "program"
>>
>> has the bug, the debugging info shows transformations of expressions.
>
> Yes! Now, we're getting someplace.
>
>>
>> This jerking back into the reality of Mathematica's actual nature
>>
>> of evaluation generally prompts me to shy away from the use of Trace.
>
> If you're using Mathematica, why ever leave that reality? Why not stay in it and use its power? If that's not working for you, why use Mathematica in the first place?
>
>>
>> I don't know if it is inevitable, but Trace in particular, and debugging
>>
>> in general in Mathematica seem to me to be quite weak.
>
> Trying to figure out what Mathematica's doing using Trace[] is like trying to figure out what a 1960's mainframe was doing from the blinking lights on the console. Useful in special circumstances, but too much detail in general.
>

This is why I wrote the DebugTrace package - available free from my website.

Sometimes we all have to debug badly structured code. For example, if 
you are a consultant, you simply have to understand a client's code, 
however it is structured!

Also, many people use Mathematica infrequently, and don't want to spend 
a great deal of time understanding its philosophy.

For that reason, DebugTrace reintroduces the fiction of functions, so 
that when a program pauses at a breakpoint, or when it generates an 
error message, you can obtain a trace-back of what called what, at which 
line number. Line numbers relate to a special 'listing' notebook that is 
generated as the debugger starts.

Since I don't really like the Workbench, all this runs directly in the 
FrontEnd!


David Bailey
http://www.dbaileyconsultancy.co.uk


[toc] | [prev] | [next] | [standalone]


#13426

FromMatthias Bode <lvsaba@hotmail.com>
Date2013-02-09 05:43 +0000
Message-ID<kf4nme$8ru$1@smc.vnet.net>
In reply to#13124
Hola:

"There is nothing that cannot be done in assembler that can be done in Mathematica."

Upon inspection of the code of "A small program that calculates and prints terms of the Fibonacci series"

http://www.assembly.happycodings.com/code1.html

I have been led to surmise that using Mathematica might have some slight advantages over the assembler approach.

Best regards,

MATTHIAS BODE
S 17.36398=B0, W 66.21816=B0,2'590 m. AMSL.
> From: fateman@cs.berkeley.edu
> Subject: Re: Mathematica and Lisp
> To: mathgroup@smc.vnet.net
> Date: Fri, 8 Feb 2013 05:10:38 -0500
>
> On 2/6/2013 6:28 PM, John Doty wrote:
> =\... snip...
> >
> > All this demonstrates is that you don't understand how to use Mathematica. > All you know how to do is fight against it. You don't understand when to use rules versus when to use the various algebraic tools. Your code is pointless: no trajectories calculated, no bridges designed, and it doesn't enable anything that Mathematica can't already do.
>
> There is nothing that cannot be done in assembler that can be done in
> Mathematica.  By your reasoning Mathematica itself is pointless.
>
> There are deficiencies in Mathematica, as demonstrated by questions posted
> in this very newsgroup.  You can dismiss all such questions as claptrap
> because people are misusing it, and that is certainly the view of some
> contributors.  I think that such a view is unhelpful, at a minimum.
>
> >
> >>> Considered as software failures, both of these occurred in application code and were not the result of programming language deficiencies.
> >>
> >>
> >>
> >> Was the code not written in a programming language?
> >>
> >> Even if it was written in assembler, that too is
> >>
> >> a programming language.  I expect that the bug
> >>
> >> occurred because the programmer did not realize the
> >>
> >> semantics of the code.
> >
> > In the Theravac case, the coders appeared not to understand the operation and hazards of the radiation therapy machinery very well.
>
> That's not my understanding at all.
>
>   In Ariane case, I
> > have heard that the coders concluded that overflow was impossible in the context of Ariane IV, but that analysis was not redone for Ariane V when the software was reused.
>
> The re-use of software is usually tied to the programming language.
>
> In any case, the fundamental failure in both cases was in systems engineering, not code.
>
> The language of the system engineering was programming languages.  A
> better programming language might have provided a more reliable framework
> for construction or re-use.
>
>
>   You shouldn't place much blame on the spark that sets you on fire when you walk around in clothes soaked with gasoline.
>
> I think I agree with what you said here, in reverse. that is ...using
> Mathematica is like walking around with your clothes soaked in gasoline.
> >
> >>> Not all bugs are of equal importance. An error of 5.5E-79 in a Bessel function is very unlikely
>
> If that were the only bug or the most significant one, you might have a
> point.  Except:
> 1. There are many errors that can be prompted at the 1st decimal digit of
> an answer.
> 2.  There are other numbers around.  If A is supposed to be equal to B,
> but A-B  is 5e-79,   you can with one operation make that error much bigger.
> Just multiply by 10e79.    Now you could say that 10e79 is an unlikely
> number, but how would you know?
>
> >>
> >>   >to cause trouble in a practical application.
> >>
> >>
> >>
> >> One of the marvels of computing today is that it is possible to do so
> >>
> >> much in such a short time.
> >>
> >> One can execute billions of instructions a second.  If only
> >>
> >> one in a million does the wrong thing, and is wrong only
> >>
> >> by a tiny percent,  you can accumulate a whopping mistake
> >>
> >> in a second.
> >
> > 5.5E-79 is rather smaller than a tiny percent. The best physical measurements are good to a few parts in 10^16. Assuming teraflop arithmetic, adding numbers with errors of 5.5E-79, it'll take you about 4E45 times the age of the universe to have errors add up to 1E-16.
>
> Ah yes. assuming you don't multiply or divide.
> >
> >
> >>    I've been using Mathematica to do practical work since version 1,
> >>
> >>   > and I've never encountered a bug in its numerics.
> >>
> >> I guess it is my turn to wonder if YOU know much about Mathematica.
> >
> > The difference is that I *use* it. You *fight* it.
>
> If finding bugs is fighting, sure.  If criticizing design features and
> sometimes suggesting changes is fighting, sure.
> >
> >>> Crazy results from numerical codes are a normal occurrence,
> >>
> >>   > I don't find Mathematica to be unusually hazardous here.
> >>
> >> I guess I disagree on this point.
> >
> > But you don't actually use numerical codes. You don't design bridges, compute trajectories, or study turbulence. So your opinion is uninformed.
>
> Um, who is uninformed?
> See
> http://adsabs.harvard.edu/abs/1998IJMPC...9..509F
>
> a paper entitled
>
> Symbolic Computation of Turbulence and Energy Dissipation in the Taylor
> Vortex Model
>
>
>
> >
> > Well, I'm not so sure that using Scheme is so good: it means that few potential collaborators are willing to try to read my code. To the average engineer or scientist, Lisp screams "forget your application and pay attention to the cool computer science".
>
> Just suggests that the average engineer is a sucky programmer.  That's
> not so surprising.
>
>   Now, I actually know enough of that CS crap that I can see past it to reality, but most don't. I primarily use Scheme to access a collection of useful functions that are actually written in C, but have Scheme (Guile interfaces. I think it would be much better if those interfaces were in a language friendlier to engineers, like Python. Scheme's fine for me, w ith my eccentric background, but not for most others.
> >
> >> Though
> >> Common Lisp  (a Lisp dialect) is used in space computations --
> >> the Hubble telescope.
> >
> > My old colleague Mark Johnston developed SPIKE for Hubble, but it has=
 been and is used for other missions as well. I was involved in getting the=
 ASCA and Chandra space observatories to adopt it for their operational pla=
nning. The last time I talked to Mark (a long time ago), he seemed rather=
 unhappy with CL as an implementation language for a practical AI applicati=
on. I don't think he'd choose CL again if he had to rewrite SPIKE.
> >
> I think the phrase "practical AI application" is still, for most people=
,
> an oxymoron.  There are plenty of practical CL applications.
> While people differ on their favorite languages for different
> purposes, my experience with students at Berkeley is that the
> time for them to write major parts of a compiler in C or C++ is
> LONGER than the time for them to learn Lisp and then write the same
> program in Lisp.  That's not rocket science, though.
>
> But then they are probably not average engineers.
>
>

[toc] | [prev] | [next] | [standalone]


#13499

FromJohn Doty <noqsiaerospace@gmail.com>
Date2013-02-15 06:56 +0000
Message-ID<kfkm72$j97$1@smc.vnet.net>
In reply to#13124
On Friday, February 8, 2013 10:43:19 PM UTC-7, Richard Fateman wrote:
> Regarding the Therac-25  (not theravac);
>
> you can read about it on Wikipedia.
>
> http://en.wikipedia.org/wiki/Therac-25
>
> and also look at the links, especially Nancy Leveson's report
>
> http://sunnyday.mit.edu/papers/therac.pdf
>
> especiall page 7, top.
>
> which I think is the most significant.
>
>
>
> As I recall,  the operator editing the display screen used
>
> carriage returns etc to go between fields and thought that
>
> the actual settings were reflected  by what appeared on the screen.
>
> This was not the case.
>
>
>
> There are other factors too. Lack of hardware interlocks, certainly
>
> a systems design error,  also
>
> meaningless error messages (how could THAT happen?)
>
> hard to debug programming language (assembler).

There are always bugs in non-trivial software.

There are always layers of misunderstanding:

1. The engineers (hardware and software) never fully understand the application, and are usually too stubborn to admit this.

2. The programmers never fully understand the hardware, and are usually too stubborn to admit this.

3. The operators never fully understand the machine, and are usually too stubborn to admit this.

Hardware is not perfectly reliable, especially in radiology departments where there's much EMI and possibly other problems like stray neutrons (I know from experience that unhardened microcontrollers misbehave near the MGH cyclotron in Boston, even in "shielded" areas). Operators are often distracted, tired, and pressured. And misspelling of silly made-up words is common, too ;-)

One must therefore assume that if the hardware can be put into a fatal configuration, it will be at some point. When it actually happens, the retrospective details of how it happened are misleading. The fundamental engineering issue is that one must design so that the ordinary, routine failures do not cascade to fatality. By removing the hardware interlock, the Therac engineers had designed the system to fail.

[toc] | [prev] | [next] | [standalone]


#13518

FromDavid Bailey <dave@removedbailey.co.uk>
Date2013-02-17 09:08 +0000
Message-ID<kfq6mr$4v7$1@smc.vnet.net>
In reply to#13499
On 15/02/2013 06:56, John Doty wrote:

>> hard to debug programming language (assembler).
>
> There are always bugs in non-trivial software.
>
> There are always layers of misunderstanding:
>
> 1. The engineers (hardware and software) never fully understand the application, and are usually too stubborn to admit this.
>
> 2. The programmers never fully understand the hardware, and are usually too stubborn to admit this.
>
> 3. The operators never fully understand the machine, and are usually too stubborn to admit this.
>
> Hardware is not perfectly reliable, especially in radiology departments where there's much EMI and possibly other problems like stray neutrons (I know from experience that unhardened microcontrollers misbehave near the MGH cyclotron in Boston, even in "shielded" areas). Operators are often distracted, tired, and pressured. And misspelling of silly made-up words is common, too ;-)
>
> One must therefore assume that if the hardware can be put into a fatal configuration, it will be at some point. When it actually happens, the retrospective details of how it happened are misleading. The fundamental engineering issue is that one must design so that the ordinary, routine failures do not cascade to fatality. By removing the hardware interlock, the Therac engineers had designed the system to fail.
>
>

I would really like to endorse that. I feel that some people like to 
scoff at software developers and their supposedly inadequate methods 
without proposing a viable alternative. For example, program proving 
seems an impossible dream for serious programs, and would in any case 
require a formal specification that might itself contain bugs.

All the most complex artifacts we have are either software, or contain 
large amounts of software. Software engineers are routinely required to 
deliver a level of complexity unheard of say 50 years ago - yet some 
people like to scoff when they sometimes fail.

Anything that is extremely complex is susceptible to mistakes - 
particularly if it can't really be tested until it is finished. Take for 
example, the Mars probe that crashed because of a mixup over physical 
units. Clearly such a trivial mistake would be unthinkable in a simpler 
project - I presume it got overlooked because it was hidden among vast 
amounts of other detail.

Anyone using Mathematica (or any other software) for a serious task has 
to take responsibility for the results he/she uses, and even then, there 
are still some risks involved. So for a very trivial example if you 
decide to check:

In[6]:= Integrate[Exp[ax]x,x]

Out[6]= (E^ax x^2)/2

by doing:

In[7]:= D[%,x]

Out[7]= E^ax x

Your check will return the original expression, and maybe lead you to 
believe you have the answer you wanted! Maybe if you recognise that you 
are prone to make that type of mistake, you should examine anything 
important in FullForm - but ultimately the user has to be responsible.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#13527

FromJoe Gwinn <joegwinn@comcast.net>
Date2013-02-18 10:59 +0000
Message-ID<kft1io$cp1$1@smc.vnet.net>
In reply to#13518
In article <kfq6mr$4v7$1@smc.vnet.net>, David Bailey
<dave@removedbailey.co.uk> wrote:

> On 15/02/2013 06:56, John Doty wrote:
>
> >> hard to debug programming language (assembler).
> >
> > There are always bugs in non-trivial software.
> >
> > There are always layers of misunderstanding:
> >
> > 1. The engineers (hardware and software) never fully understand the
> > application, and are usually too stubborn to admit this.
> >
> > 2. The programmers never fully understand the hardware, and are usually too
> > stubborn to admit this.
> >
> > 3. The operators never fully understand the machine, and are usually too
> > stubborn to admit this.
> >
> > Hardware is not perfectly reliable, especially in radiology departments
> > where there's much EMI and possibly other problems like stray neutrons (I
> > know from experience that unhardened microcontrollers misbehave near the
> > MGH cyclotron in Boston, even in "shielded" areas). Operators are often
> > distracted, tired, and pressured. And misspelling of silly made-up words is
> > common, too ;-)
> >
> > One must therefore assume that if the hardware can be put into a fatal
> > configuration, it will be at some point. When it actually happens, the
> > retrospective details of how it happened are misleading. The fundamental
> > engineering issue is that one must design so that the ordinary, routine
> > failures do not cascade to fatality. By removing the hardware interlock,
> > the Therac engineers had designed the system to fail.
> >
> >
>
> I would really like to endorse that. I feel that some people like to
> scoff at software developers and their supposedly inadequate methods
> without proposing a viable alternative. For example, program proving
> seems an impossible dream for serious programs, and would in any case
> require a formal specification that might itself contain bugs.
>
> All the most complex artifacts we have are either software, or contain
> large amounts of software. Software engineers are routinely required to
> deliver a level of complexity unheard of say 50 years ago - yet some
> people like to scoff when they sometimes fail.
>
> Anything that is extremely complex is susceptible to mistakes -
> particularly if it can't really be tested until it is finished. Take for
> example, the Mars probe that crashed because of a mixup over physical
> units. Clearly such a trivial mistake would be unthinkable in a simpler
> project - I presume it got overlooked because it was hidden among vast
> amounts of other detail.

I think there was also software reuse involved, if I recall correctly.

Anyway, for comparison, the large radars I work on typically have 10^6
lines of C/C++in them, and command and control systems are at least a
factor of ten larger still. 

Suffice it to say that getting most of the bugs found and fixed takes a
very large effort spread out over at least a few years, if all goes
well, which isn't always.

My impression is that Mathematica is tens of millions of lines of their own
variant of C.  What saves Wolfram is that this codebase accumulated
over the years, rather than being done in one big effort.

Joe Gwinn

[toc] | [prev] | [next] | [standalone]


#13542

From"djmpark" <djmpark@comcast.net>
Date2013-02-18 11:00 +0000
Message-ID<kft1l8$cqr$1@smc.vnet.net>
In reply to#13499
For critical applications isn't one of the best methods to have Team A that
writes the code, and Team B that tries to break it by throwing input at it?
It really helps if they hate each other's guts and Team B has skeptical
people who will be using the application.


David Park
djmpark@comcast.net 
http://home.comcast.net/~djmpark/index.html 



From: David Bailey [mailto:dave@removedbailey.co.uk] 


On 15/02/2013 06:56, John Doty wrote:

>> hard to debug programming language (assembler).
>
> There are always bugs in non-trivial software.
>
> There are always layers of misunderstanding:
>
> 1. The engineers (hardware and software) never fully understand the
application, and are usually too stubborn to admit this.
>
> 2. The programmers never fully understand the hardware, and are usually
too stubborn to admit this.
>
> 3. The operators never fully understand the machine, and are usually too
stubborn to admit this.
>
> Hardware is not perfectly reliable, especially in radiology 
> departments where there's much EMI and possibly other problems like 
> stray neutrons (I know from experience that unhardened 
> microcontrollers misbehave near the MGH cyclotron in Boston, even in 
> "shielded" areas). Operators are often distracted, tired, and 
> pressured. And misspelling of silly made-up words is common, too ;-)
>
> One must therefore assume that if the hardware can be put into a fatal
configuration, it will be at some point. When it actually happens, the
retrospective details of how it happened are misleading. The fundamental
engineering issue is that one must design so that the ordinary, routine
failures do not cascade to fatality. By removing the hardware interlock, the
Therac engineers had designed the system to fail.
>
>

I would really like to endorse that. I feel that some people like to scoff
at software developers and their supposedly inadequate methods without
proposing a viable alternative. For example, program proving seems an
impossible dream for serious programs, and would in any case require a
formal specification that might itself contain bugs.

All the most complex artifacts we have are either software, or contain large
amounts of software. Software engineers are routinely required to deliver a
level of complexity unheard of say 50 years ago - yet some people like to
scoff when they sometimes fail.

Anything that is extremely complex is susceptible to mistakes - particularly
if it can't really be tested until it is finished. Take for example, the
Mars probe that crashed because of a mixup over physical units. Clearly such
a trivial mistake would be unthinkable in a simpler project - I presume it
got overlooked because it was hidden among vast amounts of other detail.

Anyone using Mathematica (or any other software) for a serious task has to
take responsibility for the results he/she uses, and even then, there are
still some risks involved. So for a very trivial example if you decide to
check:

In[6]:= Integrate[Exp[ax]x,x]

Out[6]= (E^ax x^2)/2

by doing:

In[7]:= D[%,x]

Out[7]= E^ax x

Your check will return the original expression, and maybe lead you to
believe you have the answer you wanted! Maybe if you recognise that you are
prone to make that type of mistake, you should examine anything important in
FullForm - but ultimately the user has to be responsible.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#13577

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-02-22 06:05 +0000
Message-ID<kg71s0$4mo$1@smc.vnet.net>
In reply to#13542
On 2/18/2013 3:00 AM, djmpark wrote:
> For critical applications isn't one of the best methods to have Team A that
> writes the code, and Team B that tries to break it by throwing input at it?
> It really helps if they hate each other's guts and Team B has skeptical
> people who will be using the application.
>
sometimes 2 teams don't work the way you think.  Many years ago when 
people used punched cards, a high-quality operation would have two
data-entry people typing from hand-written input, where the first
one would punch holes in a card and the second would "verify" the card
deck --
essentially type the same thing, and if the two entries agreed, a
little notch would be punched at a card edge.  A "verified" deck of
cards, it was believed would have no data-entry errors.

If the original handwritten source was a FORTRAN program,it might
have lines like

  10 DO 20 I=100,200

And the keypunchers, who might not know anything about the content,
might type zero instead of letter Oh in one or more places. Or the
reverse.  The verifying keypuncher might get a mismatch on 0 or O,
and then would simply type the other one, so it would match.  It would
not of course guarantee correctness, just matching after perhaps an
initial mismatch.

Punch cards and verifier
  technology pretty much vaporized when programmers became
responsible for typing their own programs.

Similarly:
My guess is that the 2-team approach is not nearly as foolproof as
one might think, because the second team might be bulldozed into
thinking the first team's code represented the best informed and
most appropriate solution, even when it is not.  This may especially
be the case when (as is common), the application specification is
incomplete or even wrong, and what is correct may be more a matter
of opinion than absolute truth.

Anyway, getting back to Mathematica and Lisp...
Since Lisp programs tend to be short, there are fewer opportunities
for bugs.  Mathematica programs can be short too, but the irregular
syntax makes them harder to read. See djmpark's comment about FullForm
below.  Lisp is like FullForm all the time.

Since the semantics for Lisp programs tend to be understood by
(at least, moderately experienced) programmers,
there is less opportunity for a mismatch between specification and code.
(Compared to Mathematica).

Incidentally, I have an excellent name for the "language of Mathematica"
but Steve C (the moderator) won't allow me to mention it.
RJF

>
> David Park
> djmpark@comcast.net
> http://home.comcast.net/~djmpark/index.html
>
>
>
> From: David Bailey [mailto:dave@removedbailey.co.uk]
>
>
> On 15/02/2013 06:56, John Doty wrote:
>
>>> hard to debug programming language (assembler).
>>
>> There are always bugs in non-trivial software.
>>
>> There are always layers of misunderstanding:
>>
>> 1. The engineers (hardware and software) never fully understand the
> application, and are usually too stubborn to admit this.
>>
>> 2. The programmers never fully understand the hardware, and are usually
> too stubborn to admit this.
>>
>> 3. The operators never fully understand the machine, and are usually too
> stubborn to admit this.
>>
>> Hardware is not perfectly reliable, especially in radiology
>> departments where there's much EMI and possibly other problems like
>> stray neutrons (I know from experience that unhardened
>> microcontrollers misbehave near the MGH cyclotron in Boston, even in
>> "shielded" areas). Operators are often distracted, tired, and
>> pressured. And misspelling of silly made-up words is common, too ;-)
>>
>> One must therefore assume that if the hardware can be put into a fatal
> configuration, it will be at some point. When it actually happens, the
> retrospective details of how it happened are misleading. The fundamental
> engineering issue is that one must design so that the ordinary, routine
> failures do not cascade to fatality. By removing the hardware interlock, the
> Therac engineers had designed the system to fail.
>>
>>
>
> I would really like to endorse that. I feel that some people like to scoff
> at software developers and their supposedly inadequate methods without
> proposing a viable alternative. For example, program proving seems an
> impossible dream for serious programs, and would in any case require a
> formal specification that might itself contain bugs.
>
> All the most complex artifacts we have are either software, or contain large
> amounts of software. Software engineers are routinely required to deliver a
> level of complexity unheard of say 50 years ago - yet some people like to
> scoff when they sometimes fail.
>
> Anything that is extremely complex is susceptible to mistakes - particularly
> if it can't really be tested until it is finished. Take for example, the
> Mars probe that crashed because of a mixup over physical units. Clearly such
> a trivial mistake would be unthinkable in a simpler project - I presume it
> got overlooked because it was hidden among vast amounts of other detail.
>
> Anyone using Mathematica (or any other software) for a serious task has to
> take responsibility for the results he/she uses, and even then, there are
> still some risks involved. So for a very trivial example if you decide to
> check:
>
> In[6]:= Integrate[Exp[ax]x,x]
>
> Out[6]= (E^ax x^2)/2
>
> by doing:
>
> In[7]:= D[%,x]
>
> Out[7]= E^ax x
>
> Your check will return the original expression, and maybe lead you to
> believe you have the answer you wanted! Maybe if you recognise that you are
> prone to make that type of mistake, you should examine anything important in
> FullForm - but ultimately the user has to be responsible.
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>
>

[toc] | [prev] | [next] | [standalone]


#13584

FromDavid Bailey <dave@removedbailey.co.uk>
Date2013-02-23 12:01 +0000
Message-ID<kgab38$c7s$1@smc.vnet.net>
In reply to#13577
On 22/02/2013 06:05, Richard Fateman wrote:
>
> Anyway, getting back to Mathematica and Lisp...
> Since Lisp programs tend to be short, there are fewer opportunities
> for bugs.  Mathematica programs can be short too, but the irregular
> syntax makes them harder to read. See djmpark's comment about FullForm
> below.  Lisp is like FullForm all the time.
>

Yes Lisp is rather like FullForm - but who in their right mind would 
write all their Mathematica code in FullForm!

The beauty of FullForm, is that you can render an expression into this 
form to resolve any misconceptions you may have about operator 
precedences etc.

Since practically nobody writes all their Mathematica code in FullForm, 
it follows, does it not, that they must find Mathematica code 
significantly (I would say massively) more readable than Lisp!

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#13593

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-02-24 04:31 +0000
Message-ID<kgc52j$gae$1@smc.vnet.net>
In reply to#13584
On 2/23/2013 4:01 AM, David Bailey wrote:
> On 22/02/2013 06:05, Richard Fateman wrote:
>>
>> Anyway, getting back to Mathematica and Lisp...
>> Since Lisp programs tend to be short, there are fewer opportunities
>> for bugs.  Mathematica programs can be short too, but the irregular
>> syntax makes them harder to read. See djmpark's comment about FullForm
>> below.  Lisp is like FullForm all the time.
>>
>
> Yes Lisp is rather like FullForm - but who in their right mind would
> write all their Mathematica code in FullForm!
>
> The beauty of FullForm, is that you can render an expression into this
> form to resolve any misconceptions you may have about operator
> precedences etc.
>
It means that for many people the misconceptions that they have about
precedences are never revealed to them because they don't use FullForm,
and their programs are buggy.  There are hosts of arbitrary precedences
among // /. /; _ _? ....  that ordinary mathematics does not have, so
the ordinary math-familiar occasional programmer has no solid clue.
For example, do you know offhand if  Pi x // Sin is  Sin[Pi*x] or 
Pi*Sin[x] ?  Do you realize that if you type Sin Pi x you see as a 
result,  Pi Sin x.  so it seems that Mathematica believes sin(pi*x) = 
pi*sin(x).


> Since practically nobody writes all their Mathematica code in FullForm,
> it follows, does it not, that they must find Mathematica code
> significantly (I would say massively) more readable than Lisp!

How do you know this? Do you have a survey? Just curious how you can say 
this.
  Making
up statistics is easy.  Even with poll data it is sometimes hard
to draw conclusions.  For example,

46% of Americans belief that God created humans in their present
form within the last 10,000 years.

http://www.huffingtonpost.com/2012/06/01/gallup-poll-americans-creationism-evolution_n_1563800.html

............

Actually, the occasional preference for infix arithmetic in the midst
of lisp code can be satisfied by any of a number of packages, some
dating back to the 1960s. More recent code can be found in  e.g.
http://www.cs.berkeley.edu/~russell/code/logic/algorithms/infix.lisp
which allows you to write "x+y*z"  instead of (+ x (* y z)).

I find that most of my programs are much heavier on control logic than
on arithmetic. Occasionally I have to convert pre-typeset formulas into
expressions, in which case I might use an infix parser.

I have posted a program (in Lisp) which allows you to insert 
Mathematica-style arithmetic expressions into Lisp, e.g.
(+ x  (mma "z * Pi x//Sin").

So if you think Mathematica is more readable, you can use it for
mathematical expressions inside Lisp.

Other advantages, like open source free multiple suppliers ANSI Standard
debuggers libraries compilers ...



[toc] | [prev] | [next] | [standalone]


#13601

FromDavid Bailey <dave@removedbailey.co.uk>
Date2013-02-25 07:19 +0000
Message-ID<kgf39v$mj1$1@smc.vnet.net>
In reply to#13593
On 24/02/2013 04:31, Richard Fateman wrote:

> It means that for many people the misconceptions that they have about
> precedences are never revealed to them because they don't use FullForm,
> and their programs are buggy.  There are hosts of arbitrary precedences
> among // /. /; _ _? ....  that ordinary mathematics does not have, so
> the ordinary math-familiar occasional programmer has no solid clue.
> For example, do you know offhand if  Pi x // Sin is  Sin[Pi*x] or
> Pi*Sin[x] ?  Do you realize that if you type Sin Pi x you see as a
> result,  Pi Sin x.  so it seems that Mathematica believes sin(pi*x) =
> pi*sin(x).
>

I think anyone with some Mathematica experience uses a selection of 
operators, such as /. etc. and spells out other things longhand. For 
example, I always write Map rather than use the /@ operator. On the 
other hand, I use the // operator a lot, so I was able to answer your test.

>
> How do you know this? Do you have a survey? Just curious how you can say
> this.
Well, I have seen a fair bit of beginner Mathematica code, both from my 
consultancy and from answering questions on this forum. Practically 
nobody presents their code in full FullForm! For example, hardly anyone 
would spell out CompoundExpression rather than use a semicolon.

Suppose that FullForm were the only acceptable input to Mathematica - 
which you would appear to advocate. Would you want FullForm output also? 
That would result in some pretty ugly maths, so perhaps you would relent 
at this point, but part of the convenience of Mathematica is that you 
can paste bits of output back into other input!

Program bugs are often to be found in obscure bits of code that are hard 
to read. Formulae are obviously far easier to read if they are not 
written in FullForm (or Lisp!).

I would concede that it might be a good idea if certain built in symbols 
such as Sin had a new attribute such as NonAlgebraic that forbade their 
use in expressions like Sin Pi x.

The real truth is that conventional written maths is hopelessly 
ambiguous without context. That is why you can come up with expressions 
like Sin x - or indeed f(x). Likewise hardly any maths/physics paper 
would spell out those multiplications that were non-commutative (e.g. by 
using a special operator) - the reader is just meant to figure it out. 
Thus every CAS has to resolve those ambiguities one way or another.  I'd 
say Stephen Wolfram's design is about as good as you can get - and 
certainly better than Lisp!

David Bailey
http://www.dbaileyconsultancy.co.uk



[toc] | [prev] | [next] | [standalone]


#13617

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-02-26 06:09 +0000
Message-ID<kghjj1$s40$1@smc.vnet.net>
In reply to#13601
On 2/24/2013 11:19 PM, David Bailey wrote:
> On 24/02/2013 04:31, Richard Fateman wrote:
>
>> It means that for many people the misconceptions that they have about
>> precedences are never revealed to them because they don't use FullForm,
>> and their programs are buggy.  There are hosts of arbitrary precedences
>> among // /. /; _ _? ....  that ordinary mathematics does not have, so
>> the ordinary math-familiar occasional programmer has no solid clue.
>> For example, do you know offhand if  Pi x // Sin is  Sin[Pi*x] or
>> Pi*Sin[x] ?  Do you realize that if you type Sin Pi x you see as a
>> result,  Pi Sin x.  so it seems that Mathematica believes sin(pi*x) =
>> pi*sin(x).
>>
>
> I think anyone with some Mathematica experience uses a selection of
> operators, such as /. etc. and spells out other things longhand. For
> example, I always write Map rather than use the /@ operator. On the
> other hand, I use the // operator a lot, so I was able to answer your test.

And for people without much Mathematica experience, or who are not
adventuresome and just use the syntax they learned in a math class and
maybe from Pascal or C,  these things will remain mysterious indefinitely.

>
>>
>> How do you know this? Do you have a survey? Just curious how you can say
>> this.
> Well, I have seen a fair bit of beginner Mathematica code, both from my
> consultancy and from answering questions on this forum. Practically
> nobody presents their code in full FullForm! For example, hardly anyone
> would spell out CompoundExpression rather than use a semicolon.

This is true.  But we also have lots of examples of people
  misunderstanding the code they have written that would have
been clear had they simply used FullForm.  I think we have no
idea how many people make mistakes in syntax in the real world.
I do have some idea of how many people misunderstood how to type
sin(x) from what was typed in to a website I maintained that did
integral table lookup and allowed Mathematica syntax.  About
30% got that, or something like it, wrong.

>
> Suppose that FullForm were the only acceptable input to Mathematica -
> which you would appear to advocate.

Not really.  I am advocating the simplicity and reliability of a
fullform-like programming language -- especially for programming
and control structure.  The "data" language for math expressions
could be the same, but could also be infix if there was a lot of
such math.

  Would you want FullForm output also?
For programs, yes.
For math expressions, I think experience has been that people
(myself included) prefer something like
MathJax, (2d typeset stuff) or options for linear strings.
Other options include fullform and even spoken stuff.  It is
perfectly clear that something like fullform for expressions
is a key to understanding some 'features' of Mathematica that
figure prominently in the list of bug reports.

> That would result in some pretty ugly maths, so perhaps you would relent
> at this point, but part of the convenience of Mathematica is that you
> can paste bits of output back into other input!

This is a feature that is available in many ways.  select a 
subexpression and get the underlying representation, and paste it 
somewhere else.
This is especially simple if the output is fullform, in which case
the selection can be done in an ordinary text editor. If it is
done in some 2-d display, it is more complicated but the effect --
which is to get the moral equivalent of the fullform underneath
the 2-d display, is the same.


>
> Program bugs are often to be found in obscure bits of code that are hard
> to read. Formulae are obviously far easier to read if they are not
> written in FullForm (or Lisp!).

If you have looked at formulas published in historic books of integrals
you will find that they are sometimes hard to read because of ambiguous
or even incorrect syntax that is disambiguated only because the reader
KNOWS that an integration formula could only be one of the possible
choices.  Actually in some cases I've simply had to test the formula
by some other means (e.g. integration or differentiation) to figure
out the formula in the book.

The point is, complicated or poorly typeset or "old" formulas are
not the pure crystalline beauty that you might like to believe.
For an easy example, look at the crap turned in by calculus students.

>
> I would concede that it might be a good idea if certain built in symbols
> such as Sin had a new attribute such as NonAlgebraic that forbade their
> use in expressions like Sin Pi x.

There is a format in Mathematica called TraditionalForm, or something
like that.  I have never used it.
>
> The real truth is that conventional written maths is hopelessly
> ambiguous without context.

Ah yes.

  That is why you can come up with expressions
> like Sin x - or indeed f(x). Likewise hardly any maths/physics paper
> would spell out those multiplications that were non-commutative (e.g. by
> using a special operator) - the reader is just meant to figure it out.

It is not even that simple.  Sometimes the same notation is used to
mean different things in the same paper.  Look for the phrase "by
abuse of notation".

> Thus every CAS has to resolve those ambiguities one way or another.  I'd
> say Stephen Wolfram's design is about as good as you can get - and
> certainly better than Lisp!

Well, I guess I disagree with respect to (a) the programming language,
which is, around the edges, is a hodge-podge of peculiar syntax
  and semantics,  easily and frequently demonstrated.
and also   (b) the  mathematical/data/numerical expression language,
  which requires [], and makes up its own incompatible definitions
of atan2, list, etc.


This particular thread was mostly about (a).
As you say, for an experienced programmer who either knows how
to keep away from the hairy edges of the Mathematica language,
or knows how to use them and uses them with relish, there
is less of a problem than with the naive, or the unskilled/
careless/unfortunate.  Unfortunately, most programmers are not so
skilled as they think they are.  Like the 80% of automobile
drivers who consider themselves "above average".

RJF

>

[toc] | [prev] | [next] | [standalone]


#13127

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-01-13 02:51 +0000
Message-ID<kct7fe$sgh$1@smc.vnet.net>
In reply to#13103
On 1/11/2013 7:23 PM, amzoti wrote:

>
> Would it be helpful to learn Lisp in order to improve programming skills in Mathematica?
Possibly.
>
> If so, what Lisp books would you recommend?
Many people seem to think Practical Common Lisp (free online)  by Peter 
Seibel is good.
I like Peter Norvig's Paradigms of AI Programming, which even shows how
you might write a Mathematica-like program, including matching, 
simplification, integration  in Lisp.

>
> What variant of Lisp would you recommend using for practice - Common Lisp, Scheme, or Clojure?

It doesn't matter much, for your purposes.  You can get free or trial 
versions of any of these. Maybe what you need is something like "lisp in 
a box"

Would Mathematica itself be a better choice
probably not
(I am not sure if it supports all the Lisp language constructs and such).
it doesn't
>
> What about Haskell?
another functional language with a small but enthusiastic group of users.

Learning to think in a functional programming framework is
probably a good idea that could pay off even if you intend to
eventually write in Mathematica.

RJF


[toc] | [prev] | [next] | [standalone]


#13158

FromJohn Doty <noqsiaerospace@gmail.com>
Date2013-01-16 06:38 +0000
Message-ID<kd5hto$jjk$1@smc.vnet.net>
In reply to#13103
On Friday, January 11, 2013 8:23:16 PM UTC-7, amzoti wrote:

> It is clear the Mathematica uses Lisp as one of the example programming paradigms it pulls from and I have a general question regarding this.

Perhaps not as much as you think. Mathematica is fundamentally a term rewriting system, a more general concept than the lambda calculus behind Lisp. To be sure, the easiest thing to express as term rewriting is the replacement of a function invocation by its body (as in the lambda calculus), but Mathematica can do more complex things, some rather strange from the lambda calculus point of view. Consider

f_[whoCalled]^:=f
Sin[whoCalled]

which yields

Sin

Very alien to Lisp!

[toc] | [prev] | [next] | [standalone]


#13179

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2013-01-17 04:15 +0000
Message-ID<kd7tsm$q43$1@smc.vnet.net>
In reply to#13158
On 1/15/2013 10:38 PM, John Doty wrote:
> On Friday, January 11, 2013 8:23:16 PM UTC-7, amzoti wrote:
>
>> It is clear the Mathematica uses Lisp as one of the example programming paradigms

  it pulls from and I have a general question regarding this.
>
> Perhaps not as much as you think. Mathematica is fundamentally a term rewriting system,


a more general concept than the lambda calculus behind Lisp.

....
If you want a term rewriting system, several of them (free, open source) 
have been written in Lisp.  Anything that Mathematica can
do computationally can be done, in principle, with any "Turing equivalent"
programming language, and that includes Lisp.

Lisp is not an implementation of the lambda calculus as some people
seem to think.  McCarthy used the word "lambda" the way Mathematica
uses the word "Function".
Other than that use to introduce formal parameters, nothing much was
taken from Church's writings, as McCarthy has explained in some
historical articles.


  To be sure, the easiest thing to express as term rewriting

is the replacement of a function invocation by its body

(as in the lambda calculus), but Mathematica can do more

complex things, some rather strange from the lambda calculus point of 
view. Consider
>
> f_[whoCalled]^:=f
> Sin[whoCalled]

Certainly such a feature could be implemented in a pattern-matching 
system written in Lisp.  Since most lisp implementations provide
many "introspective" features including examining the run-time call 
stack, I think it would be possible to extract "who called me" from
this information of the (complete) call stack.  Lisp systems also tend
to provide tools that answer questions like "where are all the calls to
the function f in the source code.

>
> which yields
>
> Sin
>
> Very alien to Lisp!

Not really.

>

[toc] | [prev] | [next] | [standalone]


Page 3 of 4 — ← Prev page 1 2 [3] 4  Next page →

Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web