Author: Vincent Diepeveen
Date: 10:23:57 07/02/03
Go up one level in this thread
On July 02, 2003 at 12:56:07, Andrei Fortuna wrote:
>On July 02, 2003 at 12:19:14, Vincent Diepeveen wrote:
>
>>On July 01, 2003 at 15:29:28, Andrei Fortuna wrote:
>>>The problem seems that when you get to the tiny details it is hard to write a
>>>very complex eval function in C/C++. Actually not hard to write but hard to
>>>debug and hard to add new terms for eval and modify values for existing ones.
>>>Not to mention hard to quickly test new ideas for eval.
>>
>>Not so much C/C++ is the problem, but the actual 1/0 behaviour of a computer
>>where a human can weight everything.
>>>So I was thinking that a meta language for eval would be a wonderful tool. What
>>
>>And wonderful slow.
>
>Have you read my message until the end before writing the above line ?
>
>>>I have in mind is something that would translate my human-like meta language
>>>into machine code that will replace my current evaluation function. Maybe even a
>>>translator that will generate valid C/C++ code tailored for my engine !
>>
>>Nah even better would be a robot creating the entire evaluation for us while we
>>lie down at the couch :)
>
>That's the whole idea : have a program generate the C/C++ eval function from a
>meta-language.
>
>>>Now : I know this or something very similar have been tried before. My questions
>>>to you, my friends, are :
>>
>>No it has not been tried before. Nimzo had some simplistic preprocessor language
>>one day but you could not define loops or scanning with it. Just simple
>>patterns.
>
>There is also CHEVAL written by J.C.Weil which is more general than that, but
>that one generates more likely piecesquare values using a set of general rules.
>
>CHE/CHE++ used in Nimzo looks pretty close to what I have in mind (they even
>have this code compiled to a custom format) but I think their syntax could be
>made nicer.
>
>>>1) Do you have references to previous work on this area ? I am sure that I have
>>>read a paper which describes specifying eval func in human language so there
>>>certainly must be previous work
>>
>>Everyone keeps a big lock on their evaluatoin source code in general.
>>
>>>2) What tools would you recommend for writing my translator ? I don't have the
>>>resources to write from scratch a compiler for the meta-language so I would have
>>>to use something existent. Lexx/yacc ? Or something else ?
>>
>>The question would be whether the language in the end wouldn't be looking very
>>similar to C or C++. In short, why not directly write it in C/C++ then?
>Because it gets complicated when you have so many terms in the eval function to
>add/remove/modify some to see how it goes without. Also you have to mirror code
>written for white pieces eval for black pieces (at least I did in my program,
>maybe you have been smarter than me and have a piece representation that would
>require calling twice the eval, once for white and once for black) and the
>translator would do the work to mirror eval automatically.
Yes i have been a lot smarter than you seemingly. Note if you would have read
just a month ago or the month before that you would have seen me write down the
criticism about crafty that its thing is doing everything for every color
specific (like move generation) which makes it a very bad programming example.
>Anther reason is that the syntax would be much simpler than C/C++ (even if there
i have no idea what you talk about. want to make a graphical board where people
can put pawns at the board and say: "this pattern?"
>will be variables etc) and there is a posibility to share eval functions between
>different people to try in their own chess engines.
you want to make a special functionality in the interface called 'cut&n pasting'
?
:)
>>>It just occured to me that we could start an OpenSource project for this
>>>meta-language. Imagine : having an universal language to write our eval
>>
>>Then i bet after 6 months when you have written yourself 100 source code lines,
>>then some Dann Corbitt takes over your project as no one else cares for it. Then
>>he will convert your pretty code to bitboards and your program slows down 5
>>times first then secondly the meta language will be bad documented and end up
>>being even worse than writing it directly in C.
>
>Why this mean attitude Vincent ? 100 source code lines in 6 months ? At least
>give me some credit please ! I have written a chess engine from scratch (even if
>5 years ago) and also the search engine and a few more programs chess-related
>recently and I have been living from programming in the last 6 years, so I find
>this paragraph pretty much insulting. I know this is usually your style when
>replying but still ...
Nothing mean in my attitude. Just realism. See below.
>>>functions , and then each programmer writes (or modifies existing
>>>compiler/translator) to produce code (c/c++ or binary code) tailored for his
>>>engine and the structures used in his engine from this meta-languages !
>>
>>Which programmer do you refer to? Know an open source programmer that is rated
>>above 1200 and is interested in helping you?
>As usual you don't listen but pose as guru.
>What I wanted to say above (and you could perhaps have understood it if you
>would pay more attention to other's sayings) is that if we have this library of
>code in the meta language and any programmer that wants to test those eval
It is exactly this what i already warned for but you're not listening.
If we had a black box that is giving gold at demand, then we can make a big
difficult industrial process which we go patent and get credit for, and which
will deliver us... ...gold!!!
You are just busy reinventing a new industrial process here after you already
got the gold.
Only when your evaluation will be 100+ lines. Or perhaps even hit the according
to Uri Blass chess solving size of 2000 lines, then you might start to slowly
understand the problem.
Someone who can write patterns in a batch language, can write it in C too.
There were very little Che volunteers. Now *that* language sucked, but you could
GRAPHICALLY define it.
Perhaps you still didn't get the remark that Che was a preprocessor language. I
bet you do not know what i mean by that.
>functions already written has to adapt/write the translator from the
>meta-language to a source code file that can be compiled with his chess program.
>The translator would convert the meta-language implementation-free style to a
>code taylored to the engine for which is intended. The translator will know
>about the internat structure of that chess program and will be able to write
>code optimized for that target.
Assuming of course first that you find that box that produces the gold for you.
But that is a matter of a feature that will be able to copy a part of a program
to another program. Or in less difficult words: after you first write your own
cut'n paste macro editor :)
>>What do you think ? Is this a crazy idea ? I see that the hardest part would be
>>
>>It is a nice idea, regrettably it is not going to work for a number of reasons
>>which are trivial.
>>
>>My tip to you would be that you do some effort yourself before asking some
>>others to write something for you. As we have a saying here:
>> "someone else will do it for you" :)
>
>I have not, and I say again : _NOT_ asked anyone to write or start this project
>for me. If I will start it I'll write the prototype myself and only after it
>will work reasonably in my own chess engine I'll make the project open source. I
>can't see any other way for it to work.
you swear that if the engine is successful this suddenly gets open source?
Just like all the chessbrain stuff is supposed to get open sourced?
>How did you came with the idea I was trying to lure anyone in writing code for
>me ? Please read and understand messages before answering them, it would save
Because you assume you get a black box that produces gold for you :)
>you from beeing embarrassed later (or perhaps you are one of those people who
>can't be embarrassed no matter how rude they behave).
>
>>>to define this meta language so it will be useful to all (simple enough human
>>>like language to describe eval functions) but easy to convert to (binary/C++)
>>>code. But once this is done we will have huge freedom to test our ideas and even
>>>non-programmers will be able to use it into practice ! Imagine giving such a
>>
>>How in jupiter will non programmers be able to program evaluation for you in an
>>imperative language?
>
>Again the "program for you" stuff. Oh well ...
>
>I ment that the meta-language will not be so hard to learn as C/C++ for a chess
>GM which is not a programmer. For 3D games it was a similar situation with
You didn't read my comments on how the average GM explains to me how he found
that very good move?
"i feel that this is the best move"
How's your black box going to parse that?
>scripting languages, even non-programmers started writing code.
I'll contribute a function for your basic language
Function FeelGood
if PositionSmellsGood()
then print I feel good!
end
fi
Ugh
My question about your language would be. Do you allow global variables without
being initialized?
>>Note that you need imperative language, because if you make it a functional
>>language the average slowdown will be around 10000 times when compared to
>>optimized C code.
>>
>>>tool in the hand of a grandmaster to tune your engine ! Not to mention how easy
>>>will be to understand the ideas from other's functions (have you ever tried to
>>>understand what somebody else's program does ? then you know what I am talking
>>>about).
>>>
>>>Or am I just daydreaming ?
>>
>>For sure
>
>No further comments.
>
>If you want to really discuss the problem : ok by me, this is my intention.
>But if you will continue to flame me I won't gratify you with any further
>answer.
>
>Andrei
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.