News for hackers. Stuff that matters.

calebwin

Re:RLSL: a Rust to SPIR-V Compiler on Friday October 25, 2019 @01:43AM (#21352209)
https://docs.rs/em contains not only documentation but also comprehensive explanation on effectively using Emu.

I would recommend looking through it first. Of course, if you have questions feel free to ask - https://gitter.im/talk-about-emu/thoughts

Re:RLSL: a Rust to SPIR-V Compiler on Monday October 21, 2019 @05:06PM (#21317363)
- Maybe there is a component of RLSL that could be useful. I have to think more about what I want that component to be.

- I want Emu to support general Rust code but still use stable Rust and provide really nice compile-time errors. Maybe Emu could do AST-level checking to (1) ensure that only legal transpilable-to-SPIR-V subset is used, (2) infer the kernel parameters, (3) infer global work size, local work size and then do MIR-level compilation to OpenCL or SPIR-V?

- At the moment, I want to focus on AST-level compilation because I think many applications (AI, ML, simulations, etc.) can still technically be implemented without a huge subset of Rust.

Re:RLSL: a Rust to SPIR-V Compiler on Monday October 21, 2019 @04:01PM (#21316614)
I've been working on a project with similar goal to RLSL, called Emu. It's a procedural macro that automatically off-loads portions of code to run on a GPU. Here's a quick example...

  #[gpu_use]
  fn main() {
      let mut a = vec![0.2; 1000];
      let mut b = vec![0.3; 1000];
      let c = vec![0.0; 1000];

      gpu_do!(load(a));
      gpu_do!(load(b));
      gpu_do!(load(c));
      gpu_do!(launch());
      for i in 0..1000 {
          c[i] = a[i] + b[i];
      }
      gpu_do!(read(c));
      
      println!("{:?}", c);
  }
Emu is currently open-sourced as a 100% stable Rust library and while it only supports a tiny subset of Rust, that subset is well-defined with useful compile-time errors and a comprehensive test suite.

So if you're looking for a way to contribute to single-source GPGPU for Rust, please consider helping expand Emu's supported subset of Rust. The repository is at https://www.github.com/calebwin/emu

I will say that since Emu works at the AST/syntax level, RLSL is of great interest to me because it works instead at the MIR level which allows it to more easily support a large subset of Rust.

Re:The Lobster Programming Language on Wednesday April 03, 2019 @06:09PM (#19567666)
Would you mind elaborating on the "compile time reference counting"? Is this new? How does it handle cycles?
I really like that graphic for the website and README! Did you make it?
Re:About V, the language Volt is written in on Tuesday February 12, 2019 @06:22PM (#19148748)
Would you mind explaining why compiling to machine code was faster than to C?
Re:About V, the language Volt is written in on Wednesday February 06, 2019 @09:37PM (#19102461)
Isn't the main reason why languages like Go and Rust don't do that because it would produce a ton of memory garbage?
Re:Ask HN: Can we write a programming language for biology? on Monday January 07, 2019 @10:03PM (#18852745)
there's this language called gro that i'm hoping to look into when i get some time - http://depts.washington.edu/soslab/gro/