Does Python compete with Java?

?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Jakub said:
Is there really no chance this goes into python on an "if you really
have to do this, be warned, but here are the tools" basis?

Certainly. Write a PEP, and an implementation.

Alternatively, write a different parser front end that converts your
enriched language into standard Python.

Regards,
Martin
 
J

Jakub Fast

Certainly. Write a PEP, and an implementation.

I cosider myself silenced :).

[but then, i'd have trouble filling the "Disadvantages" section in the
PEP...]
Alternatively, write a different parser front end that converts your
enriched language into standard Python.

i did think of that :).

kuba
 
D

Daniel Yoo

: On quite another note, is it possible to define your own operators in

: learning them actually might turn out useful for whatever they want to
: do in the future -- more useful than, say, prolog) and nothing can beat
: the intuitive appeal of

: S ==> (NP and VP) or VP

: over CFGProduction(S, NP, VP), CFGProduction(S, VP) for specifying your
: simple cfg, dcg or ebnf rules if you're completely new to programming
: and have just been given a programming assignment :)

Hi Jakub,

You may then want to give your students a prewritten parser that takes
a string like "(NP and VP) or VP" and reproduces the kind of data
structure that you want. John Aycock's SPARK toolkit is a really nice
tool for building such a tool:

http://pages.cpsc.ucalgary.ca/~aycock/spark/


As an example, you may find:

http://hkn.eecs.berkeley.edu/~dyoo/python/propositions/

interesting --- I wrote it a LONG LONG time ago, but it may be useful
for you. It is not production code by a long shot, but may still
serve as a beginning.


Good luck!
 
M

Maurice LING

A. Lloyd Flanagan said:
No argument here :)

I don't quite understand, does Python have to compete with Java? In many
cases, the programming language used to write an application almost has
no relevance to the acceptance of the application. Although we thought
(think) that a compiled language is faster, better than an interpreted
language like python, it has some contradictions. I was researching for
an assignment some time back on 2GL and 3GL and the general dogma is
that the lower the language, the faster it should run, but a paper in
ACM digital library showed that a program in Ada can run substantially
faster than one written in assembly.

What I see is that Python and Java can be synergistically linked, for
example, through Jython, can be more constructive than competition...

Maurice
 
G

Graham Fawcett

Jakub Fast said:
I've been pondering using python+NLTK to teach a computational semantics
class this summer (precisely because i think the basics of python would
be easy for the students to learn quickly, and, class aside, that
learning them actually might turn out useful for whatever they want to
do in the future -- more useful than, say, prolog) and nothing can beat
the intuitive appeal of

S ==> (NP and VP) or VP

over CFGProduction(S, NP, VP), CFGProduction(S, VP) for specifying your
simple cfg, dcg or ebnf rules if you're completely new to programming
and have just been given a programming assignment :)

Using a domain-oriented mini-language (parsed from within Python) is a
simple way to "extend" Python syntax.

An new instance of a DgcGrammar class, for example, could represent a
new, empty grammar; it could have an eval() method which could parse a
string of DGC rules to be added to itself: e.g.,

g = DcgGrammar()
g.eval('s --> np,vp. np --> det,n. ...').

Perhaps not what you had in mind; but personally, I think the
separation of syntaxes enforced by the method call is a a benefit. You
get Prolog (kind of) and Python both, without having to force one to
imitate the other.

There are Python tools for generating parsers from EBNF grammars, for
example, which could be used to whip up a domain-language parser in a
jiffy.

And, of course, your students get the added benefit of having the
parser's source code available -- for reuse, Python instruction and
light bedtime reading!

(On another note, I seem to recall there's a Prolog implementation in
Python somehwere; perhaps there's some reusable DGC-related code
there.)

Just two cents,

-- Graham
 
P

Peter Hansen

Maurice said:
I don't quite understand, does Python have to compete with Java? In many
cases, the programming language used to write an application almost has
no relevance to the acceptance of the application.

