r/javascript • • Oct 11 '17

JavaScript's Promise is Memory Unsafe

https://alexn.org/blog/2017/10/11/javascript-promise-memory-unsafe.html
70 Upvotes

77 comments sorted by

View all comments

Show parent comments

6

u/[deleted] Oct 11 '17

funfix

Ah, so this whole contrived example is to push the funfix package you wrote.

Future isn't a promise. So of course you can write it however you want. You can leave spec behind so you can show you fixed this "terrible" Promise bug by not using Promises.

1

u/alexelcu Oct 11 '17

No, the Funfix implementation is there to show that it can be done, otherwise there would be people here saying that it can't be ... oh wait.

Well, I've been called a scumbag for doing self promotion. I guess that if you work on stuff and talk about it, you must be one.

5

u/[deleted] Oct 11 '17

I guess that if you work on stuff and talk about it, you must be one.

No. That's not the case. It's how you're coming across in all of this.

You came up with a rather contrived, academic example to demonstrate a very specific problem. Instead of addressing how the specific implementation causes problems, you attempted to generalize it beyond the scope of the issue - including using a clickbait title like "Promises are Memory Unsafe".

No, Promises are NOT memory unsafe and that has been shown time and time again in this thread. In fact, your example isn't even memory unsafe - it's just a fucking infinite loop that causes the program to run out of memory. The exception is thrown because JS can't safely handle memory after it's out of usable memory space.


People are upset with you because they expected you to actually demonstrate how Promises as a whole suffer from a serious memory problem. You didn't and people called you out. You somehow decided that the best approach was to double down on your flawed argument and attack people for criticizing your approach.

-1

u/alexelcu Oct 11 '17

I replied in kind to all technical arguments and added extra explanations where possible, given the limitations of a forum and the time available.

Your argument has a logical inconsistency ... either my linked Funfix is proof that the leak is real and that a fix is possible, or it is not. I also added the following links to that article, for completeness sake:

Now if you have actual technical arguments or opinions, that you can express politely, then we can have a dialog.