Live data from Hacker News

A Javascript journey with only six characters

jazcash.com

91–100 of 123 posts

Re: A Javascript journey with only six characters

#91
post #59

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.

Previous HN context:

https://news.ycombinator.com/item?id=11024511

Re: A Javascript journey with only six characters

#92

I'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…

Lexical scope with async closures makes it very easy to write async code for example events in a gui or handling multiple clients in a server. Its a big deal.

Re: A Javascript journey with only six characters

#93

It'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.

We detached this subthread from https://news.ycombinator.com/item?id=12666782 and marked it off-topic.

Re: A Javascript journey with only six characters

#94
post #46

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: 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…

> In a statically typed language, types are attached to variables.

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

#95
post #83

Earlier 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?

http://blog.checkpoint.com/2016/02/02/ebay-platform-exposed-...

http://thedailywtf.com/articles/bidding-on-security

Re: A Javascript journey with only six characters

#96
post #59

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.

I think the problem is your post reads like it's a discovery of your own, jsfuck and previous artwork are only hinted at the end.

Re: A Javascript journey with only six characters

#97
post #52

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.

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 by one user to another, then it could be a problem.)

Re: A Javascript journey with only six characters

#98

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.

What about Node.js's `vm` module?

Note that the vm module doesn't protect against local denial-of-service attacks: user-written javascript executed with it could allocate tons of memory or run forever (despite any configured timeouts: https://github.com/nodejs/node/issues/3020).

Re: A Javascript journey with only six characters

#99
post #97
post #52

Earlier 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…

Ha, here's an old thread where I asked the caja developers about that exact scenario: https://groups.google.com/forum/#!topic/google-caja-discuss/...

Some possible mitigations but I don't know if they ever implemented them.

Re: A Javascript journey with only six characters

#100
post #91
post #59

Earlier 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

Those links are to generators, not easy-to-read long-form explanations.
Post reply on HN