inkwell icon indicating copy to clipboard operation
inkwell copied to clipboard

A more ergonomic and elegant API

Open Immortalin opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. Llama does not seem to be receiving any more new updates. It has a much more pleasant API than Inkwell, perhaps Inkwell can adopt some of its designs.

Immortalin avatar Mar 25 '21 07:03 Immortalin

Thanks for pointing out Llama. Didn't know about it. Is there anything in particular you had in mind? A lot of their design looks to be based on inkwell

TheDan64 avatar Mar 25 '21 13:03 TheDan64

Their function creation code (in the README example) is much more cleaner.

Immortalin avatar Mar 26 '21 18:03 Immortalin

Llama neglects a lot of type-safety here:

  1. You can provide any Type to FuncType::new, even types that are not valid to be there.
  2. Params passed to add aren't guarenteed to be integers, and would fail IR validation. Inkwell guarentees this upfront

declare_function taking a closure is kinda cool, but forces assumptions on you about basic blocks. Looking at the example, it's not even clear to me how do you manage basic blocks.

I think something like this would be better served as an abstraction ontop of inkwell, rather than changing inkwell to be less concrete

TheDan64 avatar Mar 26 '21 21:03 TheDan64