Anyone here tried mercrisp FORTH for programming ARM Cortex M? i.e. "Blue Pill", nRF5, STM32, etc.?

  • Hero Member

    It runs very close to the bare metal because, despite being REPL interpretive, it includes an optimising compiler that seamlessly generates native code AND runs on the target itself, AND the whole thing runs on as little as 16K flash and 2K RAM. Amazing!

    It also happens to be what the founder of Jeelabs has switched to using instead of C, and we all know that he's a very capable C programmer. I already knew that but had been dismissive about it (after all, FORTH has been around a long time) until I saw this interesting short overview video where a regular guy demonstrates how easily it programs a "blue pill":

    Mecrisp Forth on STM32 Microcontroller (blue pill) – 30:54
    — jephthai

    So, sure, FORTH itself is nothing new, but it's the inclusion of a native code generating optimizing compiler in such small space on the target that suddenly makes this all so attractive. I mean, for instance, you could wirelessly connect to any node you want and debug it and/or modify it in real time if you wanted to.

  • Hero Member

    I have since installed it on a BBC microbit. Installation is a snap: literally one drag and drop.

  • I'd be interested to hear what you think compared to uLisp. The notion of uLisp seems a little strange to me. But then, I never got past thinking of lisp as just fun to play with.

  • Hero Member

    @nagelc I'm working to get the nRF52840 supported by mecrisp-stellaris. If that happens, then it will be faster than uLisp, because then FORTH will automatically compile seamlessly into native machine code rather than running on a VM. Allegedly the performance would then be very close to that of compiled C code. To me that would be like having my cake (interactivity of a REPL) and eating it too (fast execution speed).

Log in to reply

Suggested Topics

  • 4
  • 3
  • 2
  • 9
  • 14
  • 933