new to Julia

236 views
Skip to first unread message

Rahul Rai

unread,
Dec 17, 2013, 8:31:30 AM12/17/13
to juli...@googlegroups.com
Hello Everyone

I am new to technical computing using Julia .

I come from a kernel development background.

I was recently doing this tutorial at

http://forio.com/julia/tutorials/advanced/tutorial1.html


And in that I read the following paragraphs

We precede the definition of a constant with the keyword const, which instructs the compiler that this variable is immutable. It also treats the constant as a global variable, without the performance hit you incur by using globals


Since julia is implemented in C , what I would like to know is how does it achive that.

Would someone point out to the specific C files which implement this Julia features.



Thanks A lot






Stefan Karpinski

unread,
Dec 17, 2013, 11:02:27 AM12/17/13
to Julia Dev
I think you misunderstand the way Julia works. You are not running C/C++ code when you run a Julia program. Rather, C/C++ code uses LLVM to generate machine code which is what you are running. The fact that a global is const is implicit in the generate code, which may assume that the value (and type) of a constant global will never change, allowing it to avoid re-fetching and checking const values all the time.
Reply all
Reply to author
Forward
0 new messages