Live data from Hacker News

Don't Clobber the Frame Pointer

nsrip.com

1–10 of 46 posts

Re: Don't Clobber the Frame Pointer

#2
GoLang assembly boggles my mind - I understand why it's there, but having looked at it few times makes me wonder if it could've been prevented somehow (I guess not, cryptographic primitives would be way too slow, redirecting them through some kind of ffi would require a shared lib, yada yada yada)...

Re: Don't Clobber the Frame Pointer

#3
post #2

GoLang assembly boggles my mind - I understand why it's there, but having looked at it few times makes me wonder if it could've been prevented somehow (I guess not, cryptographic primitives would be way too slow, redirecting them through some kind of ffi would require a shared lib, yada yada yada)...

They could have added crypto primitives via intrinsic, or had some other way of including the edge case functionality it solves.

But it's good enough and I guess it compiles quick which was a major goal for golang.

Re: Don't Clobber the Frame Pointer

#4
post #3
post #2

GoLang assembly boggles my mind - I understand why it's there, but having looked at it few times makes me wonder if it could've been prevented somehow (I guess not, cryptographic primitives would be way too slow, redirecting them through some kind of ffi would require a shared lib, yada yada yada)...

They could have added crypto primitives via intrinsic, or had some other way of including the edge case functionality it solves. But it's good enough and I guess it compiles quick which was a major goal for golang.

Major Rust cryptography libraries (see for instance Ring) use assembly, too. It's a pretty normal thing to do.

Re: Don't Clobber the Frame Pointer

#5
post #3
post #2

GoLang assembly boggles my mind - I understand why it's there, but having looked at it few times makes me wonder if it could've been prevented somehow (I guess not, cryptographic primitives would be way too slow, redirecting them through some kind of ffi would require a shared lib, yada yada yada)...

They could have added crypto primitives via intrinsic, or had some other way of including the edge case functionality it solves. But it's good enough and I guess it compiles quick which was a major goal for golang.

[deleted]

Re: Don't Clobber the Frame Pointer

#6
post #4
post #3

Earlier quoted context omitted.

They could have added crypto primitives via intrinsic, or had some other way of including the edge case functionality it solves. But it's good enough and I guess it compiles quick which was a major goal for golang.

Major Rust cryptography libraries (see for instance Ring) use assembly, too. It's a pretty normal thing to do.

It's kinda weird that languages (or at least languages with pretensions to cryptography) are still forcing people to resort to asm directly rather than offering some sort of first-class support for constant time operations and not leaving secrets lying around in memory. It doesn't need to be super high level, it just needs to clear the infinitely low bar of assembly language. Does any language offer such a dedicated facility?

Re: Don't Clobber the Frame Pointer

#7
post #4
post #3

Earlier quoted context omitted.

They could have added crypto primitives via intrinsic, or had some other way of including the edge case functionality it solves. But it's good enough and I guess it compiles quick which was a major goal for golang.

Major Rust cryptography libraries (see for instance Ring) use assembly, too. It's a pretty normal thing to do.

Sure but golang has its own special assembly flavor rather than using standard gcc flavor inline assembly. Probably because it's a soup to nuts compiler but still.

Re: Don't Clobber the Frame Pointer

#8
post #7
post #4

Earlier quoted context omitted.

Major Rust cryptography libraries (see for instance Ring) use assembly, too. It's a pretty normal thing to do.

Sure but golang has its own special assembly flavor rather than using standard gcc flavor inline assembly. Probably because it's a soup to nuts compiler but still.

The point of this article is that Go-specific assembler generators (Avo in particular) are better than standard assembly for this purpose.

Re: Don't Clobber the Frame Pointer

#9
post #7
post #4

Earlier quoted context omitted.

Major Rust cryptography libraries (see for instance Ring) use assembly, too. It's a pretty normal thing to do.

Sure but golang has its own special assembly flavor rather than using standard gcc flavor inline assembly. Probably because it's a soup to nuts compiler but still.

>soup to nuts compiler

Any chance you can explain that to rubes like me?

Re: Don't Clobber the Frame Pointer

#10
post #7

Earlier quoted context omitted.

Sure but golang has its own special assembly flavor rather than using standard gcc flavor inline assembly. Probably because it's a soup to nuts compiler but still.

>soup to nuts compiler Any chance you can explain that to rubes like me?

Go isn't built on an existing compiler framework like LLVM. It does its own code generation, has its own assembler.
Post reply on HN