Live data from Hacker News

Picol, a Tcl interpreter in 550 lines of C code

oldblog.antirez.com

11–15 of 15 posts

Re: Picol, a Tcl interpreter in 550 lines of C code

#11
post #10

Earlier quoted context omitted.

But it’s so simple. All I have to do is divine from what I know of you. Are you the sort of man who would put the nerd snipe source code into his own repo, or his enemy’s? Now, a clever man would put the source into his own repo, because he would know that only a great fool would reach for what he was given. I’m not a great fool, so I can clearly not choose the source in your repo. But you must have known I was not a…

Is my knowledge of English lacking? Am I missing context perhaps? Is this a machine generated comment?

It's a parody comment based on the poison goblet scene from the movie "The Princess Bride."

https://www.youtube.com/watch?v=rMz7JBRbmNo

Re: Picol, a Tcl interpreter in 550 lines of C code

#12
I did a stupidly straight translation of Picol into Python about a year ago [0].

I'm daydreaming about doing another translation of it into Racket, but I don't think I'll have free time until January or February.

It would also be interesting to see about doing a version of it in Lisp Flavored Erlang.

Similar to some others in the comments, I may have just nerd sniped myself (again).

[0] https://github.com/connorberry/PicolPython

Re: Picol, a Tcl interpreter in 550 lines of C code

#13

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.

Huh! Falling into exactly this trap, I ended up writing a tiny Tcl interpreter for the embedded systems years ago: https://zserge.com/posts/tcl-interpreter/

Re: Picol, a Tcl interpreter in 550 lines of C code

#14

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.

It also doesn't do well with strings that have a null character in it. Which would stop basic stuff like being able to copy/read arbitrary files. So, neat, but not practical outside a narrow subset of problems.

Re: Picol, a Tcl interpreter in 550 lines of C code

#15
post #8

Meta: this really needs a (2007) or something, to signify that it pre-dates Antirez creating Redis and stuff. I had time to think "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!!". :) It's always very interesting (to me) to see what people end up doing after a great success, so I thought this was it. Then…

Yes, indeed! I can confirm this post is from 2007.
Post reply on HN