Hacker News new | ask | show | jobs
by WalterBright 49 days ago
D doesn't allow pointer arithmetic in @safe code. At first it seems like that cannot work, but it works very well. Pointer arithmetic is relegated to functions that are @system.

The reason it works is because D has actual array types.

If you choose to use automatic memory management with D, you are memory safe.

1 comments

I'm referring to C heavily using pointer arithmetic.

If you wanted to make it easier to convert arbitrary functions to use your shiny new resizable type, you end up with something simulator to iterators.