Subject: [PATCH 0/2] Implement serde::Deserialize for Value

From: Ryan Lahfa <[email-masked]>
Date: Sat, 24 Dec 2022 18:27:44 +0100

As per IRC discussions, this tries to bring an impl of
serde::Deserialize for Value.

Various questions are:

- Do we want to keep the ugly #[serde(skip)] for the other values?
  - I think it's quite neat to know it _should be possible_ to serialize
    as-is a Value structure, but I feel like there's two policies of
    serialization.
    A public-facing one and an internal one.
- Do we want to introduce `serde_test` to perform ad-hoc unit testing of
  the deserialization process?
- Performance testing? It seems like the #[derive] stuff is generating
  fast enough deserialization, similar to handwritten ones.
- Conversion from ErrorKind to serde errors?
  - I see there is a Error paired with a ErrorKind and a Span, I'm not
    sure we can get the Span in the deserialization process without
    being too involved.
  - I am not sure I see a way to convert a "partial" string and let
    serde fill the rest, with the span itself for example.

Ryan Lahfa (2):
  feat(tvix/eval): implement From<f64> for Value
  feat(tvix/eval): implement serde::Deserialize for Value

 tvix/eval/Cargo.toml                          |  2 +-
 tvix/eval/src/builtins/mod.rs                 |  4 +-
 .../tests/tvix_tests/eval-okay-fromjson.exp   |  2 +-
 .../tests/tvix_tests/eval-okay-fromjson.nix   |  1 +
 tvix/eval/src/value/attrs.rs                  | 39 ++++++++++-
 tvix/eval/src/value/list.rs                   |  4 +-
 tvix/eval/src/value/mod.rs                    | 65 ++++++-------------
 tvix/eval/src/value/string.rs                 | 34 ++++++++++
 8 files changed, 101 insertions(+), 50 deletions(-)

-- 
2.38.1