tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

apidiff: Differences between TinyGo stdlib and Go stdlib

Open eNV25 opened this issue 1 year ago • 1 comments

# tinygo version
tinygo version 0.25.0 linux/amd64 (using go version go1.19.1 and LLVM version 14.0.0)
# GOFLAGS='-tags=tinygo' apidiff crypto/rand github.com/tinygo-org/tinygo/src/crypto/rand
# GOFLAGS='-tags=tinygo' apidiff net github.com/tinygo-org/tinygo/src/net
Incompatible changes:
- (*Dialer).Dial: removed
- (*IPAddr).Network: removed
- (*IPAddr).String: removed
- (*OpError).Temporary: removed
- (*OpError).Timeout: removed
- (*ParseError).Temporary: removed
- (*ParseError).Timeout: removed
- (*TCPConn).CloseRead: removed
- (*TCPConn).ReadFrom: removed
- (*TCPConn).SetKeepAlive: removed
- (*TCPConn).SetKeepAlivePeriod: removed
- (*TCPConn).SetLinger: removed
- (*TCPConn).SetNoDelay: removed
- (*TCPConn).SyscallConn: removed
- (*conn).Close, method set of *TCPConn: removed
- (*conn).File, method set of *TCPConn: removed
- (*conn).LocalAddr, method set of *TCPConn: removed
- (*conn).Read, method set of *TCPConn: removed
- (*conn).RemoteAddr, method set of *TCPConn: removed
- (*conn).SetDeadline, method set of *TCPConn: removed
- (*conn).SetReadBuffer, method set of *TCPConn: removed
- (*conn).SetReadDeadline, method set of *TCPConn: removed
- (*conn).SetWriteBuffer, method set of *TCPConn: removed
- (*conn).SetWriteDeadline, method set of *TCPConn: removed
- (*conn).Write, method set of *TCPConn: removed
- DNSConfigError: removed
- DNSError: removed
- DefaultResolver: removed
- DialIP: removed
- DialTCP: removed
- DialTimeout: removed
- DialUDP: removed
- DialUnix: removed
- Dialer.Cancel: removed
- Dialer.Control: removed
- Dialer.FallbackDelay: removed
- Dialer.LocalAddr: removed
- Dialer.Resolver: removed
- ErrWriteToConnected: removed
- FileConn: removed
- FileListener: removed
- FilePacketConn: removed
- IP.IsPrivate: removed
- IPConn: removed
- InvalidAddrError: removed
- ListenConfig: removed
- ListenIP: removed
- ListenMulticastUDP: removed
- ListenPacket: removed
- ListenTCP: removed
- ListenUDP: removed
- ListenUnix: removed
- ListenUnixgram: removed
- LookupAddr: removed
- LookupCNAME: removed
- LookupHost: removed
- LookupIP: removed
- LookupMX: removed
- LookupNS: removed
- LookupPort: removed
- LookupSRV: removed
- LookupTXT: removed
- MX: removed
- NS: removed
- PacketConn: removed
- Pipe: removed
- ResolveIPAddr: removed
- ResolveTCPAddr: removed
- ResolveUDPAddr: removed
- ResolveUnixAddr: removed
- Resolver: removed
- SRV: removed
- TCPAddr: removed
- TCPAddrFromAddrPort: removed
- TCPListener: removed
- UDPAddr: removed
- UDPAddrFromAddrPort: removed
- UDPConn: removed
- UnixAddr: removed
- UnixConn: removed
- UnixListener: removed
- UnknownNetworkError: removed
Compatible changes:
- ErrNotImplemented: added
# TODO: find workaround
# GOFLAGS='-tags=tinygo' apidiff os github.com/tinygo-org/tinygo/src/os
loading github.com/tinygo-org/tinygo/src/os: ../../go/pkg/mod/github.com/tinygo-org/[email protected]/src/os/tempfile.go:9:2: use of internal package internal/itoa not allowed
# GOFLAGS='-tags=tinygo' apidiff os/exec github.com/tinygo-org/tinygo/src/os/exec
Incompatible changes:
- Cmd: removed
- Command: removed
- CommandContext: removed
- ErrDot: removed
- ErrNotFound: removed
- Error: removed
- LookPath: removed
# GOFLAGS='-tags=tinygo' apidiff reflect github.com/tinygo-org/tinygo/src/reflect
Incompatible changes:
- (*MapIter).Reset: removed
- Array: value changed from 17 to 23
- ArrayOf: removed
- Chan: value changed from 18 to 19
- ChanDir.String: removed
- ChanOf: removed
- Func: value changed from 19 to 24
- FuncOf: removed
- Kind: changed from uint to uintptr
- MakeChan: removed
- MakeMapWithSize: removed
- Map: value changed from 21 to 25
- MapOf: removed
- Method.IsExported: removed
- Pointer: value changed from 22 to 21
- Ptr: value changed from 22 to 21
- Select: removed
- SelectCase: removed
- SelectDefault: removed
- SelectDir: removed
- SelectRecv: removed
- SelectSend: removed
- Slice: value changed from 23 to 22
- SliceHeader.Cap: changed from int to uintptr
- SliceHeader.Len: changed from int to uintptr
- String: value changed from 24 to 17
- StringHeader.Len: changed from int to uintptr
- Struct: value changed from 25 to 26
- StructOf: removed
- Type.FieldByIndex: removed
- Type.FieldByNameFunc: removed
- Type.Method: removed
- UnsafePointer: value changed from 26 to 18
- Value.CallSlice: removed
- Value.CanComplex: removed
- Value.CanConvert: removed
- Value.CanFloat: removed
- Value.CanInt: removed
- Value.CanUint: removed
- Value.Close: removed
- Value.FieldByNameFunc: removed
- Value.InterfaceData: removed
- Value.IsZero: removed
- Value.Method: removed
- Value.OverflowComplex: removed
- Value.Send: removed
- Value.SetIterKey: removed
- Value.SetIterValue: removed
- Value.SetPointer: removed
- Value.TryRecv: removed
- Value.TrySend: removed
- Value.UnsafeAddr: removed
- VisibleFields: removed
Compatible changes:
- TypeError: added
- Value.RawType: added
# TODO: find workaround
# GOFLAGS='-tags=tinygo' apidiff runtime github.com/tinygo-org/tinygo/src/runtime
loading github.com/tinygo-org/tinygo/src/runtime: /home/nv/go/pkg/mod/github.com/tinygo-org/[email protected]/src/runtime/chan.go:27:2: could not import internal/task (invalid package name: "")
# GOFLAGS='-tags=tinygo' apidiff runtime/cgo github.com/tinygo-org/tinygo/src/runtime/cgo
Incompatible changes:
- Handle: removed
- NewHandle: removed
# GOFLAGS='-tags=tinygo' apidiff runtime/debug github.com/tinygo-org/tinygo/src/runtime/debug
Incompatible changes:
- (*BuildInfo).String: removed
- BuildInfo.GoVersion: removed
- BuildInfo.Settings: removed
- BuildSetting: removed
- FreeOSMemory: removed
- GCStats: removed
- ParseBuildInfo: removed
- PrintStack: removed
- ReadGCStats: removed
- SetGCPercent: removed
- SetMaxThreads: removed
- SetMemoryLimit: removed
- SetPanicOnFault: removed
- SetTraceback: removed
- WriteHeapDump: removed
# GOFLAGS='-tags=tinygo' apidiff runtime/pprof github.com/tinygo-org/tinygo/src/runtime/pprof
Incompatible changes:
- (*Profile).Add: removed
- (*Profile).Count: removed
- (*Profile).Name: removed
- (*Profile).Remove: removed
- Do: removed
- ForLabels: removed
- Label: removed
- LabelSet: removed
- Labels: removed
- NewProfile: removed
- Profiles: removed
- SetGoroutineLabels: removed
- WithLabels: removed
- WriteHeapProfile: removed
Compatible changes:
- ErrUnimplemented: added
# TODO: find workaround
# GOFLAGS='-tags=tinygo' apidiff sync github.com/tinygo-org/tinygo/src/sync
loading github.com/tinygo-org/tinygo/src/sync: /home/nv/go/pkg/mod/github.com/tinygo-org/[email protected]/src/sync/cond.go:3:8: could not import internal/task (invalid package name: "")
# GOFLAGS='-tags=tinygo' apidiff testing github.com/tinygo-org/tinygo/src/testing
Incompatible changes:
- (*B).ReportMetric: removed
- (*B).SetParallelism: removed
- (*T).Deadline: removed
- (*T).Setenv: removed
- (*common).Setenv, method set of *B: removed
- (*common).Setenv, method set of *F: removed
- BenchmarkResult.Extra: removed
- BenchmarkResult.MemAllocs: removed
- BenchmarkResult.MemBytes: removed
- BenchmarkResult.MemString: removed
- Cover: removed
- CoverBlock: removed
- Coverage: removed
- Main: removed
- MainStart: changed from func(testDeps, []InternalTest, []InternalBenchmark, []InternalFuzzTarget, []InternalExample) *M to func(interface{}, []InternalTest, []InternalBenchmark, []InternalFuzzTarget, []InternalExample) *M
- RegisterCover: removed
- RunBenchmarks: removed
- RunExamples: removed
- RunTests: removed
- TB.Setenv: removed
Compatible changes:
- M.Benchmarks: added
- M.Tests: added

This might be useful enough to add to wiki.

eNV25 avatar Sep 09 '22 08:09 eNV25

Actually, I think it would be great to have this included in https://tinygo.org/docs/reference/lang-support/stdlib/. It will need some fudging with the information from tinygo info "" (cached GOROOT, etc) so that it can locate imports.

See https://github.com/tinygo-org/tinygo-site/blob/release/imports/main.go for the code that generates the standard library test results.

aykevl avatar Sep 14 '22 10:09 aykevl