Is PERL good for a linguist new to programming?

P

p.podmostko

Hello there!

Just a small question. I'm about to start my postgraduate course in
translation and I wanted to specialise in computational linguistics.

Just wanted to know the opinion of PERL users if it makes sense to
start to learn it now. I have several ideas regarding linguistics-
related programs and wanted that language to help me create them and,
maybe in the future, write my PhD dissertation.

I've done some research and opinions about that language are heavily
polarised, namely that the syntax is cluttered, that it's a
Pathologically Eclectic Rubbish Lister, etc. I wanted to focus on PERL
due to it's supposed text-processing capabilities, and I've also
considered going for Python but I don't want to waste time on learning
something which is not very common and useful. If I'm to spend years
on learning a language (wheter it's French, PERL, Spanish or C++) I
want to know that there are opportunities for it and there's numerous
users of that language out there.

Thanks in advance for any suggestions!
Przemek
 
T

Tad J McClellan

Just a small question. I'm about to start my postgraduate course in
translation and I wanted to specialise in computational linguistics.


Perl's creator, Larry Wall (a linguist), wrote a bit about *natural*
language principles that he incorporated into Perl's design:

http://www.wall.org/~larry/natural.html

Though that does not mention my personal favorite example of natural
language things in Perl. Perl has a concept of "singular" vs "plural"
that I've not seen in any other machine language.

("scalar context" vs "list context" in perl-speak)

Just wanted to know the opinion of PERL users if it makes sense to
start to learn it now.


The name of the language is "Perl".

"Perl" is used to refer to the language itself

"perl" is used to refer to the implementation of the language
(the interpreter, the binary)

"PERL" is used to indicate that you do not know the
"secret handshake" of people who really know Perl.

:)

I have several ideas regarding linguistics-
related programs and wanted that language to help me create them and,
maybe in the future, write my PhD dissertation.


The most powerful argument for using Perl is CPAN.

Many already-invented wheels just waiting for you to use them!

For natural language, the Lingua::* namespace is interesting.

I've done some research and opinions about that language are heavily
polarised, namely that the syntax is cluttered, that it's a
Pathologically Eclectic Rubbish Lister, etc.


Everything is a tradeoff.

The "bad" things above may be offset by the expressiveness they
help realize...

Thanks in advance for any suggestions!


Share the results of your research by putting them into
modules on CPAN. :)
 
C

ccc31807

Just wanted to know the opinion of PERL users if it makes sense to
start to learn it now. I have several ideas regarding linguistics-
related programs and wanted that language to help me create them and,
maybe in the future, write my PhD dissertation.

Perl is simply a tool, nothing more and nothing less, like all
languages.

Like other tools, Perl is optimized for a certain range of tasks, like
a hammer for nails or a screwdriver for screws or a wrench for bolts.

The range of tasks that Perl is optimized for is text and data
processing, especially dealing with strings. Other examples are Java
in dealing with very large applications, the .NET languages for
dealing with (mindless) RAD, C and assembly for dealing with hardware
and bits, Lisp for artificial intelligence, Erlang for telecom
applications, and so on.

I'm a database guy, and I use Perl for dealing with large globs of
ASCII data. The reason I use Perl is because it allows me to easily do
what would be much harder in other languages, like transforming data.
I use Perl to spit out reports in a variety of formats: HTML, XML,
PDF, RTF, csv, txt, and so on.

David Cross write a little book a number of years ago entitled 'Data
Munging with Perl.' This can be had cheaply and quickly from
Amazon.com or half.com - best used price is $12.95. I don't
necessarily recommend this as a good book, but it does a good job at
illustrating the kinds of jobs that Perl excels at. You might want to
spend the $13.00 to get it, scan through it, and decide for yourself.

I like to see Perl as a fat, warty, ugly, old woman who will cook your
meals, wash your clothes, clean your house, take care of you, and be a
good companion for your life's journey. If getting the job done
appeals to you, Perl is worth a good, hard look.

CC
 
P

p.podmostko

Thanks all for your answers!

I might need to clarify because this point has come up thrice already
during this conversation. I just used a wrong word.

I don't want Perl to write the dissertation FOR ME. I just want Perl
to be the tool to assist me in creating something which will be the
subject of that dissertation. I should've known that I'm talking to
programmers and that I should choose words more carefully :)
 
T

Tad J McClellan

Thanks all for your answers!

I might need to clarify because this point has come up thrice already
during this conversation. I just used a wrong word.

I don't want Perl to write the dissertation FOR ME. I just want Perl
to be the tool to assist me in creating something which will be the
subject of that dissertation. I should've known that I'm talking to
programmers and that I should choose words more carefully :)


