News for hackers. Stuff that matters.
Re:Write Elixir NIFs in Rust by el_oni on Monday August 07, 2023 @07:32AM (#37033061)
That is really neat!

I suppose the only downside of using the same code is it has the same bugs (e.g. I forgot to strip whitespace before doing a length check). So you don't get a belt and braces of having two lots of independently implemented validation

But then the upside is that it has the same bugs, so you only have to fix it once

Re:Write Elixir NIFs in Rust by DylanSp on Monday August 07, 2023 @11:51AM (#37036107)
Even if it's buggy, I figure it'd at least be consistently buggy. Part of what spurred me to make this was an issue I had with account setup for a local utility's website; their client-side validity check for creating a new password was apparently using different logic than the backend code. I kept trying to create a password, the web page said it was valid, then I'd hit submit and get rejected for having an invalid password.