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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Brainfuck beware: JavaScript is after you (2012)

123 点作者 SworDsy将近 11 年前

11 条评论

Noctem将近 11 年前
It's been a while since I last brushed up on the Geneva Conventions, but I think this violates most of them.
Pitarou将近 11 年前
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 未加载
zatkin将近 11 年前
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 未加载
tonylampada将近 11 年前
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
facorreia将近 11 年前
&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.
nirmel将近 11 年前
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 未加载
nubs将近 11 年前
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>
aqrashik将近 11 年前
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>
shittyanalogy将近 11 年前
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>
ChrisAntaki将近 11 年前
This was a brilliant article, I learned a ton, thanks.
dj-wonk将近 11 年前
{Brace} yourself before (and after) reading this.