Dan Kolsoi

Results 260 comments of Dan Kolsoi

You maybe want something like the `rental` crate, which allows for self-referential structs by doing the unsafe bits for you. Though it's worth noting that `rental` is no longer maintained...

1. This was just a naming choice since in Rust `vec` is well known to mean `vector` 2. Vectors are purely mathematical constructs and therefore can only be used with...

I don't really understand what you're trying to do. If you want to use stdin/out rust provides methods to use them in [std::io](https://doc.rust-lang.org/std/io/index.html). Inkwell provides some methods to print llvm...

If you're trying to print the module to stdout you can do `println!("{}", module.print_to_string());` or if you're trying to write to stdout in your generated program you'll have to call...

I believe if you [create a `FunctionValue`](https://thedan64.github.io/inkwell/inkwell/module/struct.Module.html#method.add_function) with no body attached to it, it'll assume it's extern. As long as it has a matching signature to the LLVM builtin function...

Could you explain how labels are generally used? I'm only aware that some intrinsics use them as params?

Also, we already have metadata

`num` crate doesn't look like it could help but `typenum` defines types for a lot of int sizes. So we could probably use those for custom width types: `IntValue`, `IntType`...

Also, it seems like signed types should be explicit, though LLVM doesn't make this distinction.

It's worth noting StructTypes (and probably StructValues) have two interesting properties: * Can be opaque, that is, no body yet set, which is useful for recursive types. So we need...