Show HN: Tritium – The Legal IDE in Rust (tritium.legal)

312 points by piker ↗ HN
$1,500 an hour and still using the software my grandma used to make bingo fliers!?

Hi HN! I'd like to submit for your consideration Tritium (https://tritium.legal). Tritium aims to bring the power of the integrated development environment (IDE) to corporate lawyers.

My name is Drew Miller, and I'm lawyer admitted to the New York bar. I have spent the last 13 years in and out of corporate transactional practice, while building side projects in various languages using vanilla Vim. One day at work, I was asked to implement a legal technology product at my firm. Of course the only product available for editing and running programs in a locked-down environment was VS Code and its friends like Puppeteer from Microsoft.

I was really blown away at all of the capabilities of go-to definition and out-of-the box syntax highlighting as well as the debugger integration. I made the switch to a full IDE for my side projects immediately. And it hit me: why don't we have this exact same tool in corporate law?

Corporate lawyers spent hours upon hours fumbling between various applications and instances of Word and Adobe. There are sub-par differencing products that make `patch` look like the future. They do this while charging you ridiculous rates.

I left my practice a few months later to build Tritium. Tritium aims to be the lawyer's VS Code: an all-in-one drafting cockpit that treats a deal's entire document suite as a single, searchable, AI-enhanced workspace while remaining fast, local, and secure.

Tritium is implemented in pure Rust. It is cross-platform and I'm excited for the prospect of lawyers running Linux as their daily driver. It leverages a modified version of the super fast egui.rs immediate-mode GUI library. The windows build includes a Rust COM implementation which was probably one of the more technical challenges other than laying out and rendering the text.

Download a copy at https://tritium.legal/download or try out a web-only WASM preview here: https://tritium.legal/preview

Let me know your thoughts! Your criticisms are the most important. Thank you for the time.

170 comments

[ 3.7 ms ] story [ 218 ms ] thread
Really cool to see a native app instead of another Electron or browser-based tool.

I'm curious what was your experience like building this in Rust? Also, how did you find working with egui, what made you choose egui over other UI frameworks?

Agreed! I don't think lawyers would have accepted an Electron alternative to super fast Word. Rust gives the raw speed and safety necessary to compete.

It's my first Rust project, and I've found Rust to be amazing once you cross over the learning hurdle. The biggest issue was of course the borrow checker, but for a project like this where you aren't really iterating much on the design (as opposed to say a game dev), it lets you fly. It saves you from all the big mistakes and allows you to comfortably use threads and things. No idea how I would have made it without rust_analyzer, though.

Egui was simple to get going, while it has some downsides being an immediate mode UI, those are mostly overcome by the caching necessary for rendering documents, etc.

why you choose egui or you just choose based on what you commonly used??
I had been messing around with Imgui relatively recently and enjoyed the simplicity. Prior to that I was doing stuff with React which is kind of the polar opposite and found that to be super laborious. So when I saw egui, I jumped at the chance.
Not familiar with law enough to understand how to use it. Maybe you could show some boring hours long streams of using it in the real world and we would understand
It probably wouldn't make sense to show lawyers what we do, either, but there's a kernel of truth there: the product needs some development on the onboarding.
This is pretty interesting! Did you implement the DOCX support and rich-text editor from scratch? I’d be concerned about interoperability with other editors — a semi-compatible editor losing content/comments added by other software could be a huge problem.
Yes! From scratch. It started with a docx library but had to be re-implemented from the beginning because that library dropped data that wasn't implemented. Tritium's docx implementation is more permissive such that it can gracefully failover to just pure XML if it can't parse an element via the AST.
Spent 15 seconds waiting for the spinner to resolve before I gave up.
Apologies for that. I thing the pipe is getting hugged a bit here. Unfortunately it's a bit lean so no GCP outages to blame it on!
I too waited for the preview to load, but looking in the browser console I saw a file was in 404 ( /static/tritium-c69b2fe84b82a0da.js ) (so it silently failed as soon as "import init, * as bindings from '/static/tritium-c69b2fe84b82a0da.js';")
Thanks so much! Shouyld be fixed now
> Tritium is implemented in pure Rust.

This beautiful software that looks a bit like VS Code, what did you use to make it? I'm guessing Tauri but curious if you used something else.

That's very kind -- let's hope the legal profession feels the same way. It's certainly inspired by VS code. It's using egui (https://github.com/emilk/egui) under the hood. Big hats off to Emil Ernerfeldt and the team at rerun (https://app.rerun.io/) for the incredible work on a great immediate mode GUI library.
I did send it to a lawyer I'm friends with, their hesitation comes from putting anything confidential on "unknown software" so I think you should really focus on highlighting any kind of metrics you keep, and anything that could be fully relevant to a legal professional. I also recommend, I think you mentioned AI is possible, making that opt-in only.
Yes that battle is won by getting the IT/infosec team's approval for the desktop application. Lawyers really don't like the WASM version because it seems like you're uploading docs to some server (you aren't).

Thanks a ton for the feedback!

Does it have Reveal Codes? :P
Not yet, and I can't tell if you're being sarcastic, but that's exactly the of question its users should be asking :)
This seems pretty cool! I tried it out but I ran into an error that froze the entire app on the preview. Seems to be related to max pages per paragraph.
Ah yes, that is a bug where the layout engine can't fit it correctly and gets stuck in a loop. It maxes out rather than overflows, but the same effect. It's being worked on, and sorry for the inconvenience.
My understanding working with law firms was that they are pretty bought-in to the Microsoft Office ecosystem, how well does Tritium integrate? Is the docx format fully supported? Can one person use Tritium without affecting others? Other than tabs, what does Tritium offer that two Word panes and a file browser pane tiled on screen can't cover?

I am interested in developing software in this space, so these are earnest questions and not criticism.

> My understanding working with law firms was that they are pretty bought-in to the Microsoft Office ecosystem, how well does Tritium integrate?

Absolutely. Overbought. They're owned by Microsoft. Go to a legal tech conference and there are thousands of vendors and not a single MSFT representative. All they want to do is push more Azureware on the deep pockets of profitable firms.

> Is the docx format fully supported?

It will be. There are certainly edge case features that don't render correctly yet, but those will come. The 80% that we care about should work. No data will be dropped, as mentioned elsewhere it will just look bad and gracefully degrade behind the scenes to a safe representation that ensures the data isn't lost.

> Can one person use Tritium without affecting others?

Yes, it's totally private and secure. Using Tritium doesn't require any cloud access or anything like that (other than to phone home with the auto-update or your LLM integration). I'm going to link the history to a separate hidden directory in the filesystem a la .git in the future which will allow some basic multi-editor features.

> Other than tabs, what does Tritium offer that two Word panes and a file browser pane tiled on screen can't cover?

Great question! It does the things lawyers care about: help them pick out symbols (defined terms, specifically) and run diffs (redlines) cheap and quick. It also renders PDFs (using pdfium).

> I am interested in developing software in this space, so these are earnest questions and not criticism.

Drop a line to the email in my bio. I'd love to chat offline.

It's a catchy name, though ironically tritium is not legal in the US, generally[1] (for "frivolous purposes"). Guess this is serious software!

1: https://www.law.cornell.edu/cfr/text/10/30.19

Can I trademark that slogan? :)
I pine for a DSL for legal documents, both because it’s tedious and tiresome to parse prose like this:

> Except for persons who manufacture, process, produce, or initially transfer for sale or distribution self-luminous products containing tritium, krypton-85, or promethium-147, and except as provided in paragraph (c) of this section, any person is exempt from the requirements for a license set forth in section 81 of the Act and from the regulations in parts 20 and 30 through 36 and 39 of this chapter to the extent that such person receives, possesses, uses, transfers, owns, or acquires tritium, krypton-85, or promethium-147 in self-luminous products manufactured, processed, produced, or initially transferred in accordance with a specific license issued pursuant to § 32.22 of this chapter, which license authorizes the initial transfer of the product for use under this section.

... and also because it is ambiguous / error-prone / subject to interpretation, especially when figuring out antecedents of pronouns, referents, and textual boundaries.

I tried four times to read the above by paragraph without reformatting it with some parentheses etc, but failed.

.... I think it means that you can make self-luminous products without needing a license, as long as you got them from somebody who does have a license.
I think that's pretty much it but IANAL. Tritium vials are available for sale for use in self-luminous products. The vials themselves are pretty expensive for what they are, and they come with documentation about who initially created the vial (or how it was imported).

I have a gun with a tritium-based night sight (so the sight dots glow with no light), and it came with documentation about the provenance of each of the three tritium vials.

I also believe it is a crime to break open a sealed tritium vial.

One thing I would really like to see is the mathematical and/or notation with the tall single curly bracket (with nesting, when appropriate).

I've seen a bulleted list being used for both conjunctions and disjunctions within the same document and in both cases it was not obvious from context (it was related to conditions for receiving funding)

I have designed CSTML with that exact set of usage and features in mind. It would be absolutely perfect for what you describe. I badly need investors though. Know any lawyers interested in investing in a product like you are describing?
I don't see anything like that on the github link in your profile, but I would be interested in taking a look if you have anything public?

As to whether I know any lawyers interested in that kind of thing -- I think your thing would face the same kind of issue that others in this thread have identified: why would lawyers be interested in a product that, at the end of the day, helps them bill fewer hours? You could argue that some law firm could use it as their secret sauce like Whatsapp used Erlang or something like that, but I don't think that the legal space has many people interested in this kind of innovation.

CSTML is just a serialization language so it doesn't have a repo. Like HTML its purpose is to embed invisible structure into a steam of visible text. BABLR is the main way we do this: producing the CSTML documents with a parser.

To the extent the law can be parsed as English you could generate CSTML documents by parsing the text of laws (or even writing laws in CSTML) but I think the "secret weapon" scenario is more likely in the present -- that a firm would use CSTML to show them effectively encode their current understanding of the structure of the text of the written law.

Hey guys - I really appreciate the love from Hacker News. It's a real honor to get all of these votes and comments. If you like the idea and aren't a lawyer but want to help the project move forward, please suggest Tritium to the corporate lawyers you know.
Super interesting. Working in consulting, often with corporate lawyers. Will check it out.
Feedback: the UI feels like a direct reference to VSCode, which is familiar to software developers, but not to lawyers. If you're hoping this will be adopted by lawyers, I would focus on making the UX familiar to them. Look at software that they already use, and mimic those idioms insomuch as it makes sense to do so. I would also have the base web domain link to a normal home/info page, not to the demo directly. And maybe prefill the demo with some actual content (documents/etc) so people can really see what it does and how

Good luck!

Great feedback; and I do agree. The HN link goes to the app itself because we're impatient, but there is an actual landing page most visitors hit.

I've gone back and forth on the UX idea, and while I do agree, it's important that Tritium selects for users that are going to be able to quickly adopt the newer concepts. Just simply presenting a "better Word" isn't really going to move the needle. It's really a shift in expectations. That said, I have recently backed off defaulting to dark mode to make it feel slightly more familiar.

I think software people tend to underestimate the value of superficial familiarity. By all means, adhere to your new concepts and mental model. But even things like coloring, placement of the menu bar, the icons that you use, the organization of the UI, etc can go a really long way

Think about programming languages- ones that introduce radical new concepts may still employ familiar syntax/naming to smooth the transition for newcomers. Rust mimicked C++, TypeScript extended JS, etc. These languages were made to introduce powerful new ways of thinking about code, but by appearing as similar as possible to what devs already knew, they freed up more brain cycles for people trying to adopt them. They didn't muddy their concept-space for the sake of familiarity, but they didn't introduce any more unfamiliarity than they actually needed to for the benefits they wanted to give

No attorney who is flummoxed by this UX is going to touch an AI product in any meaningful way. Making legal tools for lawyers who would otherwise be using cuneiform tablets or the dictation pool is a waste of conversation. Looking similar to the tools a seventy five year old lawyer uses is like making an F1 car that would look familiar to Jackie Stewart: yeah, it’d probably help him adapt, but not enough to be competitive with an actual car.

Dig the idea of this product, will give it a whirl tonight.

Source: attorney, former dev

It's not about being flummoxed, it's about being annoyed enough not to give it a chance

How much less adoption would Rust have gotten if it looked like OCaml instead of C++?

Its adopters are not stupid, they could have figured out alien syntax if they were already convinced of the benefit. But selling someone on an entirely new substrate for their professional work is a huge ask. You need to make it as immediately-palatable as possible, or they'll just keep on sailing without giving it a chance.

As much as I wish the world to be different, I've heard so much whining about the Ada language's not-C-likeness that I tend to agree with you.
> Rust mimicked C++

if anything, it didn't mimick /enough/

I really like the idea. I could see some of my academic collaborators use something like this because it has features typically only supported when working with plaintext. A lot of academics do not love working with LaTeX.

But I would push back a bit against the UX and it being a "better Word". It is not immediately clear from looking at the website whether you support tracking changes. If you support editing Word documents, why aren't basic editing features, like font selection, size and weight, exposed in the UI. (I am viewing it on mobile Chrome and I might have missed it because your page doesn't support pinch to Zoom.)

You don't have to make it look like Word but it must be designed to facilitate common interaction patterns needed for working with Word documents.

(If you are building it on top of VSCode you could use its multiplayer features, which could be a good sell. )

Figure out how to make it uncompromisingly productive for power users and then dumb it down, not the other way around way around
There's a couple ways to skin it. In fields where people are happy with products, i think familiarity is good. In fields where people hate the products, you get to go in tabla rasa. In this case they take advantage of the form of the interface through multisearch et al. Instead of resembling legal software, I wonder if they should resemble a court or a briefcase?
minor nit: cmd+z is ctrl+z in macos, which felt counter-intuitive on an editor

IANAL: idk if lawyers dont do pdfs but tried some research papers and PDF rendering could use some love (MacOS)

Noted, and to be fixed. Thank you
I had edited prior message but would be great if supported PDF rendering as good as docx! (for research mostly, not a lawyer)
If this is Electron, try pdf.js - really good rendering, you can create a text layer (for text selection, etc). Probably the best result per effort you can get
One thing it does is cast the PDF to grayscale to render for speed (lawyers rarely care about the color of a legal doc in PDF), so perhaps I'll make that an adjustable setting which will trade off speed for clarity. Otherwise, it uses PDFium for PDF rendering so it should come out just as well as what you see in a Chromium-based browser.
might be an issue with DPI / Retina screens on macOS?

it's really more blurry than any pdf on chrome https://imgur.com/a/AElOuaA

Oh, yes, that is also a cheat code to render them quicker -- it downsamples the render to save time. That will improve in future versions as Tritium uses spare cycles to increase the resolution.
I also noticed when i opened a folder with hundreds of big pdf's it choked on it

seems you're doing work on all files when loading, you should be more like lazy-loading?

