30 karma · joined Dec 21, 2013 (12y ago) · 18 submissions
comment 5y ago · link · parent
Here is an example limitation of typescript's type system that I routinely run into while developing real code [1].
I look at it like this. If you consider all possible programs, some are invalid, some are valid, and some are valid and useful. A type system's job is to reject as many invalid programs as possible while accepting as many valid programs as possible and trying to optimize for useful valid programs. Due to the halting problem this is impossible to do perfectly, so any given type system will likely accept some invalid programs and reject some useful valid programs. If the type system happens to reject your useful valid program, you'll likely have a bad day :)
[1] https://www.typescriptlang.org/play?#code/PTAEHUFNQCwQwG7TgO...
comment 6y ago · link · parent
By the way, I was also enticed by multi-methods in this area, but I ultimately don’t think multiple dispatch is necessary.
comment 7y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
hn:
javascript:window.location.href='https://hn.algolia.com?query='+encodeURIComponent(window.location.href)%20+%20'&page=0&dateRange=all&type=story'
reddit: javascript:(function()%7Bwindow.location.href%20%3D%20%22https%3A%2F%2Freddit.com%2Fsearch%3Fq%3Durl%3A%22%20%2B%20encodeURIComponent(window.location.href)%7D)()comment 9y ago · link · parent
comment 9y ago · link · parent
EDIT: Grammar
comment 10y ago · link · parent
This is called the hierarchy problem. https://en.wikipedia.org/wiki/Hierarchy_problem#The_Higgs_ma...
comment 12y ago · link · parent
That being said I still find the speed of Realm pretty impressive. And it's hard to gauge real world performance from this test. In my experience the real bottle necks around insert are upsets and establishing maintaining relationships.
For reference here are the benchmarks without reusing sqlite statements.
Macbook Pro - Realm: 0.780414 sqlite: 0.464804 FMDB: 0.654659
iPhone 5S - Realm: 2.235381 sqlite: 2.786381 FMDB: 3.336679
And with statement reuse Macbook Pro - Realm: 0.766406 sqlite: 0.189747 FMDB: 0.683823
iPhone 5S - Realm: 2.214847 sqlite: 0.991864 FMDB: 2.832800
Interesting side note: FMDB seems to be spending just as much time finding the cached statement as sqlite takes to prepare a new one. I didn't expect that. I haven't dug into it at all, but I wouldn't be surprised if this due to the fact that the insert statement is relatively simple.EDIT: Just fixed up formatting for the results