[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Python, Ruby, or Perl? What's the better scripting language?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 91
Thread images: 14
Python, Ruby, or Perl?

What's the better scripting language?
>>
php
>>
Ocaml
>>
JavaScript (ES6), Lua, or a Lisp variant.
>>
>>53147595
PowerShell, works on the largest OS install in the world.
>>
awk
>>
>>53147595
BASH
>>
Lua
>>
>>53147595
When it comes to comparing Python and Ruby I compare their philosophy behind the langague than itself. It really helps to narrow down an answer.
>>
Lua
>>53147618
>>53147722
>>
Hasn't python supplanted ruby now?
For some tasks, Perl is ideal but for most general scripting, python would be better.

I love perl too so it kills me to say so.
>>
gLua
>>
Angelscript
>>
Scala.
>>
File: 062.gif (1 MB, 305x239) Image search: [Google]
062.gif
1 MB, 305x239
>>53147595
Stop being a bitch and learn C
>>
>>53147740

Please explain what you see as the differences in their philosophy.
>>
>>53148050
But I'm already learning C++.
>>
>>53147595
sh
>>
what are you fucking trying to accomplish OP? languages are just tools, you aren't going to use a screw driver when you are given a nail

javascript: dom manipulation, slowish graphics and audio manipulation in browser

C/C++: fast graphics and computation in general, beginners prone to memory management bugs so learn to allocate/deallocate. Generally low assurance

Java: Big company/enterprise horseshit, good for impressing mediocre mid level management types

haskell: functional, requires less lines to do the same thing as imperative but requires a change in thinking (there are no loops in haskell). You can extract to Isabelle for formal proofs to give some assurances.

AGDA: a theorem prover and haskell mixed together: this is where you absolutely need to prove your program works before running it. This is slightly experimental but where programming will go in the next decades.

etc.
>>
>>53147595
Lua, Guile
>>
File: tip.png (114 KB, 320x263) Image search: [Google]
tip.png
114 KB, 320x263
>Lisp
>>
Scripting languages are all garbage and are no longer necessary now that GC'd statically-typed languages with generics and type inference and no header files are basically mainstream.
>>
>>53148370
this
muh D

fuck type inference tho
>>
>>53148370

embedded environments need them, not everything is a server.
>>
File: 1410677842363.png (13 KB, 530x492) Image search: [Google]
1410677842363.png
13 KB, 530x492
javascript
>>
all considered harmful.
us this >>53147692
>>
>>53148562

what does harmfull mean in this context?
>>
>>53148619
"neurotypical"
>>
File: 1449425479264.jpg (93 KB, 755x696) Image search: [Google]
1449425479264.jpg
93 KB, 755x696
LISP is the best scripting language

>>53148395
>fuck type inference
>>
>>53148650
>neurotypical

thanks i learnt a word.

from wikipedia ...

"refers to anyone who does not have any developmental disabilities such as autism, dyslexia, developmental coordination disorder, or ADHD."

so you're saying those languages are harmfull because they're *not* autistic???? i confess to being somewhat baffled.
>>
>>53147595
Python.

Perl is garbage and ruby is nothing outside of rails.

Python is clean enough and its popularity ensures that someone has probably already solved your problem.
>>
>2016
>Using any language except JavaScript

I SERIOUSLY hope you guys don't do this.
>>
>>53148562
>Worse is better
The worst meme.
>>
>>53148562
>recommends go
>D considered harmful
ROB PIKE PLS GO
>>
I am new to learning languages, only about a year in. I currently work at a tier IV data center. the back end we usually use is perl around here. I have not learned perl yet but everyone tells me its worth the learn. currently I only know PHP and Python for scripting
>>
>>53148776
Sssssssllllllooooooooowwwwwwaaaaahhhh
>>
>>53148839
Isn't there some sort of privacy problem with Javascript or whatever? Why is it disabled in Tails?
>>
>>53148050
>make scripts in C
>>
>>53148562
>How to not have a job, the post
>>
>>53147595
Python
>>
It's all the same shit desu. If you want something different, try Tcl or Lua. Those two are designed specifically for embedding into C.
I'm still using Perl 5 because it's what I learned in the 90's and it just works.
>>
Perl over python
>>
>>53148776
Perl.

Python is garbage and ruby is nothing outside of rails.

Perl is clean enough and its CPAN ensures that someone has already solved your problem.
>>
>op gives you three choices
>no one picks any of them
/g/ everyone.
>>
Python.
>Perl
Obsolete shitty write-only shell knock-off.
>Ruby
Python made worse and slower by some Japanese idiot.
>>
>>53147595
Python
>>
>>53148562
>iSCSI, FCoE
>Instead use AoE

You're kidding, right?
>>
>>53148210
>beginners prone to memory management bugs
Everyone is prone to bugs. Pros just make more subtle ones.
>>
tcl
>>
>>53147595
es6 bruh
>>
Perl makes me wet but it's such an ugly language.
>>
>>53147595
>perl
>posting a fucking coal-burner

2/10 - low-tier b8
>>
Of the three I'd go for Python. I use R with functions in C++ via Rcpp where it makes sense to do so, but that's for my specific use case.
>>
>>53147646
And Kimoji is the app generating the largest app download traffic in the world.
>>
File: 1451102178534.webm (2 MB, 640x640) Image search: [Google]
1451102178534.webm
2 MB, 640x640
>>53147646
>PowerShell, works on the largest OS install in the world.
That statement wouldn't even be true if Windows had the biggest installation base, since PowerShell isn't preinstalled on most Windows systems. Until this is the case the only scripting language broadly supported by Windows remains to be Batch script.
>>
File: IMG_0289.jpg (2 MB, 3888x2592) Image search: [Google]
IMG_0289.jpg
2 MB, 3888x2592
Microsoft BASIC, because it runs on everything.
>>
>>53148210
Did you even read the question you fucking autist?
>>
>>53147740
>Python
>Ruby
>philosophy
>>
>>53155531
>read the question
what, is this not /g/ anymore?
>>
>>53148210
I cant wrap my head around the no loop idea in haskell , how do you iterate through something
>>
>>53155759
the function processes the head, and passes the tail to itself
>>
>>53147595
>Python
Widely supported, easy to get into. Horrible syntax that makes it very easy to slip in errors. Barely any sanity checking or error testing. Lots of available resources and libraries that will make your life easier.

>Ruby
Not as widely supported, lots of homebrew or mish-mash syntax. Slightly more rigorous than python, but only barely. Very malleable.

>Perl
Extremely scripting-oriented, contains shittons of tools, operators and keywords for every string-related situation you could possibly encounter. High amounts of syntactical noise and special cases / keywords. Hard to read for the uninitiated. Runs everywhere and widely supported.

I'd say perl is the classic sysadmin's scripting tool, but python is quickly growing to replace it among younger audiences who are finding perl inpenetrable and not worth getting into.

Ruby doesn't really seem to have a widespread market share among scripting languages, though some people swear by it. It might be a decent middle ground.
>>
>>53148700
>thatsthejoke.jpg
>>
Nodejs (JavaScript)
>>
>>53155759
Say you want to print each element of a list separately to the terminal (in different lines).

You would write something like
mapM print myList
, which is just a shorthand form of saying
sequence (map print myList)
.

‘map’ takes a function and maps it over a list, and ‘sequence’ takes a list of IO actions and combines them to one bigger IO action. (The IO action thing is an abstraction haskell uses to avoid side effects)

Also, when people say
>haskell has no loops
They're just dirty liars. Haskell has no _control flow_, but it does have loops: recursion.

That's how stuff like ‘maps’, which seemingly requires a loop to work, actually works. It recurses its way through the list.

And as anybody with even the barest of functional programming experience could tell you, you can implement any loop as a tail-recursive function call instead.
>>
>>53155007
define "largest"

GNU/Linux is the most widely deployed OS in the world.

M$ is the largest if you mean bloated with crapware and low rent trash.
>plus spyware
>>
File: adventureStarWars.jpg (399 KB, 1920x1080) Image search: [Google]
adventureStarWars.jpg
399 KB, 1920x1080
>>53147595
GUILE then BASH with the POSIX tools (awk,sed,grep,xargs, cut,cp,cat,wc,etc. etc.)
>>
File: bladerunner.jpg (976 KB, 3543x2324) Image search: [Google]
bladerunner.jpg
976 KB, 3543x2324
>>53156034
Plus stop being a bitch and learn C
>use C and "glue" it with Guile and BASH
>BASH = POSIX
>>
>>53147595
perl master race reporting in
>>
>>53153185
>Perl is clean enough

>perl
>clean
>>
>>53148081
>considering c and cpp the same

anon don't trigger me again with this shit, we talked about this already
>>
Perl 6 is the Haskell of scripting languages, it only needs more modules...
>>
>>53157022
>Perl 6 is the Haskell of scripting languages
It's pure, functional and nonstrict and has a strong static, turing complete type system?
>>
>>53156121
If they weren't cia niggers they would just write a fucking compiler that lets you write C code in the shell and run it.
I bet they can't even write a fucking compiler.
>>
>>53156955
perl -le 'print qw(Cleaner than yo mama!)'
>>
>>53157173
No, but it has more funky dank operators than you can shake a stick at.
>>
>>53148050
>>53151481

not saying one should script in C, but one defnetly could...

http://stackoverflow.com/questions/584714/is-there-an-interpreter-for-c
>>
>>53157173
it's multiparadigm and have gradual typing
>>
File: faye-dunaway.jpg (93 KB, 430x594) Image search: [Google]
faye-dunaway.jpg
93 KB, 430x594
>>53157337
You can run C in shell using GDB if you attach to something running or just use: CINT
also
igcc, ccons, or c-repl
>>
>>53148562
>don't use HTTP
>uses HTTP himself

White people are always the biggest hypocrites.
>>
>>53157559
I hate racism.
And niggers.
Now GTFO
>>
File: Jeb.png (314 KB, 500x500) Image search: [Google]
Jeb.png
314 KB, 500x500
>>53157505
better off scripting with SBCL (Common Lisp)
you can call Python Native Code Compiler if that makes you feel better.
>CMUCL also named the native compiler Python
>>
Tcl. None of the bigger languages interest me and I seem to be just as productive in Tcl as in the others. Also, Tk is a godsend for GUI design, which always struck me as a horrid chore, yet feels so simple in this framework.
>>
post more riley
>>
File: lisp.png (341 KB, 500x500) Image search: [Google]
lisp.png
341 KB, 500x500
>>53157588
#!/usr/local/bin/sbcl --script
(write-line "Hello, World!")

$ ./hello.lisp
Hello, World!

>just tell people it is python
>>
>>53157588
Both CL and Python regex sucks. I do use CHICKEN for some NLP stuff though.
>>
File: good_work.png (95 KB, 1347x564) Image search: [Google]
good_work.png
95 KB, 1347x564
>>53147595
import json
import urllib2 as ulib
from matplotlib import pyplot as plt


def get_thread(borad, tnum):
api_lol = 'https://a.4cdn.org/{}/thread/{}.json'.format(borad, tnum)
raw = ulib.urlopen(api_lol).read()
return json.loads(raw)


counts = {'python': 0,
'ruby': 0,
'perl': 0,}

thread = get_thread('g', 53147595)
posts_on_topic = 0
for post in thread[u'posts']:


for k in counts.keys():
lang_ref = k in post[u'com']
counts[k] += int(lang_ref)

if lang_ref == True:
posts_on_topic += 1

print 'A total of {} posts, with {} posts on topic'.format(
len(thread[u'posts']), posts_on_topic)

X = counts.keys()
Y = [counts[x] for x in X]

plt.bar(xrange(3), Y, 0.5)
plt.xlabel('Language')
plt.ylabel('References in thread')
plt.title('well done, /g/')
plt.xticks([i + 0.25 for i in xrange(3)], X)

plt.show()
>>
>>53147595
Perl desu
>>
>>53148867
DON'T YOU MEAN BEST MAYMAY?
>>
Nodejs
>>
>>53147595
The answer is objectively python.
Even php exists largely due to entropy.
Thread replies: 91
Thread images: 14

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.