Closed doppioandante closed 1 year ago
Thanks for the report! I think you may be running into a bug recently fixed in response to #4. Are you working from a Git repo checkout or source from somewhere else (such as the Racket source distribution)?
Hello, sorry for the scarce info; I'm using master from this very repository. I updated to your latest fixes, and I figured out why we may be seeing different things:
✦ ❯ gcc -DZUO_EMBEDDED zuo.c example.c -o example
zuo on main
✦ ❯ ./example
The answer was 5
zuo on main
✦ ❯ gcc -DZUO_EMBEDDED image_zuo.c example.c -o example
zuo on main took 3s
✦ ❯ ./example
undefined: 'random-five
in read-and-eval {2}
Is the generated image_zuo.c supposed to behave like this? Thanks for your time
That difference is not expected. Has image_zuo.c
been rebuilt (with make
or even zuo
) after pulling changes? Is the diff of zuo.c
and zuo_image.c
any more than changing EMBEDDED_IMAGE
to 1
and defining emedded_boot_image_len
and emedded_boot_image
?
Yes, image_zuo.c
has been regenerated and the diff also shows the hefty embedded_boot_image
array being populated.
Oh, I see it now. I still have been running the wrong example.
The problem is that the zuo_image.c
version has a zuo/kernel
that was created without the added primitive. I'll have to think about this issue more.
I've addressed this problem mostly by adjusting the example and explanation. To better support new primitives, though, I also added support for an --image
flag to local/image.zuo
, which makes it easier to embed an image that's compatible with new primitives.
Hello, the embedding example, namely:
Currently gives this error when run: