为什么脚本(动态)语言没有指针? [关闭]

I was wondering why scripting languages (python,php,ruby,perl) don't have pointers such as C/C++,Objective-C so on?

Because pointers, while very versatile, are a pain-in-the-ass source of bugs. The whole point of higher-order languages is abstraction of dangerous or verbose constructs into safer and shorter ones: you trade power for ease of development. Thus, for example, arrays in dynamic languages all know how to allocate themselves, free themselves, and even resize themselves, so the programmer does not need to worry about it (and can't mess it up). It is the same reason why we don't normally program in assembly unless we really really want to control every cycle of the processor: too verbose, too easy to make a mistake (which is why C/C++, Objective-C and so on exist in the first place). Dynamic languages are a step further in the same direction.

Question is too general too be answered on Stackoverflow. But the answer is - scripting languages try to be as hardware independent as they can. And that includes no knowledge of RAM structure and content.

A major difference between the two categories is that scripting languages don't necessarily deal with things like, say, memory in a direct manner. In your C languages you have memory and have to allocate and manage it. In PHP, however, you don't generally manage your memory directly (and in most cases, the memory usage is transparent to the programmer). The underlying software does this for you. So it's entirely possible to write software without knowing a thing about machine level code, malloc, etc.