Login
You're viewing the ruby.social public feed.
  • Nov 17, 2026, 2:40 AM

    I read the original Knuth-Plass paper and the prose in it is excellent, I really understand the concepts. Unfortunately the pseudocode is... not ideal. I ended up adapting someone else's javascript implementation into Odin.

    "The meaning of the ad hoc Algol-like language used here should be self-evident." yes I agree, it should be. Shame it isn't!!

    psuedocode that somewhat resembles Algol. It's full of the keywords "loop" and "begin" and the symbol ":=" and I don't know what any of these actually mean
    💬 4🔄 0⭐ 0

Replies

  • Nov 17, 2026, 5:35 AM

    programming whitepaper writers want you to believe good variable names for "looseness" and "threshold parameter" are `q` and `𝝆`.

    💬 0🔄 0⭐ 0
  • Nov 17, 2026, 2:47 AM

    @clarity

    <compute the adjustment ratio r from a to b>
    <compute demerits d and fitness class c>

    Oh yea, I totally understand that :D.

    (Has no idea wtf he just read...)

    💬 1🔄 0⭐ 0
  • Nov 17, 2026, 3:05 AM

    @cr1901 The bits in `<...>` are elided code that get shown in future code samples. It's probably the clearest part of the whole thing but it gets so drowned in the syntax and ugly algol loops and overly terse variable names that I really just can't track any of it.

    💬 1🔄 0⭐ 0
  • JobvanderZwan@vis.social
    Nov 17, 2026, 6:00 AM

    @clarity @cr1901 Yeah that's the funniest bit with old Algol-like pseudo-code: the structure and control flow of the program is verbose while the variable names are terse. Most people would do it the other way around these days, I guess.

    I guess that shows what people working on this were and weren't familiar with back then.

    💬 0🔄 0⭐ 0
  • Nov 17, 2026, 3:00 AM

    @clarity uhh, at a guess, `:=` is assignment (`=` is compare for equality), `repeat` jumps to the previous matching `loop`, `exit loop` jumps to after the next `repeat`, and `begin` and `end` appear to have no effect

    (i agree that pseudocode leaves something to be desired)

    💬 0🔄 0⭐ 1
  • 💬 1🔄 0⭐ 0
  • Nov 17, 2026, 3:04 AM

    @maia I guess variables have to always be declared as part of a `begin` statement, is the idea?

    💬 0🔄 0⭐ 0
  • olivejovialthunder@xoxo.zone
    Nov 17, 2026, 6:36 AM

    @clarity "end;" with a semicolon is what gets me. Sorry, why do you think the parser of the human eye needs that?

    💬 1🔄 0⭐ 0
  • Nov 17, 2026, 7:14 AM

    @jovialthunder @clarity It's the Algol brain i'm afraid 🙃

    my limited understanding of this is that the "end" is only closing the "begin ... end" block and ";" is closing the current statement. The alternative to a semicolon after the "end" is following it up with an else clause (because if .. then .. else .. is all in a single statement apparently), or a full stop (like on the last line).

    💬 0🔄 0⭐ 0