public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* How do i debug --no-inline or --full-tailcalls options?
@ 2016-02-11  8:51 OKUMURA Yuki
  2016-02-11 14:02 ` Per Bothner
  2016-02-12  1:26 ` Per Bothner
  0 siblings, 2 replies; 7+ messages in thread
From: OKUMURA Yuki @ 2016-02-11  8:51 UTC (permalink / raw)
  To: kawa

Hi list,

I'm currently porting my own R7RS library into Kawa 2.1 but I'm
struggling to understand Kawa's compiler behaviour.

Some portions of my library require --no-inline or --full-tailcalls
options to compile correctly but
I think these should not be required on my code, at least reading on
the reference manual.

EXAMPLE1: --full-tailcalls
(https://github.com/okuoku/yuni/issues/33)

Following program requires --full-tailcalls to run with "java
kawa.repl -r7rs prog.sps".
Otherwise, Kawa gives java.lang.VerifyError.

(import (scheme base))

(define (ssplit-parse-byte0-ORIG byte)
  (case byte
    ((NONE) (values 'NONE #f))
    (else (values 'OTHERS #f))))

Why do we need --full-tailcalls here?
Removing CASE should compile fine so I guess there's something
different around (scheme base)
exported VALUES procedure here..


EXAMPLE2: --no-inline
(https://github.com/okuoku/yuni/issues/35)

Following program behaves differently with/without --no-inline option:

(import (scheme base)
        (scheme write)
        (scheme eval))

(let ((c (eval 'cons2 (environment '(rename (scheme base) (cons cons2))))))
 (write c)(newline))

With --no-inline option, EVAL will fail to bind renamed identifier so
it will fail to execute:

$ java kawa.repl --no-inline -r7rs check.sps
unbound location: cons2

Oddly, it is fine without --no-inline option:

$ java kawa.repl -r7rs check.sps
#<procedure cons>

AFAIK, other R7RSs Gauche, Chibi-scheme, Sagittarius and Chicken behaves same as
the latter(without --no-inline) case.
I expect Kawa also behaves same; why --no-inline changes program behaviour here?
The reference manual suggests mutating procedures would affect inliner
behaviour but I believe
RENAME in R7RS should not the case.

Sorry for vague/newbie questions but I'm totally getting lost..

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-12 21:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11  8:51 How do i debug --no-inline or --full-tailcalls options? OKUMURA Yuki
2016-02-11 14:02 ` Per Bothner
2016-02-11 18:26   ` OKUMURA Yuki
2016-02-12 21:53     ` Per Bothner
2016-02-12  1:26 ` Per Bothner
2016-02-12  7:25   ` Per Bothner
2016-02-12 17:33     ` OKUMURA Yuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).