Jump to page: 1 2 3
Thread overview
text based file formats
Dec 18, 2022
Robert Schadek
Dec 18, 2022
Adam D Ruppe
Dec 18, 2022
rikki cattermole
Dec 20, 2022
Adrian Matoga
Dec 22, 2022
Walter Bright
Dec 18, 2022
CM
Dec 19, 2022
Per Nordlöw
Dec 19, 2022
Walter Bright
Dec 19, 2022
Adam D Ruppe
Dec 20, 2022
Walter Bright
Dec 20, 2022
H. S. Teoh
Dec 20, 2022
John Colvin
Dec 20, 2022
H. S. Teoh
Dec 21, 2022
9il
Dec 21, 2022
Tejas
Dec 21, 2022
John Colvin
Dec 22, 2022
Walter Bright
Dec 22, 2022
Per Nordlöw
Dec 22, 2022
Walter Bright
Dec 21, 2022
Adam D Ruppe
Dec 22, 2022
Walter Bright
Dec 19, 2022
Robert Schadek
Dec 19, 2022
Robert Schadek
Dec 19, 2022
bachmeier
December 18, 2022

I complaint before that D and phobos needs more stuff.
But I can't do it all by myself, but I can ask for help.

So here it goes https://github.com/burner/textbasedfileformats

As on the tin, text based file formats is a library of SAX and DOM parsers for text based file formats.

I would like to get the following file formats in.

  • json (JSON5) there is actually some code in there already
  • xml, there is some code already, the old std.experimental.xml code
  • yaml, maybe there is something in code.dlang.org to be reused
  • toml, maybe there is something in code.dlang.org to be reused
    • ini, can likely be parsed by the toml parser
  • sdl, I know I know, but D uses it.

There are a few design guidelines I would like to adhere to.

  • If it exists in phobos, use phobos
  • have the DOM parser based on the sax parser
  • no return by ref
  • make it @safe and pure if possible (and its likely possible)
  • share the std.sumtype type if possible (yaml, toml should work)
  • no @nogc, this should eventually get into phobos

So stop talking, and start creating PR's.
For the project admin stuff, this will use github. There are milestones for the five formats, so please start creating the issues you want/can work on and start typing.

December 18, 2022
On Sunday, 18 December 2022 at 15:56:38 UTC, Robert Schadek wrote:
> * xml, there is some code already, the old std.experimental.xml code

my dom.d doesn't do the sax parser part but has its own advantages over the other things (including being continually maintained for over a decade, unlike the phobos things)
December 19, 2022
On 19/12/2022 4:56 AM, Robert Schadek wrote:
> * xml, there is some code already, the old std.experimental.xml code

I've toyed with std.experimental.xml.

I'm not convinced that it is a good code base for inclusion.

> * no return by ref

As a bit of a follow up of what we were talking about on BeerConf:

Because these are not data structures, they won't own externally facing memory (thats the GC job). So these lifetimes issues with ref should never be encountered.

> * make it @safe and pure if possible (and its likely possible)

pure is always a worry for me, but yeah @safe and ideally nothrow (if they are forgiving which they absolutely should be, there is no reason to throw an exception until its time to inspect it).
December 18, 2022

On Sunday, 18 December 2022 at 15:56:38 UTC, Robert Schadek wrote:

>
  • sdl, I know I know, but D uses it.

Thank you for remembering it. I feel like I'm one of the few who prefer SDL to YAML, JSON, and the like.

December 19, 2022

On Sunday, 18 December 2022 at 15:56:38 UTC, Robert Schadek wrote:

>

So stop talking, and start creating PR's.
For the project admin stuff, this will use github. There are milestones for the five formats, so please start creating the issues you want/can work on and start typing.

If I were you I would join forces with Ilya and work on getting the mir libraries doing text-parsing integrated into Phobos.

December 19, 2022
On 12/18/2022 7:56 AM, Robert Schadek wrote:
> So stop talking, and start creating PR's.

Yup!

Curious why CSV isn't in the list. I encounter that a lot at tax time.

https://en.wikipedia.org/wiki/Comma-separated_values

Maybe just ask OpenAI?
December 19, 2022
On Monday, 19 December 2022 at 09:55:47 UTC, Walter Bright wrote:
> Curious why CSV isn't in the list.

Maybe std.csv is already good enough?
December 19, 2022
> Curious why CSV isn't in the list. I encounter that a lot at tax time.

As Adam said, std.csv is already there and its at least from my perspective okay enough.

That being said, I liked how you quoted me here

On Monday, 19 December 2022 at 09:55:47 UTC, Walter Bright wrote:
> On 12/18/2022 7:56 AM, Robert Schadek wrote:
>> So stop talking, and start creating PR's.
>
> Yup!
>

and replay, create an PR that puts it on the list ;-)
December 19, 2022
replay -> reply


December 19, 2022

On Sunday, 18 December 2022 at 15:56:38 UTC, Robert Schadek wrote:

>

I complaint before that D and phobos needs more stuff.
But I can't do it all by myself, but I can ask for help.

So here it goes https://github.com/burner/textbasedfileformats

As on the tin, text based file formats is a library of SAX and DOM parsers for text based file formats.

I would like to get the following file formats in.

  • json (JSON5) there is actually some code in there already
  • xml, there is some code already, the old std.experimental.xml code
  • yaml, maybe there is something in code.dlang.org to be reused
  • toml, maybe there is something in code.dlang.org to be reused
    • ini, can likely be parsed by the toml parser
  • sdl, I know I know, but D uses it.

A natural complement to this would be the functionality in https://github.com/eBay/tsv-utils

I've created versions of the filter and select functions that take a string as input and return a string or string[] as output. It's a performant way to query text files. Most important, all the hard work is already done.

« First   ‹ Prev
1 2 3