An infinite canvas for code exploration
territory.dev
territory.dev
I wanted to watch the demo video again; even if it's only on the initial signup page, the hijack is irritating. If it's intentional, that's offensive.
Chill.
An audio track narrating what's happening would be nice, although it's pretty clear from the video what's happening, which is great!
One question: how do you display functions that are more than a dozen lines long? Do they get shown in a scrollable window, or does the window get auto-sized to show the entire function (which, IMHO, would be bad if the function was huge)?
On my device (Linux) no control is shown at all even in full screen.
I just thought this was a screenshot, and got disappointed that login is compulsory to try the tool, without showing anything about it beforehand.
On the missing Terms of Service, you have the Data Use notice, but it essentially describes how you're using our email, not any code that we would need to upload to you. In the day and age where we're having daily discussions on copyright violations and people hoovering up any data or analysis they can find, I definitely want a sturdy legal agreement in place before I ship IP off to someone's systems.
Seconding other comments about having it run as a local program in some way, I have a lot of different tools that I use in my IDE to explore codebases, utilize LSPs, etc. One of the big ones is how I utilize semantic color coding (https://medium.com/@evnbr/coding-in-color-3a6db2743a1e) to quickly parse function / variable names, and usually a standalone app gives me a lot more ability to control things like that. Having it local (and not communicating remotely) means that I _also_ don't have to worry about you hoovering up my codebase.
Otherwise, excited to see someone implement an idea like this! I can be very visual with certain kinds of diagrams and code bases and was unhappy with how few tools I felt visualized those organizations well.
How much would you be willing to pay? I feel like if you say that, and you like a product on HN, it's helpful to provide feedback (although it's not show hn, so idk if they'll see it). One time payment of $100? $5/month subscription? 10/month?
If social-sign-in is too much of a barrier (it was two clicks for me, and my email is pretty public, and I can switch to another account within the browser), then I'd be very surprised that you'd be willing to pull out your credit card and deal with the hassle of a purchase or subscription.
Also, saying that you'd be willing to pay for the product is meaningless if it's much less than the effort to often build and maintain for the business.
Maybe I am wrong, and you're willing to pay 1000s if only for those few small issues, but sometimes small hurdles like sign-ins are a good way to filter out customers that should be turned away because they're not as invested in the product. I would even argue that an app that requires no sign-in comes off as non-serious because any non-trivial app requires sign-in; the ones that don't are often very simple and the type of thing most people wouldn't pay for.
However, I'm confused by, "If social-sign-in is too much of a barrier..." Nowhere in my comment is that what I was bugged by. I've signed up for plenty of random services with disposable emails (or, sometimes, even less-disposable ones). As for the barrier to entry, I've worked with plenty of tools / libraries that took me hours to potentially get up and running, so again, not a barrier-to-entry problem.
I find your opinion on "not requiring sign-in" pointing to trivial apps baffling. A quick "dnf list installed | wc -l" shows that I have over 5000 installed packages. While many of those are libraries, I have everything from IDEs, Browsers, CAD applications, software ecosystems, tools (both visualization and otherwise), and more. Sign in simply tells me that when you shut down the service or change it in some way that breaks everything and makes it worse in a few years, that I have no real recourse.
As for a lot of "hosted" services, I'm personally weird because I have a homelab and like doing a lot of self-hosted stuff, both as a hobby and for my own privacy reasons. This means that a lot of the "We're hosting it _for_ you!" arguments don't hold water for me, and frequently don't feel like the right fit for the product, instead being driven by business. But I also get the need to _have_ a business at all - the competition is brutal. As an example, when MS is willing to devote an incredible amount of resources towards building an "open source" IDE and an incredible number of people are willing to build free (beer & speech) plugins on top of it, how do you even begin to compete? I've seen a lot less mention of Sublime text in the last few years and everyone and their mother seems to be using VSCode.
So, to go back to the pricing, right now I'm not sure. This feels like the ~$100 / year for a personal license project. If it was $10 / month, that's probably worth trying out for at least a single month and seeing if it does have the expected value. As others have alluded to, since this is a standalone tool, that means there is friction for using it alongside / outside of your IDE. Is it valuable enough to overcome that and remember to alt-tab over to it or keep it surfaced among a hundred other windows and tabs? Maybe!
Even with the best go-to-definition editor feature you need to keep a whole bunch of mental context when tracking down a deep control flow. The idea of Territory is to give you exactly the relevant cross-section through a large codebase. A code map that you build in this fashion can then provide explanatory value to others.
So far we indexed Linux, LLVM and Godot to prove we can handle repos of that scale and to provide value free of charge to free software contributors. We will be adding more repos and shipping self-service build setup later. Would love to hear your opinion. Are there any projects you think we should cover next? We are doing C/C++ first -- our initial parsing setup is build around libclang.
Nice work!
Editing is definitely on the roadmap. We would like to have an agent to sync edits with your local workspace at some point.
Something like: https://github.com/pixelkind/p5canvas
in particular, show all callers and callees of a code snippet
I would love to use a tool like this to navigate the unknown on rails!
I doubt, there will be much demand for throwing large non-public code bases into third party services... However, I can totally see how this would be a hit as a FOSS project.
Do you have a way to contact you?
Any reason you're not using treesitter with LSPs by the way? This would make it really easy to get this working with all major languages at once.
Are you on X? You can DM me at @pst723 or @territory_dev.
Don't overlap existing boxes when exploring new definition. Instead find the lowest free space in the column (or insert it at appropriate level)
When adding a reference to rather than exploring definition, default to adding box to the opposite side (left)
But I’m not going to give a website my email before learning the pricing strategy and ToS which (currently) aren’t available (on mobile at least). Would love to see these added.
I'll wait and see if someone in my dev network recommends it now. Too bad, it did look interesting.
Luckily I usually find the patterns used and know the tools and libraries used, but indeed some things make me sigh deeply as I know i'm in for a dig in a pit of the damned when having to diagnose + fix something.
https://cs.brown.edu/people/spr/codebubbles/
They have teamed up with Microsoft to develop a visual studio ultimate extension:
https://marketplace.visualstudio.com/items?itemName=Debugger...
> Works with Visual Studio 2010
I think Andrew Bragdon moved on from it and Steven Reiss (one of his coadvisors when Andrew initially created it) has appropriated it to some extent. Seems mostly dead though.
Unfortunately as the demo shows, a tree-map is hard because the code is just too big. Like, you can only see one or two full snippets in the window at once, the others are mostly off-screen. I think this is one area that would genuinely benefit from virtual reality, due to the massive "screen space" and ability to map code directly to physical locations (which is a known technique for memorization and allows for even more space).
As seen here: https://x.com/pst723/status/1745105464113676478
Everybody seems fine with doing just that on github.
I don't know who everybody is. Not me, not our company, not anyone I know. Who is everybody? Any stats?
People use Copilot but I already included that:
> Unless it's something well known and huge (aka can be sued when abuse comes out),
Edit: maybe you meant github itself? That's the same exemption as copilot.
Reminds me of UML-like diagrams over relational databases, except that it's generated one piece at a time. In practice I generate diagrams showing cyclomatic complexity much more often, and for code exploration outside the IDE I'd use ast-grep.
https://www.youtube.com/watch?v=kvMw-JSeGK8
* click on a table to get a preview
* write SQL or create analysis with pivot-table-like UI
* add visualizations to canvas
* publish as a dashboard
First, we pre-build a codebase-wide index for large repos that's readily available vs some kind of local VSCode plugin.
Secondly, we cover different languages. We started with deep support for C/C++ based on clang while they seem to be focused on TypeScript.
I'm curious why you'd say that theirs is more polished?
Best in class experience for navigating code graphs started in Visual Studio Ultimate circa 2010. The nav experience for dgml was super smooth and I've never experienced another graph tool as powerful as that. Looks like some of that lives on till this day https://learn.microsoft.com/en-us/visualstudio/modeling/map-....
Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Some specific scenarios are - 1) Using IDP-Initiated SAML SSO. 2) Using signInWithRedirect in a storage-partitioned browser environment.
It would be helpful if you added more to the homepage.
What languages does it support?
Haven't used it, but one thought that came to mind, would be to allow binding key presses to specific cards.
e.g. Hold my mouse button on a card, hit the "k" key, and now "k" will returned to that bookmarked card.
Demo solves the representation of a call tree in a really useful manner, the other thing to solve is the quick navigation within the call tree when reasoning about behavior. Would love to be able to simply bind bookmarks, and quickly flip back and forth between them. Perhaps holding Shift-k in the above context would temporarily "float" that bookmarked card next to my current card, so I can kind of temp pull in that context.
Having a tool such as territory.dev to replace the digital whiteboard would be really nice, as the copy/pasting and manual linking using arrows in the images is pretty time consuming, and the text in territory.dev is still copyable and searchable. In a canvas, i would have to use snipping tool on windows to extract specific text from the images again.
However, there are a lot of features I am missing from a tool like territory.dev, which makes the whiteboard superior:
* The most important feature that i would need for using a code exploration whiteboard, is that it works with the ui from a different application. I frequently add screenshots from the most diverse of places to the canvas, and link it to specific methods in my code, such as: * Message or specific parts of the UI of the application i am working on * Private messegas with other people * Github issues/comments in our task management system * Chrome console logs * Chrome network requests * Terminal output * Database viewer output or sql queries * Error messages/stack traces * JSON data returned from requests * CSV data returned from requests
This works well with a generic digital whiteboard, as i can just screenshot the other UI and then annotate it with a pencil, and then draw lines to what i'm working on.
* The canvas workflow works with all programming languages that my IDE supports. This means that for all programming languages, i get: * Correct syntax highlight * Correct goto definitions (by just using vscode, and then moving it to the canvas) * Familiar theme * Additional Inline actions and info provided by other extensions (count of references, inline errors, parameter hints, showing of translation string, etc)
You could make this work in a general way by instead of integrating with each language, you integrate with the LSP protocol, and then you can just plug in every LSP implementations for each programming language. In theory that would give you goto definitions for all languages.
* I often see myself "skipping" a definition if i am intimately familiar with the code i'm working with. If i know that an implementation on a high level runs a method to mutate an object, then the other method might be 10 hops away, but all of the methods in-between may not be relevant for the current bug i am investigating. * In the same vein as above, I might sometimes follow a value through multiple functions, and in that case i would like to connect a mutation which is applied to my value directly to the usage of the value, even if it might not reference the same symbol.
* Sometimes i want to connect 2 things which don't have a symbolic reference between them, such as a magic string which is used multiple places, and afaik that isn't possible in your
* You can trace a "path" a variable takes through your system by connecting function calls to parameters, and then to usages of parameters or when they are passed into the next method. This makes trailing your steps when you lose your train of thought a lot easier.
* You have the usual features of digital whiteboards, such as adding comments, stickies, highlighting and other things.
I am really enthusiastic about this kind of working, and it really helps when you are 15+ layers deep into a problem (which happens relatively often) and you lose your train of thought. I could walk someoene else who knows the code through one of my canvases, but I wouldn't share these whiteboards with a teammate though, as they are quite chaotic and are directly linked with the way i'm thinking.
I did an experiment with exporting to Obsidian's interchange format: https://twitter.com/pst723/status/1767381329086145002/photo/.... Perhaps that is something you'd find helpful for your use case?
Really the worst experience I’ve ever had with a landing page. Whatever this is …