During migration from fibers to goblins in my project I have faced with problem:
Uncaught exception:
1. #<&undefined-variable module: #<<module> name: (ice-9 binary-ports) exports: #<hashtable size: 19> defs: #<hashtable size: 600> submodules: #<hashtable size: 0> state: open root: #<<module> name: () exports: #<hashtable size: 0> defs: #<hashtable size: 0> submodules: #<hashtable size: 10> state: detached root: #f>> name: eof-object>
2. #<&source file: "hoot/errors.scm" line: 95 column: 22>
Git Repo: Prismascape Composition / SkimScripter · GitLab
As I understand, Hoot does not support variables that exported, but not defined in module. I dont think that so obvious error is not fixed yet, so may be I dont understand something. Please help how I can fix this error.
I use most recent Hoot commit and guile-goblins from guix.
This error could be fixed on guile’s or hoot’s (ice-9 binary-ports)?
I haven’t seen this particular error before and I’m unsure what action to take based on the details given. What would help me is if you could share a minimal reproducer program that demonstrates the problem. Thanks!
1 Like
That’s not a complete program. I’m unsure what you are trying to do. We have successfully compiled several programs that uses Goblins at this point.
I am just noticed this error produced by -g1 flag 
A-ha! Things make more sense now. The -g
options are not super well supported right now and we haven’t tried to make live hackable Goblins programs with Hoot yet. We have additional work to do to make live hacking work in practice.
I have little question: should I always use call-with-vat
and pass vat as a parameter, or could I somehow wrap all my game inside vat like this:
(define a-vat (spawn-vat))
(call-with-vat a-vat
(lambda ()
(init (reverse script))))
Because now I get “No current syscaller” error.
I don’t know what would be appropriate for your game, but what I can say is that you need to ensure that anything that is using an actor operator ($
, <-
, spawn
, etc.) must be done from within the context of a vat i.e using call-with-vat
or the with-vat
syntax sugar.
Should this code return (42 . 42)
?
(define-record-type <foo>
(make-foo bar)
foo?
(bar foo-bar))
(match (list (make-foo 42) (make-foo 42))
((($ <foo> bar) ($ <foo> bar*)) (cons bar bar*)))
Currently I catch
Uncaught exception:
1. #<&assertion>
2. #<&message message: "value failed to match">
3. #<&irritants irritants: ((#<<foo> bar: 42> #<<foo> bar: 42>))>
4. #<&source file: "hoot/errors.scm" line: 95 column: 22>
This is even small example:
(use-modules
(goblins)
(hoot records)
(ice-9 match))
(define-record-type <foo>
(make-foo bar)
foo?
(bar foo-bar))
(match (make-foo 42)
(($ <foo> bar) bar))
Error reproduces only with goblins
This program works for me:
(use-modules (srfi srfi-9)
(ice-9 match))
(define-record-type <foo>
(make-foo bar)
foo?
(bar foo-bar))
(match (list (make-foo 42) (make-foo 42))
((($ <foo> bar) ($ <foo> bar*)) (cons bar bar*)))
Also, I haven’t had issues matching against records in Goblins programs and Goblins’ own code does this quite a bit.
Please try compile program with (goblins)
lib imported.
I am using goblins from latest guix commit, not from source. Are you too?
What kind of info I should provide to register a bug?
Yet another question: how to write tests for Hoot project?
Module (srfi srfi-64) unavailable.
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ make test.wasm
HOOT_LOAD_PATH=/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile-hoot/0.6.0/lib:/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile/3.0 guild compile-wasm -L /gnu/store/q4648183qkl43ky8yp3qqikv63j67dw7-guile-goblins-0.15.1/share/guile/site/3.0 -L modules -L . -o test.wasm test.scm
WARNING: (% %library-group108 srfi srfi-64): `let' imported from both (% %library-group108 srfi srfi-71) and (% %library-group108 guile)
WARNING: (% %library-group108 srfi srfi-64): `let*' imported from both (% %library-group108 srfi srfi-71) and (% %library-group108 guile)
ice-9/psyntax.scm:2663:4: In procedure syntax-violation:
Syntax error:
srfi/srfi-64.scm:1002:37: define-record-type: expected a record type as #:parent in subform &programming-error of (define-record-type &bad-end-name #:parent &programming-error #:extensible? #t (make-bad-end-name begin-name end-name) %exn? (begin-name t-4ea3473da1c326d-165) (end-name t-4ea3473da1c326d-166))
make: *** [Makefile:31: test.wasm] Error 1
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ cat test.scm
(use-modules
(srfi srfi-64))
I have just reviewed the (test utils) module and get the point, sorry.
Also that approach does not working as I expect:
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ make test.wasm
HOOT_LOAD_PATH=/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile-hoot/0.6.0/lib:/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile/3.0:/home/lil/Git/guile-hoot:/home/lil/Git/guile-hoot:/home/lil/Git/guile-hoot/module guild compile-wasm -L /gnu/store/q4648183qkl43ky8yp3qqikv63j67dw7-guile-goblins-0.15.1/share/guile/site/3.0 -L modules -L . -o test.wasm test.scm
ice-9/psyntax.scm:2663:4: In procedure syntax-violation:
Syntax error:
module/hoot/primitives.scm:441:17: define-module: library-group only supports modules with #:declarative? #t in form (define-module (hoot primitives) #:pure #:use-module (hoot frontend) #:use-module ((guile) #:select (canonicalize-path search-path define-syntax-rule syntax-case
...
(syntax-module-bindings . guile:syntax-module-bindings)) #:declarative? #f)
make: *** [Makefile:32: test.wasm] Error 1
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ cat test.scm
(use-modules (test utils))
(test-call "#t" (lambda (a b) (< a b)) 1/2 +inf.0)
(test-call "#f" (lambda (a b) (< a b)) 1/2 -inf.0)
(test-call "#f" (lambda (a b) (< a b)) +nan.0 1/2)
Guile’s SRFI-64 does not yet work with Hoot, unfortunately. Non-declarative modules do not work in general because they aren’t compatible with Hoot’s whole program compilation approach.