This sounds like mixing the features from:
- http://docs.factorcode.org/content/article-embedding.html which
initializes everything, but then requires the compiler to use a string ->
factor eval -> string call.
- http://docs.factorcode.org/content/article-alien-callback.html which
allows to directly call into factor code with C function calls.
But looking at callbacks.hpp in vm/, it says that callbacks are
"
The callback heap is not saved in the image. Running GC in a new session
after
saving the image will deallocate any code heap entries that were only
reachable
from the callback heap in the previous session when the image was saved.
"
So I'm not sure if that means you need the compiler to recompile the
callbacks each time factor is started ?
Jon
On Mon, Feb 9, 2015 at 8:07 PM, John Benediktsson <mrj...@gmail.com> wrote:
> Should be possible as the FFI supports calls and callbacks, but I'm not
> aware of anyone who has tried. Love the idea, though!
>
> On Sat, Feb 7, 2015 at 6:22 AM, Marmaduke Woodman <mmwood...@gmail.com>
> wrote:
>
>> Hi
>>
>> I'm curious as to the feasability of exporting a C API for a library
>> written in Factor.
>>
>> From the FFI docs, I expect that it would be possible for a small stub
>> library in C to initialize the VM and populate a table of alien callbacks
>> which could be used from another language... in theory.
>>
>> Does anyone have any experience with this?
>>
>> Thanks
>> Marmaduke
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>
>
------------------------------------------------------------------------------
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