You haven't even started yet...

.... but you've learned something already!

:)
 
M

Marc Girod

The language is called Perl. It is not an acronym.

But from a linguistic point of view, let's note that
it is a (probably intended) spelling error for
'pearl', which is what you might find valuable in a
'shell'.

So, some level of contorted jokes and double entendre
at the very start, which is highly in phase with the
spirit of the language.
Maybe a variation on the popular theme of 'not what
you might think it is'...
Also, even if Perl is not an acronym, acronyms were
certainly taken into consideration while coining the
name.

Maybe I should add that I am a (humble) afficionado.

Marc

There is certainly some amount of literature on this
topic already...
 
P

p.podmostko

I just wanted to ask you a question of somewhat psychological nature.

I know that with all due effort and time devoted to learning Perl it
is possible to do it. However, only after having started the
O'Reilly's Beginner's Introduction to Perl did I realise what kind of
thinking is required to be able to write programs.

It calls for a specific approach to problem-solving, logical,
sequential thinking. I was just thinking if it's possible to develop
that kind of mindframe for a person who has aptitude for languages and
humanities but not for maths (because that what programming is
ultimately - solving problems by means of mathemathics). Or will I be
fated for creating programs only by means of analysing and copying
parts of sourcecodes written by someone else?

Opinions appreciated :)

Regards
Przemek P.
 
B

Bradley K. Sherman

...
ultimately - solving problems by means of mathemathics). Or will I be
fated for creating programs only by means of analysing and copying
parts of sourcecodes written by someone else?
...

You say that as if it were a bad thing.

BTW, if you can count, you can program.

--bks
 
C

ccc31807

I know that with all due effort and time devoted to learning Perl it
is possible to do it. However, only after having started the
O'Reilly's Beginner's Introduction to Perl did I realise what kind of
thinking is required to be able to write programs.

This is just my opinion, and many will disagree, some violently. I'm
of late middle age, majored in history and English in college, and
practiced law for 17 years before tranistioning into IT. I'm not a
mathematician nor a programmer but a liberal arts guy. I give this
background to warn you of my bias.

IMO, programming is NOT an academic pursuit, but a technical one. I
see learning to program the same as learning to cook, to ride a bike,
to hit a baseball, or to play a musical instrument. You don't learn
these things by reading a book, hearing a lecture, or watching people
do it. The ONLY(!) way you learn to do these things is by doing it,
and doing it a lot. Practice, practice, practice. There is a
cumulative effect, and the more languages you learn the quicker you
can pick up new ones.
It calls for a specific approach to problem-solving, logical,
sequential thinking.

The trick is learning the logic. I now have a couple of advanced
degrees in CS and SwE, and have spent a lot of time with students in
labs. The HARDEST thing for a new student to learn is the logic, but
this is no different from law. It's not hard to learn the semantics of
a language, just as it's not hard to learn what the law is. The much
more difficult part is learning to apply these. For example (taking a
very common student problem) write an algorithm to figure out how many
coins (quarters, dimes, nickles, and pennies) are in a given amount of
money. Try this and you will see that it's not an particularly easy
thing to do -- and most students who fail will fail on the cusp
between programming and logic.

There's a reason that we call this field computational science, or
combinatorial science, or algorithmic science. You can develop a good
knowledge of programming semantics and techniques, but until you learn
discrete math and algorithms, you are just a hack, not an accomplished
professional. (I don't say this to discourage you, just to make the
point that learning a language and learning to use a language are
different things.)
I was just thinking if it's possible to develop
that kind of mindframe for a person who has aptitude for languages and
humanities but not for maths (because that what programming is
ultimately - solving problems by means of mathemathics). Or will I be
fated for creating programs only by means of analysing and copying
parts of sourcecodes written by someone else?

You had better develop that mind frame. If you don't, you won't
succeed. My point is that logic is a discipline that transcends math,
really transcends all disciplines. As to your second question, the
answer is both. If you can analyze and understand program code, you
can write it. In doing so, you will come to appreciate clarity and
precision (including the art of properly commenting code).

You also need to understand that having a tool without a job is almost
as bad as having a job without a tool. It won't do you any good to
learn to program unless you have a problem domain where you can use
the tool. You will never learn to use the tool unless you can use it
to do real work -- not make work or pretend work, but real work.

CC
 
U

Uri Guttman

BM> I think the only real similarity to the practice of mathematics is
BM> the need for 'rigour': that is, to take what you have written and
BM> try to come up with every possible way in which it might go
BM> wrong. I suppose a mathematician's sense of 'elegance' is also
BM> similar to a programmer's, in that you are trying to find a
BM> solution that avoids needless repetition and unnecessary
BM> assumptions.

i would say there is more to the math/programming relationship.
algorithm theory is a very math oriented field and many mathematical
fields have been conquered only through programming. fortran, one of the
most successful (and fugly) languages ever was totally created with math
in mind. programming took the primary math symbols and precedences from
math (in most langs). the list could go on much further IMO.

uri
 
U

Uri Guttman

c> IMO, programming is NOT an academic pursuit, but a technical one. I
c> see learning to program the same as learning to cook, to ride a bike,
c> to hit a baseball, or to play a musical instrument. You don't learn
c> these things by reading a book, hearing a lecture, or watching people
c> do it. The ONLY(!) way you learn to do these things is by doing it,
c> and doing it a lot. Practice, practice, practice. There is a
c> cumulative effect, and the more languages you learn the quicker you
c> can pick up new ones.

you don't know too many people who can't cook, hit a baseball, or play
an instrument (the latter for me). some skills just can't be taught
because some fundamental skill or something is missing or weak. sure
everyone could do a minimal program if they can follow a recipe or
travel directions. but real programming isn't about that but dealing
with complex levels of those things. i teach that the reason programming
is easy is anyone can do minimal logical stuff. the reason programming
is hard is scaling - two kinds of scaling. there is scaling in knowledge
- the programming field is very broad and deep with more to learn than
any one person cant. and the other scaling is in complexity. small
programs are easy, scaling them up to handle large loads, high speed,
reliability, etc is very hard.

c> The trick is learning the logic. I now have a couple of advanced
c> degrees in CS and SwE, and have spent a lot of time with students
c> in labs. The HARDEST thing for a new student to learn is the logic,
c> but this is no different from law. It's not hard to learn the
c> semantics of a language, just as it's not hard to learn what the
c> law is. The much more difficult part is learning to apply
c> these. For example (taking a very common student problem) write an
c> algorithm to figure out how many coins (quarters, dimes, nickles,
c> and pennies) are in a given amount of money. Try this and you will
c> see that it's not an particularly easy thing to do -- and most
c> students who fail will fail on the cusp between programming and
c> logic.

the logic is easy enough as i said. scaling is the hard part. everyone
can learn a little law but learning enough to be a lawyer and pass the
bar is hard. same thing. writing a php page is easy enough. writing a
kernel is hard.

c> You had better develop that mind frame. If you don't, you won't
c> succeed. My point is that logic is a discipline that transcends math,
c> really transcends all disciplines. As to your second question, the
c> answer is both. If you can analyze and understand program code, you
c> can write it. In doing so, you will come to appreciate clarity and
c> precision (including the art of properly commenting code).

there is definitely a certain mindframe that good or better programmers
have that others don't. accepting that the computer is right and you are
wrong is one of the important attitudes! :)

uri
 
C

ccc31807

you don't know too many people who can't cook, hit a baseball, or play
an instrument (the latter for me).

True, but I don't know many who can do these things WELL. I think you
and I agree even though we express it differently.
some skills just can't be taught
because some fundamental skill or something is missing or weak. sure
everyone could do a minimal program if they can follow a recipe or
travel directions. but real programming isn't about that but dealing
with complex levels of those things.

This was my point. Learning the syntax and key words of a languages
isn't difficult, and learning the built in functions requires just
some practice. The difference between a journeyman and a master is the
same thing that separates the weekend golfer and Tiger Woods, or the
church pianist and Murray Parriah (sp?): a little bit of genius and
lots and lots and lots of hard work.
i teach that the reason programming
is easy is anyone can do minimal logical stuff.

Playing chess? Learning the moves of the pieces is easy. Learning
certain practices (holding the center, developing your men, focusing
your attack) is a little harder. To me, the logic of chess, more of an
art really, is seeing the patterns. Programming as a science can be
taught and learned. Programming as an art cannot be taught or learned.
Anyone can be taught to read notes and play a scale. Making music is
an entirely different matter.
the logic is easy enough as i said. scaling is the hard part. everyone
can learn a little law but learning enough to be a lawyer and pass the
bar is hard.

Actually, passing the bar takes minimal knowledge but great analytical
skills. I've taken and passed bar exams in two states, and what we
were told by the bar examiners was this: 'If you don't know the law,
make it up. We are much more interested in how you think than what you
know.' An engineer can always look up material strengths and formulas
in a handbook, but knowing how to apply the knowledge is the crucial
point. Likewise, a good programmer can program in any language, while
a poor programmer cannot program in any language.

