Not an answer to your questions, but: you might want to keep an eye on (or try out) this patch exposing labels and gotos at the user level. It was developed by Daniel Jones for parser backend purposes, and might be useful for a regex engine:
https://github.com/JuliaLang/julia/pull/5699 (I believe it is going to be merged, just a question of when) On Thu, Jun 5, 2014 at 8:22 PM, andrew cooke <[email protected]> wrote: > in the docs it says that exceptions in julia are implemented using tasks. > > can i take that to mean that they come with a significant overhead? > > and do you pay for that overhead even if the exception is not thrown? > > in particular, what is the best way to handle errors in fairly tight loops: > 1 - exceptions > 2 - maybe types (ie unions with nothing) > 3 - (flag, result) tuples (result is not a union but you have a tuple to > unpack) > and does that change if the excptions are common (say, 10% of loops) or > rare (0.1%)? > > the reason i ask is that i am thinking of writing a regular expression > engine in julia (i know it already has an interface to pcre, but it might > be cool to have regular expressions over things other than characters, for > example). that needs an efficient inner loop, but is also fairly complex, > and i'm trying to sketch out how things might work. > > thanks, > andrew >
