Julia for prototyping, compared to MATLAB?

Yes, because they are familiar with it. The code I often get, requires me to sit down with them and “be explained” what is what—something I feel is very inefficient (documentation ftw). I have actually started using EDF.jl for accessing MEG data (from your comment from a different thread :grinning:) and I’m starting to see how it isn’t inherently tabular.

1 Like

I am wondering if the community can help improve the Julia IDE options. Juno is good, but, as @jlperla said, it just cannot compete with MATALB. I saw that Juno is maintained by JunoLab as an open-source project in Github. Thus, is it too crazy to think about a Bounty to hire, let’s say, 3 full-time programmers for a year focusing on polish Juno experience?

I am thinking about it because to build a really good IDE without financial support seems very, very unlikely. People tried in the past to create simple text editors (like Oni), and struggled a lot to make something good without financial support.

Finally, IMHO, the “fear” to switch to Julia from MATLAB will greatly reduce with a very good IDE.

8 Likes

I never particularly loved the matlab IDE. I quickly switched to R and have found RStudio to be a lot better. But a lot of what has made RStudio good now is a lot of other projects that aren’t IDE specific. I honestly think that if we had the plotting ecosystem and Weave.jl in an ideal spot we could start making a killer IDE. Until then an IDE would just be a bunch of menus for people that are afraid to learn the commands for most stuff. If we don’t have the other stuff in place I don’t think we’re ready for that level of hand holding.

Edit:
This sounds a bit harsh now that I read it. I should add that efforts for this probably aren’t wasted. We can always use whatever comes out of an effort to create an IDE once we get all the other stuff in place. I just don’t think that it will make a difference for the people that are held up on an IDE until they can have it all

1 Like

I am not sure, people that install MATLAB are not afraid of the command line. They just want to install a package, open, and star to do their thing. However, I agree with you that a good, stable, fast, interactive plotting system must be available. Unfortunately, I am a user of PyPlot and have been away from alternatives since 2014 :smiley:, so I am not aware of the state of the other packages.

Only very specific parts of the Matlab IDE are particularly good, debugger, profiler, and plot interactions. The editor, for example, is badly out of date.

6 Likes

I like this idea and wouldn’t mind donating a few dollars for this. It would likely have to come from the Julia business side, and probably requires a permanent programmer to maintain and release bug fixes and patches.

3 Likes

Whoa, I had never tried the Plotly backend, but that’s exactly what I was looking for. Thanks!

1 Like

Used latest MATLAB last week. Just found out that the plotting infrastructure is no longer loaded at start-up. Hence, time to first plot is not that “great” now. It’s faster to use “PyPlot” in Julia!

5 Likes

Was about to comment on why I think Julia is far better than MATLAB for prototyping and read your answer, which is in-lin with my opinion.

I’d like to emphasize why it think so:

In MATLAB, when I develop a function, there’s always the following pattern:

Small function
MATLAB

  1. write a 1st version
  2. run it
  3. wait 45 seconds
  4. it crashes? Redo step 1-3

Julia

  1. write a 1st version
  2. run it
  3. wait 45 seconds (or higher due to compile time)
  4. it crashes? Redo step 1-3

Notice that it’s not better? Now comes the fun part. As your function/program/analysis grows, so does your codebase. Your initial function now becomes 2-3 or 10 new small functions. You’re now farther in your development so most of your initial calculations are in those functions and compiled (and debugged hopefully).

Now, you’re developping the last part of your code. Your development is now the following.

Large function(s)
MATLAB

  1. Continue to develop your program
  2. Run it
  3. Wait 600 seconds (it does not scale, unless you write functions in a compiled language. While you might do this, I’m doing science stuff in Julia)
  4. It crashes? Redo step 1-3

Julia

  1. Continue to develop your program
  2. Run it
  3. Wait 60 seconds (while compiled and fast, your functions are still not free!)
  4. It crashes? Redo step 1-3

See? as your prototyping goes more complex, the prototyping waiting-time is (almost) constant! That’s the “Julia (almost) scale-invariance law” :tm:

9 Likes

Fellow neuroscientist here, long time Matlab user and trying to switch to Julia as my daily driver. I’ve been thinking about trying to implement a Neurodata without Borders interface for Julia as a forcing function for myself to switch. Would be ideal to use the metadata provided in the datasets to construct the appropriate data structures annotated with units, probably using AxisArrays or DimensionalData. Let me know if you’re interested in chatting about how to go about this!

6 Likes

I am also a neuroscientist, and switched to Julia years ago(since v0.3) and never went back. some of the hardware related data parsing is constrained by the vendor using MATLAB libraries. but most of the data analysis(EPhys, 2p imaging) are now in Julia.

I am also successfully convinced a close colleague who is also a long time MATLAB user to switch. now we are working together on a neural single analysis package.

The pros and cons of MATLAB and Julia have been explained by many in this threads. so I guess you just have to read, learn and use more Julia, then you will grow the confidence about the language, ecosystem and the community.

7 Likes

I’m currently waiting for NeuroCore.jl to register. It’s intended to be a common interface for neuroscience data. I have been playing around with as many corner cases and concise documentation examples so it’s in good shape to help people build on. I need to fix some stuff once it’s released so it’s more friendly for people to develop on top of, but then I’ll be in super documentation and bug squashing mode with it.

Feel free to raise issues in NeuroCore for how to interface with it or just to get my attention for a neuroscience package you want to collaborate on. It’s all in the JuliaNeuroscience organization so that we can put neuroscience tools in a more central place if beneficial (I’m not saying everyone needs to give up ownership of packages to JuliaNeuroscience if they want to collaborate).

5 Likes

Would love to hear more about this: we should all discuss this on the #neuro on the julia slack channel! Haven’t seen any activity there, so this would be something nice to start of the conversation.

This is precisely why I was really frustrated with MATLAB during the final stages of my masters thesis. I had these terribly long scripts with long waiting times.

That’s not how I develop Julia code. I usually

  1. create an empty package using a template,
  2. activate it,
  3. start test-driven development, working on the code and the tests at the same time.

I rarely ever experience compile times longer than 2s (on a puny laptop, thanks to the amazing Revise). If I have to work on large data with long runtimes, the first thing I do is create a small mock dataset generating function for the unit tests. Just to clarify: I use this workflow for anything nontrivial that does not end up in a public package, not just for libraries.

I think that it is advantageous to recognize from the very beginning that Julia requires a different workflow.

Trying to use it like Matlab or R is like peeling carrots with a flathead screwdriver: technically possible, but immensely frustrating and a waste of a good tool.

18 Likes

I totally agree with this (at least when compared to MATLAB)—and this is primarily an issue with people who aren’t experienced with programming and want a MATLAB to Julia “cheat sheet”. I feel a lot of tutorials make a similar mistake, essentially showing “how Julia can do what matlab can do” with the same workflow.

3 Likes

They shall not go wanting.

2 Likes

Are you using PkgTemplates.jl for the templates? Or do you have your own? I switched from R to Julia and have not figured out a work flow yet. At the moment I keep a module in a sub folder of the project and include and load it (thanks for the revise hint). This way I can keep the module and the analysis in the same folder in one git repository. My understanding is that Julia has a dev folder in ~/.julia and keeps user packages there and therefore not in the same repo. Do you have any suggestions for source control of projects that have a module + a notebook or file to create the actual output? Or is this entirely the wrong way to go with Julia?
Thanks!

1 Like

For projects, I keep runtime code in the script/ directory of the package, and have a results/ folder for the output, but since this does not really matter you are free to do what you like.

4 Likes

Thanks! I’ll check that out. :slight_smile: