I just want a cute language for scripting that isn't used by troons (Python, TS, JS).
I looked at Perl but the syntax is just gross. Any recommendations?
I just want a cute language for scripting that isn't used by troons (Python, TS, JS).
I looked at Perl but the syntax is just gross. Any recommendations?
If you don't like python then man up and use perl, or even pure bash. You're complaining both about the problem and the solution
Impossible. You know who likes "cute" languages? Fucking troons. In fact, you're probably a troon yourself or other deviant, you're just also a hipster that's "not like the other degenerates".
Just us the shit that works best for your use case, though I'm guessing you don't actually have one, besides LARPing.
Perl.
>get over yourself ya nagger
You can try Julia, or just give up on the scripting language meme altogether and use a real language like Zig
Perl programmers would appreciate Julia, but I wouldn't recommend it for scripting due to slow start-up times. Perl programmers trying out Julia will have to adapt their workflow to be REPL-oriented. (It is a very nice REPL that's easy to like.)
>slow start-up times
This is one workaround that has worked for me.
https://github.com/dmolina/DaemonMode.jl
lots of people use python that aren't troons. I don't like troons but it's a tool. if a troon used a hammer is the entire category of hammers now tainted?
>is the entire category of hammers now tainted?
Of course not -- just the hammer that's emblazoned with a pride flag, comes with an obnoxious CoC, and forbids problematic terms like 'ball-peen'.
Perl is great but if you insist on avoiding it then try Tcl. Lots of batteries included but obscure enough to be left out of most political bullshit.
fair enough
>emblazoned with a pride flag
Where is python emblazoned with the pride flag?
Some people just like to suck dick.
>Tcl.
I always forget about Tcl despite that being where the ubiquitous *Tk comes from. Good suggestion.
>I just want a cute language for scripting that isn't used by troons
do you also not drink water because troons also drink water believe it or not
Ruby is comfy. Probably also used by troons, but just stop thinking about them, don't let them live your head without paying rent.
>the syntax is just gross
That's a (you) problem, just find another way to write it
GPL is harmful? Sounds like some corporate shill.
>sed 11q
sides
>JSON
>less harmful
ok
XML and YAML are full of exploits not to mention they can look like lovecraftian horrors if abused enough. JSON may not be as feature-rich as them, but that's the point
There exists no good data interchange format, except for maybe newline seperated values a-la http
Protobuff mate.
shoo google shill
How's it different than a struct/object
>i will make my life a misery because i dislike those who have it easy
apricot kernels are rich in cyanide, 15 should do it, and you don't even have to use troon methods like the noose
OK, but how do I get people to eat raw potatoes?
How about Lush?
https://lush.sourceforge.net/index.html
>I just want a cute language
>that isn't used by troons
The sheer queer irony.
Lua
Lua
>I just want a cute language for scripting that isn't used by troons
you sound like a tranny in denial.
> perl
Stick with python for God sake or try out Julia
>scripting
stop falling for the false-dichotomy of "systems vs scripting"
one lang can do both now.
Learn D
https://tour.dlang.org/
https://dlang.org/rdmd.html
>looked at Perl but the syntax is just gross
It's not as gross as you think. I find it very comfy personally and have no problem reading my own code because I try to follow my own best practices regarding the text formatting, the naming of functions and variables and always try to make programs the simplest way possible. You do all this and it can be as much or more readable than so called "readable" languages like python.
Nim is all you need!
https://nim-lang.org/
https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#JSON
successfully repelled the throbbing CoC
That troons never use Nim out of spite
I really want to like Perl, but there's a few hangups I have with it, like the my/our keywords, and the sigils. I need to use it more and really get used to it.
>my/our keywords
this is nothting, you'll get use to it even though they are stupid words to use in this context. the good thing about my is that it is so god damn short.
>and the sigils
I would lie if I said I wasn't dreaming of a perlish language with tons of improvement including syntax improvements, including no sigils, but somehow you get used to them. Or rather to "it" really, 80% of the sigils you use are dollars and they are easily reachable with you index while your pinkie presses Shift
>Or use Lua because metatables are underrated.
what do they all you to do?
>I would lie if I said I wasn't dreaming of a perlish language with tons of improvement including syntax improvements, including no sigils,
That's kind of what Ruby tried to be.
I know but Ruby doesn't cut it for me, not even close. I want real improvements, not cosmetic stuff and OO certainly doesn't count as an improvment.
The grammar stuff of Raku (but way better: more speed, actual semantic checks and debugging and being able to use an operator precedence parser in the PEG-like grammar) the ability to really and completely change the syntax and semantics of the language just inside a lexical scope (has never been done ever to my knowledge), real AST-based macros like Lisp but with a normal syntax, and finally having the backtracking machinery of the regex engine directly incorporated in the VM so that the main VM can implement regexes (and the grammar/parser stuff) on its own without a additional regex VM bolted on the side and that way the integration with regular code is flawless. This also opens the door to the logic paradigm and that is actually increasing the expressivity by a lot.
Now that's what I call improvements.
>real AST-based macros like Lisp but with a normal syntax
Julia has this.
Maybe but it doesn't have the other stuff and can't implement them either since the embeded regex/grammar/prolog stuff definitely requires computed goto for it to be implemented the right way and so that it's not slow.
Julia is not what you're looking for, but you might like it anyway. One of its core devs used to write a lot of Perl back in the day, and a seasoned Perl veteran can tell. There are traces of Perlishness sprinkled throughout the language. It is clever in a lot of ways but in a different way than Perl was. While I've been exploring this language, I've caught myself thinking, "Oh, that's smart" more than once.
One bold move they made was to completely abandon OO. There's no such thing as a class in Julia. HOWEVER, there's tons of polymorphism in the language due to type-based function dispatch. I've never seen polymorphism work so well for the whole community. For example, they have a convention where if you implement a show function for whatever type you happen to invent, the REPL will use your show function to render that data. (There are tons of show functions for all kinds of data types.)
(I've historically not been into type systems, but this is the first time I feel like the type system is actually helping me. It doesn't feel bolted on like TypeScript. It's an integral part of the language, and it makes magic possible. It doesn't feel like I'm being handcuffed by the type police.)
I think of Perl as the old grandpa, and Julia is like the grandchild that's shockingly intelligent (particularly when it comes to high performance numeric code), but still playful (like Perl was). I wasn't looking for Julia, but I fell in love~ when we met.
Thank you for the effort post anon, but Julia is not what I need, at least for the moment. I've been dying like a year to have a language with the features of I listed before but it doesn't exist so I'm trying to make a prototype in Perl.
That said you're not the first one to say that Julia's type system/multiple dispatch is really great so I'm definitely curious about it and what makes it so neat. It might be worth to steal it.
It's also really based from their part to ditch OOP in favor of a good system. It shows that the guys that made Julia are not morrons.
>language...that isn't used by troons
Doesn't exist.
Program in Forth like a real man. Tailor it to your specific needs.
Or use Lua because metatables are underrated.
forth is a great language for implementing forth, and pretty much nothing else (except maybe a toy bootloader).
larpers and hackaday parrots pls go and stay go
[09x13] Top 10 JuliaCon 2023 Presentations | A Viewer's Guide to JuliaCon, JuMP-dev and SciMLCon
Golang?
scheme
Nuff said
Guile Scheme
>doesn't support non freetard operating systems used by white men
DOA
Guile came out before GUIX, noob
Still no (native) support on windows? If I'm building something I'd like for it to work on the most popular operating system nagger homosexual
Most popular where? Are you building software for stay at home moms?
Get out of your bubble once in a while. The world runs on windows. Linux is a meme that was created by one guy that had too much time.
You sound envious of that guy.
https://babashka.org/
#!/usr/bin/env bb
(require '[babashka.http-client :as http])
(defn get-url [url]
(println "Downloading url:" url)
(http/get url))
(defn write-html [file html]
(println "Writing file:" file)
(spit file html))
(let [[url file] *command-line-args*]
(when (or (empty? url) (empty? file))
(println "Usage: <url> <file>")
(System/exit 1))
(write-html file (:body (get-url url*~~)
#!/usr/bin/env bb
(defn download-file
([] (println "Usage: <url> <file>"))
([url] (download-file url (fs/file-name url*~~
([url file]
(printf "Downloading %s as %s%n" url file)
(with-open [i (io/input-stream url)
o (io/output-stream file)]
(io/copy i o*~~)
(apply download-file *commandline-args*)
people think this is human:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
# Define the URL of the HTTP endpoint you want to call
my $url = 'https://example.com/api';
# Create an instance of LWP::UserAgent
my $ua = LWP::UserAgent->new;
# Make an HTTP GET request
my $response = $ua->get($url);
# Check for errors
unless ($response->is_success) {
die "HTTP request failed: " . $response->status_line;
}
# Get and print the response body
my $content = $response->content;
print $content;
If you have a problem with that code it's nothing specific to Perl per se, just specific to this particular http client. You can awlays use another or make a little wrapper function like this. Then you put this in a module, import it and it becomes a one liner
my $ua = LWP::UserAgent->new;
sub http_get {
my $url = shift;
my $res = $ua->get($url);
if (!$res->is_success) {
return
}
$res->content
}
say http_get "https://example.com/";
It's:
$variable
::
->
.;
you mean that you don't like sigils on variables, :: on package/namespaces, -> for dereferencing and method calls, and the dot for string concatenation?
The last one is handy since it's a very common operation in perl scripts and it's best to have 2 different operators for the addition and concatenation.
you can use standard the function call syntax if you don't like making method call with ->, like this method($obj, @params)
:: are not really used all over the place so it's ok
thanks to the $sigils, you can call functions without parentheses, this is handy
use LWP::UserAgent;if(!(my$r=LWP::UserAgent->new->get("https://example.com"*~~{die"HTTP request failed: ".$r->status_line;}
#!/bin/env bb
(-> "https://a.4cdn.org/g/thread/95916736.json" slurp println)
>slurp
I didn't know slurp understood URLs. That's handy.
that's how I saw it used in the video that first got me into Clojure
it supports anything that java.io/reader can handle
https://clojuredocs.org/clojure.java.io/reader
yeah, Perl definitely integrates more seamlessly with shell syntax than Clojure/Lisp. It feels like a natural extension, it's what Bourne Shell should have been.
I use Babashka because I'm very bad at remembering syntax, and I already use Clojure(Script) for apps and websites.
Just a few months ago, a dialect of Clojure that's hosted on Perl was released.
https://metacpan.org/dist/Lingy/view/lib/Lingy.pod
https://github.com/ingydotnet/lingy-dev
a bit more neatly:
#!/bin/env bb
(-> "https://a.4cdn.org/g/thread/95916736.json"
slurp
json/parse-string
pprint)
ez
>utils.pm
sub http_get {
my $url = shift;
qx{curl -s "$url"}
}
1;
>.bashrc
alias perl='/usr/bin/perl -Mutils'
perl -E 'say http_get "https://a.4cdn.org/g/thread/95916736.json"'
aside from that ugly arrow syntax and `unless`, this looks fine
Modern PHP is actually pretty good for scripting, especially when web requests are involved.
Clojure the true white man's language.
#!/usr/bin/tcc -run
>language for scripting that isn't used by troons
doesn't exist. stop trying shit and just do your work.
i wish you were still able to write anything useful in perl, seemd like a cool hipster language