Is Julia's workflow like R's?

So I frequently hear that Julia is supposed to be interactive, where you work mostly in the REPL:

Julia’s REPL provides rich functionality that facilitates an efficient interactive workflow.

The most basic Julia workflows involve using a text editor in conjunction with the julia command line.

It used to be the weirdest thing to me, since I kept using the REPL literally from the terminal. So I quickly switched to Jupyter and Pluto notebooks for Julia development.

Recently it struck me that R is used “from the REPL” too: in RStudio, you write code in a file, Shift+Enter to run a block of code and observe results either as plots or as printouts in the bottom panel. However, the bottom panel is the R REPL! Shift+Enter simply dumps lines of code in there, so working in RStudio is working “in the REPL”, all the time. Right?

The Julia VSCode extension lets me do the exact same thing:

  1. Write code.
  2. Shift+Enter to evaluate an expression.
  3. The code I want to evaluate is dumped into the Julia REPL and then executed.
  4. Observe results as plots or printouts. I even set up the same editor layout as in RStudio: code to the left, plots to the right, the terminal is the bottom panel.
  5. Rinse and repeat.
  6. Profit!

The main benefit compared to working in the terminal is that you have a Julia file where you write and evaluate your code. You get language server support, highlighting, and the code is automatically saved. I mean, this is a full-fledged IDE, so tons of features.


Is this comparison with R and RStudio valid? Is this an efficient way of using Julia, besides notebooks? I feel like this is exactly what the Julia VSCode extension was made to support.

This seems to work well for “exploratory programming”, where you write random code to test out ideas. Equipped with this workflow, I’ve just spent two full days designing an API for a future package, and it was kinda fun and I actually made a lot of progress with relative ease, for the first time with Julia and a text editor. …even though I’ve been writing Julia in the terminal and notebooks for about two years now, so I’m not exactly new to Julia itself.

1 Like

Yes, this REPL+IDE workflow is indeed very typical for Julia. And for R+RStudio, and for Matlab, and for Python+Spyder. It is my preferred workflow for Julia.

And you are correct to contrast it with the notebook style. Which is popular in Julia+Jupyter, R+Jupyter, Python+Jupyter, and Mathematica.

I would also like to point out that there is a (arguably) better form of the notebook style: reactive notebooks, like Julia+Pluto and JavaScript+Observable.

Just for completeness: Sage is also notebook style and Maple is more of an REPL+IDE style. And the VSCode jupyter plugin provides for a mix between the REPL+IDE and notebook styles.

4 Likes

It’s pity that julia doesn’t have a IDE like RStudio or Spyder, VS Code with julia plugin isn’t suitable for scenario of data science.

2 Likes

and why? I find the three very similar…

1 Like

RStudio server features, run local/remote background jobs, data connections, ets…

Agreed.

We use RStudio Server internally, and I’ve been looking at migrating some of the homegrown functionality to Julia. Personal preferences on my part aside, VSCode simply doesn’t fit in with the sort of remote workflow we have. Nor does Jupyter, for that matter.

I’d really like to see RStudio support Julia like it does Python, but that’s probably a topic for another forum. :slight_smile:

1 Like

Could you elaborate for the uninitiated? I am looking at RStudio Server - Posit and I am not sure I see something that I can not do with vscode or jupyter.

In vscode you can run julia REPL on a remote server and just connect to it. You can use standard unix users to do all user management.

In jupyter, especially with jupyter-lab, you can run jupyter on a server and access it remotely. It has some support for separate user permissions.

1 Like

What is JuliaHub missing?

1 Like

I think with RStudio Sever you can have easy in-house installation and for example link it with IBM SPSS Server/workstation, Phoenix WinNonlin ets… from one side and SQL DB from another, so you get core for enterprise DM platform.

2 Likes

I can certainly try…

The use case for us is primarily doing analysis and fault detection on customer
provided logs, which exist in a secure location. SSH access is sometimes less than
reliable, and using RStudio Server as a front end works nicely to sidestep that
problem. I initially explored it 4+ years ago for that reason, and due to frustration
in dealing with tmux or screen.

Another benefit is that I don’t have to have anyone install anything on their laptops,
as all they need is the standard IT issued web browser. (Windows didn’t always come
with an ssh client.)

For the bulk of the users, who are not programmers, RStudio Server serves both as the point
of entry, and as an interactive way to browse the data and do exploratory analyses,
once they’ve run the initial analysis script. The View panes are quite nice, and overall
it has shown itself to be easy to use for people expecting something like Excel as an
interface.

If they want to, they can also modify the generated reports (they’re saved as Rmd
notebooks) to change the existing analyses, add their own, or simply comment on what
they see (changing a Tidyverse pipeline is less intimidating than having to write a
“script”). These notebooks become living documents for the work on a particular case,
and this cuts down on repeated work if they need to escalate up the skill pyramid.
There are linux shells available as well, right in the UI. We keep everything organized
as “projects”, making flipping between “cases” quite easy.

There is a tiny minority of us who actually do code development, mostly me, and for
that I find that RStudio as an IDE is good enough. I’m just getting started
with Julia, and for that I’ve gone back to Emacs for now, which I run inside an RStudio
Terminal.

I’m not saying that this all couldn’t be well approximated with something like Jupyter, or
VSCode, only that for the end users, the barrier to entry would be a bit higher due to
“ease of use” and setup, both on their part and on mine.

4 Likes

