10 ms·
An infinite canvas for code exploration
- pst723 2y agoWe built an "infinite canvas" style app for exploring codebases. We cut your repo into atomic pieces - functions, data structures etc. and give you an interactively expandable graph of defintions. 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.
- dontdieych 2y agoI would like editing code in this style. Focus on narrow area but can easily view as bird eye. Nice work!
- pst723 2y agoThank you! Editing is definitely on the roadmap. We would like to have an agent to sync edits with your local workspace at some point.
- verdverm 2y agoWhat about a VS Code extension? Would love to explore like this in my IDE over needing a separate tool / webapp Something like: https://github.com/pixelkind/p5canvas https://github.com/pixelkind/p5canvas
- pst723 2y agoI got that request from a couple of people already. Definitely coming soon. For now, we tried to make it easy to hop around manually. Click the node header to copy path, ⌘P, paste. Pasting a path to our search bar also works.
- gigatexal 2y agoPost to HN when that launches. I’ll take a look then.
- pst723 2y agoSure. You can follow as on X @territory_dev, I post updates there.
- verdverm 2y agoI can imagine a number of really cool ways to explore code with a tight integration to intellisense / LSP in particular, show all callers and callees of a code snippet
- speps 2y agoSupport Unreal Engine and you'd get a lot of interest from game devs!
- pseudosudoer 2y agoIdeally this would be a standalone app (perhaps ported using electron) that I could run locally, and import codebases directly. Sourcegraph was on the right track, but eventually fizzled out unfortunately. I would love to use a tool like this to navigate the unknown on rails!
- pst723 2y agoThat is definitely an option. However what you get from a hosted service is that we do the indexing for you. That can take a significant amount of time for a huge codebase.
- jijijijij 2y agoLove the idea, but isn't the "indexing" part of many editors and language servers already? Ctags and stuff? Never got the impression that to be a huge problem on modern hardware. 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.
- sdesol 2y agoI've built a code search engine in the past so I know how painful debugging long indexing jobs can be and I would certainly be reluctant to support private repos until I know I can index thousands if not tens of thousands of open source repos with no issues.
- pst723 2y agoThat's more or less the plan. We want to prove our concept with free software repos first.
- sqs 2y agoSourcegraph CEO here. We stopped making a standalone Electron app (which was an experiment) and instead remained focused on our web app and editor extensions. You can use Cody in your editor with no server needed. We didn’t fizzle out. :)
- azeirah 2y agoI have some interesting ideas about this, as I've been thinking about it and have been prototyping ideas for ... a decade at this point? 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.
- pst723 2y agoLSP and treesitter are cool and we might use them when adding more languages eventually. From my understanding though treesitter does parsing only and it would take a bunch of work to do the semantic analysis clang already does. Plus clang is an industry tried compiler that we know can handle a lot of the rough edge cases of C and C++. LSP is closer to our use case but I think still not close enough. It took a lot of work to get the right points to cut the code at and when talking to clang directly, at least we can inspect things at a decently low level. Are you on X? You can DM me at @pst723 or @territory_dev.
- voxelghost 2y agoSome first impression UI feedback: 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)
- pst723 2y agoAh yes those are definitely on the TODO list.
- voxelghost 2y agoWhile we are at it, it would probably also be nice to (optionally) color the background of the explored row(or token) and color the title bar of the result correspondingly (I am thinking similar to Godbolt color coding for matching C->ASM)
- anentropic 2y agoIt'd be great if this UI could happen inside VS Code, for the current workspace and its dependencies
- aappleby 2y agoThis might interest you - https://github.com/aappleby/wideboard https://github.com/aappleby/wideboard
- LeafItAlone 2y agoThis tool seems very useful. Demo well done. 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.
- gigatexal 2y agoYeah. Pricing or get busted.
- pst723 2y agoIt's free for the open source repos we indexed. No pricing yet.
- hiccuphippo 2y agoIt would be nice if you put links to the tool for those open source repos in the landing page so we can try it out.
- marcus_holmes 2y agoSame. The video looks interesting, but forcing a signup before disclosing any more caused me to click away. It's interesting, but not interesting enough to make me give them my details. I'll wait and see if someone in my dev network recommends it now. Too bad, it did look interesting.
- observationist 2y agoHijacking the back button to lock me on the page is an unacceptable violation of my browser functionality. Don't do that. It's bad. When I click the back button, I want to go away from where I am, back to where I was before. I don't click the back button to remain in the same place. 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.
- pst723 2y agoThat sound like a bug, definitely not intentional. Will look into that.
- chaps 2y agoWhile you're at it, could you re-add controls to the video? Yeah I know two minutes is short, but.. I just want to see some screenshots!
- cyxxon 2y agoLooks interesting to me - I am using the mouse button on the left side of the mouse which is bound to back by default. That just flickers the login page. Actually clicking the back button on the browser UI works, though (Edge Win10/64).
- koito17 2y agoHaving worked as a frontend web developer, I can assure you that the back-button hijacking is sheer incompetence of the developers. They have to be mutating your browser history in a careless way to achieve this. That or they somehow picked a really bad client-side routing library. (Even just following a basic tutorial for react-router wont cause this behavior. It's almost always sloppy state management causing this)
- pst723 2y agoThanks, forwarded to my frontend dev/cofounder ;)
- 2y ago
- brotchie 2y agoHell yeah, this is really cool. 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.
- pst723 2y agoKeyboard navigation is definitely something I want to improve. I think we can get far with a good search bar implementation.
- Esras 2y agoGreat idea, and I was excited to try it (and even pay for it!) until the requirement to sign up and the hijacked back button. Also, in my Firefox, your white box as a background appears transparent and so your text is just on top of a _very_ noisy background. 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 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.
- pst723 2y agoAt this point we only index open source code. Once we open up to customers with private repos, that will definitely be the first thing to add.
- parentheses 2y agoMake a plugin. I want this and I think the world needs this.
- preommr 2y ago> I was excited to try it (and even pay for it!) until the requirement to sign up 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.
- BatmansMom 2y agoLove this app, this is something I've had rolling around in my head for a while and I think it can massively improve developer productivity. Excited to try it when I can use my own code!
- pst723 2y agoThank you!!
- deleted 2y ago[deleted]
- conartist6 2y agoI wanted to try it, but I was scared away by the idea that I was creating a new seeming-infinitely-persistent asset I didn't want. Could you put up an actual demo where I can just see an existing graph?
- _andrei_ 2y agoGreat to see this, I'm working on something similar but local and LSP-powered.
- gediz 2y agoSometimes it takes great amount of time to understand a specific flow in any given software that's abstract enough. This is a great concept. I'm ready to pay for it.
- jxramos 2y agocurating those accurate mental models of the system and its architecture are valuable things, even more so if it can be expressed in a snapshot graph like this tool can render. 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-dependencies-across-your-solutions?view=vs-2022 https://learn.microsoft.com/en-us/visualstudio/modeling/map-....
- pst723 2y agoThank you, glad to hear that!
- abalaji 2y agoThis seems great, I would use something like this day to day if it were a vscode plugin. Often times two side by side panes are not enough to get the intertwined context of a large program that spans both code / subprocess / api boundaries. Currently, I solve this problem by keeping a set of tab groups for different "workflows" that I need to edit frequently
- Jabrov 2y agoThis needs to be a part of VSCode
- wangii 2y agonot able to sign in with github: 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.
- thunderrabbit 2y agoSame for me (on Firefox)
- lgas 2y agoI got this same error (in Chrome).
- corytheboyd 2y agoThere are keyboard shortcuts for navigating up and down the goto definition navigation stack that are absolutely indispensable for this reason (in JetBrains IDEs at least, though I’m sure in other IDE/editors too). Their demo gif is exactly how I would visualize my thought process using this navigation, which is pretty neat! It’s so painful watching people global-search by function name to navigate back to where they just were once you lock this functionality in to your workflow (aaaa you can get there instantly and exactly!)
- pst723 2y agoI definitely would not be able to live without my C-o's and gd's. Making the research process persistent is the next step forward IMO. We want the machine to extend your mental context.
- armchairhacker 2y agoIMO better representations for code is one of the big things we need to build more complex software. 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).
- pst723 2y agoAs a matter of fact I already have a demo working in the Vision Pro sim ;) As seen here: https://x.com/pst723/status/1745105464113676478 https://x.com/pst723/status/1745105464113676478
- drhodes 2y agoSome prior art from Brown university, code bubbles: https://cs.brown.edu/people/spr/codebubbles/ 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=DebuggerCanvasTeam.DebuggerCanvas https://marketplace.visualstudio.com/items?itemName=Debugger...
- thomassmith65 2y agoAha, so that's what happened to Code Bubbles. I saw this video about the project years ago, and always wondered. https://youtube.com/watch?v=PsPX0nElJ0k https://youtube.com/watch?v=PsPX0nElJ0k
- jxramos 2y agointeresting to see the VSU 2010 reference, that was when all the great software architecture features released with Visual Studio, very powerful stuff. > Works with Visual Studio 2010
- mondrian 2y agoThere's this: https://github.com/StevenReiss/bubbles https://github.com/StevenReiss/bubbles 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.
- alexvoda 2y agoI was just about to post the same information. Sad to see the concept never caught on. I really liked using Debugger Canvas on VS2010 even if it was somewhat buggy.
- Tagbert 2y agoIs this only for C or does it support other languages? It might be helpful if you site contains some more details about things like this?
- abraxas 2y agoThis is fine and all but it only shows half of the information, namely the flow of the code. When it models the flow of data then it will become as powerful as the Unreal Engine Blueprints which to me is the pinnacle of visual coding.
- benzguo 2y agoFunny coincidence – saw this very similar, perhaps more polished variant of the idea trending on twitter today: https://twitter.com/fronseneca/status/1752125155667824764?s=46&t=HBHv31n-PSDdD_vOuu7DZg https://twitter.com/fronseneca/status/1752125155667824764?s=...
- pst723 2y agoI saw this work a while ago, they posted some early demos roughly when we were first opening up with our Linux index. While the interface is indeed similar, I'd say as things stand now we are different in a couple of dimensions. 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?
- jxramos 2y agocould be the animations, hard to tell if its live or prerecorded with jank removed but the visual they post is very fluid and responsive. If that's the life performance that app is pretty fast.
- jxramos 2y agoInteresting they just posted an update to X this morning https://twitter.com/fronseneca/status/1787559698826244188 https://twitter.com/fronseneca/status/1787559698826244188
- cess11 2y agoIt's unclear what the superpowers would be? Video doesn't show anything I can't do with an IDE or decent code editor, and there I also have refactoring tools, metadata like indicators for usages that can be used for navigating and so on. 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://ast-grep.github.io/ https://ast-grep.github.io/
- gverrilla 2y agoI want to use this for private codebases. Seems like something that should have existed already, great idea!
- pst723 2y agoThank you, glad to hear that!
- ijidak 2y agoI've been waiting for something like this!! I don't know why this doesn't exist already! It would be helpful if you added more to the homepage. What languages does it support?
- asicsarecool 2y agoThis is right up my alley. Shame I'll never get to try it after experiencing the back button hijacking. Fail.
- jonahx 2y agoPremature Abstraction Undoer Machine™
- pst723 2y agoLove it! Definitely inspired by the time spent digging through layers of half-assed abstractions!
- nitric 2y agoWe're actually building something similar at getSpectral.io . Ours focuses on Javascript/Typescript, and is a VSCode plugin so you can use it on any repository!
- deleted 2y ago[deleted]
- ilius2 2y agoI get js errors in brave: TypeError: r.data is not a function at https://app.territory.dev/static/js/main.ac1114cb.js:2:1379499 https://app.territory.dev/static/js/main.ac1114cb.js:2:13794... at Object.Qo [as useMemo] (https://app.territory.dev/static/js/main.ac1114cb.js:2:577242 https://app.territory.dev/static/js/main.ac1114cb.js:2:57724...) at t.useMemo (https://app.territory.dev/static/js/main.ac1114cb.js:2:674167 https://app.territory.dev/static/js/main.ac1114cb.js:2:67416...) at PL (https://app.territory.dev/static/js/main.ac1114cb.js:2:1379362 https://app.territory.dev/static/js/main.ac1114cb.js:2:13793...) at xo (https://app.territory.dev/static/js/main.ac1114cb.js:2:572831 https://app.territory.dev/static/js/main.ac1114cb.js:2:57283...) at Eu (https://app.territory.dev/static/js/main.ac1114cb.js:2:584519 https://app.territory.dev/static/js/main.ac1114cb.js:2:58451...) at xs (https://app.territory.dev/static/js/main.ac1114cb.js:2:630827 https://app.territory.dev/static/js/main.ac1114cb.js:2:63082...) at bl (https://app.territory.dev/static/js/main.ac1114cb.js:2:619050 https://app.territory.dev/static/js/main.ac1114cb.js:2:61905...) at yl (https://app.territory.dev/static/js/main.ac1114cb.js:2:618978 https://app.territory.dev/static/js/main.ac1114cb.js:2:61897...) at gl (https://app.territory.dev/static/js/main.ac1114cb.js:2:618841 https://app.territory.dev/static/js/main.ac1114cb.js:2:61884...)
- pst723 2y agofixed now
- trash_cat 2y agoNow combine this with Jupyter notebooks and we are good to go. I'd pay for that.
- anonzzzies 2y agoIn my opinion this has to be local and/or open source to get serious uptake. I really find it hard to trust slurping my codebases through some 3rd party site. Unless it's something well known and huge (aka can be sued when abuse comes out), I cannot see me using it on anything except open source projects.
- wodenokoto 2y ago> I really find it hard to trust slurping my codebases through some 3rd party site. Everybody seems fine with doing just that on github.
- anonzzzies 2y ago> Everybody 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.
- pst723 2y agoWell, github wasn't always huge either.
- anonzzzies 2y agoBesides my other comment ; I like this idea and I have been thinking a lot about code understanding and overviews. As I get older I notice my memory degrading and I read a lot of codebases for my work, hobbies etc; many are very over architected and pretty annoying to grok. How can you rapidly understand where a specific functionality is? Etc. Codebases that have been thought out, nicely organised etc are a joy, but many, especially, newer ones I see, take going across 10+ files (in 5 packages) (with a number of build steps) to add/change a simple thing. And IDE's are not helping with that at all. 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.
- gibb0n 2y agoVery nice start, I've been dreaming about this for a while as an intellij/vscode plugin, will be great to see if anyone can pull it off
- DLA 2y agoI cannot even see the thing because of error - Cannot load page. Too many redirects (more than 20). What’s up?
- pst723 2y agoCloudflare configuration fucked me up. We should be back up.
- mritchie712 2y agoIf you're looking for something like this for data / SQL, we (https://www.definite.app/ https://www.definite.app/) have it: https://www.youtube.com/watch?v=kvMw-JSeGK8 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
- StrauXX 2y agoPretty much seems like what reverse engineering tools have been doing for ever. Always wondered why that way of navigating code never seemed to catch on outside this domain.
- dzogchen 2y agoDid anyone figure out how to use this with another repo?
- Zikoat 2y agoI have actually been using exactly this approach to investigating bugs for some time now. I started with ctrl+alt+clicking in vscode to open 10's of tabs, then taking a screenshot and drawing lines, but the large amount of tabs caused chaos, and then I suddenly noticed I need another tab and i would have to somehow merge the 2 images. To fix this, I added a digital whiteboard to my workflow, and this is phenomenal. You can use any digital whiteboard, such as https://www.figma.com/figjam/ https://www.figma.com/figjam/, https://excalidraw.com/ https://excalidraw.com/, https://miro.com/ https://miro.com/, or https://obsidian.md/canvas https://obsidian.md/canvas. My workflow generally goes like: 1. Copy screenshot of code in vscode 2. Paste into digital whiteboard 3. Go back to vscode and ctrl+click on symbol to see references, and then find the one i need. 4. Copy/paste that code into the digital whiteboard. 5. Add arrows to symbol in the code to connect 2 separate definitions/references/usages. 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.
- bogwog 2y agoThis seems cool and I'm always open to new ways of working, but I am hesitant to trust a third party with my code, especially in this AI gold rush we're living in.
- muxiHuxi45 2y agoI just see an image and a huge button, that brings me to the sign up page with disabled navigation to get back. No text, no description, no video. Nothing. Brave on iOS. Really the worst experience I’ve ever had with a landing page. Whatever this is …