What is your scripting language of choice?
Recently stumbled upon https://github.com/shirok/Gauche
Then realized I don't necessarily write my own scripts all that often.
inb4 elisp
Noone likes elisp bro
>>2
there are a few emacs veterans lurking... be weary of what you write, they may GNU/hex you
Y-You use n-nation therefor y-you think i-its good111!!!
Bro emacs veterans justly hate elisp, they just know its better than viml and teco
Vim veterans justly hate viml come up with better material
>>1
* POSIX sh
* Python
If it's for money, and others have to maintain, Python. If it's just for me, ISLisp (OpenLisp implementation).
>>1
Bash with bashisms to be POSIX incompatible on purpose. Industry standard.
Groovy. Industry standard for many tools.
Have to use Python at work, but I don't like this schoolboy language with a stupid name.
I like the Scheme language. If my purpose is to have scripting functionality as a way to extend an existing application, I will hook Guile into it. If my purpose was to write systems administration scripts, I will compile my Scheme program with Guile. Chicken Scheme is also a compiler that I've used and embedded into other applications.
I like the Scheme language. That's why I write no scripts, just talking about writing them in Scheme on this forum.
Guile is an implementation of the concept of a programming language known as Scheme, just like your mother is an implementation of the concept known as a whore.
ISLisp (OpenLisp implementation)
Why do you enslave yourself to a proprietary implementation?
Because I am a cuck.
everyone knows ben
I see a trend where people want r write Lisp/Scheme, but have to use Python for work. What do people here think about Hy, looks like a good solution?
No one would care about your pony language outside of the walled garden of Lisp enjoyers. Python is used just because everyone knows it and it gets your enterprise shit done.
>>1
Java, now that JShell is part of the JDK.
scsh
Starting to get bored of this anti-lisp guy persona.
>>18 You are so bored that you don't miss a post from "him" (it's not even the same person, just people not so retarded about Scheme fanaticism).
>>19
didnt read, go back where you came from gay boy
>>19 i was pushing retarded scheme fanaticism tho
>>19
hello, mister schemers-are-all-retarded
so, have you learnt to be polite?
>>22
Don;t care, didn't read.
What about Lua?
>>24
The de-facto standard for embedding an interpreter in a larger system, e.g. one written in C/C++ (this design is common in the video game industry). I don't find the language or its standalone interpreter terribly interesting, but that isn't really important.
>>24 Would be nice if Python dies from its weight like Perl and Lua supersedes it.
I still use Perl for scripting, tho, much more powerful than Python.
>>26
perl isnt dead this is idealism
Usually Common Lisp, though file manipulation tends to suck. APL (April) for napkin math.
Why is everyone here promoting non-standard scripting languages?
You should all be using POSIX scripting tools such as awk, sed, sh, etc.
Bash with bashisms to be POSIX incompatible on purpose. Industry standard.
>>29
Perl5 is the de facto scripting language of *Nix systems.
POSIX compatible sh. If something is too cumbersome for that, I consider writing a program in Lisp.
Isn't POSIX compatible scripting a pain in the ass to write though?
>>33
Generally speaking, yes it is. The one and only reason I would write a Sh script would be as a shortcut to a set of command line commands. Anything more complex and I'd rather write a Perl script: I hate reading and writing in Perl but that's significantly more tolerable than writing Sh.
>>33
It's significantly less pain than writing in something like bash or zsh. In general, it's alright if you are in the territory of text manipulation (for which Unix in general is heavily geared towards), or using external programs to do something. Outside of that, you are headed into the rape zone, and should probably use a better equipped programming language.
I was thinking of using fennel to script stuff.
What are the cons of doing this?
It seems lua can be easily transportable/installed.
What are the cons of doing this?
I haven't used Fennel but Lua is pretty comfy and lightweight. One downside is that Lua doesn't come with as many batteries as Perl, Ruby or Python. But there are still plenty of libraries available.
better equipped programming language
c99
is part of POSIX.
What you can do:
* Write program in C.
* Write a POSIX sh script to compile and run the C program.
In this way, you are using C as a "scripting language".
>>38
You can install Csh and write your scripts in C
>>39
The programming language of the C shell is not C.
It was inspired by C, but it is not C.
How about awk?
Gnu AWK is pretty awesome! But can it be used for systems programming?
Click Here to find out! ==> https://github.com/arnoldrobbins/awk-sys-prog
I think GNU Awk (or MAWK??) is much better (and less harmful §) scripting language than Python when it's possible to use it (but sometimes it's not possible, for practical reasons). AWK is faster and the code is usually shorter (unless, Awk is not good for solving your problem). Awk is also part of POSIX, so it's present on all Lunix environments. The core POSIX Awk standard is also frozen, much like Common Lisp. And there just isn't a better language for pattern { action }
§ https://harmful.cat-v.org/software/
Some features of GAWK:
* POSIX Awk support plus Gnu Awk extensions
* network programming with sockets
* namespaces
* debugger and profiler
* Great manual that includes a tutorial (+ Effective AWK Programming book)
I recommend getting The AWK Programming Language 2nd edition: https://www.awk.dev/ (the O'reilly Sed & AWK book is also decent).
I also recommend these 2 sites:
* https://www.grymoire.com/Unix/Awk.html
* https://web.archive.org/web/20150205231223/http://awk.info/
>>39
I thought (t)csh scripting is considered to be a harmful activity?
https://harmful.cat-v.org/software/csh
https://www.grymoire.com/unix/CshTop10.txt
I found Janet recently and wanna try to use it as my small scripting language.
I really like I can compile and distribute code meaning I can set setuid setgid flags.
Also it handles ffi really good as I see that.
Tcl/Tk is good for GUI wrappers if users can't get around with cli lol.
And Shell is good for simple tasks of course.
Groovy
what the shit, people still use Groovy? i remember fucking around with that in like 2014 or something hot damn.
>>27
the latest generation of devs have no idea what perl even is, just like irc.
>>44
Groovy is kept on life support by its use in Gradle, at least until Kotlin finally replaces it
>>43
Tcl is actually nice language (but perhaps uplevel
and upvar
can be a bit insane (if used carelessly)). But I think this is similar to how some outsiders call Perl a "write-only language", which is not true (unless the code was written by a bad programmer.). In Tcl everything is a command and everything looks like a string. Tk
is still the easiest and most convenient GUI toolkit (there is a reason why Python and Ruby imported it). Expect
is still the best tool for automating interactive cli tools.
PS. check out Tcllib.
How about you give Tcl a try?
-> https://wiki.tcl-lang.org/page/Tcl+Tutorial+Lesson+0 <-
If you prefer a book...
- The Tcl Programming Language: A Comprehensive Guide: https://www.magicsplat.com/ttpl/index.html
- Practical Programming in Tcl and Tk: http://www.beedub.com/book/
- Exploring Expect: https://wiki.tcl-lang.org/page/BOOK+Exploring+Expect
quick rundown on Tcl: http://antirez.com/articoli/tclmisunderstood.html
I use Babashka
When I need a language for the purpose of controlling a compiled program, as the term "scripting" suggests, I'm more likely to write one built for the purpose
When I need to quickly write a command line tool to perform computation specific to my current task or setup, and I don't care how fast it runs, I just use Bash or Python
perl... really
perl
i made this in perlle ;))
cibipixsibv5ryy2dn3efpahiwrg56gbhfdwlpe2by2ngiupc7tgbuqd.onion
PerlMonks is great. And Perl docs tend to be great, too. Try perldoc perltoc
Python, even if i dislike the language and the people using it.
The reason is simple, there's a library for everything.
Python is very pragmatic choice because there are simply so many libraries but Python as language is not very elegant or beautiful. A syntax that depends on whitespace is not easy for beginners or anyone else (have you tried copy+pasting Python code?). Having Begin/End keyword that Starts/Closes a block is much more clear, even for beginners. Parenthesis or curly brackets are also very clear (but shorter to write). How about working in a team? 1 person who has configured their editor to insert 4 spaces while everyone else uses 1 tab char can (will) cause trouble if you code in Python.
Some List functions in Python are functions but others are methods, which is confusing for beginners. Why lst.remove() but len(lst)?.
Would it have been better if OOP in Python was provided by separate module? Lua and Tcl* does this (core Tcl now includes TclOO). Why doesn't range(n1, n2) func include also number n2
(it includes n1...(n2 - 1)) but the stdlib random.randint(n1, n2) func does include n1...n2 ???
Also, the only reason why Python replaced Perl, is that Python was pushed by Google (before Golang). The proponents of Python also resorted to FUD. They said that "Perl is write-only language" and they then showed some code golf example code and said "look!". They also showed bad code written by beginners. But it's important to keep in mind that Perl used to be the beginner's programming language before Python. There is plenty of bad code written in Python now.
Why is packaging and package management so broken and fragile in Python land? Perl has CPAN and it has been around for a long time and it works well. Ruby has gems that also just works™. Rust has cargo etc. Everyone else can do it but why can't Python?
I should also mention GIL and the overall bad performance of Python, too...
51
I also like sigils in Perl5. It makes it 100% clear what kind of variable you are dealing with (is it a regular/"scalar" var or array?).
https://raku-advent.blog/2022/12/20/sigils/
>>51
perlmonks is one of the best websites ive ever come across
>>47
Babashka is based.
the only reason why Python replaced Perl, is that Python was pushed by Google
Holy revisionist history, Batman!
I don't want to defend either Google or Python, but the fact is, Perl was balls deep in the grave years before Python's ascendancy. The Perl 6 debacle killed all the momentum left in the community, which already wasn't much, because Perl 5 was being eaten alive by PHP, because PHP was easier for half-asleep teenagers to get started with. Then word got around that it was bad for security, and PHP lost to Ruby, which ruled the world for about a week until Zed Shaw posted his "ghetto" rant.
The Python people hated Ruby a lot more than they ever hated Perl. Ruby and Python were close rivals. They started getting widespread attention at the same time. They had similar strengths, like REPLs, and similar problems, like poor performance and inconsistent stdlibs. Ruby was "fun" so the pythonistas all decided they were going to be "not fun" and act professional. They got in bed with the Fortran people early on and started building tools for scientific computing. (Actually, where was Lua all this time? It was designed to be complementary to Fortran, but those blockheads forgot it existed.) They were really well prepared to take Ruby out at the knees as soon as the drama started happening. Maybe they even instigated some of it. I seem to recall Zed Shaw endorsing Python right away.
I worked with Perl for a while. The "write-only language" thing was an inside joke as much as anything else. When I heard it used as an insult, it usually came from C programmers (throwing stones in glass houses as usual). They preferred Bash to Perl, especially once it started adding more features, but they still preferred Perl to Python for a long time and were constantly starting arguments about whether Python "deserved" to be part of Linux distros.
>building tools for scientific computing
*cof* call-ing fortran software is not software *cof*
>>56
Interesting story.
For me it's the GNU Ubiquitous Intelligent Language for Extensions.
Emacs keyboard macros
>>60
Why Emacs?
>>61
Emacs just works.
I like elisp :c
>>63
N
Plan 9 rc, guile, or python.