C++ Logo

sg16

Advanced search

Re: [SG16-Unicode] P1689: Encoding of filenames for interchange

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 08 Sep 2019 11:20:30 -0700
On Sunday, 8 September 2019 11:07:00 PDT Lyberta wrote:
> > Ok, so how would you do this in C++?
>
> First, you implement binary IO layer. My GCC 9-compatible implementation
> is about 2300 lines of code. I'd say proper implementation that is
> proposed is about 3000 lines of code.
>
> Then, you implement Unicode streams on top. Right now I have code unit
> and scalar value layer mostly implemented. That's about 3400 lines of
> code. But for streams you need UCD and for UCD you need to parse it. My
> pessimistic estimation for UCD parser is about 5000 lines of code. That
> makes somewhere in the ballpark of 10,000 lines of code for Unicode streams.
>
> Then you need a JSON reader/writer. It's hard to estimate without
> writing one. Maybe 3000-5000 lines of code?
>
> So, all in all, the entire thing is within 20,000 lines of code. I can
> give better figures later when I have more of that implemented. I need
> JSON myself.

So you're going to do all of this just to produce a simple JSON payload with
the result of an operation?

> > Because it isn't about JSON, it's about everything else. Here's a failure
> > mode your code should be able to deal with: printing the localised error
> > message of why it couldn't open the output file for writing.
>
> Either write output for humans or machines. Don't mix the two. JSON is
> for machines.

I'm not mixing them. They are in different channels.

The error message goes to the user. The JSON payload goes to a file.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2019-09-08 20:20:33