News for hackers. Stuff that matters.
Re: by wiseowise on Saturday August 24, 2024 @03:38AM (#41336366)
The moment you NEED to include a library to parse some basic JSON file - you’ve lost already.
Re: by tcfhgj on Saturday August 24, 2024 @03:55AM (#41336437)
Why have I lost what exactly?
Re: by ModernMech on Saturday August 24, 2024 @11:54AM (#41339097)
Based on your other reply about JSON being a "basic" feature I assume you do a lot of work with JSON.

What you need to understand is not everyone works with JSON, and for them it's a feature to not have JSON parsing code in their binaries. It's not a loss for them.

Re: by wiseowise on Saturday August 24, 2024 @12:26PM (#41339333)
Where did you get a notion that JSON parsing code will end up in a binary if it’s not used? Or Rust compiler is so obtuse it can’t tree shake unused code?
Re: by ModernMech on Saturday August 24, 2024 @01:40PM (#41339871)
How did you get that from what I said? JSON isn't included in Rust binaries because of its ability to bring in only what's needed, and my ability as a developer to specify that as a fine-gained level at compilation time.

Using a language where you don't bring things in as needed means they're built-in at the interpreter level or some other scheme like a large required standard library.

Maybe in those languages your compiler is smart enough to filter out unused code, maybe you don't even have a compiler and you have to distribute your code with an interpreter or a virtual machine with all the batteries. Either way, languages where libs are brought in as-needed are at an advantage when it comes to compiler tech to generate such binaries.