
Show HN: Hydrogen Brings Light Table to Atom - willwhitney
https://atom.io/packages/hydrogen
======
ibdknox
This is very cool work. :) Great job Will!

When Atom was first launched I mentioned that it might make sense to port the
interesting parts of LT over to it since the core editor isn't what's
important (and it's also a _ton_ of work to get right). LT has found its way
into lots of projects, from the Chrome Dev Tools to XCode and IntelliJ, which
is a tremendous honor for us - it's great to see it coming to Atom as well.

~~~
willwhitney
Thanks for the support!

I've been thinking a lot about what makes for a good development experience,
and how to properly "factorize" an IDE to provide a consistent experience
across different languages. The monolithic IDE experience can be great (once
you get it set up) if all your work is in a single language. But for people
like me, having a confusingly different development environment for each
project is a nightmare.

This is a tiny step toward the dream of having a consistent core editor but
with powerful tools for each language that allow introspection into the state
of the running machine.

~~~
stuaxo
This is great, I've been thinking in a similar about something like this for
'visual debugging', for a livecoding tool.

It would be great if this could recognise some common image formats in memory
(cairo surfaces, PIL) and visualise those on mouseover.

Possibly similar for arrays - be able to visualise it as a wave or even
playback as audio.

Is there any chance of factoring out the support for the popouts? - It would
be great if this could appear in other editors.

~~~
willwhitney
I'd love to do live variable inspection (like the Chrome Dev Tools) — it's
something I'm thinking about for the future.

There's a (nascent) project called `jmp` (for Jupyter Messaging Protocol) that
implements kernel communication in JS:
[https://github.com/n-riesco/jmp](https://github.com/n-riesco/jmp). I'll
probably contribute to that and factor out my kernel communication.

------
mattdeboard
I don't understand how people use Atom for Python. Indentation in language-
python is broken.

[https://github.com/atom/language-
python/issues/64](https://github.com/atom/language-python/issues/64)
[https://github.com/atom/language-
python/issues/22](https://github.com/atom/language-python/issues/22)

There are also several syntax highlighting issues but those aren't deal-
breakers like broken indentation.

I'm sympathetic, I help maintain elixir-mode for emacs. I know it's hard to
get this stuff right. But all things considered, Atom is unusable for Python
for me. I was using it for working with JS & React but now that web-mode seems
to have ironed at many kinks, I'm back to Emacs.

~~~
chc
Python indentation in Emacs was awful for a long time too, wasn't it?

~~~
mattdeboard
Doesn't matter, it works now. This isn't a moral question about which project
has had the fewest bugs in their respective lifetimes. It's a practical
question about which mode gets auto-indentation right _right now_.

edit: I don't know the answer to your question. What I do know is that it's
really hard to get indentation right in Emacs for languages with significant
whitespace where new lines are the only marker, and I assume the same is true
for TextMate (which Atom piggybacks on for indentation). I'm not an expert on
emacs, emacs lisp or creating language modes for emacs, but I do have a decent
amount of experience[1]. So when I say I'm sympathetic I mean it down in my
bones.

But still, if an editor can't get auto-indentation right, it's a deal-breaker.

[1] [https://github.com/elixir-lang/emacs-
elixir/blob/master/elix...](https://github.com/elixir-lang/emacs-
elixir/blob/master/elixir-smie.el)

~~~
chc
Oh, I didn't mean it as a moral question or smack-talk or anything like that.
I was just noticing that Python seems to be neglected by a lot of editors. I'm
normally an Emacs user, but I gave up on it for Python because I had to spend
too much time fighting it on indentation, so I was kind of surprised to see it
mentioned in your comment and it made me think.

~~~
mattdeboard
No, python-mode works beautifully for me. There are a couple very minor
hiccups (I think there's some error with indentation after a method with no
`return` statement or some such) but it's not a deal breaker.

------
sherbondy
Congrats on the release, Will! This would make for a killer default env for
MIT's 6.815 course ([http://ocw.mit.edu/courses/media-arts-and-
sciences/mas-531-c...](http://ocw.mit.edu/courses/media-arts-and-
sciences/mas-531-computational-camera-and-photography-fall-2009/syllabus/))
(presently taught in Python). Also, ahem, I believe it is now time to JUPYTER
ALL THE REPLS.

~~~
willwhitney
I'm looking forward to that Elixir kernel!

------
jscottmiller
Nice work. Question for anyone using light table or similar environments on a
day-to-day basis: does this statement-by-statement eval and output scale to
larger projects? It makes a nice demo for contained scripts, in particular
those working with a concrete dataset (image, samples). I have trouble
imagining what it is like for larger, more abstract stretches of code.

~~~
willwhitney
I like to break my code up into little functions that are easy to test, so
that flow works well for me.

Even more powerful, though, is autocomplete from the running environment. It
means that (just like in the Chrome Dev Tools) when you start typing
something, the autocomplete suggestions include all of the valid names that
are defined. It really helps in navigating complex APIs like Torch:
[https://www.dropbox.com/s/e6hriw5quwct65a/Screenshot%202015-...](https://www.dropbox.com/s/e6hriw5quwct65a/Screenshot%202015-05-20%2016.37.51.png?dl=0)

~~~
nawitus
How powerful is autocomplete, when statically typed languages also provide it?

~~~
willwhitney
The development experience for statically typed languages is often _amazing_
compared to that of dynamically typed ones; we sometimes choose dynamically
typed ones anyway because of the flexibility and speed of development they
give. I'd be very happy with an environment that provided dynamically typed
languages the same analysis, checking, completion, etc that statically typed
languages take for granted.

~~~
espadrine
> _I 'd be very happy with an environment that provided dynamically typed
> languages the same analysis, checking, completion_

Thinks like tern.js[0] or my own Aulx[1] provide that with varying success.
Visual Studio's JS autocompletion is also stellar. The techniques used could
be applied (with tweaks) to most dynamic languages.

[0]: [http://ternjs.net/doc/demo.html](http://ternjs.net/doc/demo.html)

[1]: [http://espadrine.github.io/aulx/](http://espadrine.github.io/aulx/)

------
jarpineh
Yes! I like this very much. This is the favorite feature I used in LT (though
I've wished to delve more in its architecture), I never really got the hang of
external REPLs and browser sessions.

I recently tested Wallaby.js, which brings LT approach to testing. Now I
wonder if the logic in Hydrogen could be extended to call module's tests and
bring results just like the evaluation messages come. I think both immediate
coding and testing might make coding more intuitive and reliable.

Is there an Atom to Jypyter bridge or something? How does Hydgoren and Atom
communicate with Jypyter kernel?

~~~
willwhitney
Jupyter provides a spec for a ZeroMQ-based messaging API, which kernels in
each language have implemented. Hydrogen acts as a client to those kernels the
same way that the Jupyter frontend does, sending execution requests to the
kernel and displaying responses.

I'd love to see live test results in Atom too! It would make it so much easier
to be confident in your code's correctness.

~~~
jarpineh
Thank you. I managed to miss that when reading the first time. I'm currently
learning testing with the TAP protocol [1], which might be simple enough to
bring into Atom or Oxygen and also use in Jypyter languages. I know that
Python and JavaScript supports it.

Just had another thought. Regular Jypyter kernel supports multiple
connections. Have you tested connecting to Oxygen's Python kernel from
Notebook or IPython session? I'm thinking that console + Atom is nicer
environment for a coder than Notebook. Afterwards the session could then be
saved as a Notebook.

Anyways, I must now find time to dig into this! I don't like to leave my
editor just to look at code execute nor tests run, there is more than enough
context switching in programming.

[1]
[http://en.wikipedia.org/wiki/Test_Anything_Protocol](http://en.wikipedia.org/wiki/Test_Anything_Protocol)

------
lewisl9029
I have a question for those who are either still using Light Table or have
switched away from it:

I've been meaning to start a project in ClojureScript and was thinking of
using Light Table as my editor. I vaguely recall seeing news about development
of Light Table slowing down, but despite this, would you guys still recommend
Light Table today for Clojure/ClojureScript development? In its current state,
how does it compare to editors like Atom/Sublime and whatever other options
that are out there for Clojure development?

~~~
mattdeboard
I would recommend Emacs or vim. I know for sure that both of these have really
great development environments.

------
jinxedID
I wonder if they know their logo is also the Ionic logo?

~~~
gabeio
I feel like it's not/shouldn't be possible to copyright/trademark/etc an
element/element's atomic structure unless it's man made.

~~~
zyxley
But the copyright (if there is one in this case) isn't on the element, it's on
the specific visual interpretation of it for branding purposes.

~~~
gabeio
I still feel like that's basically "copyrighting"/or otherwise the atomic
structure of the element...

~~~
weego
A filled circle with a ring round it that has an intersecting filled circle is
not an accurate representation of how a hydrogen atom looks. It is an artistic
simplification. There are any number of ways of interpreting it.

------
bryanjos
That looks so cool! I'm not an Atom user anymore (jumped back to Sublime), but
this is the kind of thing that makes me want to jump back again. Wondering if
there is an equivalent for Sublime.

~~~
dethstar
There's plugins for different languages e.g RubyEval

~~~
wldcordeiro
SublimeREPL exists as well and it does a great job for many languages.

------
dimino
As recently as today I thought IPython might be worth looking into -- I've
heard too many good things about IPython to ignore it, but I didn't really
know how to get started.

I guess I don't have that excuse any longer! My only concern is that my mind
will have trouble adjusting to the evolving state of the "app" I'm working on
-- it seems like values in lines above others change, which then change values
at other places, not just below the code? Will take some getting used to.

------
ajtulloch
Awesome - and very cool to see ITorch getting some love. Thanks very much
@willwhitney.

------
philipn
For a vim version(ish) of this, be sure to check out vim-ipython:
[https://github.com/ivanov/vim-ipython](https://github.com/ivanov/vim-ipython)

------
rando3826
I clicked the link and then my browser (firefox) froze. Thanks.

~~~
rando3826
And it repros.

~~~
bronson
There is nothing questionable on that page. Check your browser.

------
RangerScience
What's the state of using this with non-Python languages?

~~~
willwhitney
I'm actively using it with Julia and Torch. It _should_ work with any Jupyter
kernel (and there are lots: [https://github.com/ipython/ipython/wiki/IPython-
kernels-for-...](https://github.com/ipython/ipython/wiki/IPython-kernels-for-
other-languages)).

In practice, different kernels have various oddities or holes in their
implementation of the spec. I'm accommodating them when I can and posting
issues when I can't. Let me know if you find a kernel that doesn't work!

~~~
bronson
Wow, that's a lot of languages!

How is the Ruby support? A Rails console in the file I'm writing sounds epic.
No longer would I need to clumsily suck the interesting lines back out of irb
history using copy/paste.

Looks active:
[https://github.com/SciRuby/iruby](https://github.com/SciRuby/iruby) I'll have
to try it.

~~~
willwhitney
I haven't tried the Ruby kernel - let me know how it works, and post an issue
if anything breaks!

~~~
bronson
Pretty dismal for now. :(
[https://github.com/SciRuby/iruby/issues/1](https://github.com/SciRuby/iruby/issues/1)

It looks like they got it working with python2, then the switch to python3
broke everything.

Hopefully in a few months the python3 version will work better than the
python2 version.

------
outworlder
I was thinking about the same thing yesterday! Glad to know it already exists.

My own Emacs feels... inadequate right know. But I guess something like this
could be done for it too.

------
knicholes
While this is very cool, it seems like this type of development supplants TDD
by running the intermediate results manually once and is forgotten.

~~~
saidajigumi
I find this a surprising reaction, just because for so many devs I've known,
it's common to keep a "sketchpad" interpreter open to mess about with code
ideas. And these are all dedicated TDD folks. Perhaps if the dev(s) in
question don't really understand TDD, but I think that's a cultural problem
rather than a tooling problem.

In my experience, "getting" TDD is about two main things. First, internalizing
what to test & why to test. (Fortunately, we've got a lot of help these days
on the "how to test" front.) Second, having that moment when having tests
makes your life-as-developer easier, or perhaps just _possible_. (Re:
"possible", I recently upgraded a mature, legacy Rails 2.3 app to Rails 4.2.
My blessings upon the devs prior to me who saw fit to create a comprehensive
and well-maintained test suite. Without that, there would have needed to be a
"throw it away and start afresh" discussion. Perhaps even project
cancellation.)

------
shepardrtc
Very cool is an understatement. I can't imagine the amount of work that is
going on behind the scenes to orchestrate this.

~~~
willwhitney
Most of the credit goes to the Jupyter team and the people who have
implemented the kernels for various languages. The Jupyter API spec is what
has made this possible. I'm really looking forward to what can be done next
(hint:
[https://github.com/jupyter/notebook/issues/99](https://github.com/jupyter/notebook/issues/99))

------
billwilliams
Thank you for bringing us the future.

------
spv
This is cool but I am eagerly waiting for this though
[https://github.com/atom/atom/issues/307](https://github.com/atom/atom/issues/307)

------
billwilliams
Any easy way to run remote kernels?

~~~
willwhitney
Right now it only works with local kernels, but that's on the to do list for
sure.

~~~
billwilliams
Awesome, great work. This is one of those situations where I wish massive
bribes were part of the open source ethos.

~~~
willwhitney
:D

I mean, if you're offering...

