Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
benhoyt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
35 ms
·
361.
▲
by
benhoyt
5y ago
Aside from the "assertion" libraries, which I have mixed feelings about, I often use table-driven tests to avoid this. That way each test is generally one line, like `{"1234", 1234}` for testing an Atoi function. Or, I&#
362.
▲
by
benhoyt
5y ago
I suspect in part it's a combination of 1) Go is good enough as is (and some people don't mind Go's simple type system or the boilerplate-y but explicit error handling), and 2) the Go tooling is really good -- "go build&
363.
▲
by
benhoyt
5y ago
For better or worse, this is by design. See: https://golang.org/doc/faq#methods_on_basics It's "to avoid complicating questions about the interface (in the Go type sense) of basic types". It also allows
364.
▲
by
benhoyt
5y ago
Note that this switches to a register-based calling convention, but it's not the platform "standard" one. The Go authors describe the rationale for this here: https://go.googlesource.com/proposal/+/
365.
▲
by
benhoyt
5y ago
Overall for GoAWK I get an 18% speed increase on my micro-benchmarks between Go 1.16 and 1.17 (see https://github.com/benhoyt/goawk/commit/1f314f421273b3dc164f... ) and I measured an 8% speed increase on my &q
366.
▲
by
benhoyt
5y ago
With the introduction of generics in Go 1.18 and the accompanying "slices" package ( https://github.com/golang/go/issues/45955 ), we might soon write that as: a = slices.Delete(a, i, i+1) That
367.
▲
by
benhoyt
5y ago
Oh, good to know, thanks!
368.
▲
by
benhoyt
5y ago
Wow, this update is awesome: my GoAWK interpreter ( https://github.com/benhoyt/goawk ) runs a simple CPU-bound AWK program 38% faster when compiled with Go 1.17 (compared to 1.16). $ time goawk_go1.16 'BEGIN { f
369.
▲
by
benhoyt
5y ago
To me, the most interesting change is the performance improvement due to the new register-based calling convention. Your CPU-bound programs will magically get 5% faster when compiled with 1.17: > Go 1.17 implements a new way of passing f
370.
▲
by
benhoyt
5y ago
We have a 14-year old daughter who's been begging us to get her a phone for a couple of years now (we've said she can at 15), and I'm guessing she doesn't experience that much social ostracism, but she does experience
371.
▲
by
benhoyt
5y ago
My own experience backs this up: on the hiring side, I always use someone's personal projects as a fun discussion point in interviews (if they don't have any it doesn't count against them ... but like simonw says, it may help
372.
▲
by
benhoyt
5y ago
Link to said textbook content on dynamic arrays: http://www.craftinginterpreters.com/chunks-of-bytecode.html#... Edit: Ah, I just saw munificent linked to this in a reply elsewhere in the thread.
373.
▲
by
benhoyt
5y ago
New Zealand is proposing a similar law change: https://consultations.justice.govt.nz/policy/incitement-of-h... ... it's ostensibly in response to the Christchurch mosque shooting of 2019, but I'm very wary of
374.
▲
by
benhoyt
5y ago
Yeah, this is rather strange. I mean, it's vaguely interesting, but contains so little information and so few details it really doesn't seem front-page worthy, let alone worthy of the #1 spot. I thought about flagging it, but it&#
375.
▲
Go 1.17 is deprecating the traditional use of 'go get'
(utcc.utoronto.ca)
2 points
by
benhoyt
5y ago
|
0 comments
376.
▲
by
benhoyt
5y ago
Excellent article -- despite (like others) disagreeing with several of his specific points, I think his overall take to optimize for predictability, readability, and simplicity is great. A few years ago I took over as tech lead at a previou
377.
▲
by
benhoyt
5y ago
I'm a Type 1 & 2 combo. I currently work full-time at home (with Canonical, which has been "remote first" long before Covid) and I love the flexibility and the fact there's no commute, but I do miss the office intera
378.
▲
How to end up with 500k commits in your log
(arp242.net)
88 points
by
benhoyt
5y ago
|
55 comments
379.
▲
by
benhoyt
5y ago
Yeah, I like the "visual boundaries" way of framing it. A line of whitespace is a visual boundary, of course, but I find the // comment above it acts as a heading. Like a bold heading above a couple of paragraphs of text
380.
▲
by
benhoyt
5y ago
I have no idea what Triplebyte gets or even what their business model is, but typical recruitment companies get a lot more than that -- on the order of 15-20% of the first year's salary, so on the order of $15-25k. I suspect Tripleby
381.
▲
Cue, an open-source data validation language
(cuelang.org)
190 points
by
benhoyt
5y ago
|
71 comments
382.
▲
Istiod: Simplifying the Control Plane (2020)
(istio.io)
2 points
by
benhoyt
5y ago
|
0 comments
383.
▲
Language Compilation Speed
(wiki.alopex.li)
2 points
by
benhoyt
5y ago
|
0 comments
384.
▲
by
benhoyt
6y ago
I think this is inspirational but it seems like puffy popular science ("pseudo-science" may or may not be too strong?). I'll quote what I wrote to a friend about this article: > It was intriguing and piqued my interest. Ho
385.
▲
by
benhoyt
6y ago
Thanks, that's a great idea -- not sure why I didn't think of that, as I am using the assembler to figure this out for if/else forward branches already (as the parent comment pointed out). I've added a paragraph to the a
386.
▲
by
benhoyt
6y ago
Wow, I had no idea the Oberon implementation was so small, thanks. And it looks like it's implemented in a similar way, with parsing and code generation mingled together. It is ~2900 lines of code, though it's very dense. You can
387.
▲
by
benhoyt
6y ago
Interesting. I couldn't find any documentation for how this happens (does it need compiler/linker support to know whether free is used?), but I did find the source code for this __simple_malloc: https://git.musl-libc.or
388.
▲
by
benhoyt
6y ago
Wow, that is impressive, thanks. I confirmed this with godbolt.org at -O2.
389.
▲
by
benhoyt
6y ago
Yes, that's correct. I actually initially implemented local "var" parsing, but was never using it in the compiler, so I removed it to trim it down and keep things as simple as reasonably possible.
390.
▲
by
benhoyt
6y ago
> can and probably are optimizing the loop away Why do you think that, and how would it do that and still do the calculation? My timing tests showed that Go didn't optimize the loop away (if I counted to 10 billion it took about 10
More ›