Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Olympic Spririt for Forth
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 51 - 75 of 143 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Paul Rubin  
View profile  
 More options Oct 4 2012, 9:54 pm
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Thu, 04 Oct 2012 18:54:24 -0700
Local: Thurs, Oct 4 2012 9:54 pm
Subject: Re: Olympic Spririt for Forth
"Elizabeth D. Rather" <erat...@forth.com> writes:

> A data type check certainly doesn't guarantee you've got the "right
> stuff."

This was about stack effect, or correspondingly (in other languages)
making sure that the caller passed the right number of args to the
callee.  

> I realize that programmers who have felt comforted by syntax/data type
> checking compilers feel a little naked getting used to Forth, but with
> a little experience you'll understand the Forth programming/testing
> cycle and feel more comfortable.

I've written enough C code in my life to appreciate the difference
between having to find the bug by examining the state of memory with
gdb, and having the Python (etc.) interpreter tell me "wrong number of
args at line 237, called from line 415", showing the source code at each
of those two lines.  I see the mismatch, say "oops" and fix the code.
(# of args isn't a good example of this, since C checks that statically,
but you get the idea).  

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
A. K.  
View profile  
 More options Oct 5 2012, 2:19 am
Newsgroups: comp.lang.forth
From: "A. K." <a...@nospam.org>
Date: Fri, 05 Oct 2012 08:19:47 +0200
Local: Fri, Oct 5 2012 2:19 am
Subject: Re: Olympic Spririt for Forth
On 05.10.2012 03:54, Paul Rubin wrote:

One of my first Forth programs in my life was assert( .. )
which pretty much worked like Hayes T{ .. }.
I used to use assert( a lot in the beginning. Today my preferred way of
coding critical code sections is still with paper, pencil, and rubber
gum.  :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gerry Jackson  
View profile  
 More options Oct 5 2012, 3:20 am
Newsgroups: comp.lang.forth
From: Gerry Jackson <ge...@jackson9000.fsnet.co.uk>
Date: Fri, 05 Oct 2012 08:20:27 +0100
Local: Fri, Oct 5 2012 3:20 am
Subject: Re: Olympic Spririt for Forth
On 05/10/2012 02:11, Paul Rubin wrote:
 >> I try to make these modifications one little piece at a time, and then
 >> test it, as well.
 >
 > OK, so you make a small modification and create a bug, which makes your
 > test fail.  What now?  You have to figure out the cause of the bug.
 > And, I think, this is much easier in a (runtime) type-checked and
 > bounds-checked language, than something like Forth.

This is made easier by using a test file - see below

 >
 >> look at John Hayes ttester (in Gforth under test/ttester.fs;
 >> require test/ttester.fs
 >> : bounds ( addr len -- last first )  over + swap ;
 >> t{ 3 5 bounds -> 8 3 }t
 >
 > Oh this is nice, and I didn't know about it.  I'm going to start
using it.
 >

Even better are further developments of it by David Williams and Josh
Grams. See
http://www-personal.umich.edu/~williams/archive/forth/utilities/xtest...
and associated files and
http://qualdan.com/forth/flex-tester-2012-05-30.tar.gz

These were written for application program development rather than Forth
system testing which was the original aim of the Hayes tester.

Like some others I routinely use a tester like this when writing a
program larger than a few words that I intend to maintain and use. After
all you only have to type a simple test once into a text file instead of
continually typing the same thing when manually testing at the keyboard.
Then just start the Forth up with a command line that includes the test
file - a simple double click in an IDE.

If such a test program is continually added to during development, you
have a regression test available when you've finished. This test program
can then be provided with the program for users e.g. see files
dstrings.fs and dstrings-test.fs at
www-personal.umich.edu/~williams/archive/forth/strings/
dstrings is a strings package with garbage collection - something you
mentioned as being desirable.

--
Gerry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Elizabeth D. Rather  
View profile  
 More options Oct 5 2012, 4:18 am
Newsgroups: comp.lang.forth
From: "Elizabeth D. Rather" <erat...@forth.com>
Date: Thu, 04 Oct 2012 22:18:12 -1000
Local: Fri, Oct 5 2012 4:18 am
Subject: Re: Olympic Spririt for Forth
On 10/4/12 3:54 PM, Paul Rubin wrote:

> "Elizabeth D. Rather" <erat...@forth.com> writes:
>> A data type check certainly doesn't guarantee you've got the "right
>> stuff."

> This was about stack effect, or correspondingly (in other languages)
> making sure that the caller passed the right number of args to the
> callee.

Since DEPTH returns the number of things on the stack, you could test
that. However, since the actual stack depth at any point is
context-dependent (i.e., you never know which things on the stack are
actually parameters for other words, not *this* one), that is strictly a
early-stage debugging tool.

But this is why many systems (including SwiftForth, SwiftX, etc.) have
stack-monitoring facilities. In early-stage testing, if you have a word
that is misbehaving you can type your way through it or use a stepper
and watch the stack behavior.

Such tools are "quality of implementation" issues, not language issues.

>> I realize that programmers who have felt comforted by syntax/data type
>> checking compilers feel a little naked getting used to Forth, but with
>> a little experience you'll understand the Forth programming/testing
>> cycle and feel more comfortable.

> I've written enough C code in my life to appreciate the difference
> between having to find the bug by examining the state of memory with
> gdb, and having the Python (etc.) interpreter tell me "wrong number of
> args at line 237, called from line 415", showing the source code at each
> of those two lines.  I see the mismatch, say "oops" and fix the code.
> (# of args isn't a good example of this, since C checks that statically,
> but you get the idea).

Different Forths have different programming aids, as I said above. I
suggest you evaluate several different systems as regards programming aids.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anton Ertl  
View profile  
 More options Oct 5 2012, 7:08 am
Newsgroups: comp.lang.forth
From: an...@mips.complang.tuwien.ac.at (Anton Ertl)
Date: Fri, 05 Oct 2012 11:08:29 GMT
Local: Fri, Oct 5 2012 7:08 am
Subject: Re: Olympic Spririt for Forth

This reminds me of what I do with data in charts written in Postscript.

In simple cases, the data is interpreted directly and drawn right away:

%trad
1
   3040561373
   3042635978
   3043166570
3 copy median3 /scalefactor swap def
median3point mt
%doprims
   3106897257
   3103339195
   3106836628
median3point lt

In more complex cases I put the data in arrays and drawn them later:

/compress
[ 0.0
  0.0
 29.3
 41.5
 29.3
  0.0
  0.0
] def
...
[ /compress /jess /db /javac /mpegaudio /mtrt /jack ]
{ << /bench rot >> begin bars end } forall

Finally, I put the data in procedures that can be used to draw things
or build arrays from the data several times in different ways, if
needed:

/core2 { %smaug
[
100383730 event0x0041008D@0
5370 event0x0041008E@1
5638338384 event0x00410000@0x40000000
3251152763 event0x00410000@0x40000001
100381820 event0x0041008D@0
5180 event0x0041008E@1
1638276480 event0x00410000@0x40000000
840453768 event0x00410000@0x40000001
(primitive) oneword
2400384720 event0x0041008D@0
300006874 event0x0041008E@1
7938302989 event0x00410000@0x40000000
9241083370 event0x00410000@0x40000001
400381976 event0x0041008D@0
5822 event0x0041008E@1
1938271683 event0x00410000@0x40000000
940217000 event0x00410000@0x40000001
(code-def) oneword
...
] /default oneforth
....

} def

/scalefactor 2000000000 def

/oneforth {load exec} def
/oneword {drop sub scalefactor div} def
%select none by default, later change one event and one forth from default
/event0x0041008D@0          {drop} def
/event0x0041008E@1          {drop} def
/event0x00410000@0x40000000 {drop} def
/event0x00410000@0x40000001 {drop} def
/tsc                        {drop} def
/event0x004100C0            {drop} def
/event0x004100C4            {drop} def
/event0x004100C5            {drop} def
...
<< /results {core2} /event0x00410000@0x40000000 {} >> bars

This selects the event0x00410000@0x40000000 records from the data and
draws a set of bars (for a bar chart).  I guess I had to write _and
debug_ all these event* procedures before running the program
successfully.  So what.  The actual work was elsewhere.

These three steps are actually the evolution of how I write these
charts.  The main driver here was to minimize the manual work for
integrating the data coming out of my measurement scripts into the
charts.

>If I'm supposed to implement such stuff myself, why do I want your
>toolkit in the first place?  Obviously as a FOSS user I want to be able
>to extend the toolkit as a last resort, and obviously in the first
>releases of a toolkit, the important use cases haven't necessarily been
>identified.  But after a few iterations I'd expect the toolkit to do
>pretty much everything needed, and modularity makes me not want to
>maintain my own fork if I can help it.

Yes, Knuth expected users to do their own forks of TeX for specialized
purposes, but this has not really happened, even though there is no
evolution of TeX to speak of (so merging changes back into the fork
would not have been an issue).  People just don't want to much with
the internals of an existing program.

OTOH, the success of applications that support scripting and add-ons
shows that, no, you cannot expect a program to do everything that's
needed out of the box, even after a few iterations.  So people are
willing to program extensions given a defined interface (e.g., various
packages on top of TeX, such as LaTeX, instead of a fork of TeX).

>OK, so you make a small modification and create a bug, which makes your
>test fail.  What now?  You have to figure out the cause of the bug.
>And, I think, this is much easier in a (runtime) type-checked and
>bounds-checked language, than something like Forth.

For a small modification, the bug is usually obvious.  How can
something else be easier.

Debugging Forth code is usually easy in my experience, certainly for
things that would be caught by a type or bounds checker.  But maybe it
takes experience to write programs such that such bugs are easy to
find.

>> If you haven't found Forth strings, arrays, hash tables, etc., by now,
>> it's because you were looking at an embedded Forth, where all these
>> features just don't fit.

>I'm using gforth and I didn't notice any of that in the manual.

Strings: http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Memory-Blocks...

(no docs for Bernds strings package, though).

Arrays:
http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Address-arith...

Hash tables:
http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Word-Lists.html

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anton Ertl  
View profile  
 More options Oct 5 2012, 9:20 am
Newsgroups: comp.lang.forth
From: an...@mips.complang.tuwien.ac.at (Anton Ertl)
Date: Fri, 05 Oct 2012 13:08:22 GMT
Local: Fri, Oct 5 2012 9:08 am
Subject: Re: Olympic Spririt for Forth

I don't find this easier than LaTeX or HTML, and in the end you need
some more "abstract" markup after all, e.g., for links.  The wide use
of the HTML-like BBcode also supports my view.

>Yes, showing where you made a mistake is a good idea.  But people are
>much better at these visual markups, they do produce correct code much
>more likely, because correct code is visually pleseant there.  Incorrect
>code isn't.  That *does* matter.

My experience is that at some point visual pleasantness breaks down
and becomes hard to maintain.  E.g., links, or comments.  So now you
have a language that appears easy at first, and breaks down later.

>The lession I learned from both LaTeX and HTML is:

>* the content is in a free-form markup, i.e. you need to be flexible how
>to parse your markup (one single markup notation won't do it)

Your example above is everything but free-form.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2012: http://www.euroforth.org/ef12/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 5 2012, 11:48 am
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Fri, 05 Oct 2012 17:48:44 +0200
Local: Fri, Oct 5 2012 11:48 am
Subject: Re: Olympic Spririt for Forth

Anton Ertl wrote:
>>This sort of type-writer markup seems to be pretty easy to grasp.

> I don't find this easier than LaTeX or HTML, and in the end you need
> some more "abstract" markup after all, e.g., for links.  The wide use
> of the HTML-like BBcode also supports my view.

IMHO the motivation for BBcode is to make it easy to transform into
HTML.  The motivations for the other, more visual codes which are also
widely used (like the Wikipedia syntax) is to make it easier.

"more abstract" markup uses more difficult constructs, of course.  
Though I consider [url|name] as less cumbersome than <a
href="url">name</a>.  The only problem there is with the [url|name]
notation is that some systems actually have a [name|url] syntax ;-).

> My experience is that at some point visual pleasantness breaks down
> and becomes hard to maintain.  E.g., links, or comments.  So now you
> have a language that appears easy at first, and breaks down later.

So your suggestion is to make everything hard to maintain, not just the
difficult parts?  If I would add comments to such a language, I would
use skip-to-eol comments, and use one of the common EOL comments like %,
# or //, which people are familiar with.

>>The lession I learned from both LaTeX and HTML is:

>>* the content is in a free-form markup, i.e. you need to be flexible
>>how to parse your markup (one single markup notation won't do it)

> Your example above is everything but free-form.

What I want to say is that the content is *not* in a form mandated by
the browser (which would be fixed-form, fixed to whatever form the
browser accepts), but one mandated by the content-provider (or that
framework).  Having the browser provide a fixed parsing program is so
obviously wrong when you look at the current web: Almost everybody who
has user-generated content uses something else than HTML, even when it
is relatively close like BBCode.

So you say "this is BBcode" and the browser fetches a BBcode parser and
uses that to read your content.  Or you say "This is a particular Wiki
markup", and the browser uses that parser.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Albert van der Horst  
View profile  
 More options Oct 5 2012, 3:09 pm
Newsgroups: comp.lang.forth
From: alb...@spenarnc.xs4all.nl (Albert van der Horst)
Date: 05 Oct 2012 19:09:23 GMT
Local: Fri, Oct 5 2012 3:09 pm
Subject: Re: Olympic Spririt for Forth
In article <6cd04453-c73a-4587-a160-0603784ef445@googlegroups.com>,

 <theoriginalsn...@gmail.com> wrote:
>Hi Paul,
>> .. And don't you have to boot your PC in order to
>> start the terminal program before you can type to the Fignition board?

>FIGnition, unlike embedded MCU boards like Launchpad or Arduino, is a
>whole, self-contained computer with a keypad for programming and video
>output and boots straight into its programming environment.

>I thought it was obvious from the introductory paragraph on the
>FIGnition home page that with FIGnition you can code on its keypad,
>directly into the machine as you would with an early 80s micro.

Indeed, pretty unbelievable. It is beyond me they didn't spare a
5 pin mini DIN connector, so you can plug in a vintage keyboard.
Typical dump prices 1 or 2 euro's. Then of course you can
find them by the wayside.
(I've collected 5 IBM original's, so my stock should last 5 life times.)

>However, on reflection, perhaps it's not obvious enough for some people.

It was the first thing I looked for. Do I have to hook up a PC, and
where do I plug it in? But then I'm known for getting at the important
points fast.

>-cheers from julz

Groetjes Albert

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
theoriginalsn...@gmail.com  
View profile  
 More options Oct 5 2012, 3:29 pm
Newsgroups: comp.lang.forth
From: theoriginalsn...@gmail.com
Date: Fri, 5 Oct 2012 12:29:10 -0700 (PDT)
Local: Fri, Oct 5 2012 3:29 pm
Subject: Re: Olympic Spririt for Forth
Hi Paul,

> > the reality is that the end-to-end complexity is still the biggest
> > hurdle the kids have to face.
> Maybe you could say exactly what you mean by "end-to-end complexity".
> you're advocating dealing with it through a very simple
> implementation.

Abstraction is great for usability, but not so helpful for understanding. For example, a light switch 'buttons-up' the complexity of the national grid, and it's known they're very easy to operate. But it doesn't mean that we teach electronics using a slightly more detailed version of the national grid. Instead we start with simple, but real, circuits that can be understood.

The problem is that this buttoning up never really works perfectly for two reasons: firstly there's an inevitable conflict between requirements, resources and their implementation. For example, the user-interface for a GPS system is more complex than for traditional map navigation and future needs to support, e.g. congestion re-routing or inter-car collaboration.

Secondly, it's not practical to wait for systems to be completely abstracted before we build on them - in reality there's a continual mix of technologies that expose their heritage at various levels.

But end-to-end complexity can be understood fairly easily. In the early 80s we'd turn on a computer and start coding within seconds. By the mid-80s simple compilers were in vogue so we coded using a edit-compile-run cycle with monolithic programs. Here, conventional tools exposed underlying requirements for performance at the expense of ease-of-development. By the late 80s OS's were becoming more complex and GUIs were being introduced; so there was a need for simple IDEs which supported the libraries and multi-file applications. Here, multi-file projects expose the implementation trade-off between compilation performance and project size requirements. Project development again became more complex.

In the 90s raw APIs were 'buttoned-up' behind OO-frameworks, but today development environments such as Eclipse expect even newbies to handle multiple targets, sdks, simulators, mixed-language project implementations across objective-C/Javascript boundaries; mandatory source control and a plethora of cloud-hosted client-server scripting paradigms.

We can button-up this complexity for users, they just click on an Appstore and suddenly Augmented Reality is at their fingertips. But in the same way we don't teach electronics by diving into the national grid (or a simplified virtual national grid), it doesn't mean the best way is to teach using either fake programming paradigms (e.g. KODU or Scratch) or full-on environments where they just stitch stuff they don't understand together in ways they don't really understand.

You see this in practice, e.g. the previous poster who was shocked that GRADUATES don't understand how computers actually work as it's someone else's problem. But also in the way you don't really want to deceive kids with fake programming.

A good example was Young Rewired State in Birmingham a month or so ago. One of the finalists (a reasonably bright student) had created a Scratch-based app, but you could see that as he stood up he was basically embarrassed about it.

> Geany is a fancy IDE sort of like Eclipse.. handles multiple languages
> .. people just
> getting started should probably consider alternatives, so I mentioned
> Geany.

Indeed, it doesn't get much simpler than Eclipse ;-)

> Python is a language, not a complete environment.

True, it's hard to cram anything better than a crude CLI into 860Kb.

> The CPython distribution does come with an IDE

Hmmm, yes at 23Mb it might just be possible!

> it's less powerful than fancier ones like Geany.

Understandable, it's only 23Mb.

> I've never personally used LOGO but I know it's gotten some traction for
> teaching little kids.

Logo's smart; about as powerful as Lisp, but with a friendlier syntax. It's not totally general purpose, which is probably why it didn't replace Basic, but it is pretty good.

> How many kids today do you think are coding in Minecraft, compared with
> "early 80s systems"?

I really don't know. I do know that about 10 to 20x fewer kids can code at all compared with the mid-80s, despite the far greater numbers of available computers so I guess either it isn't that transferable or Minecraft 'coding' is more like HTML or something.

> Another theory ..in the early 80's the only thing [kids]
> could really do with them was code, and today there's far more
> possibilities.

I think there's some truth in that, though there were plenty of non-programming electronic toys in the day. It's certainly true there's far more distractions on modern systems - it's always far easier to not code than to code for all of us, but the complexity of modern systems (including modern coding systems) plays a huge part from personal experience.

> > I thought it was obvious.. with FIGnition you can code on its keypad
> No, that's not mentioned.

I meant, I now realise it's not obvious, it'll get changed.

> ..It frankly sounds nuts

Surprisingly, it's not though, it's faster than texting and as fast as typing on a touch-screen :-)

> I don't know if modern TV sets.. still have composite video input.  

Pretty much all of them still have composite (sometimes multiple inputs) and/or SCART.

> You know, that Atmega part in the Fignition purports to be an 8-bit
> micro that's sort of a modernized 6502, but how do you know it's not
> really a much faster x86 core, running firmware that emulates the AVR
> instruction set, eh? ;-)

Because people have decapsulated AtMega168s and the functional units can be easily seen. But you'd be able to figure it out anyway from the outrageous power consumption; ns-level timing inaccuracies; parts cost (Atmel would probably go bust if they took that approach) etc. Like I'm arguing, almost nothing can be perfectly abstracted ;-)

-cheers from julz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
theoriginalsn...@gmail.com  
View profile  
 More options Oct 6 2012, 4:40 am
Newsgroups: comp.lang.forth
From: theoriginalsn...@gmail.com
Date: Sat, 6 Oct 2012 01:40:09 -0700 (PDT)
Local: Sat, Oct 6 2012 4:40 am
Subject: Re: Olympic Spririt for Forth
Hi Mark,

Just looking at some other posts!

> > Mark Wills <forthfr...@gmail.com> writes:
> > >Well, for youngsters, how about a cycle computer [...features
> > > suggested hardware...]

Yes, that'd be fun. It's a much more practical application than any 555 circuit, could be done with Forth and Arduino could do it pretty easily (you could do both, using AmForth). They can learn a lot about electronic design and could add their own features. Who cares if it's not a commercial solution - it'll help them get out of the hyper-consumerist ethos!

Being inspired in these terms, is all about being able to see that your only choice isn't just to buy prepackaged products.

-cheers from julz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
A. K.  
View profile  
 More options Oct 6 2012, 5:18 am
Newsgroups: comp.lang.forth
From: "A. K." <a...@nospam.org>
Date: Sat, 06 Oct 2012 11:18:43 +0200
Local: Sat, Oct 6 2012 5:18 am
Subject: Re: Olympic Spririt for Forth
On 06.10.2012 10:40, theoriginalsn...@gmail.com wrote:

> Hi Mark,

> Just looking at some other posts!

>>> Mark Wills <forthfr...@gmail.com> writes:
>>>> Well, for youngsters, how about a cycle computer [...features
>>>> suggested hardware...]

> Yes, that'd be fun. It's a much more practical application than any 555 circuit, could be done with Forth and Arduino could do it pretty easily (you could do both, using AmForth). They can learn a lot about electronic design and could add their own features. Who cares if it's not a commercial solution - it'll help them get out of the hyper-consumerist ethos!

> Being inspired in these terms, is all about being able to see that your only choice isn't just to buy prepackaged products.

> -cheers from julz

C'mon --- why on earth should kids learn Forth ???
They can spend their time way better to find their own place in this
everchanging world.

The "target market" for Forth are not bicycle riding kids but
technically oriented young students. For them you can crank up the
complexity of a Forth demo, for instance a house photovoltaic battery
charger or somesuch that is more useful than taping an Arduino board to
a bike handle.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Howerd  
View profile  
 More options Oct 6 2012, 9:17 am
Newsgroups: comp.lang.forth
From: Howerd <howe...@yahoo.co.uk>
Date: Sat, 6 Oct 2012 06:17:22 -0700 (PDT)
Local: Sat, Oct 6 2012 9:17 am
Subject: Re: Olympic Spririt for Forth

Hi Mark,

When I was 15 I asked my school if they could by me some bits to make a computer, but they had no idea what I was talking about. That was 1969 - I bought my first computer around 1982 - an Amstrad CPC64.

I do worry about young people these days being so gullible - the power of advertising seems to be strong - and I don't see much judgement or discretion being used, or curiosity about how things really work.

Two questions : do you write a Word document, or do you program it? Do you program in C# or write in C#?

"Programming" in the sense that it is used in the sorts of companies where I work, is less about problem solving and more about fighting the IDE. It follows the corporate structure - interfacing is ...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ilya Tarasov  
View profile  
 More options Oct 6 2012, 11:30 am
