
Show HN: Lucidity – an interactive program-state visualizer - westoncb
http://symbolflux.com/luciditystory.html
======
proc0
I've always wanted a runtime visualizer, and/or a static analysis visualizer.
With a couple of exceptions I was unable to find a suitable library and it
seems for some reason this hasn't been built yet.

So I also decided to take a stab at this, and hopefully will share if I get
anything useful. I'm using Haskell + Diagrams to construct a JS parser (to
begin with) that will do static analysis and render a graph of whatever you
need. The simple use case I've always wanted was just a slice of the graph of
the function calls, perhaps with some information on context variables. Seeing
this visually would help me get up to speed with any codebase and would allow
extremely fast contributions.

~~~
westoncb
I do wonder why more work hasn't been done in this area—especially on the run
time side.

I actually think a big part of it is something like a fixed perspective on
what the process of computer programming has to be like that comes from an era
before it was possible to do such a thing well.

One of the skills a programmer always implicitly learns is to imagine the data
their code is operating on—and only to occasionally peek into it with e.g.
printlns and debuggers. There's something about the seeming necessity of that
that keeps people away from tackling the problem directly. It may be a fish
not being able to see the water kinda thing. (At least that's my read on it :)

~~~
shalabhc
Perhaps a combination of cultural and technical feedback loops?

Technology selects folks that like 'playing computer in your head' as Victor
said [1]. This grows a culture where tools that help you _avoid_ mentally
simulating the computer are devalued. This selects more people even better at
playing computer in their heads, etc.

[1]
[https://www.theatlantic.com/technology/archive/2017/09/savin...](https://www.theatlantic.com/technology/archive/2017/09/saving-
the-world-from-code/540393/)

------
duncancarroll
Very cool! Looks very promising and something I'd use often if it were
connected to IntelliJ. I'd been toying around with a similar idea of doing a
similar "visual debugger" but within VR (not that it needs to be, but 3D is
fun. I've never found time to execute on it however.

~~~
westoncb
Thanks, and glad to hear! Yeah... having it connected to IntelliJ was
something that seemed always 'around the corner' for years. I think I will
forever be annoyed working on projects without having something like this
around—so hopefully someone will get to it eventually.

It seems like there is more interest in this 'direction' these days though: I
saw something new from the Firefox dev tools the other day whose time-
navigation felt very similar (I'll see if I can find it), and the Clojure REBL
project feels philosophically aligned. And I've seen a few others.

Using it in VR would be awesome :D

Edit: I think this was the Firefox devtools thing I was thinking of:
[https://developer.mozilla.org/en-
US/docs/Mozilla/Projects/We...](https://developer.mozilla.org/en-
US/docs/Mozilla/Projects/WebReplay)

------
westoncb
Author here btw. Happy to answer any questions.

~~~
ptrott2017
Firstly, congrats on an interesting project with clearly a lot of thought and
time investment. At end of article you request feedback on should you open
source - in that respect:

There is clearly some interest in this area e.g. DS-PITON project (See
[https://bit.ly/35Eq35R](https://bit.ly/35Eq35R)) or the Jive project for java
([https://cse.buffalo.edu/jive/](https://cse.buffalo.edu/jive/)). Another
would be Glamours Toolkit for Pharo Smalltalk
([https://gtoolkit.com/](https://gtoolkit.com/)) - though it has a larger
scope.

If you do not have time or funds to continue it in its current form and you do
not have any 3rd party at this point interested in sponsoring development in
some form, and you cannot see how to leverage it in the future - what do you
have to lose by open sourcing it?

At worst - it languishes, and no one uses it but it will give you a
referenceable open source project for your CV that may help attract work in
this or a related area.

At best, the project sees adoption and opens new opportunities for you.

Given the quality on display in the articles and videos I would expect the
project to get some interest especially amongst IDE and program visualization
communities.

If you do decide to open source the project be careful on licensing choice (to
encourage adoption in a manner you want) and copyright notices to ensure you
are associated with it. Do expect to have to invest a little time in
documentation and code clean up before making it available - but think of that
as future advertising for your own capabilities.

Good luck

~~~
westoncb
Thanks for the feedback ptrott.

> ... - what do you have to lose by open sourcing it?

That's pretty much my line of thinking as well. It seems like not much.

Thinking about it more, part of what I've wanted to figure out by posting:

1) How much interest is there (so will it be worth my time to do the
documentation, etc.)

2) What's the minimum set of tasks I'd need to do in order for it to have some
likelihood of getting picked up by others.

3) Is there some clearcut business usecase that I've never considered that
someone on HN might bring up.

~~~
ptrott2017
re: min set of tasks - Obvious list:

0\. Decide how you want to license codebase and how much you care about post-
release adoption.

1\. Write enough documentation to understand what the project is and can be
used for (i.e. an edited version of what you have already posted)

2\. Minimal demo project / app that the can be build so a prospective user can
understand the application / library (probably updated example you already
have)

3\. Clear repeatable build instructions for demo app/ lib etc

4\. License and Copyrights clearly stated and in codebase.

5\. One or two paragraph guidance on contributing to the project or using the
project.

6\. Plan on where to announce, announcement msg and follow up so you can
monitor interest.

7\. If you decide you do care about adoption, plan on some regular but minimal
effort after release to write updates/project blogs so folks can see what is
happening and encourage interest. *i.e. dont just throw it public, do no
marketing or launch effort and expect people to magically find it and adopt it
- some sustenance effort will be necessary. If you don’t care, but just want
to release it so its out there – then this step is obviously not necessary.

Finally, perhaps, an alternate way to get people interested in Lucidity and
demonstrate Lucidity's benefits would be to package up Lucidity and look to
contribute new features / functionality that leverage a subset of Lucidity to
an existing project that would benefit from those Lucidity's features.

Whatever you decide, Good luck.

------
lanbanger
This is absolutely spectacular, I love it. Have you thought about approaching
a programming tools company like Jetbrains to licence/sell it to them? They
would have the resources to turn it in to a viable commercial product.

~~~
westoncb
That's a good idea. I should at least try, but tbh I've always just kinda
figured they wouldn't take me seriously. Jetbrains seems pretty broadminded
though....

~~~
lanbanger
Another alternative is crowd-funding, at least to get to a "first shareware-
quality" release.

------
mettamage
A use case I think that's awesome for this project is YouTube educational
videos about programming.

------
mansard
I hope you find some way to proceed with Lucidity, I have once in a while
whished for something like this, the potential seems to be huge.

Good luck!

------
Gehinnn
This reminds me very much of my debug visualizer extension for vs code:

[https://marketplace.visualstudio.com/items?itemName=hediet.d...](https://marketplace.visualstudio.com/items?itemName=hediet.debug-
visualizer)

We have different approaches though.

~~~
emmanueloga_
Tangent; a small detail of your extension: I really like that tree widget you
used, it traces the path from the root of the tree to the selected leaf.

I wish all tree widgets looked like that. For instance, the VS Code file tree
is awful: I always need to look thrice in order to double check which folder a
file belongs to, specially when there are a ton of folders.

~~~
Gehinnn
Thanks ;) It took me a great amount of effort to implement that tree widget as
I had to combine absolute positioned svg elements with relative positioned
divs to get that effect.

------
mettamage
If I could download it, I'd use this to better prep for data structures and
algorithm style interviews.

------
gyanchawdhary
Awesome ! Can it show DS modification from a memory corruption ? Would be
super helpful in exploit development

------
capableweb
This should not be a Show HN as there is nothing you can actually try.

> Show HN is for something you've made that other people can play with. HN
> users can try it out, give you feedback, and ask questions in the thread
> [[https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)]

If you upload binaries for the various platforms somewhere and link on the
page, maybe mods be nice enough to let the post stay here?

Because the project looks awesome and I would to try it out in order to give
feedback and use it myself.

~~~
westoncb
Hmm, I guess it depends on how letter vs. spirit you'd like to interpret that
in. It is still a project I spent years working on that I'd like to share with
the community and get feedback on, so that I can potentially make it
available.

Unfortunately at the moment there isn't really a reasonable way for me to make
binaries available that would be useful for much. I'm going to go make a
sandwich and then think a bit more about whether there's something I can do,
though.

I assume the mods are fine wit it since they've already revised the title
once.

