Better HN
topnewbestaskshowjobs
Log inSign up

zachkirsch

12 karma · joined Jul 16, 2018 (8y ago) · 10 submissions

Submissions

1.

Show HN: Word in 2 (Puzzle)(wordin2.com ↗)

2 points · by zachkirsch · 1y ago · 3 comments

2.

Show HN: An auto-generated OpenAI Node SDK that's better than the official one(github.com ↗)

5 points · by zachkirsch · 3y ago · discuss

comment 3y ago · link · parent

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

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 - 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 if you want to see a demo of using Fern + Express: https://www.loom.com/share/31f4243c4d824c54938bdc4840fbb8ba

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.

4.

Fern: A cross-language alternative to tRPC(github.com ↗)

5 points · by zachkirsch · 3y ago · 1 comment

5.

How Candid sped up API development by 50% by going schema first(buildwithfern.substack.com ↗)

5 points · by zachkirsch · 3y ago · discuss

comment 3y ago · link · parent

> Smithy trait seem to be an escape hatch for everything, I believe it could be used to achieve the same but maybe not easier.

No doubt! This is definitely part of our thinking - there's a lot of things that are _possible_ in Smithy (and OpenAPI), but it requires you to be an expert and really understand how things work. For 90% of the use cases, it should be dead simple. For the remaining 10%, it's okay to rely on more complex features like plugins and traits.

comment 3y ago · link · parent

Yes, we are! We're planning on offering a paid site where all the generation and publishing happens in the cloud.

comment 3y ago · link · parent

Thanks for checking out Fern!

Smithy is an awesome library, and we love the VSCode extension that makes it easy to click around in the Smithy files.

We built our own spec because there's a lot of cool SDK features that aren't supported in Smithy. For example:

- Audiences. It should be easy in the spec to specify some endpoints as "internal only" to include them in the internal SDKs, but exclude them from the external SDKs.

- Per-endpoint errors. Smithy doesn't have a concept of specifying which non-200 responses a particular endpoint might return. It's super helpful in the SDKs to know which errors might be thrown from a particular endpoint.

- Pagination. It should be easy in the spec to specify that an endpoint is paginated, so the SDK is able to page through results easily (e.g. for-await in TypeScript). Note: this is a WIP and not yet released in Fern.

Having our own spec also lets us be more creative with the feature set we provide. For example, we want to add support for websockets and webhooks.

All that said, we're not aiming to be a competing standard. There's so much tooling already for these different specs, and it should be easy to convert between them. Our Smithy->Fern converter is in development so that Smithy users can take advantage of our SDK generators.

9.

Show HN: Fern, a language for defining REST APIs that compiles into OpenAPI(github.com ↗)

18 points · by zachkirsch · 3y ago · 7 comments