Skip to content

Rename JavaNull? #7759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
odersky opened this issue Dec 14, 2019 · 1 comment
Closed

Rename JavaNull? #7759

odersky opened this issue Dec 14, 2019 · 1 comment

Comments

@odersky
Copy link
Contributor

odersky commented Dec 14, 2019

Now that explicit nulls are merged, I wanted to raise an issue of naming: Should we continue to use JavaNull for the null type that comes from the host system and is not checked? Isn't Java too specific, after all there's also a null in JS and in C, and whatever other language runtime Scala might be embedded in?

Alternatives could be:

  HostNull
  PlatformNull
  UncheckedNull
  UnsafeNull
  SilentNull
  LegacyNull

It would be good to get further suggestions and feedback on this.

@sjrd
Copy link
Member

sjrd commented Dec 14, 2019

At least for JavaScript, all possible nulls would be explicitly written out in the façade types, which are written in Scala. So in Scala.js we'll never use the platform Null.

For Native it's less clear. An automated importer from C headers would probably choose to use the platform Null when typing pointers.

I believe UncheckedNull is a good one. It fits the narrative of Scala.js which has socalled unchecked behaviors for error conditions such as class cast and index out of bounds.

@anatoliykmetyuk anatoliykmetyuk added this to the 0.21 Tech Preview milestone Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants