Hacker News new | ask | show | jobs
by learyg 2121 days ago
Thanks again for the detailed thought! We actually [developed more advanced bit slicing syntax]( https://github.com/google/xls/blob/1b6859dc384fe8fa39fb901af... ) since that example was written, you can do things like a standard slice `x[5:8]` or a Verilog-style "width slice" that has explicit signedness `x[i +: u8]`. There's currently no facility for "destructuring" structs as bitfields like pattern matches, but there's no conceptual reason it can't be done, I think that'd be an interesting thing to prioritize if there's good bang for the buck. [Github issue to track!](https://github.com/google/xls/issues/131) Let me know if I missed out on details or rationale, thanks!
1 comments

Hey, thanks for replying, the project looks like it has a lot of potential. You're right, bit slicing gets you like 99% of the way there (the rest is just syntax sugar). It's interesting because from what I remember there were some non-trivial issues for the people using LLVM for their IR because of fundamental assumptions in the representation, but bit-slicing is the core functionality. Is there a reason you guys decided on your own IR?