Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Obviously that question depends on your motivation, but one good reason is that it is a great way to learn how software actually works.

R makes it very easy to see the underlying R code (you just type the function name), until you get to a ".Call" or ".Primitive": from that point, it is effectively a black box.

But as most of Julia is written in Julia, you can easily inspect and understand how functions work, all the way down. Moreover, by using the @code_* macros, you can also inspect the various stages by which the code is transformed from high level Julia code down to the actual machine code which is running on your computer.



sort by: page size:

Today I used it to convert a non-trivial function from Julia to R because I wanted to use a certain R package for a project.

On top of what else has been said: you can call R from within Julia with almost negligible overhead via RCall.jl[0], so you can still use code you have already written.

https://github.com/JuliaInterop/RCall.jl


Hmmm... this seems to be an odd first impression.

There is the use of @ (but to signal macros), but otherwise, the syntax is much closer to a cross between Python and matlab except nicer for doing math.

I tried writing a few programs in Julia and got sucked in by how effective it is. The real surprise is that just a few weeks in instead of pulling up R to do a quick calculation my fingers decided they wanted Julia.


This (metaprogramming, macros, language as a datastructure in the language)is why I learned Julia, but R + R-studio still draw me back by being just so useful.

Is there a succinct rundown of differences between Julia and R? As in, why would you use one over the other. Thanks!

I know R and have used Octave. I started learning Julia this morning after a physicist recommended it to me after he switched from python. I used Jupyter/Julia to simulate a neuron as a practice exercise. This is my experience as a beginner:

1. The static typing makes a big and positive difference. Its nice having a statically typed repl.

2. The documentation is good.

3. Using unicode symbols and \mu style tab completion is nice, especially in Jupyter where you can use the same symbols in latex style equations.

4. The base install is a bit bare. It would be nice if batteries were included - distributions and dataframes in particular.

5. R uses 1 based indexing and it was no shock to see this in Julia.

6. I had no problems with the mix of lisp and C++ in the source code. The lisp implementation is beautiful and worth a read.

Generally, I was shocked to see a blog post like this given that my first day with Julia was so positive.


What's the best way to use rr to debug Julia code atm? Or are you talking about debugging the actual language code in C?

No, nlopt. Why we could easy port from R to Julia as nlopt exists for both (its c)

I don't use Julia regularly, it's just an example of making it clear how the REPL is core to using Julia.

>the dependency on using the REPL

This is a feature for a lot of Julia's core audience (data scientists like me, who grew up with R).


I have yet to fully jump into Julia but it is one language that has impressed me for a while, and I've seen a good number of them that impress me but Julia has a few things that to this day I think back to like code_native() and how it returns assembly code for whatever you throw at it, might seem trivial to others and y'know you can do it with C too but it's still cool you can just do it.

Your description of it makes it very intriguing and makes me want to revisit it.


Interesting. Sensible. How possible/easy is it to use Julia libraries from e.g. python or R or C++?

I've been thinking about jumping on the Julia ship for a while. I like the LISP-like nature of R and miss its flexibility very much while working in Python (a language I also enjoy, but not particularly for data science). Julia, specifically its macro story and speed, fascinate me.

One of the things that still keeps me at bay is the JIT and the pre-compilation in general. It seems like it's still not very easy to actually compile a Julia library or an executable. There is PackageCompiler.jl, but my understanding is that it necessitates pulling in sys.so, which is some 130 MB in size, making it prohibitive for many projects.


> The thing that keeps me coming back to Julia is the ability to pipe

> Provides link to R.

Is there an example of this in Julia? I use R now, and every time I give Julia a shot I go back to R because of the insane TTFP. I don't use anything remotely close to big data, and the 90-120s compile times just to replot my small data (using AlgebraOfGraphics.jl in a Pluto notebook) just kill me.


There are over 1500 packages (pkg.julialang.org)in Julia now, with the ability to call Python and R, and any C and Fortran library written. Julia packages tend to be more Julian of course, and natural if you are using Julia.

I say most of the basic stuff is there, but a few things remain. What kinds of things are you looking for that Julia doesn't have?


Even if you don't like R, your can do the entire course with Julia/Turing, Julia/Stan or Python, the course github's page has a list of “code translations” for all the examples.

I have nowhere experienced more looking under the hood feeling then when I am using Julia.

The source code of the packages sit on my computer, I can (and sometimes do) modify it, and I can still compile the same function to SIMD or GPU.


The same with R. There's already the excellent JuliaCall[1] package, for embedding Julia code in R. Listed in the README are some R packages, using Julia code through JuliaCall.

[1] https://github.com/Non-Contradiction/JuliaCall


I'd love to switch to Julia, but I rely on a lot of packages that are only available in R (e.g. lots from http://bioconductor.org/). Is there any way to call R code from Julia?
next

Legal | privacy