TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

“Swift is the only language I could find with over 100 keywords”

29 pointsby alexobenaueralmost 4 years ago

11 comments

blacktrianglealmost 4 years ago
I don&#x27;t think this is fair to Swift. Swift seems to have taken a view that the langauge will force you to be explicit about what you want. For example, the &quot;indirect&quot; keyword. Early Swift did not let you have recursive enums, apparently this can be something of a performance killer I guess was the reasoning. However they are really useful, so Swift added them. However rather than just automatically using an indirect Enum which is easily detectible, Swift forces you to use the &quot;indirect&quot; keyword. Rather than implicitly doing work for you, the Swift compiler stops to ask &quot;are you sure this is what you really want to do? Do you understand the tradeoffs you are making?&quot;<p>Personally I&#x27;m a fan of the Swift approach even if it does balloon the keyword count a bit.
评论 #28012122 未加载
eesmithalmost 4 years ago
Depending on how you count keywords, SQL has over 400. See <a href="https:&#x2F;&#x2F;github.com&#x2F;ballista-compute&#x2F;sqlparser-rs&#x2F;blob&#x2F;main&#x2F;src&#x2F;dialect&#x2F;keywords.rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ballista-compute&#x2F;sqlparser-rs&#x2F;blob&#x2F;main&#x2F;s...</a> .<p>SQLite has 147 keywords - <a href="https:&#x2F;&#x2F;www.sqlite.org&#x2F;lang_keywords.html" rel="nofollow">https:&#x2F;&#x2F;www.sqlite.org&#x2F;lang_keywords.html</a> .
评论 #28011328 未加载
vb6sp6almost 4 years ago
VB6 has close to 300<p>And while some vb6 code is truly terrible, it isn&#x27;t because of keywords. It&#x27;s because beginners have no idea what they are doing.<p>So I imagine Swift code may be terrible because there are a lot of noobs out there doing whatever it takes to ship.
hpenalmost 4 years ago
And yet code in Swift is much cleaner than anything in Javascript. I say that having mostly written Swift &amp; Javascript at my jobs and on the side.
评论 #28012264 未加载
wdbalmost 4 years ago
Yeah, the design by committee approach of Swift isn&#x27;t helping either. There are some weird language decisions being made
Zababaalmost 4 years ago
56 keywords in OCaml, 99 total if you count the character sequences. Maybe a better metric would be &quot;keywords uses regularly&quot;?. <a href="https:&#x2F;&#x2F;ocaml.org&#x2F;manual&#x2F;lex.html#sss:keywords" rel="nofollow">https:&#x2F;&#x2F;ocaml.org&#x2F;manual&#x2F;lex.html#sss:keywords</a>
xq3000almost 4 years ago
Smalltalk80 wins with only 6 keywords <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Smalltalk" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Smalltalk</a>
mmphosisalmost 4 years ago
<a href="https:&#x2F;&#x2F;threadreaderapp.com&#x2F;thread&#x2F;1420950032669286402.html" rel="nofollow">https:&#x2F;&#x2F;threadreaderapp.com&#x2F;thread&#x2F;1420950032669286402.html</a>
cweillalmost 4 years ago
I don&#x27;t see golang on that chart. It must be close to C (on the lower end).
ksajalmost 4 years ago
I&#x27;m pretty sure Common Lisp has well over 100 keywords.
评论 #28012717 未加载
BooneJSalmost 4 years ago
SystemVerilog (IEEE 1800-2017) has 248.