4 ms·
Jose Storopoli (@storopoli): "I've made amazing friendships here, co-authored a free open access and open source Julia Data Science book with Rik Huijzer and La
by lmc 5y ago
Jose Storopoli (@storopoli): "I've made amazing friendships here, co-authored a free open access and open source Julia Data Science book with Rik Huijzer and Lazaro Alonso."
I just read this book. Every page was like, 'wow'.
A couple of questions I had afterwards:
* I saw the DateTime type, but it doesn't seem to have a timezone - how do you deal with timezones?
* How is it to work with async code?
* It's a garbage collected language, what are some techniques to avoid performance pitfalls due to that?
If there's other Julia programmers around, any answers would be much appreciated!
- cbolton 5y agoFor timezones the official[1] answer is to use TimeZones.jl. For async code Julia has "tasks" which are similar to goroutines in Go: they can be multiplexed on a number of OS threads for parallelism, and channels can be used to communicate with other tasks. The language provides some sugar to make some common things easier, for example to get the result of a long-running operation: # Make channel and pass it to anonymous function result = Channel() do chan # Anonymous function body sleep(5) put!(chan, "Done") end # Do stuff ... # Now get the result take!(result) When GC is a problem, the most common is to minimize allocations and disable GC at critical times. See [2] for a robotics example where some kind of realtime is required. The language provides tools to help diagnose allocations, and minimizing allocations is a popular sport in the community so it's easy to get help on that topic. Still, realtime is currently not where the language shines. [1] https://docs.julialang.org/en/v1/stdlib/Dates/ https://docs.julialang.org/en/v1/stdlib/Dates/ [2] https://ieeexplore.ieee.org/document/8793875 https://ieeexplore.ieee.org/document/8793875