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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why Dart is not the language of the future.

260 点作者 vital101超过 13 年前

20 条评论

ohyes超过 13 年前
There are a lot of unwarranted conclusions drawn here. I think this article is FUD (and I don't really care for Dart).<p>&#62; Dart programs may be statically checked. The static checker will report some violations of the type rules, but such violations do not abort compilation or preclude execution.<p>&#62; In other words the "static checker" is a lint-type development aid, not a language feature.<p>My reading is that the language is optionally typed (similar to SBCL). The type checker will warn you when you have a type declaration that appears to be incorrect, and will optimized based on these declarations, but will not keep you from running code that violates a type-check. This is a remarkably good solution for dynamic languages.<p>&#62; Here's a strange thing: the one and only true value is the boolean literal boolean true. Everything else is false. That means that code in if (1) { ... } will never execute, because 1 is a number, not a boolean, and there is no implicit conversion to boolean. You'll need to write if (1==1) instead.<p>This makes as much sense as 'everything' being true. You would write if (true) {...}, but I can't imagine why you would do that.<p>&#62; There is no implicit type conversion between numeric, string or boolean types.<p>Ok. This is a good thing. Auto conversion is bad.<p>&#62; The distinction between string and numbers allows to re-use the addition operator + both for addition and concatenation. However, without strong typing, this will almost certainly prove to be a bad idea. From the specs, it looks like "2" + 2 will be a concatenation, and 2 + "2" a run-time exception (in the absence of implicit conversion from string to number), but experience infirms this: string concatenation happens in both cases (although with a warning in the second one).<p>This seems to directly contradict the first point. Which is it? It should do a dynamic type check and generate a run time exception in both cases. I don't see anything to convince me that "2" + 2 will be a concatenation... in the spec.<p>&#62;Thus, isolates are a heavyweight thread control model very much like Perl 5's ithreads. That means that they are good for data isolation, but heavy to use and hungry in memory, because spawning a new isolate will imply cloning all the objects and data structures of the running libraries.<p>There is absolutely nothing that implies this. There is a tiny section in the spec about isolates. They could easily be lightweight like Erlang processes.
评论 #3098810 未加载
评论 #3099762 未加载
评论 #3099200 未加载
评论 #3098725 未加载
评论 #3099165 未加载
评论 #3100509 未加载
alttag超过 13 年前
I think one of the reasons JS succeeded is precisely a major complaint of experienced developers: globals [1]. But this, (perhaps as with PHP) is what enabled novice developers —some of whom eventually became experienced developers—to learn the language easily.<p>We all started with some bad practices, and as we matured our code did too. But the loose, forgiving standards are precisely what enabled broad use in the first place.<p>When a language imposes more constraints on the programmer (it may be for their own good!), it limits adoption and growth.<p>1: From the summary of <i>Javascript: The Good Parts</i>, "... Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation. Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables."
评论 #3099053 未加载
评论 #3098838 未加载
评论 #3101391 未加载
评论 #3098792 未加载
jriddycuz超过 13 年前
<i>The worst of both worlds: Dart fails to provides the advantages of static languages, without compensating by the flexibility of dynamic languages.</i><p>This was my impression exactly when I first read about Dart. This is the language that Google wants to replace Javascript? Please. Javascript may have some strange design quirks (or outright flaws, depending on who you talk to), but at least it has the sense to have a meaningful boolean context. I understand that you can't try to revolutionize everything if you're targeting a wide audience, but this just looks like decaffeinated Java.
评论 #3102023 未加载
bascule超过 13 年前
This article conflates "dynamic typing" with "weak typing" all over the place. First he whines that type declarations aren't mandatory (at least within the scope of what a type inferencer can resolve), claims the runtime won't be able to determine type information (which V8) can already do...<p>...then he goes on to complain that there's no automatic type coercion! This is probably one of the worst misfeatures of JavaScript (and Perl and PHP), but after a short tirade about "weak typing", he's longing for automatic type coercion? Sorry dude, "3 dog night" + 2 should not equal 5
mrspeaker超过 13 年前
Very interesting article. After playing with the examples and looking at the docs for a bit, it really felt "old school" - but I assumed that that was just a facade to lul any corporate java types into a false sense of familiarity before busting out the modern goodness: much like JavaScript's own "Surprise! I was really SmallTalk all along!" magic trick.
评论 #3099741 未加载
ajanuary超过 13 年前
The comments under the "Feeble Typing" section make it clear the author has never seen or read Gilad talk about optional typing. For one example, read <a href="http://bracha.org/pluggable-types.pdf" rel="nofollow">http://bracha.org/pluggable-types.pdf</a>
enmanuelr超过 13 年前
Yes, please. Tell me how this language, before it even launches, is finished, or has been tested in the real world, is already doomed to fail.<p>Oh and it's posted on a Perl blog. Completely objective I'm sure.
jbooth超过 13 年前
Is it just me, or is every dart criticism follow the pattern:<p>1) I have a hobby horse 2) Dart gets released 3) Flog hobby horse<p>Go had a bunch of similar criticisms, mostly for not being "innovative" enough and favoring a small, solid feature set.
评论 #3100104 未加载
评论 #3099175 未加载
swah超过 13 年前
Those points just mean Dart isn't revolutionary, which is pretty much a requirement for a language to replace Javascript.
评论 #3098638 未加载
评论 #3098640 未加载
评论 #3098622 未加载
rayiner超过 13 年前
Like 80% of these things are true for Scheme/Lisp/Dylan. Canonical true value? Lack of implicit type conversions? These are good design decisions, not warts.
评论 #3102438 未加载
评论 #3099359 未加载
sambeau超过 13 年前
This is not a bad article despite the stupid title.<p>Take-up is all that matters in the future; the quality of a programming language has rarely had any influence on take-up.
评论 #3098881 未加载
评论 #3098715 未加载
roopeshv超过 13 年前
I'll just leave them here. (<a href="http://www.google.com/search?q=chrome+why+we+don%27t+need+another+browser&#38;ie=utf-8&#38;oe=utf-8&#38;aq=t&#38;rls=org.mozilla:en-US:unofficial&#38;client=firefox-a" rel="nofollow">http://www.google.com/search?q=chrome+why+we+don%27t+need+an...</a>)<p><a href="http://www.uxpassion.com/2008/09/google-chrome-nah-we-dont-need-another-hero/" rel="nofollow">http://www.uxpassion.com/2008/09/google-chrome-nah-we-dont-n...</a><p><a href="http://www.extremetech.com/computing/79620-who-cares-about-googles-chrome-browser" rel="nofollow">http://www.extremetech.com/computing/79620-who-cares-about-g...</a><p><a href="http://floggingenglish.com/2008/09/03/google-chrome-just-because-you-can-doesnt-mean-you-should/" rel="nofollow">http://floggingenglish.com/2008/09/03/google-chrome-just-bec...</a>
aristidb超过 13 年前
&#62; Which means that the expression (a==a) might be, in some pathological cases, false.<p>Most languages (including Perl) have at least one case where a==a is not true. (0.0/=0.0) == (0.0/0.0), or any NaN == NaN expression.
评论 #3099217 未加载
pyre超过 13 年前
<p><pre><code> &#62; if (1) { ... } will never execute, because 1 is a &#62; number, not a boolean, </code></pre> This hasn't stopped Ruby from being popular.
评论 #3099352 未加载
评论 #3099201 未加载
bryze超过 13 年前
If we're going to be posting judgmentally titled articles, then why don't we post "why perl is the language of the past." I suspect the main reason languages like perl and FORTRAN are still used is because of legacy and tradition. But I acknowledge that is my opinion, not fact, so I wouldn't post such a title. Seriouly, we need to stop the pomposity. What about "My concerns about Dart 0.1", or "Early Criticism for Dart 0.1"?
digamber_kamat超过 13 年前
I will not use dart because it comes from google. Wont let them own everything about the web.
评论 #3100083 未加载
dextorious超过 13 年前
May I point to the irony on posting why a language is not "the language of the future" on perl.org?<p>[UPDATE: yes, please, down vote freely, because humor is dangerous].
评论 #3098603 未加载
评论 #3099355 未加载
评论 #3098836 未加载
评论 #3098566 未加载
dos1超过 13 年前
To me Dart feels a bit like the Embrace/Extend/Extinguish behavior of Microsoft. There's nothing I've seen so far that really makes me excited about Dart, and it kind of feels like Google is really just creating this new thing for the sake of being different. It seems like they want to unilaterally make decisions on the future of the web. We all know how well that works.
dreamdu5t超过 13 年前
Dart provides and enforces a bunch of idioms that you don't need in JavaScript in the first place! Adding classes to a language that... doesn't need classes.<p>If anybody but Google released Dart HN wouldn't give two shits.
sadfasdfads超过 13 年前
The way I understand it, Dart is a higher-level abstraction of Javascript. People thought that Java was crap too when it came out and said C/C++ was still king. Look how that went.<p>Perl has been out fucking forever and still isn't in the browser, so stop whining. Javascript whipped your ass in this arena, Perl.
评论 #3098917 未加载