Archive

Archive for November, 2015

Julia Programming Language

November 22nd, 2015

Recently I’ve been looking into Julia, below are my somewhat random jumbled thoughts so far. I’ve also put together a function listing for julia that should help beginners. I should mention upfront that I actually really like the idea of Julia and that it has a lot of promise.

1. The long time taken for packages/recompilation is annoying and it failed on me a few times.

2. It just annoys me that the index starts at 1 - different than most other languages.

3. One of the most successful modules in python is pandas. Why not take this further and make DataFrames a full part of julia i.e. Make nulls, dataframes and DataArray the builtin for all vectors. If julia is going to be for manipulating data, there are always going to be nulls. Why have the duplication between julia arrays and DataFrames, make them one and the same.

4.Has a number of builtin functions that duplicate functionality available in just as short a form:


fill(0.,3)
zeros(3)
ones(3)

They add little and pollute the global namespace. Ken Iverson gives a wonderful talk on reducing a language to the minimal core here:
https://www.youtube.com/watch?v=8kUQWuK1L4w

5. There are many small bugs, inconsistencies and irritations such as:

Should super()/subtypes error on anything? because it does.


julia> super(bb)
ERROR: MethodError: `super` has no method matching super(::Regex)
julia> subtypes(bb)
ERROR: MethodError: `subtypes` has no method matching subtypes(::Regex)
julia> super("2")
ERROR: MethodError: `super` has no method matching super(::ASCIIString)

cd silently fails and isn’t cross platform.


julia> cd("/temp/")
julia> homedir()
"C:\\Users\\DAVE"

It should at least throw an error. Even better would be if julia supported forward slashes regardless of platform. Ensuring julia scripts are cross platform.


run(pipe(`echo world` & `echo hello`, `sort`))

The run command is weird, not like other languages at all. It uses backtick to enclose the command, supposedly to allow easy copy pasting
but what’s the point of that when you cant use piping within a single command, so you will need to break out each command separately anyway. Rather than this string interpolation I could just have used join() myself and have less surprise. This interpolation will also possibly cause issues with user entered commands. (A bit more browsing reveals there is a significant number of people find this a more powerful technique)

Writing to a file isn’t visible. This is very non-intuitive:


julia> f = open("a.txt", "w")
IOStream(<file a.txt>)
julia> write(f, "hello!")
6
julia> readall(f)
""
julia> f = open("a.txt")
IOStream(<file a.txt>)
julia> readall(f)
"hello!"

If possible I’d prefer not to have to even specify “w”, rather when its used by a function,
depending if its read or write, those functions handle the underlying details.

Uncategorized