Julia does not have a method for arbitrary code parsing in the standard library — just for Julia code
But parsing code is fundamentally different from parsing numbers, even if the former does involve the latter. For the original question, invoking the Julia parser is definitely overkill.
Yes, sure, arbitrary Julia code, although many other parsers have been written in Julia too.
It’s a slightly different question, but still fairly related to the OP’s topic. It would be overkill for that situation, and wasn’t offering it as a solution for that. It’s more of an open ended question to see if optimization is possible.
The 400x speed difference can surely be improved in some way for situations like this, cant it?
I don’t know, depends on how you define “in some way”. The parser is constantly being improved, and I am not sure there are any obvious low-hanging fruits.
Also, having to parse Julia code (from strings) is kind of a rare use case outside Julia reading code. Metaprogramming encourages the construction of ASTs directly.