Hacker Newsnew | past | comments | ask | show | jobs | submit | neilpa's commentslogin

We're currently evaluating both Zod and ArkType as a replacement for earlier JSON schema validations. The thing I can't get over with Zod is the syntax is _so_ different from defining TS types.

Are there reasons to go with Zod over ArkType?


You might like Typia better.

I recently put together a deck for this after some investigation: https://docs.google.com/presentation/d/1fToIKvR7dyvQS1AAtp4Y...


On the ArkType website they talk about speed and DX, but no mention of bundle size. I assume, and maybe this is an unfair assumption, that's because it's bad. I haven't come across ArkType until just now, but I was just checking out Valibot today because it's got a small bundle size.



These numbers don't reflect anything useful. This is the total size of the code in the package, most of which will be tree-shaken. In Zod's case, the package now contains three independent sub-libraries. I recommend plugging a script into bundlejs.com[0] to see bundle size numbers for a particular script

[0] https://bundlejs.com


We also chose ArkType after evaluating Zod, Valibot, and Effect Schema, among others. It seemed to have the best developer experience while also being much faster. It also supports the Standard Schema project which I believe Effect Schema does not fully support.


Could you elaborate on how exactly do you use these? I was assuming its for some kind of contract testing, but there are mentions of bundle size, is it used on fetching data to fail early if the format is wrong, something like that?


I believe Effect Schema fully supports Standard Schema, the issue is that it supports much more than Standard Schema, so not all schemas will work and thus provide compile time errors.


Yes that's correct, it's more powerful but we wanted to maintain full compatibility just for the future as well. But if you're all in on the Effect ecosystem, it's quite nice.


Does ArkType support generating data from schema?


Everyone else is using Zod so the LLMs understand it well, there’s a big ecosystem, it’s unlikely to disappear overnight, and new hires may well already use it. It’s the boring solution.


This was the de-facto practice for courses at U of M and I loved it. Although it appears they may have ended that practice in 2018

https://record.umich.edu/articles/university-updating-start-...


Randomly noticed your post is dated in the future - December 16, 2025


Great Scott!


This looks like the app I wanted ages ago when I tried to find a TextAnalysisTool.net replacement for OSX.

https://superuser.com/questions/706761/textanalysistool-net-...



> We wouldn't want to ban Sony MP3 players from including an app that plays music, right?

Maybe? There was that time Sony decided to install a rootkit when you played a CD

https://en.wikipedia.org/wiki/Sony_BMG_copy_protection_rootk...


I have a literal pile of bricks in my backyard. I thought this was going to be an app that I could scan them with and tell me how to build a pizza oven.


It would be helpful in Argentina... sorry.. couldn't help it.

https://news.ycombinator.com/item?id=32794597



Same! There isn't one standard "red brick" size (like I thought lol), but there are a lot of different sizes. I'd pay for an app like that.



This is why I read HN. Thanks so much! That has been driving me crazy forever now.


My w3schools workaround is appending `mdn` to any search for something related to web standards


I have been part of the beta test for kagi search engine (kagi.com) and my favorite feature is you can prefer/mute websites. So for example I prefer MDN so the site is ranked higher if it shows in the search results. Note I’m unaffiliated with them but the product/team is great so rooting for them to succeed.


I'm using Kagi at the moment and not only does it have nice features like this but it is also a fantastic search engine.

Maybe the best way to explain how fantastic it is is that I think it has a bang operator like DDG but I have never tested it because when I look at the results they are obviously better than DDG or Google.


I love the preference idea... I'm going to implement that in my personal search engine.


I’m assuming PGA is Programmable Gain Amplifier? It wasn’t immediately obvious from a web search.


Yes. The basic structure of a CMOS sensor looks a lot like a DRAM array, but instead of a capacitor you have a photo diode and the "bit lines" / column lines go into a programmable gain amplifier and then into a 12 or 14 bit ADC with some DSP [1] and a parallel-to-serial interface. The exposure is determined by the readout (row for row), that's what gives you rolling shutter.

Some sensors have global shutter instead, which makes it even more like DRAM: Conceptually each pixel has a capacitor and a photodiode, and a transistor connecting the two, all of these transistors are connected in parallel and form the "global shutter signal".

Some sensors have faster ADCs and use one ADC for a bunch of columns, which has been claimed as the source of column-banding in some sensors (unclear if correct).

[1] Sensors that are intended for both photo and video typically support things like pixel binning, where the sensor itself averages e.g. 2x2 blocks of pixels internally. A lower quality alternative is line skipping, where the sensor is told to only read out every nth line, thus reducing resolution considerably. The higher quality alternative is "full-sensor readout", i.e. the camera reads all pixels and downsamples the image to the video resolution. I believe some (announced?) sensors can do this in the sensor itself now.

Note: A lot of this is "somewhat informed speculation" on my part, because image sensor manufacturers tend to be very secretive of their sensor's details.


Annnnd comments like this are why I'm on HN daily. Thanks for sharing your knowledge!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: