"Concatenative programming and stack-based languages" by Douglas Creager

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 11

  • @blaiseutube
    @blaiseutube Год назад +10

    I took a class with Alan Perlis when I was in college.
    Yes, I did have a slight idea of how lucky I was.

  • @sjmaddox
    @sjmaddox Год назад +5

    Great talk! Very clear exposition. And thanks for the reference 🙂

  • @IZEASGT
    @IZEASGT День назад

    The Python example from around 4:00 on feels a little contrived to me. I’ve done some professional work in Python, and I think I’d write it more as something like this:
    from math import sqrt
    def nd_pythagoras(*args): return sqrt(sum(x*x for x in args))
    Or if you don’t want to do the fancy n-dimensional generalization:
    def pythagoras(a, b): return sqrt(a*a + b*b)
    Which doesn’t require much more name-binding than the likes of “: pythagoras dup * swap dup * + sqrt ;”.
    I’ll keep watching. Stack-based languages interest me, and while I doubt even Chuck Moore could implement Tears of the Kingdom in Forth, the way something like PlanckForth can be bootstrapped from a tiny core is fascinating. I’ve dabbled in designing a postfix-based language of my own (under the premise of “What would the C equivalent look like in a world where programming languages were mostly developed by speakers of an SOV language?”), but it did seem like there was a lot that could be expressed more clearly and succinctly with explicit value names.

  • @JohannesRiecken
    @JohannesRiecken Год назад +4

    Why isn’t “swap” called “dig” for consistency with “dig2”? Very enjoyable to see how stack languages relate to other compiler theory concepts!

    • @DevineLuLinvega
      @DevineLuLinvega Год назад +5

      In the joy docs, it says `Note that "dig1" is the same as "swap". ` It looks like it wanted to have a word that was symmetric to buryn/dign.

  • @teeesen
    @teeesen Год назад +2

    This is bringing back a lot of memories. Back in the early 90s I made a semantics for machine code that had the same sort of [| p q |] = [| p |] o [| q |] distributivity relationship between semantics, concatenation, and composition, allowing you to break a machine code program at any point and get the same meaning. But, I’m wondering whether the language in the talk actually has this property. Since “[“ and “]” aren’t given meaning on their own, it seems that you only get the distributivity property if “[“ and “]” are replaced using quote and compose.

  • @23bcx
    @23bcx 7 месяцев назад

    Wouldn't make more sense for dig to be an operation that pops the top of the stack and digs that far?

  • @BartoszGolda
    @BartoszGolda Год назад +3

    Very nice, even if one would not get 100% - still, it's helpful. Examples in one of Forth standards could be more universal though - if it's doable at all (cons?)..

    • @DevineLuLinvega
      @DevineLuLinvega Год назад +2

      Forth is not based on lambda calculus tho, it'd be trickier, you'd have to have to build library words that are non standard, joy and factor have those built into the standard implementations.

  • @TaranovskiAlex
    @TaranovskiAlex Год назад

    Nice talk, thank you!

  • @docteurklein
    @docteurklein Год назад

    great talk!