TVL depot development (mail to depot@tvl.su)
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Implement serde::Deserialize for Value
@ 2022-12-24 17:27 Ryan Lahfa
  2022-12-24 17:27 ` [PATCH 1/2] feat(tvix/eval): implement From<f64> " Ryan Lahfa
  2022-12-24 17:27 ` [PATCH 2/2] feat(tvix/eval): implement serde::Deserialize " Ryan Lahfa
  0 siblings, 2 replies; 3+ messages in thread
From: Ryan Lahfa @ 2022-12-24 17:27 UTC (permalink / raw)
  To: depot; +Cc: flokli, Ryan Lahfa

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-24 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-24 17:27 [PATCH 0/2] Implement serde::Deserialize for Value Ryan Lahfa
2022-12-24 17:27 ` [PATCH 1/2] feat(tvix/eval): implement From<f64> " Ryan Lahfa
2022-12-24 17:27 ` [PATCH 2/2] feat(tvix/eval): implement serde::Deserialize " Ryan Lahfa

Code repositories for project(s) associated with this public inbox

	https://code.tvl.fyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).