Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tinygo is just one package away #679

Open
mar1n3r0 opened this issue Jan 9, 2022 · 7 comments
Open

Tinygo is just one package away #679

mar1n3r0 opened this issue Jan 9, 2022 · 7 comments

Comments

@mar1n3r0
Copy link

mar1n3r0 commented Jan 9, 2022

Good news, I know that a lot of people are waiting for this.

The net/http and encoding/json packages are now implemented in tinygo.

The only package left for it to compile successfully is text/template:
https://tinygo.org/docs/reference/lang-support/stdlib/#texttemplate
tinygo-org/tinygo#752

text/template relies heavily on reflect which is one of tinygo's weak points. You might be better off looking for a code-generation template library if possible.
?

@maxence-charriere Could this be an easy to bypass stumble block?

Maybe this:
https://github.com/valyala/fasttemplate

Let's keep that issue open and track progress here.

@oderwat
Copy link
Sponsor Contributor

oderwat commented Jan 9, 2022

Very good indeed! I made a quick replacement for the usage of text/template (see: #680)

Compilation now fails with a missing function in os. I did not follow up changing more code yet.

>$ tinygo build -o tiny.wasm -target wasm cmd/app/main.go
# github.com/maxence-charriere/go-app/v9/pkg/app
../go-app/pkg/app/http.go:334:16: Setenv not declared by package os

@dkegel-fastly
Copy link

dkegel-fastly commented Jan 22, 2022

The dev branch of tinygo has supported os.Setenv for about a month now.

Try building the dev branch from source... or wait a week or so for the 0.22 release.

@oderwat
Copy link
Sponsor Contributor

oderwat commented Jan 22, 2022

@dkegel-fastly os.Setenv is just a minor problem. The missing timers is much more serious, see #682

The title of this issue is misleading, as it will be always "one package" away till all of them are supported :-)

@dkegel-fastly
Copy link

Thanks. That's tinygo-org/tinygo#1037

@justinfx
Copy link

Tiny-go says they just released the support for timers.

@mar1n3r0
Copy link
Author

mar1n3r0 commented Oct 9, 2022

Depends on WASI support in Go. See: tinygo-org/tinygo#2910

@gedw99
Copy link

gedw99 commented May 3, 2024

Hey all

I gave github.com/maxence-charriere/go-app/v10 a try today and the only bug is

# github.com/maxence-charriere/go-app/v10/pkg/app
../../../../../../../../../../../pkg/mod/github.com/maxence-charriere/go-app/v10@v10.0.0-20240312064243-fd8d583dcdfa/pkg/app/node.go:784:13: v.Equal undefined (type reflect.Value has no field or method Equal)
../../../../../../../../../../../pkg/mod/github.com/maxence-charriere/go-app/v10@v10.0.0-20240312064243-fd8d583dcdfa/pkg/app/node.go:789:14: v.Equal undefined (type reflect.Value has no field or method Equal)

from https://github.com/mlctrez/mlctrez.github.io/issues/1 where the test code is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants