Using Rust for 'Scripting'
51–60 of 126 posts
Re: Using Rust for 'Scripting'
#52This is over engineering if I've ever seen it. For one this is a single line bash script that would allow you to even handle drag and drop. Best user experience. Second, if you're going to over engineering just look for someone who has already done that for you: http://www.den4b.com/products/renamer It's no use to engineer something that has been solved (unless you're learning) if there are already better solutions.…
Re: Using Rust for 'Scripting'
#53Re: Using Rust for 'Scripting'
#54>Writing it in Rust means I can compile it and hand it to him, and he can run it. And that’s it. As wonderful as they are, the fact that languages like Python, Perl, Ruby, JavaScript, etc. require having the runtime bundled up with them makes just shipping a tool a lot harder—especially on systems which aren’t a Unix derivative and don’t have them installed by default. I'm wondering what part of the twelve step compi…
I agree. Instead the "friend" is taught the bad behavior of running untrusted (and I didn't see any tests, so untested and undocumented too) code in binary format on their machine. The glob-rename is exactly the sort of problem a script is supposed to solve easily. I feel the author justified the use of Rust and cross-compilation simply to avoid usage of a Windows OS (or VM) for such a trivial task. If the goal was t…
It's not untrusted code, it's code that a friend wrote to help you out. That's not at all the same as installing random untrusted code off the internet. I write code to help out my friends with things they want to do - are you saying they shouldn't accept it from me just because they can't code themselves? I can give them the source code, but what good is that to them when they can't program and don't want to?
Re: Using Rust for 'Scripting'
#55The amount of contortions the author has had to go through is ridiculous, and all because the target operating system is Windows, and doesn't yet ship a production ripe UNIX userland (hence no AWK, sed, or zsh/tcsh/ksh out of the box). As a colleague of mine always says: give Wintendo no chance!
Re: Using Rust for 'Scripting'
#56This guy has likely not prototyped in environment such as Jupyter notebooks or ptipython. It is not just language - there is whole ecosystem build around Python scripting: pandas, matplotlib, numpy, etc. And don't forget about debuggers and IDEs once your projects grow out of scripting environment. Did I mention hooking up to GUI or web app?
Re: Using Rust for 'Scripting'
#57Earlier quoted context omitted.
The Windows rename command doesn't support recursively processing subfolders, but it can be achieved using one line of powershell: Get-ChildItem . -Recurse -Include *.cha | Rename-Item -NewName { $_.name -Replace '\.cha','.txt' }
From what I remember Include will only match items from the base directory and powershell gets stupidly complicated very quickly: http://flukus.github.io/2015/03/13/2015_03_13_Powershell-is-...
Re: Using Rust for 'Scripting'
#58Earlier quoted context omitted.
Python scripts can also be compiled to an exe file, although I think that the following batch one-liner is the best for this job: for /r startdir %%i in (*.cha) do ECHO ren "%%i" "%%~ni.txt"
Yep, one liner crushes the problem because a shell script is the perfect tool for the job!