Wednesday, April 12, 2023

Forth

The most important programming language of all time. 

Forth posts by me 

26 comments:

  1. Replies
    1. It's an astrobiology calculator:
      Carbon Hydrogen Nitrogen Oxygen Phosphorus Sulphur
      Adenine, Cytosine, Guanine, Thymine
      (sorry for the delay - you're the first one kind enough to post here lately)

      Delete
  2. Well. Tryed Forth.

    Well... how tryed. Have read book. And found it neat.

    Even installed some SwiftForth...

    But... I have no tasks to solve with it. :-(((

    ReplyDelete
  3. Forth is perfect for models with vast numbers of autonomous (nearly independent) agents. There really is no other language that can do this (millions of threads running on millions of cores). GPUs looked good to me years ago, but they all use SIMD or MIMD architecture, not a more 'natural world' one. What I said about 'sparse networks' in reply to your comment in GOFAI also applies.

    Thanks for your thoughts, nice to know someone's reading this blog.

    ReplyDelete
    Replies
    1. Well... I heard about multi-core systems... but heard nothing about available off the shelf.

      Only through FPGA.

      Well, I'm sure there is some FPGA Forth already. But saddly, I cannot afford it.

      And even if i can... for what purpose.

      If I could be interested in Forth -- it's because my Holy Grail seeking mission to find New Programming. More comprehensive programming. More effective. Whatever.

      Delete
    2. Yes, some Forthers work with FPGAs, including entire stack-oriented microprocessors (similar to the old NOVIX stuff). For me, it's the potential of implementing many thousands (or more) individual interpreters, not simply multiple cores. This is a much more natural approach, indeed it's the way evolution itself works. There is (almost) nothing 'off the shelf'. That's also where Forth shines: experimentation. Tiny systems can be implemented quickly & cheaply, and scaled when/if they work out.

      Delete
    3. Well... but can they be united into bigger systems???

      Today. After many-many tryes... Object Oriented Programming is still the best... if not ONLY way to make BIGGER systems...

      And Forth do not seems like able to communicate good with it.

      Delete
    4. There's an old joke about OOP: I wanted a banana, but I had to inherit a monkey, then a tree, then an entire jungle to get it.

      In general, Forth is not good for building large systems because it likes to do everything in Forth (there are some good internal Forth OOP implementations). However, it's the only game in town for the thousands of interpreters model I play with.

      BTW I was once a professional Smalltalk programmer.

      Delete
    5. \\There's an old joke about OOP: I wanted a banana, but I had to inherit a monkey, then a tree, then an entire jungle to get it.

      Yes.

      But. That's it.

      Apart from programmer I have solid education in engineering.

      And I know that it EXACTLY like that too.

      To have iPhone... you need to "inherit" not only some pile of code of iOS (which is inherited from NEXTStep project, which is inherited from UNIX, which inherited from time sharing systems, which was inherited from ENIAC, which was inherited...)

      But also.

      Chemistry -- for every plastic used in it.

      Metalurgy -- for metal cover.

      Optics and Semicondactors.

      And etc, etc, etc...

      Delete
    6. \\BTW I was once a professional Smalltalk programmer.

      Well... what do you think about Squeak heir of it?

      With very neat and profound visual part -- what Forth visibly lacking -- ability to work seemless with modern visual primitives.

      Delete
    7. Big Raspberry Pi fan here...
      https://www.scidata.ca/smalltalk-on-the-pi/

      Delete
    8. \\Once the ‘central dogma’ is mastered, there’s nothing left to learn (about the language, not about the problem at hand of course). One computer plus one human mind are sufficient to do valuable work, although of course entire teams and communities may eventually join in.

      Yes.

      But you know what's the problem here? Turing Tarpit.
      Where "everything is possible... but nothing is easy".

      So... if I'd be forced to chose... or, I'd be a Tyrant to force all coders to code in one lang.

      I'd chose machine codes. ;-)
      As it makes you able to do REAL things (like triple buffering, or on-the-go-chifering/compressing, or nitty-gritty networking, or... place your favorite her)

      Or... allure em into C... as "high level assembler". ;-P

      But... still, I'd like have something better.

      Some REAL D... or even E language, F???

      Not just ++ of it. Or some phony counterfeits.
      Which only remove something, or add something... not that necessary (though C++ templates are neat... enough)

      Delete
    9. Oh...

      Do you have some good(?) experience with APL?

      It intriguing me with its representative might -- whole program in just a bunch of symbols.

      Delete
    10. Well... problem with Squeak is the same time it's might.

      Poor interoperability... :-(

      How good it would be... if it would be easy to interoperate with some shell script. Or other application in whatever lang on your sufficiently Unix/Linux system...

      Delete
    11. Explored other topics too.

      \\The best combat games are those that enable the player to construct their own custom devices. Sadly, this is always achieved with a rigid menu system instead of a pencil-and-paper approach.

      Saddly... it's the same as in our Real World.

      We do not have much choice... "pencil-and-paper approach" to something working in real life too.

      There is some limited choice of option... you much put a lot of work even before you can start using it.

      Too much biolerplate code... as programmer could say.

      Before one could start making something interesting.

      And then... viable possibilities shrink abruptly again.

      Like for exmple -- to make a spear... on need to learn how to choose good wood for it... then how to dry it properly, so it would not loose its flexibility... then make a sharp tools to cut it to a needed form... add a tip.

      But then... it's just a spear. You can pierce a mamoot... but nothing much of else.

      Maybe add some incrustation. Or inscribe own name on it.

      But... that's it.

      Delete
    12. \\ A packaging system would allow players to share (or even purchase) expert systems from others.

      Yes!

      Exactly!

      Delete
    13. Just try to imagine... what if Lenat would made his EURISCO open??? At least among that Traveller gamer.

      Delete
  4. APL: looked at it when I was in school, couldn't afford the keyboard!

    ReplyDelete
    Replies
    1. https://www.dyalog.com/prices-and-licences.htm#other That is somewhat higher priced keyboards there ;-) . Okay, i shall budget my own 'special' keyboard's connectivity with SwiftFORTH for about 10x this APL keyboard's market price...

      Delete
  5. Replies
    1. yes. I know

      but it looks like digression

      Delete
  6. Heretical question.

    Is there maybe some Forth... -like system?

    But without Polish notation.

    ReplyDelete
    Replies
    1. Not heretical at all. We all know who won the RPN vs Algebraic calculator wars. However, RPN encourages one to think like a machine - kind of charming in a way.

      Delete
    2. Well... pity that it overshadowed the mighty CORE idea of "WORDS"... :-(

      Delete
  7. And Forth based OS? ;-)

    ReplyDelete

Science

    [Our research] has nothing to do directly with defending our country except to help make it worth defending ...