Sublime Text 3: Worth a look!

Thank you very much, that looks useful.

I don’t know that anyone is actually working on a similar capability for Sublime Text that is currently available for Atom. :frowning:

With 2019a:

Your mileage may vary.

1 Like

@PetrKryslUCSD

I have 2019a version, and it doesn’t have code completion in m files. It has a new file extension called mlx, which provides some code completion, but it is too slow!

I haven’t seen reformat anywhere :thinking: It only has an auto-indent.

In terms of possibility for expanding the IDE’s features, I even wrote my own Atom package for Julia:

This is impossible for things like Matlab.

BTW, those were my experiences as a long-time Matlab user.

I do have SSD. Pretty regular to be honest (SATA based, no NVME).
If you read what I wrote MATLAB loads in 5-7 seconds on modern desktop computer (We’re back to the fact something is really limiting with your computer?).
I don’t know where you brought the idea MATLAB crashes, but again, I find many of your opinions to be far from mine. Later on I will close my MATLAB session (Running for 4 days) just for recording video to show you how much suffer it is to launch MATLAB. Great suffer.

Regarding Code Completion, try using Tab when you type even in MATLAB regular editor.
Also there is great linting and hints when calling functions.

MathWorks basically has stopped investing in the regular editor for 3-4 years and still I’d rather MATLAB environment to any development environment with one exception - Visual Studio.
In R2019b one can see they are in the process of moving the UI from Java Based to HTML based.
Probably when they are done (I’d say R2020b or R2021a) internally MATLAB will be Electron application with similar capabilities to Atom / VS in text handling with MATLAB’s great debugging experience.

While Infiltrator.jl is great addition, it is not a Debugger. It is a short time solution to the fast it is hard to create form the UI break points in scripts and functions. It literally states it is equivalent of MATLAB’s keyboard() and MATLAB doesn’t state keyboard() functionality is its debugging prowess.

You can add buttons to the UI. You can attach those buttons to a script of your own. On scripts you can have great control on the text editor. Look for posts by Yair Altman about this stuff.
You may be also be interested in MATLAB Editor Plugin.

I get we all love Julia. It is like everyone baby child and everything about your child is as good as it gets.
But snap out of it. Julia is young. Expecting it to be as mature as MATLAB or other competitors isn’t real. The progress and direction is good but competition is still ahead in those aspects. Trashing alternatives isn’t the way to go.

But anyhow, this thread is about the great work with integrating Julia into ST3. ST3 is really an exceptional and capable text editor so it is a great contribution to the eco system.

Update

Just for you, a video of launching MATLAB in 7 seconds while screen recording and having 2 Chromes each with ~30 tabs each, Visual Studio Code, MS Edge, Notepad++, SmartGit, Photoshop, CMD, Task Manager…

https://streamable.com/izdfj

By the way, This is on Windows which has slower Disk IO than Linux. On Linux it launches in less than 5.

2 Likes

Your Matlab doesn’t crash because you don’t do crazy things that are very easy to do in Julia. Try to run a SIMD openBlas C or Mex code inside Matlab, and you see it crashes right away.

Another example would be when you run code, the IDE gets locked! You can’t even open another file for editing unless you stop running the process. If you try to open a file, the process crashes.

Another example is trying to stop the running process, especially when using clusters. A lot of the time, it leads to a crash.

When you run the Matlab for the first time in a boot, it takes a lot of time. You opened your instance for the second time.
A quick loading benchmark on this system:


vs

Here are workflow and speed for writing a simple code! For me, Matlab isn’t that different from Notepad. :slight_smile:

I do crash Matlab lots of times when I’m working on MEXs.
I do crash Julia equally frequently when make it access C libs and I screw either on Julia or C side.
Those are not good examples to describe a system stability.

Fully agree with @RoyiAvital regarding the debugging experience experience in both environments. Only VS compares to the Matlab debugger.

3 Likes

I haven’t been able to crash Julia so far. But even if it crashes, it is 4 seconds away (considering worst-case MKL load time):
https://github.com/JuliaComputing/MKL.jl/pull/17#issuecomment-541317976

not 3 min.

With Julia restart button, I implemented in my packag, I sometimes just skip using Revise when I want to quickly edit something.

Crashing Julia due to bad memory access caused by users programming errors (ccall) is as easy as crashing Matlab for the same reason with MEXs.

matlab.exe -nodesktop takes less then 4 seconds to launch in my laptop, and with the full IDE about 8 seconds (R2019b). But that is not really the point.

2 Likes

Have been meaning to pop to thread and thank you @PetrKryslUCSD for your suggestion and guide.
Was previously working primarily in Jupyter notebooks and some in the REPL. Installed and used Atom for just a bit, but wanted something lighter re system resources. Did the ST3 setup a few weeks ago and it’s been great. Having never used a full IDE before, don’t even know what I’m ‘missing’ with this, but it’s meeting goals! Liking ST3 in general, a step up from NP++ and using for LaTeX editing as well.

Looking at setup notes, couple of points I ran into that could be useful for others:

Had some issue with package control install initially. Installed from Package control:
https://packagecontrol.io/installation
Package control has a script: copypasta and paste into console within ST3
Didn’t seem to work with the selection list, so downloaded locally from git. Put into the package directory.
First test run failed, as it was trying to find package ‘Julia-sublime’, but package directory name installed manually from the downloaded zip, was ‘Julia-sublime-master’.
Renamed this in package directory without the ‘-master’, and the test passed when “building” the file (ctrl-shft-b).

Editing the Preferences.sublime-settings file in USER directory …\AppData\Roaming\Sublime Text 3\Packages\User and removed the following from settings file:
“theme”: “Arzy.sublime-theme”,
(display was all wonky.)
Might be because Arzy package wasn’t installed? Not sure. Added:
https://github.com/rzProjects/arzy
https://packagecontrol.io/packages/Theme%20-%20Arzy

  • it installed to: ‘\AppData\Roaming\Sublime Text 3\Installed Packages’ dir as “Theme - Arzy.sublime-package”
    added to settings file:
    “theme”: “Arzy.sublime-theme”,
    “color_scheme”: “Packages/Theme - Arzy/Heliopolis.tmTheme”
    …and… NICE!
    gray sidebar now showing (was solid black previously, probably because no color theme called out, but it was in default settings with molokai or sumsuch.). Command pallet works (was behind text previously).
    The Heliopolis looks a bit nicer than the Olympus, darker gray in the panels.
    “color_scheme”: “Packages/Theme - Arzy/Olympus.tmTheme”
1 Like

On Windows, something as simple as typing lags in the Julia REPL, once you do using Plots. It’s quite awful, and it does not happen in any other language that I tried to use. And that’s after getting a package to download/compile.

Bonus points if the package you use has a dependency on WinRPM. I timed it, it literally is faster to fresh install Matlab than to do using Pkg; Pkg.add("WinRPM")

1 Like

Sublime Text 3 readily supports multiple terminals running Julia at different versions (0.7, 1.2, 1.4 dev, …). The instructions have been updated with the description of the “trivial” change to accommodate multiple Julia versions.

2 Likes

I followed your instructions and I seem to get it almost to work, which is nice. However, I start with a Julia file that just contains 1+1. I open through terminus Windows PowerShell and type in there Julia which starts the Julia REPL. Selecting 1+1 and pressing CTRL+Enter does indeed send it to the Julia REPL, however that is the result
image

Which I do not understand why it appears. Apart from that I followed all your instructions. Do you know where the error may be?

Thank you very much!

Set "bracketed_paste_mode": false in the SendCode package (since PowerShell and Cmd don’t support it).

2 Likes

That worked, thanks a lot!

My Matlab 2019b crashes at least several times a week, without any mex or any other fancy stuff. Just stops responding. It may, however, be my computer that’s the problem.

The Matlab IDE has a few strong points: debugger, profiler (which is pretty buggy on mac btw) and graphics integration. Aside from that it is really, really, bad. The editor is a stone age relic. It’s hard to fathom how someone can think it’s great.

I am pleased that Matlab are moving away from their legacy java integration, but by the time they are done, we have (fingers crossed) already moved most of our workflow to Python and Julia.

2 Likes

Maybe you split the Matlab vs Julia discussion in another thread?

9 Likes

Check out tabnine (ST plugin). As an autocompleter it is FANTASTIC! No dependency on LS (which is GOOD).

3 Likes

@PetrKryslUCSD Can you tell me more about Dragon + Sublime + Julia?

Here is the TLDR:
Run ST, open project
Run some code
Working with the REPL

If you want to find out more, pop me a message. We could do for instance an online meeting; that might be more effective than posting stuff here.

1 Like

One other note: if you use Revise.jl, you can change the Packages/SendCode/support/Julia - Source File.sublime-build file to say “includet” instead of “include”.

Would be nice to be able to check to see if Revise.jl has been loaded and choose between them accordingly. Dunno how you would do that. Or to have multiple build commands, one of which was “using Revise; includet(...);”, but not sure if that can be done either. Might be possible to create fictive file-types: regular Julia and Julia-under-Revise, so you’d have multiple build commands available depending on how you want to treat a given file. (Whatever, I guess you either use Revise or you don’t.)