An illustration from programming: you have a glob of data that has
some complex relationships, and you need to stuff it into a data
structure. Do you use and array of arrays, an array of hashes, a hash
of arrays, or a hash of hashes, or something else? You can have a
great technical knowledge of these structures, but knowing when and
why to use them is on a higher level. As you say, scaling is one
important component.

CC
 
P

p.podmostko

Well, I'll try anyway :) Thank you for so many suggestions and
comments.

I'm a drummer myself, I write music. However, I've always wanted to
learn a programming language but never really had a purpose. An I
agree, you can learn notes and theory but to have that nack for
applying that and actually write music is something different. Let me
see if I have it for programming.

Thank you!
 
C

ccc31807

Well, I'll try anyway :) Thank you for so many suggestions and
comments.

You're welcome.
I'm a drummer myself, I write music. However, I've always wanted to
learn a programming language but never really had a purpose. An I
agree, you can learn notes and theory but to have that nack for
applying that and actually write music is something different. Let me
see if I have it for programming.

I am not a programmer. I just write programs as part of my job. In a
way, I'm an amateur programmer in the original sense of 'amateur' --
that is, one who does something because he loves it, not for money.

I enjoy writing little scripts even though I'm not a star. Just as I
enjoy performing music (my main instrument is the bagpipe, and this
month I've performed publicly 14 times, and generated almost $1,000 in
revenue, and brought joy to about 12,000 people) but know that I'll
never perform with the perfection of a professional.

The key is having fun, and if you don't worry about being in the top
rank you can certainly have fun, whether it be music, or sports, or
cooking, or programming. There really is a joy to writing a little
script that performs a task that makes me feel warm inside, and
astounds others who think you do magic. Sort of like playing the
bagpipe.

Remember that the benefit is commensurate with effort, that nothing is
free, and that you will only achieve your aim with lots of sweat and
pain.

CC
 
P

p.podmostko

You're welcome.


I am not a programmer. I just write programs as part of my job. In a
way, I'm an amateur programmer in the original sense of 'amateur' --
that is, one who does something because he loves it, not for money.

I enjoy writing little scripts even though I'm not a star. Just as I
enjoy performing music (my main instrument is the bagpipe, and this
month I've performed publicly 14 times, and generated almost $1,000 in
revenue, and brought joy to about 12,000 people) but know that I'll
never perform with the perfection of a professional.

The key is having fun, and if you don't worry about being in the top
rank you can certainly have fun, whether it be music, or sports, or
cooking, or programming. There really is a joy to writing a little
script that performs a task that makes me feel warm inside, and
astounds others who think you do magic. Sort of like playing the
bagpipe.

Remember that the benefit is commensurate with effort, that nothing is
free, and that you will only achieve your aim with lots of sweat and
pain.

CC

Well, thats why im doing it mainly. I also want to be a better
specialist in my domain (im a translator), but hence my above
question. Im just worried if my brain will be up to par with all the
challenges posed by programming.

Right now for example im racking my brains how to sort several words
alphabetically using only if, for, else, and several variables. So i
really got into it but im afraid that ill get discouraged if i see im
not cut out for it.

Regards
Przemek
 
U

Uri Guttman

pp> Right now for example im racking my brains how to sort several words
pp> alphabetically using only if, for, else, and several variables. So i
pp> really got into it but im afraid that ill get discouraged if i see im
pp> not cut out for it.

that is a classic part of the knowledge scaling i mentioned. sorting is
one of the core areas taught in every algorithm class. i won't give you
a fish but you want to learn the bubble sort. it is the easiest sort to
code up but one of the slowest to run. but the speed doesn't matter for
short data sets and it is very educational to know how to code it up and
learning WHY it is slow.

uri
 
P

p.podmostko

  pp> Right now for example im racking my brains how to sort several words
  pp> alphabetically using only if, for, else, and several variables. So i
  pp> really got into it but im afraid that ill get discouraged if i see im
  pp> not cut out for it.

that is a classic part of the knowledge scaling i mentioned. sorting is
one of the core areas taught in every algorithm class. i won't give you
a fish but you want to learn the bubble sort. it is the easiest sort to
code up but one of the slowest to run. but the speed doesn't matter for
short data sets and it is very educational to know how to code it up and
learning WHY it is slow.

uri

--
Uri Guttman  ------  (e-mail address removed)  --------  http://www.sysarch.com--
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training ---http://perlhunter.com/college.html---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com---------

Im aware of something like "sort" but i just a wanted to make it a
challenge to myself and use only the resources that i know at this
stage :)

Do you guys write out algorithms very often before sitting down to
programming?

Regards
Przemek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top