News for hackers. Stuff that matters.
Re:Espresso Machine Powered by Tcl/Tk by bsder on Wednesday July 31, 2019 @03:27AM (#20572327)
> 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.

Re:Espresso Machine Powered by Tcl/Tk by johnbuckman on Wednesday July 31, 2019 @06:23AM (#20573054)
Ironically, 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.

Re:Espresso Machine Powered by Tcl/Tk by _ph_ on Wednesday July 31, 2019 @09:36AM (#20574304)
Yes, 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.
Re:Espresso Machine Powered by Tcl/Tk by pjmlp on Wednesday July 31, 2019 @06:43AM (#20573152)
It 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.

Re:Espresso Machine Powered by Tcl/Tk by johnbuckman on Wednesday July 31, 2019 @07:51AM (#20573549)
"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.
Re:Espresso Machine Powered by Tcl/Tk by icebraining on Wednesday July 31, 2019 @06:12AM (#20573002)
Not quite 4k, but MicroPython runs on 16K of RAM.
Re:Espresso Machine Powered by Tcl/Tk by bsder on Wednesday July 31, 2019 @02:57PM (#20577145)
As 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.

Re:Espresso Machine Powered by Tcl/Tk by kbr2000 on Tuesday August 13, 2019 @12:42PM (#20687499)
Sounds 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!

Re:Espresso Machine Powered by Tcl/Tk by kbr2000 on Thursday August 15, 2019 @04:01PM (#20709059)
...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).