bagel-rs

By brundonsmith

Bagel-rs Alternatives

Similar projects and alternatives to bagel-rs

  1. go

    2,197 bagel-rs VS go

    The Go programming language

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. rust-playground

    The Rust Playground

  4. pest

    45 bagel-rs VS pest

    The Elegant Parser (by pest-parser)

  5. grammars-v4

    Grammars written for ANTLR v4; expectation that the grammars are free of actions.

  6. salsa

    20 bagel-rs VS salsa

    A generic framework for on-demand, incrementalized computation. Inspired by adapton, glimmer, and rustc's query system.

  7. grafbase

    The GraphQL Federation platform

  8. librdx

    Replicated Data eXchange format C lib

  9. pathlib

    Go's own object-oriented path library (by chigopher)

  10. CG-SQL-author

    CG-SQL Author's Cut: CG/SQL is a compiler that converts a SQL Stored Procedure like language into C for SQLite. SQLite has no stored procedures of its own. CG/CQL can also generate other useful artifacts for testing and schema maintenance.

  11. chesskell

    Chess. In Haskell! (by ryandv)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better bagel-rs alternative or higher similarity.

bagel-rs discussion

Log in or Post with

bagel-rs reviews and mentions

Posts with mentions or reviews of bagel-rs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-11-07.
  • Why I love Rust for tokenising and parsing
    12 projects | news.ycombinator.com | 7 Nov 2024
    Yup! You can find it here: https://github.com/brundonsmith/bagel-rs/blob/master/src/mod...

    [trying to remind myself how this works because it's been a while]

    So it's got macros for defining "union types", which combine a bunch of individual structs into an enum with same-name variants, and implement From and TryFrom to box/unbox the structs in their group's enum

    ASTInner is a struct that holds the Any (all possible AST nodes) enum in its `details` field, alongside some other info we want all AST nodes to have

    And then AST is a struct that holds (1) an RC, and (2) a PhantomData, where TKind is the (hierarchical) type of AST struct that it's known to contain

    AST can then be:

    1. Downcast to a TKind (basically just unboxing it)

    2. Upcast to an AST

    3. Recast to a different AST (changing the box's PhantomData type but not actually transforming the value). This uses trait implementations (implemented by the macros) to automatically know which parent types it can be "upwardly casted to", and which more-specific types it can try and be casted to

    The above three methods also have try_ versions

    What this means then is you can write functions against, eg, AST. You will have to pass an AST, but eg. an AST can be infallibly recast to an AST, but an AST can only try_recast to AST (returning an Option>)

    I worked in this codebase for a while and the dev experience was actually quite nice once I got all this set up. But figuring it out in the first place was a nightmare

    I'm wondering now if it would be possible/worthwhile to extract it into a crate

Stats

Basic bagel-rs repo stats
1
0
-
over 1 year ago

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com