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

Perl

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 151
Thread images: 9

File: 1487842502425.png (14KB, 800x247px) Image search: [Google]
1487842502425.png
14KB, 800x247px
What is your opinion on Perl?
Is there any reason to learn it over Python nowadays?
>>
>>61302365
>Is there any reason to learn it over Python nowadays?
You want to embed an interpreter in your program but want more than one instance and these instances should be properly separated, not some shitty hack.
>>
>>61302365
>Is there any reason to learn it over Python nowadays?
Some shitty, exotic typesetting softwares uses lots of it.
>>
>>61302396
>>61302411
So there's pretty much no reason?
I thought Perl was faster to write and better for Unix scripting.
>>
Perl isn't slow as fuck and it's more readable for shell scripting or other simple scripts.
>>
>>61302365
2hard4me
>>
>>61302365

A while ago I did a comparison between Python Ruby and Perl for fun. Basically I just wrote some simple "/g/ coding challenges" projects in all languages.

While I'm totally sold on Ruby (as it's really beautiful) and I also think it's great to know some Python (since it's simple and has so many applications nowadays, it's literally everywhere).
But I was really surprised that Perl felt so great to code with. It's syntax is super funky and you have so many ways to let Perl take care of something, if you want to. It also has this air of being an oldschool hacker language. All in all Perl was a very pleasant surprise. A lot of cool gimmicks you have in Ruby are somehow inspired by Perl.

I wouldn't change from Ruby to Perl as my main language, but maybe I'll take a few weeks and get into in in the future. And if someone would ask me to do a Perl project, I'd totally do it just because of the coolness or Perl (even it CAN be less readable than Ruby or Python).

print (($_%3 ? "" : Fizz) . ($_%5 ? "" : Buzz) or $_) for 1..100
>>
Perl is just fun to program with. It was designed by a linguist and it shows. If you're looking for a job it's probably a better idea to focus on Python or Ruby though.
>>
>>61303860
say "Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for 1..100

get on my level
>>
>What is your opinion on Perl?
It's one of the few programming languages that requires a degree of actual study to be able to read due to its large count of special variables and the way it uniquely handles a lot of things.

>Is there any reason to learn it over Python nowadays?
Faster
More efficient
Way better for text parsing and manipulation
Easier to write for in my opinion
and >>61302396
>>
>>61302637
>Perl isn't slow as fuck

It is though.
>>
>>61304166
It's a good deal faster than both Ruby and Python, except for heavy number-crunching applications because nobody ever wrote the equivalent of cython for it (which honestly shouldnt even count as "python" at that point)
>>
>>61304016
>looking for a job
Don't most sysadmins and netadmins use Perl?
It's also pretty popular in the security field.
>>
>>61302365
>What is your opinion on Perl?

its syntax is inherently better than bash and a lot of the utilities you use with bash are built into the language (awk sed grep etc), it's great to know bash, sed, awk, grep, and the coreutils, etc, but sometimes you just want to do something in a hacky tiny script without having to piss about with a shitty syntax (bash or python for instance), if it weren't a dirty quick hack it wouldn't be in bash, perl, or arguably even python to begin with, so when it has to be a dirty hack why not do it in arguably the best language for it? if I had to sum up the biggest benefit of perl it's that if you're writing something new or original and it's only ever going to be a small hack (say, <250 lines in one file with sparring use of external libraries) it's super nice to use perl

the drawbacks are that cpan is shit and everything written for it is generally ancient and irrelevant now(hence writing stuff yourself), perl6 isn't even remotely close to perl5 (or even mainstream) and that if you have to maintain someone's perl code that was written without 'use warnings' or 'use strict' you're going to want to off yourself

python is always useful to know and it's popularity is going through the roof, perl on the other hand, like bash, is situational and it depends on your scenario if you should even consider learning it, but if you know python you basically know enough to pick perl/bash up in a week so why not also learn a bit of perl and save yourself the hassle of having to really learn bash and the coreutils

besides, perl is the best language to do regex in and every other language with decent regex is using perl's method

>>61302548
>I thought Perl was faster to write and better for Unix scripting.

it is

>>61303860
>While I'm totally sold on Ruby

ruby is a decent contender as well, and both ruby and python do external package managers far better than perl
>>
>>61304035

Hah, I'm not on that level, but nice code though..
>>
>>61304258
>Don't most sysadmins and netadmins use Perl?

older shops will probably have a lot of perl, yes, but nobody is hiring perl developers, they're hiring sysadmins with experience in perl and something else(usually ruby/python, but python more so these days) so they can get you to rewrite all their legacy perl shit in something far more maintainable for new hires that don't know the language

most new development isn't going to be in perl and most medium-large projects aren't going to be in perl either, it's nice to know perl incidentally but don't learn it to be employable

>It's also pretty popular in the security field.

yeah but if you're any good in that field you should know at least the basics of most major popular languages in use
>>
>>61304451
>don't learn it to be employable
I met a sysadmin once who didn't seem to be older than 35 at most yet only knew Perl and bash for scripting (not Python, nor Ruby). So are popular scripting languages really a must?
>the basics of most major popular languages in use
Java, C++, Python?
I meant Perl was popular in infosec as in, it's used for a lot of network security tools for example.
>>
>>61304451

Well, Solo hacked the US defense forces and NASA with some Perl scripts. So it's definately good enough.

For Ruby there is Metasploit.

For Python there are other frameworks.


At the end of the day each scripting language can do everything. Similar to Java, C# and C++: 90% of all the software written with it could be done with one of the others without problems.
>>
If Perl is faster why dont we have frameworks like Jango made on it?
What is a example of a popular software made on Perl?
>>
>>61304690

>why dont we have frameworks like Jango made on it?

Catalyst
Mojolicious
Mason
Dancer
Squatting
Jifty
CGI::App
(...)
>>
>>61304690
Perl isn't noticeably faster and if you're looking for a web framework in Perl there's Catalyst.

There's really no good reason to use Perl over Python these days. Perl and Ruby are dying and Javascript and Python will be the last dynamically typed languages to ever become popular.
>>
>>61304741
>Perl and Ruby are dying and Javascript and Python will be the last dynamically typed languages to ever become popular.
Is this a bad or a good thing?
>>
>>61304767
It will only truly be great when Javascript and Python die.
>>
>>61304741
>>61304799
What will replace them?
Also, so many shit is written in Perl I have a hard time believing it'll ever truly die. It's called the duct tape of the Internet for a reason.
>>
>>61304741

>Perl and Ruby are dying

Nah, not true.

Perl kinda "was" dying, because a decade ago a lot of Perl hackers changed to either to Python or Ruby. So the community is not that big anymore. But it won't shrink any further and will ways have it's (niche) place. The last few years they are even recovering:

>https://www.tiobe.com/tiobe-index/perl/


As for Ruby, I don't know why people are repeating this meme. Ruby is pretty alive and almost as big as on it's prime. And in a few years Ruby3 is coming, which will be great. For python there is nothing announced, AFAIK?

The only downside is Ruby is pretty much cneterd about Rails. You'll find about 100 Python Jobs, which are 20 Security Jobs, 20 SysAdmin Jobs, 20 Data Science Jobs and 40 WebDev Jobs. For Ruby you'll find 50 Jobs, with 40 Rails jobs and maybe 10 others.

See:
>https://www.tiobe.com/tiobe-index/ruby/


Also let's not forget that Python isn't really "growing" anymore:
>https://www.tiobe.com/tiobe-index/python/

The only things that's growing is Go and maybe Swift.


Here are some numbers:

Python: 43,916 Jobs
Django: 1,866 Jobs

Perl: 15,421 Jobs

Ruby: 13,120 Jobs
Rails: 15,824 Jobs

See:
>https://www.indeed.com/q-Python-jobs.html
>https://www.indeed.com/q-Perl-jobs.html
>https://www.indeed.com/q-Ruby-jobs.html
>>
>>61304882


You can also find this trend here:

>https://www.indeed.com/jobtrends/q-Python-q-Rails-q-Perl-q-Ruby-q-Django.html

Or here:
>http://www.ryan-williams.net/hacker-news-hiring-trends/2017/june.html?compare1=Ruby&compare2=Python&compare3=Perl&compare4=Rails

Or:
>https://www.itjobswatch.co.uk/IT-Job-Market/UK/Programming-Languages

You'll notice that Python has at alest twice as much jobs as Ruby, but Ruby Jobs are almost always Rails Jobs.
Perl is not that big, but it has maybe half of the jobs of Ruby (depending on the area) and it's not vanishing over night.
>>
>>61304882
> I don't know why people are repeating this meme

Usage, mailing list activity and contributions have been quickly dropping for the last 5+ years. Even on Tiobe it has dropped to a sad 13th place. They also haven't been able to find companies willing to sponsor Ruby, Bundler or Rails development so the ecosystem has largely stagnated. The primary Ruby implementation, which desperately needs work, only has four people actively working on it and those four are a very far cry from the people working on other VMs.

Rails is the only thing people really use Ruby for and it hasn't been unique for a very long time and is now widely considered a slow bloated mess. Most of the top contributors have also moved on to other languages like Javascript, Elixir, Python and Rust. Meanwhile, no new interesting work is being done in Ruby and it lacks complete up to date bindings for basically everything interesting (Tensorflow, Torch, Spark etc.). It doesn't even have complete up to date bindings for any GUI library besides TK.

>And in a few years Ruby3 is coming, which will be great

Ruby 3 will change nothing. They don't actually have any idea how to implement any of the proposed changes and they have no money to hire people that do.

> Here are some numbers

The Indeed stats you posted for Rails are somewhat misleading because Rails is mentioned in a lot of non Ruby job postings. A lot of PHP jobs for instance mention "experience in Rails like MVC frameworks."

> Python isn't growing

Python is in the top 5 and no language will be surpassing Java, C or C++ anytime soon. It's hard to have continuous growth when you're already that popular.
>>
>>61302365
Places that still use perl:

Search engines (DuckDuckGo, Jewggle)
Biomedical industry
University physics labs
Plenty of banks

It has it's uses but all I've ever used is AWK for system scripting and tiny scheme interpreters if I need to embed an interpreter in a binary.
>>
>>61304396
This guy gets it. If you want to be a system administrator, you should learn perl. It will make you more effective in less time than coreutils shit from the late 60s or memeshells, usually with less resource footprint than either, and it's present on the base install of every Unix-like OS from the last 15 years. Even routers and switches have perl.

