TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Picol, a Tcl interpreter in 550 lines of C code

111 pointsby woooshover 2 years ago

5 comments

goddstreamover 2 years ago
The Picol code has always been a fascinating read, until you get to the comment /* XXX: escape handling missing! */ and realise it won't escape/eval stuff inside strings, so you think ha! and roll up your sleeves and get tapping ... then you think ha! I could just improve that bit of code, and ... before you know it the sun's coming up and you didn't feed the dog last night. Speaking for a friend, obviously.
评论 #33965634 未加载
评论 #33965726 未加载
评论 #33967161 未加载
评论 #33972672 未加载
unwindover 2 years ago
Meta: this really needs a (2007) or something, to signify that it pre-dates Antirez creating Redis and stuff.<p>I had time to think &quot;wow, I also want to create some world-famous infrastructure software, rock that world for a bunch of years, then (semi?)retire and blog about 3-hour C projects!!&quot;. :) It&#x27;s always very interesting (to me) to see what people end up doing after a great success, so I thought this was it.<p>Then I read the early comments, understood that it was from <i>before</i> Redis, and went back to check. The only post date I could find was in the (Italian) tiny footer where it says &quot;Pagina creata il Thursday, 15 March 07&quot;.<p>Edit: changed the suggested year to be only 2007.
评论 #34081459 未加载
082349872349872over 2 years ago
&gt; <i>Probably the parser should be rewritten in order to take less space, currently it takes almost 250 lines of code: this is too much and leaves little room for all the rest.</i><p>Wirth&#x27;s PL&#x2F;0 is also pretty much half parser, and I&#x27;ve noticed the same phenomenon in a couple of my projects.<p>I believe this is why we had no-grammar languages in the early days (LISP, APL, FORTH) — if the rest of the language is small enough, parsing looks like bloat.
blippageover 2 years ago
I&#x27;ve used Picol a couple of times in some of my microcontroller projects as a command language. Its advantage is that it is easy to compile and link to without a lot of rigmarole.
sea6earover 2 years ago
I did a stupidly straight translation of Picol into Python about a year ago [0].<p>I&#x27;m daydreaming about doing another translation of it into Racket, but I don&#x27;t think I&#x27;ll have free time until January or February.<p>It would also be interesting to see about doing a version of it in Lisp Flavored Erlang.<p>Similar to some others in the comments, I may have just nerd sniped myself (again).<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;connorberry&#x2F;PicolPython" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;connorberry&#x2F;PicolPython</a>