HNHacker News
TopNewBestAskShowJobs

tynorf

96 karma · joined October 3, 2017

[ my public key: https://keybase.io/tynor; my proof: https://keybase.io/tynor/sigs/cDld0ea8BUMbX4Blb2Hs-zUV9Cp9rGQDSu7I4SGZXeI ]
submissionscomments
tynorf··on Go’s Features of Last Resort
Your protobuf messages are changing that much? My condolences.

ETA: Also, you already are needing to add code to every encode/decode point for the `map[string]interface{}` handling. :P

tynorf··on Go’s Features of Last Resort
One technique I use is to create a struct that mirrors the layout of the target struct, then just cast between them. So if you have a

  type Person struct {
    FirstName string `json:"first_name"`
  }
And you get json like `{"name": "Alice"}`, you can decode it something like this:

  var doc struct {
    FirstName string `json:"name"`
  }
  json.Unmarshal(data, &doc)
  person := Person(doc)
I have not looked at the assembly so I can't say whether this incurs extra overhead or not.
tynorf··on Restic – Backups Done Right
AFAIK that is exactly how restic works. You use `restic forget` to remove the roots (snapshots), then `restic prune` garbage collects unreachable blobs.

ETA: However, nearly all data in restic is encrypted. This includes the index files. So you still need to have the encryption key to look at snapshots and walk their trees.

tynorf··on Common Systems Programming Optimizations and Tricks
Many (most? all?) allocators are guaranteed to give you back aligned pointers.

For instance, jemalloc(3) on amd64 platforms will give back 16-byte aligned pointers:

  [...] The allocated space is suitably aligned
  (after possible pointer coercion) for storage of any type of object.
tynorf··on A lighter V8
The PyPy interpreter is written in RPython, but is a full Python interpreter with a JIT. When you compile PyPy, it generates C files from RPython sources, which are then compiled with a normal C compiler into a standalone binary.

RPython is both a language (a very ill-defined subset of Python... pretty much defined as "the subset of Python accepted by the RPython compiler"), and a tool chain for building interpreters. One benefit of writing an interpreter in RPython is that, with a few hints about the interpreter loop, it can automatically generate a JIT.

tynorf··on A lighter V8
As far as I know, JS does not have the equivalent of Python's descriptor protocol[0]. This is notably different from setter/getter methods.

[0]: https://docs.python.org/3/howto/descriptor.html

tynorf··on To Break Google’s Monopoly on Search, Make Its Index Public
It's posted a few other places in this thread, but it already exists: https://commoncrawl.org/
tynorf··on Next steps toward Go 2
In Rust you can also do arbitrary operations on the error before it is returned with `Result.map_err()`.
tynorf··on Switch from Chrome to Firefox
macOS will create local backups (space permitting) and then dump them all at once when connected to the Time Machine drive. Though of course you won't have the backups from between the last time you connected the drive to the time your computer was hosed.
tynorf··on BigInt Shipping in Firefox
This is one reason why people use strings for IDs in JSON, even if they are actually integers.
tynorf··on Some of China’s '996' tech tribe quit, seek less stress
This article seems to indicate that they would at least develop better games if the employees were not subjected to "crunch". https://gamasutra.com/blogs/PaulTozour/20150120/234443/The_G...
tynorf··on Apple tells app developers to disclose or remove screen recording code
I deleted the Music app and that stopped it. ️
tynorf··on Makefiles – Best Practices

  / # make --version
  GNU Make 4.2.1
  Built for x86_64-alpine-linux-musl
  Copyright (C) 1988-2016 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
tynorf··on Evaluation of five password managers
> although you'll get worse performance since Apple doesn't allow third party browsers to take advantage of Javascript optimizations

This hasn't been true since iOS 8 with WKWebView[0].

[0] http://www.iphonehacks.com/2014/06/ios-8-javascript-performa...

tynorf··on OOP Is Dead, Long Live OOP
As a testament to how bad AWS's shorthand is, ECS is actually Elastic Container Service.
tynorf··on Death by Database
> Addresses are complicated too so you might as well just have a country field + the rest and then use an API to standardize, which also makes future queries easy.

This, big time. I worked on an ecommerce site that had to ship to Nigeria. No zip codes, often no street name or number. "Two doors north of the post office on the east side of Lagos." The couriers could find it.

tynorf··on Stripe Billing
Recurly is actually 1.25% plus $0.10 per transaction plus $99/month (core) or plus $299/month (professional).
tynorf··on Go best practices, six years in (2016)
I'm fairly certain you can use `--flag` with the standard flag package from stdlib: https://godoc.org/flag (in the section on command line flag syntax).

Though supporting `-flag` does remove the very nice combining of short flags.

tynorf··on The Cost of JavaScript
> Give me literally any other language.

I'm torn between JS and PHP for the language I have the least fun programming in.

← PreviousPage 2 of 2