That's not the whole picture though. One would also like to be able
to easily find programmers capable of working very effectively with
the language, so that maintenance can be performed, and enhancements,
and new projects using the same language.

This "competition" he's talking about is not really going on in the
users' minds, but in the developers' minds. Imagine how difficult it
would be to get anywhere with projects if there were so many popular
languages that the odds of a given developer knowing your language
were, say, less than 2%...
What I see is that Python and Java can be synergistically linked, for
example, through Jython, can be more constructive than competition...

That is yet another of Python's strengths. ;-)

-Peter
 
K

kk

That is exactly my point! If I were starting a company that needed a
staff to write custom software or software for sale, I could choose to
use Python as the predominate tool. Assuming this was a rational
decision, and not an emotional one, this could lower my costs by
making programmers more productive, and making maintenance cheaper.
However, if there are no programmers in my area that know Python, how
could I justify that decision? I would have the expense of training
programmers on the job, as well as having a hard time getting
applicants for the job.

Python doesn't have big company dollars behind it like Java and C#,
and some say it never will. It could be argued that the same thing
was said about Linux a few years ago. Now, you can't pick up an IT
rag without reading something about Linux and Open Source.

compete -> as in developer mind-share.

I would hope that someday Python would be a "tool" that "most"
developers would want to have in their "tool box".
 
M

Maurice LING

I understand what you are trying to get at. In my mind, the
"competition" between languages had existed since the 1st day I wrote
Hello World in QBasic. Maybe there are two types of computer guys in
this world, those that learn the minimal and those that learn as much as
possible. I think I belong to the latter group even though I'm a
molecular biologist/bioinformaticist by trainings. Simplicity in syntax
is Python's strength to cater for the former group. Another thing that
can be done is to improve the libraries. In this world of 3000
programming languages, what makes Python worth learning?

Personally, I do wish to see that Python AND Java becomes mainstream,
although the latter has. A "marketing" strength which wasn't quite
tapped into is universities. If Python is taught in universities, then
it isn't tough to become mainstream. That's how mysql got so popular, or
at least I think that's how. Python enforces good programming
techniques, such as, readability. Yet, themes as such are taught in C,
perhaps one of the most unreadable language. Trying to debug a badly
indented C program is a horror, not to mention people do write a
recursive function in a single line!!

Maurice
 
K

Kyler Laird

I've only caught bits of this thread and I don't really want to address
any one post in particular but I thought a timely example is in order.

I have been needing to get more control over bookmarks in the PDF files
I concatenate. I've tried a bunch of tools but my current favorite is
iText.
http://itext.sourceforge.net/
It's written in Java and I thought I could make some simple mods to the
example concatenation program with my *very* rusty Java skills. Nope.
I spent an afternoon trying to figure out how to do it without any luck.
I gave up.

After I regained some strength, I decided to throw Jython at it. I had
not used Jython for anything more than to verify that it really worked.
Within minutes I was interactively poking my way through iText libraries
with Jython, discovering what I could do. My enhancement was fairly
easy to implement and it reminded me how much less effort it takes to
accomplish things in Python than in Java.

Bottom line...I don't give a hoot about a language "competition." I'm
going to keep using Python because it allows me to accomplish Great
Things. It even lets me do those where C or Java are "required." I
like it.

--kyler
 
K

kk

I was responding to your point made earlier.

I was the one that started the thread, look again.
 
P

Peter Hansen

> I was responding to your point made earlier.
>
> I was the one that started the thread, look again.

Ah, thanks. Mozilla had dropped the earlier messages, but Google
Groups helped me out.

And yes, I see that that was exactly your point. :)

-Peter
 
R

R.Marquez

I would hope that someday Python would be a "tool" that "most"
developers would want to have in their "tool box".

The day "most" developers use Python is the day it stops being a
competitive advantage. ;)

Seriously, if you are starting a company with a good product idea in
mind, Python would be an excelent choice to get you going. (Wasn't a
certain search engine company started that way?)

-Ruben
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top