monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Collections should support subguards on .diverge() #191

Closed MostAwesomeDude closed 5 years ago

MostAwesomeDude commented 7 years ago

E has a very nice feature where guards can be passed to .diverge/0, forming a .diverge(guard) (or .diverge(keyGuard, valueGuard) for maps) idiom. As expected, the guard is used to coerce elements of the collection when they are inserted.

In addition to the obvious benefits, there is a massive speed boost waiting for us if we use collection strategies to speed up certain common situations like l.diverge(Int) by unboxing elements internally. This may require getting hands dirty with the JIT.

dckc commented 7 years ago

Well, the massive speed boost part is hard, but the feature itself is not, is it? Maybe make the hard part its own ticket?

MostAwesomeDude commented 5 years ago

FYI the change from .diverge() to .diverge(Int) in the montstone benchmark is worth a 4.8x slowdown.

dckc commented 5 years ago

I made a ticket for the hard part #202

I suggest closing this. Well done!