public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: OKUMURA Yuki <mjt@cltn.org>
To: kawa@sourceware.org
Subject: How do i debug --no-inline or --full-tailcalls options?
Date: Thu, 11 Feb 2016 08:51:00 -0000	[thread overview]
Message-ID: <CAG1-Us1p_d+WdW6JRXyXYjafrmUBO1+1+2xAW4FSQjmepzMjGQ@mail.gmail.com> (raw)

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..

             reply	other threads:[~2016-02-11  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11  8:51 OKUMURA Yuki [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG1-Us1p_d+WdW6JRXyXYjafrmUBO1+1+2xAW4FSQjmepzMjGQ@mail.gmail.com \
    --to=mjt@cltn.org \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).