Readit News logoReadit News
rnmkr commented on A new experimental Go API for JSON   go.dev/blog/jsonv2-exp... · Posted by u/darccio
donatj · 3 days ago
I'm coming in a little hot and contrarian. I've been working with the Go JSON library for well over a decade at this point, since before Go 1.0, and I think v1 is basically fine.

I have two complaints. Its decoder is a little slow, PHP's decoder blows it out of the water. I also wish there was an easy "catch all" map you could add to a struct for items you didn't define but were passed.

None of the other things it "solves" have ever been a problem for me - and the "solution" here is a drastically more complicated API.

I frankly feel like doing a v2 is silly. Most of the things people want could be resolved with struct tags varying the behavior of the existing system while maintaining backwards compatibility.

My thoughts are basically as follows

The struct/slice merge issue? I don't think you should be decoding into a dirty struct or slice to begin with. Just declare it unsupported, undefined behavior and move on.

Durations as strings? Why? That's just gross.

Case sensitivity by default? Meh. Just add a case sensitivity struct tag. Easy to fix in v1

Partial decoding? This seems so niche it should just be a third party libraries job.

Basically everything could've been done in a backwards compatible way. I feel like Rob Pike would not be a fan of this at all, and it feels very un-Go.

It goes against Go's whole worse is better angle.

rnmkr · 2 days ago
lol
rnmkr commented on Limbo: A complete rewrite of SQLite in Rust   turso.tech/blog/introduci... · Posted by u/avinassh
ncruces · 9 months ago
If you "intend to get rid of some of the baggage" you won't be fully compatible.

libSQL already isn't fully compatible: as soon as you add a RANDOM ROWID table, you get "malformed database schema" when using the (e.g.) sqlite3 shell to open your file (also Litestream doesn't work, etc).

And that's fine, as there probably is no better way of doing what you needed to do. But it's also taking what SQLite offers and breaking the ecosystem, under the covers of "we're compatible" without ever calling out what compromises are being made.

Note how the SQLite documentation that introduces STRICT tables very clearly documents the backwards compatibility issues of the feature and how to get around them: https://sqlite.org/stricttables.html#backwards_compatibility

You also never got round to documenting the internal Virtual WAL APIs you exposed. This is something where SQLite is lacking, where you could've made an impact without any compatibility issues, and pressure upstream to release something by doing it first/better. Alas, you did it for Turso's exclusive benefit.

rnmkr · 9 months ago
That's fine though. Full compatibility doesn't have to mean full backwards compatibility. I think of it as what's Typescript to Javascript.
rnmkr commented on Limbo: A complete rewrite of SQLite in Rust   turso.tech/blog/introduci... · Posted by u/avinassh
akira2501 · 9 months ago
> The U.S. government wants everyone to abandon C/C++

That's the position of two federal agencies, namely, FBI and CISA. They don't describe how this change will reduce CVEs or why the languages they prefer still produce projects with CVEs.

I don't particularly hold the technical or social acumen of FBI or CISA in particularly high regard and I'm not sure why anyone would by default either. Mostly because they say things like "switch to python!" without once accounting for the fact that python is written in C.

It's an absurd point to invoke as a defense of this idea.

rnmkr · 9 months ago
Well Google's Rust report is already out with great results.. so..
rnmkr commented on "Hetzner decided to cancel our account and terminate all servers"   mastodon.social/@kiwix/11... · Posted by u/_5euu
rnmkr · 9 months ago
We need to boycott hetzner.
rnmkr commented on Deno 2   deno.com/blog/v2.0... · Posted by u/frou_dh
WuxiFingerHold · a year ago
Deno 2 with full Node compatibility is huge, presupposed it works reliably without runtime surprises. I wouldn't mind if I get a warning when a Node package is not supported, but runtime must be rock solid, especially with server packages like node-postgres (pg).

Apart from this little doubt, I love it:

