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.

A Javascript journey with only six characters

567 pointsby Jazcashover 8 years ago

21 comments

qwertyuiop924over 8 years ago
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 未加载
madflame991over 8 years ago
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 未加载
kukxover 8 years ago
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 未加载
tempodoxover 8 years ago
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 未加载
shp0ngleover 8 years ago
Why do I feel like I have read this article a few years ago? I remember it, but it has 2016...
评论 #12667492 未加载
评论 #12667291 未加载
Centimeover 8 years ago
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>
JelteFover 8 years ago
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 未加载
fiboover 8 years ago
Wow, JavaScript is also an esoteric Language.<p>I remember similar strange and interesting stuff in Perl, like the spaceship operator.
lellover 8 years ago
Reminds me a bit of the quest for alphanumeric shell code.
novaleafover 8 years ago
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 未加载
sjclemmyover 8 years ago
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!
joshschreuderover 8 years ago
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>
keyleover 8 years ago
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.
pvdebbeover 8 years ago
I sighed with relief that the characters were not emoji.
CiPHPerCoderover 8 years ago
&gt; Javascript is a weird and wondeful language that lets us write some crazy code<p>Wondeful! A typo six words in.
评论 #12670688 未加载
ameliusover 8 years ago
I&#x27;m getting a browser security warning on the url on Android.
a_cover 8 years ago
I don&#x27;t see the point of a programming language allowing itself braining fucking its users(developer) for serious use
评论 #12667924 未加载
评论 #12667573 未加载
评论 #12667853 未加载
mooveprinceover 8 years ago
One more reason for the world to hate JavaScript ? :(
kyriakosover 8 years ago
this is insane. someone should create a js obfuscator that converts human readable code to this.
评论 #12666519 未加载
评论 #12666522 未加载
评论 #12666521 未加载
eweiseover 8 years ago
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;
catscratchover 8 years ago
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 未加载