Hacker News new | past | comments | ask | show | jobs | submit | ttsiodras's comments login

I have been using xterm's default dabbrev-expand to do the same via "Alt-/" ( https://github.com/ttsiodras/dotfiles/blob/master/.Xresource... ) - which works regardless of what shell you're in.

But I was curious for your approach... so I asked Claude to convert it to bash: https://claude.ai/public/artifacts/01a49347-1617-4afe-8476-0...

Works like a charm - pinned it to Ctrl-k, which was free in my setup. I guess I don't have to depend on XTerm for this any more :-)

Thanks!


As soon as I met Forth, I felt I had to hack my own (https://github.com/ttsiodras/MiniForth/) - and did so over a single week, two years ago. I targeted the Blue Pill and the original Arduino, but developed via cross-compilers so that I could test my code in the host.

I became so obsessed with the project that I was looking forward to tinkering with it after coming back from work every day; so it was hacked in 5 evenings and a weekend. It was that much fun, to build a Forth.

I highly recommend the process; I think the only other time I felt so enlightened was when I first met Lisp macros (https://www.thanassis.space/score4.html#lisp).


> I became so obsessed with the project that I was looking forward to tinkering with it after coming back from work every day; so it was hacked in 5 evenings and a weekend. It was that much fun, to build a Forth.

Yep. In my computer architecture class as a freshman, we were supposed to do a final project of our choosing for the LC-3 (a RISC instruction set with emulator). I had dabbled briefly in Forth (with the RedPower 2 Minecraft mod) and thought it'd be fun to implement one. It ate up essentially all of my free time that semester: There was one morning where I only realized I'd stayed up all night when the sun started to come up and I finally checked the clock.

I've never found a practical use for Forth in my "real" life, but building one from scratch was an experience almost best described in religious terms. It was a pure distillation of Fred Brooks's description of programming:

> The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.

> Yet the program construct, unlike the poet's words, is real in the sense that in moves and works, producing visible outputs seperate from the construct itself. It prints results, draws pictures, produces sounds, moves arms. The magic of myth and legend has come true in our time. One types the correct incantation on the keyboard, and a display screen comes to life, showing things that never were nor could be.


In terms of practical usage, FYI both bitcoin script and postscript (for printers) are Forth based, as are some aerospace chips.


It’s arguable how much, if any, Forth is in PostScript. It is, indeed, a stack based language, but that’s pretty much where the similarities end.

There’s more to what makes a Forth a Forth than a parameter stack.

More discussion at https://wiki.c2.com/?ForthPostscriptRelationship


Fully agree. About 40,000 eons ago I wrote a Forth compiler in ZX81 basic. It went from taking 19 seconds to print 1000 numbers on the screen to instantly. I also learned a great lesson: I looked at the machine code it generated (it had a pinhole optimizer because the output was PUSH HL, PUSH DE, POP DE, POP HL everywhere), and I thought it was perfection - impossible to improve. The day later I came back and made it much faster.


This is why I come to HN - brilliant ideas that I should have thought of before, but didn't!

I just changed my server, and uninstalled the - now truly useless - fail2ban. I use SSH keys of course, but without fail2ban my server's logs were constantly flooded with hacking attempts.

No longer - wireguard for the win. Thank you, chlorion!


signal-to-noise ratio: off the charts.

Many thanks, OP.


> dkozel and your kind, whoever you are, wherever you are, and whatever you are doing right now, you are legend.

Both of you are :-)

Heart=warmed. Happy holidays to both of you!


Thanks for sharing! The slides are here: http://vger.kernel.org/~acme/prez/linux-plumbers-2022/


I was not aware of gsocket - thank you, very useful!


> I wonder if using RLE encoding would not have been but vastly simpler and more compact...

No, mate - it wouldn't. Don't be confused by the "printf"-dump; the Python script processed it into pairs of (frequency,delay). That is, when you see...

    989 Hz @ 15209
    989 Hz @ 15213
    989 Hz @ 15218
    784 Hz @ 15222
    784 Hz @ 15226
...the data actually generated are:

    (989, 15222-15209), 
    (784,  ... -15222),
Simply put: RLE can't do anything on them. The repetition has already been "cleaned out".

I wouldn't have gone to Huffman compression if I had a simpler choice.


:-)

Well, if the bird in question used an LZ77 followed by Huffman, he could compress all that wood/chuck stuff down to almost nothing. So he could chuck a lot :-D


Spot on! I planned initially to control the volume with a potentiometer - but abandoned the plan when I got to the "sounds good enough" :-)


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: