[Chicken-users] reducing the size of chicken runtime
Currently, a statically linked "hello world" executable is 1.7MB (stripped). Is it possible to strip out some unnecessary features (i.e. R5RS stuff, numeric tower, etc) so that the runtime is more suitable for an embedded (low memory) system? ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] reducing the size of chicken runtime
On Thu, Nov 19, 2015 at 03:52:23PM +, Victor J wrote: > Currently, a statically linked "hello world" executable is 1.7MB (stripped). > Is it possible to strip out some unnecessary features (i.e. R5RS stuff, > numeric tower, etc) so that the runtime is more suitable for an embedded (low > memory) system? Hi Victor, It can be done, but it's a little painful. There's some information on how to do that on the wiki: http://wiki.call-cc.org/generating%20the%20smallest%20possible,%20self-contained%20executable Note that there's no "numeric tower" in CHICKEN 4; there's only fixnums and flonums, and the core needs both. In CHICKEN 5, there's a numeric tower. Perhaps it is a nice goal for CHICKEN 5.1 or perhaps 6 to make it easier to build smaller self-contained binaries. Because CHICKEN 5 is more explicitly structured as separate modules, it should (theoretically) be easier to figure out internal dependencies and split it up. Unfortunately, making the components of CHICKEN more fine-grained also (currently) means we'll generate more toplevels, which results in a longer startup time. If binary size is really your main concern, you might want to take a look at Chibi Scheme: it is quite modular and has many compilation-time options for stripping it down to the bare minimum. Cheers, Peter signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] reducing the size of chicken runtime
Isn't there a significant barrier to determining what to strip due to eval, apply and read? -Dan Sent from my BlackBerry 10 smartphone. Original Message From: Peter Bex Sent: Thursday, November 19, 2015 8:31 AM To: Victor J Cc: chicken-users@nongnu.org Subject: Re: [Chicken-users] reducing the size of chicken runtime On Thu, Nov 19, 2015 at 03:52:23PM +, Victor J wrote: > Currently, a statically linked "hello world" executable is 1.7MB (stripped). > Is it possible to strip out some unnecessary features (i.e. R5RS stuff, > numeric tower, etc) so that the runtime is more suitable for an embedded (low > memory) system? Hi Victor, It can be done, but it's a little painful. There's some information on how to do that on the wiki: http://wiki.call-cc.org/generating%20the%20smallest%20possible,%20self-contained%20executable Note that there's no "numeric tower" in CHICKEN 4; there's only fixnums and flonums, and the core needs both. In CHICKEN 5, there's a numeric tower. Perhaps it is a nice goal for CHICKEN 5.1 or perhaps 6 to make it easier to build smaller self-contained binaries. Because CHICKEN 5 is more explicitly structured as separate modules, it should (theoretically) be easier to figure out internal dependencies and split it up. Unfortunately, making the components of CHICKEN more fine-grained also (currently) means we'll generate more toplevels, which results in a longer startup time. If binary size is really your main concern, you might want to take a look at Chibi Scheme: it is quite modular and has many compilation-time options for stripping it down to the bare minimum. Cheers, Peter ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] reducing the size of chicken runtime
On Thu, Nov 19, 2015 at 08:36:43AM -0800, Dan Leslie wrote: > Isn't there a significant barrier to determining what to strip due to eval, > apply and read? Only if you want to use those. Eval itself is in eval.scm, which can be left out using -explicit-use, as mentioned in the wiki page. Apply isn't a problem, it is very small and lives in runtime.c. Read is rather large, but it's extendable, so for example the #u8() syntax is only hooked in when you actually load srfi-4 (which is also self-contained). So there already is quite a bit of stuff you can leave out. But if you do that, you might not be able to use any eggs, unless you're very conservative about what you use. Cheers, Peter signature.asc Description: Digital signature ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users