I'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's not without its warts, and this is one of the worst. Although it's sometimes fun to mess with, nonetheless.<p>To see this taken to one of its logical extremes, check out If Hemmingway Wrote Javascript's entry for Douglas Adams:<p><pre><code> // Here I am, brain the size of a planet, and they ask me to write JavaScript...
function kevinTheNumberMentioner(_){
l=[]
/* mostly harmless --> */ with(l) {
// sorry about all this, my babel fish has a headache today...
for (ll=!+[]+!![];ll<_+(+!![]);ll++) {
lll=+!![];
while(ll%++lll);
// I've got this terrible pain in all the semicolons down my right hand side
(ll==lll)&&push(ll);
}
forEach(alert);
}
// you're really not going to like this...
return [!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]];
}</code></pre>
The title is incorrect; you need "!" and the only reason why I clicked on the article was that doing it without "!" would be a BIG deal. The title of the original article is "A Javascript journey with only six characters" and the topic has been posted/reposted and explained more times than I can count on HN
Wat <a href="https://www.destroyallsoftware.com/talks/wat" rel="nofollow">https://www.destroyallsoftware.com/talks/wat</a>
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://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/" rel="nofollow">https://existentialtype.wordpress.com/2011/03/19/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?
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 "learn programming" that would benefit from this immensely.
I saw a similar video recently called Code Without Keywords which was quite interesting.<p><a href="https://www.youtube.com/watch?v=LG-ozmTnhdI" rel="nofollow">https://www.youtube.com/watch?v=LG-ozmTnhdI</a>
I knew about these languages but I've never understood how they were made. This is a fun, fantastic article! These articles make me excited about technology. Even bad ones.
This doesn't make me want to use JS. The power of JS is in two things, it's in every major browser and it doesn't completely suck. JS syntax kind of sucks. The power in JS is that it's dynamic and lets you send functions around, but defining functions is much uglier than defining a lambda in Ruby:<p>-> {anything goes here}<p>or<p>->(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'm sure I'd use it more.