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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Advantages of Tcl over Lisp (2005)

75 点作者 tonyjstark超过 7 年前

8 条评论

keymone超过 7 年前
&gt; For example in order to use a number as argument of a string manipulation function, there is to convert from one type to the other.<p>ah yes, the coercion of everything into everything that depends on order of application. best feature ever.<p>another &quot;gem&quot;:<p>&gt; many thinks like HTML, XML, Networking Protocols, are about strings more than they are about lists<p>all these things are about a very structured often deeply nested pieces of data. pretty much a direct opposite of the string type.
评论 #15584662 未加载
pmoriarty超过 7 年前
<i>&quot;Tcl is a programmable programming language like Lisp, in both you can write new control structures, and more generally it&#x27;s possible to specialize both the languages. But while in Lisp is usually needed to write macros, in Tcl you have to write normal procedures.&quot;</i><p>You can write normal procedures in Lisp too -- for new control structures even. In fact, macro use in Lisp is usually discouraged unless you really need them, and in most cases you really don&#x27;t. When you really do, they&#x27;re nice to have, though. It&#x27;s too bad that when you really need them in other languages, they&#x27;re not there.<p><i>&quot;Lisp has types, more or less like Python and Ruby. For example in order to use a number as argument of a string manipulation function, there is to convert from one type to the other.&quot;</i><p>I&#x27;m not sure I see the point. You have to convert strings to numbers and numbers to strings in Lisp too. Lisp has types. You can even get static types in Lisp, if you want them - like with Typed Racket.[1]<p><i>&quot;In Tcl serialization just happens for many types because almost everything has a string representation. You can write a Tcl list in a file just with: puts $fd $list. This is not possible in Lisp, where you need to perform serialization.&quot;</i><p>You can write a TCL list to a file? You mean a TCL string to a file? Lisp can just write strings to files too.<p><i>&quot;Lisp central data type is the list, while Tcl central data type is the string. Tcl also makes a lot of use of lists that are just special strings. In today&#x27;s world, to have strings as base type is usually more useful, because many thinks like HTML, XML, Networking Protocols, are about strings more than they are about lists. To deal with strings in Lisp is not as natural as with Tcl.&quot;</i><p>The thing is, you don&#x27;t necessarily <i>want</i> to deal with strings in Lisp (and arguably even in TCL). You want to deal with higher level abstractions such as tags, elements, and so on. The underlying representation as string or list is less important, and can sometimes even get in the way (such as in some languages which allow buffer overflows when dealing with strings).<p>[1] - <a href="http:&#x2F;&#x2F;docs.racket-lang.org&#x2F;ts-guide&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;docs.racket-lang.org&#x2F;ts-guide&#x2F;index.html</a>
评论 #15582906 未加载
评论 #15582933 未加载
评论 #15585152 未加载
评论 #15582877 未加载
评论 #15582335 未加载
评论 #15582318 未加载
empath75超过 7 年前
I was surprised when I started working at aol a few years ago how much of the legacy infrastructure runs on tcl. They had a configuration management and process load balancing system that was written in the 90s that as far as I know is still being used to push out updates to stuff like AIM to this day.<p>It might be interesting to hear one of the old school aol guys talk about it now that they’re decomming a lot of that finally. There was a lot of interesting stuff there that should have been open sourced decades ago and never was.
评论 #15582352 未加载
评论 #15582688 未加载
joe_the_user超过 7 年前
As I recall, a fairly generic critique of lisp is that as a language of incredible power and open structure, you wind-up with many implementation of many functionalities in many libraries but few of them are finished and the API for these tend to not be very well defined.<p>See;<p><a href="http:&#x2F;&#x2F;www.shenlanguage.org&#x2F;lambdassociates&#x2F;htdocs&#x2F;blog&#x2F;bipolar.htm" rel="nofollow">http:&#x2F;&#x2F;www.shenlanguage.org&#x2F;lambdassociates&#x2F;htdocs&#x2F;blog&#x2F;bipo...</a>
评论 #15582697 未加载
评论 #15582637 未加载
martyalain超过 7 年前
I also love Lisp and I understand your point of view about the way Lips is not so nice with strings, which are the main data of the web. What do you think of such an approach based on strings and regular expressions: <a href="http:&#x2F;&#x2F;lambdaway.free.fr&#x2F;" rel="nofollow">http:&#x2F;&#x2F;lambdaway.free.fr&#x2F;</a> ?
flavio81超过 7 年前
This is so misleading that i don&#x27;t know where to start. Don&#x27;t get me wrong, i wish more people would take a look at Tcl, because it has clever tricks. But this page is puzzling:<p>&gt;<i>But while in Lisp is usually needed to write macros, in Tcl you have to write normal procedures</i><p>Well, in Lisp, macros are written... basically in the same way as normal procedures&#x2F;functions. The difference is minimal: Use the quasiquote and comma operators (for something that can be described as &quot;code templating&quot;), and make sure to use &quot;gensym&quot; whenever you need to generate a symbol (and don&#x27;t want it to collide with other existing symbols.) That&#x27;s it.<p>The rest is just as if writing a normal function.<p>&gt;<i>Lisp has types, more or less like Python and Ruby. For example in order to use a number as argument of a string manipulation function, there is to convert from one type to the other.</i><p>This is because Lisp is strongly typed, which is universally regarded today as a <i>Good</i> Thing.<p>&gt;<i>strings as base type is usually more useful, because many thinks like HTML, XML, Networking Protocols, are about strings more than they are about lists. </i><p>There are many things wrong here. In Lisp, if you need to deal with HTML or XML, instead of having to be losing time doing string operations, you just write HTML or XML directly in your code as s-expressions (take a look at most of the libraries for outputting HTML in Lisp).<p>Thus, you do it the high-level way.<p>&gt;<i>The Tcl world is less fragmented. There aren&#x27;t a big number of implementations of Tcl</i><p>I wonder if this is truly an advantage for Tcl. Common Lisp has a dozen implementations and your code will run unchanged in all of them, as long as you don&#x27;t use implementation-dependent features (And for them, there are already many portable libraries, so those features are not implementation-dependent anymore.)
评论 #15589411 未加载
KasianFranks超过 7 年前
TiVo chose Tcl and in fact started as a Tcl house when I was there, cutting tons of Tcl and still do to this day.
tuananh超过 7 年前
iirc, the very first version of redis was written in tcl, wasn&#x27;t it?
评论 #15584918 未加载