Newsgroups: comp.lang.forth
From: Ilya Tarasov <ilya74.tara...@gmail.com>
Date: Sat, 6 Oct 2012 08:30:46 -0700 (PDT)
Local: Sat, Oct 6 2012 11:30 am
Subject: Re: Olympic Spririt for Forth

> Ilya Tarasov wrote:

> > Does anybody hope on the such symple device,

> > which can be implemented by hundreds ways?

> Well, I was just responding to the initial post. Building your own computer *is* inspiring. It's also a Forth-based computer, which is what you want on this forum eh? Like proper computers it doesn't need an external host to do any programming with it. And it's very similar to an early 80s micro, using similar resources.

Perhaps, if I told I've got a linecard of my own FPGA-based Forth-processors, it makes things easier. It is not necessary to explain me all benefits of Forth in embedded systems. I just want to say that first imagination and 'Wow! -effect' are not enough to provide a valuable results. Simple projects could be a good quick-start for beginners, but they should be followed by more complex ones. So, we should think about teaching course, not about simple device without any specific functions.

> But the key thing *is* the simplicity, that's what makes it special; because only simple machines can be mastered and understood from end-to-end. How does it benefit kids if their only true experience of programming requires incomprehensible Giga-byte and GigaHertz, multi-core monstrosities? How would they ever grasp it, if even reading the code in the system would take many lifetimes?

> And how is it inspirational if every computer we experience is pre-packaged, surface-mount technology that requires a microscope to modify it? It's in some sense impressive, but what does that say about accessibility?

It looks like a mix with platform-independent basic principes (that's good!) and evaluation platforms, which targets a very simple applications. You should to choose, what you want to do - explain something (and you require a comprehensive hardware platform to demonstrate as many features as possible), or implement a low-cost high-volume device.

> Ultimately, we have to weigh up why kids aren't inspired to program today. Is it because computers aren't cheap enough (though even a netbook is 3x cheaper than a ZX Spectrum in today's money)? Or could it be something to do with them being 10,000 times more complex? Does FIGnition fit the STEM club criteria? (yes) Can you do a substantial amount of a GCSE computer studies on a FIGnition? (yes) Is FIGnition cute and fun? (you bet ;-) ) !

In this project, you are talking about a student lab. It requires about 1 hour to explain and implement this device, almost regardless of hardware platform. Also, check the 'rotary encoder' for properly debouncing scheme. Some kinds of these devices uses two optocoupled pairs, which makes a pulses consequently and at a different moments of time. So you simple should wait for second sensor after first and so on. Otherwise, you must filter the leading and trailing bounce sequences.

Finally, I can repeat that this application is too simple for inspiring anybody for a long time.

Ilya Tarasov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 6 2012, 10:26 pm
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Sat, 06 Oct 2012 19:26:07 -0700
Local: Sat, Oct 6 2012 10:26 pm
Subject: Re: Olympic Spririt for Forth

theoriginalsn...@gmail.com writes:
> For example, a light switch 'buttons-up' the complexity of the
> national grid, and it's known they're very easy to operate.

I like your light switch example, and it makes the same point as the
earlier examples I gave.

> there's an inevitable conflict between requirements, resources and
> their implementation. For example, the user-interface for a GPS system
> is more complex than for traditional map navigation

Really it's not.  Just key in the address you want to travel to, versus
messing with map books, street-finder indexes, coordinate grids telling
you to jump from one page to another or buy another book, etc.  Or
worse, in the nautical case: figuring out how to use a sextant and sight
tables and all that, plus it doesn't work if there is cloud cover.

> and future needs to support, e.g. congestion re-routing or inter-car
> collaboration.

Maps don't do that, the car GPS that I currently use doesn't either, and
it's very helpful regardless.

> But end-to-end complexity can be understood fairly easily. In the
> early 80s we'd turn on a computer and start coding within seconds.

Again you're talking about the boot delay while saying you're talking
about something different.  If you get a regular PC to boot in 3-seconds
and auto-start an IDE, what have you lost?  Maybe you could just do a
software image that boots a PC or a Raspberry Pi to your favorite IDE.

> multi-file projects expose the implementation trade-off between
> compilation performance and project size requirements.

It's not just compilation performance, it's also general modularity and
manageability of the code.  There's no significant loading delay for
reasonable size Python programs but it's still helpful to separate stuff
into different files.  But, maybe for initial teaching, this isn't
needed.

>development environments such as Eclipse expect even newbies to handle
>multiple targets, sdks, simulators, mixed-language project

I think this is sort of a Java and "enterprise" thing.  I don't think
Java is a good language for beginning programmers.

> [Logo] didn't replace Basic, but it is pretty good.

Basic is pretty dead now, unless VB counts as Basic, and even VB is
pretty dead now, so something replaced Basic.

> I do know that about 10 to 20x fewer kids can code at all compared
> with the mid-80s,

Where on earth do you get numbers like that from?

One impression I do get is that the main app kids are interested in
coding these days is video games, so your product should be able to get
stuff moving on the screen.

> [8-button keypad] it's faster than texting and as fast as typing on a
> touch-screen :-)

Really, your thing will be a lot more usable with a USB host port that
can accept a normal PC keyboard.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arc  
View profile  
 More options Oct 7 2012, 6:46 am
Newsgroups: comp.lang.forth
From: arc <arc.deletet...@vorsicht-bissig.de>
Date: Sun, 07 Oct 2012 23:45:57 +1300
Local: Sun, Oct 7 2012 6:45 am
Subject: Re: Olympic Spririt for Forth

We all seem to be assuming that kids don't program these days, unlike
the halcyon days of yore when computers had 8 bits, we made our own fun
and used the power of our imagination, we didn't have remote controls,
and there was this thing called discipline.

Are we really sure about this?

(Julz, how do you know that 80s computers were '10-20x more effective at
getting kids to code' ?)

I mean, it seems to me thinking back on it that in my experience it was
uncommon for kids to program in any way whatsoever, and very rare for
them to get beyond simple BASIC or LOGO programs.  I never really got
beyond very rudimentary programs, and I'm fairly certain there was
no-one in my year at school who did much more than that, and moderately
sure there was no-one in the years either side of me.  Later on I met
people my age who had gotten into programming in a big way as kids or
teenagers, so sure they existed, but I'd put the number at well shy of
1%.

(I see your ancedotes, and i raise you mine)

Maybe rather than something being wrong with either computers or kids
these days, it's just the case that programming is something that
doesn't really interest most kids, never has, probably never will, and
people with the inclination to be real hackers are pretty rare, and,
unsprisingly, well over-represented in this newsgroup.

That's not to say I don't think it couldn't be presented in a way that
would make it more approachable or fun for kids, or whatever, but I
don't think it was really all that approachable or fun (for most kids)
back in the day.  Those that did anything beyond the rudimentary were
those few that found it innately interesting and natural.

The one thing I think maybe made it more attractive to program back then
was the fact that the games and even applications available to you were
not actually all that sophisticated, so it was easier to see yourself as
footing it with commercial programs.

-arc.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 7 2012, 11:32 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Sun, 07 Oct 2012 08:32:03 -0700
Local: Sun, Oct 7 2012 11:32 am
Subject: Re: Olympic Spririt for Forth

an...@mips.complang.tuwien.ac.at (Anton Ertl) writes:
>>  {'name':'Paul','languages':['Python','Forth']}
> This reminds me of what I do with data in charts written in Postscript.
> In simple cases, the data is interpreted directly and drawn right away:

I couldn't follow the Postscript code details but I get the general
idea.  It still goes against the usual wisdom that once you figure out
your program's data structures, the code takes care of itself.

Another issue is that Lisp and Python-like languages not only have a
convenient syntax for reading those structures, they can also print them
in a way they can read them back in.  So you can easily compute data and
dump it out for later re-import.  This is very convenient for fast
interactive development.

> OTOH, the success of applications that support scripting and add-ons
> shows that, no, you cannot expect a program to do everything that's
> needed out of the box, even after a few iterations.

I would say here, the toolkit is script interpreter and the stuff
exported to the scripting language, and the application is the user
script.  So it's pretty usual in the iterative development of such
frameworks that in early versions, the script system can't quite do what
you want and you have to mess with the internals, such as to export new
functions that scripts can use.  But eventually the scripting level
becomes pretty powerful.  This happened with Emacs, with browsers, etc.

> Debugging Forth code is usually easy in my experience, certainly for
> things that would be caught by a type or bounds checker.  But maybe it
> takes experience to write programs such that such bugs are easy to
> find.

It's well known that such bugs are a perennial drain on development time
and source of exploits in in C and C++ programs.  I'm interested to know
if Forth somehow avoids these problems where C and C++ fail.  The rest
of the development world dealt with it mostly by migrating to type-safe
and GC'd languages.

> Strings: .../Memory-Blocks.html
> Arrays: .../Address-arithmetic.html

These are very do-it-yourself approaches, to say the least ;-).

> Hash tables: .../Word-Lists.html

This seems to be a way to manage vocabularies visible to the
interpreter, rather than make dictionary-like data objects for use by
programs.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 7 2012, 3:39 pm
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Sun, 07 Oct 2012 21:39:31 +0200
Local: Sun, Oct 7 2012 3:39 pm
Subject: Re: Olympic Spririt for Forth

Paul Rubin wrote:
>> Debugging Forth code is usually easy in my experience, certainly for
>> things that would be caught by a type or bounds checker.  But maybe
>> it takes experience to write programs such that such bugs are easy to
>> find.

> It's well known that such bugs are a perennial drain on development
> time and source of exploits in in C and C++ programs.  I'm interested
> to know if Forth somehow avoids these problems where C and C++ fail.
> The rest of the development world dealt with it mostly by migrating to
> type-safe and GC'd languages.

We had that discussion a while ago, stdlib strings are broken by design
(and even though people here argue that zero-terminated strings in C are
"optional", people learn this broken string functions when they learn
C).

The solution for this problem is to have string buffers growing and
shrinking with the string.  This doesn't require full GC and type-safe
stuff, it only requires resize() of malloc-ed blocks.

The little string words I use for that in Gforth are documented, though
only in the current development branch.  I've used them quite often, and
I never had any sort of buffer overflow or alike with them.

I think Forth program development differs in two important ways from C:

* We don't write big chunks of code and then test them.  This is done in
C, because compiling takes long, and to debug stuff you need to write a
debug harness etc.; in Forth we change little things and test
immediately.

* We extend the programming language to provide what's missing.  C
people use libraries and stick to their libraries even if there are
serious flaws.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 8 2012, 12:03 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Sun, 07 Oct 2012 21:03:25 -0700
Local: Mon, Oct 8 2012 12:03 am
Subject: Re: Olympic Spririt for Forth

Bernd Paysan <bernd.pay...@gmx.de> writes:
>>> things that would be caught by a type or bounds checker....
>> I'm interested to know if Forth somehow avoids these problems where C
>> and C++ fail.
> We had that discussion a while ago, stdlib strings are broken by design
> (and even though people here argue that zero-terminated strings in C are
> "optional", people learn this broken string functions when they learn C).

It's not just strings, it's every sort of array, in every language
except apparently for Forth.  I guess Forth array users can always write
access functions that check bounds, and use those at least during
developent.

> The solution for this problem is to have string buffers growing and
> shrinking with the string.  This doesn't require full GC and type-safe
> stuff, it only requires resize() of malloc-ed blocks.

C++ STL strings and vectors do this growing and shrinking, and are
somewhat less vulnerable to these hazards than C stdlib strings, but you
still have memory leaks and double-free errors to deal with.

> The little string words I use for that in Gforth are documented, though
> only in the current development branch.  I've used them quite often, and
> I never had any sort of buffer overflow or alike with them.

Cool, I'll look for them.

> I think Forth program development differs in two important ways from C:
> * We don't write big chunks of code and then test them.  This is done in
> C, because compiling takes long, and to debug stuff you need to write a
> debug harness etc.; in Forth we change little things and test
> immediately.

I'm not sure how much this really helps: it handles immediate, localized
bugs, but not really bugs involving long-range interaction between
components.

I think Forth applications simply tend not to be of the type that uses
dynamic memory or even strings all that much.  The typical profile might
be more like MISRA C.  This is perfectly fine of course.

> * We extend the programming language to provide what's missing.  C
> people use libraries and stick to their libraries even if there are
> serious flaws.

I'd say if the same stuff turns up missing again and again, it's time to
factor it into the library.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 8 2012, 1:09 pm
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Mon, 08 Oct 2012 19:09:45 +0200
Local: Mon, Oct 8 2012 1:09 pm
Subject: Re: Olympic Spririt for Forth

Paul Rubin wrote:
> It's not just strings, it's every sort of array, in every language
> except apparently for Forth.  I guess Forth array users can always
> write access functions that check bounds, and use those at least
> during developent.

Hehe, the word goes "using bound checking during development is like
using a parachute while still on ground".  The development style is
"crash early, crash often"; you might do your bould checking there and
crash, but the application program should rather be robust.

The array function in my string package is auto-expanding the string
array instead of crashing.  This goes towards robustness, not towards
crashing.

>> The solution for this problem is to have string buffers growing and
>> shrinking with the string.  This doesn't require full GC and
>> type-safe stuff, it only requires resize() of malloc-ed blocks.

> C++ STL strings and vectors do this growing and shrinking, and are
> somewhat less vulnerable to these hazards than C stdlib strings, but
> you still have memory leaks and double-free errors to deal with.

That's why I only allow strings to live in global variables (or - when
used within my OOP package - as instance variables of objects which know
how to dispose themselfes).

