You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go is a systems language, but without pointer logic, or inline assembler code
(like C/C++), how can we interface with hardware? Perhaps there should be an
unsafe system like that of C#, so Go can be embedded and interfaced directly
with hardware, other ways.
Then again I may be missing something, there might already be a way to
interface hardware with Go, if so something in the FAQ or a tutorial would be
nice.
Thanks!
The text was updated successfully, but these errors were encountered:
"The unsafe package contains operations that step around the type safety of Go
programs."
http://golang.org/pkg/unsafe/
Which includes a Pointer type, that lets you read/write arbitrary memory.
Thanks! I've just began looking through the documentation for a bit, but hadn't found
any references to this package yet. Great to know it exists.
As a systems programmer this could have been a deal breaker. I was about to dismiss Go
completely as a real systems language, but figured I'd ask first, glad I did. But it
would probably be wise to add this info to the language FAQ, so other system
programmers don't miss this feature and leave before asking.
We're intentionally quiet about package unsafe
(it is documented in the spec), because it's not intended
for everyday use. It is, as you note, crucial for implementing
some low-level pieces of the system.
It is also worth noting that Go can link with C programs
easily if some very low-level tasks are better done in C.
by Robert.Jay.Gould:
The text was updated successfully, but these errors were encountered: