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
Create a new section under reference called Domain specific features to dump all technical details about features added to tinygo which are not present in Go or that function differently such as:
pragmas
Stdlib functionality (what does it mean to not have an OS?)
Memory addresses of microprocessor peripherals
I am available for starting work on this if I get a greenlight!
Ayke:
The //go:inline pragma is only a hint. It will make it more likely that something is inlined, but it's no guarantee at all. In fact, I would very much recommend against using it unless you know what you're doing: the compiler usually knows better whether to inline a function or not.
The compiler will already inline many functions, the pragma only makes it somewhat more likely.
//go:inline and //go:noinline: only for very specific cases. Makes inlining more likely, does not have an effect on heap allocations.
//go:linkname: same as regular Go, don't use it unless you know what you're doing.
//go:align and //go:section: only for specific use cases like DMA.
//go:nobounds: unsafe, don't use unless you know what you're doing
//go:variadic: don't use (only for internal use)
//go:export: alias for //export, the only pragma that is meant for use in regular code
The text was updated successfully, but these errors were encountered:
Create a new section under
reference
called Domain specific features to dump all technical details about features added to tinygo which are not present in Go or that function differently such as:I am available for starting work on this if I get a greenlight!
Below is data exchanged on slack channel.
Benjamin Gould:
function pragmas: https://github.com/tinygo-org/tinygo/blob/release/compiler/symbol.go#L245-L296
global pragmas: https://github.com/tinygo-org/tinygo/blob/release/compiler/symbol.go#L430-L453
Ayke:
The //go:inline pragma is only a hint. It will make it more likely that something is inlined, but it's no guarantee at all. In fact, I would very much recommend against using it unless you know what you're doing: the compiler usually knows better whether to inline a function or not.
The compiler will already inline many functions, the pragma only makes it somewhat more likely.
The text was updated successfully, but these errors were encountered: