5 ms·
Picol, a Tcl interpreter in 550 lines of C
- swah 16y agoThe original reddit discussion: http://www.reddit.com/r/programming/comments/1aefl/picol_a_tcl_interpreter_in_550_lines_of_not_line http://www.reddit.com/r/programming/comments/1aefl/picol_a_t...
- Nate75Sanders 16y agoAh, I was hoping this was going to be about a stored procedure mechanism for Redis.
- dexen 16y agoVery nice project. I'd like to show it to every nay-sayer in the recent ``C, The Beautiful Language (tenaciousc.com)'' [1] thread. ---- [1] http://news.ycombinator.com/item?id=2325065 http://news.ycombinator.com/item?id=2325065
- sstephenson 16y agoTcl is a strangely beautiful language. For those who haven't tried it, it's a little bit like Lisp (minimal homoiconic syntax, code is data) but without closures. Which of course sounds awful until you realize you can implement lexical scoping with the [uplevel] command: https://gist.github.com/874370 https://gist.github.com/874370 It's also very easy to embed a Tcl interpreter into a C program, or into a Tcl interpreter itself via the [interp] command. And asynchronous I/O is baked into the standard library. If you're interested, the Tclers Wiki (http://wiki.tcl.tk/ http://wiki.tcl.tk/) is a great place to learn more about the language.
- mhd 16y agoTcl seems a bit in a slump nowadays, but I don't think it would need much to get out of it. With a nice interface builder or some "automagic" layout classes the GUIs could be up to par again, although that's probably not even the most important aspect right now. Probably the biggest part missing are packages. TEA isn't that bad, but compared to Eggs/Gems/CPAN it's a bit lackluster. Although this is a bit of a catch-22, I guess. Hmm, was thinking about what language to use for my next project. Wanted to go with Python, but I think I'll give my old Tcl muscles a good workout again. Had much fun using it in an industrial context, let's see how much hurdles I have to jump for a current web project...
- gaius 16y agoIt suffers a bit from public perception as being "old" but of course it's up there with all the modern features, it's exceptionally easy to learn and use, there are no surprises or special cases. Probably because Tcl/Tk attracts the sort of programmer who happily uses it for real work and doesn't spend much time on advocacy forums...
- dexen 16y agoSeconded. My first (and only to date) serious encounter with Tcl was when writing some `expect' scripts. The language is flexible and powerful. It's quite easy to pick up the basics and become productive. Tcl is pretty good with GUI -- for example, Git's gui (`gitk' and `git gui') are implemented in Tcl with Tk library. By default it looks very plain, but is of course skinnable. NB., `expect' is a great way of automating CLI interaction with remote devices during development and testing. In a way `expect' reminds me of Awk -- `expect' is data driven as well, actions are attached to specificators of input conditions.
- peterbotond 16y agotcl info var and a dict can do closure like constructs. 8.5. 8.6 has a really cool oo interface. http://tcl.activestate.com/cgi-bin/tct/tip/257.html http://tcl.activestate.com/cgi-bin/tct/tip/257.html i do not know lisp, yet i heard tcl is like lisp without the strong type checking.
- Nate75Sanders 16y agoObligatory link to Stallman's "Why you should not use Tcl". http://www.vanderburg.org/OldPages/Tcl/war/0000.html http://www.vanderburg.org/OldPages/Tcl/war/0000.html This set off a war a long time ago, in a galaxy far far away. Edit: This has been downvoted twice now. Could be accident, but could be that people think I'm saying you shouldn't use Tcl. I've never used Tcl and hold no strong opinions about it. I'm simply linking to a piece of usenet history.
- protomyth 16y agoI didn't downvote you, but I didn't upvote you either. Maybe it is the reaction to doing something cool and having someone post a link to criticism that is peripheral to the project. Maybe some Tclers are a little tired of people continuing to post this particular piece of criticism. Maybe a random few don't care about RMS's opinion. It is like people posting the Tanenbaum / Torvalds thread in every Minix article. It just seems a little mean-spiritted after a while.
- silentbicycle 16y agoAgreed. In particular, it's hardly "obligatory".
- emelski 16y agoMany of those criticisms are completely irrelevant now. The post is from 1994, which means RMS is probably talking about Tcl 7.3, which is worlds apart from Tcl 8.5, the latest official release. People certainly can and have developed large applications in Tcl; Tcl has long since introduced an internal representation to efficiently handle numbers; etc. Posting links like this that are so old and out of date borders on irresponsible, because not everybody will take the time to realize that the criticisms are no longer valid.
- giu 16y agoIt's quite impressive, especially since he managed to do it in 3 hours. Hats off! Regarding the name: I'm guessing it's an altered version of the word piccolo, which stands for small in Italian. Nice one ;)
- riffraff 16y agoIIRC antirez implemented another tcl dialect long time ago (named jim IIRC), so he had a clear idea of where he was going I guess :)
- swah 16y agoFrom Reddit: - someone: "Picol", as in "piccolo"? - antirez: No, it's an obscure joke about the way Tcl is usually pronounced: "Tickle" that in Italian sounds a lot like "Ticol", so the small version of it is "Picol".