[program-l] Re: JavaScript REPL ... or ...

  • From: Florian Beijers <florianbeijers@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Sat, 15 Jan 2022 00:03:13 +0100

That is interesting, yes. I can reproduce. And going up through the
history with up_down reads the contents of the variable when landing
on the line with its name, which ...works, but is somewhat
non-standard. This only seems to happen when echoing a variable like
that though, any  other output seems to work fine.

2022-01-14 23:33 GMT+01:00, joeldodson@xxxxxxxxx <joeldodson@xxxxxxxxx>:

Yeah, console.log('hello world'); works the same for me in node v16 (same
for me meaning I get the same result you do).

The issue is when I try ('>' is the repl prompt):

let hw = 'hello world';
hw

I don't hear anything from NVDA after hitting enter after typing the hw.

And now the plot thickens,

I just tried Narrator and JAWS.  In each of them, I DO hear 'hello world'
after typing hw and hitting enter.

Perhaps this is an NVDA issue?  Maybe this is the forcing function I need to
learn some NVDA debugging.  Or maybe I'll stick with deno and go back to my
day job, while I still have one 😊


Thanks,
Joel


-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx> On
Behalf Of Florian Beijers
Sent: Friday, January 14, 2022 1:52 PM
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: JavaScript REPL ... or ...

I'm not really sure what to tell you here :) if I do console.log("Hello
world!"), NVDA neatly tells me "Hello world, undefined"and takes me back to
the prompt in CMD at least.

2022-01-14 22:28 GMT+01:00, joeldodson@xxxxxxxxx <joeldodson@xxxxxxxxx>:
Hmm, lovely, auto complete.



I used to sort of like auto complete when I could see.  I suppose I
might like it now if I were more patient. I have it totally disabled in
vscode.
But weren’t here to debate auto complete 😊 (I appreciate you pointing
it out though Florian.)



I thought maybe I could disable auto complete and that might change
how output is generated.  Looks like I’m not the first person to want
to disable this feature: https://github.com/nodejs/help/issues/3286



In that post, it points out auto complete was introduced in node v12.
Finally, a good reason to try nvm (https://github.com/nvm-sh/nvm).



I get node v10 running in my bash shell and try the repl.  Sure
enough, no auto complete, and, yes!, I actually hear the output from
the code I just typed when I hit enter.



How about the node repl v12?  Sure enough, where auto complete is
introduced, I no longer automatically hear output of the js when I hit
enter.



So, what changed.



In the post there’s mention of a way to disable auto complete in the
repl settings.  That lead me to https://nodejs.org/api/repl.html to
try and understand how to configure the repl.



I’m still digging around in there to find some way to affect stdout.



Thanks again Florian for helping dig in to this issue.  I’ll post more
if/when I figure out how to have the output in the repl created in a
way that NVDA will read it to me automatically.



Thanks,

Joel







From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx>
On Behalf Of Florian Beijers
Sent: Friday, January 14, 2022 9:33 AM
To: program-l <program-l@xxxxxxxxxxxxx>
Subject: [program-l] Re: JavaScript REPL ... or ...



Ahh,



I see what it's doing. So, as you're typing, it's offering you
autocomplete suggestions. If you type "l" for example, it will make it
'let"in the way that your cursor is still at the letter l, but "et"
has been inserted to the right of your cursor.If you hit tab at this
point, the suggestion is committed, and your cursor gets placed
immediately to the right of the final character.

If you don't hit tab but keep tying, the autocomplete gets removed
again, essentially you're overtyping it at that point. Does that make
sense?



Florian



Op vr 14 jan. 2022 om 05:37 schreef <joeldodson@xxxxxxxxx
<mailto:joeldodson@xxxxxxxxx> >:

Thanks Florian,



I’m using node v16.13.1 on both Windows and Ubuntu.



I’m on Windows 10, Version 21H2 (OS Build 19044.1466) (just updated
today).



I have Ubuntu 20.04 installed from the Windows store and yesterday ran
sudo apt update && sudo apt upgrade.



FWIW, the Python REPL (Python 3.10.1 installed from python.org
<http://python.org> ) works beautifully (as in like deno, not node).



I’ll poke around more as well.  Appreciate your help.



Thanks,

Joel





From: program-l-bounce@xxxxxxxxxxxxx
<mailto:program-l-bounce@xxxxxxxxxxxxx>
 <program-l-bounce@xxxxxxxxxxxxx
<mailto:program-l-bounce@xxxxxxxxxxxxx> > On Behalf Of Florian Beijers
Sent: Thursday, January 13, 2022 3:57 PM
To: program-l <program-l@xxxxxxxxxxxxx
<mailto:program-l@xxxxxxxxxxxxx> >
Subject: [program-l] Re: JavaScript REPL ... or ...



Hi,



I will experiment with this some and get back to you. What you are
describing does sound suboptimal and it certainly did not do this when
I last tried it, but this is node we're talking about, things change
rapidly.
Could you do me a favor and tell me what node version you're using,
just so I can closely replicate what you were trying to do?


Thanks,

Florian



Op vr 14 jan. 2022 om 00:51 schreef <joeldodson@xxxxxxxxx
<mailto:joeldodson@xxxxxxxxx> >:

Hi Florian,

Glad you asked.  After I sent this mail, I listened to a 2022
predictions podcast from Syntax and they're predicting a tepid future
for deno.  Who knows.

Running 'node' from either the bash shell on Ubuntu or PowerShell on
Windows does put me into a REPL.  The problem is after I type some JS
and hit enter, I hear nothing.  I use number pad seven to scroll up a
line and can hear the output.

I just tried more experimenting and heard some weird stuff.  When I
type the
following:

Let h = 'hello';
Let w = 'world';
h + w

As I type the last line, h + w, if I pause after typing the 'h', NVDA
says 'hello' ( including the ticks).  If I pause after typing the 'w',
NVDA says, 'hello world' (again with the ticks).  The same thing
happens in a wsl2/ubuntu/bash shell.

In the deno repl, I don't hear anything other than character echo as I
type the h + w.  After I hit enter, I hear the 'hello world'.
This does seem to be node vs deno as they behave differently in the
same shells.

For node, it seems the repl is evaluating the statement as I type it.
That is kind of cool.  If I have to choose between that and having the
output read to me after I hit enter, I prefer the deno approach (wait
until I hit enter and tell me the result).

I'd love to hear ideas, especially if they include ways to change the
behavior, of why the result is not read from the node repl even though
it is there.

I do have report dynamic content changes on, fwiw.  I've seen that be
the reason nothing is read.

Thanks,
Joel


-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
<mailto:program-l-bounce@xxxxxxxxxxxxx>
 <program-l-bounce@xxxxxxxxxxxxx
<mailto:program-l-bounce@xxxxxxxxxxxxx> > On Behalf Of Florian Beijers
Sent: Thursday, January 13, 2022 3:04 PM
To: program-l@xxxxxxxxxxxxx <mailto:program-l@xxxxxxxxxxxxx>
Subject: [program-l] Re: JavaScript REPL ... or ...

At the risk of causing fiery armageddon to rain from the sky ...what's
the matter with NVDA and node? I've not done this in a while but when
I messed with it several years ago it seemed to work fine from the
commandline?

Thanks,
Florian

2022-01-13 22:59 GMT+01:00, joeldodson@xxxxxxxxx
<mailto:joeldodson@xxxxxxxxx>  <joeldodson@xxxxxxxxx
<mailto:joeldodson@xxxxxxxxx> >:
How I stopped worrying and learned to love JavaScript (shoutout for
fans of cult classic 1960's movies).

I'm working on learning React which means I need to brush up on
JavaScript.


As I hope many people here realize, a REPL like Python or Ruby comes
with, is a great way to experiment and solidify one's understandings
of nuances of different constructs.  I also like to use the Python
REPL, import requests, and poke at third party REST APIs.  It's like
a more interactive curl.

<editing out rant about looking for a JavaScript REPL and how badly
node works on the command line with NVDA>

About at the end of my rope, I recalled hearing about deno
(https://deno.land).  The scales have fallen from my eyes.

<editing out effusive praise for deno>

Indeed, deno has what seems so far to be a great JS REPL,
https://deno.land/manual@main/tools/repl.  It works great with NVDA
running from a bash shell on Ubuntu 20.04 running on WSL2 on Windows 10.


In general, though I've only poked around for a day or so, deno seems
like a great project.  The manual is very accessible and easy to
navigate with Firefox and NVDA.

Cheers,
Joel


** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>  with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>

** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>
with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>

** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx
<mailto:program-l-request@xxxxxxxxxxxxx>
with the Subject:- faq


** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: