Support priority queue!

For now, JavaScript does not support any data structure. If developers want to use data structure, they can only rely on community (eg. github). This is very bad.

The reasons are as follows:

  1. The data structure belongs to the basic function and has a wide range of application scenarios. It needs the support of the engine (eg. V8) to make it play faster, rather than using js to write it.

  2. Most developers will only choose the library by github star and have no time to see whether its implementation is correct and efficient.

I think we should gradually improve the proposal in this regard. His importance doesn't even need my explanation.

Let's start with the priority queue !!! Of course, the more data structure supported, the better.

1 Like

Hi @ttttttssssss

Were you imagining something similar to heap - npm ? Which is inspired by Python's heapq.

Yes. Heap and Priority Queue are one thing in principle.

So what do you think of the priority queue(heap) as a proposal?

I'm curious that no one commented on my posts. Is it because it's not attractive enough?

As far as I know, Java, Python, C++, Go are all supported, but JS gives it to the community library.

What are the use cases for it? What would an engine be able to do that a userland implementation couldn’t?