3 ms·
You're right that there isn't a particularly strong emphasis on lazy data structures or higher-order programming in Julia's base library. They are, however, bot
by StefanKarpinski 13y ago
You're right that there isn't a particularly strong emphasis on lazy data structures or higher-order programming in Julia's base library. They are, however, both well supported and higher-order functions in particular are used in many places; Julia uses Ruby-style do blocks all over the place, and a lot of macros desugar to functional constructs. However, Julia's primary paradigm is multiple dispatch. For more details on that, you can check out this presentation I gave at Strange Loop this year:
http://nbviewer.ipython.org/gist/StefanKarpinski/b8fe9dbb36c1427b9f22 http://nbviewer.ipython.org/gist/StefanKarpinski/b8fe9dbb36c...
Functional style isn't something to embrace for its own sake. Lazy data structures, in particular, while elegant, require a very sophisticated compiler in order to have even remotely decent performance. Even with a sufficiently clever compiler, the performance characteristics of the resulting code tend to be extremely opaque and difficult to reason about. That said, sometimes it's a nice way to express things and it's quite possible to implement lazy data structures in Julia: see, for example, the Lazy [1] and LazySequences [2] packages.
[1] https://github.com/one-more-minute/Lazy.jl https://github.com/one-more-minute/Lazy.jl
[2] https://github.com/dcjones/LazySequences.jl https://github.com/dcjones/LazySequences.jl