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

File sizes #3

Open
lassik opened this issue Dec 30, 2020 · 3 comments
Open

File sizes #3

lassik opened this issue Dec 30, 2020 · 3 comments

Comments

@lassik
Copy link
Contributor

lassik commented Dec 30, 2020

(continuing from #2)

@jcubic wrote:

Also this thing is huge, min.js file have 22MB of data. in comparison BiwaScheme is about 250KB (version 0.7.1) and LIPS is about 150kB of js and about 100kB of Scheme code so the size is similar (not even close to 1MB). If this file include all the modules then maybe, modules can be separated and loaded on demand and load only minimal Scheme.

Maybe we should pick another Scheme implementations that is close to R7RS? I'm not saying LIPS, but something that can be compiled to JS and that have standard libraries written in scheme that can be loaded using AJAX when needed.

Maybe Gambit is great when run on users machine, but if something is more then 2MB it's of no use in browser.

Some people on #scheme IRC also say that Chibi-Scheme (compiled via Emscripten, also results in a big file) takes too long to load. Others don't mind it.

For cell phones and tablets and the like, something fast-loading would be great, though I'm not sure how easy it's to type code on those things. There's a Gambit phone app with some special input considerations IIRC.

Is WebAssembly widely supported now, and could we get smaller file sizes by compiling to it instead of JS?

@feeley
Copy link
Collaborator

feeley commented Dec 30, 2020

I don't think mobile users are an interesting target audience for try.scheme.org . The user experience will be suboptimal whatever is done because of the small screen size and the lack of a keyboard (and yes there's the "Gambit REPL" mobile app on iOS and Android for those that really want to try out Scheme on their phone or tablet).

I think most newcomers will be on a desktop-class computer, with a decent size screen, keyboard, mouse and 5-50 Mbps network link. A 1.6 MB file will take ~ 3 seconds to load on a slow network. I think users on a slow network already expect such delays when loading a page, and in any case the actual page can be shown on the screen before the REPL is active.

The "typical" user of try.scheme.org will probably be a developer at any level of experience. For this class of user a reasonably fast machine and network are to be expected. When I visit https://feeley.github.io/gambit-in-the-browser/ after clearing my browser caches it takes 1.5 seconds to load all the page (which is a total of 2.5 MB of data transfer), and my home network link is quite basic. There's no noticeable user experience issue.

I'm planning to build Gambit (C) with emscripten in the near future and will check WASM vs JS file sizes.

@lassik
Copy link
Contributor Author

lassik commented Dec 30, 2020

Those are good points. Also, as you said in the other thread, many popular websites' front pages are 2 MiB nowadays with all the images and JS.

@lassik
Copy link
Contributor Author

lassik commented Dec 30, 2020

Production deployments of web apps written in Scheme are another matter, but there we can take advantage of tree shaking and don't need to ship eval or a compiler, documentation and debugger, etc.

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