6

I have cygwin under Windows 8 and I've installed and run raku which I understand to be just Perl6. I wanted to print some strings and numbers but say doesn't do the job (please see the black snippet below) it just do nothing unlike it is described here:

enter image description here

enter image description here

hynek0@hynek /cygdrive/c/Users/hynek0/Desktop/FU
$ raku --version
This is Rakudo version 2020.05.1 built on MoarVM version 2020.05
implementing Raku 6.d.

EDIT 2

enter image description here

EDIT 3 enter image description here

user2925716
  • 949
  • 1
  • 6
  • 13
  • 1
    This looks very strange. What does `raku --version` say? – Elizabeth Mattijsen May 28 '21 at 21:24
  • 2
    If you look closely at the text you're following it shows `> say "Hello, World"` and *not* `say "Hello, World"`. That initial `> ` corresponds to the REPL prompt, analogous to your system `$` prompt. It's not appearing. My guess is that the `raku` you've installed is just accepting lines of input, waiting for you to finish entering a bunch of lines. If so, pressing Control-D will presumably end the input and your code will run. If you'll confirm (or reject) my guess we can try to figure out what's going on, which is presumably something to do with `cygwin` or the `raku` that you've installed. – raiph May 28 '21 at 21:28
  • Do you need to install `Readline` or `Linenoise` to get the REPL working properly? – jubilatious1 May 29 '21 at 04:32
  • 1
    @jubilatious1 theoretically that should be only to have better editing capabilities on the REPL, it shouldn't be needed for making it work. – jjmerelo May 29 '21 at 08:00
  • 1
    On Windows 10, it works for me out of the box on Cygwin. I downloaded the binary distribution of Raku 2021.05, and did not have to install `Readline` or `Linenoise` modules.. – Håkon Hægland May 29 '21 at 09:27
  • @ElizabethMattijsen See my EDIT at the very bottom for Raku version. – user2925716 May 29 '21 at 12:30
  • 2
    @raiph Control-D doesn't work either :-( – user2925716 May 29 '21 at 12:31
  • @HåkonHægland I cannot install `Raku 2021.05` it provides `tar.gz` files only and **not** `.msi`. Could you please give me a link to `msi` type file of `Raku 2021.05` ? – user2925716 May 29 '21 at 12:32
  • @raiph How do I run `raku` to obtain `>` ? – user2925716 May 29 '21 at 12:33
  • @user2925716 *"it provides tar.gz files only and not .msi"* : I don't think you need .msi, just unpack the `.tar.gz` and move the resulting folder to e.g. `C:\rakudo`. It contains a precompiled binary at `bin\raku.exe`. So I just made sure that my `PATH` environment variable contains `C:\rakudo\bin` and if you are going to use `zef` also include `C:\rakudo\share\perl6\site\bin` in `PATH`. – Håkon Hægland May 29 '21 at 14:40
  • @HåkonHægland A very strange things happens. When I copy `raku.exe` to a new file it works. But after executing it stops working. I just need to copy it another time. When you would direct me at `raku 2021` msi things would be much easier! – user2925716 May 29 '21 at 15:40
  • @HåkonHægland I cannot google it up by myself. – user2925716 May 29 '21 at 15:50
  • @jjmerelo Thanks for the note! The only issue I see then is whether or not the terminal has entered the Raku REPL. I've actually seen a similar situation where running `raku script_name.p6` at a bash prompt drops the terminal into a similar `stdin` 'accept input linewise' mode (in the absence of any `prompt` commands). For other interpreters/REPLs I've always understood that an explicit `-` dash is required on the shell command line, but apparently not in Raku. Anyway I hope someone with expert-level `bash`-, `fish`-, `zsh`-, etc. experience may provide direction here. – jubilatious1 May 29 '21 at 16:23
  • 1
    @jubilatious1 Please see my **EDIT 2** `-` hasn't helped. Also please see [here](https://stackoverflow.com/questions/67753788/prompt-not-appearing-after-running-perl). – user2925716 May 29 '21 at 16:48
  • 1
    See https://github.com/rakudo/rakudo/issues/4378 - probably same issue. – Coke May 29 '21 at 16:49
  • 1
    What does `raku -e 'say $*IN.t'` say? – Elizabeth Mattijsen May 29 '21 at 17:09
  • 2
    Does a REPL start if you run `raku --repl-mode=interactive` ? – Elizabeth Mattijsen May 29 '21 at 17:11
  • 1
    @ElizabethMattijsen Irregularly, see my 3rd **EDIT**. – user2925716 May 29 '21 at 17:22
  • 1
    @ElizabethMattijsen It says `False`. – user2925716 May 29 '21 at 17:25
  • 1
    Then `$*IN.t` returning `False` is probably the underlying issue why the REPL isn't started. Raku thinks there's nobody behind the keyboard, so it assumes you're going to pipe the program to be executed. – Elizabeth Mattijsen May 29 '21 at 18:13
  • @user2925716 You've hit a bug, something to do with `raku` on your system, likely due to your version of `cygwin` or of Windows . (@HåkonHægland reports it's not just `raku`: "On Win10, it works for me out of the box on Cygwin.") Please click link in .@Coke's comment above / Liz's answer below and add comment there: "Looks like I have same problem -- running `raku` inside `cygwin` on Windows 8 hangs - REPL never appears", output of `raku --version` (i.e. same as in your answer, but as text), version info for your version of `cygwin` and of Windows 8, and your answer to `$*IN.t` question. Thx. – raiph May 29 '21 at 21:31

1 Answers1

6

This is probably the same bug as reported with https://github.com/rakudo/rakudo/issues/4378 . It looks like Raku thinks there's nobody behind the keyboard ($*IN.t returning False) and thus switches to slurping the program to execute from STDIN.

At this point, I can only see a workaround: execute you example code with raku -e.

Elizabeth Mattijsen
  • 25,654
  • 3
  • 75
  • 105
  • 1
    The issue to which you linked is about the "git bash" environment, which is MSYS (or MSYS2?) This is a unix-emulation environment very similar to Cygwin. It's not surprising the issue affects both. – ikegami May 29 '21 at 18:55
  • @ikegami Right, but why do I need to press `enter` twice do get the result of `1+1` or even `1` when executed with `raku --repl-mode=interactive` ? – user2925716 May 29 '21 at 19:53
  • Probably related. – ikegami May 29 '21 at 20:30