Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think the Atom editor + Hydrogen plugin for running interactive Python sessions inline with the code is still unmatched by anything available in VS Code. This setup is what I migrated to when I ditched Matlab for the "scientific Python" stack, and I'm still here.

Multiple concurrent kernels, the ability to connect any .py file to any running kernel, sharing variables and imports across multple .py files, inline matplotlib output that persists on-screen and inline with the code even when running other code cells... the list goes on. I'm really fond of this setup. I use it daily--it's an essential component of my day job--and intend to do so for the foreseeable future. VS Code does seem to be the way of the future but there have just been too many friction points for me to leave Atom.



What’s preventing this from being done in VSCode? Other than it hasn’t yet?

I don’t think it ticks every box for you, but have you tried Jupyter Notebooks in VSCode[0]?

[0] https://code.visualstudio.com/docs/datascience/jupyter-noteb...


VSCode doesn't support an API to put outputs inline in the text editor. IIRC there have been longstanding feature requests for it but it would probably have a performance hit. The closest thing is having a separate output window on the right side


I don't think it's an API problem, because Scala Worksheets work in VSCode[0] (and in most editors actually).

[0] https://scalameta.org/metals/docs/editors/vscode/#worksheets


I think you're referring to the "inlay hint" API, which is different from being able to visualize any HTML in the current text editor, like Hydrogen is able to: https://cloud.githubusercontent.com/assets/13285808/20360886...


VSCode’s Jupyter Notebooks is slightly different from Hydrogen in that it’s basically a MarkDown document with executable code blocks (cells) in the text editor that show their output in the text editor.

Again, not exactly the same as Hydrogen but there’s definitely some overlap in use cases and VSCode’s Jupyter Notebooks is pretty good. You should give it a shot and see if it’s a viable replacement for what you were using Hydrogen for.

This showcases the UI a bit if I’m not being clear: https://code.visualstudio.com/learn/educators/notebooks


That's exactly my complaint though. I don't want to work in a notebook frame of mind. I don't want to have to demarcate `#%%` every time I run code (especially because you'd need to scroll down to put another `#%%` where the code you're running should stop.)

As I noted in a sibling comment, I wrote a quick extension [0] that makes this easier by automatically inferring code blocks, but VSCode Jupyter is lacking in other ways: you can't have multiple Jupyter kernels running at the same time and it doesn't show you runtime completions in the editor (necessary for compiled packages without type support).

[0]: https://github.com/kylebarron/vscode-jupyter-python


Is that not what Jupyter notebook support is about? I can run something and see the output below the code.


But with Hydrogen you could do that in a regular Python script without needing to create a notebook or think in terms of cells. There's an example of this in the Hydrogen readme: https://github.com/nteract/hydrogen#hydrogen-


I completely agree. For the last couple years I've used VSCode for everything _except_ interactive Python development because Atom + Hydrogen is just too good.

I'm giving VS Code + its Jupyter extension a shot for now. It's significantly worse than Hydrogen, but I tried to make it a little less bad with a quick extension to auto-infer code blocks [0].

[0]: https://github.com/kylebarron/vscode-jupyter-python


Same! I live in this ecosystem (Atom + Hydrogen python sessions) on a daily basis. But rather than for "science", i use it for devops productivity (scrape logs, query dbs, automate mitigations) and some low-key data analysis.

It's breathed life into my love for programming, given how easy it is to just start executing code (sometimes I just use it as a calculator app since it's that easy and accessible)

I tried VSCode's equivalent plugin, but the UX was nowhere near as nice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: