from Hacker News

Partcl – a tiny command language

by vmorgulis on 2/7/17, 8:48 PM with 19 comments

  • by boznz on 2/7/17, 10:02 PM

    I don't know TCL at all though I have implemented my own variation of tiny C in a handheld terminal I designed in the past which fitted nicely in 10KB in a PIC18F processor and 3K of RAM for the (compressed) basic so always good to see a different spin on other interpreters.

    Your code doesn't actually compile in my MPLAB XC8 compiler but should be fixable so I may give it a go. I note there are no comments in the code but the explanation text should help.

  • by david-given on 2/7/17, 9:34 PM

    See also TH1, which is the Tcl subset which Fossil uses for HTML templating:

    http://fossil.wanderinghorse.net/repos/th1-sgb/index.cgi/wik...

    It's about 6kloc. (I don't know how it compares to Picocl feature-wise.)

  • by davidw on 2/7/17, 10:11 PM

    I made my own tiny Tcl thing a while back:

    https://github.com/davidw/hecl

    It ran on those Nokia phones that had a minimal version of Java (no floats!), which was kind of cool back in the day.

  • by ethanpil on 2/7/17, 10:08 PM

    TCL is an interesting idea. I have been a fan of MicroPython (https://micropython.org/) for a while. It's probably not as tight or efficient as Partcl but I think it may be a good contender for a comparison in your original article.
  • by __michaelg on 2/11/17, 12:07 PM

    Nice project!

    Unfortunately, as with most interpreters written in C, afl finds segfaulting bugs in a few seconds. In your case at least empty variable substitutions are broken. E.g., entering

      $ foo
    
    will crash.
  • by gravypod on 2/7/17, 10:12 PM

    I don't see why one would choose TCL over LISP-likes which can be made equally as efficient and are very simple to implement and optimize.