Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded go, needs pointer logic #202

Closed
gopherbot opened this issue Nov 15, 2009 · 3 comments
Closed

Embedded go, needs pointer logic #202

gopherbot opened this issue Nov 15, 2009 · 3 comments

Comments

@gopherbot
Copy link
Contributor

by Robert.Jay.Gould:

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!
@gopherbot
Copy link
Contributor Author

Comment 1 by jesse.dailey:

"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.

@gopherbot
Copy link
Contributor Author

Comment 2 by Robert.Jay.Gould:

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.

@rsc
Copy link
Contributor

rsc commented Nov 15, 2009

Comment 3:

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.

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants