Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
totallygamerjet
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
totallygamerjet
4y ago
I don't have either. I was gonna figure out how to post it after I actually sat down and wrote it lol. I'll probably post it in the golang subreddit and maybe link to it in the README.md since it describes how purego works.
2.
▲
by
totallygamerjet
4y ago
"In Go object files and binaries, the full name of a symbol is the package path followed by a period and the symbol name: fmt.Printf or math/rand.Int. Because the assembler's parser treats period and slash as punctuation, tho
3.
▲
by
totallygamerjet
4y ago
What slimsag wrote is correct. It makes cross-compiling code that needs to call C functions as easy a setting the GOOS and GOARCH and just building. This means no need to worry about building a C cross-compiler. I do want to write an articl
4.
▲
by
totallygamerjet
4y ago
I’m one of the main contributors. I’ve looked into it bc I wanted to know if I could build iOS apps without Cgo. ATM, it is not possible. The reason is because when you run go build creating a shared object it runs the go cgo tool. That too
5.
▲
by
totallygamerjet
4y ago
Yeah the default behavior is to switch back. It’s possible to pin a goroutine to a thread with runtime.LockOSThread(). However I don’t believe it avoids the stack switching. It’s purpose it to make sure that Thread Local Storage works prope
6.
▲
by
totallygamerjet
4y ago
It’s pretty simple to use if you are familiar with dlopen and friends. Just call purego.Dlopen(“libname.so”, purego.RTLD_GLOBAL) Take the returned library (make sure to check for errors with purego.Dlerror() first) and call purego.Dlsym(lib
7.
▲
by
totallygamerjet
4y ago
Contributor here: Purego doesn’t do anything to improve the overhead of calling into C. It uses the same mechanisms that Cgo does to switch to the system stack and then call the C code. Purego just avoids having to need a C toolchain to cro