grep -nr 'unsafe' .
Is all you need to know to consider how much of an abomination it is
The original code was one giant unsafe block with almost no tangible way to find or debug all the subtle memory bugs and leaks they had.
Now it's smaller, faster and has fewer bugs. Also its every potential memory issue is neatly annotated by an unsafe block so you can go and refactor them out one by one with confidence.
All this seems like a pretty huge improvement to me. Why is this an abomination in your eyes?
This comment inspired me to take a look at the trend of "unsafe" in the Bun code over time since the rewrite PR first landed - here are the commits where that number changed by at least 10:
So not as much cleanup as I had expected!ChatGPT written script for counting here: https://gist.github.com/simonw/b1015bcadcedd1a781cedb7af9cbb...