|
|
Up |
|
|
  |
Author: metaperl.commetaperl.com Date: Nov 11, 2007 04:50
It seems that basic mathematics, when expressed in English, maps most
directly to postfix/reverse polish notation, as used in Factor/Forth.
If you are given 2 apples 3 times, how many do you have?
F> 2 3 *
6
Note how the Forth expression maps almost perfectly to English.
Now, for addition, the most common English is not the perfect mapping:
If you have 2 apples and you have given 3 more, how many
do you have?
wow, I just noticed something. "times" in the first example is not a
verb. So the forth operator does not necessarily correspond to an
English verb.
So, if you use "more" as your clue to throw in an operator, then Forth
again maps well:
F> 2 3 +
5
Division and subtraction dont seem to map so well:
|
| Show full article (1.78Kb) |
|
| | 94 Comments |
|
  |
Author: Paul E. BennettPaul E. Bennett Date: Nov 11, 2007 05:06
> I spent my early years memorizing multiplication tables and solving
> multiplication problems without any real practical idea of what
> multiplication really was.
Learning your multiplication tables by rote (something rarely done these
days) imprints the basis for doing other maths in the head for later life.
In my primary school we went up to 13 times and it has all stuck very
firmly. My son has a bit more difficulty because the school had given up on
rote learning and has to resort to pen and paper or a calculator to do
stuff I still do in my head. Yet, he is still a very intelligent lad.
--
********************************************************************
Paul E. Bennett............... topmail.co.uk>
Forth based HIDECS Consultancy
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-811095
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************
|
| |
|
| | no comments |
|
  |
Author: cr88192cr88192 Date: Nov 11, 2007 15:25
> It seems that basic mathematics, when expressed in English, maps most
> directly to postfix/reverse polish notation, as used in Factor/Forth.
>
yes, RPN has uses, but I will argue, is still not the best model for general
programming.
does remind me of something though:
I was in HS, and took a class related to the construction trade.
the teacher (neither all that knowlegable in either math or programming),
devised a way of explaining the calculations and tasks done in building
stuff (I think the lecture I was remembering was on setting up forms for
pouring concrete), and this system beared more than a passing similarity to
forth...
it can also be noted that many people in 'unlearned' cultures, may divise
systems for doing arithmetic and so on, that are infact often based on
binary (although afaik base 10, followed by 12 are most common for counting
and measuring tasks).
|
| Show full article (3.44Kb) |
| no comments |
|
  |
Author: schemelabschemelab Date: Nov 11, 2007 15:57
On Nov 11, 8:06 am, "Paul E. Bennett" talktalk.net>
wrote:
> Learning your multiplication tables by rote (something rarely done these
> days) imprints the basis for doing other maths in the head for later life.
> In my primary school we went up to 13 times and it has all stuck very
> firmly. My son has a bit more difficulty because the school had given up on
> rote learning and has to resort to pen and paper or a calculator to do
> stuff I still do in my head. Yet, he is still a very intelligent lad.
I think intelligent people get bored with repetitive things quickly. I
know I would go crazy before developing the discipline to excel via
Kumon. But no question, regular repetition is the way to great
performance. I have seen it myself the few times I managed to keep the
ants out of my pants long enough.
|
| |
| no comments |
|
  |
Author: schemelabschemelab Date: Nov 11, 2007 16:05
>> It seems that basic mathematics, when expressed in English, maps most
>> directly to postfix/reverse polish notation, as used in Factor/Forth.
>
>> If you are given 2 apples 3 times, how many do you have?
>
>>> 2 3 *
>> 6
>
> In what real-world situation would someone commonly says "given 2 apples
> 3 times"? You've contrived a English sentence that maps to Forth. How
> about more real-world sentences:
>
> "I have three bags of 2 apples."
>
> 3 * 2 (Seems infix to me.)
|
| Show full article (3.49Kb) |
| no comments |
|
  |
Author: slavaslava Date: Nov 11, 2007 16:14
On Nov 11, 6:25 pm, "cr88192" hotmail.com> wrote:
> so, the downfall of forth is not that it is 'unnatural', but rather that no
> one can really read and follow the code...
> one has to 'study', even their own code in a language they may know well,
> just to figure out what the hell they were doing.
I've never had this problem in Factor, with my or other people's code.
Sure, sometimes the intent is not fully clear (perhaps due to poor
choice of parameter names or data types) but that's nothing that some
refactoring and clean up cannot fix.
Forth code can be a bit more opaque due to low-level memory management
details, but usually this can be factored out into a nice vocabulary.
The beauty of a flexible syntax and extensible semantics is precisely
that well-written code can express intent well. The closer the code is
to the problem domain, the easier it is to read. That's all there is
to it.
> this is not so much a problem with a more C-style syntax...
|
| Show full article (1.81Kb) |
| no comments |
|
  |
Author: Jerry AvinsJerry Avins Date: Nov 11, 2007 17:21
...
>> There, I've demonstrated that English is a very flexible language-- far
>> more flexible when describing math that strict infix, prefix, or postfix
>> languages.
>
> we are trying to create a highly useable consistent mental framework
> for computation. In doing so, we take "free-flowing english", perform
> a source-to-source translation to "postfix english" and from there
> into working computer programs.
>
> It's just like term rewriting or any of the other processes we do to
> make problems tractable.
>
> The forth mentality is: you cant operate until you have the data, so
> let's get all the data specified first.
|
| Show full article (1.83Kb) |
| no comments |
|
  |
Author: cr88192cr88192 Date: Nov 11, 2007 17:21
> On Nov 11, 6:25 pm, "cr88192" hotmail.com> wrote:
>> so, the downfall of forth is not that it is 'unnatural', but rather that
>> no
>> one can really read and follow the code...
>> one has to 'study', even their own code in a language they may know well,
>> just to figure out what the hell they were doing.
>
> I've never had this problem in Factor, with my or other people's code.
>
I have not used Factor, but I have used Forth and PostScript...
(PostScript has been a far greater influence on me WRT this style though).
> Sure, sometimes the intent is not fully clear (perhaps due to poor
> choice of parameter names or data types) but that's nothing that some
> refactoring and clean up cannot fix.
>
the difficulty is not so much when there are poor names, but when there are
no names...
|
| Show full article (5.62Kb) |
| no comments |
|
  |
Author: Rod PembertonRod Pemberton Date: Nov 11, 2007 22:16
> So my opinion is that children may have problems with mathematics
> because they are forced into trying to do a bunch of things which seem
> foreign to them.
>
That depends on the abilities of the person. I, for one, suffered through
two mathematics teaching styles in my elementary schoole years decades ago.
The "standard" method was visual and algebraic in...
|
| Show full article (3.70Kb) |
| no comments |
|
  |
|
|
  |
Author: cr88192cr88192 Date: Nov 11, 2007 22:44
"Rod Pemberton" wrote in message
news:fh8r1u$6ui$1@aioe.org...
>> So my opinion is that children may have problems with mathematics
>> because they are forced into trying to do a bunch of things which seem
>> foreign to them.
>>
>
> That depends on the abilities of the person. I, for one, suffered through
> two mathematics teaching styles in my elementary schoole years decades
> ago.
> The "standard" method was visual and algebraic in nature. The new method,
> which they called "new math," was verbal and used written forms, like long
> division. I grasped the first very quickly and naturally. It wasn't
> until
> the end of HS that I learned I had far above average spatial relationship
> abilities. However, many other students in elementary school preferred
> the ...
|
| Show full article (5.64Kb) |
| no comments |
|
RELATED THREADS |
  |
|
|
|
|
|