What I was referring to here was something like the ability to “see” into the running Julia environment, like is now possible with Python using the Envrionment Panel. JuliaCall (R pkg) is something that might solve that for me, but I haven’t gotten around to working with it yet.

I may well be unaware of what’s possible with JuliaHub, but in our case we’re running the RStudio server ourselves, both inside of a private cloud and on in house hardware.

It sounds like you like the responsiveness of Rstudio’s web interface more than anything. I mean, Tidyverse is nice for low-tech users but I do think DataFramesMeta.jl gives it a run for it’s money.

Julia also supports Rmarkdown-style development in the form of Weave.jl.

It should be easy to run the entire instance of VSCode over OnDemand (not ssh) such that your users only need to use a web browser. You certainly can do that with JupyterLab.

1 Like

While I generally agree, I would be extremely careful when I say things like “should be easy”. In a lot of these situations the only solution that matters is the solution that takes the minimum amount of clicks, and a single extra click makes a solution exponentially less enticing.

1 Like

This is, afterall, Rstudio Posit’s main product (I would guess). So its understandable they put a lot of effort into the “last mile” problem.

1 Like

Yes, DataFramesMeta.jl is already on my short list of things to become familiar with, and I will look into Weave.jl, now, too, though my initial goal for Julia in this instance is to replace the somewhat slow back end “ETL”, which transforms the unparsable logs and stuffs them into parquet files. The front end analysis in the notebooks runs plenty fast, so was going to leave that to the existing R implementation.

I actually like the Tidyverse for that, since its primary purpose is to be a “query language”, both in the autogenerated notebooks and the REPL. Keep in mind that many of the users are, in fact, [relatively] low tech, and sometimes I feel that way myself. :slight_smile: The current user base seems comfortable enough with it to insert a filter, change a parameter, etc. in an analysis code chunk when they need to, which was the goal.

[I have seen some criticism of it, particularly with regard to NSE, but I’ve yet to have an issue with it. Maybe that’s because my initial programming “aha moment” was with MacLisp on a KL-10, I don’t know… :laughing: ]

I wasn’t aware of OnDemand before you mentioned it. Thanks for the tip! I started perusing the web site, and it looks quite interesting so far, and for more than just this purpose. Not sure whether I’d need VNC, which doesn’t always perform well in our env, but I digress…

Thanks again for the pointers

Rstudio (Posit) has now a new markdown “framework” called Quarto, it supports R, Python, Julia, and Observable.js. For me, it is the best tool to create a workflow for data analysis.

Take a look: https://quarto.org/

5 Likes

If you mean by “Tidyverse is nice for low-tech users” that it is easy for non-OO programmers or non-programmers at all, I agree.

Tidyverse is THE framework for data analysis for non-programmers because it brought, to some degree, a “functional paradigm” for R, and anyone in the world can understand functions (basic math) and basic system theory (Bertalanffy), from biologists to managers.

Maybe for that, tidyverse has been influencing Python dfply, siuba, tidypolars, Julia Queryverse and Explorer in Elixir, thank gosh!!

I know Julia has impressive packages for functional programming like Transducers.jl, underscore.jl, Chains.jl, MLStyle.jl etc.

1 Like

What do you have in mind? VC Code is for data science, and is (or can be) an IDE (for Julia, at least).

[to get started with Python], Microsoft recommends the following extensions:

[Then listing e.g. Jupyter (that supports also Julia) [and Azure Machine Learning] extensions. Julia can be used with Jupyter, and I don’t think it excludes the context of VS Code, nor is using it a strict requirement to fill the definition.]

Julia with or without VS Code [extension] is for data science.

Julia is commonly used in areas such as data science, machine learning, scientific computing

While [Microsoft’s other Visual Studio is an IDE, as opposed to] VS Code only a source code editor, I believe VS Code, with appropriate extensions, as in Julia VS Code extension (alone, or bundled ones, more needed?), is an IDE. I don’t see “IDE” mentioned for the Julia extension, and it’s a somewhat obvious term, not sure all agree on the needed features, so I checked what’s considered needed.

Going by:

Components of a Standard IDE

Code Editor

Compiler or Interpreter

[Check. Julia itself provides BOTH. Since there’s no separate compilation phase VS Code [extension] doesn’t need special support, but I think it may even support PackageCompiler.jl, if wanted needed as part of the definition.]

Debugger

[Check. I believe it’s there. Good enough?]

Syntax Highlighter

[Check]

Graphical User Interface (GUI)

[Check? VS Code itself is a GUI, not text-only [editor], also for thee debugger. Not sure something more specific meant here.]

Build Automation Tools

[Check. No need to build Julia code (only JLLs), and for such I believe supported, or if you need to build/make Julia itself.]

Now is it a good IDE, or with some specific features for data science? I’m not familiar with RStudio but it and Julia with VS Code have plotting, one thing that comes to mind. I believe RStudio is the best-in-class IDE for data science, so it may have some features other IDEs don’t have. What’s (the single-most important) such a feature?

The JSON Language server provides language-specific smarts for editing, validating and understanding JSON documents. It runs as a separate executable and implements the language server protocol to be connected by any code editor or IDE.

2 Likes

The variable view of VScode is so slow and in Spyder or RStudio, it’s so convenient. I hate to print or use head/tail again and again, and I need to adjust the max display option always.
What’s more, It always has some small bugs, probably because it is configured with various tools, so that it is not so stable

1 Like

Seems to not work for me, unfortunately. I run into this issue. Hopefully the quarto team can help me debug.

1 Like