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

I am not an expert but I’d say it’s because Awk arrays are associative; they are more like maps than slices, to use Go terminology. And IIRC (it’s been a while) the array values are not strongly typed. So I think you could even say:

  a[1] = “hello”
  a[“world”] = 2
That means that - unlike C arrays - Awk arrays are not a simple, addressable byte range, but a complex data structure with lots of pointers.

I suppose you could come up with a way to serialise the array and pop it on the stack but that would be a lot of work, and for the kind of things I use Awk for, the arrays would often be huge.



I'm not really convinced my that argument. No matter how big your associative array is, it is still represented by a pointer to the initial/root element. It should be quite possible to move the pointer into the caller.

Maybe the language is simpler without it, and that can be a good reason to avoid it. But I don't buy that it has anything to do with GC.




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

Search: