Earlier quoted context omitted.
Because you did. I came to the comments wondering if this was a shameless ripoff of the original or a re-post from the same author.
If it's similar to another article, I'd love to see it. I wrote this over the last two days using only the sources noted at the bottom of the post.
A Javascript journey with only six characters
91–100 of 123 posts
Re: A Javascript journey with only six characters
#92I'm a fan of Javascript. It has proper lambdas, true lexical scope, will soon have TCO, and is a really flexable language. But it's not without its warts, and this is one of the worst. Although it's sometimes fun to mess with, nonetheless. To see this taken to one of its logical extremes, check out If Hemmingway Wrote Javascript's entry for Douglas Adams: // Here I am, brain the size of a planet, and they ask me to w…
Re: A Javascript journey with only six characters
#93It's too bad that people were willing to ostracize Brendan Eich for not being a cookie-cutter silly-valley progressive. Oculus is facing that now. It's the new mccarthyism.
Re: A Javascript journey with only six characters
#94This 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: https://existentialtype.wordpress.com/2011/03/19/dynamic-lan... 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?
What the OP takes to the extreme is a property of weak typing, not dynamic typing. These properties are separate issues. A language is either statically typed or dynamically typed, and it is also either strongly typed or weakly typed. In a statically typed language, types are attached to variables. In a dynamically typed language, types are attached to values. Do note that many languages don't fit 100% into either ca…
More precisely, expressions may be typed. Of course, free variables are one particular of expression.
> In a dynamically typed language, types are attached to values.
More precisely, tags are attached to objects. An object is a “physical” entity that exists in space (computer memory) and time (from its construction to its destruction or garbage collection). A value is an abstract and atemporal entity that only exists in the language's semantics.
> Such a language would not allow you to, say, add an integer and a floating point number without explicitly converting one to the other.
But it does allow you to add integers and floating points! The result just happens to be an exception, which is a very well defined operation in the semantics of most high-level languages.
If it weren't allowed, it simply wouldn't happen.
Re: A Javascript journey with only six characters
#95Earlier quoted context omitted.
Because this technique was used to bypass EBay's JS blocker a while back.
Interesting, any chance you have a link to a writeup of that?
Re: A Javascript journey with only six characters
#96Earlier quoted context omitted.
Because you did. I came to the comments wondering if this was a shameless ripoff of the original or a re-post from the same author.
If it's similar to another article, I'd love to see it. I wrote this over the last two days using only the sources noted at the bottom of the post.
Re: A Javascript journey with only six characters
#97Does 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.
https://developers.google.com/caja/ Used it a few years ago. It was a little finnicky to get working right but I was impressed at the time. No idea where the project is at nowadays.
Re: A Javascript journey with only six characters
#98Does 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.
What about Node.js's `vm` module?
Re: A Javascript journey with only six characters
#99Earlier quoted context omitted.
https://developers.google.com/caja/ Used it a few years ago. It was a little finnicky to get working right but I was impressed at the time. No idea where the project is at nowadays.
Note that caja doesn't protect against local denial-of-service attacks: user-written javascript executed with it could allocate tons of memory or run forever (`while(true){}`). This may or may not be a problem depending on your use-case. (If you're using caja for code written by mostly-trusted 3rd parties, or for one user's code only on their own machine, then it's not much of an issue. If you're serving code written…
Some possible mitigations but I don't know if they ever implemented them.
Re: A Javascript journey with only six characters
#100Earlier quoted context omitted.
If it's similar to another article, I'd love to see it. I wrote this over the last two days using only the sources noted at the bottom of the post.
Previous HN context: https://news.ycombinator.com/item?id=11024511