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.

Brainfuck beware: JavaScript is after you (2012)

123 pointsby SworDsyalmost 11 years ago

11 comments

Noctemalmost 11 years ago
It's been a while since I last brushed up on the Geneva Conventions, but I think this violates most of them.
Pitaroualmost 11 years ago
Yet another example of the horrible mess unprincipled automatic type conversion causes.<p>What prevents language designers from avoiding all these lurking bugs with a generic type-conversion operator? E.g. here&#x27;s how it might look in a Python-like language:<p><pre><code> &gt;&gt;&gt; x = 1 &gt;&gt;&gt; y = &quot;2&quot; &gt;&gt;&gt; print(x + cast(y)) 3 &gt;&gt;&gt; print(cast(x) + y) &quot;12&quot; &gt;&gt;&gt; print(cast(x) + cast(y)) Exception: ambiguous type</code></pre>
评论 #7832183 未加载
评论 #7834331 未加载
评论 #7833099 未加载
评论 #7832396 未加载
评论 #7832043 未加载
评论 #7832397 未加载
zatkinalmost 11 years ago
I&#x27;m curious on what the performance implications are. If I have some JavaScript on a webpage that I want to &quot;obfuscate&quot;, would using this accomplish the task?
评论 #7832092 未加载
评论 #7832613 未加载
tonylampadaalmost 11 years ago
I&#x27;ve seen this before here: <a href="http://www.jsfuck.com/" rel="nofollow">http:&#x2F;&#x2F;www.jsfuck.com&#x2F;</a>.<p>It&#x27;s nice that this guy actually explains how it works
facorreiaalmost 11 years ago
&gt; For instance, here is 4: !+[]+!![]+!![]+!![].<p>Gotta love this language... It&#x27;s a wonder we can get any work done with it. But, used with discipline, it&#x27;s not too bad.
nirmelalmost 11 years ago
I am not a programmer so this is part curiosity and part criticism. Why do programmers seem to enjoy creating programs that satisfy some syntactical constraint? Is it a fun mental exercise, or or can you just admit that you&#x27;re showing off on something that really does not matter?
评论 #7832032 未加载
评论 #7832083 未加载
评论 #7832275 未加载
评论 #7831993 未加载
评论 #7831981 未加载
评论 #7832021 未加载
评论 #7832429 未加载
评论 #7832039 未加载
评论 #7832048 未加载
评论 #7831992 未加载
nubsalmost 11 years ago
I once did something similar in PHP.[1] View the semi-useful writeup[2] as well.<p>[1]: <a href="https://gist.githubusercontent.com/nubs/5849633/raw/78bae58f6675f4e514d7a784c3142dd7d98f0629/nodigitsorquoteseither.php" rel="nofollow">https:&#x2F;&#x2F;gist.githubusercontent.com&#x2F;nubs&#x2F;5849633&#x2F;raw&#x2F;78bae58f...</a><p>[2]: <a href="https://gist.github.com/nubs/5849633" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;nubs&#x2F;5849633</a>
aqrashikalmost 11 years ago
This method could also be used to evade XSS filters.<p>For e.g. I believe encoding code using something similar is the only way to solve this challenge - <a href="http://escape.alf.nu/9/" rel="nofollow">http:&#x2F;&#x2F;escape.alf.nu&#x2F;9&#x2F;</a>
shittyanalogyalmost 11 years ago
Encoder for a similar subset: <a href="http://utf-8.jp/public/jjencode.html" rel="nofollow">http:&#x2F;&#x2F;utf-8.jp&#x2F;public&#x2F;jjencode.html</a>
ChrisAntakialmost 11 years ago
This was a brilliant article, I learned a ton, thanks.
dj-wonkalmost 11 years ago
{Brace} yourself before (and after) reading this.