Not for large projects. Not a means of entry level employment.
>>
>>61304138
>Faster
>More efficient
see >>61304166
and not >>61304195
who is wrong
>>
>>61305204
>Biomedical industry
>banks
Why? I thought Python and COBOL respectively were more popular.
>>
>>61302548
>Unix scripting
This in itself is a bad idea.
>>
>>61304166
These dubs don't lie.
>>
>>61305286
No idea why, just it's always been that way.
COBOL is still used all over banking too.

All those Bio informatician or w/e type jobs are all in Perl (sometimes Python, but stripped down Python with code specifically written for optimization like moving out any function calls from loops and performing those outside the body to only operate on primitive data)
>>
>>61305286
From what I've been told it's because most of the algorithms and programs in the medical industry were written by doctors and lab techs, without a compsci background so you ended up with a scripting language doing everything.

There's also no money to optimize these genetic sequencing programs, as typically a doctoral student will get some grant money to do something, create a good enough program to do it and then present a paper with a medical finding.

However universities are always looking for programmers to help them rewrite and optimize these programs, it's a good project for any Jr developer to pad their github with and optimizing these programs is dead simple for any CS student.
>>
>>61305278
Except you're factually wrong.
Perl is a great deal faster than both Python and Ruby for most applications.
>>
>>61305681
Except you're factually wrong.
Perl is a great deal slower than both Python and Ruby for most applications.
Except for regular expressions, but if you use them to that extend where it matters you should kill yourself anyway.
>>
>>61302365
Perl (5.20) is much faster than Python 3. Also it's more expressive, more functional style friendly, and doesn't fuck up with scope rules. If you are doing text processing Perl is the best tool you can use.
You should also try Perl 6, which is a completely new language based on Perl. Perl 6 is the most advanced scripting language ever created.
>>
>>61304035
you don't need the space between say and the string literal
>>
>>61305681
>>61305729
>Perl (5.20) is much faster than Python 3.
[citation required]
And it better be not plebians benchmark games or related to text manipulation where actual parsers are at order.

>and doesn't fuck up with scope rules.
Also, it has forced declaration, which should be a standard. Unfortunately only in strict mode, which by now should be default, given they don't give much of a fuck about backward compatibility anyway.
>>
>>61305729
>Perl 6 is the most advanced scripting language ever created.
Explain.
How is it so different from Perl?
>>
>>61305779
>How is it so different from Perl?
They removed a lot of retarded grammar from Perl5 and added a fuckton of features of which some are awesome like grammars and custom operators but make it semi-impossible to implement.
>>
>>61305779
For instance:
https://docs.perl6.org/language/grammar_tutorial
>>
>Perl

I don't know what it is or what it does, but Python is just beginning to kick off in my field of research, so it's not gonna go anywhere soon. If Perl has not equivalent for numpy, scipy, matplotlib and h5py, it's probably worthless for scientific applications..
>>
>>61302548
>I thought Perl was faster to write
Too bad it's impossible to read.
>>
>>61306060
Read the thread. It's for sysadmins, not lab rats.
>>
>>61306205
Those poor sods.
>>
>>61306205
That's one level below even labrats.
>>
>>61304396
>ruby is a decent contender as well, and both ruby and python do external package managers far better than perl
Pinto is going to change that.
>>
>>61306531
Great, now call again as soon as Perl has a good repository as well.
>>
>>61306060
>If Perl has not equivalent for numpy, scipy, matplotlib and h5py
Perl Data Language http://pdl.perl.org/
And for biosci there is BioPerl http://bioperl.org/
>>
>>61306060
>f Perl has not equivalent for numpy, scipy, matplotlib and h5py, it's probably worthless for scientific applications..
Good. Because in case of >>61306205 I'm not sure which to disregard more.
>>61306668
Damn.
>>
>>61306855
I think you have ignorant people spreading FUD against Perl here anon. Better take what you've learn and leave it here.
>>
>>61306561
Tell me what shitty repository use the shitty language you like for you to say shit on CPAN.
>>
>>61306890
>>61306975
Actually I used Perl and by extension CPAN couple of years ago and I think as maintenance and coverage go it can't get any worse than CPAN.

There were and probably still are a couple of good packages that work out of the box, but the rest is useless garbage like Perl style checkers, ASCII art libraries, C bindings that won't compile, web shit that only works half of the time, an inconsistent number of semi-working TCL bindings - compare that to TKInter which just werks - and outdated, incomplete documentation.
The only other time I was that disappointed by a language repository was npm, but they have a better track record of successfully compiling bindings.
>>
>>61307127
>couple of years ago
Maybe try Pinto
>>
>>61307127
Interesting, I have been using Perl for 16 years and I never had such problems with CPAN. Out of curiosity, what modules did you have problems with?
>>
>>61302365

To learn it over Python? Not really.

To learn it as well as/after Python? Definitely.
>>
>>61304882

Is indeed actually a good site for tech jobs though? From my experience, most of those numbers are likely recruiter spam or even scams - or they would be in my area. So many jobs on indeed that are actually advertisements for paid training programs or recruiters using as many keywords as they can to reach anybody who knows a scripting language no matter what it is.
>>
>>61302396
>embedding python
wtf
>>
>>61307157
I don't think that can be solved with a package manager. It's the packages that are shit.

>>61307181
Too many to really remember and too long ago. However, one that stood out was some SDL1 binding extension/wrapper, I don't remember the name.
The binding worked but the extension didn't.
>>
>>61307428
https://docs.python.org/3.6/extending/embedding.html

Like in Blender, LibreOffice (I believe, but I might be wrong and UNO might be able to use some IPC mechanism), Scribus and a couple of more desktop applications.

CPython (and any other Python implementation in actual existence) got that wrong, though, because they use opaque global state, which is some special kind of C cancer and so you can only create one interpreter state which surprisingly often doesn't suffice. Also, you can't restrict function access to native functions.

>inb4 extension over embedding
That's where you are wrong, kid. If it can't properly manage native threads it shouldn't be in control of the application.
>>
>>61304195
>what is XS
>what is PDL
>>
>>61305152

If I ever read a shilling post..
It this you, Guido?

>Even on Tiobe it has dropped to a sad 13th place.

But what are the differences we are talking about?

Python: 3,54%
Ruby: 2.25%

Whoa, 1,3%, that's really a game changer!
Sorry, I don't buy that.


>Ruby, Bundler or Rails development so the ecosystem has largely stagnated

That's pretty much bullshit. Ruby 2.4 came out on christmas and bundle got it's last update about two weeks ago, Rails 5.2 is maybe a few month old.

>The primary Ruby implementation, which desperately needs work, only has four people actively working on it

Ruby is open source:
>https://github.com/ruby/ruby

And there you can read "46 contributors", and that' definitely not because they couldn't find more people willing to work on it..

>Rails is the only thing people really use Ruby for

Metasploit, Chef, Puppet, Sinatra, Rack, Homebrew, Discourse..


>and is now widely considered a slow bloated mess

It's not the fastest framework in terms of response time, but it's still by far the fastest thing to develop in. And honestly it's still "fast enough" for every application people like you and me will ever code.

>Most of the top contributors have also moved on to other languages like Javascript, Elixir, Python and Rust.

Yes, because if you develop something for almost a decade you want to do something new. Even if Rails would vanish over night (and it won't) it would still have eternal fame for how much the internet community has learn about how to make a good MVC framework. Rails5 is better than ever with a lot of cool stuff (i.e. API mode makes it super easy to run it as API).


>It doesn't even have complete up to date bindings for any GUI library besides TK.

There are things like RubyQt and Korundum. The point is people usually don't use Ruby to do graphical stuff. But since including or using C and C++ is super easy in Ruby, you could do what you want.

Things like SciRuby are great, but Rubyist are mostly web people.
>>
>>61305152

>Ruby 3 will change nothing.

You can screecap this post and read it aloud in 3 years: Ruby3 will change a lot.

Meanwhile Python lives from it's huge market penetration, because it was (too) early adopted by Universities. But even with that much backing, it still manages to be maybe twice as big as Ruby.


>The Indeed stats you posted for Rails are somewhat misleading..

If you say so, random internet dude on 4chan. I will definitely believe you more than the biggest language trends website..


BTW
Why is it that Perl people are always cool people to look up to, while Pythonistas are always obnoxious brats that keep on shit-talking about Ruby?

Honestly I'd use Ruby even if I was the only person in the world, because it's fun to code in. I don't enjoy coding in Python that much, but that's just me and I would never talk shit about python, even if there are many points that are sub par IMHO..
>>
>>61308545
>Why is it that Perl people are always cool people to look up to
Perl people are a bunch of middle-aged sysadmins and hackers, so overall they're pretty cool.
>>
>>61308559

Yes, it's probably an "age thing"..
But I believe it's also some kind of philosophical thing.

Ruby has adopted the TIMTOWTDI philosophy from Perl, and I believe that this naturally makes people more eager to try out new things and try to find the most elegant way to get something done. Meanwhile Python has this "no fun allowed" attitude where only the "pythonic way" is correct.

Perl was written by one of the biggest programming punks in history, so naturally it produces cool guys. Python was written for non-programmers like scientists, that don't want to get into details, so naturally it produces programmers that aren't real programmers. And Ruby was written to make programmers happy, so naturally it produces happy programmers..

^^
>>
>>61308902
>it's probably an "age thing"
It's too bad not many younger programmers want to get into Perl. It's really fun.
>>
Metasploit was writen in Perl
Serious RegEx work is done in Perl
Serious bionformatics work is writen on Perl
>>
>>61308995
>Metasploit was writen in Perl
Isn't it Ruby?
>>
>>61308292
>If I ever read a shilling post..
>It this you, Guido?

I don't like Python either. They're both poorly designed dynamically typed messes, but unfortunately Python has a future. Ruby does not.

> muh percentage

The percentage on Tiobe doesn't correlate directly with how much it is used in reality. In the real world, Python is easily 10 times more popular than Ruby and there is probably way more Perl than Ruby as well.

> And there you can read "46 contributors"

Like I said, only 4 of them are actively working on it. It makes no difference how many of them have contributed over the entire life of the project. Matz, 2 other Japs, and tenderlove from Github are the only people ACTIVELY working on it. That's a skeleton team for a language implementation and none of those people have the knowledge necessary to make it competitive with other VM implementations.

> but it's still by far the fastest thing to develop in

Nope. Rails is nothing special today.

> And honestly it's still "fast enough" for every application people like you and me will ever code

Again no. If I hit above 100ms response times I'd be fired for gross incompetence. Rails can barely hit that serving static data.

> RubyQT

RubyQT is dead and won't even compile on Windows or OS X.
>>
>>61309147
>If I hit above 100ms response times I'd be fired for gross incompetence.
In what line of work do you need performance to be so perfect?
>>
>>61309167
100ms response time isn't that great. A lot of companies like Google and Amazon aim for lower than that. 200ms is widely considered unacceptably slow and most page speed tools raise a red flag anywhere after that.
>>
>>61309147

>They're both poorly designed dynamically typed messes

You can say what you want, but Ruby is a greatly designed language. It has so many cool things that don't even come to mind in everyday usage (i.e. dead code elimination). The basic structure (i.e. iterators, classes, blocks) are already so powerful that you can basically rebuild half of the ruby syntax with it.

Take a look at a simple thing like the "Fixnum" class (in C) and you'll see that it's beautifully engineered code.

See this example discussion here:
>https://crystal-lang.org/2016/07/15/fibonacci-benchmark.html

You can also fake LISP macros or Haskell Types or Python syntax in Ruby without much effort. It even has insane stuff like continuations (CallCC) - the only two languages that even have this are Scheme and Ruby.


So say that you don't like Ruby, but don't you ever say it's poorly designed.


>In the real world, Python is easily 10 times more popular than Ruby

Whatever, dude. There are arguably more jobs for Python, because of the whole big data meme train. But guess what? I'm not into big data, so I don't care. You'll always find more Rails jobs than Django jobs.


>Like I said, only 4 of them are actively working on it.

Maybe because Rails is just closer to perfection? In the last few rails version there were only minor changes, simply because Ruby doesn't need anymore stuff.

Ruby is similar to LISP in that is is basically "programming language building material". You can make your own syntax and create your own domain specific language, and that's exactly what Rails, RSpec, Chef and all those other did.


>Nope. Rails is nothing special today.

Not special, but it's hands down the fastest technology to develop a simple CRUD app in.


>If I hit above 100ms response times I'd be fired for gross incompetence. Rails can barely hit that serving static data.

You don't get what Rails is good for. For serving static data you could simply use Rack. Rails is for complicated stuff.
>>
>>61309617
>So say that you don't like Ruby, but don't you ever say it's poorly designed.

I know Ruby and it's primary implementation very well. It's very poorly designed. If you want a well designed dynamically typed language see Smalltalk or Racket.

> Maybe because Rails is just closer to perfection?

I wasn't talking about Rails there. I was talking about the mainline Ruby implementation which is very, very poor. Out of all the relatively popular languages it is easily the worst VM.

> Rails is for complicated stuff.

You sound like a junior programmer. Rails is for simple CRUD web applications and nothing more. Obviously you would serve static data with a CDN or nginx. However, if you're web framework can't serve small amounts of static data in under 100ms with modern hardware it is doing something horribly wrong.
>>
>>61309147
>I don't like Python either. They're both poorly designed dynamically typed messes, but unfortunately Python has a future. Ruby does not.
a poorly designed language has a future over a well designed language....this thread in a nutshell
>>
>>61308902
>Ruby has adopted the TIMTOWTDI philosophy from Perl
You have no idea what timtowtdi means in Perl, all container types in Perl are flat, there is no nested arrays or hashes, everything is flat and has to be accessed with 'pointers'. So you do a lot of silly 'pointer' tricks in Perl which leads to a lot of timtowtdi craziness. This is nothing like how Ruby treats containers as immutable objects that get mapped over with methods that almost always create a new container structure. There is almost never mutable changes on variables in Ruby, this is a reason Ruby doesnt even have a ++ iterator.

this thread is full of larping teenagers fighting language wars over their favorite fizzbuzz langauge
>>
>>61302396
>You want to embed an interpreter in your program but want more than one instance and these instances should be properly separated
T C L
C
L
>>
>>61304741
>Javascript and Python will be the last dynamically typed languages to ever become popular
Elixir (if you count it as a separate language from Erlang).
>>
File: wtf.jpg (41KB, 429x410px) Image search: [Google]
wtf.jpg
41KB, 429x410px
>>61304731
>CGI::App
>>
>>61309732

>I know Ruby and it's primary implementation very well. It's very poorly designed.

Did you even get one of my arguments?
Whenever people talk about Ruby you hear that it's one of the greatest designed languages ever. That's probably one of the reasons why so many languages were inspired by Ruby: Scala, Swift, Rust, Elixir to only name a few.

Smalltalk is a great language, that's why Matz took a lot of inspiration from there. But Ruby works better out of the box and is way more readable.

Also Ruby has mixins, permits adding methods to individual objects, you can add methods dynamically and you have powerfull macros. Smalltalk not.

But that's not even remotely interesting because smalltalk was dropped by the industry a long time ago.


Racket?
Can't comment, but it's a LISP, so either you have a boner for it's syntax anyway (then you will use it on matter what) or you are more comfortable with C-family-like syntax. SO I see no competition here.


>I was talking about the mainline Ruby implementation which is very, very poor.

You aren't a Rubinus fanboy, by any chance..?


>Rails is for simple CRUD web applications and nothing more.

Unfortunately my post waas too lengthy so I couldn't elborate on that one in the last post..

Yes, if you have static stuff you could simply let your Server serve it and set a Phusion Passenger on top of it.

A lot of Rails benchmarks use the oldest server (Unicorn) instead of a better one like TorqueBox or Raptor.
>http://www.rubyraptor.org/


Rails does really a lot for you and of course this comes at a (small) price. But that's a matter of what tools you use. Again, for a simple basic CRUD I'd use something like Sinatra or Cuba, which are basically wrappers around Rack with standards like routing and so on.

Rails is a completely different beast, because it has ActioView, ActiveRecord and what not. Every line of code in Rails does a lot of things and takes care of everything it can reasonably take care for.
>>
>>61310185
>Whenever people talk about Ruby you hear that it's one of the greatest designed languages ever.

I almost never hear anyone say that. Scala, Swift and Rust are not inspired by Ruby in any meaningful way. Ruby basically took some ideas from Smalltalk and made them worse.

I think we're done here. It's very obvious you're a junior developer at best.
>>
>>61302365
>What is your opinion on Perl?
It's comfy

>Is there any reason to learn it over Python nowadays?
It's not Python
>>
>>61309876

Interesting. Could you give a small example?
This is a Perl thread after all.

In Ruby a nested structure (like you called it) would look like this:
test = {true => {42 => 'some text'}}
test_2 = [[['''implying''']]]

p 'yes' if /text/ =~ test[true][42]
p test_2[0][0][0]
>>
>>61307127
Maybe you're just an idiot
>>
>>61308992
because a young programmer starts his first job and sees this fuckmess perl script written by his predecessor and thinks

never again
>>
Perl is great but its following is and will remain a small to medium sized cult. I have a feeling an almost constant amount of people will continue to use Perl until computers as we no it are no more
>>
>>61304451
>tfw in 10 years new sysadmins will be rewriting those scripts in JavaScript
>>
>>61304451
Still a few big companies using Perl. There are jobs near them. But unless you're in one of those areas I guess you're out of luck
>>
>>61304820
Unix isn't forever, and the Internet will almost certain outlast Unix. They'll probably die as Unix dies or (more likely) is relegated to a rarely-touched VM-hosting platform.
>>
>>61305768
>>61305703
Perl and Python are neck in neck and I wish I could back it up with a link but you'll have to trust I'm sure of it. Ruby is a lot slower though. Than both
>>
>>61310288

Sorry, you have really no idea about Ruby.

Scala took a lot of inspiration from Ruby..

>http://dev.housetrip.com/2013/10/29/scala-from-ruby/
>https://medium.com/@fapoli/is-scala-the-new-ruby-8d53975e7297


>It's very obvious you're a junior developer at best.

Nice ad hominem, bro.
Running out of arguments already..? ;)
>>
>>61309876
None of that is even remotely true
>>
>>61310508
>>https://medium.com/@fapoli/is-scala-the-new-ruby-8d53975e7297
>Note that Scala is a typed language but has Type Inference so you don’t need to specify the value type of foo, but you must specify a and b’s type. This way looks cleaner to me. I thing the key is the arrow thing that we find in both examples.
wow this guy have no fucking idea what he's talking about
>>
>>61310498

>Ruby is a lot slower though. Than both

Nah, Ruby is faster than Python in many benchmarks. They are at least pretty close.

>https://benchmarksgame.alioth.debian.org/u64q/ruby.html
>>
>>61308292
>it's still "fast enough" for every application people like you and me will ever code.
Speak for yourself. Some of us here work on things that aren't CRUD and need soft real-time performance.
>>
>>61310325
Not the original guy, but in perl, the hash assignment works: (note: perl doesn't have 'true' or 'false' defined as values
%test = {"true" => {42 => "Some text"}};
print "yes\n" if /text/ =~ $test{'true'}{42};


Now, the original anon is correct in that $test{'true'} contains a pointer to an anonymous hash with the key value pair '42' => 'some text', but for everyday usage you don't need to worry about it all that much.

For the array assignment it gets a little bit weirder in that what you're creating an array that contains at [0] a pointer to an anonymous array that contains as [0] another pointer to another anonymous array that contains as [0] 'implying'

@test_2 = ([["implying"]]);


Accessing it, however, is just as easy as in Ruby:
print $test_2[0][0][0];


tl;dr - whilst nesting data structures in perl is a little convoluted at first, once you grasp the basics you can solve 99% of problems you'd ever encounter.
>>
>>61310526
Not him, but yes it is and it's a large part of why sigils in perl are retarded. Hashes and arrays can only store scalar types, including references, but to get arrays/hashes from other arrays/hashes you have to cast them back, so you get pointless cruft like the example off the Perl 6 wikipedia page:

my @trans_verbs = @{ $dictionary{ 'verb' }{ 'transitive' } };
>>
>>61309732
>Smalltalk
Which Smalltalk implementation are you talking about? I thought all the open source ones were mediocre and slow.
>>
>>61310575

Haha, I guess that's what you get for not checking your sources..

Nevertheless, I tried to learn a little bit of Scala and during the process a lot of things reminded me of Ruby. Starting with keywords like "def" and "yield", but also the way that numbers are always objects (like in Ruby) and not Java-like. OK, Scala had a lot of influences, i.e. Erlang or Python, so let's drop that.


But Wikipedia says:
Ruby influenced Clojure, CoffeeScript, Crystal, D, Elixir, Falcon, Groovy, Ioke, Julia, Mirah, Nu, potion, Reia, Rust, Swift
>https://en.wikipedia.org/wiki/Ruby_(programming_language)

So that's already a bunch of languages, right?
>>
>>61310185
>TorqueBox
That's for JRuby, though.
>>
>>61310604

Hey, how about you read my comment (>>61310185) where I wrote:

>Rails does really a lot for you and of course this comes at a (small) price. But that's a matter of what tools you use. Again, for a simple basic CRUD I'd use something like Sinatra or Cuba, which are basically wrappers around Rack with standards like routing and so on.
>Rails is a completely different beast, because it has ActioView, ActiveRecord and what not. Every line of code in Rails does a lot of things and takes care of everything it can reasonably take care for.


Wow, a spoon must be poorly designed, you simply can't cut things like a knife..

>>61310695

Thanks for the example.
So the problem here is the "$dictionary"?

Bear with me, I'm a Perl noob..
>>
Favorite gem.
>>
>>61310632

Thanks a lot!
>>
>>61302365
>What is your opinion on Perl?
Single best programming language ever. Largest selection of open sourced libraries to go with it. The Perl community is amazing.
>>
>>61310772
>Hey, how about you read my comment
>read my comment
>comment
Anyway, I don't see how it contradicts my point that not "every [web] application people like you and me will ever code" Rails is going to be fast enough for. It's literally what you wrote.
>>
>>61310772
>So the problem here is the "$dictionary"?

More or less. You have to change the hash's % sigil to $ to look up values, but once you get an array or a hash you have to cast it back to what you wanted to start with.

References weren't an original part of the language; they were a hack added around version 4 of the interpreter to add nested data structures as perl evolved beyond a shell scripting replacement. They were never very well thought out and they interact poorly with sigil variance (a bad idea that was there from the start).
>>
>>61310772
>So the problem here is the "$dictionary"?
$dictionary in this case is referring to a hash (%dictionary) as perl has this (somewhat peculiar) style of placing unique sigils in front of different data structures, and using them in a rather idiosyncratic way, so for example:
$foo
is a scalar variable
@foo
is an array variable (but is used to refer to the entire array, so @foo[0] is invalid, and
$foo[0]

is correct.
Similarly for hashes
%foo
is the entirety of a hash, and
$foo{'bar'}

refers to a single value within the hash
>>
>>61310325
I really dont get the point your making, your writing Ruby in Perl style to prove Ruby is bad?
p 'yes' if test[true].value?(/text/)
p test_2.flatten.first
>>
>>61310848

Touché...

>>61310867
>>61310881

OK, so..

1) I make a hash called %dictionary
2) the key of the dictionary is 'verb'
3) the value of ${'verb'} is another (anonymous) hash with the key 'transitive'
4) I put them in another hash, but "cast" this hash to an array

Is this correct??!?!

I thought I understood those sigil thingy..
>>
>>61311141
>Is this correct??!?!
Almost, for the first three parts yes, however:
>4) I put them in another hash, but "cast" this hash to an array
Is wrong, the example is casting the value from the 'transitive' anonymous hash (which is most likely (given the context) to be an anonymous array reference) into a new array called @trans_verbs, so you're not putting them into another hash
>>
>>61310953

The power of TIMTOWTDI, my friend..

p 'yes' if test[true][42][/text/]
p *test_2[0][-1]
>>
>>61311209

Ahh I see.

So it's "= @{ ... }" only because we assume that 'transitive' points to another array.. Uhm, no, I didn't get it. Why not "= @( ... ) "

Different question:
is it better to learn Perl5 or Perl6?
>>
>>61311378
>is it better to learn Perl5 or Perl6?
go to the Perl 6 wikipedia page, look at the syntax examples they have, ask yourself if this is any better than Perl 5, if you say yes, check yourself into a mental hospitol
>>
>>61311378
@(...) would create an anonymous array with one value, a reference to the array contained in the 'transative' key/value
@{...} casts from a reference to a container (in this case an array)

>is it better to learn Perl5 or Perl6?
Perl6 tidies up a lot of the sigil shit, however, there are more examples of Perl5 available, so finding out how to do something (particularly something esoteric) is easier
>>61311422
Also this
>>
>>61311422

Not gonna argue with those dubs.
Also I just realized I have Perl5 already installed on Linux, yay!
>>
>>61311422

>Global variables have a twigil
>Yes, a twigil. It's the second character in the variable name. For globals, it's a *.

Ahahaha, Perl6 is crazy shit..

So basically Perl pulled off a Python and recreated a worse version of itself that nobody wants to use..?
>>
File: perl6_operators.jpg (2MB, 3477x2456px) Image search: [Google]
perl6_operators.jpg
2MB, 3477x2456px
>>61311509
There's no way it can be worse, look at all the new operators they added

language of the future
>>
>>61310867
I see it differently. The fact that lists and hashes are flattened implicitly when passed with their default syntaxes can inspire interesting, quick, and optimized solutions to common problems
>>
>>61311701

fail andthen die 
^fff^
>>
>>61302365
i like it

fuck XS though
>>
>>61310185
Old ass programmer here. Ruby has only ever been used for one reason: Rails.

There is almost no new development in RoR and I know for a fact in the Atlanta market they can't find developers willing to learn it.

Single page apps and front end frameworks like Angular and React have killed boutique server side languages.

All the cool kids use MEAN stack for API development. Everything else is done in the browser.

RIP RoR 2005 - 2013
>>
>>61312166
>All the cool kids use MEAN stack for API development.
Err...
>Old ass programmer
I see.
>>
>>61312200
Okay, what do the cool kids use?
>>
>>61312200
Please tell us what's wrong with that statement.
>>
>>61312244
>>61312259
It isn't 2014 any more. The cool kids today use Postgres, Vue and Go. The even cooler kids use AWS Lambda and DynamoDB.
>>
>>61312320
Ok kid
>>
>>61312320
What is it with the contrarian non-devs on /g/

>API development with Vue
Leave /g/ forever
>>
File: 616HDYb6HzL._UX342_.jpg (17KB, 342x342px) Image search: [Google]
616HDYb6HzL._UX342_.jpg
17KB, 342x342px
>>61312336
Here's your watch and complimentary LWN subscription.
>>61312389
I'm not selling Vue, just telling it like it is.
>>
>>61312412
Do you know what an API is?

Do you understand what Vue does?
>>
>>61305703
>for most applications
But that's wrong, you fucking retard
>>
>>61312473
Do you know what vue-resource is? Do you understand what Vuex does? Again, I should emphasize I am only trying to give you old folks a hint of a clue. I am not a fan of Vue.
>>
File: 1311534610683.jpg (18KB, 300x390px) Image search: [Google]
1311534610683.jpg
18KB, 300x390px
>>61305444
>>
>>61312559
I'm bumping this so other people can see how fucking stupid you are.
>>
>>61305152
>haven't been able to find companies willing to sponsor Ruby
>Rails is the only thing people really use Ruby for
>Meanwhile, no new interesting work is being done in Ruby

I guess you're just not Japanese enough for mruby, or really anything else (mostly Japanese) people actually use Ruby for.
>[mruby is] sponsored by the Regional Innovation Creation R&D Programs of the Ministry of Economy, Trade and Industry of Japan.
>>
>>61310135
u mad
>>
>>61305204
Chip designers use it for utility scripts, although this is often due to inertia. Many EEs are like lazy seagulls -- you have to throw rocks at them in order to get them to fly (or in this case, try a new language).

>>61310409
This. Try inheriting a script with inconsistent indentation and standing orders to never run with the -w switch, because no one wanted to fix the warnings.
>>
>>61303860
i wish i could suck ur knowledge out from ur eye socket

let me in brother
>>
>>61316269
>-w
Not
use warnings;

pleb
>>
>>61316326
In my book, true patricians use both the warnings and strict pragmas.
>>
>>61316346
Well yeah, use strict; goes without saying, the only time you don't have it there is as a warning that some high grade fuckery is about to happen
>>
>>61302365
> Is there any reason to learn it over Python nowadays?
if you have to ask, then no
>>
>>61316387

Interesting, what's the deal about not using "strict"?


>>61312166

>Ruby has only ever been used for one reason: Rails.


Yes, because Chef, Puppet or Metasploit are totally unknown projects, right..?


I do agree that the ever moving hype train in the web industry has moved on. First the MEAN stack with Mongo and Angular was the thing. Then React came and blew Angular out of the water. Then this whole functional circus with languages like Scala, Elixir and Elm started to bring the functional paradigm more into web development. Then ClojureScript revived LISP. Then Vue came and showed the React and Angular community how to make lean and smooth single page apps. Then Rust tried to bring low level programming in web dev, but then Golang came and had way more success for the web. Maybe in a few years everybody is doing WebAssembly and something we can't even dream of right now?

You see, It's not about following the latest hype. I mean it's cool and fun to try out new things, currently I'm trying to get into Node and Vue, just for fun.

But eventually you don't need to know everything. If you are an experienced Django or Laravel developer you can learn Rails in no time (and the other way around). MVC frameworks are more or less the same. Just as SPA frameworks are more or less the same (mostly MVVM, but the differences are usually biger than for MVC frameworks).

I code with Rails because I like it. And it's far from "dying". But even if you develop in Java, Rails comes in handy for rapid prototyping:
Hack it together in one week to do a "proof of concept" and rethink your design, then do a clean Java implementation in two months.
>>
>>61317736
>Interesting, what's the deal about not using "strict"?
http://perldoc.perl.org/strict.html has a good explanation, but essentially it turns on a whole load of syntax checking that stops the use of constructs that "work", but might not necessarily work as expected, causing interesting debugging problems later on
>>
>>61315884
What do the Japanese use Ruby for, besides sysadmin tasks?
>>
>>61317928
Nothing. Ruby isn't actually used much in Japan. It's far more popular in the US.
>>
File: tism.jpg (25KB, 403x433px) Image search: [Google]
tism.jpg
25KB, 403x433px
>>61302365
>perl
B-but it's an onion..
>>
>>61310719
Numbers aren't objects. "Numbers" are a subset of the AnyVal class in Scala..

Syntactically, def doesn't indicate that it has ruby influence
>>
File: 09hhXbg.png (1MB, 1190x1032px) Image search: [Google]
09hhXbg.png
1MB, 1190x1032px
>>61302365
Perl is mostly used by hackers to develop payloads.
>>
>>61318660


This is Scala. We call the "-" method ("3 - 2" is syntactic sugar).

val dec1 = 3.-(2)
val dec2 = dec1.unary_-



This is Ruby. We call the "-" method ("3 - 2" is syntactic sugar).

dec1 = 3.-(2)
dec2 = dec1.-@
>>
>>61318990
Clearly Scala is a complete rip off of Ruby! It's not like dozens of better languages had similar OO features decades before Ruby even existed!
Thread posts: 151
Thread images: 9


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.