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

0

u/[deleted] Oct 11 '17

[deleted]

-9

u/alexelcu Oct 11 '17

All loops in functional programming are expressed as tail recursions, or as folds that are implemented with tail recursions, because otherwise there's no way to express them. And classic loops are inadequate for expressing algorithms involving asynchronous calls, being error prone.

This is not a narrow, edge case, having started with lambda calculus in 1930. It's only an edge case when your tool of choice doesn't support it.

Hence my Stockholm Syndrome joke is really only a half joke ;-)

0

u/[deleted] Oct 11 '17

[deleted]

3

u/alexelcu Oct 11 '17 edited Oct 11 '17

It is an edge case to keep around a 2,000,000 promise long chain

The issue is that the implementation should not keep around 2,000,000 promises, being the problem we are talking about. Please re-read what I wrote, because I don't want to keep repeating the same words.

As for why this is an issue, I'm also a little out of breath explaining why, tried to do that in a comment here.

If this is a bug in the implementation ... you should just report it to the v8 team

This isn't an issue with V8, since Firefox has the same behavior, but an issue with the standard.

If it's an issue in the spec you should point out the flaw in the spec and start a discussion about how to fix it.

I was under the impression that I'm doing just that and I'm showing you the solution as well.

you write an article attacking what's become a fundamental part of JS for the purpose of promoting your own library

Well, those of us that are building libraries, we like talking about it. I'm sorry for contributing stuff, I really am, it's a reward-less activity.

It's toxic and my issue is that it does nothing to help anyone except you.

You're attacking me for no reason. My critique was for a piece of technology, yours is personal.

0

u/[deleted] Oct 11 '17

[deleted]

11

u/alexelcu Oct 11 '17

So I should just be an angry man that complains about what other people do, but that does nothing about it?

Personally I prefer to show and tell, to build and deliver alternatives and to talk about it. That's not a "scumbag thing to do" in my culture, even if I were to do this for money, which I don't, this being on my own free time and at personal sacrifice.

What about calling people scumbags? Is that appropriate for this or any other community?

We have nothing more to talk about. Have a great life.