you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 6 months ago (6 children)

I thought one of the goals of Java and similar was partial memory safety? If it didn't have null it seems it would be most of the way there.

And don't forget Basic. Yeah most variants had pointers and equivalents to null, but they are 'advanced' and not meant for general code. (Although that's interpreted and you said compiled, often it could be 'complied' similarly to Java bytecode)

  • source
  • parent
  • hideshow 6 child comments
  • [–] 3 points 6 months ago (1 child)

    @davidgro @hunger Last basic variant I worked with was the basic of the commodore machines. It had no NULL. I have also seen vbscript a little, afaik also it had not.In Java, null does not mean a real 0 value, I think it is more like a static const, more similar to the None type of the Python. Its name is only a helper for the C/C++ guys to better understand a stack trace.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 6 months ago

    Ah, yeah looks like address 0 is nothing special on C64. I was thinking more about things like Qbasic and especially Visual Basic where dereferencing address 0 expecting a string or object is easy enough to do.

  • source
  • parent
  • [–] 2 points 6 months ago

    A null does not make it memory unsafe. You aren't accessing invalid memory, the runtime just raises a NRE. Which is fine. No memory safety violated.

    Java is, as long as you stick to pure java and not native interop, entirely memory safe. And that's achieved by giving up control of memory allocation to the garbage collector.

    Rust is not the first memory safe language. It does however, manage to achieve memory safety without needing a garbage collector. Which is what drew my initial interest.

  • source
  • parent
  • [–] -2 points 6 months ago (1 child)

    @davidgro @hunger Learn the three languages you are talking about before talking about them. Ill-informed thoughts impress no one.

  • source
  • parent
  • hideshow 1 child comment