by wtdata · 7y ago · 0 comments
Yesterday I finally put time aside to port some stuff I have been doing in Python to Julia.
1st: install Julia - used a snap on Ubuntu, fine
2nd: get jupyter to work with Julia: a bit complex, but achievable
3rd: install Julia support for vscode: Julia kernel keeps crashing in vscode
4th: Port a routine from Python to Julia: some nice language features, some scary: importing a package exposes all its functions to the all namespace - this seems quite awful! (EDIT: Thank you for pointing out that I should use `import` instead of `use`, in order not to put everything in the same namespace).
5th: Try to read a Parquet file - doesn't work because it was compressed with zstd (something all 3 libraries for parquet in Python support)
6th: realize that there is no package in Julia that even allows to write parquet files
Conclusion: maybe in a few years Julia will be my go-to language, but right now, it's too underdeveloped in order to be able to do real work with it.
When doing `using SomePackage` it only imports the names that are explicitly exported by `SomePackage`. Even collisions don't cause problems very often because exported type names tend to be fairly unique and when two packages use the same name for a function, there's a strong chance it's actually the same generic function shared between the packages so there's no collision. When that's not the case and the name is fairly generic, e.g. `connect`, then it's quite common to use the API as `SomePackage.connect` rather than as just `connect`. This is quite a bit different from class-based object-oriented languages, so it takes a little while to get used to.
The issues with Parquet files are likely to get sorted out in the near future (a few months), so try again soon.