TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Tcl the Misunderstood (2006)

135 点作者 drudru7 个月前

16 条评论

foobarian7 个月前
Another excellent aspect of Tcl I found is extensibility of JO's C implementation. At some point I needed to write some native code for speed and making this visible to the Tcl interpreter was a pleasure. Plus the codebase is so clean and well written.
评论 #41796214 未加载
评论 #41795360 未加载
评论 #41796513 未加载
评论 #41810954 未加载
js27 个月前
Previous discussions:<p>31 points|pmarin|16 years ago|17 comments<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=389107">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=389107</a><p>181 points|zeitg3ist|12 years ago|110 comments<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4920831">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4920831</a><p>131 points|throwaway344|11 years ago|45 comments<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7069642">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7069642</a><p>182 points|goranmoomin|2 years ago|79 comments<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31129936">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31129936</a>
bsder7 个月前
The biggest problem with Tcl is the fact that C won.<p>This means that &quot;&quot; and {} are expected to work a certain way from C and when you hit Tcl you are <i>HORRIBLY</i> confused.<p>It&#x27;s especially confusing as {} is simply quoting and <i>has nothing to do with scope</i>. The fact that Tcl is written such that {} is used with indentation in if-statements muddies the issue even further.<p>I suspect that a choice of ` (backtick) for Tcl &quot; and &quot; instead of Tcl {} would have made Tcl way less confusing to the vast majority of programmers.<p>I understand <i>why</i> things weren&#x27;t done that way--having the ability to know that your quote has different characters for open vs close is very valuable for efficient parsing.<p>Nevertheless, the Tcl choices were unfortunate given the way history played out.
评论 #41795240 未加载
评论 #41796577 未加载
评论 #41795208 未加载
ilrwbwrkhv7 个月前
This is fascinating. I have emailed Tcl&#x27;s &quot;father&quot; (John Ousterhout) at length and he is one of the few to have actually tried to test what coding patterns make for better code and is the only book I recommend anyone when they want to get better.<p>Unfortunately most fall for the more popular Clean Code and it&#x27;s derivatives.<p>Edit: The book is &quot;A Philosophy of Software Design&quot;
评论 #41794338 未加载
lilyball7 个月前
I&#x27;ve long wished to have the free time to write a Tcl-derived language, because it really is so elegant in many ways, it just needs a bit of modernization in some areas. It&#x27;s been years since I really thought much about this but I recall one of the things it&#x27;s missing is closures (it does have lambdas at least).<p>Reading through this article, the memoize implementation does have an issue which is if the memoized command wants to call uplevel or upvar it&#x27;ll get the wrong stack frame. If I were writing this I&#x27;d structure it so it&#x27;s used like<p><pre><code> proc myMemoizingProcedure { ... } { memoize { ... the rest of the code ... } } </code></pre> such that it can just `uplevel` the code. Or better yet I&#x27;d make `memoize` replace the `proc` keyword (or perhaps `memoize proc myMemoizingProcedure …`).<p>EDIT: I suppose memoizing makes no sense in a procedure that wants to use upvar or uplevel though, because memoizing only works for pure functions.
评论 #41794328 未加载
评论 #41794793 未加载
评论 #41797249 未加载
andrelaszlo7 个月前
A lot of the power of expect seems to come from the fact that it&#x27;s (normally) configured&#x2F;scripted in Tcl<p><a href="https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;expect" rel="nofollow">https:&#x2F;&#x2F;linux.die.net&#x2F;man&#x2F;1&#x2F;expect</a><p>I really like that it, like the article mentions, just looks like config for basic scripts but also scales to whatever you need it to do.
评论 #41801088 未加载
评论 #41794985 未加载
sshine7 个月前
My favorite obscure line of TCL:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;athas&#x2F;EggsML&#x2F;blob&#x2F;master&#x2F;concieggs&#x2F;hooks&#x2F;channel_message&#x2F;40regex#L25">https:&#x2F;&#x2F;github.com&#x2F;athas&#x2F;EggsML&#x2F;blob&#x2F;master&#x2F;concieggs&#x2F;hooks&#x2F;...</a><p>A line that contains a regex pattern for matching regex patterns.<p>TCL was chosen here because its regex engine isn&#x27;t too powerful.
评论 #41796370 未加载
generalizations7 个月前
The biggest weakness IMHO is the inability to comment out elements of an array. Even bash lets you do this and it makes testing and dev so much easier. Really wanted to love it, but that got in the way too many times.
评论 #41795321 未加载
评论 #41796558 未加载
magicalhippo7 个月前
Wish I had this page when messing around with Eggdrop[1] back in the late 90s.<p>As a self-taught novice programmer that started with QBasic and had moved on to Turbo Pascal, I found Tcl to be <i>very</i> confusing and it left a rather negative impression.<p>Reading this page now though, it seems a lot more logical and reasonable than it appeared at the time.<p>[1]: <a href="https:&#x2F;&#x2F;docs.eggheads.org&#x2F;tutorials&#x2F;firstscript.html" rel="nofollow">https:&#x2F;&#x2F;docs.eggheads.org&#x2F;tutorials&#x2F;firstscript.html</a>
评论 #41797226 未加载
WillAdams7 个月前
One thing which I&#x27;ve always not understood about Tcl&#x2F;TK is why there isn&#x27;t a standard graphical tool for laying out a GUI program.<p>For a long while, when I might have used Tcl&#x2F;TK, I instead used Runtime Revolution&#x2F;Livecode (a cross-platform HyperCard clone) which had a very nice system for interactively drawing programs.<p>I&#x27;d really like for there to be an agreed-upon standard option for graphical program development which was interactive and cross-platform.
评论 #41796435 未加载
评论 #41796074 未加载
评论 #41796348 未加载
评论 #41796096 未加载
import_awesome7 个月前
Another great feature of Tcl for writing servers it that you can reload the code while it is running and keep all the state and connections open. Code up&#x2F;bootstrap your server while it is running the whole time. Sure this is a security nightmare, but it is fun to code.
评论 #41798268 未加载
leoh7 个月前
Fun fact: SQLite’s test suite is written in TCL <a href="https:&#x2F;&#x2F;github.com&#x2F;sqlite&#x2F;sqlite&#x2F;blob&#x2F;master&#x2F;test&#x2F;strict1.test">https:&#x2F;&#x2F;github.com&#x2F;sqlite&#x2F;sqlite&#x2F;blob&#x2F;master&#x2F;test&#x2F;strict1.te...</a>
评论 #41797356 未加载
allknowingfrog7 个月前
Does anyone know of a good tutorial for getting starting with Tcl&#x2F;Tk that still makes sense in 2024? I&#x27;m really intrigued by the idea of building and shipping simple, cross-platform GUIs, but I&#x27;m completely overwhelmed by all of the installation and configuration options. It seems like tclkit is supposed to be the go-tool tool for self-contained executables, but I honestly can&#x27;t even figure out which site is the source-of-truth for downloading it, let alone installing it.
评论 #41800386 未加载
评论 #41813482 未加载
mseepgood7 个月前
This language seems like a security nightmare to me regarding code injection attacks through untrusted inputs.
评论 #41797214 未加载
评论 #41797239 未加载
评论 #41798298 未加载
zombot7 个月前
&gt; Concept 9: Eval and Uplevel<p>That&#x27;s where it gets really criminal: Dynamic scoping rules. There is no lexical scoping and hence no closures. If you use `uplevel`, your procedure works or doesn&#x27;t, depending on the caller. There is a reason Tcl is the last language that uses this braindead mechanism.
77pt777 个月前
Tcl is basically a sloppier Perl with a GUI.
评论 #41796150 未加载
评论 #41796305 未加载
评论 #41795981 未加载
评论 #41801808 未加载
评论 #41804960 未加载