Image Image Image




Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 1:15 am 
Offline
Senior member
User avatar

Posts: 356
Favourite Bot: OpenHoldem
And what do all you guys think about python?


Top
 Profile E-mail  
 
 Post subject: Re: Write his own bot in java: Existing framework ?
PostPosted: Tue Feb 02, 2010 1:23 am 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
Panik wrote:
indiana wrote:
Well this wasn't a general language statement. There are still applications for which C++ if better over Java and C#, but it's definetly not better for developing bots.


Why is Java better?


Mostly because of faster development process due to the language being simpler and an increased availability of standard libraries and shared tools.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 1:43 am 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
Panik wrote:
And what do all you guys think about python?


I personally don't like it but can't say i know it really indepth.
I've used a bit of Perl and a reasonable amount of PHP, before.

I prefere compile time strong types than scripting style languages and i like C styled syntax definately more than python's (supposed "elegant") syntax. The latter is just a matter of personal style but i strongly believe that the former helps in keeping controls over large projects by better engineer, test and organize them.
Also, i don't think there are many botting related libraries for python.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 9:40 am 
Offline
Senior member
User avatar

Posts: 172
Location: France
Favourite Bot: Lucy Liubot
Ockham wrote:
Also, i don't think there are many botting related libraries for python.
AFAIK, there is only one in lab 21 dedicated to poker botting. But there is still some interesting resources in Python that can be used to do botting.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 1:03 pm 
Offline
Senior member
User avatar

Posts: 165
Location: Vienna, Austria
Favourite Bot: it's toasted
indiana wrote:
For botting Java is much better, [...] it's just more productive language, easier to debug, etc. Dealing with low level process crashes is so much 199x :)

Can you point me to a Java IDE that supports real-time debugging, i.e. pausing a running program in order to look at variables and their contents? Thanks.

Ockham wrote:
C#
[...]
cons:
- no hardcore optimization is available for intensive algorithms


I disagree, and I will give you a reason why I use C# and not Java for botting. I have some "unsafe hardcore functions" in my neural net library, as supported by C# under Windows. These functions basically use the same tricks that make optimized C++ code so fast. They avoid array boundary checks and use pointer arithmetics etc.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 2:24 pm 
Offline
Senior member
User avatar

Posts: 147
Location: Brazil
Favourite Bot: coded one
Quote:
Can you point me to a Java IDE that supports real-time debugging, i.e. pausing a running program in order to look at variables and their contents? Thanks.

Eclipse, NetBeans, etc...

Btw, why not make a big list with the pros and cons of each language and make it sticky...
everybody will defend their own language, so theres obviously no clear winner in the discussion...

_________________
English is not my main language. Sorry.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 3:05 pm 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
testacc wrote:
Can you point me to a Java IDE that supports real-time debugging, i.e. pausing a running program in order to look at variables and their contents? Thanks.


Eclipse. It rocks.

Quote:
I disagree, and I will give you a reason why I use C# and not Java for botting. I have some "unsafe hardcore functions" in my neural net library, as supported by C# under Windows. These functions basically use the same tricks that make optimized C++ code so fast. They avoid array boundary checks and use pointer arithmetics etc.


There is still a significant difference between "hardcore" optimization done with an half-interpreted language running in a virtual machine and what you can achieve with machine compiled C and good hardcore programming. I'm sure that you won't need the added speed most of the time, especially on botting, but it's not comparable with unchecked C# code. And it's sure more difficult to write and maintain.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 5:45 pm 
Offline
Senior member
User avatar

Posts: 165
Location: Vienna, Austria
Favourite Bot: it's toasted
Ockham wrote:
There is still a significant difference between "hardcore" optimization done with an half-interpreted language


What does half-interpreted mean? PHP is interpreted. But in both Java and C#, the functions in question will be compiled to native code at startup or sometimes a little bit later.

Ockham wrote:
it's not comparable with unchecked C# code.


Both Java and .NET can take advantage of a long history of compiler optimization, why should the compilers of new languages make less efficient native code?


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 6:41 pm 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
testacc wrote:
Both Java and .NET can take advantage of a long history of compiler optimization, why should the compilers of new languages make less efficient native code?


The short answer is safety.

In Java every time you extract an element of an array the JVM checks the index is => 0 and < length. If you are doing big matrix calcs this is a significant cost. You don't have to accept this overhead in C.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 7:38 pm 
Offline
Senior member
User avatar

Posts: 147
Location: Brazil
Favourite Bot: coded one
Quote:
The short answer is safety.

In Java every time you extract an element of an array the JVM checks the index is => 0 and < length. If you are doing big matrix calcs this is a significant cost. You don't have to accept this overhead in C.


I heard this will be done in compile-time in Java 7 resulting in lots of performance gain..
http://www.taranfx.com/java-7-whats-new ... -5-1-6-1-7
http://lingpipe-blog.com/2009/03/30/jdk ... rithmetic/

_________________
English is not my main language. Sorry.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Tue Feb 02, 2010 8:17 pm 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
testacc wrote:
What does half-interpreted mean? PHP is interpreted. But in both Java and C#, the functions in question will be compiled to native code at startup or sometimes a little bit later.
[...]
Both Java and .NET can take advantage of a long history of compiler optimization, why should the compilers of new languages make less efficient native code?



I simply meant that they are compiled in an IL and then recompiled to machine language at run time.
Compiler optimization technique are costly and are best used by static compilers.
JIT compiler does not offer the same optimization level of static compilers, and never will, because they need to account for VM features (safety, garbage collection, exceptions handling...) and at the same time need to compile in a reasonable amount of time to be usable, thus they don't optimize everything and/or don't use every technique available.

Said that, i currently prefere Java because i enjoy the added features of the VM most of the times.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Wed Feb 03, 2010 4:45 pm 
Offline
Senior member
User avatar

Posts: 165
Location: Vienna, Austria
Favourite Bot: it's toasted
spears wrote:
In Java every time you extract an element of an array the JVM checks the index is => 0 and < length. If you are doing big matrix calcs this is a significant cost. You don't have to accept this overhead in C.


We were talking about unchecked C#, as in no boundary checks, therefore as unsafe as C.

Ockham wrote:
I simply meant that they are compiled in an IL and then recompiled to machine language at run time.
Compiler optimization technique are costly and are best used by static compilers.

Is this just a hunch or did you read this somewhere?
Hmm, a static compiler has to convert source-code into machine code; while the JIT-compiler only has to convert the intermediate language (eg. java byte code) to native code. The intermediate language can already be partially optimized, and is certainly faster to process. But C# supports AOT anyway (ngen), and I believe so does Java, so that's no argument for the language war :D


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Wed Feb 03, 2010 5:16 pm 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
Quote:
Ockham wrote:
I simply meant that they are compiled in an IL and then recompiled to machine language at run time.
Compiler optimization technique are costly and are best used by static compilers.

Is this just a hunch or did you read this somewhere?

Have you ever tried to compile a big project with all optimization on? It can take several minutes.
If a JIT compiler would use the same level of optimization it would be untolerable slow.

JITs tries to choose what to optimize and what not, and for different parts of the code use different level of optimization. It is indeed a wonderful technology but it's not a static compiler.
A static compiler simply does everything that can be done to optimize code size and performances, a JIT must choose between quality of machine code and time taken to get it.

Quote:
The intermediate language can already be partially optimized, and is certainly faster to process.


I have never seen .NET IL but i've read/used JAVA IL. There's nothing optimized in there.
I expect .NET IL to be quite similar.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Feb 04, 2010 3:29 am 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
This might not interest anyone, but I'd like to correct a wrong statement before... poker-eval is not written in C++ but in C (well, arguably C++ encompasses C, but...).

poker-eval can be used within a C program

C was not mentioned earlier in the list of languages for botting, and it's a lot of fun (who needs objects anyways)


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Wed Feb 24, 2010 11:02 pm 
Offline
Senior member
User avatar

Posts: 356
Favourite Bot: OpenHoldem
Ockham wrote:
Also, i don't think there are many botting related libraries for python.

I think this is the primary drawback of the language

iamnobody wrote:

Thanks for the link!


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Wed Feb 24, 2010 11:29 pm 
Offline
Senior member
User avatar

Posts: 171
Favourite Bot: RoboJeff (@OH)
hawkpkr wrote:
I heard this will be done in compile-time in Java 7 resulting in lots of performance gain..
http://www.taranfx.com/java-7-whats-new ... -5-1-6-1-7
http://lingpipe-blog.com/2009/03/30/jdk ... rithmetic/


Such problems are (in general) impossible to decide at compiletime.
Though it is true, that a good portion (with practical relevance) is decidable.

In recent times I tend to use more and more asserts in my code (C++),
it warns me in debug mode and doesn't matter for releases.

_________________
In the sweat of thy face shalt thou eat bread.


Top
 Profile  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Feb 25, 2010 2:36 pm 
Offline
Senior member
User avatar

Posts: 458
Location: Now in the mighty PolarBoar variant!
Favourite Bot: ...
TheHighFish wrote:
In recent times I tend to use more and more asserts in my code (C++),
it warns me in debug mode and doesn't matter for releases.


Same here (only Java instead of C++) - I'm a big fan of assert. I differ in approach to reacting to failed assertion though - I generally keep my asserts even for production mode and try to catch AssertionError thrown by JVM when assertion fails. In error handling code ('catch' section) I notify the bot that something very wrong has happended and it needs to try to finish current games ASAP, and must not log into new ones. I think it's the most safe approach.

BTW, I was suprised that C# doesn't have an assert keyword (or equivalent).


Top
 Profile  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Feb 25, 2010 3:14 pm 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
In C# you can use uncaught exception to emulate assert behaviour.
It is exactly the same thing.

Specifically in Java, a failed assert indeed throws an uncaught exception.
The only difference is that you can tell the compiler to remove all assert automatically when going into production if you want added performance.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Feb 25, 2010 4:16 pm 
Offline
Senior member
User avatar

Posts: 458
Location: Now in the mighty PolarBoar variant!
Favourite Bot: ...
Ockham wrote:
In C# you can use uncaught exception to emulate assert behaviour.
It is exactly the same thing.


In the spirit of languge war thread :) :

The assert statement is much more concise. Compare:

Code:
assert condition;


with
Code:
if(!condition) throw new AssertionException();


Top
 Profile  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Feb 25, 2010 5:11 pm 
Offline
PokerAI fellow
User avatar

Posts: 1562
Location: Finland
Favourite Bot: Self-made
PolarBear wrote:
BTW, I was suprised that C# doesn't have an assert keyword (or equivalent).
Debug.Assert not equivalent enough for you?

http://msdn.microsoft.com/en-us/library/e63efys0.aspx

With the added benefit of getting them out of the code in release builds.

_________________
Opinions expressed are my own, your mileage may vary... ;)
Warning: If I spot an opportunity to give sarcastic replies, I will take it. Nothing personal. I don't even know you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: