11K - /usr/bin/perl

11K - /usr/bin/perl
3.2M - /usr/bin/python2.7

For two languages that occupy a similar niche, why is the Python interpreter binary over 2 orders of magnitude larger than Perl's?

Both are modular, but does Python have many more built-in modules?

Other urls found in this thread:

madore.org/~david/programs/unlambda/
docs.python.org/3/library/os.html#os.system
perldoc.perl.org/functions/system.html
bugs.python.org/issue9334),

this isnt a browser thread, what are you doing OP

-rwxr-xr-x 1 root root 1825300 Dec 30 21:11 /usr/lib/libperl.so.5.22.1
/thread

:~$ ls -lh /usr/bin/perl5.20.2-rwxr-xr-x 2 root root 11K May 3 2015 /usr/bin/perl5.20.2
I should probably update one of these days...

import antigravity

>>>/oven/

% ls -lh /usr/bin/perl /usr/lib64/libperl.so.5.20.2 /usr/bin/python3.4 /usr/lib64/libpython3.4.so.1.0 /usr/bin/ruby21 /usr/lib64/libruby21.so.2.1.0 /usr/bin/lua /usr/lib64/liblua.so.5.1.5 /usr/bin/luajit-2.0.4 /usr/lib64/libluajit-5.1.so.2.0.4-rwxr-xr-x 1 root root 10K 3. Feb 20:53 /usr/bin/perl-rwxr-xr-x 1 root root 11K 5. Feb 17:16 /usr/bin/python3.4-rwxr-xr-x 1 root root 6,1K 10. Nov 13:49 /usr/bin/ruby21-rwxr-xr-x 1 root root 15K 26. Feb 09:18 /usr/bin/lua-rwxr-xr-x 1 root root 443K 7. Jan 16:50 /usr/bin/luajit-2.0.4-rwxr-xr-x 1 root root 1,7M 3. Feb 20:53 /usr/lib64/libperl.so.5.20.2-r-xr-xr-x 1 root root 2,5M 5. Feb 17:16 /usr/lib64/libpython3.4.so.1.0-rwxr-xr-x 1 root root 2,4M 10. Nov 13:49 /usr/lib64/libruby21.so.2.1.0-rwxr-xr-x 1 root root 184K 26. Feb 09:18 /usr/lib64/liblua.so.5.1.5-rwxr-xr-x 1 root root 448K 7. Jan 16:50 /usr/lib64/libluajit-5.1.so.2.0.4
(luajit is a statically compiled executable for some reason on Gentoo)

You're out of your fucking mind if you thought the python parser, interpreter, bytecode compiler, and virtual machine, as well as all static functionality, could fit in any 11K binary. That would be fucking ludicrous. That's an order of magnitude smaller than liblua.

I think we need the assembly squad to fix this bloat

this

We need someone to re-write the whole GNU userspace in Assembly so I can save 5 more pictures of Chinese cartoon girls.

Perl is actually pretty huge. will eat around 20MiB last I checked. It's why distros (the real ones people who do things use) switched to a minimal install of python for scripts as it can fit in 4MiB.

Don't act as if this wasn't just as retarded and cancerous.

`file` reports that my Python2.7 (3.2M) is dynamically linked.

Which one language has more popularity among SJW?

lua

JS, the language Mozilla is pushing as if their life depended on it because they do

javascript

So Stephen Lynx is an SJW?

what? sjws love js, python and that is about it maybe ruby

what? sjws love js, python and that is about it maybe ruby

what? sjws love js, python and that is about it maybe ruby

what's the least bloated language?

That's not how it works.

Unlambda: madore.org/~david/programs/unlambda/

Assembly. You can also get close with C but you really have to know your shit to micro-optimize C.

Huh.

-rwxr-xr-x 1 root root 6.7K Apr 11 22:45 /usr/bin/perl-rwxr-xr-x 1 root root 2.0M Apr 11 22:45 /usr/lib/libperl.so.5.22.1-rwxr-xr-x 1 root root 6.4K Apr 12 13:50 /usr/bin/python3.5m-r-xr-xr-x 1 root root 2.9M Apr 12 13:50 /usr/lib/libpython3.5m.so.1.0-rwxr-xr-x 1 root root 5.1K Apr 12 17:34 /usr/bin/ruby23-rwxr-xr-x 1 root root 2.6M Apr 12 17:34 /usr/lib/libruby23.so.2.3.0-rwxr-xr-x 1 root root 525K Apr 11 21:15 /usr/bin/luajit-2.0.4-rwxr-xr-x 1 root root 526K Apr 11 21:15 /usr/lib/libluajit-5.1.so.2.0.4

(Using musl on Hardened Gentoo)

What CFLAGS are you using?

What CFLAGS SJW uses?

i really, really dont want to have to learn perl, are there really no other options?

Thanks for your user ID's suckers.

...

Suck it up


wat?

...

I used to hate it until I found how convenient it can be. Now it's one of my most used languages. Here's one of the things that made me pick it up:
for (@array) { do-thing;}#Is the same as:do-thing for (@array);

Wait, is that liek:

(loop for shitfuck in dicknipples do (nigger-thing))

Also, can I debug and re-write perl while it's running?

for (@array) { do-thing($_);}#Is the same asfor $x in @array { do-thing($x);}#$_ is an automatically defined variable to make things a bit easier.#This still works as well:for (my $x = 0; $x < 10; $x++) { do-thing($array[$x]);}

`perl -d file.perl` is the debugger. I haven't used it much, so I don't know if it's any good. Perl isn't compiled, so you shouldn't have issues with fixing and debugging at the same time

so... we're talking about efficiently processing lists...
Gee, I sure with there was some sort of well developed... LIST PROCESSING... language that existed. :^)

Racket's the only language I use more than perl. I made pic related in it.

Perl's real advantages involve text manipulation. Any code written in double quotes is replaced with what it evaluates to, so "Your answer is $random" is a valid way to display a value. You can also import the contents of a file into an array with @array = ; so that each line is a value in the array. It's little things like that which make it fun to work with.

Is this a flag to express how much of a faggot you are

The point I'm making is that literally everything you want to do you can probably do better in Common Lisp.

In terms of programming I agree. Outside of that there are still reasons to learn perl

>SJW proof Not that CL isn't, but they're taking over Clojure's community

Sometimes you can't use Lisp. I've worked in groups with people who find Lisp hard, and perl is a nice compromise.

So how about fuck them in the neck with a rake?

(if (handles-lisp? normie) (display "reeeeeee") (fuck normie rake))

Hey I actually like ARM assembly fgts.

(defvar ree (list))
(loop
(setf ree (append ree (list "REEEEE")))
(write-line ree))

Well now I just feel like an asshole.
For god's sake don't run this if you fix the error.

i dont want to though


seems pointless to me
also i really hate bullshit symbols in my languages

Perl's just so handy for everything, it's a no-nonsense language that just lets you write whatever you want to write.
My only peeve with it is when you're looking for a library to do something simple like an SNMP get, and it should be a 1 liner, except for the fact that Net::SNMP is OO only. So I end up settling for qx(snmpget), because it turns out that's pretty much all the module does anyways.


No one's forcing you to use $_, you can always do it longform with the 'for $i (@array) { something $i; }'

i mean i dont want $i or @array at all

Well, I guess most functions default to using $_ if you don't specify, but you're going to have a hard time with any language

i want variables, i dont want daft sytax denoting exactly what kind of variable they are. essentially i want a better supported python.

Variable typing in perl is quite important, data contexts are very useful. So the [[email protected]%] is a lot more than just a label.

Same goes for assembly. You'd be surprised how difficult it is to beat the C compiler. You really do need to not only learn the language, but learn how CPUs work to a decent level. You can't write fast code in assembly without knowing your shit, it's not some default that comes with having written in assembly.


Thought you were going to say something like
@array = (1, 2, 3);for my $elem (@array) { $elem *= 2;}print "@array\n"; # prints 2 4 6

It's not as bad as you'd think.

please explain it to me then, because im clearly retarded and am missing out on something


its still pretty bad

If I access an array in scalar context ($array) it gives me the length of the array.
If I access an array in hash context, it creates a hash using the even numbers as keys, and the odds as data:
%hash = @array[1,4,6,7]
becomes (1 => 4, 6 => 7)
Some functions return different values depending on what context they're being accessed as.

And so on. Perl lets you do whatever you want with your variables, that's why you have to tell it what you're doing.

but for what purpose?

Different user, but I think where he's going with this is something along the lines of being able to ask this array what it's length is and then be able to ask it something else, but still be using the same exact variable.
I might be totally wrong on that, though.

Yeah it's a simple thing but like "return X if Y" too.

What you've said is true, but the example variable access you've given is wrong.

The code here is *almost* correct (you've confused indices and value in your array), but the sentence is not. There is no such thing as hash context, hashes are assigned in list context (just as arrays are).
A good example for that is "localtime". If you call it in list context you get a list corresponding to various components of the current date/time, while in scalar context you get a nicely formatted date/time string according to the user's locale.

To add to the confusion...

These constructs are all using the variable $var in some way (definitely not an exhaustive list):
1. $var
2. ${var}
3. ${"var"}
4. $$var
5. @$var
6. &$var
7. $var->[4]
8. $var->(qw/hello world/, pork => 'beans')

#1, #2: just the contents of $var
#3: the contents of $var but using a string to refer to it (not allowed in "use strict 'refs'")
#4: dereferencing a reference to a scalar held inside $var
#5: same for an array ref
#6 same for a subroutine ref
#7: accessing the 5th element of the array whose reference is held inside $var
#8: calling the subroutine whose reference is held inside $var

These are all using @var in some way:
1. @var
2. @var[1..4]
3. $var[2]
4. $var[2][2]

#1 in scalar context: length of the array @var
#1 in list context: the contents of the array @var
#2: the second to fifth elements of the array @var
#3: the third element of the array @var (the sigil changes to $ because it's now a single value, rather than a list)
#4: the third element of the array whose reference is held in the third element of the array @var

These are all using %var in some way:
1. %var
2. %var{4}
3. %var{'the', 'quick', 'brown', 'fox'}
4. @var{4}
5. @var{'the', 'quick', 'brown', 'fox'}
6. $var{4}
7. $var{4}[4]{4}->(4)

#1 in list context: the contents of the hash %var, values following their respective keys, but otherwise in an unspecified order
#1 in scalar context: a string representing how much of %var is used, and how much space has been allocated to it.
#2: the key and value corresponding to the key "4" in the hash
#3: the keys and values asked for (keys in the order specified, values immediately after their keys). i.e. the same as ('the', $var{the}, 'quick', $var{quick}, 'brown', $var{brown}, 'fox', $var{fox})
#4: same as #2, but without the key. It's still a list though.
#5: same as #3, but without the keys
#6: same as #2, but without the key
#7: calling the subroutine referenced by the element at "4" in the hash referenced by the 5th element in the array referenced by the element at "4" in %var

Such a great language, I have no idea why everyone fled for python the moment it was viable.

yeah, but its not really that big of a deal

whoops

Yes, I should really stop trying to make informative posts while drunk.

Python also x10 slower than Perl.

Fuck that noise I'm sticking with python.

Ruby (hipster RoR bandwagon)
Rust (literally developed by SJWs)

Both have their use cases.

Sage this thread because it amounts to pointless bikesheeeeiting. You should be programming.

smh tbh fam

Perl is a pleasure to use if you're using it right.

Compare a short script to keep a MRU list with counts up to date:
#!/usr/bin/env perluse strict;use warnings;use Errno "ENOENT";my ($mru_cache, $command) = @ARGV;my $found = 0;open(my $cache_w, ">", "$mru_cache.new") or die "Could not write new cache: $!";if (open(my $cache, "

There are advantages perl has over python above and beyond just terseness though:
- Perl is a wiser choice for web servers and such, because it supports more than one thread running simultaneously, while Python does not. This means if you got an expensive 64-core server-grade CPU, you will have to do some nasty hacks to let Python actually use it.
- Perl has a taint tracking mode, where it will throw an error if any unsanitized user input makes its way into potentially dangerous functions. Python has no such thing, you're on your own. While it can be argued that you shouldn't need a crutch like this, I'd argue that any help improving security in a script should be welcomed, because the alternative is letting people make silly mistakes and get rooted because of it.
- Perl's documentation makes python's look like a joke. Check out "perldoc perlfaq", or "perldoc perlsec", or "perldoc perldebtut". Python relies on you searching the web and finding contradictory blog posts on those topics instead. Also compare Python's documentation for "os.system" docs.python.org/3/library/os.html#os.system with perl's documentation for "system": perldoc.perl.org/functions/system.html
- Perl tries to mitigate algorithmic complexity attacks in its data structures (and succeeds). Python is still affected by these attacks; the python devs decided to leave python vulnerable to these attacks because the solution wasn't a theoretically perfect prevention of the attacks. I have no idea how they justify that to themselves. It's almost as bad as the current HTTP/HTTPS situation in popular browsers, where your browser sometimes tries to convince you an encrypted connection is less secure than an unencrypted one.
- The python devs write fucked up broken core modules like argparse and shlex, then deprecate the modules that work (optparse), then never fix the bugs they create. The behavior of "--" has been broken in argparse forever (bugs.python.org/issue9334), which has security implications for anything that wants to pass user input as arguments to python scripts using these broken modules. Perl on the other hand has very well tested packages, and its CPAN (equivalent to PyPi) has a very large variety of packages. The CPAN also lets you rate modules and rate their compatibility with your operating system, so you can see at a glance if it's a good or bad module.
- Perl has NYTProf, which makes profiling your code almost tolerable. Python has cProfile and line_profiler, which will make you want to gouge your eyeballs out with spoons. Python's profiling tools tell you fucking nothing until you make invasive changes to your code to accomodate them, at which point they provide just enough information for you to find another function you forgot to explicitly enable profiling on.
- Perl starts up faster than python and runs faster than python in nearly all cases.
- Perl has string interpolation and some very nice shorthand operators like "qw". You can run it without strict mode to allow you to take some more shortcuts. By comparison it makes python feel like a bondage-and-discipline programming language.
- Perl has anonymous subroutines that aren't completely crippled like Python's lambda.
- Perl has a 'do' operator, which lets you use statements within an expression (usually for scoping reasons or loop conditions). You'll know when you want this, and it's a godsend.
- The python community is full of the "omg import antigravity make apping fun again dae hear about python from xkcd" crowd. This thread even has a glimpse of that. Perl has no such insufferable cult following.
- On the flipside of that coin, people poke fun at perl for being "ugly", but that's the biggest problem they have with it. It's never something substantial like broken features or poor security or awful performance (all of which I could attribute to Python in some capacity or other). Consider what that says about the language, and consider what it says about the people who complain about it.

Doesn't python have some kind of threading library that can handle multithreading?

It can do threading, but the GIL means that only one thread can actually be executing at a time.

oh, ok, I didn't know that.
I don't have a whole lot of skill points in python.

Someone explain why Python 2.7 is still so widely in use. It always fails due to codepage problems, unless you always work with ascii and english system. 3.5 on the other hand just works and feels little less hack
.

How ironic it is that the language SJW like the most was created by a guy who hates faggots (Brendan Eich) and was brought into the mainstream by a guy that wrote a tool which tells you upfront that it will hurt your feelings anf there's nothing you can do about it but git gud at it (Douglas Crockford).

In theory, that's nice. In practice, programmers trip upon having too many choices about how to do something (like people declaring int variables when long is available, and then getting in trouble because the int variable was overflowed), so it ends up being harmful.