Show HN: Feather – a fresh Tcl reimplementation (WASM, Go)

(feather-lang.dev)

17 points | by dhamidi 5 days ago

3 comments

  • smj-edison 2 days ago
    What, that's super cool! I've also been working on a from scratch implementation of TCL for firstclass multithreading, and it's been really fun learning all the edgecases that show up. I've gotten a lot of the core components working, but man is reference counting a pain in the neck or what. Are you doing a mostly one-to-one port, or something more novel? I've been working on my design to dramatically lower double indirections for lists. It's a little sad that a list contains a list of pointers pointing to another list. So much indirection! So I'm trying an experiment where all non-list/non-dict objects are contained directly after the head dict object in memory. It took a crash course in buddy allocators to finally figure out how to store objects, but it's really cool how I can allocate 8 contigious objects, set the first to the dict metadata, and all other items are the dict's objects. One cooler thing is if one of the dict's items is still borrowed somehere (ref_count > 1), the dictionary will dissolve into individual allocations, and all non-shared items are freed. Then, the new dict will reference them, as they're now normal objects.
  • trebligdivad 32 minutes ago
    Ooh, it's got to be about 30 years since the Tcl plugin for Netscape; so perhaps we can have it back in the browser via WASM.
  • cmacleod4 2 days ago
    Very interesting!

    Note that the name might be confused with an old project: https://wiki.tcl-lang.org/page/Feather .