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
Go version: 1.24.0, but the same error in older compiler versions too.
Starlet version: latest published, v0.1.2
chzyer/readline versions: both latest, v1.5.1 and v0.0.0-20180603132655-2972be24d48e used in Starlet.
Reproduction steps
mkdir reproduce-error
cd reproduce-error
go mod init main
go get github.com/1set/starlet
cat > starlet.go << 'END'package mainimport ( "github.com/1set/starlet")func main() { const code = `print('Hello from Starlet!')` machine := starlet.NewWithBuiltins(nil, nil, nil) _, err := machine.RunScript([]byte(code), nil) if err != nil { panic(err) }}END# works OK in console
go run starlet.go
# fails to compile to WASM
GOOS=js GOARCH=wasm go build -o starlet.wasm starlet.go
Same error against latest available version of chzyer/readline, 1.5.1 at the this time
mkdir reproduce-error-v1.5.1
cd reproduce-error-v1.5.1
go mod init main
go get github.com/1set/starlet
go get github.com/chzyer/[email protected]
cat > starlet.go << 'END'package mainimport ( "github.com/1set/starlet")func main() { const code = `print('Hello from Starlet!')` machine := starlet.NewWithBuiltins(nil, nil, nil) _, err := machine.RunScript([]byte(code), nil) if err != nil { panic(err) }}END# works OK in console
go run starlet.go
# fails to compile to WASM
GOOS=js GOARCH=wasm go build -o starlet.wasm starlet.go
Encountered an error while attempted to compile the embedded version of Starlet to Webassembly:
v0.0.0-20180603132655-2972be24d48e
used in Starlet.Reproduction steps
Same error against latest available version of chzyer/readline, 1.5.1 at the this time
readline versions available
Error:
Reproduction steps
Why reporting to Starlet repo
Possible solutions on Starlet side
Have not analyzed the code of Starlet very deeply, but AFAICU one of the following fixes is possible:
CLI
, decoupling the core suitable for embedding from IO dependencies.What do you think?
BTW thank you all for your work on Starlet!
The text was updated successfully, but these errors were encountered: