• @Static_Rocket
    link
    English
    101 day ago

    For those who don’t want to click the link for context:

    OA Tree-Sitter language.

    A small langauge that can be used to generate tree-sitter grammar without JS.

  • fxomt
    link
    fedilink
    3
    edit-2
    1 day ago

    That’s pretty cool, was this a practice for actual compiler development? Or for fun, or an actual project?

    • @[email protected]OP
      link
      fedilink
      41 day ago

      I’m intending to use this for a custom language “OA” that I want to compile to Rust and JS to start with.

      I don’t know enough about LLVM to compile directly to machine code although I would like to.

      • fxomt
        link
        fedilink
        61 day ago

        I love compiler dev, so i can give you a few tips:

        It may be hard to compile to rust, due to the borrow checker; but C or javascript are great first backends, i always go with C for my prototypes.

        PS: Don’t go with LLVM early on, it has almost no documentation! it’s not worth it, i learned that the hard way. Even zig replaced their LLVM backend with a C one.

        Also some good libraries for rust:

        Here’s a great list of libraries that can help with building it: https://github.com/Kixiron/rust-langdev

        Good luck with OA :)

        • @[email protected]OP
          link
          fedilink
          41 day ago

          Thanks!

          I intend for the language to have a similar borrow checker and type system. Which is why I’m targeting rust. It means I have something to check against when writing the tooling. (Although I’m not sure I’ll get that far. My computer is littered with dead projects).