The APIs and std lib are so extensive that we don't need huge amounts of third party packages. Typescript support is great. Deno actually can check Typescript (not just run it by stripping it as Node or Bun). Compiling (bundling) is another great feature.

rnmkr · a year ago
Making their stdlib compatible for other runtimes are huge W! I'd drop some third party libs in favor of them.
rnmkr commented on Node.js adds experimental support for TypeScript   github.com/nodejs/node/pu... · Posted by u/magnio
unilynx · a year ago
If this feature ever becomes the default (ie not behind a flag) - how will the NPM ecosystem respond? Will contributors still bother to build CJS end EJS versions when publishing a NPM module, or just slap an 'engine: nodejs >= 25' on the package.json and stop bothering with the build step before pushing to NPM ?

I personally would very much prefer if NPM modules that have their original code in TS and are currently transpiling would stop shipping dist/.cjs so I unambiguously know where to put my debugger/console.log statements. And it would probably be very tempting to NPM contributors to not have to bother with a build step anymore.

But won't this start a ripple effect through NPM where everyone will start to assume very quickly 'everyone accepts TS files' - it only takes one of your dependencies for this effect to ripple through? It seems to me that nodejs can't move this outside an opt-in-experimental-flag without the whole community implicitly expecting all consumers to accept TS files before you know it. And if they do, it will be just months before Firefox and Safari will be force to accept it too, so all JS compilers will have to discard TS type annotations

Which I would personally be happy with - we're building transcompiling steps into NPM modules that convert the ts code into js and d.ts just to support some hypothetical JS user even though we're using TS on the including side. But if node accepts

.ts files we could just remove those transpiling steps without ever noticing it... so what's stopping NPM publishers from publishing js/d.ts files without noticing they broke anything?

rnmkr · a year ago
I would love to ship my source code (.ts) to npm. But Typescript team was very much against this, as there'll be tsconfig issues and other performance issues. But still fingers crossed.
rnmkr commented on Bun 1.1   bun.sh/blog/bun-v1.1... · Posted by u/ksec
stefanos82 · a year ago
Thank you for letting me know about telemetry; I had no idea.
rnmkr · a year ago
Then people go crazy when Golang announced they want to enable informed opt-out telemetry.
rnmkr commented on Backdoor in upstream xz/liblzma leading to SSH server compromise   openwall.com/lists/oss-se... · Posted by u/rkta
xorcist · a year ago
Is that version truly vetted? "Jia Tan" has been the official maintainer since 5.4.3, could have pushed code under any other pseudonym, and controls the signing keys. I would have felt better about reverting farther back, xz hasn't had any breaking changes for a long time.
rnmkr · a year ago
It's not only that account, other maintainer has been pushing the same promotion all over the place.
rnmkr commented on Cloudflare Hyperdrive   blog.cloudflare.com/hyper... · Posted by u/ccorda
jgrahamc · 2 years ago
Use Cloudflare Tunnel to connect to Cloudflare. Don't open your firewall. That feature is coming.
rnmkr · 2 years ago
Hope it lands soon. DBs are usually locked down with no access to/from internet.
rnmkr commented on Bun v1.0.0   bun.sh/blog/bun-v1.0... · Posted by u/tuananh
mrinterweb · 2 years ago
Since Bun is VC backed, what is the monetization plan? One of the things I consider with new tech is "how likely will this tech still be actively developed in N years." Bun will need to make money somehow or funding will be pulled.

I see bun's licensing is MIT, and that is fantastic. So that does give me some hope it won't die should the business go under. I hope the business succeeds, but I'm curious should I adopt bun, what might the upsell be down the road.

rnmkr · 2 years ago
I guess they'll follow NextJS/Vercel or Deno/Deploy book or even License change shouldn't be out of question. Advertise everything as "open source", get free bug reports, contribution, marketing and adoption. Push everything into their commercial offering.

u/rnmkr

KarmaCake day24February 3, 2023View Original