in reply to Problems compiling Parrot

My guess is that the line above it:

use lib "$FindBin::Bin/lib";

might not be working properly on your system, for some reason (FindBin is rumored to be unstable). Try a 1-liner of:

perl -MFindBin -le 'print $FindBin::Bin'

while in the directory that you have parrot installed, and see if it is displaying the correct directory. You may have an extra trailing '/'.

In the meantime, cd over to the languages/imcc subdirectory and make imcc. You can use it to assemble (and run!) parrot programs with the -a switch, i.e.:

imcc -a source.pasm

Update:
As a side note, your assembly snippet is a bit whacked. There isn't a 4 arg conditional branch anymore, and you are comparision is a bit off. Try this:

REDO: time I1 print I1 print "\n" SPIN: time I1 ne I1, I2, REDO branch SPIN

Hope that doesn't take the fun outta it! (-:

Replies are listed 'Best First'.
Re^2: Problems compiling Parrot (perverser)
by tye (Sage) on Mar 26, 2003 at 16:38 UTC
    perl -MFindBin -le 'print $FindBin::Bin'

    You do realize that this tells FindBin to look for the location of the script in your file system but that this script isn't in the file system at all, it is just on the command line. So FindBin simply notes that the script name was '-e' which probably means there is no script so it simply returns getcwd()?

    So it isn't really testing FindBin much at all. Almost none of the code used in the original situation is used in your test case (then again, almost none of the code used in the original situation is of any value in finding the location of a Perl script, but that is another story).

                    - tye
      Um, well, hmmm... seems I blew that one. Regardless though; IMCC is still the better choice. (-:
Re: Re: Problems compiling Parrot
by jens (Pilgrim) on Mar 26, 2003 at 03:09 UTC
    jryan -- when I do a
    perl -MFindBin -le 'print $FindBin::Bin'
    in the parrot directory gives me this output, which seems to me to be correct:
    bash-2.05b$ perl -MFindBin -le 'print $FindBin::Bin' /usr/local/bin/parrot/parrot
    I've made imcc without error. What is the relation
    between imcc and the parrot interpreter?
    Any more ideas on what may not be working correctly?

    --
    Microsoft delendum est.

      Yep, FindBin doesn't seem to be the problem. Don't know what to say there. You can still use IMCC though.

      Neither the assembler nor IMCC have anything to do with the parrot interpretter (which is actually a virtual machine). However, both the assembler and IMCC have the ability to assemble parrot assembly into parrot bytecode. Traditionally, this has been the job of the assembler, but IMCC, the optimizer, has gotten advanced enough so that it can also assemble, and is actually better at it. Give it a try! It shouldn't break like the assembler did; it is written in pure C.

        OK, so I'm in directory
        /usr/local/bin/parrot/parrot/languages/imcc
        and so is my source code time.pasm (updated with your newer syntax). So then:
        bash-2.05b$ imcc -a time.pasm bash: imcc: command not found
        Now I have successfully made imcc, so this is very confusing. ;)

        --
        Microsoft delendum est.