HNHacker News
TopNewBestAskShowJobs

simscitizen

434 karma · joined January 14, 2013

submissionscomments
simscitizen··on Distribution of JVM Desktop Applications
Try running that analysis for iOS apps against the dyld shared cache or for Android apps against the Android system frameworks.
simscitizen··on CS193p: Developing Apps for iOS
It's an elective course.
simscitizen··on Blink: Intent to Remove: HTTP/2 and gQUIC server push
Server push never made any sense anyway for most subresources. The server doesn't know about the state of the browser's cache, so using server push for a subresource could cause it to needlessly push a subresource that was already cached by the browser.

Maybe it is useful outside of the browser context, e.g. in gRPC.

simscitizen··on A brief introduction to BEAM
There is an Erlang plugin for IntelliJ which is...ok.
simscitizen··on A Brief Guide to OTP in Elixir
Hot loading in Erlang is not magical. Here is an example. Let's say you want to redeploy some new code. In your deploy, you change some existing function foo in module A to call a new function bar in module B.

If you do this, you'd better make sure that you hotload the new version of B before you hotload the new version of A. Otherwise some process could end up trying to call B:bar through A:foo before the new B has finished loading.

If you rely on hotloading modules as your primary deploy mechanism, you will run into issues like this all the time. So it's not really clear to me that hotloading is a win for your typical stateless web service compared to just deploying a new binary and doing your standard zero-downtime deploy via forking.

It makes more sense when you realize that certain Erlang apps build up a huge amount of state in-memory. In those cases hotloading allows you to load new versions of the changed modules without having to take down the whole VM.

simscitizen··on A Brief Guide to OTP in Elixir
At WhatsApp we had a bunch of mnesia-backed services. I can't say that it was the best experience. Pretty much anything non-trivial, such as healing a cluster after a partition, or expanding a cluster, or cross-DC replication was a complete PITA to do properly. There's also very few people that have operational experience with it and very little documentation about it compared to pretty much any other storage engine.

The main benefit was the ability to load and store Erlang terms natively, along with the fact that it's just a library. The fact that your compute is colocated with your storage lends itself to a different architecture than when you use, say, a stateless web service in front of a relational database.

(Edit: I realize now that I'm replying to a WA old-timer so I'd be curious to know what your assessment of mnesia is with the benefit of hindsight.)

simscitizen··on IBM Cloud was down, as well as their status page
They’re talking about WhatsApp.
simscitizen··on I Want Off Mr. Golang's Wild Ride
https://en.m.wikipedia.org/wiki/Worse_is_better

And I happen to agree with it.

simscitizen··on ThinkPads 2020 - X13 AMD - X1 Nano?
What tablet do you have? My wife had a nearly top-spec X1 3rd gen tablet and the stylus lag is terrible compared to something like an iPad Pro with the pencil.
simscitizen··on Why Child Care Is So Expensive
Surprised that there wasn't any mention of Baumol's cost disease: https://en.wikipedia.org/wiki/Baumol%27s_cost_disease.
simscitizen··on Hermes – A small JavaScript engine optimized for running React Native on Android
Looks like I was wrong and it’s just the docs that are missing.
simscitizen··on Hermes – A small JavaScript engine optimized for running React Native on Android
Hermes compiles JS ahead of time to bytecode. The VM takes bytecode in as input, not source code. The ES5 vs. ES6 distinction doesn't matter as much as in other engines where the runtime takes source code as input, and as a result has to pay the more expensive ES6 parsing cost at runtime.
simscitizen··on Hermes – A small JavaScript engine optimized for running React Native on Android
The current open-source release doesn't have the component that glues the RN inspector with the Hermes debugger to make on-device debugging of Hermes bytecode work. But Hermes does contain a debugger interface, and making this flow this work will happen sometime in the future.
simscitizen··on Android Emulator – AMD Processor and Hyper-V Support
Parallels Desktop Lite is available on the Mac App Store with all of its sandboxing restrictions because it uses Hypervisor.framework: https://itunes.apple.com/us/app/parallels-desktop-lite/id108...
simscitizen··on Original Windows File Manager with enhancements
Cmd+Shift+G to bring up a go to location sheet.
simscitizen··on The AWS and MongoDB Infrastructure of Parse
We created more than 5 indices per collection if necessary. But fundamentally some queries can't be indexed, and if you allow your customers to make unindexable queries, they'll run them. Think of queries with inequality as the primary predicate, or queries where an index can only satisfy one of the constraints like SELECT * FROM Foo WHERE x > ? ORDER BY y DESC LIMIT 100, etc.
simscitizen··on The AWS and MongoDB Infrastructure of Parse
Clash of Kings used Parse, not Clash of Clans.
simscitizen··on The History of the iPhone on its 10th Anniversary [audio]
This is completely incorrect. I was at Apple working on iOS during this time period and helped implement and optimize many of those skeuomorphic UIs. Steve was a huge proponent of skeuomorphism.

One example is the iPad Contacts app. Originally it was a simple list of contacts like you'd find in Outlook. This was changed to the "little address book" UI that looked like a leather-bound address book much later in the process because the original UI wasn't "fun" enough.

simscitizen··on What was it like working on the original iPhone project?
Your first misconception is that xnu (the OS X kernel) derives mainly from BSD. In actuality, it's based much more upon Mach than BSD. The BSD subsystem is largely implemented on top of Mach subsystem in the kernel (e.g. a BSD process is implemented on top of a Mach task), and xnu supports both Mach and BSD system calls. There is very little you could port from BSD into xnu without significant work, although obviously there has been a lot of cross-pollination between xnu and BSD (launchd, GCD, mandatory access control, etc.).
simscitizen··on Pixel smartphone camera review: At the top
iOS has always tried to simulate zero shutter lag: the camera continuously captures full-resolution images into a ring buffer, and the app goes back in the frame buffer to find the image that corresponds to when you pressed the shutter.
simscitizen··on Ask HN: What's your favorite tech talk?
"An Introduction to SQLite" by Richard Hipp (who wrote the library) is actually a pretty good intro on to how to build your own DB engine.

https://www.youtube.com/watch?v=giAMt8Tj-84

simscitizen··on L4 microkernels: The lessons from 20 years of research and deployment
That is completely untrue. While the BSD syscalls are supported, Mach syscalls and Mach IPC are also heavily used, especially internally at Apple.

Just one simple example: run "sample <process>" (where <process> is any Cocoa application) on OS X. Pretty much every thread will have an event loop powered by CFRunLoop, and they'll all be stuck in mach_msg_trap waiting for an event to occur.

Also, pretty much any sort of semi-complicated IPC on OS X is done over Mach IPC (e.g. passing a large bitmap copy-on-write from one process to another). Take a look at the ipc directory in the Chromium source, for example.

simscitizen··on If your code accepts URIs as input, filter out “file://”
The most popular HTTP library is libcurl, and it supports file URLs by default.
simscitizen··on M 122: Advanced Operating Systems (2015)
That's a classic paper to read for an operating systems class. Generally in an advanced OS class you read papers and discuss them critically. The value is in the discussion.

Here is an example syllabus from Stanford's CS240: https://web.stanford.edu/class/cs240/old/sp2014/. You can see that this paper is listed, along with a paper that states the opposite opinion ("Why Events are a Bad Idea").

simscitizen··on Making algorithms lock-free with Read-Copy Update (RCU)
It absolutely can get expensive with lots of threads running. And you are also right that this code ends up making each thread reach a synchronization point. Luckily Objective-C is targeted towards clients which generally don't have a bazillion threads running so it's generally not a problem.

There was talk at some point of adding a single syscall that got all the PCs of all the threads at once to cut down on the overhead, but it looks like that still hasn't happened.

What's going on here is something like this:

1. objc_msgSend is Obj-C's method dispatcher, and it depends on method caches to make method lookup faster.

2. Sometimes the method caches become out of date. For instance, maybe the method cache filled up and the Obj-C runtime needs to allocate a larger method cache.

3. This old method cache has to be GC'd at some point, so it's added to a freelist.

4. This GC function (the "write" you're talking about) for these caches runs once the size of outdated method caches grows beyond a certain threshold (garbage_threshold in the code). So it shouldn't run too often. The GC function works by checking if any thread is currently within objc_msgSend. If no function is in objc_msgSend, then the runtime is sure that none of the method caches on the free list is in use.

5. It is definitely optimized for reads. The "read" in this case is literally a method dispatch so it happens all the time, and it's important for the read to be lock-free.

simscitizen··on Swift and Dynamism
He's saying that the same team that developed LLVM, clang, and ARC (which most people think are good things for the Apple ecosystem) is also bringing you Swift. So you should feel good that the language is being developed by a team with a good track record that will probably find a solution for this particular issue.
simscitizen··on Making algorithms lock-free with Read-Copy Update (RCU)
You can do a variant of this in userspace as well:

https://github.com/opensource-apple/objc4/blob/master/runtim...

Basically, issue a syscall that acquires the PC of all threads. When none of the PCs are in the critical section, then you can garbage collect old objects.

simscitizen··on On libunwind and dynamically generated code on x86-64
Luckily Apple is sane enough to compile its core libraries with frame pointers, so unwinding is pretty trivial. See for yourself (this function is called by backtrace(3)): http://opensource.apple.com//source/Libc/Libc-825.40.1/gen/t...
simscitizen··on CS143: Compilers (2011)
At Stanford, faculty are prohibited from proctoring. So there is no professor or grad student that sits in the exam hall with the students while they are taking the test:

"The faculty on its part manifests its confidence in the honor of its students by refraining from proctoring examinations and from taking unusual and unreasonable precautions to prevent the forms of dishonesty mentioned above."

https://communitystandards.stanford.edu/student-conduct-proc...

A professor or grad student walks into the room every 30 minutes or so just to make sure everything looks okay. They otherwise sit outside the exam hall so you can ask them questions, ask to go the bathroom, etc. But it's up to the students to police each other and ultimately themselves.

There are definitely other universities in the US that have this policy, but I would say it's more the exception than the norm.

simscitizen··on HTTP/2 Protocol for iOS Push Notifications
Because it's fundamentally different and more secure.

Apple's model uses a public/private key pair: the private key never leaves your server and Apple doesn't know it. Apple only knows the public key, in the form of a cert. Apple actually writes about the trust model in the docs: https://developer.apple.com/library/ios/documentation/Networ....

Google's model uses a shared secret (the API key) that both the client and server know.

Having worked with both systems, I prefer the ease of the shared secret model, but each system uses a fundamentally different security model.

← PreviousPage 3 of 4Next →