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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Javascript journey with only six characters

567 点作者 Jazcash超过 8 年前

21 条评论

qwertyuiop924超过 8 年前
I&#x27;m a fan of Javascript. It has proper lambdas, true lexical scope, will soon have TCO, and is a really flexable language.<p>But it&#x27;s not without its warts, and this is one of the worst. Although it&#x27;s sometimes fun to mess with, nonetheless.<p>To see this taken to one of its logical extremes, check out If Hemmingway Wrote Javascript&#x27;s entry for Douglas Adams:<p><pre><code> &#x2F;&#x2F; Here I am, brain the size of a planet, and they ask me to write JavaScript... function kevinTheNumberMentioner(_){ l=[] &#x2F;* mostly harmless --&gt; *&#x2F; with(l) { &#x2F;&#x2F; sorry about all this, my babel fish has a headache today... for (ll=!+[]+!![];ll&lt;_+(+!![]);ll++) { lll=+!![]; while(ll%++lll); &#x2F;&#x2F; I&#x27;ve got this terrible pain in all the semicolons down my right hand side (ll==lll)&amp;&amp;push(ll); } forEach(alert); } &#x2F;&#x2F; you&#x27;re really not going to like this... return [!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]; }</code></pre>
评论 #12666861 未加载
评论 #12667995 未加载
评论 #12668263 未加载
madflame991超过 8 年前
The title is incorrect; you need &quot;!&quot; and the only reason why I clicked on the article was that doing it without &quot;!&quot; would be a BIG deal. The title of the original article is &quot;A Javascript journey with only six characters&quot; and the topic has been posted&#x2F;reposted and explained more times than I can count on HN
评论 #12666540 未加载
kukx超过 8 年前
Wat <a href="https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;wat" rel="nofollow">https:&#x2F;&#x2F;www.destroyallsoftware.com&#x2F;talks&#x2F;wat</a>
评论 #12669211 未加载
tempodox超过 8 年前
This is an extreme demonstration of the validity of a delightfully snarky blog post by Robert Harper on how dynamic typing is actually static typing using a unitype:<p><a href="https:&#x2F;&#x2F;existentialtype.wordpress.com&#x2F;2011&#x2F;03&#x2F;19&#x2F;dynamic-languages-are-static-languages&#x2F;" rel="nofollow">https:&#x2F;&#x2F;existentialtype.wordpress.com&#x2F;2011&#x2F;03&#x2F;19&#x2F;dynamic-lan...</a><p>A string is a Boolean is a number is a function, and braindead conversions can happen without anyone noticing. How does one keep their sanity using a language like that?
评论 #12667133 未加载
评论 #12666760 未加载
评论 #12666561 未加载
shp0ngle超过 8 年前
Why do I feel like I have read this article a few years ago? I remember it, but it has 2016...
评论 #12667492 未加载
评论 #12667291 未加载
Centime超过 8 年前
Without parenthesis (requires 8 characters though):<p><a href="http:&#x2F;&#x2F;centime.org&#x2F;jsfsck&#x2F;" rel="nofollow">http:&#x2F;&#x2F;centime.org&#x2F;jsfsck&#x2F;</a>
JelteF超过 8 年前
The article does not explain how it gets the {}, which is used to get the Object constructor string. Other than that it&#x27;s very clear.
评论 #12667103 未加载
评论 #12667392 未加载
fibo超过 8 年前
Wow, JavaScript is also an esoteric Language.<p>I remember similar strange and interesting stuff in Perl, like the spaceship operator.
lell超过 8 年前
Reminds me a bit of the quest for alphanumeric shell code.
novaleaf超过 8 年前
Does anyone know a good sandboxing technology to execute user written javascript in a safe way? (like, on other user machines or on the server)? I have some ideas like &quot;learn programming&quot; that would benefit from this immensely.
评论 #12669003 未加载
评论 #12667233 未加载
评论 #12667786 未加载
评论 #12667365 未加载
sjclemmy超过 8 年前
This is quite timely. I was looking at a library the other day which had IIFEs preceded by &#x27;+&#x27;. I wondered what the purpose was. Now I know!
joshschreuder超过 8 年前
I saw a similar video recently called Code Without Keywords which was quite interesting.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=LG-ozmTnhdI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=LG-ozmTnhdI</a>
keyle超过 8 年前
I knew about these languages but I&#x27;ve never understood how they were made. This is a fun, fantastic article! These articles make me excited about technology. Even bad ones.
pvdebbe超过 8 年前
I sighed with relief that the characters were not emoji.
CiPHPerCoder超过 8 年前
&gt; Javascript is a weird and wondeful language that lets us write some crazy code<p>Wondeful! A typo six words in.
评论 #12670688 未加载
amelius超过 8 年前
I&#x27;m getting a browser security warning on the url on Android.
a_c超过 8 年前
I don&#x27;t see the point of a programming language allowing itself braining fucking its users(developer) for serious use
评论 #12667924 未加载
评论 #12667573 未加载
评论 #12667853 未加载
mooveprince超过 8 年前
One more reason for the world to hate JavaScript ? :(
kyriakos超过 8 年前
this is insane. someone should create a js obfuscator that converts human readable code to this.
评论 #12666519 未加载
评论 #12666522 未加载
评论 #12666521 未加载
eweise超过 8 年前
So glad I don&#x27;t write in a &quot;weird and wondeful language that lets us write some crazy code that&#x27;s still valid&quot;
catscratch超过 8 年前
This doesn&#x27;t make me want to use JS. The power of JS is in two things, it&#x27;s in every major browser and it doesn&#x27;t completely suck. JS syntax kind of sucks. The power in JS is that it&#x27;s dynamic and lets you send functions around, but defining functions is much uglier than defining a lambda in Ruby:<p>-&gt; {anything goes here}<p>or<p>-&gt;(a,b,c) {anything goes here}<p>The problem with Ruby is that you then have to .() the lambda vs. (), so that is more verbose than just calling the function.<p>If browsers were to embrace a language that was more Ruby-like and less clunky than JS, I&#x27;m sure I&#x27;d use it more.
评论 #12667507 未加载
评论 #12667097 未加载