Post A44d6g4PI3n2Cdyv8S by jgoerzen@floss.social
 (DIR) More posts by jgoerzen@floss.social
 (DIR) Post #A3w6qC12tvubtc7jW4 by profoundlynerdy@mastodon.technology
       2021-02-04T13:39:31Z
       
       0 likes, 2 repeats
       
       What is your favorite general purpose scripting language and why?#programming #bash #perl #python #dos #linux
       
 (DIR) Post #A3ze9NXXllj9lWf7om by feoh@cybre.space
       2021-02-04T16:13:48Z
       
       0 likes, 0 repeats
       
       @profoundlynerdy Python because: 1) It's un-clever and for me its syntax is very readable and approachable. 2) Its "batteries included" philosophy means that you can do SO MUCH without even pulling in external dependencies, and if you do choose to tap pypi, the selection is mind boggling. 3) The community is truly outstanding.
       
 (DIR) Post #A3ze9O0c1gynDgGL7w by herrdoering@fedpi.de
       2021-02-04T16:48:51.314863Z
       
       0 likes, 0 repeats
       
       @feoh Bash, because I never learned Python. ;-)@profoundlynerdy
       
 (DIR) Post #A3ze9ORCQqFMY8hZZI by profoundlynerdy@mastodon.technology
       2021-02-04T17:31:25Z
       
       0 likes, 0 repeats
       
       @herrdoering @feoh Is it just me or is there a bit of counter cultural push back against Python in some circles?
       
 (DIR) Post #A3ze9OyASGcOCO7txI by feoh@cybre.space
       2021-02-04T21:30:13Z
       
       0 likes, 0 repeats
       
       @profoundlynerdy @herrdoering Kind of.There's a fixation with small/light/low level as "cool" and Python as "bloated" "slow" and hence un-cool, especially among the Rust/Zig/Go/C/C++ cool kids club. Personally I enjoy solving problems at a high level of abstraction. YMMV and clearly does :)
       
 (DIR) Post #A3ze9PNgvN2DTY4Hjs by profoundlynerdy@mastodon.technology
       2021-02-04T21:43:22Z
       
       0 likes, 0 repeats
       
       @feoh @herrdoering I like tinkering with the low level bits.I see what you're saying. BTW, have you tried #Nim? #Nimlang looks visually quite similar to #Python but transpiles to #C.I expect it will be "the next big thing" for a lot of people currently into Python — especially if they only know Python — and want to get into compiled code.* https://nim-lang.org/
       
 (DIR) Post #A3ze9PozHsrwqCq5Hk by ashwinvis@mastodon.acc.sunet.se
       2021-02-06T09:46:53Z
       
       0 likes, 0 repeats
       
       @profoundlynerdyPython transpiles to C too. That's basically the idea behind PyPy, Cython, Numba and Pythran.Trying out just CPython, the reference implementation and complaining it is slow is a trope or meme in tech circles like@feoh mentioned. People who have explored it a bit more would know better. @herrdoering
       
 (DIR) Post #A40B06FHzti20cJ6VU by jgoerzen@floss.social
       2021-02-05T03:38:36Z
       
       0 likes, 0 repeats
       
       @feoh @profoundlynerdy My problem with Python (3) is that it's not really suitable for shell-type work since it doesn't work with non-UTF8 filenames.
       
 (DIR) Post #A40B06o1ujUxkMYqem by feoh@cybre.space
       2021-02-05T20:38:25Z
       
       0 likes, 0 repeats
       
       @jgoerzen @profoundlynerdy The proof is in the pudding :)
       
 (DIR) Post #A40B07NTmvr3WJ99ua by jgoerzen@floss.social
       2021-02-05T22:38:24Z
       
       0 likes, 0 repeats
       
       @feoh @profoundlynerdy Try this:touch `printf "test\xf7.txt"`and then see how it works to process it in Python.  If I try:f=open("test\xf7.txt")in python 3, I get "No such file or directory"
       
 (DIR) Post #A40B07v9linFCku3P6 by ashwinvis@mastodon.acc.sunet.se
       2021-02-06T15:55:00Z
       
       0 likes, 0 repeats
       
       @jgoerzen @feoh I tried it. The only thing you have to do is pass the path as a byte-string.open(b"test\xf7.txt")
       
 (DIR) Post #A40EFWi8BMvmINqTEO by jgoerzen@floss.social
       2021-02-06T16:31:25Z
       
       0 likes, 0 repeats
       
       @ashwinvis @feoh Correct.  But this is not the case throughout the standard library; for instance, dbm can't open that file.  Can't fit it all in a toot.  I wrote about it with more nuance at https://changelog.complete.org/archives/10063-the-fundamental-problem-in-python-3 and https://changelog.complete.org/archives/10053-the-incredible-disaster-of-python-3 .  In short, I don't think #Python 3 is suitable for systems or scripting work anymore.   It is too dang hard to just handle filenames correctly.
       
 (DIR) Post #A44d6fbh0ooylaXzNY by feoh@cybre.space
       2021-02-08T16:50:07Z
       
       0 likes, 0 repeats
       
       @jgoerzen @ashwinvis What do you propose instead? To be honest I've never encountered anything but ASCII filenames in all my years of infrastructure work. Obviously full unicode support is important but nowhere near enough to disqualify a language in very wide use that clearly works very well for a whole lot of people.
       
 (DIR) Post #A44d6g4PI3n2Cdyv8S by jgoerzen@floss.social
       2021-02-08T16:58:44Z
       
       0 likes, 0 repeats
       
       @feoh @ashwinvis I guess the alternative depends on the needs.  I'm sure Pythong is still suitable for some things.  But the problem here isn't that it can't handle Unicode; it's that it can't handle non-Unicode very well, and this sets it up for bugs and issues in a lot of scenarios.  So for instance, I have Gopher mirrors from the 90s, before Unicode, and there are many filenames that are in ISO-8859-1 or similar that are a real mess in Python 3
       
 (DIR) Post #A44d6gWPbwBvbV5Hmq by feoh@cybre.space
       2021-02-08T17:04:35Z
       
       0 likes, 0 repeats
       
       @jgoerzen @ashwinvis OK. So it's not good for your use case. That's cool. I can totally buy that, but there is a HUGE different between saying "Python 3 no longer works for my use case" and "Python 3 isn't suitable for systems and scripting work anymore" when the BigCo I work for churns out literally thousands of lines a day in mission critical systems.
       
 (DIR) Post #A44d6gx015SUvxWWEC by jgoerzen@floss.social
       2021-02-08T17:07:17Z
       
       0 likes, 0 repeats
       
       @feoh @ashwinvis Well I said that in the context of "what's your go-to scripting language?".So bash has a lot of similar (or worse) bugs handling filenames.  People still use it.  It does have workarounds, though you have to know how to use them carefully.Python 3 doesn't even have workarounds in many places.  Do you want something that will crash if \xF7 is in a filename?  That's just not robust coding practices.  You've got to handle the unexpected-but-valid.  And it's HARD in python 3.
       
 (DIR) Post #A44d6hTG59GMY0cHVg by feoh@cybre.space
       2021-02-08T19:10:06Z
       
       0 likes, 0 repeats
       
       @jgoerzen @ashwinvis Not arguing with that at all. Everything has bugs and can be improved upon, Python 3 is no exception :)