Live data from Hacker News

A deep dive into Apple's .car file format

dbg.re

41–50 of 73 posts

Re: A deep dive into Apple's .car file format

#41

Looks very much like a format that should just have been gzipped JSON. Don't use binary formats when it isn't absolutely needed.

> Don't use binary formats when it isn't absolutely needed.

JSON in particular isn't very good [0] but I'd also argue that text formats in general aren't great. Isn't it a lot better that an int32_t always takes exactly 4 bytes instead of anywhere between one and eleven bytes (-2147483648)?

[0] https://news.ycombinator.com/item?id=40555431

Re: A deep dive into Apple's .car file format

#42
post #14

Claude is pretty good at turning (dis)assembly into Objective-C. i went exploring these systems looking for the secrets of glass icon rendering. i used ipsw to unpack all the class metadata in relevant system private frameworks. for each class, i extracted class header/interface, and a assembly file per method in the header. i wrote a ruby script to shell out to claude cli with a custom system prompt to give me reada…

> obj-c runtime dynamism is fascinating. it’s like, “what if we make C as dynamic as Ruby”.

Well thats because objc and ruby are cousins. Both are sort of the only two smalltalk based languages out there

Re: A deep dive into Apple's .car file format

#43
post #25

Looks very much like a format that should just have been gzipped JSON. Don't use binary formats when it isn't absolutely needed.

>Looks very much like a format that should just have been gzipped JSON. For application file formats that require storing binary blob data such as images, bitmaps, etc , many in the industry have settled on "SQLite db as a file format": ( https://www.sqlite.org/appfileformat.html ) Examples include Mozilla Firefox using sqlite db for favicons, Apple iOS using sqlite to store camera photos, Kodi media player uses sqli…

My favorite example of this is Audacity, which stores their entire project file, including all the audio data, as a SQLite database. It's really amazing, you can stream audio data from many input sources into a SQLite database at once, it wont break a sweat, it's flexible and extremely safe from data loss due to crashes or power outages. As well as trivially mutable: many of these kinds of formats the "export" is a heavy-duty operation which serializes everything to JSON or whatever. But in SQLite, it's just a question of updating the database with normal INSERTs, very cheap and simple operations. We've put a similar system into production, and it's incredible how well it works.

Re: A deep dive into Apple's .car file format

#44
post #14

Claude is pretty good at turning (dis)assembly into Objective-C. i went exploring these systems looking for the secrets of glass icon rendering. i used ipsw to unpack all the class metadata in relevant system private frameworks. for each class, i extracted class header/interface, and a assembly file per method in the header. i wrote a ruby script to shell out to claude cli with a custom system prompt to give me reada…

> obj-c runtime dynamism is fascinating. it’s like, “what if we make C as dynamic as Ruby”. Well thats because objc and ruby are cousins. Both are sort of the only two smalltalk based languages out there

> Well thats because objc and ruby are cousins. Both are sort of the only two smalltalk based languages out there

I'm sure you can trace connections, at least in ideas, but I think Ruby is way more Perl-based than Smalltalk-based.

Re: A deep dive into Apple's .car file format

#46
post #11

Earlier quoted context omitted.

And have it hallucinate stuff? Nah, this stuff is hard enough without LLMs guessing.

I'd argue that as long as it produced working code it's better than nothing, in this case.

The code is already working with the v01, v02 names though. The use of LLMs here is intended to add information for humans to easier understand what the code does. Which might be worthwhile, but I think this AI upscaling of Obama pretty well illustrates the potential risks of trying to fill in information gaps without a proper understanding of the data https://x.com/Chicken3gg/status/1274314622447820801

Re: A deep dive into Apple's .car file format

#47
post #14

Claude is pretty good at turning (dis)assembly into Objective-C. i went exploring these systems looking for the secrets of glass icon rendering. i used ipsw to unpack all the class metadata in relevant system private frameworks. for each class, i extracted class header/interface, and a assembly file per method in the header. i wrote a ruby script to shell out to claude cli with a custom system prompt to give me reada…

[deleted]

Re: A deep dive into Apple's .car file format

#48
post #44

Earlier quoted context omitted.

> obj-c runtime dynamism is fascinating. it’s like, “what if we make C as dynamic as Ruby”. Well thats because objc and ruby are cousins. Both are sort of the only two smalltalk based languages out there

> Well thats because objc and ruby are cousins. Both are sort of the only two smalltalk based languages out there I'm sure you can trace connections, at least in ideas, but I think Ruby is way more Perl-based than Smalltalk-based.

Im talking the fundamental language framework. 'Everything is an object' and method calls are actually message passing are the two reasons that objc and ruby are actually smalltalks.
Post reply on HN