Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 22:15
    epage commented #490
  • Jan 31 21:54
    AlexTMjugador commented #490
  • Jan 31 21:41
    epage closed #505
  • Jan 31 21:41
    epage commented #505
  • Jan 31 21:18
    AlexTMjugador synchronize #505
  • Jan 31 21:16
    AlexTMjugador synchronize #505
  • Jan 31 20:47
    AlexTMjugador synchronize #505
  • Jan 31 20:40
    AlexTMjugador synchronize #505
  • Jan 31 19:45
    AlexTMjugador opened #505
  • Jan 31 18:01
    epage commented #504
  • Jan 31 17:49
    davepacheco opened #504
  • Jan 30 22:46
    robjtede closed #503
  • Jan 30 22:37
    robjtede synchronize #503
  • Jan 30 22:36
    robjtede edited #503
  • Jan 30 22:35
    robjtede opened #503
  • Jan 30 22:30

    epage on main

    docs: Update changelog chore: Update release process chore: Release (compare)

  • Jan 30 22:26

    epage on main

    docs(serde-spanned): display fe… docs(toml-datetime): display fe… docs(toml-edit): display featur… and 2 more (compare)

  • Jan 30 22:26
    epage closed #502
  • Jan 30 22:14
    robjtede synchronize #502
  • Jan 30 21:52
    robjtede edited #502
Pascal Hertleif
@killercup
@ordian i'll just dump some random thought after my first 5min of reading toml_edit code here :)
first off: this is an awesome code base!
could use some comment on the abstract software design (how the pieces of code relate/interact with each other) but with Go To Definition it's actually quite easy to navigate
(and you said the API is not final, so it might not be a good idea to invest in docs right now anyway)
one thing that surprised me was the value::ValueType enum
Pascal Hertleif
@killercup
i think this is only used in value::Array::push_value right now
but it could be used to implement nice indexing, serde_json style
(also cf alexcrichton/toml-rs#193)
on a most abstract level, i think the API should try to be close to that of serde_json, because a lot of thought has been put into making that nice
and then, on top of that, let's add custom methods like insert_at, and sort_entries_by
do you have any plans to make this is general toml crate? i.e., add serde support?
Pascal Hertleif
@killercup
i tried to run the fuzzer btw and it immediately crashes with a heap-use-after-free on my mac. i'll try to see if it's a local thing
(nice to see you downloading the run-fuzzer.sh script I wrote for rust-fuzz/targets :D)
Andronik Ordian
@ordian
hey, @killercup! Thanks for sharing your thoughts!
About indexing: yeah serje_json indexing was an inspiration for that struct.
About fuzz: I wasn't able to run fuzzer on my local machine due to some asan error, but I've seen some false positives when running sanitizers.
The current problem with making api as nice as serde_json has is that serde_json and toml-rs have a single enum - Value, while in toml_edit we have Value, ArrayOrTables, Table - and they are different in the way you can own them. E.g. you can only have a reference to Table, while Value permits full ownership semantics.
Pascal Hertleif
@killercup
the fuzz thing might just be a data structure usage asan doesnt understand
Andronik Ordian
@ordian
Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly.
Pascal Hertleif
@killercup
is it possible for us to use a single Value enum?
if this is not meant to be used to parse 10GB files, it's fine use just add a bunch of Rc/Arc
Andronik Ordian
@ordian

is it possible for us to use a single Value enum?

Well, we have TableChild and TableChildMut, this basically covers all types (except for the document).

if this is not meant to be used to parse 10GB files, it's fine use just add a bunch of Rc/Arc

The problem with Rc is not only performance consideration, but also that it's painful to use without non-lexical lifetimes. Actually early version used Rc as pointer to the document in table and array of tables, but I switched to raw pointers later (it's was before initial public commit).

Andronik Ordian
@ordian
I meant Rc<RefCell<T>>, not just Rc<T>.
Pascal Hertleif
@killercup
ah, true. well, the nll rfc is up, so it's only about a year away ;)
André Zanellato
@AZanellato
Hello :)
@ordian I saw you mentioning that the cargo-add command was blocked by the two issues on toml_edit. Would love to help with that
I don't have that much Rust experience, but I would try me best :smile:
Andronik Ordian
@ordian
@AZanellato hi there, glad to hear that :) I'll add more context to #57 soon. You can post any questions here and I'll try to respond in a timely fashion.
André Zanellato
@AZanellato
Nice :smile:
I'll try to check something later tonight after my working hours are done
ironyman
@ironyman
I would like to help too :D
Andronik Ordian
@ordian
@ironyman hello! Would you be interested in adding toml 0.5 support? ordian/toml_edit#58
This would require changing a parser (https://github.com/ordian/toml_edit/tree/master/src/parser) as well as e.g. adding new Value type "dotted keys".
André Zanellato
@AZanellato
Hi @ordian ! So, I'm checking the codebase and from what I am gathering I would need to change the document parser here: https://github.com/ordian/toml_edit/blob/master/src/parser/document.rs Which uses the macros defined here:
https://github.com/ordian/toml_edit/blob/master/src/parser/macros.rs
Is that it? :smile:
ironyman
@ironyman
sure
Andronik Ordian
@ordian
@AZanellato I guess that would require changing all the parsers, including the macros. The implementation of Document::from_str would first convert &str to Token stream and then use document parser on top of tokens. This probably means changing error type to include Token error.