• sed... (Was: a sed question)

    From Kenny McCormack@21:1/5 to 643-408-1753@kylheku.com on Sat Dec 21 03:36:11 2024
    In article <20241220184059.820@kylheku.com>,
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    ...

    Sed is one of the so-called "esolangs" which some people use for puzzling. >For instance, here is a kind of Lisp interpreter written in Sed:

    https://github.com/shinh/sedlisp/blob/master/sedlisp.sed

    The goal of writing in sed is not to solve the problem, and to communicate with
    future users of the program so that they can adapt it to changing needs; the >goal is to puzzle out what it takes to solve it in Sed, and to show: "Hey, >look, I did this in Sed! Isn't it amazing? (And, by extension, aren't I?)"

    Exactly. Well said and well put.

    (rest clipped, but should be required reading for everyone)

    --
    He continues to assert that 2 plus 2 equals 4, despite being repeatedly
    told otherwise.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kenny McCormack on Sat Dec 21 03:57:20 2024
    On 2024-12-21, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <20241220184059.820@kylheku.com>,
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    ...

    Sed is one of the so-called "esolangs" which some people use for puzzling. >>For instance, here is a kind of Lisp interpreter written in Sed:

    https://github.com/shinh/sedlisp/blob/master/sedlisp.sed

    The goal of writing in sed is not to solve the problem, and to communicate with
    future users of the program so that they can adapt it to changing needs; the >>goal is to puzzle out what it takes to solve it in Sed, and to show: "Hey, >>look, I did this in Sed! Isn't it amazing? (And, by extension, aren't I?)"

    Exactly. Well said and well put.

    (rest clipped, but should be required reading for everyone)

    Sometimes that puzzled out stuff people do in their spare time is really cool!

    This just appeared on HackerNews:

    https://github.com/izabera/pseudo3d

    A raycast first-person maze navigator, written in Bash.

    (The code is pretty small and not particularly cryptic.)

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kaz Kylheku on Sat Dec 21 15:38:22 2024
    On 21.12.2024 04:57, Kaz Kylheku wrote:

    Sometimes that puzzled out stuff people do in their spare time is really cool!

    This just appeared on HackerNews:

    https://github.com/izabera/pseudo3d

    A raycast first-person maze navigator, written in Bash.

    Wasn't there a similar code in Awk mentioned some time ago?

    (The code is pretty small and not particularly cryptic.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Janis Papanagnou on Sat Dec 21 17:29:12 2024
    On 21.12.2024 15:38, Janis Papanagnou wrote:
    On 21.12.2024 04:57, Kaz Kylheku wrote:

    Sometimes that puzzled out stuff people do in their spare time is really cool!

    This just appeared on HackerNews:

    https://github.com/izabera/pseudo3d

    A raycast first-person maze navigator, written in Bash.

    Wasn't there a similar code in Awk mentioned some time ago?

    I found it (fps.awk) on my file system; ~650 LOC - too long to post?
    (I see it uses some GNU Awk features.)
    To support searches for it, it says: #Copyright (c) 2016 Fedor Kalugin

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lars Poulsen@21:1/5 to 643-408-1753@kylheku.com on Sat Dec 21 21:46:24 2024
    In article <20241220184059.820@kylheku.com>,
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    The goal of writing in sed is not to solve the problem, and to
    communicate with
    future users of the program so that they can adapt it to changing needs; the >> goal is to puzzle out what it takes to solve it in Sed, and to show: "Hey, >> look, I did this in Sed! Isn't it amazing? (And, by extension, aren't I?)"

    Just like APL.
    - "can you figure out what this one-line program does?"
    - "can you think of a way to do this in fewer characters?"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lars Poulsen on Sun Dec 22 21:22:18 2024
    On 2024-12-21, Lars Poulsen <lars@cleo.beagle-ears.com> wrote:
    In article <20241220184059.820@kylheku.com>,
    Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    The goal of writing in sed is not to solve the problem, and to
    communicate with
    future users of the program so that they can adapt it to changing needs; the
    goal is to puzzle out what it takes to solve it in Sed, and to show: "Hey, >>> look, I did this in Sed! Isn't it amazing? (And, by extension, aren't I?)"

    Just like APL.
    - "can you figure out what this one-line program does?"
    - "can you think of a way to do this in fewer characters?"

    It's not quite so easy to casually dismiss APL, because if you look past
    the reduction in character syntax, it has a powerful array processing
    paradigm that made it unique at the time of its inception. APL programs
    are actually short in the number of tokens and operations specified, not
    just character count.

    Sed is more like BrainF##### in just making things stupidly harder;
    it's not a notation for something powerful under the hood.

    A sed program won't necessarily be shorter than an Awk one. For instance certainly not if it has to implement integer addition using regexps on
    strings, where the Awk program just does a + b.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)