4 ms·
> Tcl/Tk is one of the cooler tools out there, though I wish it were not so... string-based. Tcl was designed in a different time when memory was scarce. The
by bsder 7y ago
> Tcl/Tk is one of the cooler tools out there, though I wish it were not so... string-based.
Tcl was designed in a different time when memory was scarce.
The point of being so "stringy" is that you could parse it in place in the same amount of RAM as the original "string program" took up.
I really would love something with similar constraints as the old Tcl for microcontrollers. BASIC used to run in 4K RAM with 4K ROM--I really wish we had a modern equivalent that I could connect to with a UART.
Quite often my constraint on a microcontroller is waking up and waiting for a sensor, transmitter, etc. -- I have forever to run interpreted code. A small language would be really nice.
- icebraining 7y agoNot quite 4k, but MicroPython runs on 16K of RAM.
- bsder 7y agoAs I understand it, that's a very cut back version and doesn't include the compiler/interpreter so you can't just hook up to a UART and start reprogramming. I could be wrong, so please feel free to correct my statement if it's completely off the wall. What I want is something that I can hook up to the UART serial port, and start typing interactive commands into it to debug why my system is hung/stuck/etc. It needs to live in about 4K of RAM (and I can trade quite a bit of flash to do that). 16K of RAM is too much. Something like a Nordic nRF52811 only has 24K of RAM, and a lot of that gets used for the Bluetooth stack.
- kbr2000 7y agoSounds like you might want to explore Forth a bit. Punyforth on the ESP8266 is a convenient way to try get started hands-on, Jonesforth if you want to learn how you could go about implementing one. On bigger devices (PC/SBC/...) with an OS, Tcl/Tk is a wonderfully effective programming tool!
- kbr2000 7y ago...While checking the nRF52811 product specification to learn more about this chip, I found out that it contains a Cortex M4 CPU. You can research some of the existing Forths for these processors (myself I find a tethered Forth convenient to work on CPUs like this).
- johnbuckman 7y agoIronically, because Tcl was made to run GUIs on very limited hardware (old Unix machines, 30 years ago) it runs really nicely on slow Android tablets. Its focus on asynchronous programming, rather than relying on threads, really helps, as does the small memory footprint (105mb of RAM used for my app). Java-based apps on the same tablet that I supply with the espresso machine run at a crawl, whereas my Tcl app feels normal.
- pjmlp 7y agoIt doesn't help that Google did a pretty lousy job with Dalvik. If those tablets were running something like Aicas Java runtime, it would be much different.
- johnbuckman 7y ago"Androwish", which is Tcl/Tk ported to Android, runs mostly on the C layer sitting on top of Linux. As such, it's way more "performant" than Java.
- _ph_ 7y agoYes, my experience also always was, that while the pure Tcl code performance isn't great, most Tcl programs perform very well, due to the low resource consumption and overhead.
- deleted 7y ago[deleted]