Readit News logoReadit News
Posted by u/akshaysg a year ago
Show HN: Haystack – an IDE for exploring and editing code on an infinite canvashaystackeditor.com/...
Hi HN, we’re building Haystack Editor (https://haystackeditor.com/), a canvas-based IDE that automates the boring stuff (plumbing, refactoring, and finding code) so that you can focus on the exciting parts of software development! You can see a quick overview of Haystack at https://www.youtube.com/watch?v=c2uZnR5D_cc!

(It's currently only on Mac OS but we're working on Linux and Windows. Edit: just added a Linux download!)

Haystack was born out of our frustrations with working in large and mature codebases, specifically with navigating and editing functional flows (e.g. the code flow for adding an item to the Amazon shopping cart).

Oftentimes dealing with such flows would involve navigating a maze of files and functions, and making any edits would involve a lengthy process of doing corresponding downstream/upstream plumbing.

Haystack attempts to address this in the following ways:

    1. It allows you to explore your codebase as a directed graph of functions, classes, etc on the canvas. We feel like this better fits how your mind understands your codebase and helps you find and alter functional flows more intuitively. We especially want to utilize this for pull request reviews!

    2. It has a navigational copilot that makes edits across files or functions much easier. After you make some changes, Haystack will try to predict your next action and create functions/methods or refactor upstream/downstream code for you. Haystack will surface these speculative edits on the canvas in a way that you can easily dismiss or incorporate them, allowing you to make large changes with a few clicks or keystrokes.

    3. Haystack will utilize natural language search so you don’t have to play “Where’s Waldo” to find a functional flow in your codebase. This is coming soon!

We’re still pretty early in development and we really want to perfect the experience of navigating and editing code on a canvas. Any feedback would be much appreciated!

PSA: Since Haystack is a VS Code fork, you should be able to move your extensions and keyboard shortcuts. Please let us know if you have any issues with this!

cl3misch · a year ago
I'm not sure about the AI features but the concept of working with code on a canvas and having some sort of flowchart UI has been a dream of mine for some time. I mainly do data processing and draw lots of flowcharts for communicating pipelines and also for myself. Having a development UI which goes in that direction somewhat would be great for handling unwieldy codebases written by non-CS folk.
Falimonda · a year ago
Is a tool like LabView what you have in mind?

https://www.ni.com/en/shop/labview.html

cl3misch · a year ago
Yeah kind of. I have worked with LabView and liked the flowchart UI for handling lab instruments, but for somewhat complex algorithms it got unwieldy really fast.

I have the feeling LabView is a good tool for designing control panels and visual tools in general ("front-end"). It is less suited for implementing back-end algorithms. I guess I wish for a similar tool which can also handle the back-end (in the context of my data processing job).

The problem is that I don't know myself what UI I would actually want for a "canvas-based editor". Some mixture between a visual flowchart and being able to edit code in each box? I'm obviously not the first person to think about it and it seems to be a non-trivial problem.

promiseofbeans · a year ago
Kind of like what BlueJ does with Java?

Deleted Comment

akshaysg · a year ago
Curious if the problem you're encountering is visualizing the data flow vs. the control flow?
tmvnty · a year ago
It would be awesome if we can sketch diagrams and code in the same canvas! This would make visual documentation much easier.
sim7c00 · a year ago
you can do asciidoctor, plantUML kroki in vscode so maybe its present mode can already be used in there like that?

Dead Comment

sensanaty · a year ago
This is really cool! I like the fact that when you navigate to a method/declaration/whatever, it only contains the relevant snippet, rather than opening a secondary tab with the whole file scrolled to where the definition is.

I often end up in a situation where I keep losing track of whatever method I'm reading since I need to compare where a method is called vs its definition, which is frustrating. I like that I can just "pin" the method to the side, and can glance at it without accidentally switching to scrolling through the whole file in the pinned view.

I tried it out for a bit and I found it a bit too mouse-centric unfortunately, and I quickly ended up in a situation where I had way too many floating windows to manage, especially once I got into checking out methods inside of other methods. It would be nice to have an arrow or line to keep track of what the "parent" window is so that it's easier to build a sort of flowchart.

Regardless of my personal issues with it, hope you succeed with this! It's great to see alternative ways of thinking in this space, as I often feel things could be better but it's also hard to imagine how.

broken-kebab · a year ago
>I like the fact that when you navigate to a method/declaration/whatever, it only contains the relevant snippet

I see why you like it, but I suspect it could be sum negative in a long run. I believe it's beneficial to just be aware of what and where is in the code. Can it be that few years went with a project, and you still don't know what all those files are about because you has been working only with small chunks?

WillAdams · a year ago
Literate Programming affords a 1D (vertical/scrolling) implementation of this with two views:

- raw code w/ comments/text

- nicely typeset code with formatted text and hyperlinks for navigation

http://literateprogramming.com/

akshaysg · a year ago
Yeah we have some work to do to make it easier to navigate on the keyboard.

For the "parent window" what are you imagining here as your frame of reference? This idea makes sense but I'm wondering if you want to designate a specific window as an anchor vs some heuristic that identifies such an anchor.

andybak · a year ago
I viscerally dislike manually arranging windows. Have you investigated auto tiling?

Also how well does this work on smaller screens? My preferred ergonomic posture is slumped on the sofa with a laptop on my belly.

karolist · a year ago
Congrats on the launch. I've actually been going in a totally separate direction lately, it helps with my focus and ADHD tendencies to jump around and get overwhelmed.

1. One window. 2. Minimal everything. 3. Most importantly, no tree navigation.

If I need to jump to a file, I either use recents menu in Intellij or use file markers to jump to it, means I have to remember the filemarker and have intent to go there (I'm using IdeaVim plugin for vim hotkeys). This, to me, make programming much more focused and pleasurable. This is part of my evolution from multi screen to widesreen and then back to a single screen.

For large and mature codebases like you mention, I just use LLM to guide me around.

asp_hornet · a year ago
> For large and mature codebases like you mention, I just use LLM to guide me around.

How? What do you call large mature codebases? In my experience LLMs already make many mistakes and assumptions just in one file?

karolist · a year ago
akshaysg · a year ago
Makes sense! Curious how you use LLMs to guide you around?

In my own experience, I ask the LLM where a functional flow is and it does a great job of creating an entrypoint, but I frequently have to figure out the finer details myself and sometimes the LLM points to something related, but not quite what I was looking for.

trte9343r4 · a year ago
Interesting, some notes:

- obsidian has similar feature called "Canvas", perhaps look at their work flow.

- For me this is uselles as a standalone tool. I need it as Idea plugin.

- creating layouts is the part I hate. Perhaps some AI that takes Git patches, or bug fixes and creates layout based on that.

- sharing layouts needs to be super easy

- integrate Git history as another dimensions. Diff and blame N notations in editor.

- there are data (git commits) that you can use to train AI.

- integrate debuging as another dimension

- integrate data from profiler...

nusl · a year ago
This appears to run within VSCode from the demo videos, as opposed to being standalone. You get everything you get there.

If you use Idea tools you're out of luck I guess.

codetrotter · a year ago
Their website says it’s a fork of VS Code.
trte9343r4 · a year ago
> out of luck

Idea can already do everything Haystack can do (open several editor windows, only open single method, code navigation, callers...). On large screens (quad 32" 4k) it is quite useful.

But a bit more refined experience would be nice.

forgotlastlogin · a year ago
The tool looks great and I would love to try it out for work (Android/Kotlin). So +1 to the IDEA integration, pretty please
dahjelle · a year ago
I've been wanting to try something like this for a long time! Is there any way to sign up for updates?

(In particular, I'm waiting for the option to turn off the AI stuff, at least for when I am trying things out.)

I especially love the ability to zoom into a function and hide the rest of a file. I've wanted that sort of thing a surprising number of times. I'm thinking one could also use this to virtually rearrange a single file by pulling the functions in that file that you are working on next to each other easily?

In addition to the editing interface, I think there are probably a lot of visualization opportunities in editors:

- what's the interaction between my code and third-party dependencies? - what are the dependencies/call graph of my code? or perhaps just a portion of it? - call graphs can be nested — perhaps you care for a dependency graph at the class or module level, or perhaps you want to "drill down" into the call graph inside an object

In all these cases, being able to seamlessly transition between the visualization and editing — like you seem to be aiming towards — seems like the killer feature.

And, of course, there are lot of other interesting visualization opportunities once you have any sort of graphics in your editor:

- heatmaps of code churn - heatmaps of code performance - tracing variable usage - and, of course, lots more (https://adamtornhill.com/articles/crimescene/codeascrimescen...)

One last thought: if you haven't read _The Programmer's Brain_, you should at least listen to this podcast. https://se-radio.net/2021/06/episode-462-felienne-on-the-pro... There are a bunch of editing ideas related to how our brain works that I haven't seen well supported in an editor yet. You took one step in that direction — maybe there are some more opportunities?

Looking forward to what you come up with!

akshaysg · a year ago
Unfortunately we haven't built a clever way to sign up for updates! I'll think of the best way to do this (eventually we'll push updates directly in the product).

Working on adding the copilot opt-out as we speak!

I love the ideas here and I would like to discuss some of these with you. If it's OK with you, I am going email/DM you!

In general, we would love to engage in conversations with folks (feedback@haystackeditor.com)

julius · a year ago
- Demo made me want this instantly -- looks better than tabs

- Realized its VSCode -- started downloading

- Stopped the download when I saw AI -- cannot work on company code

Will definately try this when AI is disabled.

dahjelle · a year ago
Feel free to email — it’s in my profile. :-)
kmoser · a year ago
I really like the way it lets you navigate from function to function (and file to file) and back again. What would be even more useful would be to have a "history" window, similar to your browser's history, that would show the list of files/functions as I'm navigating from one to the other. This would allow me to step forwards or backwards, or even jump to anywhere in my navigation history, without having to slog through the open windows.

Note that this "navigation history" I'm thinking of would be completely unrelated to my edit history; undoing and redoing an edit would not bring me forward/back in my browse history, and vice-versa (although there could certain be keyboard shortcuts for traversing the navigation history as well).

akshaysg · a year ago
This is a great idea! Will think about how to best implement this.
exe34 · a year ago
look at emacs undo buffer, it would be awesome to avoid losing the future if you step into the past.
mondrian · a year ago
akshaysg · a year ago
Yeah bubbles are awesome! I like the minimap concept especially.
pavel_lishin · a year ago
> We do not store or log your code anywhere. We do send snippets of your code to Open AI as input for our navigational copilot. We'll add an option to disable this soon.

I look forward to checking this out once that option is in place.

akshaysg · a year ago
Added an opt-out for the navigational copilot on Mac -- just bring up the command pallet (CMD+SHIFT+P) and use the "Opt out of navigational copilot" command. Coming to Windows/Linux soon!

Note that we only send data to Open AI if you have a diagnostic indicating that you're calling a function that doesn't exist.

buffet_overflow · a year ago
Had the same reaction. I’m willing to support development for a tool like this, but would prefer to do it more….directly.
reddit_clone · a year ago
Agreed. That should have been a opt-in from day one!
vegadw · a year ago
Yeah, can't exactly try this at work as is.