News for hackers. Stuff that matters.

Show HN: Fern, a cross-language alternative to tRPC

https://github.com/fern-api/fern

_Showing is better than telling:_ Here's a [Loom](https://www.loom.com/share/31f4243c4d824c54938bdc4840fbb8ba) if you want to see a demo of using Fern + Express

Hi HN,

I'm a huge tRPC fan because it subtly forces you to practice schema driven API development. You start by defining your API (using zod), and as a result, you get awesome autocomplete in your IDE.

However, there are a few things about tRPC I don't particularly like:

1. It's for TypeScript backends only! Sometimes I want the same value prop as tRPC but I need to write the backend in python (e.g. for ML applications).

2. It's for TypeScript frontends only! tRPC gives you a TypeScript client out of the box, but no other languages. You can go tRPC -> OpenAPI, but the OpenAPI-generated clients are pretty bad - definitely not up to the bar of what I'd show to a customer.

3. The wire format of tRPC's requests are pretty bonkers. They eschew normal REST conventions, so it's pretty painful to interact with tRPC from curl, Postman, and other languages besides TypeScript.

Fern is similar to tRPC but for cross-language development:

1. Define your API in a [simple format](https://docs.buildwithfern.com/definition) - similar to OpenAPI but much easier to read and write.

2. Generate server boilerplate - very similar to the tRPC experience, but we support Express, FastAPI, and Java Spring. Here's a [Loom](https://www.loom.com/share/31f4243c4d824c54938bdc4840fbb8ba) if you want to see a demo of using Fern + Express.

3. Generate client SDKs that are actually good. The initial spec is purpose-built for code generation, so the resulting SDKs are actually production quality - e.g. FlatFile uses Fern for their [Node SDK](https://github.com/FlatFilers/flatfile-node).

4. Work with your favorite tools! You can easily generate an OpenAPI spec and Postman collection as well.

( no comments | on HN )

There are no comments yet.