• Good beginner projects?

    From =?UTF-8?B?SmFrdWIgS29sxI3DocWZ?=@21:1/5 to All on Thu Aug 17 06:58:13 2023
    Hello I am software developer proficient in JS, Python, Java etc. I have great appreciation for the philosophy of stack-based Forth language and the philosophy of Chuck Moore. I know some Forth basics. What are some good beginner projects which I cant
    take in Forth (preferably gforth) which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    Thanks in advance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to All on Thu Aug 17 08:19:42 2023
    On Thursday, August 17, 2023 at 3:58:15 PM UTC+2, Jakub Kolčář wrote:
    What are some good beginner projects which I cant take in Forth (preferably gforth)
    which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    I recommend to have a look at S. Fischer's mini-spreadsheet
    ( http://www.complang.tuwien.ac.at/forth/program-links.html ).
    It should be possible to let the Forth approach shine there.

    `Knowing some Forth basics` is a flexible term. It took me a few years before
    I could say that. Did you already work you way through the copious amount of example files that most distributions offer?

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Brian Fox@21:1/5 to All on Thu Aug 17 12:43:18 2023
    On Thursday, August 17, 2023 at 9:58:15 AM UTC-4, Jakub Kolčář wrote:
    Hello I am software developer proficient in JS, Python, Java etc. I have great appreciation for the philosophy of stack-based Forth language and the philosophy of Chuck Moore. I know some Forth basics. What are some good beginner projects which I cant
    take in Forth (preferably gforth) which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    Thanks in advance.

    I am going to say out loud what others here might be thinking.
    At the very high level all your experience with those languages
    are great since you understand the things that all computer programs
    have in common, code, data, structure, loops, branching etc.

    It turns out that sometimes that knowledge can make the beginning
    of Forth study more difficult because Forth removes a lot of what you
    _assume_ will be in the system and alters how you use others things.
    A simple thing like order of operations is gone because of RPN syntax.

    The quick pass through a Forth system manual makes you feel comfortable.
    There is IF ELSE THEN , WHILE BEGIN AGAIN, VARIABLE CONSTANT.
    It looks like a high level language.

    "I know that stuff" you say to yourself. :-)

    It's not true. Forth is very low level, almost like an Assembler for a two-stack
    CPU, but it can elevate itself to as high as you want, if you grok how.

    So my suggestion is go to the online Starting Forth book and begin at the beginning so you get a better sense of how one "thinks" in Forth.

    https://www.forth.com/starting-forth/

    Once the "penny drops" Forth is a blast to use and ...
    You will probably never program the same again, in ANY language that you use.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to All on Thu Aug 17 15:42:56 2023
    On Thursday, August 17, 2023 at 3:58:15 PM UTC+2, Jakub Kolčář wrote:
    Hello I am software developer proficient in JS, Python, Java etc. I have great appreciation for the philosophy of stack-based Forth language and the philosophy of Chuck Moore. I know some Forth basics. What are some good beginner projects which I cant
    take in Forth (preferably gforth) which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    Thanks in advance.
    First, read "Starting Forth". It will teach you to print a variable numbers of stars on
    the screen and to square any number. Then think by yourself "That's easy. That's
    elegant. I can do that".

    Then go to Rosetta code, take the easiest thing you can think of - like checking
    a UPC number, doing 99 bottles of beer or calculating Hamming codes. Use
    your experience in those C-like languages and write forth words of one or two pages. Drown in stack errors, go in frustration to bed tellibg yourself you will
    figure it out in the morning.

    The next morning you will find out that you haven't a clue what all this code is all
    about. Curse the language. Convince yourself only a moron will submit himself to such a language - and think he can be remotely productive.

    Then one of two things will happen. Either you will dedicate the rest of your life
    blogging about this horrible experience - or you will man up and get serious.

    In that case "Thinking Forth" will become your bible - and C like languages become
    a distinct memory of the past. You will see algorithms in an entirely new light and
    become aware of the scope and behavior of your data.

    Words of 8 lines are suspect. Words of 16 lines are ginormuous. Defing a variable
    hurts your self esteem. Huge piles of one liners are feeling natural - the way the
    world ought to be. C feels completely alien - tedious and boring. Even drinking
    Java makes you gag - let alone programming it.

    You're really sure you want to embark this journey?

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to All on Fri Aug 18 13:05:53 2023
    On 17/08/2023 11:58 pm, Jakub Kolčář wrote:
    Hello I am software developer proficient in JS, Python, Java etc. I have great appreciation for the philosophy of stack-based Forth language and the philosophy of Chuck Moore. I know some Forth basics. What are some good beginner projects which I cant
    take in Forth (preferably gforth) which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    Thanks in advance.

    First hurdle is becoming familiar with the wordset. I'd suggest
    binary and text file copy programs. Things you know well in other
    languages, serve a useful purpose, yet simple and easy enough to
    debug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hugh Aguilar@21:1/5 to Hans Bezemer on Thu Aug 17 19:29:02 2023
    On Thursday, August 17, 2023 at 3:42:59 PM UTC-7, Hans Bezemer wrote:
    First, read "Starting Forth".

    Don't read: "Starting Forth."
    That book has turned a significant number of readers away from Forth.
    Those who have stuck with Forth after reading this book have become
    lifelong incompetents at Forth programming. The book doesn't make any
    mention of structs, most likely because nobody at Forth Inc. knows what
    a struct is. The book fails completely at showing the reader how to
    implement general-purpose data-structures, which is the primary reason
    why the "Starting Forth" enthusiasts are lifelong incompetents.

    Don't pay attention to self-proclaimed Forth experts on the internet.
    There are a lot more teachers of Forth than students of Forth, and the
    teachers typically are the lifelong incompetents described above.

    I can tell you my own experience with learning Forth (HES-Forth on the Vic-20). I wrote a program to generate the key patterns for a KwikSet master-key system. The program was full of bugs and didn't work. I became frustrated and considered
    abandoning Forth and writing the program in line-number BASIC that I was familiar
    with (of course, I was also familiar with the many design flaws of line-number BASIC,
    especially the lack of local data, so I knew that there was no future in this path).
    Then I remembered that the Forth programmers I knew had all said that interactive
    debugging is the key to getting Forth programs to work, so I rewrote the program.
    Instead of one gigantic function, I did bottom-up programming starting with short simple functions that I tested at the keyboard (the outer-interpreter). When
    I got those functions to work I wrote higher-level functions that were also short and simple and I tested them until I got them working. Using bottom-up programming I got the whole program working in about two hours. This is the program that I had spent days trying to debug when it was one gigantic function.
    I was impressed! Factoring code into small functions and using interactive testing
    to get those functions working is strong magic! This really works!

    I generally start with the difficult part of the program and get that working, then
    move outward to the less difficult parts that are also less interesting. Generally
    the difficult part of the program is where the design work needs to be done.
    If you get that working, then you also have the design done --- the rest is gravy.

    So, a good beginner project would be a KwikSet master-key system generator.
    If I could do this at age 18 with only line-number BASIC background, you should be able to do it too. Use a prng so you don't get the same system every time. Be aware that you can't have excessively thin pins because they will fall over sideways inside of the cylinder and get jammed.
    You also can't have an excessively jagged key cut-pattern because the key won't
    go into the lock.
    You don't want to have an excessively flat key cut-pattern either though, because that is too easy to pick open.
    In my program I generated all possible key cut-patterns and then had a function that went through that lengthy list and excised everything that failed for one of
    the above reasons (pins too thin, key too jagged or key too flat). This is easy!

    Note that most locksmiths don't know enough programming in any language
    to do this. They do it by hand. This is why every customer gets the same
    master key, which is obviously insecure. lol Also, they don't make some master-key
    cylinders high and some low. They simplify by making all of them low or all
    of them high. This is why the master-key cut-pattern is almost flat, which makes
    it easy to pick open. They aren't doing any thinking about the problem and how to
    provide a secure solution --- they have never done any thinking --- they just learn
    a crude technique when they are apprentices and then stick with that for decades.

    It is really sad that common people don't know how to program computers, given that computers have been commonly available since the early 1980s.
    Some locksmiths do use a computer --- they pay big money for a professionally done master-key generator with a snazzy GUI interface --- there is no guarantee
    that the programmer who wrote this knew anything about the subject
    (he was likely taught by some idiot locksmith with decades of experience
    doing this by hand and doing it badly as described above). Computers haven't really worked out well for society --- in the 1980s there was a lot of expectation
    that computers would be hugely helpful --- computers aren't helpful though.
    The problem is too many smart phones and not enough smart people.
    Nobody ever does any thinking!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hugh Aguilar on Fri Aug 18 13:27:40 2023
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.

    It just means technology has outstripped human thinking - yours
    included. So what is left for humans when they can no longer
    proclaim superior knowledge? That is the problem.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to webmjkfm@gmail.com on Fri Aug 18 10:51:45 2023
    In article <42bad368-8aa7-4af1-893d-989b7cd0c6bfn@googlegroups.com>,
    Jakub Kol á <webmjkfm@gmail.com> wrote:
    Hello I am software developer proficient in JS, Python, Java etc. I have >great appreciation for the philosophy of stack-based Forth language and
    the philosophy of Chuck Moore. I know some Forth basics. What are some
    good beginner projects which I cant take in Forth (preferably gforth)
    which are not very large but will help me gain some more experience in
    this language and philosophy of thinking?

    Good project to begin is ... what interest you.
    I enjoy math problems and learned a great deal of solving projecteuler.net. Solving simple math problems helps to get the basic of the language
    right. The primes, sieving of primes, factoring, greatest common dividers.

    Then think of problems you find tedious in other languages, and
    try to a better solution.


    Thanks in advance.

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat spinning. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to dxforth on Fri Aug 18 03:03:10 2023
    On Friday, August 18, 2023 at 5:27:42 AM UTC+2, dxforth wrote:
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.
    Cut the Internet and see how smart your smartphone still is. Not much
    smarter than a C64 next to a landline.

    It's like your average CEO who's left to his own devices.

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Zbig@21:1/5 to All on Fri Aug 18 03:01:34 2023
    The book doesn't make any
    mention of structs, most likely because nobody at Forth Inc. knows what
    a struct is. The book fails completely at showing the reader how to implement general-purpose data-structures, which is the primary reason
    why the "Starting Forth" enthusiasts are lifelong incompetents.

    You may not agree with me, but IMHO Forth is about figuring out this
    (and any other) solution on your own, and not about using someone's "ready-made" solution. It's C which is about „find the proper library, surely someone already prepared it for you”. And then dig through the
    descriptions of 300-500 functions.

    (Regarding SF — hint: chapter 11, „Extending the compiler with defining
    words and compiling words”)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hans Bezemer on Sat Aug 19 00:12:30 2023
    On 18/08/2023 8:03 pm, Hans Bezemer wrote:
    On Friday, August 18, 2023 at 5:27:42 AM UTC+2, dxforth wrote:
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.
    Cut the Internet and see how smart your smartphone still is. Not much
    smarter than a C64 next to a landline.

    It's like your average CEO who's left to his own devices.

    It takes a certain talent to convince people they need a leader.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to All on Fri Aug 18 09:28:32 2023
    On Thursday, August 17, 2023 at 8:58:15 AM UTC-5, Jakub Kolčář wrote:
    Hello I am software developer proficient in JS, Python, Java etc. I have great appreciation for the philosophy of stack-based Forth language and the philosophy of Chuck Moore. I know some Forth basics. What are some good beginner projects which I cant
    take in Forth (preferably gforth) which are not very large but will help me gain some more experience in this language and philosophy of thinking?

    Thanks in advance.
    First project:
    Build a switch to enable/disable the printing of a
    dot for each item on the stack when OK is printed.

    Names I use (unimportant) are:
    -DOTS to enable the feature
    +DOTS to disable the feature

    Its simple enough to get your feet wet and its very
    useful. In all development need to know if
    trash is left on the stack. Seeing dots after the
    ok when there shouldn't be any tells you quickly you
    have a problem.

    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to dxforth on Fri Aug 18 11:53:25 2023
    On Friday, August 18, 2023 at 4:12:37 PM UTC+2, dxforth wrote:
    On 18/08/2023 8:03 pm, Hans Bezemer wrote:
    On Friday, August 18, 2023 at 5:27:42 AM UTC+2, dxforth wrote:
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.
    Cut the Internet and see how smart your smartphone still is. Not much smarter than a C64 next to a landline.

    It's like your average CEO who's left to his own devices.
    It takes a certain talent to convince people they need a leader.
    That's what I mean. How can you be a leader when no one is following you?

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to Hans Bezemer on Fri Aug 18 12:17:23 2023
    On Friday, August 18, 2023 at 5:03:13 AM UTC-5, Hans Bezemer wrote:
    On Friday, August 18, 2023 at 5:27:42 AM UTC+2, dxforth wrote:
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.
    Cut the Internet and see how smart your smartphone still is. Not much smarter than a C64 next to a landline.

    It's like your average CEO who's left to his own devices.

    Hans Bezemer

    Had a very old text browser on my dos system. It would pass
    pic links to a user bat script which was expected to
    run whatever pic viewer the user had. All the pc's at that
    time had fax modems. So in minutes I had the browser sending
    phone links to a bat file that used AT commands to make
    phone calls from the pc. Had my handset connected with
    the pc using a y-line connector. The modem would detect
    when the far end phone answered and inform me. Then
    I simply had to pick up the handset and start talking.
    Easy to create address book, html file with names and
    phone links.
    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hans Bezemer on Sat Aug 19 13:54:07 2023
    On 19/08/2023 4:53 am, Hans Bezemer wrote:
    On Friday, August 18, 2023 at 4:12:37 PM UTC+2, dxforth wrote:
    On 18/08/2023 8:03 pm, Hans Bezemer wrote:
    On Friday, August 18, 2023 at 5:27:42 AM UTC+2, dxforth wrote:
    On 18/08/2023 12:29 pm, Hugh Aguilar wrote:

    The problem is too many smart phones and not enough smart people.
    Cut the Internet and see how smart your smartphone still is. Not much
    smarter than a C64 next to a landline.

    It's like your average CEO who's left to his own devices.
    It takes a certain talent to convince people they need a leader.
    That's what I mean. How can you be a leader when no one is following you?

    No one? Money and security matters to all of us - no? Who is CEO
    doesn't much matter. If they happen to mouth the words we like to
    hear, we support them and overlook their generous remuneration.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hugh Aguilar@21:1/5 to none albert on Sun Aug 20 18:17:00 2023
    On Friday, August 18, 2023 at 1:51:49 AM UTC-7, none albert wrote:
    Good project to begin is ... what interest you.

    The problem here is that anything that interests anybody of reasonable intelligence will be too much programming work for a first project.
    My second Forth project was a four-dimensional turtle program.
    This was on the Commodore-64, as I had upgraded from the Vic-20.
    The turtle moved in on the W, X, Y, Z axis. The screen showed a 3D
    slice of the 4D object created. I had perspective to a vanishing point.
    The program was written in SuperForth and it was too slow.
    I could rewrite that on a modern 64-bit computer and it would be
    much faster. I doubt that anybody other than myself would be interested.
    I was 18 years old at the time and I thought that space had more than
    the 3 dimensions that we experience. This idea was popular in the
    19th century, but there isn't much support for it now.

    Anyway, I don't recommend focusing on a project that interests you.
    If you do this, you will be the only person who uses your software.
    I recommend focusing on a project that has real-world application.
    My first-ever non-trivial program was the master-key system generator
    on the Commondore Vic-20 and it got used in the real world.
    Later on I worked at Testra and wrote MFX the assembler/simulator
    and Forth cross-compiler for the MiniForth processor built on the
    Lattice isp1048 PLD. The MiniForth got used in the real world as the motion-control board rfor the laser etching machine. MFX continues
    to be used three decades after I wrote it. Programming is more
    interesting when it is used in the real world.

    It is sad, but I doubt that anybody on the Forth-200x committee is
    capable of writing a master-key system generator program like what
    I did on the Vic-20 in 1984 as my first-ever programming effort.
    They are focusing their minds on fantasy, not real-world applications.

    I enjoy math problems and learned a great deal of solving projecteuler.net. Solving simple math problems helps to get the basic of the language
    right. The primes, sieving of primes, factoring, greatest common dividers.

    I remember that Jeff Fox described Albert van der Horst as a "two-plus-two" programmer. This was because Albert solves those Euler projects that have already been solved, sometimes centuries ago. This is like writing a program
    to calculate 2+2 --- you won't learn anything by doing this.

    I have been criticized for this too. My first-ever ANS-Forth program calculated the probabilities of LowDraw poker. It did a recursive descent search through all possible cards being dealt for various card-drawing strategies. There are only about a dozen realistic strategies for drawing cards though, so after these are calculated the program has nothing further to tell you.

    My second ANS-Forth program generated gcode for a CNC milling machine
    and also PostScript. This was for the image of the slide-rule faces. I had a lot of different scales, such as sine and cosine, etc.. On comp.lang.forth
    this was criticized as: "a 'hello world' program with numbers.' There are only about a dozen different scales that can be put on a slide-rule, a few ways to organize them on the slide-rule, and a choice between ten-inch, six-inch or circular. Also, it is possible to put marks on the scales to help with certain calculations. After every possible slide-rule has been generated, you are done.

    The master-key system generator is also "a 'hello world' program with numbers.' A KwikSet lock is pretty low-precision. Just guessing, I'd say there are about 1000 possible master keys and each one supports about 200 sub-keys. It is quite possible, even with a Vic-20 computer, to generate every possible master-key system that can be constructed. Schlage locks have more precision, so there
    are more possible master-key systems, but your Vic-20 should still be adequate to generate all of them (the Vic-20 used cassette tapes that wouldn't have adequate storage, but C-64 floppy disks would be more than adequate).
    Nobody now uses KwikSet locks for master key systems because they are insecure. This was a bad idea in 1984 too. Schlage provides the minimum realistic security.

    So, the real problem is not finding something that interests you.
    The problem is finding something with real-world application that is
    more complicated than a 'hello world' program with numbers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hugh Aguilar on Mon Aug 21 15:28:12 2023
    On 21/08/2023 11:17 am, Hugh Aguilar wrote:

    So, the real problem is not finding something that interests you.
    The problem is finding something with real-world application that is
    more complicated than a 'hello world' program with numbers.

    Should he become a disgruntled programmer who feels unappreciated?
    Better to do what interests. It may lead to discovery. Chasing
    rewards more often than not leads to disappointment and is hardly
    unique.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to hughaguilar96@gmail.com on Mon Aug 21 11:02:13 2023
    In article <c465bf09-ea54-4d33-9766-e6e5141b0ffbn@googlegroups.com>,
    Hugh Aguilar <hughaguilar96@gmail.com> wrote:
    On Friday, August 18, 2023 at 1:51:49 AM UTC-7, none albert wrote:
    Good project to begin is ... what interest you.

    <SNIP>
    I remember that Jeff Fox described Albert van der Horst as a "two-plus-two" >programmer. This was because Albert solves those Euler projects that have >already been solved, sometimes centuries ago. This is like writing a program >to calculate 2+2 --- you won't learn anything by doing this.

    Concerning projecteuler.net
    It is true that problems that are accepted have a solution and are
    verified by multiple methods that the solution is correct.
    It is also true that in a certain period they created very hard problems,
    where the criterion was that the solution was only not on the internet, but there were no real clues to be found on the internet.
    Of those I have solved a few. (rating 95 or 100).

    It is challenging to use Forth for problems that are sent in by folks
    that wanted Haskell to look good.

    <SNIP>

    So, the real problem is not finding something that interests you.
    The problem is finding something with real-world application that is
    more complicated than a 'hello world' program with numbers.

    No. Learning Forth is not about "real-world applications".
    On the other hand it is virtually impossible to concentrate on
    a problem that don't interest you.

    Groetjes Albert
    --
    Don't praise the day before the evening. One swallow doesn't make spring.
    You must not say "hey" before you have crossed the bridge. Don't sell the
    hide of the bear until you shot it. Better one bird in the hand than ten in
    the air. First gain is a cat spinning. - the Wise from Antrim -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)