Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> don't "convert" PHP code into Rust. Re-design your program.

Trust me, I am!

For example, I'm rewriting all the (very-efficient) PHP regex code to a much more convoluted version because Regex::new is so costly.

Less sarcastically, I am embracing the Rust Way where necessary. My complaint is that the Rust Way sometimes forces me to depart from the idealised pseudocode version of a given algorithm much more drastically than PHP does.



Wait... You're rewriting the PHP regex code instead of using the regex crate?! Just...wait...why?

Are you using lazy_static? See: https://docs.rs/regex/latest/regex/#example-avoid-compiling-...


Any reason why you can't put the Regex in a once_cell and then keep on applying it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: