From: Rob Pike <robpike@gmail.com> Date: Sun, 22 Jan 2023 18:38:03 +1100 To: The Eunuchs Hysterical Society <tuhs@tuhs.org> Message-ID-Hash: QXYVSK4PQF4UNTPGHP5PK3P7EQV76VPD Subject: [TUHS] v8 shell Archived-At: <https://www.tuhs.org/mailman3/hyperkitty/list/tuhs@tuhs.org/message/QXYVSK4PQF4UNTPGHP5PK3P7EQV76VPD/> Found this tweetstream, here folded together, when looking for something else (now lost) in my twitter archive: ========== Things I miss from the v8 shell. 1) All shell output was valid shell input. 2) Typing dir/cmd would find the command $PATH/dir/cmd. Subdirectories of your bin, in other words. 3) Functions were exportable. For one brief shining POSIX meeting, that was true in POSIX too but then... 4) The implementation was lovely and easy to understand. (No, it wasn't shalgol. Bourne fixed that for us.) 5) That I could learn things from it, like how to write a recursive descent parser.* 6) It ran in cooked mode. As expected, all that work making it a great shell is lost to history. https://t.co/IzApAUSmzN is silent. Well, the code is released now. ========== -rob * elegantly.
Tue Jan 24 22:43:15 EST 2023
From: Rob Pike <robpike@gmail.com> Date: Mon, 23 Jan 2023 12:32:10 +1100 To: Bakul Shah <bakul@iitbombay.org> Message-ID-Hash: RIRTCTTV7YMXWX7NK7V5PKZE6ER77XY6 CC: The Eunuchs Hysterical Society <tuhs@tuhs.org> Subject: [TUHS] Re: interesting case of not getting the point: dc on a mac Archived-At: <https://www.tuhs.org/mailman3/hyperkitty/list/tuhs@tuhs.org/message/RIRTCTTV7YMXWX7NK7V5PKZE6ER77XY6/> Pretty much everything in the dc man page on my mac raises my hackles. Not limited to changing behavior when you're on a TTY. (Also: NO ONE HAS BEEN ON A TTY FOR DECADES!) I am such an old grump. -rob On Mon, Jan 23, 2023 at 11:41 AM Bakul Shah <bakul@iitbombay.org> wrote: > Probably because MacOS moved things around or is intent on breaking things? > I didn't investigate. It compiles fine on FreeBSD. > > On Jan 22, 2023, at 4:20 PM, ron minnich <rminnich@gmail.com> wrote: > > How do you write a dc that doesn't compile? > > The mind reels. > > On Sun, Jan 22, 2023, 7:16 PM Bakul Shah <bakul@iitbombay.org> wrote: > >> dc -V on MacOS shows 4.0.2. Repo link in the output of dc -V. >> The current version is 6.2.2 but it doesn't compile on Ventura. >> >> > On Jan 22, 2023, at 3:39 PM, ron minnich <rminnich@gmail.com> wrote: >> > >> > dc >> > >>> >> > >> > it prompts with '>>> ' >> > >> > wonder where that came from? First time I've seen it. >> > >> > Seems to have a certain lack of understanding attached to it. >> >> >
Tue Jan 24 22:14:55 EST 2023
term% acid /bin/games/hexen /bin/games/hexen:amd64 plan 9 executable /sys/lib/acid/port /sys/lib/acid/amd64 acid: win() 7808: system call _main SUBQ $0x90,SP acid: cont() 7808: page fault DrawMainBar+0x377 MOVB $0x0,0x5f(DI) Notes pending: sys: trap: fault write addr=0x24f859f acid: lstk() DrawMainBar()+0x377 /usr/mstoney/src/hexen/sb_bar.c:1435 manaPatch1=0xe7ce48 manaPatch2=0xe7cfc8 manaVialPatch1=0xe7cc98 temp=0x0 manaVialPatch2=0xe7cd70 SB_Drawer()+0x142 /usr/mstoney/src/hexen/sb_bar.c:1036 DrawAndBlit()+0x160 /usr/mstoney/src/hexen/h2_main.c:695 H2_GameLoop()+0xf2 /usr/mstoney/src/hexen/h2_main.c:576 filename=0x2 H2_Main()+0x2ef /usr/mstoney/src/hexen/h2_main.c:332 wadloc=0x44f9f0 i=0x0 main(argv=0x7fffffffef90)+0x27 /usr/mstoney/src/hexen/i_main.c:13 _main+0x40 /sys/src/libc/amd64/main9.s:15 acid: regs() AX 0x0000000000000000 BX 0x00000000024eb700 CX 0x00000000000000a5 DX 0x0000000000000000 DI 0x00000000024f8540 SI 0x00000000000000bb BP 0x0000000000000000 R8 0x0000000000450250 R9 0x00000000004ab403 R10 0x0000000000e7cc98 R11 0x0000000000000063 R12 0x0000000000000005 R13 0x0000000000000000 R14 0x0000000000000000 R15 0x0000000000000000 DS 0x0000 ES 0x0000 FS 0x0000 GS 0x0000 TYPE 0x000000000000000e ERROR 0x0000000000000006 PC 0x0000000000243238 CS 0x000000000000002b FLAGS 0x0000000000010292 SP 0x00007fffffffecd0 SS 0x0000000000000023 acid:
Tue Jan 24 22:05:31 EST 2023
term% acid /bin/games/hexen /bin/games/hexen:amd64 plan 9 executable /sys/lib/acid/port /sys/lib/acid/amd64 acid: win() 7599: system call _main SUBQ $0x90,SP acid: cont() 7599: page fault DrawMainBar+0x377 MOVB $0x0,0x5f(DI) Notes pending: sys: trap: fault write addr=0x24f859f acid: lstk() DrawMainBar()+0x377 /usr/mstoney/src/hexen/sb_bar.c:1435 manaPatch1=0xe7ce48 manaPatch2=0xe7cfc8 manaVialPatch1=0xe7cc98 temp=0x0 manaVialPatch2=0xe7cd70 SB_Drawer()+0x142 /usr/mstoney/src/hexen/sb_bar.c:1036 DrawAndBlit()+0x160 /usr/mstoney/src/hexen/h2_main.c:695 H2_GameLoop()+0xf2 /usr/mstoney/src/hexen/h2_main.c:576 filename=0x2 H2_Main()+0x2ef /usr/mstoney/src/hexen/h2_main.c:332 wadloc=0x44f9f0 i=0x0 main(argv=0x7fffffffef90)+0x27 /usr/mstoney/src/hexen/i_main.c:13 _main+0x40 /sys/src/libc/amd64/main9.s:15 acid: regs() AX 0x0000000000000000 BX 0x00000000024eb700 CX 0x00000000000000a5 DX 0x0000000000000000 DI 0x00000000024f8540 SI 0x00000000000000bb BP 0x0000000000000000 R8 0x0000000000450250 R9 0x00000000004ab403 R10 0x0000000000e7cc98 R11 0x0000000000000063 R12 0x0000000000000005 R13 0x0000000000000000 R14 0x0000000000000000 R15 0x0000000000000000 DS 0x0000 ES 0x0000 FS 0x0000 GS 0x0000 TYPE 0x000000000000000e ERROR 0x0000000000000006 PC 0x0000000000243238 CS 0x000000000000002b FLAGS 0x0000000000010292 SP 0x00007fffffffecd0 SS 0x0000000000000023 acid:
Tue Jan 24 21:26:15 EST 2023
diff 6468f848bc16cae5a74ec15337298e33a2ff1aae uncommitted --- a/sys/src/cmd/aux/kbdfs/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs/kbdfs.c @@ -527,8 +527,8 @@ break; } } - /* button unknown to kbtab, use rune if no modifier keys are active */ - if(k.b == 0 && !a->shift && !a->altgr && !a->ctl) + /* button unknown to kbtab, use rune */ + if(k.b == 0) k.b = k.r; if(k.r == Kshift) a->shift = k.down;
Tue Jan 24 20:46:04 EST 2023
; nl=' ' ; cat /dev/kbd | tr '\0' $nl K k c K k c K k c K k c K k c K k c K k c K k c K kb cb K ka ca K k c K ; webpaste /dev/text
Tue Jan 24 20:43:57 EST 2023
; nl='\n' ; cat /dev/kbd | tr '\0' $nl KnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKn ; cat /dev/kbd | tr '\0' $nl KnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkncnKnkbncbnKnkancanKnkbncbnKnkancanKnkncnKn; webpaste /dev/text
Tue Jan 24 13:47:25 EST 2023
; grep Bar /bin/riostart window Bar ; cat /bin/Bar #!/bin/rc rfork ne fn bar { sed -u 's/$/ │ ⏮ │ ⏯ │ ⏭/g' \ | /bin/bar \ | awk -v 'c=plumb -d audio ''key ' ' /⏮/{system(c"<''")} /⏯/{system(c"p''")} /⏭/{system(c">''")} ' >[2]/dev/null } </dev/kbdtap reform/shortcuts | riow >/dev/kbdtap |[3] bar ; webpaste /dev/text
Tue Jan 24 00:44:13 EST 2023
FAILED: out/pkg/mpv/file2string.c.o cc -MD -MF out/pkg/mpv/file2string.c.o.d -O2 -pipe -c -o out/pkg/mpv/file2string.c.o pkg/mpv/file2string.c /bin/sh: 1: cc: not found
Mon Jan 23 22:55:29 EST 2023
#define DEFFUNCS \ DEFFUN(1)\ DEFFUN(2)\ DEFFUN(3)\ DEFFUN(4)\ DEFFUN(5)\ DEFFUN(6)\ DEFFUN(7)\ DEFFUN(8)\ DEFFUN(9)\ DEFFUN(10)\ DEFFUN(11)\ DEFFUN(12)\ DEFFUN(13)\ DEFFUN(14)\ DEFFUN(15)\ DEFFUN(16)\ DEFFUN(17)\ DEFFUN(18)\ DEFFUN(19)\ DEFFUN(20)\ DEFFUN(21)\ DEFFUN(22)\ DEFFUN(23)\ DEFFUN(24)\ DEFFUN(25)\ DEFFUN(26)\ DEFFUN(27)\ DEFFUN(28)\ DEFFUN(29)\ DEFFUN(30)\ DEFFUN(31)\ DEFFUN(32) #define DEFFUN(N) \ static __ int32_t mulscale##N(int32_t input1, int32_t input2) \ { return mulscale(input1,input2,N); } DEFFUNCS #undef DEFFUN #define DEFFUN(N) \ static __ int32_t dmulscale##N(int32_t input1, int32_t input2,int32_t input3,int32_t input4) \ { return dmulscale(input1,input2,input3,input4,N); } DEFFUNCS #undef DEFFUN #define DEFFUN(N) \ static __ int32_t tmulscale##N(int32_t i1, int32_t i2,int32_t i3,int32_t i4,int32_t i5,int32_t i6) \ { return tmulscale(i1,i2,i3,i4,i5,i6,N); } DEFFUNCS #undef DEFFUN #define DEFFUN(N) \ static __ int32_t divscale##N(int32_t input1, int32_t input2) \ { return divscale(input1,input2,N); } DEFFUNCS #undef DEFFUN
Mon Jan 23 20:35:18 EST 2023
# elif defined(__GNUC__) && __GNUC__>=2 # if defined(__x86_64) || defined(__x86_64__) # if defined(L_ENDIAN) # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) # elif defined(B_ENDIAN) /* * Most will argue that x86_64 is always little-endian. Well, yes, but * then we have stratus.com who has modified gcc to "emulate" * big-endian on x86. Is there evidence that they [or somebody else] * won't do same for x86_64? Naturally no. And this line is waiting * ready for that brave soul:-) */ # define ROTATE(a,n) ({ u64 ret; asm ("rorq %1,%0" \ : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) # endif