[ prog / sol / mona ]

prog


Scripting language of choice

1 2022-07-25 03:42

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

2 2022-07-25 03:43 *

Noone likes elisp bro

3 2022-07-25 03:46

>>2
there are a few emacs veterans lurking... be weary of what you write, they may GNU/hex you

4 2022-07-25 03:49 *

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

5 2022-07-25 05:50

>>1
* POSIX sh
* Python

6 2022-07-25 09:46

If it's for money, and others have to maintain, Python. If it's just for me, ISLisp (OpenLisp implementation).

7 2022-07-25 09:54

>>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.

8 2022-07-25 10:26

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.

9 2022-07-25 10:44

I like the Scheme language. That's why I write no scripts, just talking about writing them in Scheme on this forum.

10 2022-07-25 12:09 *

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.

11 2022-07-25 12:23

>>6

ISLisp (OpenLisp implementation)

Why do you enslave yourself to a proprietary implementation?

12 2022-07-25 12:32

>>11

Because I am a cuck.

13 2022-07-25 12:43

>>12

everyone knows ben

14 2022-07-25 13:12

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?

15 2022-07-25 13:17

>>14

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.

16 2022-07-25 13:27

>>1
Java, now that JShell is part of the JDK.

17 2022-07-25 13:49

scsh

18 2022-07-25 15:35 *

Starting to get bored of this anti-lisp guy persona.

19 2022-07-25 16:19

>>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).

20 2022-07-25 16:25 *

>>19
didnt read, go back where you came from gay boy

21 2022-07-25 16:30 *

>>19 i was pushing retarded scheme fanaticism tho

22 2022-07-25 16:54 *

>>19
hello, mister schemers-are-all-retarded
so, have you learnt to be polite?

23 2022-07-25 18:12

>>22
Don;t care, didn't read.

24 2022-07-26 03:41

What about Lua?

25 2022-07-26 11:49

>>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.

26 2022-07-26 13:42

>>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.

27 2022-07-26 16:03 *

>>26
perl isnt dead this is idealism

28 2022-07-27 04:00

Usually Common Lisp, though file manipulation tends to suck. APL (April) for napkin math.

29 2022-07-27 14:35

Why is everyone here promoting non-standard scripting languages?
You should all be using POSIX scripting tools such as awk, sed, sh, etc.

30 2022-07-27 14:54

>>29

Bash with bashisms to be POSIX incompatible on purpose. Industry standard.

31 2022-07-27 16:27

>>29
Perl5 is the de facto scripting language of *Nix systems.

32 2022-07-27 18:30

POSIX compatible sh. If something is too cumbersome for that, I consider writing a program in Lisp.

33 2022-07-28 14:16

Isn't POSIX compatible scripting a pain in the ass to write though?

34 2022-07-28 14:30

>>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.

35 2022-07-28 15:06

>>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.

36 2022-07-28 18:03

I was thinking of using fennel to script stuff.
What are the cons of doing this?
It seems lua can be easily transportable/installed.

37 2022-07-28 18:21

>>36

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.

38 2022-07-28 22:35

>>35

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".

39 2022-07-29 11:43

>>38
You can install Csh and write your scripts in C

40 2022-07-29 11:59

>>39
The programming language of the C shell is not C.
It was inspired by C, but it is not C.

41 2023-10-28 15:10

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/

42 2023-10-28 15:30 *

>>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

43 2023-10-30 22:04

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.

44 2023-11-01 21:33

>>7

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.

45 2023-11-01 23:04

>>44
Groovy is kept on life support by its use in Gradle, at least until Kotlin finally replaces it

46 2023-11-07 20:03

>>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

47 2023-11-19 07:42

I use Babashka

48 2023-11-19 23:23

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

49 2023-11-25 08:42

perl... really

50 2023-11-25 15:18

perl
i made this in perlle ;))
cibipixsibv5ryy2dn3efpahiwrg56gbhfdwlpe2by2ngiupc7tgbuqd.onion

51 2023-12-01 10:11

PerlMonks is great. And Perl docs tend to be great, too. Try perldoc perltoc

52 2023-12-04 20:25

Python, even if i dislike the language and the people using it.

The reason is simple, there's a library for everything.

53 2023-12-05 10:11

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/

54 2023-12-08 00:21

>>51
perlmonks is one of the best websites ive ever come across

55 2024-01-05 15:37

>>47
Babashka is based.

56 2024-01-05 18:17

>>53

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.

57 2024-01-06 00:04 *

>building tools for scientific computing

*cof* call-ing fortran software is not software *cof*

58 2024-01-06 13:11

>>56
Interesting story.

59 2024-01-06 22:39

For me it's the GNU Ubiquitous Intelligent Language for Extensions.

60 2024-01-07 16:12

Emacs keyboard macros

61 2024-01-09 16:21

>>60
Why Emacs?

62 2024-01-11 18:09

>>61
Emacs just works.

63 2024-02-17 05:03

>>2

I like elisp :c

64 2024-02-18 16:08 *

>>63
N

65 2024-04-06 08:07

Plan 9 rc, guile, or python.

66


VIP:

do not edit these