What's a scripting language that doesn't suck?

What's a scripting language that doesn't suck?


90% of the stdlib is unusable, the syntax is sensible, it's completely useless for anything other than its logical operators which literally anything can do better. For instance sh has a large amount of different kinds of expansion you can use to augment your logic.
Because at least it can get you there with logical operators and whatever you should be using it for will be providing you with nonstandard functions, at least it can be a garbage (but less so than the alternatives) extension language which was its original goal.
Also one of those things that are basically undocumented, and no the horrible manuals on the website or the cashgrab books (thank fuck I pirated them) don't count.
Best syntax except for the fact that even in POSIX builtins it's completely ignored by half the commands (look at getopts syntax for instance). Otherwise you can literally just say "do thing" and it does thing, WOOOOOOOW. No idea how everything else screwed this up so bad.
The ksh manual for instance is 2000~ lines and after that you already know POSIX shell + some bourne/korn extensions, and how limited it all is sadly.
Can't even fucking do argument splitting without requiring you to write an incomprehensible dirty hack, specially if you want to have long opts and will turn into a dirty hack one way or another if your script does anything but run commands in series.
Go back to India.

I'm going to try perl now and if it's shit too I'm not aware of another scripting language.
I don't know what else to try, everything so far is unusable, at least sh works sorta, unlike python and lua which are too shit for even that.

Attached: silicon valley.png (2326x1328, 1.85M)

Other urls found in this thread:

dlang.org/rdmd.html
github.com/Zevv/npeg
lua.org/pil/contents.html
lua.org/versions.html
lua.org/manual/
eloquentjavascript.net/
news.ycombinator.com/item?id=14944103
news.ycombinator.com/item?id=14941525
gnu.org/software/guile/docs/master/guile.html/POSIX.html#POSIX
4dos.info/
twitter.com/SFWRedditImages

Opinion discarded.

Perl 5 is basically okay. Tcl is probably fine too. Depends on what you want to do, I guess.

Oh, and Expect was made in Tcl. Really fucking useful tool for automating stuff. Haven't really used Tcl itself that much, but Expect kicks ass!

Pick one faggot.

This.

troll/10

i take it saying javascript makes me a nigger?

Worst bait.

All scripting languages suck.

If you want a scripting language, STOP, find a calendar ('cal in terminal'), confirm that the printed year is not early two-thousand aughts, and pick a real language like Nim or D or Crystal.

Scripting languages were born when we still believed that computers would get faster at such a rate that it was a waste of time to try and write good software.

ed

I am a fan of just using straight bash. Linux is your standard library.

dlang.org/rdmd.html

This.

So far I agree, but
Yeah, I'm not a pajeet who will implement a whole VPN protocol in python, I just want something for stringing togheter executables and text parsing that is more featureful and portable than sh.
Shell scripting is just painful, and I don't know what's wrong with luafags but they're messed up.

I got a little erect when the perlintro mentioned text parsing, but it's late in the night now and I have to sleep.

You could try E I guess. erights.org
The most pure scripting language I've used, but still quite crap outside the capability novelties. There really is no good scripting language period. The term "scripting language" just means "flaky pile of shit for kids". You can write SML or Haskell just as fast as any other language. The idea that any general purpose PL serves some specific niche purpose is completely absurd. Yesterday I just discovered the build system Meson, which is just some piece of shit language that's basically the same as Python - why did they need to built their own language (or adopt whatever the fuck it is that they're using, instead of just using something popular).

u wot m8

Perl doesn't parse shit, it just quickly approximates. "Parsers" written in Perl never actually parse and just cause more problems down the line. But that's no problem, we have Perl to help with those! And Perl to help with the problems that causes! And Perl for…
Managing to make sh look good is a feat, but Perl manages it. There is a reason this language is mostly dead by now.

these languages are decent and they're as convenient for scripting-language tasks as scripting languages themselves.
Python/Perl -> Nim results in a smaller, faster, safer, easier to understand program.

actually dead norwegian comp.lang.lisp autist .png
regexes are fine and there's nothing magical about writing a parser for something a regex could easily handle.
even so, compile-time parser expression grammars are pretty cool. Consider github.com/Zevv/npeg
That reason is "MJD wrote about advocacy being bad and everyone in the Perl community took it like a stake through the heart".

A scripting language that doesn't suck:
Lua
Python
Perl

why don't we have compilers for scripting languages? why don't we have interpreters for compiled languages?

why don't we have ultimate language that would be compiled or interpreted depending on your needs?

the way they're designed, you wouldn't actually benefit from compilation.
we have this. Classically, Forth and Lisp. Borderline, Erlang. Modern, Nim (with inim, not "nim secret"). You also get a measure of interpretation from debuggers.

just make the compiler fast enough so you don't worry about compiling too much

There is an idea in compiler technology known as an "intermediate representation". The LLVM compiler allows you to compile any language into the LLVM intermediate representation. From that intermediate representation, LLVM can compile the program into machine code.

In the old days, BASIC was the scripting language. It was fast enough back then to do plenty of stuff, and you could even "extend" it with calls to your own machine code subroutines. So there was never a need to wait for faster computers, because it was already useful.
Pic was made entirely in BASIC on PC-88 computers.

Attached: the-black-onyx_8.png (640x400, 3.14K)

I wrote so many notebooks full of TI Extended BASIC

BASIC is more the equivalent of bash for those systems. It's not a scripting language in the sense of awk, Perl, etc.

I bet you'd love an upvote button on 8ch.

Linux is an incredibly bad standard library. Text parsing is no way to go through life.

Text will always be around. Data representations will die and become unknown or aren't around everywhere. Not that it's not easier. Powershell compared to bash is a world of difference.

Regex is often simply the wrong tool for the job, that's all. I don't mind compile-time parser expressions. Also come on, Perl didn't just commit suicide.
heh

csh on *bsd instead

Not really, the closest equivalent to /bin/sh back then was CP/M and DOS batch files. You don't make graphics and games in batch files or shell scripts, but you do in BASIC. Also it was used for writing tools as well. Shell scripts aren't much good for anything beyond slinging a few programs together.

Attached: ultima-i-the-first-age-of-darkness_1.png (560x384, 10.99K)

These


heh, just pipe C code to tcc -run and execute it like a script or install TempleOS and use HolyC like a white man

actually, python does suck

Just use node dude XDDD

What is it with these moronic posters recently? Lua is not meant to be a standalone scripting language, it's supposed to be embedded inside a larger application and used to script that application. Even the standalone Lua interpreter is really just a very thin application that embeds Lua and is meant for playing around interactively with the language. You can technically write standalone programs in it, but don't complain when it's a subpar experience.

You can read the first edition of the textbook online, then read up on the differences in newer versions of Lua in the release notes.
lua.org/pil/contents.html
lua.org/versions.html
The book is just a luxury item anyway, it gives you an overview of the language. The real meat is in the reference manual, which is free for all versions.
lua.org/manual/

Why did you even bother asking?
Oh wait you're a nigger and didn't know any better.

Tcl all the way. Once you learn about uplevel, the dodecalogue and the ease of writing extension, you'll fall in love.

Are all the niggers spewing out javascript because of web? Python or lua is easier to learn properly but since they cant make muh javascript ridden portfolio website they never use them?

Python being easy to learn is a meme. The justifications for it have changed over time:
1. Guido studied easily-taught languages and designed one! Python embodies few of its lessons. Python's not even case insensitive. Python has grown like a teratogenic tumor since this period in response to design proposals from lots of people who didn't study or design easily-taught languages.
2. Python denies TIMTOWTDI! It doesn't even have += operators! it has them now. and list comprehensions. and generators. and decorators. and superfluous discordant feature ad nauseum.
3. (due to the meme) Python has lots and lots of introductory material! This is true, but you don't need lots of tutorials. You only need one. JS has eloquentjavascript.net/
4. Python has lots of libraries so you can probably perform your task without having to learn the details! true today, but not true when Python was getting pushed ahead of other languages "because it's easy". Those other languages were the ones with the many libraries.

For me javascript was more of a pain to learn because of:
- node blowing up
- split between browser and server side learning resources
- how the "best way" (using latest standards and styles) changed so frequently
Just look at the mess of different/new ways async can be handled for example. From callbacks->promise chains->await->iterators and generators

Eloquentjavascript looks good (just skimmed it), but your average joe ends up on stackexchange. The answers for JS are far more often outdated or the wrong way of doing something compared to python _in my experience_. Maybe I need to delve deeper into python and I'll find I am wrong. I am definitely more versed in javascript, but at first found it easier to make something decent in python than javascript.

It's useful to be able to run the Lua code by itself (not embedded). For example, back when OBLIGE (random level generator for Doom) was at v0.97, I could run it like that on my OpenBSD laptop, which didn't have the GUI libraries or whatever other C library the whole program needed to build. So I just modified his Lua code a bit, and had all the random Doom levels I wanted. I didn't even know Lua, but it was easy enough to change it for that purpose.
Unfortunately I lost that stuff years ago, but it would be easy enough to do it again. Anyway I have SLIGE, and that's almost as good. Pic is screenshot of a level I just generated with it. Imp and lost soul are fighting each other on other side of that lava pit.

Attached: DOOM04.png (320x200, 22.09K)

they're both ill-defined pieces of shit the decend from C. if your "high level" language is just a bunch of shit copied from C, you should just kill yourself.

Read the fucking spec faggot, then learn how each browser deviates from it, if you're actually retarded enough to want to unironically use JS. Books on mainstream PLs are fucking retarded and useless.

Unironically node.js.

Unironically kill yourself.

Listen to your heart. Deep down, you know what's right.

Attached: camelia-logo.png (261x243, 56.25K)

You guys jumping between programs all the time and complaining. youre like the kid who buys more audio gear thinking eventually he will find something that inspires him

Sure, I am not arguing against that. I'm just saying that standalone Lua scripts are not the primary purpose of Lua, so the language does not accommodate this use-case like for example Python does. Lua on its own has a very small standard library that only included the minimum that would be useful for an embedded language.

my @fruit= qw/Apple Orange Pear/
So comfy mmmm.....

Python is fine, just don't go overboard. People get carried away when they realize how much they can do with it.
Just saying "pajeet" is not much a reason to ignore it.


I know LLVM is not a virtual machine, but this feature is similar to bytecode.

I've just started learning go (golang) after 19-ish years working (for money) with Java, C, C++, C#, and knowing some Scheme and Python on the side. Doesn't seem that bad. Yes, it's not a scripting language but it compiles very quickly. You can also do real information hiding (as explained in the C++ FQA (frequently questioned answers)) - you just export an interface and hide the actual struct as package-private.

Just wrap Nim under Python, you twat, it is easy.

We need languages that are fast (for work) paired with languages that are kid/toy-friendly (for play).


Do some research on Quorum (the "evidence-based programming language"), then come back.

Standardization means ease of handling, which is why Python 3 is at least tolerable.


Go has a lot of holes in them, but overall properly designed like Python 3. Not perfect, but better than Java.

lmao i could vomit my boyfriends cum and it would be valid perl code, regardless, they're all shit so you might as well use it

I didn't think it would but it does.

Attached: foo.png (964x220, 7.67K)

Lynxchan, stop posting. Perl 6 is the one true language of shitposting.

Attached: min0nlepbd831.jpg (750x746, 88.16K)

It doesn't matter, just use the one that feels right in your heart.

On a different subject: Where the heck is UNIX hater? This thread seems like would be perfect for him.

He's probably still writing up a post to save us all.

I work in this language daily. The obscure syntax for code golf makes the legacy code a real treat to sift through.

the only problem I've ever had from other people's legacy code is that they wrote code like they were running interactive commands in a terminal and the result was a few enormous (hundreds of lines) of a lot of system() commands and little to no abstraction.
language for sysadmins, so you get sysadmin code.
The language problems that I've run into from errors in my own code are more interesting. The worst, the fucking worst, was when I passed undef to a function expecting a hashref. This resulted in code that always forgot the first entry it was supposed to add to the hash, because the function expecting a hashref autovivified the undef it got, after failing silently to update it. madness.
Perl5 should've had more strictness options by now to turn off stuff like this. Instead perl6 resulted in p5p-porters jerking us around by adding and then removing features.

Tcl seems to be hated by the HN crowd, if you want to avoid them, that's certainly a positive.

You can check that kind of stuff yourself with ref(), for example:
ref($_[0]) eq "HASH" or die;
I've seen some modules do this, just to be sure the caller isn't going full retard.

Really? Why would they "hate" it?

Some arguments I've seen
news.ycombinator.com/item?id=14944103

And some more fag talk here: news.ycombinator.com/item?id=14941525

Lua is to-go embedded scripting language. It's not meant to be standalone.

I poo'd

Rubby has best syntax for me

No thanks, I want to keep my eyes.

Guile is the GNU approved scripting lang, else is heresy

based

List the files in a directory.

Here you go.
#!/usr/local/bin/guile -s!#(define dir (opendir "/path/to/your/shit"))(do ((entry (readdir dir) (readdir dir))) ((eof-object? entry)) (display entry)(newline))(closedir dir)

F#

guile is such an GNU/embarrassment
at least Emacs Lisp has the cl package

gnu.org/software/guile/docs/master/guile.html/POSIX.html#POSIX
These are just POSIX calls, guess they have to be braindamaged. Maybe there's a better way to do this. I would probably do this with a tail-recursive procedure, this is just an example from the manual.

user...
obviously guile is ultimately performing syscalls.
that's the filesystem interface given by the kernel to programs that run under it.
That syscalls are involved, and even that Guile wraps them rather thinly, has nothing at all to do with any of my objections.
Any other language you used would also use syscalls, and although many abstractions might appear (like DIRECTORY-FILES in Emacs Lisp), it's still possible to write low level code that at least definitely closes the directory handle, and at least lexically binds it.

Here's why Guile is a meme
(directory-files "/path/to/your/shit")

Shell Script is AWFUL language for ANYTHING just by performance alone, doesnt matter how "useful" it is, LUA has that bizarre bullshit to optimize the shit out of it

Lua is not an acronym ;)

Guile is really a typical Scheme. Starts out "minimal", then it turns out all the shit missing is actually useful, so it gets badly tacked on, fast forward ten years and the result is a turd. I guess being a GNU project and having its own army of braindead fanboys also did a big number.

Going to teach myself Tcl over the next couple of days. I have some simple tasks that are well suited to it, and will compare the Tcl solution with my Racket one.

Guile doesn't know what it wants to be. It started out as an embeddable language like Tcl, but turned into a standalone language like Python. I think at least part of the reason for this is the lack of a package manager, they had to include everything and the kitchen sink to make it possible to write portable useful scripts.

I'm still going to use it, it's a neat language, but for embedding there are better solutions. There is Tcl, Lua, and if you want to use a lisp there is Chibi Scheme and ECL (Embeddable Common Lisp).

Jesus christ it's like brainfuck but with words.

The only thing I can say for sure is that OP invested a lot of energy in learning sh and is letting his biases cloud his judgment.

Well, good luck. Also, there's an alternative interpreter called jimtcl if you want something small.

dont understand what is supposed to be so great about tcl. It looks like lua, just with worse syntax.

Also People using scripting languages that aren't sh for small scripts in my experience tend to try to reimplement everything in that scripting language, instead of using the language as glue. No idea why. You can call external programs (like sed, awk etc.) just as well from lua as you could from sh. I've seen it quite a few times by now.

The idea of having to call a host of separate programs like sed, awk etc is quite revolting to most people.

this was btw. not a shot at tcl, I'm genuinely curious why it's supposed to be good. redpill me on tcl

lol no it isn't

It clearly is, hence the invention of perl. How bad must things have been for people to actually want to use perl instead of sh scripts littered with calls to sed and awk. It's far more productive to have one good scripting language than several for each special snowflake case you come across.

The real plus of Tcl are:
* No keywords; everything (if, while, even proc) is a procedure that you can redefine yourself. Outside of twelve rules defining the language, nothing is set in stone.
* The whole concept of uplevel (execute code in the caller's context) is genius.
* Homoiconic.
* Everything is passed by value, with a lot of copy-on-write going on in the background. The way to pass by reference (upvar) is refreshingly simple compared to the usual stuff.
* Everything is a string, making serialization trivial.
* One of the cleanest and simplest syntaxes.
* Good (as in neither C nor Java/Python tier) amount of "batteries included" with some quality stuff like Tk or Expect.
* Very easy C Tcl interaction (yes, both sides).
* Channels and the builtin event loop makes networking/event handling easy as pie.
* Hacker community devoid of niggerfaggots; the "price" of unpopularity, I guess.
* Seamless handling of bigints.
* Actually quite fast since version 8.
* Explicit tailcall.
* Actual manpages, not some doc on a shitty javascript website.

The language is a bit like Scheme: one of the best playgrounds for autists obsessing over A E S T H E T I C S. The only bad thing is that the invaluable wiki is behind Cloudflare.

Julia

Fuck off.

I find that rc solves many of the inadequacies I've had with sh (posix or otherwise). Lua also solves many of those issues.

What a shit taste you have. sh is the only good scripting language.

Lua and js are great, get rekt.

Tcl/Tk


#!/usr/bin/tclshputs [join [lsort [glob -d $argv -tails *]] \n]

It's as slow as Perl.

4DOS was so much better than batch files.
4dos.info/

Attached: perl scripts done.jpg (600x425, 26.18K)