>> I think Forth program development differs in two important ways from
>> C:
>> * We don't write big chunks of code and then test them.  This is done
>> in C, because compiling takes long, and to debug stuff you need to
>> write a debug harness etc.; in Forth we change little things and test
>> immediately.

> I'm not sure how much this really helps: it handles immediate,
> localized bugs, but not really bugs involving long-range interaction
> between components.

When our programs have interactions between components, testing that is
part of the testing.

> I think Forth applications simply tend not to be of the type that uses
> dynamic memory or even strings all that much.  The typical profile
> might be more like MISRA C.  This is perfectly fine of course.

Applications like MINOS certainly are not that common Forth
applications.

>> * We extend the programming language to provide what's missing.  C
>> people use libraries and stick to their libraries even if there are
>> serious flaws.

> I'd say if the same stuff turns up missing again and again, it's time
> to factor it into the library.

We do that, but our main problem is that we usually don't think the
libraries others have created are any good.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 9 2012, 12:57 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Mon, 08 Oct 2012 21:57:38 -0700
Local: Tues, Oct 9 2012 12:57 am
Subject: Re: Olympic Spririt for Forth

Bernd Paysan <bernd.pay...@gmx.de> writes:
> Hehe, the word goes "using bound checking during development is like
> using a parachute while still on ground".

Yeah, leaving bounds checks active all the time is probably best
practice in most applications.  

>> you still have memory leaks and double-free errors to deal with.
> That's why I only allow strings to live in global variables (or - when
> used within my OOP package - as instance variables of objects which know
> how to dispose themselfes).

But now you've got the issue of leaking or double-freeing those objects.
If you've got complex, dynamic data structures, storage management is a
nontrivial issue.

>>> in Forth we change little things and test immediately. ...
> When our programs have interactions between components, testing that
> is part of the testing.

I guess I'm not seeing how this is different from C then.  Code change
is not topologically continuous.  Sure you can write a new component
bottom-up, but you can't really connect it up to other components til a
substantial amount of the new component is working, and maybe then you
find there you find an interaction problem you hadn't thought of in
advance.  What then?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wills  
View profile  
 More options Oct 9 2012, 4:04 am
Newsgroups: comp.lang.forth
From: Mark Wills <forthfr...@gmail.com>
Date: Tue, 9 Oct 2012 01:04:30 -0700 (PDT)
Local: Tues, Oct 9 2012 4:04 am
Subject: Re: Olympic Spririt for Forth
On Oct 8, 6:09 pm, Bernd Paysan <bernd.pay...@gmx.de> wrote:

> The array function in my string package is auto-expanding the string
> array instead of crashing.  This goes towards robustness, not towards
> crashing.

No it doesn't. If it's *auto* expanding then it just hides an
undetected problem. You end up with a program that works fine for a
few hours on the lab bench, but crashes every three weeks in the
field. It goes towards crash later. And I can tell you, from bitter
experience, they are the hardest of all bugs to find, and often end up
never being solved:

"Hey, that plating controller is really great, saved us a lot of money
in copper sulphate solution, but it crashes every three weeks, and we
have to scrap whatever job is in the bath."
"Hmmm... Are you sure it's not some power spike? Is a large pump
nearby switching on or something like that?"
"Dunno. Could be. We're all scratching our heads here! But hey, it's
like only every three weeks or so..."
"Hmmm... Say, how's about we program it to do a reboot at the end of
each job?"
"Yeah. Great idea"

< six months later >

"How's the controller"
"Oh man! Solid as a rock! We just love it! Send us the bill. And
another controller while you're at it!"
"Great"

When the truth is, it's as shaky as hell!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wills  
View profile  
 More options Oct 9 2012, 4:10 am
