Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Leotard6963
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
Show HN: Build WebExtensions in Go, a Native Way
(github.com)
3 points
by
Leotard6963
3y ago
|
0 comments
2.
▲
by
Leotard6963
3y ago
Note that this project is not an attempt to replace the Go runtime, but here is what we will do: Precondition: in Go, each goroutine has its own `g` structure (like TCB, but for controlling goroutines) and its address is stored in the `g` r
3.
▲
by
Leotard6963
3y ago
Yes, that's one of our motivations to build this std! The feature of generating go packages from C in `ffigen` still needs significant work to be done (mostly dealing with C calling conventions on different platforms), and the generate
4.
▲
by
Leotard6963
3y ago
I'm afraid there is no such resource, but you may find cmd/compile/abi-internal.md[1] helpful And in brief introduction, the `g` register is a non-scratch register, and is preserved by the go compiler, it stores the poitner t
5.
▲
by
Leotard6963
3y ago
Thank you for your suggestions, but I'm afraid the best we can do is to list packages compatible with both std. The problem is, in order to build a std, we have to use a lot of <ABIInternal> stuff in assembly, and use internal&#x
6.
▲
by
Leotard6963
3y ago
Thanks, but the actually hard things are done by the Go team, the design of the interface type and availability of runtime type information made it relatively easy to complete that final goal, but let's go find out!
7.
▲
by
Leotard6963
3y ago
"platform native sdk" is the collection of apis exposed on that platform exclusively (think win32 apis, android ndk). The project is to build a stdlib, and by its nature is to be used by developers to build applications just like
8.
▲
by
Leotard6963
3y ago
Yes, we are re-implementing (some of) the official std, but with careful redesign, and probably won't provide a lot of familiar apis, this is largely because packages from the official std often do implicit allocations with the assumpt
9.
▲
by
Leotard6963
3y ago
So this is the std made for you, and to make it compile, you have to import the runtime package explicitly.
10.
▲
by
Leotard6963
3y ago
Currently pcz is building applications with the `compiling-runtime` option, so variables implicitly escaped from the stack will cause compile error. For variables you are sure living on the stack, you can use `mark.NoEscape(&v)` to obta
11.
▲
by
Leotard6963
3y ago
> dropping GC, dropping runtime concurrency Making GC/goroutine optional & customizable requires building a std works with no GC/goroutine. > dropping std relax, this is a new std, let's spare the baby some hope?
12.
▲
by
Leotard6963
3y ago
You are right, the pcz std won't be a drop-in replacement to the official std as they have different modulepath. We decided to make it this way so: 1) you can import packages from the pcz std module like you do with any other Go packag
13.
▲
by
Leotard6963
3y ago
> converge or diverge Neither, though the final result can be similar, but at project level, tinygo and pcz has very different approaches to achieve the final result: - tinygo chose the hard path to write a llvm backed toolchain with som
14.
▲
by
Leotard6963
3y ago
Sorry to cause the confusion, we are building a stdlib for Go, and all these goals are related to the development experience when using our stdlib, and we are not aiming at anything like replacing the official go stdlib (which we also enjoy
15.
▲
by
Leotard6963
3y ago
"adapting to the platform" is mostly related to the goroutine topic, as we are working on the js/wasm support and these applications prefer async/await operations. re: goroutines the official go runtime spawns goroutines
16.
▲
by
Leotard6963
3y ago
re: telemetry We don't like it as well, just do not enable it :^ re: RAII It is not possible to add RAII support without updating the compiler to call specific methods automatically, so currently it is not an option (as we are using un
17.
▲
Show HN: A new stdlib for Golang focusing on platform native support
(github.com)
154 points
by
Leotard6963
3y ago
|
82 comments
18.
▲
by
Leotard6963
4y ago
afaik, the `time` package [1] from the golang standard library has a brilliant support for (almost) everything about time, including timezone, leap year, months, duration. take timezone for example, time.Time.In [2] could be a good startpoi