Picol, a Tcl interpreter in 550 lines of C code
oldblog.antirez.com
Picol, a Tcl interpreter in 550 lines of C code
1–10 of 15 posts
Re: Picol, a Tcl interpreter in 550 lines of C code
#2Re: Picol, a Tcl interpreter in 550 lines of C code
#3Re: Picol, a Tcl interpreter in 550 lines of C code
#4The 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.
Libraries written for Jim Tcl became the foundation of Redis.
Re: Picol, a Tcl interpreter in 550 lines of C code
#5The 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.
The next thing you know your tiny code has tripled in size and now spews so much gark that you have to go optimize your garbage collector and ...
Re: Picol, a Tcl interpreter in 550 lines of C code
#6The 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 happened to me as well, and that was the result: https://github.com/msteveb/jimtcl Libraries written for Jim Tcl became the foundation of Redis.
Re: Picol, a Tcl interpreter in 550 lines of C code
#7Wirth's PL/0 is also pretty much half parser, and I've noticed the same phenomenon in a couple of my projects.
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.
Re: Picol, a Tcl interpreter in 550 lines of C code
#8I 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 I read the early comments, understood that it was from before Redis, and went back to check. The only post date I could find was in the (Italian) tiny footer where it says "Pagina creata il Thursday, 15 March 07".
Edit: changed the suggested year to be only 2007.
Re: Picol, a Tcl interpreter in 550 lines of C code
#9Re: Picol, a Tcl interpreter in 550 lines of C code
#10Earlier quoted context omitted.
It happened to me as well, and that was the result: https://github.com/msteveb/jimtcl Libraries written for Jim Tcl became the foundation of Redis.
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…