• GForth in Docker.

    From Nick P@nick.268@gmail.com to comp.lang.forth on Tue Aug 4 22:21:03 2026
    From Newsgroup: comp.lang.forth

    Hi all, Im new here.

    Having checked out the GForth.org webpage I have gone with the "use
    docker" option (on Ubuntu 22.04). As a result I'm having difficulty
    getting .fs files I have on one of my hard drives to run in it.

    I can get the docker image running, and use the command line without a problem, what I cant do is run a file that is in some arbitary directory
    on a disk.

    I strongly suspect its a docker issue rather than a Gforth issue as the
    Gforth site and documentation does not cover this so far as I can tell.

    Does anyone have a suggestion of a source of information, jargon lite hopefully, that will get me started using source files with GForth in a
    docker container?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From jkn@jkn+nin@nicorp.co.uk to comp.lang.forth on Tue Aug 4 22:50:03 2026
    From Newsgroup: comp.lang.forth

    On 04/08/2026 22:21, Nick P wrote:
    Hi all, Im new here.

    Having checked out the GForth.org webpage I have gone with the "use
    docker" option (on Ubuntu 22.04). As a result I'm having difficulty
    getting .fs files I have on one of my hard drives to run in it.

    I can get the docker image running, and use the command line without a problem, what I cant do is run a file that is in some arbitary directory
    on a disk.

    I strongly suspect its a docker issue rather than a Gforth issue as the Gforth site and documentation does not cover this so far as I can tell.

    Does anyone have a suggestion of a source of information, jargon lite hopefully, that will get me started using source files with GForth in a docker container?

    What do you mean by 'can't run...'? What did you try, and what happened?

    I would expect that your 'docker run' command should include parameters
    to map directory/ies on your host machine, to those in the running
    docker container. Then, the GForth running in the latter will be able to
    see your existing Forth files.

    Does that help any?

    J^n

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Nick P@nick.268@gmail.com to comp.lang.forth on Tue Aug 4 23:20:16 2026
    From Newsgroup: comp.lang.forth

    On 04/08/2026 22:50, jkn wrote:
    On 04/08/2026 22:21, Nick P wrote:
    Hi all, Im new here.

    Having checked out the GForth.org webpage I have gone with the "use
    docker" option (on Ubuntu 22.04). As a result I'm having difficulty
    getting .fs files I have on one of my hard drives to run in it.

    I can get the docker image running, and use the command line without a
    problem, what I cant do is run a file that is in some arbitary
    directory on a disk.

    I strongly suspect its a docker issue rather than a Gforth issue as
    the Gforth site and documentation does not cover this so far as I can
    tell.

    Does anyone have a suggestion of a source of information, jargon lite
    hopefully, that will get me started using source files with GForth in
    a docker container?

    What do you mean by 'can't run...'? What did you try, and what happened?

    I would expect that your 'docker run' command should include parameters
    to map directory/ies on your host machine, to those in the running
    docker container. Then, the GForth running in the latter will be able to
    see your existing Forth files.

    Does that help any?

    -a-a-a J^n


    Yes it does somewhat.

    I initially tried:

    $sudo docker run -it --rm forthy42/gforth filename.fs

    in a terminal in the forth files folder, this was more in hope than expectation to be honest. It didn't work I got a number of directory not
    found errors, I forget exactly which.

    Following your suggestion I did a bit of Duck Duck AI on the issue.

    It came up with the suggestion of opening a terminal in the files
    directory and running the multiline:

    sudo docker run -it \
    -v "$PWD":/usr/src/myapp \
    -w /usr/src/myapp \
    forthy42/gforth gforth fac1.fs -e bye

    which didn't give me any errors but closed Forth immediately. Losing the
    '-e bye' from the end kept it open, and I was able to use the colon definitions in the fac1.fs file at the command line.

    So I seem to be able to run an arbitrary file now, but having pre-read
    through "Starting Forth" and "Forth Programmers Handbook" before setting
    out on learning Forth properly, it's clear that may not suffice.

    So am I correct in thinking it's a Docker issue and I should try to
    understand that?

    N.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Wed Aug 5 06:35:04 2026
    From Newsgroup: comp.lang.forth

    Nick P <nick.268@gmail.com> writes:
    It came up with the suggestion of opening a terminal in the files
    directory and running the multiline:

    sudo docker run -it \
    -v "$PWD":/usr/src/myapp \
    -w /usr/src/myapp \
    forthy42/gforth gforth fac1.fs -e bye

    which didn't give me any errors but closed Forth immediately. Losing the
    '-e bye' from the end kept it open, and I was able to use the colon >definitions in the fac1.fs file at the command line.

    Container technologies like Docker try to isolate the stuff inside the container from the outside, in order to protect the outside from
    whatever may go wild inside the container. But these days it is
    questionable how well that promise holds up for technologies like
    Docker that rely on the OS kernel being secure; VMs make the same
    promise, with a higher overhead, and I have read suggestions that
    their promise has a better chance of holding up.

    You probably do not want this kind of isolation when running Gforth,
    but if you use Docker, you get it and have to tell it where to drop
    the isolation.

    Reading through the man page of docker, the -v option means that your
    working directory ($PWD) becomes visible as /usr/src/myapp inside the
    container with read and write permissions, and the -w option means
    that /usr/src/myapp becomes the working directory inside the
    container. So with this command line, you can let gforth access files
    in your working directory, but not elsewhere. You may need a changed
    -v option or additional -v options if you want to make more
    directories visible to Gforth, and adjust -w accordingly.

    So I seem to be able to run an arbitrary file now, but having pre-read >through "Starting Forth" and "Forth Programmers Handbook" before setting
    out on learning Forth properly, it's clear that may not suffice.

    My guess is that these options may be enough for working through these
    books.

    So am I correct in thinking it's a Docker issue and I should try to >understand that?

    If you want to do more things with Gforth, like letting Gforth scripts
    process files in other directories than your working directory, you
    probably should look more closely at the docker options.

    Alternatives:

    1) Use Ubuntu's gforth package. A disadvantage is that this is gforth
    0.7.3, and misses some conveniences of the current development
    version.

    2) Build Gforth from the tarball; see <https://gforth.org/> for
    instructions.

    - 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 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Wed Aug 5 10:19:17 2026
    From Newsgroup: comp.lang.forth

    In article <114tl3v$2fsah$1@dont-email.me>, Nick P <nick.268@gmail.com> wrote: >Hi all, Im new here.

    Having checked out the GForth.org webpage I have gone with the "use
    docker" option (on Ubuntu 22.04). As a result I'm having difficulty
    getting .fs files I have on one of my hard drives to run in it.

    I can get the docker image running, and use the command line without a >problem, what I cant do is run a file that is in some arbitary directory
    on a disk.

    I strongly suspect its a docker issue rather than a Gforth issue as the >Gforth site and documentation does not cover this so far as I can tell.

    Does anyone have a suggestion of a source of information, jargon lite >hopefully, that will get me started using source files with GForth in a >docker container?

    To me it merely proves that docker is creating problems, not solving them.
    The first thing I want to know if I run a compiler where the working
    directory is so that I can access files without a graphics interface.

    So preferred:
    unzip a forth archive
    cd working
    try it
    cd ..
    delete working recursively

    If you like it, you can install the program.
    If the forth is any good, you will want it all
    over the place.

    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.22a-Linux NewsLink 1.2
  • From Colin Tree@treecolin@gmail.com to comp.lang.forth on Thu Aug 6 08:47:06 2026
    From Newsgroup: comp.lang.forth

    Hi,
    No Debian package... recursive dependency, cute.
    Installed package from Sid, plus dependencies,

    then compiled from source with many, many dependencies,
    purged Sid packages, installed, that was painful.

    Hoping the Sid package makes it to stable on the next release.

    Colin

    On 5/8/26 18:19, albert@spenarnc.xs4all.nl wrote:
    In article <114tl3v$2fsah$1@dont-email.me>, Nick P <nick.268@gmail.com> wrote:
    Hi all, Im new here.

    Having checked out the GForth.org webpage I have gone with the "use
    docker" option (on Ubuntu 22.04). As a result I'm having difficulty
    getting .fs files I have on one of my hard drives to run in it.

    I can get the docker image running, and use the command line without a
    problem, what I cant do is run a file that is in some arbitary directory
    on a disk.

    I strongly suspect its a docker issue rather than a Gforth issue as the
    Gforth site and documentation does not cover this so far as I can tell.

    Does anyone have a suggestion of a source of information, jargon lite
    hopefully, that will get me started using source files with GForth in a
    docker container?

    To me it merely proves that docker is creating problems, not solving them. The first thing I want to know if I run a compiler where the working directory is so that I can access files without a graphics interface.

    So preferred:
    unzip a forth archive
    cd working
    try it
    cd ..
    delete working recursively

    If you like it, you can install the program.
    If the forth is any good, you will want it all
    over the place.

    Groetjes Albert

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Aug 6 05:08:34 2026
    From Newsgroup: comp.lang.forth

    Colin Tree <treecolin@gmail.com> writes:
    No Debian package... recursive dependency, cute.

    The tarball contains the stuff that needs gforth to build.

    then compiled from source with many, many dependencies,

    Yes. Gforth relies on a lot of infrastructure during building,
    somewhat less at run-time.

    - 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 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.22a-Linux NewsLink 1.2