^ yes it does greedily ingest the PDFs to allow for instantaneous search. What it needs (and doesn't yet do) is at least multi-thread that parsing step to get a 2-4x speedup.
Say you were going to cold email a lawyer to pitch them to use this, what would you write?
Probably something like: "

[Person] - hope you're well! I wanted to put Tritium on your radar. It's a word processor jacked on steroids built just for transactional lawyers.

From built-in defined term annotation to multi-document search/replace to redlining and much, much more, it will help your team work faster and more effectively on existing Word documents and PDFs. You'll even pick up errors from outside counsel.

Tritium runs on Windows, MacOS and even Linux for your most tech savvy lawyers.

Please let me know if that might be good for your legal team, and I'd love to demo it for you."

This is a bit too heavy on the feature side. As in, here is what this is, not what it will do for you.

What would you say if you were going to focus on a pain point and a problem that this specifically solved for you, that it can also solve for the other lawyers who are not using this and that is not being met by the other options?

Take one feature: redlining. Right now every corporate lawyer knows what a pain in the ass it is to do something as simple as a diff. It takes probably a full minute (imagine if it were like that to run git diff for you!). Tritium runs the redline in microseconds, because it's built for lawyers.
There should be a "build" button that pulled all the legal codes for the target jurisdiction and other legally binding documents and checked if everything checks out.

And to achieve this you would have to create a machine readable format for legal documents, and have a library of them already converted to it.

Then you could have a linter that highlighted that you made a logical mistake or did something wrong from the perspective of a legal guy.

This looks great! I’m really stoked to see egui being used for the desktop app. While I’m not a lawyer, I was wondering about the potential for external references to cases, i.e doc1 references a case which isn’t present locally, which can then be navigated to via something like “go to definition”. Maybe something like an indexer that crossrefs on a database of legal cases? Do you have any thoughts on some other use cases? The idea of an IDE for lawyers is super cool, can’t wait to see where this goes!
Thanks so much. Yes, the plan is to package libraries along with the product to allow for all kinds of external entities to be resolved.

Egui is great!

Probably dumb question:

Given that many lawfirms bill by the hour, are there incentives to make their work more efficient? I.e. if a firm were to adopt this tool, can they practically charge more per hour than a firm that does not?

Yes, they are not incentivized to adopt new technology in their current state. The senior partners don't want to wait around for the eventuality of charging more per hour. That's why Tritium is marked to in-house lawyers for now.

I talked a little about this back in September: https://www.legalinnovators.co.uk/post/legal-innovators-uk-t...

As a private practice lawyer in a tech-heavy firm, I can assure you that not all of us are stuck at the wrong end of that paradigm!
As someone who is a (current) software engineer and (former) lawyer I find this interesting. Not sure if I'm willing to bet on big uptake, though, unless it was through an acquisition by one of the big e-discovery companies.
Looks great, sharing it with my legal team.

The "Fetch Example" button on the web demo doesn't seem to work. It would be nice if the web demo was pre-loaded with some stuff.

I tried coming back to HN using my mouse's back button, but it seems Tritium is eating mouse back button events.
Apologies if that's the case. It's just a WASM application intended to demo the real desktop application. No nefarious purpose there, but perhaps the limitations of the "preview". Try the desktop version!
Couldn't enter Japanese into the web version. Looks like it trying to read keys directly. Copy and paste don't work. Right clicking doesn't bring up a context menu with system options so no looking up words using the locally installed dictionary. No OS level spell checking that uses the user's dictionary.

I guess all of that is TBD though I suspect based on the tech choices will be way harder than it sounds.

Copy and paste don't work on the web version, but they should work (including pasting formatting out into Office products) on desktop. Similarly for fonts. If you're using a font that contains Japanese characters it should render. It doesn't (yet) do a great job on falling back.

Try the download!

I’ve been dreaming of a better contract writing tool for a while now.

I’m not a lawyer but I draft insurance contracts and work with reviewing lawyers closely. As a former software developer I miss version control, partial includes, conditional logic, etc. I am shocked at how poorly supported the business world is by the ubiquity of MS Word.

I’ve been experimenting with Typst now for some time and it has a lot of what I want in creating and versioning documents but I believe may be too technical to become integrated with existing workflows and the non-technical users engaged in the development process. Basically my experience is normal users tune out once you get outside of even basic MS Word.

I really want a great tool to exist but I’m afraid I’m an outlier and unique in my technical ability in this space. Nice to see others interested in such a tool.

Ah, a kindred spirit. I have been drafting part time for a local firm, and I feel like i’m on the cusp of a brilliant concept for pulling documents together, presenting case status to the lead lawyer … but I don’t have the time to coalesce my inklings into a tool.

I think we technical folk need to build technical tools for us to use while we explore the space and iterate on something that the normies will accept.

If you find anyone willing to invest money so a team can spend time on this, please let me know! :-)

I’m part of the team behind Zoho Contracts, focused on simplifying how businesses manage contracts across their lifecycle — from authoring, approvals, negotiation, and signing to renewals, amendments, compliance, with comprehensive analytics built in.

Our document editor is powered by Zoho Writer, offering all the capabilities of a word processor along with versioning, document assembly, and automation features. On top of this, we’ve built structured version control, clause-level change tracking, and workflow-integrated collaboration. This enables legal and business teams to work together seamlessly without relying on external editors or juggling redlined Word files over email.

Just sharing in case anyone else here is tackling similar problems or interested in the space.

Good stuff on your launch, You need a better demo page. I can't see the video, fonts are too small.
Noted, and will be done. Thank you for the feedback. Were you on mobile or desktop?
desktop and wearing my eyeglass too!
Recognizing touch controls on the document viewer tab would be nice (ex two finger drag is pan, pinch to zoom, etc).