Hi -- I've only used Julia for about three months now, but I think it's
great; Thanks to everyone involved in its creation!
I've also accumulated a set of questions during this time that I'm finally
getting around to asking...
So first question: Are there plans to improve the messages related to
errors that occur while using macros?
Obviously error messages in general can be a difficult engineering problem,
but Julia's error messages related to macros are particularly problematic.
At one point I tried to catalog many different error scenarios, which I
collected here: Macro Errors
http://nbviewer.ipython.org/github/lilinjn/lilKanren/blob/master/crumpled-paper/julialang/JLangMacroErrorMessages.ipynb.
The notebook is perhaps a little too disorganized to follow completely,
but essentially it explores many different cases where, for example, the
reported line numbers don't seem correlated to anything useful (they are
just plain wrong).
Here is my explanation of why this is important to me. There are a few
packages that attempt to provide powerful macros that are meant to be a)
fairly general purpose and b) typically used to wrap fairly large
expressions (as opposed to, say, @show). Examples are @match from Match.jl
and maybe @as from Lazy.jl . So for instance, when I first came across
Match.jl, it seemed perfect for quickly writing simple interpreters or code
generators that used some subset (or all) of Julia's syntax. But
basically this ends up being difficult in practice due to the error
messages -- tiny typos generate opaque messages that make progress
difficult.
I've made a (somewhat feeble) attempt to understand what the issues might
be. As far as I can tell I don't believe it's related to optimizations
that happen during compilation. Rather the Julia macro system (very
nicely!) tries to mitigate hygiene issues by auto-gensym'ing (not sure
what else to call it) unescaped locals in the expression returned by the
macro. This is not an easy analysis and it happens in the bowels of
femtolisp, and somewhere in this process, the line number tracking/error
context information is getting garbled (I could be totally wrong about
this...).
The combination of theory of programming languages + numerical computation
+ systems-level core(e.g.libuv,libunwind) trifecta that is Julia makes my
heart sing, and making sure Julia remains much more than a better matlab
is very important to me, so, obviously I'd like to help fix things, but I'm
not entirely sure I know how to fix this particular issue. I'm curious if
others (the authors of Match.jl or Lazy.jl?) feel the same as I do about
this, and would appreciate any comments on the topic.
Cheers, nehal