Suppose you maintain a highly scaled service. Suppose it has a bug. Finding and fixing 3 lines of code that caused a problem that was costing the company money by the hour/minute could be well worth it and a great accomplishment in one day.
The number of lines of code is irrelevant. The impact is what matters.
JSON parsing isn't as hard as this very detailed article makes it out to be.
I've written JSON parsers in Perl, C, and Go.
My parsers pass all of the checks mentioned except for the ones regarding encoding and/or escape characters.
I intentionally only parse UTF-8. I intentionally don't do any parsing within strings except escaping of the ending double quote. Any string value is passed as is to the user of the library to further parse however they wish.
Likewise I store numbers as is in a string and provide helper functions to automatically fetch the numerically parsed value if desired.
With those restrictions it becomes very easy to write a JSON parser that works well in any number of languages.
I additionally support the following extensions:
1. Both // and /* */ comments
2. Trailing commas optional
3. Commas in arrays entirely optional
4. Hex literals in the form of x.[hex]
5. Custom literals in the form of [type name].[custom literal]
Glancing through the Nim documentation it doesn't appear to support goto. Searching online reveals one can hack something into the underlying instruction set, but it looks very unclean.
To port my parser I would need to alter the core of the processor a bunch to make it effectively be a large switch statement inside of a loop to build the state machine.
Right now all three implementation are essentially following the same logic with just the language syntax altered between them to make maintenance of all implementations simultaneously easier.
I have spent some time generating ragel grammars for this sort of thing, and ragel can output a number of different languages itself. The code generated by ragel, is, though, quite messy itself and can have random problems that require workarounds, which is why I haven't decided fully upon going down the ragel path.
May I ask what the point is of having a Nim port? You've listed safety; which can be better addressed by building a state machine generator and a state machine DSL. Also, the code is quite small, so I don't think "safety" is the primary concern for the codebase.
Nim compiles to C, C++, and Javascript. I can already effectively run the C parser in JS by compiling to WASM ( and I've done so with my XML parser ) C++ code can call the C code without issue. A wrapper to auto-call object deletion in C++ would be trivial to write.
Rewriting in Nim would not, so far as I can see, offer any benefits to me that are worth the effort.
While Apple is very restrictive and controlling, they aren't as controlling as many imply about running your own/custom apps on phones.
You can sign up for a free developer account and sign apps onto your iDevices for free. ( 3-apps at least, for 1 week at a time )
If you pay for a developer account you can sign many more apps to run on your devices as you like. This includes apps that would not pass the store approvals.
I agree it is a hassle to have to install apps that way, but at least they do allow it.
The article is very thin on details, but I don't think dismissing the idea that we are headed for disaster is the proper response.
During peak covid wfh period, there has been a clear and obvious difference in the quality of air. This, to me, seems to indicate that the air quality difference is mainly due to the lower amount of people driving. Are we not concerned about returning to a smog filled status quo?
I was recently hired by a company and quit 1 week in. Why? Turns out the position was to assist with IT work related to oil fracking. Is everyone collectively pretending that fracking is not damaging to groundwater in a large area?
Amazon is globally ( esp. in US though ) driving other businesses ( small, medium, and large ) out of business. Do we really believe that the demise of Toys R Us and Sears have nothing to do with Amazon? What about the demise of shopping malls generally?
The last US president is deemed to be a certifiable scumbag by half the US population. We have current articles and video indicating that the current US president is a pedophile ( or at least very fond of touching kids ) We just went through a huge reveal that pedophilia is a big business both in the US and globally. We also went through a lot of recent protests in regard to police and government treatment of us. Are we pretending that society is stable and well?
Education in the US is pitiful compared to education globally. It shows no signs, that I see, of improving. It's going downhill. We are okay with this?