• Cassilda@lemmygrad.ml
    link
    fedilink
    arrow-up
    7
    ·
    2 years ago

    Hell, I don’t think there’s a pure-functional runtime that fits into any of the kit I work on, not to mention the runtime plus an actual application. I’m willing to be corrected, though: if there’s a functional language out there that will let me write non-trivial applications that fit in 256KB code space and 48KB dynamic data space, I’m eager to hear about it!

    Depends what you mean by pure-functional. If you mean an ML-family language with lazy evaluation and explicit sequencing of side effects, then probably not. But there are certainly lisps suitable for those constraints. uLisp runs on Arduino Nano microcontrollers with 32 Kbytes of program memory and 2 Kbytes of RAM. lllm is a lispy DSL for writing assembly language.

    • Ephera
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Yeah, probably also worth pointing out that the original LISP came out in 1958.

      A function isn’t complex to portray in memory when you’re passing it to other functions. It’s also just a pointer to where your function’s code lives. @ttmrichter@lemmy.ml

    • ttmrichter
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Lisp is “functional-enabling” not a functional language. Take a look at the Common Lisp library and you’ll see a whole lot of imperative-nature constructs and code in it. Lisp permits (and to a degree supports) functional programming. It does not enforce nor even default to the functional paradigm.

      And even in a Lisp you’re going to start hitting the boundaries of your kit in the embedded world when you do partial application, closures, and even something as seemingly trivial as using immutable state. You’ll wind up fighting the language more often than fighting your problem domain and the result will be counterproductive.

      Best of breed for me in embedded space is Ada (with Modula-3 being another decent choice). Lisp’s not even in the display hall.