Back & Forth - Forth is even harder

Поділитися
Вставка
  • Опубліковано 7 лют 2025
  • If you thought Forth was hard, brace yourselves - it's even harder than you thought! Disaster looms at every branch and loop. How does anyone ever get any work done using this language?
    The previous "Forth is hard" episode:
    • Back & Forth - Why is ...
    My Forth compiler can be found here:
    sourceforge.ne...
    You can download it anonymously and for FREE.
    Most popular platforms are supported - even some old ones.

КОМЕНТАРІ • 11

  • @creditscorenz
    @creditscorenz 4 місяці тому +2

    I agree with this, Hans. Low level Forth is hard, but the thing is, you don't tend to spend so much time at that level. Instead, you rapidly develop your own domain specific language and use that instead. But... because you developed that language yourself, you tend to keep refining and simplifying it as you go along until it's the simplest possible way to fulfill your needs. Until I met Forth, instead of trying to simplify, my natural reaction to an issue was to make it more complex (grab a new library from somewhere or take an existing function and add more parameters to it). Forth makes you work in the opposite direction. No libraries, no frameworks, lots of factoring instead. The end of this reductionism? The REPL is the answer to everything 😆

  • @encapsulatio
    @encapsulatio 3 місяці тому

    You should do Advent of Code live streams in Forth. Nothing beats a veteran Forth user thinking(speaking out loud) in real time thru problems and applying the constraints Forth imposes to factor and make elegant solutions the Forth way.
    I think those would be even more interesting and inspiring to watch to pass on to others the fascination of using Forth to solve problems.
    From all people I ever saw on youtube talk about Forth you're the one who has a way with words that makes it super addicting and engrossing to watch. It would be a shame to not use that talent to promote Forth.
    But while I enjoy the lecture style I still think noting beats you solving in real time something while doing it in Forth and speaking out loud your thinking and decision making process as you solve something.

    • @HansBezemer
      @HansBezemer  3 місяці тому +1

      As a matter of fact, I'm doing a series on simple Forth code that packs quite a punch in functionality.
      Note I did do a series on my preprocessor that outdoes CPP with lots of code snippets. However, I won't restrict myself to either one or the other. My Forth experience has many dimensions. At one time it's this aspect that grabs my attention. At another time, it's that one.
      But live streams - I'm not sure. I don't think I'm the type to do a live stream. I need a lot of planning and tweaking to feel comfortable.
      But thank you very much for the compliments! I try to improve on each one.

  • @albertmagician8613
    @albertmagician8613 4 місяці тому

    The figForth model has available all dictionary space to use for the stack. If configured at 8 Gbyte or 16 Gbyte, it takes an infinite time for the stack to overflow. So it depends on the Forth.

    • @HansBezemer
      @HansBezemer  4 місяці тому

      I don't think I wanna wait for that. Fail early, fail often ;-)

  • @infocreate3885
    @infocreate3885 5 місяців тому

    good video on forth, i love watching these educational lessons on forth. forth is really powerful

  • @AK-vx4dy
    @AK-vx4dy 4 місяці тому

    Forth is another beast.... other kind of thinking.
    And maybe, only maybe is good to see some idiomatic code, because trying to implementing old tricks from other languages with new commands may fail....

    • @HansBezemer
      @HansBezemer  4 місяці тому

      The proof (for me) is in how it translates to other languages. My C stuff started to break up in many smaller functions (like three-five line bodies). I also translated some Forth routines to other languages - with some surprising effects. I'll be doing two of them in the near future.

    • @AK-vx4dy
      @AK-vx4dy 4 місяці тому

      @@HansBezemer I still must watch fully your videos what exactly are you doing. Decades ago Forth prefered way was to build "new words" like dsl to the max. But times changed, now maybe are forth jit compilers?

    • @HansBezemer
      @HansBezemer  4 місяці тому +1

      @@AK-vx4dy What 4tH is doing is simple - it compiles to byte code. On a high abstraction level, a symbol table isn't that much different from a dictionary. I don't think it makes much difference (in thinking) whether you develop your program using a classic Forth architecture or a classic compiler architecture. Note ForthCMP was a true compiler as well - so 4tH is not new in that regard. Going from byte code to JIT has been done before. That's the fun of it - Forth has so many (different) implementations..

  • @touka32able
    @touka32able 5 місяців тому

    thank you!!