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 #8

Open
gedw99 opened this issue May 20, 2021 · 6 comments
Open

Tinygo #8

gedw99 opened this issue May 20, 2021 · 6 comments

Comments

@gedw99
Copy link

gedw99 commented May 20, 2021

I was playing with the code

the way gs and indexdb is used is really impressive and highly useful

I am thinking that tinygo might be mature enough to deal with this code now .

the main thing was to avoid reflection ( like the standard golang json encoder ). The solution was generally to use flatbuffers.
Flatbuffers is nature now and very useable .

Anyways your project is really awesome . Just wanted to add my thoughts about strategies for using tinygo :)

if you need examples of what I am referring to above just yell

@gedw99
Copy link
Author

gedw99 commented Jun 3, 2021

What about a separate branch so others can help port code to tinygo ?

@JohnStarich
Copy link
Collaborator

Hey again @gedw99! 🙂 That would be interesting.

I think I'd first need to understand the differences between Go's and TinyGo's Wasm syscalls setup. Go Wasm may be able to accommodate another runtime if they're compatible. I see some mentions of Wasm in the tinygo repo, but I didn't find the "js implementation of syscalls" right away. Are you familiar with tinygo's runtime?

@gedw99
Copy link
Author

gedw99 commented Jun 9, 2021

Yes I am using tinygo and there are tons of examples of other gophers using it.

syscalls example:
https://github.com/jerson/openpgp-mobile/blob/flatbuffers/Makefile.wasm

This uses flatbuffers for serialisation.


Tinygo standard lib is a good doc !

https://tinygo.org/docs/reference/lang-support/

https://tinygo.org/docs/reference/lang-support/stdlib/

Reflection and net ( http ) are not yet supported. But PR’s are merging in every few days for it. They generally copy the official golang code in and then just clean it up so it works with tinygo.

For the reflection problem just use the golang json lib that genji and others use.
https://github.com/genjidb/genji/blob/main/go.mod#L6

TO compile using tinygo:
https://github.com/genjidb/genji.js
https://github.com/genjidb/genji.js/blob/master/scripts/buildgo.sh#L27


There are many many projects using tinygo for WASI also but more for servers of course

if you want more examples or whatever just yell :)

@gedw99
Copy link
Author

gedw99 commented Jun 9, 2021

@JohnStarich
Copy link
Collaborator

Hey @gedw99, FYI Go Wasm is now Hackpad!

I may be splitting things into new even more repos in the coming weeks, possibly including the runtime and the Go installation system. We may take another look at tinygo with all these changes 🙂

@gedw99
Copy link
Author

gedw99 commented Aug 6, 2021

thanks @JohnStarich for letting me know.

I will kick the tires....

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

2 participants