Live data from Hacker News

Show HN: Turned Facebook Messenger into a JavaScript REPL

github.com

21–30 of 39 posts

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#22
post #3

Earlier quoted context omitted.

"safe eval". What does that even mean?

"safe-eval lets you execute JavaScript code without having to use the much discouraged and feared upon eval(). safe-eval has access to all the standard JavaScript API of the underlying engine. It is implemented using node's vm module." [1] [1] https://www.npmjs.com/package/safe-eval

It's important to note that running code in vm.runInNewContext is not advised for 'untrusted code' according to the documentation. So probably not good to let random people use this bot.

"script.runInNewContext() is quite useful, but safely running untrusted code requires a separate process."[0]

[0] - https://nodejs.org/api/vm.html#vm_script_runinnewcontext_san...

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#23
post #14

Earlier quoted context omitted.

I personally feel it caused an unhelpful epidemic of snark about technology. When you have a bug you're trying to squash and you take a break and skim Twitter, this kind of sentiment is like salt in the wound.

pain is information

Platitudes are also information. Information we can do without.

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#24
post #3

Earlier quoted context omitted.

"safe eval". What does that even mean?

"safe-eval lets you execute JavaScript code without having to use the much discouraged and feared upon eval(). safe-eval has access to all the standard JavaScript API of the underlying engine. It is implemented using node's vm module." [1] [1] https://www.npmjs.com/package/safe-eval

https://github.com/hacksparrow/safe-eval/blob/master/index.j...

Maybe it's not a nice idea to use Math.random for secure and unique keys.

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#25

Is sending and receiving messages through facebook messenger still limited to the official app or did they add back an API to replace the old XMPP interface?

Facebook launched an API for this at F8 this year https://developers.facebook.com/docs/messenger-platform

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#28
post #8
post #4

Cool idea! But man, Gary Bernhardt's WAT talk, even though i saw it at least 10 times, still cracks me up...

His "Useing You're Type's Good" talk is also wonderful, also made me laugh to tears! [1]: https://www.destroyallsoftware.com/talks/useing-youre-types-...

That was hilarious! Anyone know of similar PL warts talks?

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#29
post #20
post #10

Or you could just open the developer console ...

Where's the JavaScript REPL on iPhone Safari?

Exactly. Now when I need a JS REPL on my iPhone, I can just think "Facebook!" and chat with the bot..

Alternative: http://thumbsnap.com/s/rd1sV73V.png?0421

Re: Show HN: Turned Facebook Messenger into a JavaScript REPL

#30
post #14

Earlier quoted context omitted.

I personally feel it caused an unhelpful epidemic of snark about technology. When you have a bug you're trying to squash and you take a break and skim Twitter, this kind of sentiment is like salt in the wound.

pain is information

Sure no yeah, all of the things you talked about in the talk are valuable things to know. You didn't talk at all about why they are that way, nor did you admit that you don't know (and neither do the language creators know) why those problems exist. Nor did you disclose that the most important thing to know was that these are undefined corner cases, of which technology is full of. Now there are millions of retweets out there that do nothing to further understanding.

They amount to me taking a screenshot of your comment here and saying things like "Oh, look, he typed into a text box and the computer didn't format his sentence properly with a capital at the beginning or a period on the end! Computers are so stupid but how could he have known that it wouldn't do that for him?"

Instead, the real explanation, that this is what you wanted, is rather mundane and boring. And it is unrealistic to expect a feature like I'm suggesting because it assumes so much about what is wanted, and would be tied to directly to a general use case of English and may not work right all the time anyway.

This is a subtle nuance that can be extrapolated into real understanding of the limits of system design, and you personally continue to push this mindset that we should all point and laugh and retweet because it is a funny in-joke and I'm sorry it just doesn't help.

I will give you that it does have an element of striving for better, more descriptive error messages, and better interactions and interfaces. But I don't see anyone outside of Bret Victor really trying, and we need a million more people a little less ambitious than him to make it happen.

This all being said, you do an absolute ton of great work that honestly I can barely understand because it is either more advanced than I am, or outside my purview, but I know it is worth it to us all that you do it, so thank you so so much for that.

Post reply on HN