You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think the List type is being used correctly in ecma-sl. Currently, in ecmaref6, there are only 19 uses of hd and 22 uses of tl, whereas l_nth has 382 uses. Additionally, l_add has 105 uses, whereas l_prepend has only 6 uses. This indicates that we are consistently iterating over linked lists to access and add values to this type.
Alternatively, we could use the ecma-sl arrays more. However, having a fixed-size array in ecma-sl doesn't seem to be very useful, as array operations only appear to have 15 uses in total in ecmaref6.
For this reason, I think we should consider implementing Lists as dynamic arrays using the Dynarray type from OCaml 5.2 to address performance bottlenecks. Additionally, we could eliminate the Array value from ecma-sl, which is rarely used in practice.
I've always had a problem with ECMA-SL arrays, as they rarely seemed to be used (primarily for byte operations, if memory serves me correctly??). I think there was even a point back when I stated to work in this repo where arrays weren't even accepted by the ECMA-SL parser. I'm ok with this change specially since performance is a big issue, but we should check Array/List uses within the JS standard so that we don't start deviating too much from it.
I think so, arrays are so rarely used I don't even know 😅
Yeah, I'd also like to do this in a way that there is minimal impact to the current ecmaref's interpreter code so that we remain as close to the standard as possible.
I don't think the
List
type is being used correctly in ecma-sl. Currently, in ecmaref6, there are only 19 uses ofhd
and 22 uses oftl
, whereasl_nth
has 382 uses. Additionally,l_add
has 105 uses, whereasl_prepend
has only 6 uses. This indicates that we are consistently iterating over linked lists to access and add values to this type.Alternatively, we could use the ecma-sl arrays more. However, having a fixed-size array in ecma-sl doesn't seem to be very useful, as array operations only appear to have 15 uses in total in ecmaref6.
For this reason, I think we should consider implementing
Lists
as dynamic arrays using theDynarray
type from OCaml 5.2 to address performance bottlenecks. Additionally, we could eliminate theArray
value from ecma-sl, which is rarely used in practice.Tagging for discussion @andreffnascimento @j3fsantos
The text was updated successfully, but these errors were encountered: