Earlier quoted context omitted.
Frankly, Julia is a young language, so these things have yet to materialize. Also, for those that really do want it, the Julia package mirror is one of the few products that the company behind Julia sells as part of JuliaHub. It is inconvenient though that it doesn't fit in with the rest of the languages in Nexus.
Isn't julia hub still remote? You can't install it on an airgap or behindnyour firewall on your own equipment can you?
Test for lists in Cython
101–110 of 147 posts
Re: Test for lists in Cython
#102Earlier quoted context omitted.
Those who are attached to the class-based OOP model used, for example, in Python will find the dot notation more natural. But Julia’s multiple dispatch is a superset of this, and unarguably more powerful and flexible. Python OOP leads to monstrosities like >>> ', '.join(['1', '2', '3']) '1, 2, 3' >>> '1, 2, 3'.split(', ') ['1', '2', '3']
That's not a failure of OOP, but a failure of design. This could have easily been avoided if `join` would have been a method of the list object, not the string object. But we're stuck with this now.
Maybe it would be better as a standalone function. But then you'd either have to import it or it would pollute the global namespace.
Other OOP models offer different solutions.
Re: Test for lists in Cython
#103Earlier quoted context omitted.
As I’m clearly missing the bigger picture, what do you find to be super offensive about this? I read the first as the concat symbol applied to an iterable leads to string concated by the concat symbol. I read the second as an iterable broken by split symbol leads to an iterable of the chunks.
It’s hard to remember what order to put things in, because the two methods follow opposite conventions. And that’s because this type of OO design has no obvious method of organization. In the first case, I want to do something to a list: join it into a string. So, clearly, I need a list method? But no, I need to engage in some form of indirection; for some reason, I need to reach for a string method. Even if there is…
Re: Test for lists in Cython
#104I don't know if this particular benchmark transpiles correctly or not, but it should be possible to achieve much speedup if you annotate your python code properly.
https://github.com/adsharma/py2many
Looking for help with open issues.
Re: Test for lists in Cython
#105Rust doesn’t need to copy the data. It’s trivial to pass e.g. Numpy arrays to Rust as slices via Cython (let alone originating in Cython!), modify them, and return them, or use them as input for a new returned struct. https://github.com/urschrei/simplification https://github.com/urschrei/lonlat_bng https://github.com/urschrei/pypolyline Each of those repos has links to the corresponding Rust “shim” libraries that pro…
Re: Test for lists in Cython
#106Re: Test for lists in Cython
#107Earlier quoted context omitted.
That's not a failure of OOP, but a failure of design. This could have easily been avoided if `join` would have been a method of the list object, not the string object. But we're stuck with this now.
If join were a method on lists then you wouldn't be able to use it with other iterables. Putting it on str is more useful, if more confusing. Maybe it would be better as a standalone function. But then you'd either have to import it or it would pollute the global namespace. Other OOP models offer different solutions.
Re: Test for lists in Cython
#108py2many doesn't care which language is faster as long as the source language is annotated python3. I don't know if this particular benchmark transpiles correctly or not, but it should be possible to achieve much speedup if you annotate your python code properly. https://github.com/adsharma/py2many Looking for help with open issues.
produces
Re: Test for lists in Cython
#109Re: Test for lists in Cython
#110Earlier quoted context omitted.
It doesn't have named types on which methods get dispatched?
Yes, but those are not classes, in the sense of Python or other OOP language classes.