# Converting strings of numbers to numbers?

**URL:** https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164
**Category:** New to Julia
**Created:** [May 26, 2018, 11:59am UTC](https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164 "2018-05-26T11:59:28Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 29, 2018, 5:40am UTC](https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164/21 "2018-05-29T05:40:45Z")

</div>

> [@chakravala](#):
>
> Therefore it is desirable to have a meta-method that selects the optimal parse method upon arbitray code parsing

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.

---

<div class="post-metadata">

### Author: ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)
#### Post date: [May 29, 2018, 10:17am UTC](https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164/22 "2018-05-29T10:17:55Z")

</div>

> [@Tamas\_Papp](#):
>
> _arbitrary_ code parsing

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?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [May 29, 2018, 12:18pm UTC](https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164/23 "2018-05-29T12:18:44Z")

</div>

> [@chakravala](#):
>
> 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.

[Previous page](https://discourse.julialang.org/t/converting-strings-of-numbers-to-numbers/11164.md?page=1)
