logoalt Hacker News

Picol: A Tcl interpreter in 500 lines of code

118 pointsby toshtoday at 8:04 AM62 commentsview on HN

Comments

analog31today at 1:52 PM

Quite a few years ago, I was looking for a way to program microcontrollers via an onboard interpreted language, and happened on the picol code. I still have my version somewhere. It was delightfully straightforward and easy for an amateur to modify. So I first got it to compile on a Teensy, then added a REPL, floating point, and a few functions to do things like flip the GPIO bits and read the ADC.

Today of course there are things like CircuitPython, and I enjoy using it too, but it's such a beast that it's really impenetrable for someone at my skill level if I want to add low level functions.

show 1 reply
stevekemptoday at 9:54 AM

Sadly it seems the blog post that was released in the past is no longer available, but the wayback machine has a copy

https://web.archive.org/web/20220303135439/https://oldblog.a...

That provides background about the constraints/limitations in this code.

show 1 reply
seyztoday at 11:48 AM

Classic antirez. Does more in 500 LOC than most frameworks in 50k.

show 1 reply
iberatortoday at 9:20 AM

best thing about TCL is easy syntax and that everything is a string :) Unique and simple and easy language with very slow changes.

Something like Python in good old days of 2.x before young internet javasceipt devs started pouring A LOT of new features to the language (feature creep).

Nowadays Python is so complex and flooded with ex C, C++, Java, JavaScript, Haskell programmers adding so many features, so fast that it's impossible to follow and understand them :(

Languages should not evolve on that rate. No time to master it :(

/rant

show 6 replies
JSR_FDEDtoday at 8:31 AM

I remember we had users at a chip foundry who were super deep into TCL. Is it still used anywhere else? Would you use it for a new project if you for instance already knew Python or Lua?

show 11 replies
Western0today at 5:26 PM

Nice idea.

picol is ideal for writing other language, for example esotheric language

anthktoday at 8:14 AM

JimTCL has more features and it's almost as small.

show 1 reply