We don't need runtime type checks

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • io-ts

    Runtime type system for IO decoding/encoding

  • That works wonderful as long as you have a flexible type system like Typescript. For me io-ts[0] has been a godsend when I want runtime type-checking on io boundaries (and you may have a lot of them in a front-end application).

    [0]: https://github.com/gcanti/io-ts/blob/master/index.md#typescr...

  • zod

    TypeScript-first schema validation with static type inference

  • These sorts of libraries are great in my experience. Here's a comparison of some of the more popular ones:

    https://github.com/colinhacks/zod#comparison

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • weblog

  • > When type errors occur in production, the end result is the program crashing, nothing you can do about it.

    Uh, you can catch the type error and recover (e.g., as with any other runtime failures, fail the incoming request that triggered the failure, unwinding the stack and reclaiming memory).

    And, even if you didn't, crashing may be the ideal reaction: https://github.com/alefore/weblog/blob/master/software-corre...

    (That said, there are many reasons to prefer static type checks; I just find this specific argument flawed.)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts