this post was submitted on 11 Jan 2025
11 points (78.9% liked)

Programming

17784 readers
143 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

cross-posted from: https://lemm.ee/post/52336135

you are viewing a single comment's thread
view the rest of the comments
[–] Val@lemm.ee 4 points 22 hours ago (1 children)

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@lemm.ee 7 points 22 hours ago (1 children)

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 :)

[–] Val@lemm.ee 4 points 22 hours 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).