• Writing a FORTH in QBE?

    From Bruce Axtens@snetxa@hotmail.com to comp.lang.forth on Fri Nov 28 17:12:18 2025
    From Newsgroup: comp.lang.forth

    I've just become aware of QBE <https://c9x.me/compile/>. Could one write
    a FORTH in it? For the little bit of reading I've done, it would seem a
    bit easier than writing one in LLVM.

    -Bruce
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Fri Nov 28 10:09:31 2025
    From Newsgroup: comp.lang.forth

    Bruce Axtens <snetxa@hotmail.com> writes:
    I've just become aware of QBE <https://c9x.me/compile/>. Could one write
    a FORTH in it?

    An interpreter written in QBE? Should be possible.

    Compiling Forth through QBE to machine code? Here the problem is that
    QBE (like some other intermediate languages) defines C-inspired
    functions and imposes the resulting calling convention on the
    languages compiling to it. This is not ideal for all programming
    languages, which is why LLVM has the option for other calling
    conventions, but I don't see that for QBE. So one option is to live
    with the constraints of the given calling convention (but why compile
    to QBE instead of C in that case?), another is to eschew functions,
    calls, and returns, and implement everything in one function, with
    calls implemented as push-and-jump, and returns implemented as pull-and-indirect-jump. Both are not ideal.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2025 CFP: http://www.euroforth.org/ef25/cfp.html
    EuroForth 2025 registration: https://euro.theforth.net/
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Nov 28 12:21:33 2025
    From Newsgroup: comp.lang.forth

    In article <10gbp1i$28pf6$1@dont-email.me>,
    Bruce Axtens <snetxa@hotmail.com> wrote:
    I've just become aware of QBE <https://c9x.me/compile/>. Could one write
    a FORTH in it? For the little bit of reading I've done, it would seem a
    bit easier than writing one in LLVM.

    In reddit one has succeeded a booting (!) Forth aided by ai.
    Much more interesting than based on languages like QBE or c.

    -Bruce
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Bruce Axtens@snetxa@hotmail.com to comp.lang.forth on Fri Nov 28 11:28:10 2025
    From Newsgroup: comp.lang.forth

    On 28/11/25 7:21 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10gbp1i$28pf6$1@dont-email.me>,
    Bruce Axtens <snetxa@hotmail.com> wrote:
    In reddit one has succeeded a booting (!) Forth aided by ai.
    Much more interesting than based on languages like QBE or c.
    Bloody AI. I've had enough experience with that to not want to. I'm happy to
    dialogue with the LLM to brainstorm, but I trust it's ability to code like
    I trust a jack hammer to do brain surgery.

    -Bruce
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Nov 28 16:25:45 2025
    From Newsgroup: comp.lang.forth

    In article <10gc109$2bpqq$1@dont-email.me>,
    Bruce Axtens <snetxa@hotmail.com> wrote:
    On 28/11/25 7:21 pm, albert@spenarnc.xs4all.nl wrote:
    In article <10gbp1i$28pf6$1@dont-email.me>,
    Bruce Axtens <snetxa@hotmail.com> wrote:
    In reddit one has succeeded a booting (!) Forth aided by ai.
    Much more interesting than based on languages like QBE or c.
    Bloody AI. I've had enough experience with that to not want to. I'm happy to
    dialogue with the LLM to brainstorm, but I trust it's ability to code like
    I trust a jack hammer to do brain surgery.

    "enough experience"? The experience is that IBM made a chess program
    that beat the world champion. Now the AI chess programs are out of
    this world. Experience only counts where the events are moderately
    repetitive.

    If the software pass the tests, it should be trusted.
    Actually AI skill is more trustworthy than the low tier of USA
    programmers.
    You realize that the Chinese have factories designed by AI?
    Xiaomi produces one mobile phone each second.
    The factories are dark because the robot don't need light.
    The lights come on if there is a hickup.
    I have Xioami A5. They test the bejezus off these telephones,
    and they work pretty well. Come on. It starts with designing
    logic. Could you do that by hand? Then it proceeds designing
    masks. Could you do that by hand?
    The wafers are placed with submicron precision.
    Could you do that by hand?

    Before checking in a version of ciforth passes an automated test.
    Any version however created that passed that test is pretty reliable.

    P.S. The USA cannot earn money of AI. The only thing is to
    design factories using it.
    Expect a crash in the ai bubble that dwarfs the crash in the 1930's in
    the USA c.s. , accelerated by Trump tariff idiocy.
    (China and BRICS work hard to immunize from this coming
    crash. )

    -Bruce

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21a-Linux NewsLink 1.2