Newsgroups: comp.lang.forth
From: Mark Wills <forthfr...@gmail.com>
Date: Tue, 9 Oct 2012 01:10:58 -0700 (PDT)
Local: Tues, Oct 9 2012 4:10 am
Subject: Re: Olympic Spririt for Forth
On Oct 9, 5:57 am, Paul Rubin <no.em...@nospam.invalid> wrote:

> Yeah, leaving bounds checks active all the time is probably best
> practice in most applications.

No. Testing the absolute living shit out of the application to prove
that a bounds error cannot happen is the way. Detecting a bounds error
is very nice in a spreadsheet, or an app to convert GIFs to JPGs or
whatever. It's not really much use on the rocket firing system on the
alignment correction system of a telecommunications satellite. Out of
bounds? Whoop de doo... You're still going to fall out of orbit!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wills  
View profile  
 More options Oct 9 2012, 4:20 am
Newsgroups: comp.lang.forth
From: Mark Wills <forthfr...@gmail.com>
Date: Tue, 9 Oct 2012 01:20:34 -0700 (PDT)
Local: Tues, Oct 9 2012 4:20 am
Subject: Re: Olympic Spririt for Forth
On Oct 9, 5:57 am, Paul Rubin <no.em...@nospam.invalid> wrote:

> I guess I'm not seeing how this is different from C then.  Code change
> is not topologically continuous.  Sure you can write a new component
> bottom-up, but you can't really connect it up to other components til a
> substantial amount of the new component is working, and maybe then you
> find there you find an interaction problem you hadn't thought of in
> advance.  What then?

You re-factor. You change the code.

You know these kind of high-brow discussions are quite entertaining.
They often make me chuckle to myself. Not so much here on CLF, but on
Java websites, or (all the time) in programming books we hear these
kind of every-day programming problems cited as major disasters.

Project Mangler: "Oh no! Johnny had to change the interface of his
object to take an unsingned int instead of an int. CALL THE MEDIA. OH
NASH NASH. WAIL WAIL. HOW WILL WE EVER RECOVER FROM THIS TERMINAL
ERROR? SOMEONE FIRE JOHNNY. HOW COULD HE BE SO STUPID... SEE? SEE?....
IF HE HAD ABSTRACTED THE INTERFACE FROM THE DEFINITION OF THE CLASS
THEN THIS WOULD NEVER HAVE HAPPENED... BUT NO... *NOBODY* LISTENS TO
ME. I TOLD YOU IT WOULD BE A DISASTER. I READ IT IN A BOOK. OH NO!
WE'RE REALLY SCREWED NOW. UP SHIT CREEK. *WE'LL HAVE TO RE-WRITE THE
ENTIRE APP*. OH MAN. I KNEW THIS WOULD HAPPEN..."

Johnny: "Er, it's okay guys. I did the change. Took like 15 mins. God
bless the object browser, eh?"

:-)

The truth is, if you know the app, you can change it. It really isn't
a big deal. Sure, there's a cost. The expense is in the re-testing,
not in the re-engineering.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bernd Paysan  
View profile  
 More options Oct 9 2012, 11:30 am
Newsgroups: comp.lang.forth
From: Bernd Paysan <bernd.pay...@gmx.de>
Date: Tue, 09 Oct 2012 17:30:19 +0200
Local: Tues, Oct 9 2012 11:30 am
Subject: Re: Olympic Spririt for Forth

Mark Wills wrote:
> On Oct 8, 6:09 pm, Bernd Paysan <bernd.pay...@gmx.de> wrote:
>> The array function in my string package is auto-expanding the string
>> array instead of crashing.  This goes towards robustness, not towards
>> crashing.

> No it doesn't. If it's *auto* expanding then it just hides an
> undetected problem.

I honestly disagree.  What should $+! do other than auto-expanding the
destination string so it can add the requested string?  Same with a
string array, which you usually use by converting lines of a file into
an array for random access.

Some of the auto-expanding code I wrote allow to expand one bit at a
time, but not arbitrary writes into the void.  This covers pretty well
for what could be an undetected problem.

Having to expand deliberately and manually makes the use of such a
package tedious at the expense of robustness.

> You end up with a program that works fine for a
> few hours on the lab bench, but crashes every three weeks in the
> field. It goes towards crash later. And I can tell you, from bitter
> experience, they are the hardest of all bugs to find, and often end up
> never being solved:

Sorry to say so, but if you don't print out a meaningful backtrace in
case of a crash, you won't solve this sort of problems.  Maybe yes, it
only crashes every three weeks and the backtrace goes something like

out of memory error
$[]+!
some function calling that
etc.

So what do you do?  Maybe you need to add a little clues in the
backtrace, to show what actually happened, and let it run another 3
weeks to get there... or maybe it's already enough of a hint to show
what's going wrong.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Rubin  
View profile  
 More options Oct 9 2012, 11:56 am
Newsgroups: comp.lang.forth
From: Paul Rubin <no.em...@nospam.invalid>
Date: Tue, 09 Oct 2012 08:56:55 -0700
Local: Tues, Oct 9 2012 11:56 am
Subject: Re: Olympic Spririt for Forth

Mark Wills <forthfr...@gmail.com> writes:
> The truth is, if you know the app, you can change it. It really isn't
> a big deal. Sure, there's a cost. The expense is in the re-testing,
> not in the re-engineering.

Well, I was just in this situation with a C++ program.  I added a
feature and that caused a double-free crash in another part of the
program.  I "fixed" the crash but the fix left a memory leak, which also
had to be fixed.  Detecting the memory leak required running the program
for a while, which I had to do several times to observe the leak and
test the fix, burning more time.

None of this was a big disaster--it was just a normal part of a day's
development.  But with more civilized (i.e. GC'd) languages, this stuff
just doesn't happen in the first place.  Programmers can then focus
their efforts more directly at producing visible end results.

If your testing expenses are that large (outside of critical systems),
it could be because too many bugs are getting through your development
process, and maybe you should re-examine your strategy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 51 - 75 of 143 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »