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


Groups > comp.lang.forth > #23655

Re: jonesforth: taking up the challenge

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: jonesforth: taking up the challenge
Date 2013-06-15 23:06 +0200
Organization 1&1 Internet AG
Message-ID <kpil1f$k51$1@online.de> (permalink)
References (3 earlier) <7xfvwund59.fsf@ruckus.brouhaha.com> <2013Jun11.165956@mips.complang.tuwien.ac.at> <7xehc83xx2.fsf@ruckus.brouhaha.com> <2013Jun12.171604@mips.complang.tuwien.ac.at> <7xppvn880t.fsf@ruckus.brouhaha.com>

Show all headers | View raw


Paul Rubin wrote:
> If understanding Forth doesn't involve understanding the underlying
> tools, then as a "mere user" why pick something as messy as assembler,
> instead of something like Ruby?

Honestly, the semantic gap between Ruby and Forth is significantly larger 
than between assembler and Forth.  So if you write a Forth in Ruby, you 
either make it simple, and then you will get something considerably 
different (RPL or so), or you try hard to implement Forth, and it will look 
messy.

>> CODE performs quite a bit of magic, in particular building dictionary
>> entries, that is explicit in assmbly language.  For modification
>> automagics is better, for first understanding explicit is better.
> 
> It's possible that you're referring to something I don't understand.  I
> had thought CODE is basically like : (colon), i.e. it does a CREATE then
> flips a state variable to assemble code until something like ENDCODE is
> seen, but the created dictionary entry maybe has some bits set to
> indicate that it's a code word, and also CODE may switch in an
> assembler-specific word list.  Is there more than that?

No, but you ditched the dictionary entry entirely, by saying that "it does a 
CREATE".  Then the magic Anton mentions just goes to CREATE.

>> I don't think the mathematical concepts they learn in school are much
>> help in learning to program.
> 
> You mean like functions?  Of course that seems useful.

Maybe if you program in Haskell.  Functions are not that common in programs, 
as most subroutine have side-effects.  The idea of programming languages 
like Haskell is to put a lot of effort into a programming language so that 
you just can stay in your mathematical mind, and program a computer that 
way.

>> Indeed we had Knuth here a few weeks ago, and he said that when he has
>> his mathematicians hat on he is using a different kind of thinking
>> than when he has his programmer's hat on.
> 
> Sure, the stuff that mathematicians think about is different.  Though,
> maybe Knuth should try programming in Haskell ;-).

If someone implements TeX in Haskell, maybe.  But as long as not, there's no 
proof that you can do something useful in Haskell ;-).

A friend of mine tried learning Haskell, and his "proof of the pudding" is 
writing a word count program.  After he was 1/3 through the Haskell book, he 
still couldn't.  Because the I/O was still missing, and Haskell's file I/O 
isn't done right.

IMHO, Haskell should treat the file system as a index -> value table.  The 
index is the file name, and the value is the file data (a string).  That 
sort of thinking fits with the way Haskell works, and with that thinking, 
the wordcount program would actually be a trivial exercise - just as it is 
with Forth.

> I think of addresses as a relatively advanced concept in programming
> these days.  One can be a productive Ruby programmer without knowing
> what an address is.

Which explains why WJ asks us so many questions about "can this or that be 
done in Forth".  It's all trivial stuff, but you need to understand what an 
address is to implement it.

IMHO, this lack of addresses in modern popular languages is to avoid the 
thing you don't understand.  When I've read K&R, I didn't quite understand 
what a pointer is.  Then I read Brodie, and it was very obvious what an 
address is.  Going back to K&R, I now understood, what a pointer is.  It's a 
bit more complicated, since pointer arithmetics knows the size of the 
elemens the pointer points to, while addresses don't - they are just bytes.

> Maybe what Forth really needs is a new name, like Erlang recently got:
> 
>   https://www.youtube.com/watch?v=rRbY3TMUcgQ
> 
> ;-)

Haha...

> JonesForth or any Forth seems like a terrible introduction to
> programming language implementation, since Forth is relatively exotic
> language.  As a language nerd it interests me -because- of that
> exoticness, but it's like learning about plant metabolism by studying
> the Venus fly trap.  It's surely interesting, but one shouldn't think
> that type of plant is typical.

It was about *implementation*, not about the language as such.  Forth's 
implementation is no way untypical, a lot of languages have VMs which, under 
the hood, don't look that much different.

> I came across an interesting term "wholemeal programming" recently.
> http://www.cis.upenn.edu/~cis194/lectures/2012-01-12.html quotes
> Ralf Hinze who attributes the term to Geraint Jones:
>     
>     Wholemeal programming means to think big: work with an entire list,
>     rather than a sequence of elements; develop a solution space, rather
>     than an individual solution; imagine a graph, rather than a single
>     path. The wholemeal approach often offers new insights or provides
>     new perspectives on a given problem. It is nicely complemented by
>     the idea of projective programming: first solve a more general
>     problem, then extract the interesting bits and pieces by
>     transforming the general program into more specialised ones.
> 
> That's a Scheme-like approach but sort of the opposite of the Forth
> approach.

Oh, yes, Forth is about solving the problem at hand, not something general.  
How would that wholemeal approach e.g. solve the Triceps playing Go stuff?  
Task: you have a board with white and black stones.  Write a program that 
uses the webcam to know what's on the Go board.

Forth approach: Take the OpenGL texture the webcam renders its preview into, 
and draw it with perspectivic correction so that it becomes a nice 
horizontal and vertical matrix.  Read in the pixels.  Bin the pixels into 
three classes: black, white, board (in our case, the board is green, but it 
could be brown, as well).  Define areas of interest (rectangles) in that 
matrix.  Do a majority decision on those pixels there, whatever is most is 
the most likely thing there.

This sort of image recognition works only for exactly one thing: a game 
board.  It was quickly done, it's not 400 lines (including the interface to 
the Go program and the robot).  It's not perfect, because if you change the 
color of the board, you have to adjust the board recognition code.  If you 
change the positon of the board, you have to adjust the perspective 
correction.  And so on.  I'm probably going to solve some of these issues, 
because they can be automated.

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

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-04 18:14 +0000
  Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-04 11:28 -0700
  Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 15:37 -0500
    Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-06 13:49 -0700
      Re: jonesforth: taking up the challenge "Ed" <invalid@invalid.com> - 2013-06-07 12:32 +1000
    Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 14:36 +0000
      Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-07 08:39 -0700
        Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 17:04 +0000
          Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-07 11:19 -0700
          Re: jonesforth: taking up the challenge "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-06-07 17:24 -0400
            Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 23:04 +0000
        Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-11 14:59 +0000
          Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-11 16:09 +0000
            Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 08:08 -0500
              Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-12 13:52 +0000
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 14:17 -0500
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-13 08:24 +0000
              Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-12 14:18 +0000
                Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-12 15:05 +0000
                Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-13 01:40 +0000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-13 08:55 +0200
                Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-06-12 21:05 -1000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-13 10:49 +0200
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-13 08:55 +0000
                Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-13 14:33 +0200
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-13 13:14 +0000
                Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-13 18:33 +0000
                Re: jonesforth: taking up the challenge Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-14 01:25 -0700
                Re: jonesforth: taking up the challenge rickman <gnuarm@gmail.com> - 2013-06-15 12:00 -0400
                Re: jonesforth: taking up the challenge Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-15 14:35 -0700
                Re: jonesforth: taking up the challenge rickman <gnuarm@gmail.com> - 2013-06-15 19:29 -0400
                Re: jonesforth: taking up the challenge Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-17 03:31 -0700
                Re: jonesforth: taking up the challenge rickman <gnuarm@gmail.com> - 2013-06-17 19:16 -0400
                Re: jonesforth: taking up the challenge rickman <gnuarm@gmail.com> - 2013-06-15 11:58 -0400
          Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-11 18:32 +0200
            Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-11 10:33 -0700
              Re: jonesforth: taking up the challenge Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-06-11 20:42 +0100
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-12 00:20 -0700
              Re: jonesforth: taking up the challenge Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-12 01:29 -0700
              Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-12 19:52 +0200
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 14:19 -0500
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-13 08:47 +0000
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-13 07:45 -0500
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-13 13:04 +0000
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-14 21:32 -0700
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 17:15 +0000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-20 09:42 +0200
                Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-06-19 21:52 -1000
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-16 10:01 -0500
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-16 14:14 -0700
                Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-16 23:58 +0200
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-16 23:17 -0700
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:00 +0000
                Re: jonesforth: taking up the challenge Elizabeth D Rather <erather@forth.com> - 2013-06-17 08:05 -1000
                Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-17 19:33 +0000
                Re: jonesforth: taking up the challenge Gerry Jackson <spam@qlikz.org> - 2013-06-17 21:23 +0100
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-12 22:58 -0700
                Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-06-12 20:48 -1000
              Re: jonesforth: taking up the challenge rickman <gnuarm@gmail.com> - 2013-06-15 12:05 -0400
            Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-13 10:39 +0000
          Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-11 18:44 -0700
            Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-12 15:16 +0000
              Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-15 12:54 -0700
                Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-06-15 11:05 -1000
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-15 14:21 -0700
                Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-15 23:06 +0200
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-15 14:56 -0700
                Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-16 00:33 +0200
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-15 16:47 -0700
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-16 09:45 -0500
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:19 +0000
                Re: jonesforth: taking up the challenge Alex McDonald <blog@rivadpm.com> - 2013-06-17 11:51 -0700
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-18 00:31 -0700
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-18 00:33 -0700
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-18 00:46 -0700
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 04:11 -0500
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-18 23:51 -0700
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-19 04:32 -0500
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-19 02:42 -0700
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-19 12:08 +0200
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-19 09:25 -0700
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-19 19:10 +0200
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-20 17:08 -0700
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-19 09:04 -0500
                Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-19 09:26 -0700
      Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-07 16:45 -0500
  Re: jonesforth: taking up the challenge "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-06-06 23:29 -0400
    Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 14:41 +0000
      Re: jonesforth: taking up the challenge "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-06-07 17:24 -0400
        Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 23:07 +0000
          Re: jonesforth: taking up the challenge Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-08 01:26 +0200
            Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-07 17:54 -0700
              Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 10:01 +0000
            Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-08 07:29 +0200
              Re: jonesforth: taking up the challenge mhx@iae.nl - 2013-06-07 23:17 -0700
                Re: jonesforth: taking up the challenge mhx@iae.nl - 2013-06-08 01:30 -0700
              Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-07 23:41 -0700
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-08 09:35 +0200
                Re: jonesforth: taking up the challenge anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-08 14:28 +0000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-08 21:22 +0200
                Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 10:06 +0000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-19 12:27 +0200
                Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 10:44 +0000
                Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-08 21:55 +0200
                Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-11 14:09 +0000
              Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-08 07:49 +0000
            Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-08 07:47 +0000
              Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-08 00:59 -0700
                Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-08 16:40 -0500
                Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-13 01:24 +0000
  Re: jonesforth: taking up the challenge Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-07 00:37 -0700
    Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-06-07 00:53 -0700
    Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-07 14:49 +0000
      Re: jonesforth: taking up the challenge Bill Richards <billrich@gmx.com> - 2013-06-11 14:13 +0000
  Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-12 14:21 +0000
  Re: jonesforth: taking up the challenge the_gavino_himself <visphatesjava@gmail.com> - 2013-06-15 23:22 -0700
    Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-06-15 21:26 -1000
      Re: jonesforth: taking up the challenge Alex McDonald <blog@rivadpm.com> - 2013-06-16 12:58 -0700
      OT Making fun of gavino. was Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-19 10:52 +0000

csiph-web