Hacker Newsnew | past | comments | ask | show | jobs | submit | darkgray's commentslogin

Pardon, but the assembly code on the "Loop de Loop" chapter currently seems broken. "rax" is acting as all three variables somehow.


Nice catch! Just to be clear, it was that we were incrementing our exponent but not our counter, is that right? I pushed up a fix, but let me know if there were other issues.


It's a bit more involved than that.

  mul rcx, rax       ; multiply our result by our base, save into rcx
This should probably be using rbx, since that's the designated base, not rax, which is the exponent.

In the explanation just above, there's a 2*8 step missing, while this one is incorrect:

  4. result = 16 * 2, result is now 16
Since 2*16 is not 16.


Ahhhhh thank you! Do you mind opening a PR or issue so I can get to that? Thank you for noticing!!


Me too. I have a project suffering pretty badly from the performance hit taken when a regexp doesn't start with a fixed string. Matching against `[ab]cd` is up to 9x slower than against `ab[cd]`.


Japanese forum giant 5ch (formerly 2ch) has also decided to IP block all of EU in order to "comply" with GDPR, as of a few days ago.

I've been hoping it wouldn't spread, since it's depressing to be confined to a little internet bubble in this day and age. Guess I'll be needing a VPN.


Careful which countries you go to with that VPN. You don’t want to intentionally circumvent an access control restriction. ;)


The far left and right sides are clickable to "turn the page", so to speak. It's an invisible area, though, so it's not very easy to deduce from just looking at the webpage.


While it doesn't remove the gymnastics requirement, a relatively nice alternative to webpage pgup/pgdn is shift-space/space.


I always thought Goo could be a name that sticks.


Go 1.1 made int default to int64, so it may depend on how up-to-date your particular version is. God knows what the blog poster uses, though.


I'm still on Go 1.0.2. However, I strongly doubt that having 1.1 yields the correct result in the amount of time that the article boasts; I rewrote the program in C (direct translation), and with both clang and gcc, I get timings of around 2m05s. It's hard to believe that for a CPU-bound task, a Go program would be 200x faster than a C program.


I'd agree it's dubious, but I was mostly commenting on the "correctness" of the code. It'd work on Go 1.1, so it's technically "correct". Sometimes. :)


Fair enough.


That is not quite right, before 1.1 int was 32-bit on all platforms and post 1.1 an int is 32-bit on 32-bit platforms and 64-bit on 64-bit platforms.

You are supposed to use int when you don't care about its size (int = native word size). If you are writing a program where it matters you should explicitly use int32 or int64.


ST2 can also delete entire words: Ctrl+Del (ahead) Ctrl+Backspace (behind)

Ctrl+Del even works in Notepad, if that's your thing.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: