atom-community / atom-script

:runner: Run ( scripts | selections | source ) in Atom
https://atom.io/packages/script
MIT License
735 stars 269 forks source link

Add support for MATLAB #231

Open dengemann opened 9 years ago

dengemann commented 9 years ago

... hope this is not a dupe.

erran commented 9 years ago

Does MATLAB have a CLI you can use to run? What commands would you use to run:

Oh and FYI not a duplicate. Lucky!

dengemann commented 9 years ago

@erran

from the command line you can do something like:

`matlab -nodesktop -r "run my_script.m; exit"``

Where matlab links to sth like "/Applications/MATLAB_R2013a_Student.app/bin/matlab" and is defined by the user.

dengemann commented 9 years ago

@erran and yes, the same mechanism can be used to run s code snippet.

`matlab -nodesktop -r "disp(1:10); exit``

dengemann commented 9 years ago

... finally support for running ipython scripts would be amazing (.ipy extension). These allow you to run all sorts of things from one file. Obviously this can be hacked by editing setting the python command to ipython. An extension based approach would be nicer though (don't deal with environment variables).

dengemann commented 9 years ago

How is the language / script support handled. Could you point out a few locations in the sources to me?

erran commented 9 years ago

@dengemann Is there a language plugin for IPython? Script "runners" for grammars are defined in grammars.coffee. For example Python, defined by the language-python package, is defined here:

  Python:
    "Selection Based":
      command: "python"
      args: (context)  -> ['-c', context.getCode()]
    "File Based":
      command: "python"
      args: (context) -> [context.filepath]
rgbkrk commented 9 years ago

Well, oddly enough I maintain the ipynb-language package and am an IPython developer. I could roll that into an overall ipython-language package if you like (for Atom to detect). Honestly though, I've never used a .ipy script. These are the ones that let you do %magics and !shell stuff?

rgbkrk commented 9 years ago

@dengemann care to open an issue for the IPython pieces?

rgbkrk commented 9 years ago

Also, @erran I love your animated GIFs.

dengemann commented 9 years ago

Well, oddly enough I maintain the ipynb-language package and am an IPython developer. I could roll that into an overall ipython-language package if you like (for Atom to detect). Honestly though, I've never used a .ipy script. These are the ones that let you do %magics and !shell stuff?

I'ts pretty useful for debugging and doing some dirty tasks easily. I use it for example when comparing python to matlab code. Or when combining command line tools with Python for data analysis.

dengemann commented 9 years ago

These are the ones that let you do %magics and !shell stuff?

Yes, exactly