parser VS assert-combinators

Compare parser vs assert-combinators and see what are their differences.

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
parser assert-combinators
4 5
5 23
- -
6.6 5.7
17 days ago 3 months ago
TypeScript TypeScript
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

parser

Posts with mentions or reviews of parser. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-04.
  • Ramda: A practical functional library for JavaScript programmers
    7 projects | news.ycombinator.com | 4 Aug 2023
    I find straight forward, dedicated combinators much more readable and practical to use ie. for iterables (context where it makes a lot of sense) [0] example [1], runtime assertions (through refutations, which are much faster than combinators over assertions) [2], parser combinators for smallish grammars [3] etc.

    In many cases vanilla/imperative js is more readable and terse, no need to bring functional fanaticism everywhere, just in places where it gives true benefits and in form that can be understood by peers.

    Functional code can be beautiful and can also be unreadable/undebugable. Same with imperative code. It's great in js/ts you can pick approach where the problem is expressed more naturally and mix it at will.

    [0] https://github.com/preludejs/generator

    [1] https://observablehq.com/@mirek/project-euler

    [2] https://github.com/preludejs/refute

    [3] https://github.com/preludejs/parser

  • Parsing Text with Nom
    4 projects | news.ycombinator.com | 12 Jan 2022
    Parser combinators are great, we're using parser combinators in production, they are great ie. for typescript [0].

    [0] https://github.com/preludejs/parser

  • Parser Combinators in Haskell
    10 projects | news.ycombinator.com | 22 Dec 2021
  • Casual Parsing in JavaScript
    5 projects | news.ycombinator.com | 19 Aug 2021

assert-combinators

Posts with mentions or reviews of assert-combinators. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-01-24.
  • Kysely: TypeScript SQL Query Builder
    19 projects | news.ycombinator.com | 24 Jan 2023
    We use in prod variant of no 1. [0]. Why? Because:

    * it's extremely lightweight (built on pure, functional combinators)

    * it allows us to use more complex patterns ie. convention where every json field ends with Json which is automatically parsed; which, unlike datatype alone, allows us to create composable query to fetch arbitrarily nested graphs and promoting single [$] key ie. to return list of emails as `string[]` not `{ email: string }[]` with `select email as [$] from Users` etc.

    * has convenience combinators for things like constructing where clauses from monodb like queries

    * all usual queries like CRUD, exists etc. and some more complex ie. insertIgnore, merge1n etc has convenient api

    We resort to runtime type assertions [1] which works well for this and all other i/o; runtime type assertions are necessary for cases when your running service is incorrectly attached to old or future remote schema (there are other protections against it but still happens).

    [0] https://github.com/appliedblockchain/tsql

    [1] https://github.com/appliedblockchain/assert-combinators

  • GraphJin – An Instant GraphQL to SQL Compiler
    12 projects | news.ycombinator.com | 28 May 2022
    We use not so much frameworks but combination of lightweight libraries:

    - runtime assertions [0] - to map unknown values at i/o boundary into statically typed code (rpc input parameters, sql results etc)

    - template based sql combinators to sanitize sql/generate sql [1]

    - jsonrpc over websockets - for bidirectional comms between f/e and b/e

    [0] https://github.com/appliedblockchain/assert-combinators

    [1] https://github.com/appliedblockchain/tsql

  • Parser Combinators in Haskell
    10 projects | news.ycombinator.com | 22 Dec 2021
  • An Inconsistent Truth: Next.js and Typesafety
    5 projects | news.ycombinator.com | 2 Dec 2021
    Types can be asserted at runtime (parsed) at IO boundaries (reading http request or response, websocket message, parsing json file etc). Once they enter statically type system they don't need to be asserted again.

    The difference it makes is illusion of type-safety vs type-safety this article touches on.

    You can try to bind service with client somehow but in many cases this will fail in production as you can't guarantee paired versioning, due to normal situations by design of your architecture or temporary mid-deployment state or other team doing something they were not suppose to do etc. It's hard to avoid runtime parsing in general.

    Functional combinators [0] or faster [1] with predicate/assert semantics work very well with typescript, which is very pleasant language to work with.

    [0] https://github.com/appliedblockchain/assert-combinators

    [1] https://github.com/preludejs/refute

  • Parsix: Parse Don't Validate
    6 projects | news.ycombinator.com | 15 May 2021
    Once i/o boundaries are parsing unknown types into static types, your type safety is guaranteed.

    [0] https://github.com/appliedblockchain/assert-combinators

What are some alternatives?

When comparing parser and assert-combinators you can also consider the following projects:

instaparse

pyparsing - Python library for creating PEG parsers

httpaf - A high performance, memory efficient, and scalable web server written in OCaml

three-pass-compiler - Solution to the Three Pass Compiler kata on CodeWars, parsing and manipulating a very simple AST

refute - Refute module.

parser-combinators - Parser combinators.

generator - Generator module.

angstrom - Parser combinators built for speed and memory efficiency

wundergraph-demo - This Repository demonstrates how to combine 7 APIs (4 Apollo Federation SubGraphs, 1 REST, 1 standalone GraphQL, 1 Mock) into one unified GraphQL API which is then securely exposed as a JSON API to a NextJS Frontend.