Comments (3)
A long list of lines in jslib.js
that use vanilla arrays as lists you say? Why of course I have that!
193 - used locally only
235
281 - used in websocket only
374
411 - used in websocket only
424 - used in websocket only
525
719ff
752
908
925
931
935
952ff
1016
1066ff
1084ff
1096ff
1207ff
1321-1378
1392ff
1400ff
1445 - an especially weird one
1483
1490ff
1501ff
1616ff
1713
1791
1798ff
1810ff
1903ff
1933ff
1941ff
1964-2033
2136ff
2266ff
2362
2385
2438
2460
2587ff
2690-2691
2697
2773ff
2843ff
2955ff
2973ff
2994
3017
3050
3088ff
3273
3367ff
3799
3811
3821ff
3890ff
3160-3182 - uses the lsList
from links.
I've had the chance to look into this a bit.
Chanigng the translation of lists in irtojs.ml
is easy. However, there exist two flavors of head and tail functions in jslib.js:
_lsHead
and _lsTail
act on linked lists, whereas hd
and tl
act on JS Arrays.
There are also other functions like min
and max
that act on JS Arrays in jslib.js
.
However, changing these functions to operate on linked lists breaks all kinds of existing code, since the existing code passes JS Arrays to them. Together with Thomas I've had a look at where those JS Arrays come from (since after adapting irtojs.ml they do not (should not) come from translated IR code any more). It seems like they are created in many places in jslib.js, for example in the code dealing with events and XML. It's quite difficult to identify all the places where those lists are coming from, for example if lists are passed around as messages.
In addition, it may be desirable to continue using JS Arrays internally in some parts of jslib.js for the sake of performance, .e.g. when dealing with XML. It would then however be necessary to carefully document which functions in there use JS Arrays and which use linked lists.
Thus, should I try to do a full code review of jslib and identify all the instances where JS Arrays are created? I see no other way in order to get this task done properly.
from links.
Doing a thorough code review and rational redesign sounds like a good strategy to me, and a good way of learning (a substantial part of) the code. (This is also the case for several other parts of the code I can think of.) I think Sam, Daniel or Thomas know more about jslib and irtojs so their advice would be helpful regarding how to proceed.
from links.
Related Issues (20)
- Unbound effect variables in type aliases when effect sugar is enabled
- Incorrect resolution of shadowed names in mutual blocks HOT 2
- "flat" and "nested" kinds for query results
- Lens refactor HOT 2
- Kind inference
- dateToInt -> intToDate does not roundtrip depending on time zone HOT 3
- Interaction between session-typed communication and effects is broken even without multi-shot continuations
- Incomplete rows can trigger an internal error
- Some questions about your work :) HOT 3
- REPL prompt disappears HOT 5
- "opam install links" doesn't produce linx executable in Ocaml 5.0.0 HOT 8
- Restriction of using row polymorphism for the effect system
- Recent versions of ppx_sexp_conv cause warnings in lens code
- Untypesettable session types
- Implement delegatable channels
- Rename links-mysql8 driver to links-mysql? HOT 2
- SPARQL improvements
- ppx_sexp_conv creates code triggering warning 40 HOT 3
- Incompatible with OCaml 4.08 HOT 2
- Continuation cancellation hangs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from links.