[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what is the best language for go: Re: [computer-go] Scoreestimating
The two languages are very similar. I have experimented with both and
I much prefer Ruby which I found a lot more intuitive and natural.
This could be because I learned Python first. But the tendancy is
like the first thing more and the second thing has to be clearly
better to win you over. It's interesting that we both did it this way
and came to different conclusions.
The idea that is suggested in these kinds of languages is to write
your software in them and then convert the time consuming parts to C
code when you need performance. I'm not sure this is all it's cracked
up to be. When you design something in Ruby or Python you will think
about it a whole lot differently that if you started in C. It's the
old top down versus bottom up design philosophy again. I've changed
over many years to thinking bottom up when it comes to performance
programming. Top down seems to "box you in" in a way I can't seem to
easily communicate. In this case it's easy to communicate because you
build it in the most convienent high level way supported by a
language, and then you can be "boxed in" when it comes to making this
work in C.
It could be that a reasonable alternative is to start right off
building the low level parts in C with a view to Ruby or Python
modules and classes. Then you have a module that is close to optimal
and you can do the creative stuff in Ruby (or Python).
There is at least one interesting projects that exists for perl, and
has a ruby counterpart that might be useful. It's a module called
inline-ruby. You can actually insert C code into your program and it
gets compiled as native code the first time it's run. It's a very
simple way to really speed up some parts of the code without too much
hassle.
Python has Psyco which sounds really cool to me. It's a lot like a
just in time compiler and I wish this existed for Ruby. It's the only
reason I could consider swithing to Python. It requires no changes to
your source code.
At some point you begin to wonder if it's worth it. The main reason
to turn away from C is to avoid complexities like this. When you
program like this, mixing languages, you are moving in the wrong
direction, making your code complicated again.
- Don
Date: Mon, 09 Aug 2004 12:10:23 +0200
From: Xavier Combelle <xcombelle@xxxxxxxxxxxxxxxxx>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4) Gecko/20030630
X-Accept-Language: fr-fr, en-us, en
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
X-Virus-Scanned: by AMaViS snapshot-20020222
X-BeenThere: computer-go@xxxxxxxxxxxxxxxxx
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: computer-go <computer-go@xxxxxxxxxxxxxxxxx>
List-Id: computer-go <computer-go.computer-go.org>
List-Unsubscribe: <http://hosting.midvalleyhosting.com/mailman/listinfo/computer-go>,
<mailto:computer-go-request@xxxxxxxxxxxxxxxxx?subject=unsubscribe>
List-Archive: <http://computer-go.org/pipermail/computer-go>
List-Post: <mailto:computer-go@xxxxxxxxxxxxxxxxx>
List-Help: <mailto:computer-go-request@xxxxxxxxxxxxxxxxx?subject=help>
List-Subscribe: <http://hosting.midvalleyhosting.com/mailman/listinfo/computer-go>,
<mailto:computer-go-request@xxxxxxxxxxxxxxxxx?subject=subscribe>
Sender: computer-go-bounces@xxxxxxxxxxxxxxxxx
>
> btw, if you want a mindblowing productivity boost then try Ruby!
I am agree, the mindblowing productivity is the main criterium for a
language.
But why Ruby?
During a long time, I looked for the best language,
I thought that I found it when I discovered Ruby (and the
pragamtic programmers)
Nevertheless I found the syntax ugly
(0 .. 9).each { | i | sum += i }
So I goback to java. But I still hate things about java:
The iterator, the bad design of collections, the way to use files, ...
But I discovered python.
The only frightenning thing is significant indentation, but after half
a day, I found that really avoid to type the brackets,
and that the mistake was caught at compile time.
And after 2 days, I really love the absence of brackets.
And the syntax was so elegant (like the rest of language)
for i in range(10): # the only strange point is that range(10) == [0..9]
sum += i
print sum
# there is no end instruction,
# the code is based on indentation
Clearly, I don't see what Ruby has more than Python, except syntax
which is really different than other language's syntax.
So you understood that I am a fan of Python.
I think it would perfectly fit with the design of a computer go program.
The advantagefor go programming are:
- Python gets the job done: (see explanation at
http://www.fsbassociates.com/books/pythonchpt1.htm)
- Easy prototype
- Development faster: twice as fast as java development (specially, looking
in the library API is very rare and far easy)
- Easy integration with C necessary to optimize things.
- A lot of C written libraries for computing expensive part
(for working with matrix computing, imaging processing, ...)
- Easy to learn (two days is enought to reach the same knowing stage,
I reached usually in two weeks)
- The code looks like pseudo-code: very easy to understand even for
programmers wich are not aware about Pyhon
- Syntax close to usual languages: Perl, Lisp, Caml, or Prolog are
very good and powerful, but I am too afraid that only Perl, Lisp, Caml
or Prolog programmers
can understand hwo work my program
- No compilation step
I tried to keep this list short ;-)
Computer go seems to be just at the experimental stage,
so the ease of developpement should be the major criterium.
So, the major advantages are certainly easy prototype and fast development
and the minor one the C integration.
The drawbacks are:
- No standard IDE (as eclipse for java)
- No standart way good GUI (as SWING)
- for somepeople, hard to multithread application (but that is quite
subjective,
I don't think so)
- The range function parameter
I hard found things to put in this list ;-)
I would say that they are minor drawbacks:
- the IDE is not a major concern, I work just with plain text files
and there is no really drawbacks ( for exemple, the lack
of autocompletion is not a such big handicap as in java)
- there is still good GUI for example wxPython/wxGlade. The only point is
that for the moment, no GUI is commonnly accepted as the standard in
the Python Community.
- Usually, the range do exactly what I expect, and moreever, we can iterate
on a lot of different sequence
So I wonder why aparently there is project to build a go program in Python.
gotools exists (http://gotools.sourceforge.net/) but it's not really a
programm,
just tools.
If someone is interested for creating a go program in Python, maybe we
could do something together.
Xavier
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/