Those feel fine to me. The look good, they read well, they’re unambiguous. I know what exactly functions are being called. It feels like you’re using the language.
If we want to deprecate
as , we should also improve the ergonomics of
I don’t think
into has an ergonomics problem. It’s a simple method call – If that constitutes an ergonomics problem, then the whole language is borked.
make yourself use these instead of
as in FFI code. let me know how it goes.
I can imagine billions of different ways to write FFI code. Perhaps you have some particularly unreasonable code on your mind? All of the FFI code I’ve written involves doing conversions up front and then passing arguments to extern functions. And there, this would make no difference, as I’m not computing anything with long multi-typed maths expressions. In either case, I would put just values in temporaries, because
as isn’t particularly pleasant either.
But that’s all just a builtin hazard of doing anything that requires careful numerical conversions. You hide that stuff behind a function and forget about the implementation. Especially for FFI code.