4 ms·
I like the idea, but it's seems a little premature to show it, since there's very little information. For example, what is the supported subset? Are there any d
by erezsh 5y ago
I like the idea, but it's seems a little premature to show it, since there's very little information. For example, what is the supported subset? Are there any divergences in behavior? (for example, are the dicts always ordered?)
Also, just wondering how modular it is. How hard would it be to add another target, say Javascript?
- adsharma 5y agoI haven't formally defined the supported subset. The 16 test cases, especially coverage.py should give you a sense. JavaScript is possible via python to dart to JavaScript. Adding another backend is easy, given there are 7 backends already. Are dicts ordered? Not by default. It should be possible to translate Python's ordereddict to one in the target language. Just mapping max/min was hard enough. In some languages max(1,2) produces a float!
- jpau 5y agoSmall note: Python's standard dict has been ordered since ~3.7 E.g. https://mail.python.org/pipermail/python-dev/2017-December/151283.html https://mail.python.org/pipermail/python-dev/2017-December/1...
- adsharma 5y agoLooking for feedback here. How many programmers actually know this and expect it? Is it worth the extra complexity when translating to static languages which don't provide this guarantee? From an implementation perspective, doing it for the ordereddict special case is much simpler.
- deleted 5y ago[deleted]
- erezsh 5y agoI think you can get away with keeping it unordered for 95% of the code. But the remaining 5% are going to fail in very confusing, and possibly inconsistent ways.