• World domination still a bit delayed by Gemini? NOPE!

    From yeti@yeti@tilde.institute to tilde.institute on Fri Apr 19 17:19:53 2024
    Staring a while at the HTTPS client example in Gambit-Scheme's manual[0]
    I could minimise and morph it back to plain HTTP and then to NNTP and
    NNTPS examples.

    #+begin_example
    (let ( (d (open-tcp-client (list address: "news.eternal-september.org"
    port-number: 119
    eol-encoding: 'cr-lf))) )
    (print port: d "article <rrej7g$72d$1@dont-email.me>\nquit\n.\n")
    (force-output d)
    (print (read-line d #f)) )
    #+end_example

    #+begin_example
    (let ( (d (open-tcp-client (list address: "news.eternal-september.org"
    port-number: 563
    eol-encoding: 'cr-lf
    tls-context: (make-tls-context)))) )
    (print port: d "article <rrej7g$72d$1@dont-email.me>\nquit\n.\n")
    (force-output d)
    (print (read-line d #f)) )
    #+end_example

    But between those HTTP and NNTP experiments I tried to access Gemini
    with a similar minimised example and it stayed uncooperative. I'm still scratching my head about that, but currently being more inet-rested
    (nice char swap / dash added later) in NNTP(S), the Gemini problem boils
    down to the curiosity level instead of being essential. It may come
    back somewhen later to bite me again, so if answers find me earlier than
    that, I might save some time collecting client and server code examples
    for (not only Smallnet) protocols (and not only in Scheme).

    ____________

    [0]: https://gambitscheme.org/latest/manual
    --
    Trust me, I know what I'm doing...


    ;-D
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From Patricia Ferreira@pferreira@example.com to tilde.institute on Fri Apr 19 16:58:16 2024
    yeti <yeti@tilde.institute> writes:

    Staring a while at the HTTPS client example in Gambit-Scheme's manual[0]
    I could minimise and morph it back to plain HTTP and then to NNTP and
    NNTPS examples.

    #+begin_example
    (let ( (d (open-tcp-client (list address: "news.eternal-september.org"
    port-number: 119
    eol-encoding: 'cr-lf))) )
    (print port: d "article <rrej7g$72d$1@dont-email.me>\nquit\n.\n")
    (force-output d)
    (print (read-line d #f)) )
    #+end_example

    #+begin_example
    (let ( (d (open-tcp-client (list address: "news.eternal-september.org"
    port-number: 563
    eol-encoding: 'cr-lf
    tls-context: (make-tls-context)))) )
    (print port: d "article <rrej7g$72d$1@dont-email.me>\nquit\n.\n")
    (force-output d)
    (print (read-line d #f)) )
    #+end_example

    But between those HTTP and NNTP experiments I tried to access Gemini
    with a similar minimised example and it stayed uncooperative.

    You're saying you managed to access the NNTP server in both ways above,
    but the Gemini protocol somehow gives you a problem? Are you able to
    talk to the Gemini protocol with the command below?

    openssl s_client -connect host.name:1234
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Sat Apr 20 00:18:03 2024
    Yipyip, I can access Gemini via GNUTLS-CLI, NC, Ncat.

    I have to switch some clients to not refuse "insecure" certs (Gemini
    often uses self signed sigs (and then trust on first use by design)).
    This may be the rough edge and I do not see an option to handle that via
    the OpenSSL options Gambit makes accessible.

    #+begin_src sh
    { sleep 1; printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' ; } \
    | gnutls-cli --insecure geminiprotocol.net:1965
    #+end_src

    #+begin_src sh
    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | nc -c -T noverify geminiprotocol.net 1965
    #+end_src

    #+begin_src sh
    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | ncat --ssl geminiprotocol.net 1965
    #+end_src

    Ncat seems tolerant by default.


    It still may be something totally unrelated I'm still overlooking.


    /!\ Note to $SELF: Add an OpenSSL snippet to my collection.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From Patricia Ferreira@pferreira@example.com to tilde.institute on Sat Apr 20 06:51:50 2024
    yeti <yeti@tilde.institute> writes:

    [...]

    #+begin_src sh
    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | ncat --ssl geminiprotocol.net 1965
    #+end_src

    Ncat seems tolerant by default.

    Meaning it accepts self-signed but if you pass an option --dont-do-it,
    it doesn't? I like that: insecure by default. Why don't we let the
    fearful people read the manual? Why must always the brave that need to
    learn how to turn off all the bureaucracy?
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Sat Apr 20 13:02:18 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:

    Ncat seems tolerant by default.

    Meaning it accepts self-signed but if you pass an option --dont-do-it,
    it doesn't?

    The man-page includes:

    ------------------------------------------------------------------------
    --ssl-verify Verify trust and domain name of certificates ------------------------------------------------------------------------

    Seems it shall be used instead of `--ssl`.

    ------------------------------------------------------------------------
    --ssl-verify (Verify server certificates)
    In client mode, --ssl-verify is like --ssl except that it
    also requires verification of the server certificate. Ncat
    comes with a default set of trusted certificates in the file
    ca-bundle.crt. Some operating systems provide a default list
    of trusted certificates; these will also be used if
    available. Use --ssl-trustfile to give a custom list. Use -v
    one or more times to get details about verification failures.
    Ncat does not check for revoked certificates.

    This option has no effect in server mode. ------------------------------------------------------------------------

    Meaning it accepts self-signed but if you pass an option --dont-do-it,
    it doesn't?

    I'm not sure I grok Ncat's behaviour:

    #+header: :prologue exec 2>&1 :epilogue true :results output :wrap example #+begin_src sh
    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | ncat --ssl geminiprotocol.net 1965
    #+end_src

    #+RESULTS:
    #+begin_example
    20 text/gemini
    # Project Gemini specifications

    In late March 2024, the official Gemini specification was refactored into two separate documents, one which addresses only the network protocol and one which addresses only the markup format. Both specifications are intended to be more formal and less ambiguous than the combined document which historical served as a "speculative specification".

    protocol-specification.gmi Gemini network protocol specification gemtext-specification.gmi Gemini hypertext format ("gemtext") specification

    The old speculative specification, which used to live at the URL you're at right now, will evolve instead into a "technical overview". It's more detailed than the Project Gemini FAQ, and is aimed at geeks, not a general audience, but it stops short of covering every corner case and defining things in down-to-the-byte detail, for which you should see the appropriate specification above. The overview serves as a good and highly readable introduction to the technologies behind Gemini. You can probably still use it to write a client which works well enough, often enough to be genuinely useful.

    tech-overview.gmi Project Gemini technical overview

    If you've arrived at this page by following a link or a bookmark, please consider updating it, or asking for it to be updated, to point to the technical overview if you think that's more approprite for the intended audience than this explanatory page.
    #+end_example

    #+header: :prologue exec 2>&1 :epilogue true :results output :wrap example #+begin_src sh
    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | ncat --ssl-verify geminiprotocol.net 1965
    #+end_src

    #+RESULTS:
    #+begin_example
    Ncat: TIMEOUT.
    #+end_example

    I like that: insecure by default. Why don't we let the fearful people
    read the manual?

    No idea.

    Why must always the brave that need to learn how to turn off all the bureaucracy?

    I'm not brave. I just think forcing TLS into Gemini is BS, like with
    every other protocol. The outer tunnel to a server should be an
    orthogonal dimension of the parameters of the connection and the user
    should be deciding which one to use, including NONE as a valid
    alternative. Stacking protocols should be modular instead of being
    glued into some protocols and not into others.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Sat Apr 20 15:10:10 2024
    yeti <yeti@tilde.institute> writes:

    #+header: :prologue exec 2>&1 :epilogue true :results output :wrap example #+begin_src sh

    printf 'gemini://geminiprotocol.net/docs/specification.gmi\r\n' \
    | ncat --ssl-verify geminiprotocol.net 1965
    #+end_src

    #+RESULTS:

    #+begin_example
    Ncat: TIMEOUT.
    #+end_example

    I've zero idea why there are blank lines after "#+begin_src sh" and "#+RESULTS:". That needs a closer look somewhen... later... mayhaps...
    --
    |rom The Future. +++ Breaking News From The Future. +++ Breaking News F|
    | The USoA are switching to the binary number system because |
    | having more than 1+1 distinct digits is far too woke. |
    |+ #MABA + #makeAmericaBinaryAgain + #USA + #USoA + #woke + #MABA + #ma|
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Mon Apr 22 15:52:36 2024
    Meanwhile that TIMEOUT has turned into a different error and I have no
    idea why or what happened before.

    Having found some Gemini servers I can access even with "--ssl-verify",
    I'm fairly convinced now that Gambit just needs an option too to
    dis-/arm that check on demand.

    I could drop a question about this via Gwene into Gambit's ML:

    | Newsgroups: gmane.lisp.scheme.gambit
    | To: gambit-list@iro.umontreal.ca

    Fingers X-ed... ,,X_

    I'd like to continue using Gambit, but if I need to switch the Scheme
    compiler to continue playing with those protocols, I will do exactly
    that.

    What I do not want is switching to Lisp. I'd prefer to only use one
    Lisp and this shall be Emacs-Lisp and that one is really bad at network
    access and even worse for making stand alone tools to run without Emacs.

    Similarly for Scheme. My experiences with Debian and Ubuntu told me
    long ago that very similar, but not identical is a bigger problem than
    big differences, e.g. using two more distant Unix relatives side by
    side.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Mon Apr 22 16:16:29 2024
    Sometimes one just needs to be brave enough to ask, but that's a real
    hurdle for me, especially in the context of contexts/languages where I
    still have the feeling of not even having reached preschool level.

    The ML quickly gave a reaction and a hint how to patch it. What's
    really needed would be an option to do that at runtime and especially
    per socket/connection, but it is a start and shows what should be
    touched.

    It's an issue now: <https://github.com/gambit/gambit/issues/904>
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Mon Apr 22 16:16:58 2024
    Sometimes one just needs to be brave enough to ask, but that's a real
    hurdle for me, especially in contexts/languages where I still have the
    feeling of not even having reached preschool level.

    The ML quickly gave a reaction and a hint how to patch it. What's
    really needed would be an option to do that at runtime and especially
    per socket/connection, but it is a start and shows what should be
    touched.

    It's an issue now: <https://github.com/gambit/gambit/issues/904>
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From Patricia Ferreira@pferreira@example.com to tilde.institute on Mon Apr 22 14:27:32 2024
    yeti <yeti@tilde.institute> writes:

    [...]

    What I do not want is switching to Lisp. I'd prefer to only use one
    Lisp and this shall be Emacs-Lisp and that one is really bad at network access and even worse for making stand alone tools to run without Emacs.

    I was introduced to Lisp last December and was coming from Racket. I
    had not looked back. Lisp seems so much easier and more fun to use.

    Similarly for Scheme. My experiences with Debian and Ubuntu told me
    long ago that very similar, but not identical is a bigger problem than
    big differences, e.g. using two more distant Unix relatives side by
    side.

    I believe that might be true.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Mon Apr 22 18:39:37 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:

    [...]

    What I do not want is switching to Lisp. I'd prefer to only use one
    Lisp and this shall be Emacs-Lisp and that one is really bad at network
    access and even worse for making stand alone tools to run without Emacs.

    I was introduced to Lisp last December and was coming from Racket. I
    had not looked back. Lisp seems so much easier and more fun to use.

    Similarly for Scheme. My experiences with Debian and Ubuntu told me
    long ago that very similar, but not identical is a bigger problem than
    big differences, e.g. using two more distant Unix relatives side by
    side.

    I believe that might be true.



    |\/| _ _ _ _ _ | | |
    | |(_)(_)(_)| | | . . .

    I'm hallucinating and still see Patricia here...

    ;-)



    I've no aversion against Lisp, just Emacs-Lisp makes the most sense for
    me now. I'm still in Lisp and Scheme preschool, but it is fun to see
    how useful even a few lines are.

    E.g. in that experiment where I collect code snippets that all shall
    produce the same output and suppress the output unless it does not match
    the expected results.

    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.org> \\ <http://yeti.freeshell.org/brain/unsorted.d/compare-results.html>

    I'll need many more of such small helpers and that is the reason why
    Elisp makes the most sense for me. Maybe when I start to dream in Lisp
    I may dare to touch a 2nd dialect.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From Patricia Ferreira@pferreira@example.com to tilde.institute on Mon Apr 22 21:42:04 2024
    yeti <yeti@tilde.institute> writes:

    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:

    [...]

    What I do not want is switching to Lisp. I'd prefer to only use one
    Lisp and this shall be Emacs-Lisp and that one is really bad at network
    access and even worse for making stand alone tools to run without Emacs.

    I was introduced to Lisp last December and was coming from Racket. I
    had not looked back. Lisp seems so much easier and more fun to use.

    Similarly for Scheme. My experiences with Debian and Ubuntu told me
    long ago that very similar, but not identical is a bigger problem than
    big differences, e.g. using two more distant Unix relatives side by
    side.

    I believe that might be true.



    |\/| _ _ _ _ _ | | |
    | |(_)(_)(_)| | | . . .

    I'm hallucinating and still see Patricia here...

    ;-)

    LOL! That was not a lie---but I changed my mind and killed all groups
    and left this one. What was annoying me was that I had subscribed to a
    lot of groups and they're all quiet, so I wanted to just go away. But
    I'll keep this one just to chat with you.

    I've no aversion against Lisp, just Emacs-Lisp makes the most sense for
    me now. I'm still in Lisp and Scheme preschool, but it is fun to see
    how useful even a few lines are.

    Dude, you gotta use a Lisp that doesn't require you to run emacs to
    compute it. I wonder why the EMACS people didn't release an interpreter
    or compiler outside of the GNU EMACS. I think that would be healthy to
    the GNU EMACS community.

    E.g. in that experiment where I collect code snippets that all shall
    produce the same output and suppress the output unless it does not match
    the expected results.

    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.org> \\ <http://yeti.freeshell.org/brain/unsorted.d/compare-results.html>

    Hey, you're interested in numbers. Cool. I just proved the fundamental theorem of arithmetic (after proving Euclid's Lemma).

    I'll need many more of such small helpers and that is the reason why
    Elisp makes the most sense for me. Maybe when I start to dream in Lisp
    I may dare to touch a 2nd dialect.

    Lisp is great and it's not too far away from Elisp. (I loved it.)
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Tue Apr 23 03:31:40 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:


    |\/| _ _ _ _ _ | | |
    | |(_)(_)(_)| | | . . .

    I'm hallucinating and still see Patricia here...

    ;-)

    LOL! That was not a lie---but I changed my mind and killed all groups
    and left this one. What was annoying me was that I had subscribed to a
    lot of groups and they're all quiet, so I wanted to just go away. But
    I'll keep this one just to chat with you.

    Oh ... nice ... but being one of many here would even be nicer.

    Dude, you gotta use a Lisp that doesn't require you to run emacs to
    compute it. I wonder why the EMACS people didn't release an interpreter
    or compiler outside of the GNU EMACS. I think that would be healthy to
    the GNU EMACS community.

    Emacs can be started as s script interpreter without staring all the UI
    parts, but that doesn't change it's capabilities and I'd perfer a
    "smaller" Lisp that compiles to C and/or has a good FFI. Systems that
    ignore that layer feel like a wart on a Unix. I see Elisp only in the
    context of extending Emacs and especially nice helpers in Org/Babel. So
    I'll give other Lisps the next chance when I'm confident that they will
    not confuse me when using Elisp in Org/Babel.

    ...aaaaand there is the Lisp used in Sawfish (Rep) which claims to be
    like Elisp. I never used it outside of Sawfish, but configuring that WM
    via Lisp was not a big problem even after not having touched Lisp for
    decades. I played with Sawfish round about the Debian6-to-7 upgrade
    era.

    <http://sawfish.tuxfamily.org/> <http://sawfish.tuxfamily.org/librep.html/index.html>

    E.g. in that experiment where I collect code snippets that all shall
    produce the same output and suppress the output unless it does not match
    the expected results.

    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.org> \\
    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.html>

    Hey, you're interested in numbers. Cool. I just proved the fundamental theorem of arithmetic (after proving Euclid's Lemma).

    -----------------------------------------------------------------------
    3. Hitchhiker 1: (6) He stood up straight and looked the world squarely
    in the fields and hills. To add weight to his words he stuck the rabbit
    bone in his hair. He spread his arms out wide. (7) "I will go mad!" he announced. -----------------------------------------------------------------------

    Primes drive me mad. In a positive way.

    I had an overdose of university maths and forgot most of it. I still occasionally like to do weird things with and without maths. Sometimes
    it is just comparing code snippets in multiple languages like an own
    little Rosetta Code, sometimes numbers or maths are more in the
    spotlight than the languages.

    Short form: I loved maths until the university destroyed that and now
    I only play a bit with it.

    The last fun I hat was "transposing" a prime number algorithm I made
    years ago by "pulling the sieve of Eratosthenes through a Klein's
    bottle" to using unary numbers in plain SH. If run open ended normally
    the original sieve would need to nest infinite loops, and I just
    reordered that to a more sequential way. That needs storage and
    original SH lacks arrays, but you can fake them by constructing variable
    names like S$SOMENUMBER. Combined with an unary number representation
    that then was kind of funny.

    Best Klein's bottle clip:

    <https://www.youtube.com/watch?v=cdLXvJ8wFY4>

    So basically I translated this Python2 snippet to SH without BASH or ZSH blingbling:

    ------------------------------------------------------------------------ #!/usr/bin/env python
    #
    # floating (sliding?) sieve of eratosthenes prime number generator #==================================================================
    #
    # 2011-09-12, yeti
    #

    L = {}
    n = 2

    while 1:

    if n in L:
    P = L[n]
    del L[n] # optional - saves some memory.
    else:
    P = n
    print n

    m = n+P
    while m in L:
    m += P
    L[m] = P

    n += 1
    ----------------------------------------------------------

    This way all action happens at a hotspot of the number line plus
    maximally a distance in which the already known primes jump around like
    frogs on a one dimensional playing field and they jump by the distance
    of their own value. Or boring: Just another serialisation of the
    original sieve. Getting it done in SH was the hurdle because I never
    used SH's eval function before. Somehow KSH, BASH and other shells had
    all the blingbling that made fighting with eval unnecessary, lile
    ${!name} for indirect references.

    And than unary did bite me again, I turned the 1st mess I used in the
    primes example into some functions, added whole numbers as pairs of
    credit and debit (C.D) to avoid an explicit zero and then fractions as
    pairs of a whole number as numerator N and a natural number as scale S
    (wanted to avoid denumerator as name because I already used D for debit)
    N:S = C.D:S.

    Guess what... I added enough functions to theoretically calculate a
    Mandelbrot set in unary fractions, but it turned out that the size of
    the unary number's representations would blow up every swap size I can
    provide.

    Ok. Hit shappens! But it was worth it.

    Looking at the whole numbers C.D and the operation to reduce them to a representation where the bigger part is reduced by the amount of the
    other one (subtract the "greatest common subtractor") that was so
    similar to trimming down quotients by dividing away the GCD, that I
    smiled for days over that analogy.

    That alone was worth it and compensated well for not getting a purely
    unary calculated Mandelbrot set image.

    Lisp is great and it's not too far away from Elisp. (I loved it.)

    Maybe I'll get there later.
    --
    I'm nonbinary, I use Lisp and Scheme. -- 20240301/yeti
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Tue Apr 23 04:01:38 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:


    |\/| _ _ _ _ _ | | |
    | |(_)(_)(_)| | | . . .

    I'm hallucinating and still see Patricia here...

    ;-)

    LOL! That was not a lie---but I changed my mind and killed all groups
    and left this one. What was annoying me was that I had subscribed to a
    lot of groups and they're all quiet, so I wanted to just go away. But
    I'll keep this one just to chat with you.

    Oh ... nice ... but being one of many here would even be nicer.

    Dude, you gotta use a Lisp that doesn't require you to run emacs to
    compute it. I wonder why the EMACS people didn't release an interpreter
    or compiler outside of the GNU EMACS. I think that would be healthy to
    the GNU EMACS community.

    Emacs can be started as s script interpreter without staring all the UI
    parts, but that doesn't change it's capabilities and I'd perfer a
    "smaller" Lisp that compiles to C and/or has a good FFI. Systems that
    ignore that layer feel like a wart on a Unix. I see Elisp only in the
    context of extending Emacs and especially nice helpers in Org/Babel. So
    I'll give other Lisps the next chance when I'm confident that they will
    not confuse me when using Elisp in Org/Babel.

    ...aaaaand there is the Lisp used in Sawfish (Rep) which claims to be
    like Elisp. I never used it outside of Sawfish, but configuring that WM
    via Lisp was not a big problem even after not having touched Lisp for
    decades. I played with Sawfish round about the Debian6-to-7 upgrade
    era.

    <http://sawfish.tuxfamily.org/> <http://sawfish.tuxfamily.org/librep.html/index.html>

    E.g. in that experiment where I collect code snippets that all shall
    produce the same output and suppress the output unless it does not match
    the expected results.

    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.org> \\
    <http://yeti.freeshell.org/brain/unsorted.d/compare-results.html>

    Hey, you're interested in numbers. Cool. I just proved the fundamental theorem of arithmetic (after proving Euclid's Lemma).

    -----------------------------------------------------------------------
    3. Hitchhiker 1: (6) He stood up straight and looked the world squarely
    in the fields and hills. To add weight to his words he stuck the rabbit
    bone in his hair. He spread his arms out wide. (7) "I will go mad!" he announced. -----------------------------------------------------------------------

    Primes drive me mad. In a positive way.

    I had an overdose of university maths and forgot most of it. I still occasionally like to do weird things with and without maths. Sometimes
    it is just comparing code snippets in multiple languages like an own
    little Rosetta Code, sometimes numbers or maths are more in the
    spotlight than the languages.

    Short form: I loved maths until the university destroyed that and now
    I only play a bit with it.

    The last fun I hat was "transposing" a prime number algorithm I made
    years ago by "pulling the sieve of Eratosthenes through a Klein's
    bottle" to using unary numbers in plain SH. If run open ended normally
    the original sieve would need to nest infinite loops, and I just
    reordered that to a more sequential way. That needs storage and
    original SH lacks arrays, but you can fake them by constructing variable
    names like S$SOMENUMBER. Combined with an unary number representation
    that then was kind of funny.

    Best Klein's bottle clip:

    <https://www.youtube.com/watch?v=cdLXvJ8wFY4>

    So basically I translated this Python2 snippet to SH without BASH or ZSH blingbling:

    ------------------------------------------------------------------------ #!/usr/bin/env python
    #
    # floating (sliding?) sieve of eratosthenes prime number generator #==================================================================
    #
    # 2011-09-12, yeti
    #

    L = {}
    n = 2

    while 1:

    if n in L:
    P = L[n]
    del L[n] # optional - saves some memory.
    else:
    P = n
    print n

    m = n+P
    while m in L:
    m += P
    L[m] = P

    n += 1
    ----------------------------------------------------------

    This way all action happens at a hotspot of the number line plus
    maximally a distance in which the already known primes jump around like
    frogs on a one dimensional playing field and they jump by the distance
    of their own value. Or boring: Just another serialisation of the
    original sieve. Getting it done in SH was the hurdle because I never
    used SH's eval function before. Somehow KSH, BASH and other shells had
    all the blingbling that made fighting with eval unnecessary, lile
    ${!name} for indirect references.

    And than unary did bite me again, I turned the 1st mess I used in the
    primes example into some functions, added whole numbers as pairs of
    credit and debit (C.D) to avoid an explicit sign and then fractions as
    pairs of a whole number as numerator N and a natural number as scale S
    (wanted to avoid denumerator as name because I already used D for debit)
    N:S = C.D:S.

    Guess what... I added enough functions to theoretically calculate a
    Mandelbrot set in unary fractions, but it turned out that the size of
    the unary number's representations would blow up every swap size I can
    provide.

    Ok. Hit shappens! But it was worth it.

    Looking at the whole numbers C.D and the operation to reduce them to a representation where the bigger part is reduced by the amount of the
    other one (subtract the "greatest common subtractor") that was so
    similar to trimming down quotients by dividing away the GCD, that I
    smiled for days over that analogy.

    That alone was worth it and compensated well for not getting a purely
    unary calculated Mandelbrot set image.

    Lisp is great and it's not too far away from Elisp. (I loved it.)

    Maybe I'll get there later.
    --
    I'm nonbinary, I use Lisp and Scheme. -- 20240301/yeti
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From Patricia Ferreira@pferreira@example.com to tilde.institute on Tue Apr 23 08:49:26 2024
    yeti <yeti@tilde.institute> writes:

    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:


    |\/| _ _ _ _ _ | | |
    | |(_)(_)(_)| | | . . .

    I'm hallucinating and still see Patricia here...

    ;-)

    LOL! That was not a lie---but I changed my mind and killed all groups
    and left this one. What was annoying me was that I had subscribed to a
    lot of groups and they're all quiet, so I wanted to just go away. But
    I'll keep this one just to chat with you.

    Oh ... nice ... but being one of many here would even be nicer.

    Dude, you gotta use a Lisp that doesn't require you to run emacs to
    compute it. I wonder why the EMACS people didn't release an interpreter
    or compiler outside of the GNU EMACS. I think that would be healthy to
    the GNU EMACS community.

    Emacs can be started as s script interpreter without staring all the UI parts,

    Does it also have a REPL? :-) I know you'll say the GNU EMACS, but I
    don't think the GNU EMACS offers a typical (ELISP) REPL.

    but that doesn't change it's capabilities and I'd perfer a "smaller"
    Lisp that compiles to C and/or has a good FFI.

    Most have FFI, but not all of them to compile to C. I don't know what's
    a good FFI. Lisp has cffi, for example, which seems nice enough.

    ...aaaaand there is the Lisp used in Sawfish (Rep) which claims to be
    like Elisp. I never used it outside of Sawfish, but configuring that WM
    via Lisp was not a big problem even after not having touched Lisp for decades. I played with Sawfish round about the Debian6-to-7 upgrade
    era.

    <http://sawfish.tuxfamily.org/> <http://sawfish.tuxfamily.org/librep.html/index.html>

    Nice! Thanks for sharing.

    Hey, you're interested in numbers. Cool. I just proved the fundamental
    theorem of arithmetic (after proving Euclid's Lemma).

    -----------------------------------------------------------------------
    3. Hitchhiker 1: (6) He stood up straight and looked the world squarely
    in the fields and hills. To add weight to his words he stuck the rabbit
    bone in his hair. He spread his arms out wide. (7) "I will go mad!" he announced. -----------------------------------------------------------------------

    Primes drive me mad. In a positive way.

    I had an overdose of university maths and forgot most of it. I still occasionally like to do weird things with and without maths. Sometimes
    it is just comparing code snippets in multiple languages like an own
    little Rosetta Code, sometimes numbers or maths are more in the
    spotlight than the languages.

    Short form: I loved maths until the university destroyed that and now
    I only play a bit with it.

    That's sad. What major you were in? At the university I realized my
    education wasn't good but I had a solid understanding of computers and I
    asked why did that happen---the answer was ``school never taught me
    anything about computers''. What did I do then? I just stopped paying attention to classes and designed my own curriculum. (And I decided not
    to major in computer science because that would have killed my passion
    for the subject.) Grades went down to a minimum, but I graduated
    satisfied and have been harvesting the profits ever since.

    It's a fraud. A university is there to certify you, not to help you in
    any meaningful way. Surely you can find people to teach and learn with,
    but that's not the university---that's the people.

    The last fun I hat was "transposing" a prime number algorithm I made
    years ago by "pulling the sieve of Eratosthenes through a Klein's
    bottle" to using unary numbers in plain SH.

    Sounds incomprehensible. :)
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Tue Apr 23 15:27:19 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:

    Emacs can be started as s script interpreter without staring all the UI
    parts,

    Does it also have a REPL? :-) I know you'll say the GNU EMACS, but I
    don't think the GNU EMACS offers a typical (ELISP) REPL.

    I've not yet seen an Elisp REPL outside of Emacs, but it might exist.
    Inside Emacs I prefer Eshell as REPL over e.g. the scratch buffer others
    seem to like more. Eshell mimicks a Unix shell but is split brained
    allowing Lisp and shell like notation. Some typical commands (grep,
    less, ls, ...) are rebuilt via Lisp functions, external commands can be
    called like in other shells. Overlaid commands like ls can be accesse
    by prefixing them with * and ib most cases I prefer the external
    originals even in Eshell.

    ...

    Short form: I loved maths until the university destroyed that and now
    I only play a bit with it.

    That's sad. What major you were in?

    I started with Maths plus IT as secondary topic, but when that took too
    long because I lost all the fun and working with computers in an
    institute was nicer than the fight with the university, I switched them,
    so IT got my main subject. It already was my hobby and when I started
    with Maths there it only could be secondary subject, but when I was fed
    up with Maths, IT was promoted to be possible as main subject too.

    At the university I realized my education wasn't good but I had a
    solid understanding of computers and I asked why did that happen---the
    answer was ``school never taught me anything about computers''. What
    did I do then?

    I scared my maths teachers at school and they were happy when I just
    wrote programs instead of disturbing them with questions they couldn't
    answer.

    At the university there were several threads of maths courses/topics in parallel and we used stuff in some of them we hadn't introduced and so
    were not allowed to use in others some hours earlier or later. That
    tohubohu was absolutely demotivating. Additionally one could fail in
    courses just for not remembering names despite deducing and applying all formulae and logic correctly. I hadn't planned to learn history, I had expected to learn and practice Maths and there the formulae are the
    condensed truths.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Tue Apr 23 15:28:34 2024
    Patricia Ferreira <pferreira@example.com> writes:

    yeti <yeti@tilde.institute> writes:

    Emacs can be started as s script interpreter without staring all the UI
    parts,

    Does it also have a REPL? :-) I know you'll say the GNU EMACS, but I
    don't think the GNU EMACS offers a typical (ELISP) REPL.

    I've not yet seen an Elisp REPL outside of Emacs, but it might exist.
    Inside Emacs I prefer Eshell as REPL over e.g. the scratch buffer others
    seem to like more. Eshell mimicks a Unix shell but is split brained
    allowing Lisp and shell like notation. Some typical commands (grep,
    less, ls, ...) are rebuilt via Lisp functions, external commands can be
    called like in other shells. Overlaid commands like ls can be accessed
    by prefixing them with * and in most cases I prefer the external
    originals even in Eshell.

    ...

    Short form: I loved maths until the university destroyed that and now
    I only play a bit with it.

    That's sad. What major you were in?

    I started with Maths plus IT as secondary topic, but when that took too
    long because I lost all the fun and working with computers in an
    institute was nicer than the fight with the university, I switched them,
    so IT got my main subject. It already was my hobby and when I started
    with Maths there it only could be secondary subject, but when I was fed
    up with Maths, IT was promoted to be possible as main subject too.

    At the university I realized my education wasn't good but I had a
    solid understanding of computers and I asked why did that happen---the
    answer was ``school never taught me anything about computers''. What
    did I do then?

    I scared my maths teachers at school and they were happy when I just
    wrote programs instead of disturbing them with questions they couldn't
    answer.

    At the university there were several threads of maths courses/topics in parallel and we used stuff in some of them we hadn't introduced and so
    were not allowed to use in others some hours earlier or later. That
    tohubohu was absolutely demotivating. Additionally one could fail in
    courses just for not remembering names despite deducing and applying all formulae and logic correctly. I hadn't planned to learn history, I had expected to learn and practice Maths and there the formulae are the
    condensed truths.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.19b-Linux NewsLink 1.113
  • From yeti@yeti@tilde.institute to tilde.institute on Fri Apr 26 15:27:13 2024
    And another mystery was quickly answered[0] within minutes and I could
    not even have been faster if I had not asked the ML first. Well, at
    least they aren't yelling at me for this order of interaction.

    This time it really looked strange. Code worked in the interpreter, but
    not in compiled form, depending on having an `(import ...)` line or not.

    Executable does NOTHING, when importing srfi-module (but code works
    in REPL) #872 \\
    https://github.com/gambit/gambit/issues/872

    I declare not looking up the issues first as mild form of PEBCAK. Ok?
    But with new stuff and not feeling at home in their terminology and
    jargon often does not make finding stuff easier. So I ask for applying extenuating circumstances.

    ____________

    [0]: The previous one got explained, so at least I can drop the PEBCAK
    hypothesis, but still needs an implementation in a post build
    Gambit time way.
    --
    3. Hitchhiker 10: (81) The Hitch Hiker's Guide to the Galaxy has this to
    say on the subject of flying. (82) There is an art, it says, or rather
    a knack to flying. (83) The knack lies in learning how to throw
    yourself at the ground and miss.
    --- Synchronet 3.19b-Linux NewsLink 1.113