5 ms·
I tend to find that Go is so multi-paradigm that it fits all my use cases well. It's a perfect high and low level language, fits entirely in your head, has dece
by bwarp 15y ago
I tend to find that Go is so multi-paradigm that it fits all my use cases well. It's a perfect high and low level language, fits entirely in your head, has decent testing support, scales code-quantity wise very well and is very fast.
It traditionally replaces all the areas I'd use Python, C# and C beforehand.
I see less requirement for "picking a language for the job" thanks to this.
It only sucks as a shell scripting language for which I use sh.
- MatthewPhillips 15y agoAre there any "real languages" that don't suck at shell scripting? I use node in client side code but glue things together with bash.
- bwarp 15y agoI've not found one yet! If anyone has any suggestions I'd love to know.
- singular 15y agoI have to say that I've found go to actually be pretty awesome as a scripting language, though I've not used it a lot for this purpose a lot myself. The type inference + straight-forward standard library helps a lot with it.
- brlewis 15y agoI've heard that scsh (The Scheme Shell) is good, but haven't tried it myself. Even though my web app is written in Scheme, I still have a few bash scripts.
- docgnome 15y agoI think chicken scheme is even nicer for that kinna stuff.
- irahul 15y agoIt depends on your definition of real language. I consider Ruby and Perl to be real, production level language, and they are both excellent as glue languages. Python, on the other hand, would need some helper functions to make the interface intuitive. But you only need to define them once, and then off you go.
- WalterBright 15y agoD seems to work rather well as a scripting language. http://dlang.org/rdmd.html Note the first line of the D "shell script": #!/usr/bin/rdmd
- bwarp 15y agoIt is statically typed and non interactive. I'm not sure I could get on with that as a scripting language.
- fabricode 15y agoYes: Perl. This was the original use case for the language. We used to have to glue together sh, awk, sed, grep, CLIs (custom C), etc in order to automate anything in Unix. Perl brought all of this functionality under one roof with a simple, coherent interface. Most every complaint I read about Perl (too flexible, weird sigils) is a direct reflection of the system it was replacing. It's funny to read how people love that there's more than one way to do just about anything in Linux, but gasp that there are too many ways to do equivalent actions within Perl. They're one in the same. (I am not going to re-re-address its "readonly" nature since that's a red herring which applies to any language.)
- bwarp 15y agoI used perl for about 5 years for general scripting tasks. It's not about there being too many ways to do something for me, it's that you need to know the subtlety of each one and cryptic abbreviations.
- jleader 15y agoRegarding "cryptic abbreviations", do you know about "use English;"? It provides readable names for all the "ugly punctuation variables". It's included as part of the core Perl install. http://perldoc.perl.org/English.html http://perldoc.perl.org/English.html
- bwarp 15y agouse English in itself is a sign of much turdyness.
- fabricode 15y agoIn probably 99% of Perl code, you only need to know two cryptic symbols: $! for errno and $? for child-process exit status. And if you're programming in shell now, you're already using $?. Yes, there are symbols for handling autoflush on handles, input/output record separators, etc. But rarely will you need to use these items. In fact, we have methods for handling these situations for quite some time now. For instance, to unbuffer your output you'd use $|, but now you just use $filehandle->autoflush(1). Another example would be undefining the input record separator so that you could pull in an entire file with one read, but now that's handled via Slurp::slurp_file.
- pjmlp 15y agoActually I think that Go is exactly lacking lots of paradigms and is only good enough for people looking for a better C, as it lacks many of the abstractions from mainstream languages. But if you are conformable with it, by all means use it.
- bwarp 15y agoWhat abstractions in particular? I'm interested from the perspective of resolving any issues in that space.
- pjmlp 15y agoThe following concepts are lacking: - generics - enumerations (the iota thing feels like a poor man's enums) - operators as method names - lack of exceptions leads sometimes to ugly defer/recover patterns - some data types are special like maps, as you cannot implement similar types yourself