3 ms·
If you created a format that is so difficult to parse that it cannot be parsed with simple readable C code then the problem is the format not the parser code.
by r3d 2mo ago
If you created a format that is so difficult to parse that it cannot be parsed with simple readable C code then the problem is the format not the parser code.
- jrimbault 2mo agoCan you feel the irony when typing this? "Simple readable C code" itself not being able to be parsed by "simple readable C code".
- r3d 2mo agoYeah, I agree. But C code parsing is a common and solved problem. The myriad of things people want to store and recover is not though right.
- tester756 2mo agoWhy care about lang which doesnt really support strings well?
- r3d 2mo agoWhat do you think the libraries you use to parse these things are doing under the hood? Maybe you don't care? Fair enough.
- tester756 2mo agouse 10 meters of wrappers around C and its quirks? :P
- mrkeen 2mo agoIn C's defence, you only have forward-compatability of string handling to the extent that your string type will not change in the future. Byte arrays are great for this. All string encodings in the foreseeable future can be encoded in bytes. You do not need to recompile coreutils once someone invents utf8-plus. If you wrote your standard lib in whatever was better-than-C at the time, you might have settled for sized strings (who needs strings longer than 65535 bytes?) instead of \0, and you might have had utf32 or some kind of wide char representation.