Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Drop support for 32-bit platforms #6

Open
masonmark opened this issue Jul 14, 2017 · 2 comments
Open

Drop support for 32-bit platforms #6

masonmark opened this issue Jul 14, 2017 · 2 comments
Labels

Comments

@masonmark
Copy link
Collaborator

Dropping support for 32-bit will allow us to use Int for all API data structures (which include 64-bit integers). Why is that desirable? Because it will let us use JSONSerialization to decode arbitrary JSON data structures (we will move Codable for serialization of objects/structs, and known JSON structures).

The JSONSerialization implementation on Linux does not support Int64 regardless of platform, but it does support 64-bit Int on 64-bit platforms.

At this point, I think we still want to use JSONSerialization when receiving an unknown/arbitrary structure as JSON.

@masonmark
Copy link
Collaborator Author

The JSONDecoder.UnevaluatedJSON mentioned in this post by Itai Ferber (main guy behind Codable) sounds intriguing... but also far in the future (post-Swift 5).

Also interesting: I read on that same forum that Codable uses JSONSerialization under the hood, so it's probably a safe bet that JSONSerialization will be fairly well-maintained going forward (it's had quite a few issues on Linux over the life of this project, but has steadily advanced...).

@masonmark
Copy link
Collaborator Author

Hmm, we have a unit test for our assumption that "JSONSerialization cannot decode an Int64" that I just noticed fails on Swift 4.1 beta and Ubuntu 16.04... which means it can decode that now. I should go back and trace when that assumption became invalid.

I have no idea what my own comment above means: "The JSONSerialization implementation on Linux does not support Int64 regardless of platform, but it does support 64-bit Int on 64-bit platforms." (Did I mean 64-bit Apple platforms? Is Linux JSONSerialization's ability to decode Int64 actually new?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant