#programming
1 messages ยท Page 217 of 1
ithinkthatssomethingdifferent
"trust me ffrfr'"
sir I think this can be refactored
posix universal abi 
what does teh b stand for ._.
no sorry i was just hopping in my vehicle to grab my copy of walle
clang has worked, and apparently shiro's example bot is dogshit
threads doesnt work in cpp
its over
its for the bindings
yes it picks a random move
no you just have the same issue we all are having 
ah i see
i played 2 rng bots against each other for like 100 games i think the average game was over 200 moves
i've finally caught up
yes we talked to shiro about this, shiro doesnt want to

its true functions are more portable for ffi than c structs and globals
its 1 more token 
the board is on top of a picture of vedal and shiro at the christmas party (embarassing) so he cant expose it
the reason this was done was legitimate but classified
whar
shiro be yelling "I CAN CODE" to vedal frfr
i think im prob gna end this game...
neuro too
it's stucked on 69

-11:34:16 time left slaps hard
fun fact: your code can't be more than ~7mb if i did the math right
how so?
i set it to unlimited
no more than 64bits per token
no more than 1000 tokens i think
long variable names tho
i.e. Happy Birthday Shiro var1, Happy Birthday Shiro var2 etc
its a rule
Trying to get the files fully setup is already draining me, I haven't even started coding yet ๐ญ
variable names don't hold data
1024
real
Im wondering how do you train this thing
it's kinda broken on windows rn
I'm forced to halt
you should probably make it a timed game
yeah i adjucated draw and started a timed one
shiro does it the api thinguy run on mac correctly
haven't tried on mac but I would think mac is more similar to linux
true
grammar is not present in the above above sentence
use en-croissant if you really want to do stockfish vs stockfish
you need to actually expose the apis
real and true, everyone should do a search and replace with those variable names before submitting their bot
It should work fine if it doesnt have linux dependencies
I wonder how long it will take for the Kotlin bindings to be fully added
downloaded the setup, installed it, finished the installation, restarted the terminal, tried the command
neat
i'll use clang for now
not long, just have to review the changes
erm
what do that mean
Alright
Remember to also add it as a supported language to the main readme I guess
have you download MSVC build tools
no?
what am i downloading

why are you getting the LLVM source...?
idk man it's hard to get MSVC environment working ik...
idk i googled install clang

now im getting this
just don't use gcc
thanks downloading this now
true!
shiro using gcc smh what an idiot
imagine having to download mingw just in-order to compile a program

t's gcc is just old
is fixed by not using gcc
literally how
gcc is based wym

so how i do this but with msvc instead lol gcc -shared -o libchess.dll bitboard.c chessapi.c
NOT EVEN 2 MONTHS OLD!!
nah, definitely old 
you don't want to mess with msvc, install clang 
msvc

i just wanna use pythonnnnnnnnnnnn
aaaaaaaaaaaaaaaaaaa
why does threads tell me __cplusplus is not defined if im compiling it through cpp project
then gcc is fine but the particular gcc distribution isnt fine
threads.h is part of the c23 standard
https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.1
get you binaries here
do i also need to wrap shiro's source into project with some cmake or
just daily stress of programmers trying to get a library working on their end, and perhaps being a repo maintainer afterwards
huh?
that'd get super laggy so quickly
um if i could ask, if i would make a custom api interface for the chess tournament, i should just copy all the functionality of the existing ones for the api ddl?
sorry i have not really done this kinda stuff before
better idea? I only know jsonl rn
some format that just appends to the end of a file would be better
sql is always there by your side
could implement it in txt or csv or use an actual database
I am getting a fatal error: 'threads.h' file not found
I am on mac this time
you use the APIs provided to make a bot
csv/tsv is super ez cuz its just a nothing file
get clang from brew
json is bad for storing messages like that because every time a message comes in your program will go "hmmm time to scan through this 200MB json file, find where to put this message in, and then overwrite the entire contents of said 200MB file with the new contents that have 1 more message stored"
Kotlin bindings are real now
and you'd be doing that multiple times a second, probably
but le append works just fine you dont have to read it
also make sure to pass -std=c23 (try that before using brew)
if your question is about making bindings to the API for a new language then in general yes, if you make language bindings for the API it should just reimplement the provided functions and not add any other functionality
that said, one exception i've waived for this is memory management; if your language is garbage-collected and you wish to wrap some of the returned pointers in classes to be automatically freed by the garbage collector, that's fine
you can see the python bindings for an example of how this might work (found on the contest repo)
i see
it's fineeeee just some I/Os, surely nothing happens when I try to write 100000+ entries in parallel 
this mf writing the chatlogs of grok
how do i link it its run through cmd 
the entire corpus of messages it receives simultaneously in all convos
maybe then it'll be a prob
just check adjascent files bro
don't open a cmd from visual studio or smth
i made a bat
what about adding an append for the jsonl.
i heard cvs is painful for nested data.
I was going to try vector DB for semantic reacall, but I'd still need the jsonl or something I read up on, SQLite.
on right
append should be fine just dont open the file first
you need to pass in the other c files
Yeah I also added garbage collection in the Kotlin one
the commands i've found to work for testing:
i saved 250k messages in jsonl sequentially without problems
Very good in a language where nobody is used to manual memory management
yeah wanted to try my hand at making it for my preferred language
gonna looks thru the repo, thanks
how tf have you find that
do clang -o my_bot.exe example_bot.c bitboard.c chessapi.c -std=c23
trial and error
me irl
actually wait, it should be bot_exec not bot_exec.exe here
throw shit at it till it works
you can make it an exe, you just have to give it with exe to cute chess too
will test
nice it worked thanks
As long as you have a way to interact with C code in your language making bindings is really just a matter of copy-paste
every time anything ever happens w/ compiling reminds me that it was a good idea to swap linux
glad i could be of use
time to make bindings for NodeJS
Silly
that would probably be fun
Someone would have fun with that probably
wouldn't even be hard methinks
apparently you do not
path = _user_dir(uid) / "scratch.jsonl"
with path.open("a", encoding="utf-8") as f:
f.write(json.dumps({"u": user_text.strip()}, ensure_ascii=False) + "\n")
f.write(json.dumps({"a": assistant_text.strip()}, ensure_ascii=False) + "\n")
try:
summarize_and_persist_if_ready(uid, every_n_pairs=10)
except Exception:
pass```
This is the only complex function in my entire bindings ```kt
fun getLegalMoves(board: Board): Array<Move> {
val len = IntByReference()
val movesPtr = nativeBindings.chess_get_legal_moves(board.value, len)
val moves = Array(len.value) { i ->
val offset = i * MoveByPointer().size()
MoveByPointer(movesPtr.share(offset.toLong())).toMove()
}
nativeBindings.chess_free_moves_array(movesPtr)
return moves
}
oh, neat :o i think pascal has that. welp time to try
And it's only complex because of memory management
yeah the only part of this that has to parse the file is possible the summarize function depending on what it is
Every other function in the core API is a oneliner
the other part is just appending, should be a-ok

This whole thing is just a bunch of oneliners
I guess they have dumb-protections
it still does the same thing
i'm guessing it doesn't work if you try to compile without the suffix but then run the cutechess-cli command with the suffix
yeah "cannot execute command"
%localappdata%

well yeah, because if you compile it with the suffix, the file without a suffix doesn't exist
system breached
guys i did it 
illegal move
not always
the first move, not last
time to get to work re-writing the entire bot then
then try gcc maybe 
plot twist: the move is actually legal and it's just all the runners that are wrong
has competition started yet 
i do wonder
it has 
started yes
you can change your submission/entry until the deadline so it doesn't really matter
same error
i can only suggest using an old version of the repo that uses pthreads
@real sierra apparently macos has pthreads but not threads.h 
gotta ask shibo if he accepts that
might want to ifdef that
nope, shiro will run on linux with latest ver no issue there
i got it 
Time for platform-conditional compilation
you gotta be kidding me
after i refactored everything to remove pthreads
lmao
use pthreads if available and threads.h otherwise?
my nice code...
Oh the joys of C
gone
ok ill address that after the windows issue as i have some ongoing changes here
you have 500 lines of dense code in a single function to get valid moves, "nice code" is not even in the room with us 
At this point just have separate code within ifdef for every platform
it's fun how you might think c/cpp would have essentially universal support without issue given how prevalent and old they are
and then you try to do anything cross platform even on the same target arch and
relatively nice code
windows and linux is fine
macos on the other hand...
completely isolated land
it has their very own dev environment/workflow

As soon as you go cross platform C explodes
I like Kotlin, it just works (tm)
speed 
also it's not copy pasted, there's slight differences per-direction
blame pawns
I mean...
i blame prawns
if it works it works... (it doesn't work, it gives invalid moves)
โ๏ธ
โ๏ธ: 
the endianness of windows isnt different is it
i guess that might be processor specific
Yeah it's from the CPU
Why is my compiler complaining that threads.h doesn't exist fml
macos?
Windows, though I'm not using the WSL compiler thing so might have to do with it as well
how do i convert int to string in c ๐ wtf is this language where my to_string
At last I will have to actually install WSL
wrong directionstrtol and similar funcs
if your int is between 0 and 9, you can just do '0' + i to make it a char
Kotlin my beloved
It's called snprintf
Having a toString() is literally part of the Any? base class
copied from java
wuh wsl compiler?
Used wrong terms mb
nope i lied
Weirdness
You may just lack the header because getting STD headers on Windows is like super impossible
PS C:\> wsl compiler
/bin/bash: line 1: compiler: command not found

that's C++'s std
oh
can't believe Shiro would lie to us 
class Meta(type):
def new(cls, name, bases, attrs):
print(f"Creating class {name}")
return super().new(cls, name, bases, attrs)
class MyClass(metaclass=Meta):
pass

itoa is available in c it's just non-standard iirc
it's betrayal 
class Point:
slots = ("x", "y")
def init(self, x, y):
self.x, self.y = x, y
char *
Well change it then
?
so i need to make text a variable then shuffle some pointers right then move terminator or smh
not very humane
char*, or your own length-prefixed type
for operation like "x" + to_string(i) + "y"
it's C, it's not meant to be humane
just replace %d with %llu wuh?
thats just a debug print, that's not the point
the point is that the supposed llu is later stored in an int *

i dont think it would explain the problems but ill try changing it
It's fine
i am extremely sad and my day is ruined. how are people supposed to find out how to contact me on skype
That's just not how C works
Assuming you don't have over 2^32 legal moves
If you want that go to Python or Kotlin
i do not
You allocate a large enough buffer and write into that
now i remember
i saw it somewhere
I guess it's fine if your size_t doesn't reach over INT_MAX
you can do a check on that if you're uncertain
its so strange, particularly in the two engine case
root@localhost:~# python3 -V
Python 3.12.3
root@localhost:~# python3.14 -V
Python 3.14.0rc3
root@localhost:~# python3.13 -V
Python 3.13.7
root@localhost:~# python3.11 -V
bash: python3.11: command not found
Why would you even want to have it be an int in the first place
not only is one getting the wrong length of legal moves array but the contents are also wrong
the humble strcat
i dont really, it should be a size_t
but it'd be a change to the api header
should be an unsigned int frfr
so if it wont fix the problem then its not my concern for now
dont need to break more stuff
suboptimal memory usage
time to remove sub-modules and test which part is not working 
Unless you somehow end up with negative moves it shouldn't make a difference at all I guess
every boring fix sessions ever
i just dont understand what could be causing a windows-specific issue
Capital T
Ure small one bro
Ure are usable
you pinged a guy sweating in osu!lazer smh
i'm relieved
interuptions
?
Example of template string
from string import Template
Suppose Python 3.14 adds a new t-string syntax, like:
tpl = t"Hello, {name}! Welcome to {place}."
Later, substitute values
ctx1 = {"name": "Alice", "place": "Wonderland"}
ctx2 = {"name": "Bob", "place": "Neverland"}
print(tpl.substitute(ctx1)) # Hello, Alice! Welcome to Wonderland.
print(tpl.substitute(ctx2)) # Hello, Bob! Welcome to Neverland.
From chatgpt
ok so it doesnt restart bot counter stays
so its api fault
i removed the cycle in main and it said "bot disconnects" after first move 
oh i get it
its supposed to be while true
t-strings โ placeholders are kept as a template; you fill them in later with data.
if someone sends me the libchess.so will it work, or do I need to compile it myself
not that it wasn't already known, but the problem is definitely in the C api
ah, well thats the problem
?
do you not know what an appimage is?
Nai
is that what chmod +x does
chmod +x <file> sets the execute permission of <file> to true
that makes it executable
it's basically the linux version of a portable .exe
Wsl ?
huh? i mean appimages are bound to work in wsl, it's literally just linux
functionally they're literally app images so yeah
but the next best thing to compare it with is portable .exes
yeah i guess if you have no other context
the other thing i was going to say is like an Apk
didnt know what would be the best to contextualize it lol
still, the most intuitive thing to compare it with is portable .exes imo
you double click it and the app works

oh fuck yeah i complain about this bridge still being in progress every time i can
Houstonโs $1.45B Ship Channel Bridge is a rare megaproject that hit pauseโthen came back stronger. The 1982 four-lane box girder is being replaced by two cable-stayed spans with 8 lanes + shoulders, a 1,320-ft free span, ~187.6-ft vertical and ~530-ft horizontal clearance, and no piers in the channel. On January 7, 2020, Harris County issued...
unreal
engine
5
it's in the game (sadly)
give me 1% of that money and I can be rich

give me 1% of that money and i'll spend it all on alcohol and die by the time i hit 30

Buy whole server rack
a whole server rack to keep my alcohol in
Give me 1% of that money and I'll buy 3 muffins
3??
are you a german, by any chance? 
so these are legal moves it finds turn 0
Yes, 3. If you want I can share one of them with you tho
i hate beer
i do however enjoy the feeling of being intoxicated

hate alcohol in general taste-wise
basically it only found knight moves for some reason
drink enough and the taste doesnt matter after a point
that is true, i have experienced that
i still don't remember what i got up to that night
thus i must.. not drink for the sake of my liver
such a cruel fate
๐ฅ
shiro do you have something to dump the board into string in api
3 germans heading to your house rn
do they have beers with them?
i could use one right now 
"Doctor told me not to consume any alcohol, I started drugging instead" 
not the entire board, but you can dump individual bitboards with the function in bitboard.h
the issue comes somewhere before get_legal_moves apparently

why
unironically the only thing my psyche told me was "hey. that's bad. stop. bad. boo."
..paraphrasing but that's basically how that went
if i knew why an issue existed, it wouldnt
because it's where you get the legal moves 
you know what is before get_legal_moves
its chess_get_board
how do i see it
ok gotta work it
gl mate
this is me while sober surprisingly enough
i am under the influence of a whole monster can though
I am once again shocked by how oblivious I can be, I spent half an hour waiting for a certain step in an installation process to complete when it turns out I just had to press enter to go the next step ๐คฆโโ๏ธ
does that count as alcohol
bro started consuming caffeine instead

watch me turn my caffeine addiction into an alcohol addiction again
damn get_legal_moves is huge 
liver won't be having a rest soon I guess
the whole file is 3000+ lines iirc
we'll see
๐
oh
maybe with bitboard its 3k
shouldn't be
who writes a bitboard implementation with 1000 lines
don't tell me

bitboards are already empty when it goes to get legal moves i think
unlocked this
yeah
you may be correct
this should print out all positions that can be moved to by a piece
per direction of movement
bla bla same lines again and again
some of those being empty makes sense
only place with Xes
but not this many
thats all
but won't would it be the same outputs everytime
those 4 X correspond to the 4 knight moves
with memory issues you can never be sure

this gives me a place to look at least
mhm mhm
i suspect either the move making code or the pseudo-legal move finder
need to know now if the board is actually devoid of pieces
or if the pieces are there and the moves are just not being generated
wait but it only prints 16 pseudo moves
16 move directions
oh
How do I build and run toknt?
@tender river ^
opp_pseudomoves are much more alive though
but it truly is opp, goes from white side while bot is black
so opp works but own moves dont
how the hell it works on linux more stable 
so get_pseudo_legal_moves is broken
hmmm
can i make the bot play as white
look at him go
apparently he cant play black but can white
still failed though
so white is bad too
he tried to move bishop like its a horse
cuda 13 being 2gigs smaller than 12.9 is something
it's a horrible process, but here's a visual guide:
well as far as i can tell, the moves are being read and made correctly
lmfaooooo
so it must be get_pseudo_legal_moves
looking into it rn but its a bit messy for my eye 
chay when considering adding automated release to the build run: 
too much effort 
using bots in workflow is a headache in github
(ignore that it's like 5 lines to create a release too)
i'll start with pawns since they clearly cant move in correct directions on turn 1 and white pawns can
god only knows what in here could be platform-dependent
i guess windows cant do addition 
Is there no way to build it with sbt from the shell? (I'm on Arch linux)
good job windows
you also have to be signed into GitHub
sbt assembly should work
ill refactor all adding and numbers out of the code (counting to 10 is too hard for microsoft)
i'd have no clue but yeah probably
it's just a jar file
if your os can run java you should be in the clear
i built toknt from source
once sbt is installed you run it and it gives you an sbt shell or something
and then you run uhhhh
assembly ?
and it spits out a jar somewhere
hidden in 100 directories
just run sbt assembly, no need to enter the shell
horrible process
bruh seriously
(assuming you use 3.7.3)
sbt assembly worked 
i mean this is why releases exist, so you don't have to dive into actions
unsigned long?
i am once again reminded of that one post "i am new to github and i have lots to say"
Try ull
i had to change all the other longs to long longs elsewhere
but totally missed the ul-postifxed constants...
WHERE IS THE .EXE I DONT GIVE A FUCK AABOUTT THE SOURCEE
MAKE A FUCKING .EXE FILE AND GIVE IT TO ME

install ide and libraries and compilers and cmakes and bitboards to run calculator
i want to buy a new phone and new heaphones but i need the old ones to break first 
damn consumerism 
โ
i'll push shortly
it was all the constants ending in UL
on windows, longs are half the size
man this dll stuff is confusing to get my hands on xD
so various masks effectively only operated on the white half of the board
๐ช smh
I believe you need it to be a .so
isn't that only linux?
ok how do i connect it to cpp now 
idk, but the instructions say to make it a .so
hmm maybe clang will save me
i've pushed a new version of the C API
please let me know if this fixes the outstanding issues
so I don't need to install linux?
windows lives 
actually yeah linux is required sorry
i dont wanna say anything until i have some more proof it works
"works on my pc" has not been a good metric so far
I still get the fatal error thing
can you show me the error?
how does it explain a bishop who decided to make a knight move 
if these constants seemingly only appear in pawns
oh
I dm'd you, I can't upload images here
namely, the masks in get_pseudo_legal_moves
So I built the C example_bot but how do I connect that to cutechess? 
i was going to check pawn bitboard and it would be empty, then i would check its parts and probably discovered bad constant too
shiro was faster 
open cutechess, Tools>Settings at the top, "Engines" tab, click plus at the bottom, and set the Command to your executable
maybe im just not knowledgeable about this stuff but am i missing something installed, it says i need threads.h? sorry if thats like a obvious question
i got threads error when i tried to build it in C
which operating system are you using?
win 10
i can show error in visual studio when building with its embedded compiler how is it called msvcsn something
it does mac as well dw
and macos seems to only have pthreads
c++*
cutechess won't let me open the binary as an engine. Does it need a special name or something? (it's example_bot right now)
ok back to installing linux
you must build it
to exe
I did
it shouldn't require a special name
No exes on Linux ๐
press the plus button bottom left
you may have to set the working directory to the same directory to make sure it can find libchess.so
totally nothing needed right ootb surely
the plus button is black and the background is black too, terrible design
oh are you on mac
then im no advisor here 
I haven't built a libchess.so (haven't found any guide on that). I built bitboard.c and chessapi.c to libchess.a
i will try to figure out how to fix threads and build in cpp
I can build an .so though if that helps.
@tender river merge pr for toknt ci releases when you see this 
ah no you're right, there shouldn't be a need if you're just using C
i apologise lol
can you try just running the executable on its own to ensure it isnt crashing in some way on start?
you can use the following test input to get it to pass the first blocking api call:
uci
position startpos
go infinite
When I start the executable on it's own it just idles. So no crash or anything.
ok tested new chessapi.c file, works
Yeah that works.
please see the above test input 
on win?
if it's not crashing then it's odd that cutechess cant start it
yep
is it marked as executable (chmod +x)?
Okay now it worked for some reason..
Maybe I had to start cutechess in the same working dir?
cutechess is an unexpectedly heavy build lord wtf is in this thing

Type type 
now then...
c++ 
making this work on mac as well
we out here Type typing
anyone know how portable __has_include is?
i don't think there's anything more portable than that but i could be wrong
okay apparently it's part of the c++ standard but not the c one but it doesn't matter because every noteworthy c compiler is also a c++ compiler anyway 
wtf
how do i tell if i should use threads.h or pthread.h if i cant tell which exists and which doesnt
"it's fine" and then the 50 people with incompatible systems wander in here asking what happened 
so when buillding as cpp the only issue is crt_secure warnings which can be bypassed
and threads.h
threads.h is included in chess_api.c and doesnt get __c_plus_plus define for some reason
hmmm
so i need to include threads in cpp file
but chess api should remain c
__STDC_NO_THREADS__ for checking if there's no support for threads.h i guess
#ifdef _WIN32 ?
sometimes you need to let little johnny with his 20yo freebsd system suffer the consequences 
ifdef mac pthread
else threads or smth
damn i was too slow
that works 
I couldn't figure out how to get a linux vm running
i'm so glad i don't hate rust
no
it should already be valid cpp as is
how do i tell threads.h that its cpp
if its included in c file
threads error
not defined
threads.h included in chessapi.c
that's fine
main cpp file calls functions from chessapi.c through chessapi.h which has extern c thingy
the compiler defines that macro
visual studio should come with clang too 
or maybe that's an optional thing you need to enable
good thing i just commented out all the pthreads code instead of deleting it

pthread_create and thrd_create have different signatures for the function they want
time for a cursed wrapper
__has_include 
found more portable way 
while shiro is working hard i found a bridge solution for the meantime at least

mb I think I was one of those
example bot just leaves after one game? but it's doing stuff in a while(1){} loop
-# seems there is a portable threads alternative called tinycthreads that i could use inplace of threads for now [just replacing the include] (well i have to figure out the rest to see if it actually works xD)
seems like the c api is fixed for me too
-#
which also means i uninstall visual studio again
wait it's just abandoning the game on the first turn? huh
if there are still bugs
lets rebrand tournament to "make chess api work without problems in under 1 month" 
and then do the chess tournament 
is this good?
fetched with github desktop idk if it worked
i tentatively have the pthread.h support re-added, which will allow use on mac
going to run some tests to ensure it works before pushing but it should be a pretty straightforward change
it was ul right? and now its ull?
should be ull, yes
there's UINT64_C(num) for adding the suffix too btw
i mean yeah but who tf remembers all these suffixes
also more tokens
and I wasn't sure if I should trust that, because I don't know what type (num) is when I type it
ok so it just disconnects immediately and does absolutely nothing else
adding ull is the only thing I know for sure makes the literal a different type
guess i try resetting EVERYTHING in the file to the example bot
and now it works
ok
sure
all the macro does is add the ull suffix or whichever one it is for the current system to the literal you give it 
Holy Kotlin STD ChessApi.getLegalMoves(board).associateWith { 1000 }
got stalemate too nice
looks like it actually works on windows but someone got problems with linux earlier today i think
good luck linux guys
That's so few tokens
For a very big operation
- .gitignore changes unrelated (you can push them separately if you want)
- i'd prefer manually triggered releases because pushing a release on every commit is weird
i pooped out a shell script that autoclones toknt repo and then builds it + moves the .jar right in the root because malding and now my life is better AND people find me more attractive when i go in public
i will use it once and have wasted an hour
maybe twice
it a macro 
I'll consider then, thought was type
I have started writing the first version of my own Chess bot
In Kotlin obviously, and holy this STD is gonna be amazing for this
sbt assembly to build a jar. alternatively, sbt to enter sbt and run a.c to run it on a.c
Just look at this oneliner to generate a scored map from the legal moves on the board
I do need to make it mutable still, but that's tiny
14 tokens
scored?
evaluation function probably
Yeah I'm gonna use at least on the first version scores to eval moves
quantifying how good each move looks
printf is a separate matter 
i'd make a separate workflow for the 2nd that can only be triggered manually, that good enough? 
there is some clang++ that should be able to compile c and cpp together
but it fails
cuz of this event when i type ch into windows search to open chatterino i get cute chess instead 
clang++ cant compile c and cpp together
its just for c++
build libchess.so instead
and link to that
windows is the problem of windows users i dont care 
This is gonna be very interesting
cc -o libchess.so -shared bitboard.c chessapi.c -fPICc++ -o bot_exec -lchess bot.cpp
its technically possible that shiro's c files are cpp-compatible, but not guaranteed at all
so thats the best way to go about it
On one hand, having to put ChessApi. before most API functions will eat some tokens, but on the other the Kotlin STD is amazing at making small code
whats cc
hard to search just 2 letters 
oh i think i found it
so i have to install linux to do it
naaah
if yes then it should be fine now 

I'm gonna be making the absolute most out of type inference, dropping non-needed brackets and small stuff like that
why is this not working
I'm not even at 128 tokens yet and I already have some kind of logic
this should be a 1-to-1 faithful replica
where the toknt releases at
is it ok if i change chessapi to export it as dll and then link it to my cpp
(idk if it will even work)
thx
when shiro runs it, it will be using the .so one
you can export the chessapi as a dll to run it on windows, should be fine
add a conditional attribute that's just empty on non-windows systems and make that the new default 
but i need to add some shenanigans in it
but i will be running the submissions on linux so don't rely on windows behaviour in your bot code
i'll be using the standard chessapi release, i would not suggest modifying it
you didnt comment out this is the only difference i could find
if the original needs changes please let me know
i mean if you will build it
and i somehow manage to build it on windows
and then there are problems with building it on linux
am i disqualified
hold on i havent pushed the pthreads-compat ver yet
because it doesnt work with pthreads for some reason 
ye i meant in the pthreads->threads.h commit

admittedly im not sure if this is an ethical testing method
#undef __STDC_NO_THREADS__
#define __STDC_NO_THREADS__ 1
that's not how this works 
sadly you can't gaslight the compiler
my system has threads.h so its kinda hard to test a feature that relies on not having it 
do i just do it in filthy c then since its 99% chance i will not be able to participate with cpp
okay fair then
i guess 
do it in holy c
c is like x10 tokens
you can participate with cpp but its up to you to figure out how to do it on windows 
if i figure it out on windows
idk anything about c++ so i cant help you 
will shiro figure it out on linux?
what if it doesnt build
or i will have to install linux, master it, and figure it out on linux
ZealC
shiro will figure it out, but it wont build if you rely on platform specifics
you don't have to master linux
you can literally open a linux mint vm, install vs code, and go from there
unless you want to be 16bit only in holyC
shiro wont touch cpp code on linux
i will have to master linux then
yeah i will just do c then
whatever
you can enable wsl2 and run vscode in gui with the wsl linked to it just fine
the struggles of windows c++ programmers
when i was on windows i spent months with wsl2 being the only thing i actually run vscode from
if i had cpp chess api you would have struggles with your c 
same with linux-windows 
dont talk to me unless your environment looks like this ๐ค
ew cygwin
There's so many little functions I never even knew about but that perfectly do what I need
@tender river can you take a look https://github.com/shiro-nya/2025-chess-bot-tournament/blob/pthread-compat/src/c/chessapi.c
im not too sure what the issue is here with the pthread mode
oops left the test line in 
in general
general? you silly billy, this is the programming text channel!
blame UCI for requiring it in the spec
MAXBY
No need to even sort
I WISH
Yeah there's so many amazing little convenience functions like this
Kotlin STD is amazing
me when i'm in an implicit behavior contest and my opponent is kotlin (i'm cooked)
not really implicit tho
Only 145 tokens so far
its very clearly defined
where is it defined
It's defined as the argument to the lambda passed to maxBy
what are you passing to maxBy
you're passing legalMoves to maxBy
Well it saves tokens, so
right mindset
and it is again clearly defined by the language standard
abandon all morals to save tokens
Indeed
syntactic diabetes
But tokens
Less tokens used means I can use add more functionality
it is implied to exist because you never explicitly state what it is
there's a difference between explicit and defined

how use token counter
you never define what void is in c 
I don't even have macros and don't even need them
huh... so I got pthreads to compile on windows (also I hate vcpkg now), but it always gives me a1a1 as the only move 
or what ( is
it is not an operator tho
void is not an operator either???
java -jar /path/to/toknt.jar /path/to/source/file
@stoic turtle
i forgot you're a java dev
carry on you're beyond saving

I just realized I'm using an outdated bindings version

I gotta update it and the release on GitHub
I changed one little thing after compilation, that being how Move.promotion works
gotta go for now 
kotlin is not implicit at all, now scala on the other hand with its implicit defs 
ping me if you discover new bugs
@real sierra
ok so the plan is
i either code it on linux entirely
or do it on windows and then fix 5000 issues transporting it to linux
theres a new branch on the git repo with experimental pthreads support, it doesn't work on linux but if you feel like finding the bug for me that'd be great 
i prefer my languages with explicity
call it verbosity
languages are literally made to abstract away common operations 
if you cant abstract some repetition away thats a failure of the language
- enable wsl2 and be fine
you know what's fun? your old pthreads commit works on Windows if one screws around with vcpkg for long enough... (and then does all the ull and uint_64t stuff)
chay go merge the thing so i don't have to grab the link to my fork when people want a release 
That's not very token-saving of you

is it windows-to-linux converter?
or the opposite
where to i code with it, on windows or linux?
it's a virtual machine in windows that runs linux
New fixed Kotlin bindings with the proper Move.promotions should be a thing now
i will spend 5 months setting it up dont i
no it's actually pretty simple
so you can use windows while having a virtual linux machine set up and running at the same time
i think at least
@real sierra you should use pthreads semaphores instead, shrimple as that 
it's been made pretty easy to use
and i code in that enviroment and run bot there too
yep
it's literally like
yes
and code in notepad
no
you can use vs code
i gave it a gliplse it looks like a 1-2 week path to set it up (maybe im wrong)
so i install that thing, then install vscode in it and im good to go?
then wsl
yep then wsl
you don't?
yes you do
you just connect to it from the host
you launch the wsl inside vscode terminal
doesn't wsl have its own wayland-comp/x-server or whatever
yes but wslg sucks
soooo..
like i said.
master linux or die
if you are in vscode, open your terminal (in vscode) and run wsl code . once it's installed
which again is just wsl --install (it does ubuntu by default) -> install the wsl extensio -> do that
using wsl is hardly mastering linux
this is pretty grim
you'll be fine
You wouldn't believe
Look at all this token saving syntax
using wsl2 for months in vscode got me to the point that i just installed linux from how much i preferred to use the freakin wsl2 over anything in my normal install but otherwise it works great for what it is
possible in java too btw 
what if my linux is different from shiro's linux and it will all break
or does it not work like that
no it does not work like that
Well Java still needs more tokens than Kotlin
assuming shiro wont lift a finger helping fixing cpp code
If someone wants to grab the Kotlin API and use it with Java, it should work fine
sigh
yes yes, semicolons
vscode in windows or in wsl
Java is just not viable, Kotlin meta
windows
that's what I originally had
until I dumped it for threads.h
alright downloading vscode lets see what i can do
vscode in windows will run natively in windows but the backend will be connected to the wsl2 so like if you run stuff in terminal it'll be theshell from wsl
it's pretty similar to just connecting to a remote linux machine and developing on it from vscode
I'm also not sure if semaphore.h is everywhere pthread.h is
and i need the wsl machine running
and by similar i mean pretty much identical
and hope it will all connect
so if I already have a custom semaphore primitive why add the dependency
well than theres your bug... probably 






