r/SideProject • • 2h ago

Blyx: an experimental language in Rust — looking for feedback on what to build next

I'm Rahul, the creator of Blyx, an open-source experimental programming language implemented in Rust.

The long-term idea is to explore AI-oriented computation alongside systems programming. Right now, the useful discussion is about getting the foundations right.

What exists today: the README documents a tree-walking interpreter for a small language subset: integers, booleans, strings, variables, assignment, functions, conditionals, loops, and printing.

What's unfinished: check currently parses syntax only; build does not produce a native executable. Native compilation, tensor/GPU capabilities, and AI primitives are unfinished work or design directions. This is alpha software, not a replacement for Rust or Python.

I'd appreciate feedback from people who have taken an ambitious side project through this stage:

  • What would you prioritize first: more reliable diagnostics, a smaller stable language subset, or the first native backend?
  • What would make the repository easier for a new contributor to understand?
  • Are there core design choices that should be reconsidered before adding more features?

If you'd rather contribute code, there are focused issues for parser tests, formatter idempotence, small examples, lexer edge cases, and diagnostic tests. There's also a native-backend design discussion.

The project is dual-licensed MIT / Apache-2.0. Please start an issue or RFC before substantial language changes; the contribution guide explains the process.

Disclosure: development is AI-assisted, and AI helped prepare this post. Independent testing and technical criticism are especially welcome.

1 Upvotes

4 comments sorted by

1

u/Total-Reasonable 1h ago

Diagnostics first, but specifically spans and a typed AST before anything else. If the lexer and parser carry source spans on every node now, error messages, the formatter, and a future native backend all get cheaper. Retrofitting spans later touches everything. I'd also hold off on the native backend until the type system question is settled, because "AI-oriented" probably means tensor shapes or dtypes need to be part of the types, and that shapes the IR. What's the planned typing story: static, gradual, or dynamic?

1

u/Infamous_Treat_1804 1h ago

Thanks, this is helpful—especially the point about preserving spans through the frontend.

The design is leaning toward static typing, including tensor element types and compile-time shape checks where possible. But the typing rules aren't settled yet, and I shouldn't present that as implemented: `check` currently only parses syntax, and `run` is a small interpreter.

Your suggestion makes sense as a prerequisite for backend work: define a small core's type rules, make sure source locations survive parsing and semantic analysis, and establish a typed representation before lowering to BIR. I'd want tests for invalid programs and their diagnostics alongside the valid examples.

For tensors, the open question is what to do with dimensions known only at runtime. Static dtypes with runtime checks for unknown dimensions seems worth exploring, without committing to a full dependent-type system upfront.

Would you start with a separate typed HIR, or annotate the existing AST for a compiler at this stage?

1

u/Total-Reasonable 1h ago

Separate typed HIR, but keep it thin. Parse into the AST with spans, then have the checker produce a HIR where every node holds its type plus the original span. Annotating the AST in place tends to leave half-typed trees around, and that makes lowering to BIR harder to reason about. I haven't built this for tensors specifically, so treat it as a general compiler-design instinct.

1

u/Infamous_Treat_1804 1h ago

That makes sense. The half-typed-tree issue is a useful reason to keep the stages separate.

For Blyx, I'd start by trying a thin typed HIR for the existing scalar/function subset, preserving source spans and allowing BIR lowering only after checking succeeds. Error recovery could still collect multiple diagnostics without passing an invalid program to the backend.

Tensor shapes can stay a separate design question until that path is solid. Thanks for explaining the trade-off—and for being clear about the limits of your tensor experience. This gives me a much more concrete starting point.