What are some reasons to use metaprogramming?

This page summarizes the projects mentioned and recommended in the original post on /r/functionalprogramming

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.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • zod

    TypeScript-first schema validation with static type inference

  • There’s many times when I want to generate code based on TS types, like data validators, OpenAPI schemas, and test data generators. TS explicitly does not support generating or changing the runtime semantics of code (except for enums) so there’s no way to do this. The alternative that people have come up with is to use tools like zod to infer types from a runtime combinator library, but this is limiting. The code is challenging to write and there’s no way to control the representation of inferred types in intellisense, so the development ergonomics are not as good as they would be if we could go from types -> code via macros.

  • sweet.js

    Sweeten your JavaScript.

  • TS doesn’t have monadic do notation, which is something that I want very badly. This would be easy to add to JavaScript with Sweet.js macros, but there’s no equivalent tool for TypeScript. I expect that extending this to TypeScript would be very difficult.

  • 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
  • static-land-recursion-schemes

    Javascript recursion schemes compatible with flow-static-land

  • I, like many functional programmers, desperately wish that TypeScript had higher-kinded types. There’s a way to simulate them using some boilerplate and unsafe casts, but I have found that this makes code much harder to read when doing advanced operations. With macros, we could generate the coercion functions automatically and transform the type signatures to look better. We’d still have to call the coercion methods manually, and we’d get worse type inference, but it could be worth a try.

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

  • Simplifying Form Validation with Zod and React Hook Form

    1 project | dev.to | 4 May 2024
  • From Flaky to Flawless: Angular API Response Management with Zod

    1 project | dev.to | 25 Apr 2024
  • You can’t run away from runtime errors using TypeScript

    1 project | dev.to | 10 Apr 2024
  • Epic Next JS 14 Tutorial Part 4: How To Handle Login And Authentication in Next.js

    1 project | dev.to | 4 Apr 2024
  • Error handling in our form component for the NextAuth CredentialsProvider

    2 projects | dev.to | 1 Apr 2024