3 ms·
I'm really not a fan of UNIX in the slightest, other than as a basic kernel OS to build something nicer on, like what macOS did. I think it's much better to mak
by bowsamic 3y ago
I'm really not a fan of UNIX in the slightest, other than as a basic kernel OS to build something nicer on, like what macOS did. I think it's much better to make it easier to write programs and have a rich system library than to glue together text streams. And in fact that's basically what has happened instead: the "UNIX philosophy" has largely been replaced by Python and the like. People now reach for Python for many tasks that were previously shell one-liners, and imo that's a positive development.
When I was a kid learning how to code reading online, everyone was religiously defending the "UNIX philosophy" showing off their fancy and indecipherable one-liners (that don't work on my system bc I have GNU awk instead of whatever awk they have or whatever). This has basically died out year by year as so many people switch over to scripting languages with great standard libraries and super-powered easy to install libraries.
Now, I'm not really a fan of the super overkill object-oriented approach that systems like mac and smalltalk take, but I think our modern approach is a good compromise
- jll29 3y agoOn the topic of "UNIX shell one-liners versus Python", I enjoy letting my students solve the "make a list of the words in a file with their counts" exercise in Python, then I show them a sh one-liner. The Python scripts takes them from 10 minutes to two hours, they're buggy, and they cannot process big files - everything is in RAM (with a monster dict) - without a crash/system freeze. The power of UNIX, pipes and re-use.
- d0mine 3y agoSpace-separated case: import sys from collections import Counter L = Counter( word for line in sys.stdin for word in line.casefold().split() ) L is the words' multiset (the desired list of words with counts). How many words are there in English? 1M? Huge text [Unicode] files. Fancier tokenizer: for word in re.findall(r"\w+", line.casefold())
- tech_ken 3y agoThe one thing holding Python back from completely eating my workflow of utils, glue, and hacks is environment isolation. Nothing sucks more than when activating some venv breaks a background tool I wrote 3 years ago and forgot about. I recognize that this is a surmountable problem with at most moderate effort, but getting to a point of complete frictionlessness would really move the whole ecosystem forward a lot, IMO.
- bowsamic 3y agoThe thing is this is already way worse on UNIX than it is on Python
- tech_ken 3y agoSure, I've basically just accepted that I'll need to trash and rebuild my various Linux daily drivers every 1-2 years because of environment decay. All solutons I've seen (Qubes, Nix, etc) come off as a massive PITA given that I just want a FOSS laptop upon which I can tool around a little and maybe watch Netflix. For now I just use docker for Unix-y isolation, but still cumbersome. If Python could finally figure this out I think it would be a reason for massive celebration. Conda got close, but never quite nailed it