r/fsharp • • 5d ago

library/package Smithy code generator for F#

Hi all

I'm maintaining NSmithy (https://github.com/thomaslaich/smithy-dotnet), a Smithy code generator for .NET heavily inspired by Disney's smithy4s for Scala.

Smithy is an interface definition language (IDL) developed by Amazon/AWS for mainly 2 purposes:

  • generate SDKs for AWS in all languages from the Smithy models (they are open source in JSON AST form here: https://github.com/aws/api-models-aws)
  • contract-first development of internal services at Amazon

Since version 0.16.0, NSmithy also generates native F# code, so I wanted to share this with you and hopefully get some feedback. For the server-side, it is an alternative to frameworks like Oxpecker or Giraffe: instead of writing routes and handlers, you write the contract and implement the typed handlers NSmithy generates from it. I do not recommend this necessarily for small projects in 1 single repo.

A minimal REST JSON example in F#: https://github.com/thomaslaich/nsmithy-fsharp-minimal

Current version: 0.23.0.

Happy to answer all questions if any.

Resources:

24 Upvotes

0 comments sorted by