3) ElixirConf 2017 - Elixir Native UI - Boyd Multerer

One more thing…

On ports vs. NIFs. I landed on Ports. The performance is fine for what I’m trying to achieve. I did prove to myself that I could get it working as a NIF in the future under Linux and such, but losing OTP is a heavy price to pay in the event of an error. Too much C code in the render and not enough benefit to make it a NIF.

Besides, it is really cool to force a crash in the render and just watch everything recover.

By the way, pretty sure it is not possible to do it as a NIF on the Mac. Turns out you can only ever open a window under OSX on the main thread of an application. That’s something that dates back to the NeXT. Trying to do so in a threaded NIF is a fast way to bring down OTP on a Mac.

1 Like