Hi Alexander,
I'm glad you're taking a look at Factor - the feedback is nice to get.
Factor and Forth share similar-looking syntax, but Factor has a different
set of internals and primitives that it builds with, for things like GC and
arbitrary-sized integers (a bit like a "high level memory managed Forth",
but maybe less like a "Forth"). It does have a good optimizing compiler
that is able to make fast code in many cases, but we have not spent a lot
of time on making the "minimal binary" smaller. Probably we should do that
sooner than later. You can see that in:
IN: scratchpad "hello-world" deploy
That gives you a "hello-world" binary of about 1 MB. The "factor" binary
itself is about 480k, I think. So in general I agree with you that we could
use some trim-the-fat pull requests.
Best,
John.
On Wed, Jan 28, 2015 at 7:20 AM, Alexander Iljin <ajs...@yandex.ru> wrote:
> Hi again!
>
> I've heard that Forth is implemented using a very small interpreter,
> which makes it a good language for the embedded domain.
>
> I've also read that Factor has a good optimizing compiler.
>
> These two propositions (if true) lead me to the following question for
> the community. Is there a way to create a very small executable (for
> Windows) for a very small script?
>
> I've tried the deploy-tool on the following example vocabulary:
>
> USING: accessors command-line io io.directories io.files.types
> kernel namespaces sequences ;
> IN: ls
>
> <PRIVATE
>
> : list-files-and-dirs ( path -- files dirs )
> directory-entries [ type>> +regular-file+ = ] partition ;
>
> PRIVATE>
>
> : ls ( path -- )
> list-files-and-dirs
> "DIRECTORIES:" write nl
> "------------" write nl
> [ name>> write nl ] each
> nl
> "FILES:" write nl
> "------" write nl
> [ name>> write nl ] each ;
>
> : ls-run ( -- ) command-line get first ls ;
>
> MAIN: ls-run
>
> The resulting simple ls.exe weighs a somewhat disappointing 1.31 Mb.
>
> Are there tools or techniques to thrim the excess bloat from the
> console-only executable? I was hoping for 5 - 50 Kb range of the result.
>
> Thank you!
>
> ---=====---
> Александр
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk