Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2023-11-20 00:00:00Z and 2023-11-21 00:00:00Z
Avatar
Now that I have a little more experience with programming I thought about giving rust another shot xDD. It went pretty well, I found fasterthanli again started to read his day 1 2022 AoC and well... this is what I ended up thinking.
00:07
I don't know how to make rust feel like I am programming :/. Maybe it's skill issue but rust feels like it's for coders (I myself make the distiction from programmers like this: Programmer is someone who thinks and then researches and tries to make code work to his desires (engineer of a sort). Coder is someone who researches and then writes code but doesn't necessarily understands what and why it's working but is happy happy ).
00:08
Well I guess I'll stick with learning OpenGL and C. That seems to work for me :)
Avatar
specially good if u watch people multiple tees in faily solo maps. (couldnt reproduce) Also encountered some flicking bug [if used with dummy and selecting different people (tried so: to watch multiple groups and keep the same zoom for each group, is that even possible? Maybe good idea, instead of dummy trick
  • u could add multiview Group watch support.)]
01:44
without the mistake all players do atleast once ,useing /tp on a higher zoomed out state only to teleport themselves into a kill or teleport tile.
Avatar
Avatar
Mr.Gh0s7
Now that I have a little more experience with programming I thought about giving rust another shot xDD. It went pretty well, I found fasterthanli again started to read his day 1 2022 AoC and well... this is what I ended up thinking.
whoever made this meme does not know how this meme format works
monkaS 1
04:02
rust == c?
justatest 4
Avatar
Avatar
Mr.Gh0s7
I don't know how to make rust feel like I am programming :/. Maybe it's skill issue but rust feels like it's for coders (I myself make the distiction from programmers like this: Programmer is someone who thinks and then researches and tries to make code work to his desires (engineer of a sort). Coder is someone who researches and then writes code but doesn't necessarily understands what and why it's working but is happy happy ).
i dont understand this take
07:27
it just seems like u dont understand rust and pass it as rust coders not knowing what they do? weird take
Avatar
Avatar
Mr.Gh0s7
I don't know how to make rust feel like I am programming :/. Maybe it's skill issue but rust feels like it's for coders (I myself make the distiction from programmers like this: Programmer is someone who thinks and then researches and tries to make code work to his desires (engineer of a sort). Coder is someone who researches and then writes code but doesn't necessarily understands what and why it's working but is happy happy ).
Coding is the writing part. Programming is researching and then coding it up
Avatar
yeah, in C you can be a coder easily, and do it wrong outright in some places, e.g memory safetiness, in Rust, to be a coder you need to pass some programming skills, which the compiler aids you, mainly understanding why some code wont work, because it is not memory safe
07:56
it puts the mental burden on you at the start, rather than at the end when ur program breaks and u need to debug and understand why
07:56
which is why u are giving up early
Avatar
i'd say if you never really programmed before c is not the worst language to start with. for the simple reason that it's easy to shoot yourself, which makes you understand what higher abstractions do for you
Avatar
just use assembly like me
10:19
NekoEvil
Avatar
Avatar
Jupstar ✪
i'd say if you never really programmed before c is not the worst language to start with. for the simple reason that it's easy to shoot yourself, which makes you understand what higher abstractions do for you
but rust errors teach you a lot on why you cant do stuff
10:20
well i guess coming from C it makes these errors have way more sense
10:20
oh i need to update gentoo guru ddnet
10:21
looks like ill be the first distro
10:21
again
10:21
BASEDDEPT
Avatar
Avatar
Ryozuki
but rust errors teach you a lot on why you cant do stuff
yeah, i'd say learning rust is indeed very useful too, bcs it's still pretty low level, even if it has many high level concepts. e.g. the borrow checker makes it defs clearer what references are than e.g. Java (IMO)
Avatar
$rax : 0xfffffffffffffff7
11:10
my mmap call returns this void* xD
Avatar
oh i was using rcx instead of r10
Avatar
アリヂン BOT 2023-11-20 11:21:20Z
People say that GC is a minor tradeoff for automatic memory management, and you might think the same until you realize your C# app does not clean memory until your swap is 7.9/8 and ram 15/16gb
11:23
GC is cool but people have to stop relying on it so much, personally C# was one of my first languages and when i decided to dig deeper and started learning C++ and rust i just couldn't wrap my head around it, i got too used to automatic cleanup
Avatar
Avatar
Mr.Gh0s7
I don't know how to make rust feel like I am programming :/. Maybe it's skill issue but rust feels like it's for coders (I myself make the distiction from programmers like this: Programmer is someone who thinks and then researches and tries to make code work to his desires (engineer of a sort). Coder is someone who researches and then writes code but doesn't necessarily understands what and why it's working but is happy happy ).
That's not how I ever thought about the words, but that is exactly how rust makes me a feel. When I write code in Rust or any other newfangled language I feel more like a stenographer than a programmer
Avatar
Avatar
アリヂン
GC is cool but people have to stop relying on it so much, personally C# was one of my first languages and when i decided to dig deeper and started learning C++ and rust i just couldn't wrap my head around it, i got too used to automatic cleanup
Memory being managed for you automagically (whether statically or through runtime gc) is easy to get addicted to, which is why I'm a firm advocate of C first. Learn your C then you can go learn whatever other new language with cool space age features you like
Avatar
Previously teleporting to cursor wasn't accurate when not using zoom 10. Closes #7510.

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change...
Avatar
@Learath2 do u know if linux syscalls (not using libc) require the stack pointer aligned to 16 too?
Avatar
Not sure
Avatar
Avatar
アリヂン
GC is cool but people have to stop relying on it so much, personally C# was one of my first languages and when i decided to dig deeper and started learning C++ and rust i just couldn't wrap my head around it, i got too used to automatic cleanup
i think if you dont know how to do manual memory management you dont really know programming or computers
11:45
but well my bar is set to high
11:45
xd
11:48
The Linux Kernel does not require stack alignment. i.e. syscalls don't. However, shared libraries do, since they follow the stupid AMD ABI.
11:48
@Learath2 why does the abi require the stack aligned to 16, isnt it more natural if it is aligned to 8? then u dont need to align the stack between calls if u dont modify the stack
11:49
call pushes the 8 byte return addr to the stack
11:49
so the requirement of 16 is stupid
11:49
u will alwyas need to align
11:49
i guess it was done because u always push rbp to setup the stack frame?=
11:49
xd
11:49
but im sure the 16byte thing is before the 64bit era
11:50
@Chairn maybe u know more about this
11:50
But my take on this is to just follow the ABI alignment requirement to avoid future problems. I have this hunch that the alignment requirement is actually meant for syscalls that make use of SSE instructions. I don't see any other practical reasons for enforcing aligned stack other than SSE. The alignment is not actually for the function's code, but for use by the SSE save and restore inside the red zone of one particular syscall. 128 bytes is enough for XMM0 and XMM7. They are the most likely candidate for such alignment or redzone population.
11:52
H. Peter Anvin 2012-05-17 00:12:57 UTC In the Linux kernel, we do not use SSE or floating-point of any kind (except in very particular highly controlled places); furthermore, stack space is at an extreme premium. As such, it makes absolutely no sense to align the stack to 16 bytes in x86-64. gcc, however, refuses to allow setting the stack alignment to 8 bytes: : anacreon 105 ; gcc -mpreferred-stack-boundary=3 -mincoming-stack-boundary=3 -O2 -mno-sse -c /tmp/foo.c /tmp/foo.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12 /tmp/foo.c:1:0: error: -mincoming-stack-boundary=3 is not between 4 and 12 This is particularly ironic since we have found out that, in fact, ALL kernel stacks are actually 16-byte misaligned on x86-64 as the entry code pushes a total of 88 bytes onto the stack. As such, gcc trying to keep a 16-byte alignment actually makes the code do worse, not better.
11:52
interesting loophole xd
Avatar
Hm interesting. Let me have a think on why the abi requires 16
Avatar
Avatar
Learath2
Hm interesting. Let me have a think on why the abi requires 16
its most probs for SSE code
11:57
%ifndef INCLUDE_ALLOC %define INCLUDE_ALLOC %include "lib/syscalls.asm" %define PROT_READ 0x1 %define PROT_WRITE 0x2 %define MAP_PRIVATE 0x02 %define MAP_ANONYMOUS 0x20 section .bss section .text ; void* alloc(size_t bytes) ; returns a ptr to the allocated bytes on rax alloc: mov rsi, rdi ; rdi has the bytes xor rdi, rdi ; addr 0 mov rdx, PROT_READ|PROT_WRITE mov r10, MAP_PRIVATE|MAP_ANONYMOUS mov r8, -1 xor r9, r9 call mmap ret %endif
11:57
i switched to mmap
11:57
xd
11:57
now i just need to do a small optimization
11:57
to allocate in bigger batches
Avatar
Hm, I guess it's common enough that there is an sse array at the start and 8 bytes of waste isn't that important to get common code for restoring rsp
Avatar
anyway just making this stuff i learnt a lot
12:01
stack frames and such
Avatar
When will you code an arena allocator in asm? 😄
12:17
@Learath2 thats what i was thinking of doing
12:17
a bump allocator
Avatar
c2d02ad Account for zoom when teleporting to cursor. - furo321 375dd7d Merge pull request #7511 from furo321/telecursor-fixes - def-
Avatar
Avatar
Voxel
whoever made this meme does not know how this meme format works
It was I.
12:59
hmm is Chiller here?
13:00
monkalaugh I wanna paste a code snippet of rust and then of C
Avatar
hi after update i have so many micro lag how its fix fps is stable ping too
Avatar
Avatar
Logik
hi after update i have so many micro lag how its fix fps is stable ping too
shutdown /r /p (in cmd)
13:30
Else test old version of it's really the client
Avatar
アリヂン BOT 2023-11-20 13:30:32Z
Hmm, I also had this issue after the update, but seems like it resolved itself after i switched backend to vulkan (it switched to opengl on its own for some reason)
Avatar
Avatar
Jupstar ✪
Else test old version of it's really the client
it helped a little but the lags did not disappear
Avatar
Avatar
Logik
it helped a little but the lags did not disappear
Test (edited)
13:39
UPS
13:39
This is the previous version
Avatar
@Jupstar ✪ did u change smth?
13:40
why so many ppl complain
13:41
justatest
Avatar
Avatar
Jupstar ✪
This is the previous version
i I tried the lags did not pass
Avatar
Avatar
Ryozuki
@Jupstar ✪ did u change smth?
As you can see i didn't change anything. It's Windows always annoying^^
Avatar
Avatar
Logik
i I tried the lags did not pass
That's sad but then it's either Internet lags or you changed something in your system
Avatar
most likely it's the internet because it's been crashing lately
Avatar
if any dev want a feature to develop: It would be very nice in practice mod, that spikes execute /r instead of kill
Avatar
Avatar
Krain
if any dev want a feature to develop: It would be very nice in practice mod, that spikes execute /r instead of kill
[Client] Don't disable practice mode on death [furo321] is it what I just said? x)
Avatar
Avatar
Krain
[Client] Don't disable practice mode on death [furo321] is it what I just said? x)
Not exactly, it won't automatically do /r for you. But if you die by a spike (and haven't touched the start line) you will still be in practice. Then once you died, you could run /lasttp to get back to your previous spot you used /tp to.
Avatar
But isn't that not only overcomplicating it + not even solving the issue either? Will be far from as smooth as just running /r. Or is there some sort of complication code wise that wouldn't let that happen?
Avatar
Avatar
furo
Not exactly, it won't automatically do /r for you. But if you die by a spike (and haven't touched the start line) you will still be in practice. Then once you died, you could run /lasttp to get back to your previous spot you used /tp to.
So we can die, then /r ? :o
14:43
oh yeh we can't cauz we hit ground on spawn
Avatar
Don't use 1400.0f and 800.0f as it varies depending on which screen resolution you have. It now uses the values of the first ShowDistance packet, which will be default zoom. As pointed out by @0xfaulty in #7511.

Checklist

  • [x] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered p...
Avatar
How can I configure a workflow to create an arm build?
Avatar
Avatar
Yek-H
How can I configure a workflow to create an arm build?
if u mean a macos silicon u cant
15:40
actually i think they dont have arm either
Avatar
It's ubuntu minimal arm
Avatar
openai drama goes hard lmfao
Avatar
Avatar
Jupstar ✪
Maybe Microsoft was actually even the reason this happened. So bing stays ahead
^ i'd say that prediction was quite good xd
16:31
they might have not predicted the CEO gets fired. But they probably wanted more to say about OpenAI
Avatar
Avatar
Yek-H
It's ubuntu minimal arm
u can cross compile u could see how the mingw cross compile is done
17:27
it will work similar, u just need to install the correct packages
17:27
at least if you meant with "create", that u want artifacts
17:27
if u meant to actually run ARM on github, i guess that's not possible
Avatar
Avatar
Jupstar ✪
at least if you meant with "create", that u want artifacts
Sure I want the artifacts
17:29
lol
17:29
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
17:30
but i bet u find lots of resources online how to cross compile to arm 😉
Avatar
Avatar
Jupstar ✪
but i bet u find lots of resources online how to cross compile to arm 😉
I want the build to be compiled by the workflow Paimon_DeadInside
Avatar
yes
17:32
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
17:33
here is the workflow build file
17:33
u gotta compile all skills i mentioned xdd
Avatar
Avatar
Jupstar ✪
u gotta compile all skills i mentioned xdd
After configuring so many servers I have no skills now
17:37
dead_pb
Avatar
ask chatgpt
Avatar
Avatar
Yek-H
After configuring so many servers I have no skills now
here. no guarantee that this does smth useful: name: Cross-Compile for ARM on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Install ARM Cross Compiler run: | sudo apt-get update sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf - name: Create Build Directory run: mkdir build && cd build - name: Run CMake run: | cd build cmake .. -DCMAKE_TOOLCHAIN_FILE=../path/to/your/toolchainfile.cmake - name: Build run: | cd build make - name: Upload Artifacts uses: actions/upload-artifact@v2 with: name: compiled-app path: build/your-app-binary # Replace with the path to your binary
17:43
# Set the system name to cross compile for set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) # Specify the cross compiler set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) # Specify the root directory for the target environment (optional) #set(CMAKE_FIND_ROOT_PATH /path/to/your/arm/rootfs) # Search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # For libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
17:44
I will try
Avatar
Avatar
Jupstar ✪
ask chatgpt
thats not really learning, is it
Avatar
did someone ask about learning?
Avatar
next_pow_2: dec eax bsr rcx, rax inc ecx mov eax, 1 shl rax, cl ret
18:23
i found this
18:23
looks op
Avatar
Greyscale images with alpha channel (i.e. channel count = 2) were incorrectly handled as RGBA images, causing the client to crash when loading such images. Now the images can successfully be loaded with the image loader, but the client still only supports loading RGB and RGBA images like before.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit te...
Avatar
ChillerDragon: muzzle → muscle
Avatar

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addres...
Avatar
$ cargo clean Removed 90180 files, 48.7GiB total twinbop
20:11
that's almost the size of my first ssd 😂
Avatar
since when does it display stats? 😮
Avatar
good question
Avatar
chillerdragon BOT 2023-11-20 20:16:30Z
lol
Replying to @heinrich5991 ChillerDragon: muzzle → muscle
20:17
Chiller English be like
Avatar
This adds showing finishes alongside kill messages (now renamed to info messages), like in 0.7 and a few older race clients. !image !image Also now with the new Sv_RaceFinish packet, we could also localize finish messages just like in 0.7 and move away from parsing finish messages.

Checklist

  • [x] Te...
20:24
7b6a126 Also set Codecov target for patch to 0% - Robyt3 b6c0b31 Merge pull request #7514 from Robyt3/Codecov-Patch-No-Target - heinrich5991
Avatar
We have name banned certain characters and strings, but this restriction does not extend to the clan field. This has led to people using the clan field as a workaround to include the prohibited characters/strings instead. Could this be changed?
Avatar
chillerdragon BOT 2023-11-20 20:45:59Z
What are the chances of this getting merged this week? I would like to take a look at it before._.
Replying to @GitHub GitHub: > furo321 […]
Avatar
then say that on the PR
Avatar
chillerdragon BOT 2023-11-20 20:50:36Z
Ok I did the review on ma phone :D
Avatar
Avatar
heinrich5991
did someone ask about learning?
i mean, the person did "I have no skills now"
21:01
using ai doesnt really give you skill, does it?
Avatar
Avatar
Voxel
using ai doesnt really give you skill, does it?
RageJK
Avatar
if you can use LLMs to help you, then that's a skill right there 🙂
Avatar
Avatar
Voxel
using ai doesnt really give you skill, does it?
IMO it's not a skill to setup some boring CIs
21:15
i've done that many times
21:15
i still forget their shitty syntax xD
Avatar
Avatar
Voxel
i mean, the person did "I have no skills now"
I said skills with irony, the truth is I'm busy with web development and other things
Avatar
Avatar
Jupstar ✪
IMO it's not a skill to setup some boring CIs
sometimes i think about using ai to assist me with things but then i remember that its better to just. do it. instead of having to rely on a machine to do the work for you
21:17
because most of the time the language models dont even do what you ask for
21:17
bard and gpt suck
Avatar
Avatar
Voxel
sometimes i think about using ai to assist me with things but then i remember that its better to just. do it. instead of having to rely on a machine to do the work for you
so you also convert all english source to binary by hand? 😄
21:18
u just hate AI
Avatar
Avatar
Voxel
because most of the time the language models dont even do what you ask for
they do it to like 80% depending on the complexity
21:18
and they only give a limited response length
21:18
that's also a problem
Avatar
Avatar
Jupstar ✪
so you also convert all english source to binary by hand? 😄
Avatar
got a problem with long as hell render while starting client Possible somehow to fix?
Avatar
Avatar
-StormAx
got a problem with long as hell render while starting client Possible somehow to fix?
can you please be more precise?
21:24
is that a release build?
21:25
shadow play for example might already make the startup much slower
Avatar
Avatar
Jupstar ✪
is that a release build?
debug
Avatar
OpenGL?
Avatar
Avatar
Jupstar ✪
can you please be more precise?
yea
Avatar
what even is long as hell
21:26
<1s should be ok for the first render call i guess
21:26
if the opengl driver setups stuff on fly
21:26
cracking hate
21:26
openGL
21:26
ty jupey
21:27
i just switch the render
Avatar
i blame windows tho xd
21:27
opengl works awesome on linux
Avatar
Avatar
Jupstar ✪
$ cargo clean Removed 90180 files, 48.7GiB total twinbop
my record is 150gb
Avatar
Avatar
Jupstar ✪
i blame windows tho xd
Sticker
Avatar
Was anyone able to confirm that #7508 fixes the weird lags yet?
Avatar
Avatar
Robyt3
Was anyone able to confirm that #7508 fixes the weird lags yet?
i asked multiple times in #bugs
21:30
but sadly they hard ignore
21:30
if they have problems, they ur best friends. else they full ego
21:30
😂
Avatar
It's possible that the compatibility flags make windows chose a worse option for the game
Avatar
it kinda must be
21:31
bcs it makes 0% sense that the opengl windows software driver is used
Avatar
You can download as PDF though, only 227 pages monkaS (edited)
Avatar
u cannot control that programatically
Avatar
This compatibility pack allows more of your favorite OpenCL™ and OpenGL® apps to run on a Windows 10 PC that doesn't have OpenCL and OpenGL hardware drivers installed by default. If a DirectX 12 driver is installed, supported apps will run with hardware acceleration for better performance. This package supports apps that use OpenCL version 1.2 a...
Avatar
If a DirectX 12 driver is installed, supported apps will run with hardware acceleration for better performance. This package supports apps that use OpenCL version 1.2 and earlier and OpenGL version 3.3 and earlier.
21:33
ogl on dx12
21:34
not interesting for their potato problems
Avatar
What if they accidentally installed it?
21:34
Would it make things worse?
Avatar
nah
21:34
i dont think they installed that
21:35
they all had old PCs
21:35
it's probably bcs the drivers of their GPUs are flagged as win7 compability mode
Avatar
Which OS did they have btw?
Avatar
win10
Avatar
Avatar
Jupstar ✪
it's probably bcs the drivers of their GPUs are flagged as win7 compability mode
yeah, could be something like this
21:36
right now it doesn't matter I guess, but at some point we might need the compatibility flags with new OS
21:37
Are their drivers already end-of-life?
Avatar
you want to say drop OGL <2
21:37
i am in
Avatar
Avatar
Robyt3
Are their drivers already end-of-life?
1000% xD
Avatar
Both are equivalent. Seems to already be used consistently for all other types.

Checklist

  • [ ] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [...
Avatar
does vanilla master servers use a different port to check open ports? aka: "ERROR: the master server reports that clients can not connect to this server."
21:42
i read it as this: the master server can contact my servers
Avatar
yes
Avatar
this is so annoying
Avatar
it's a port forward check ^^
Avatar
yeah but i can't cleanly block IPs that way
Avatar
you need to use a different port, otherwise the port forward check doesn't work
Avatar
Avatar
heinrich5991
you need to use a different port, otherwise the port forward check doesn't work
yes
21:43
but it could be a static port
21:45
well let's hope the servers where the master servers don't report me for port scanning 😂
21:45
this is so annoying xD
22:09
29a32b7 Use const char * instead of char const * consistently - Robyt3 83b199b Merge pull request #7517 from Robyt3/Style-ConstChar - heinrich5991
22:10
15e4f9a Remove remaining obsolete // ignore_convention comments - Robyt3 0427dff Use bool instead of int - Robyt3 82b75dd Improve error log messages for PNG loading - Robyt3 f0a1743 Ensure freed image buffer is not propagated - Robyt3 bcae7da Handle all color channel counts in image loader - Robyt3 35f071b Merge pull request #7513 from Robyt3/ImageLoader-Greyscale-Fix - def-
Avatar
Avatar
Ryozuki
@Chairn maybe u know more about this
sorry no idea. But i had the same question for a lab work with RISC-V assembly where the stack is advanced by 16 for each function...
Avatar
Avatar
Ryozuki
@Learath2 why does the abi require the stack aligned to 16, isnt it more natural if it is aligned to 8? then u dont need to align the stack between calls if u dont modify the stack
because then you can easily put 16-byte aligned stuff onto the stack, and since you're likely gonna push rbp, it doesn't matter as much, I guess
Avatar
u push if u want a stack frame
22:37
but yeah i guess
22:37
well u always need a stack frame for the abi i think
Avatar
I think windows always requires you to push rbp as well
Avatar
Avatar
heinrich5991
I think windows always requires you to push rbp as well
u dont need to specifically push rbp tho
22:53
but pushing aligns the pointer
22:54
with -fno-frame-pointer it doesnt push
22:54
i read this today
22:54
it uses relative to rsp somehow
22:54
-fomit frame pointer sry
22:54
well if i got this correctly ofc
Avatar
Avatar
Mr.Gh0s7
I don't know how to make rust feel like I am programming :/. Maybe it's skill issue but rust feels like it's for coders (I myself make the distiction from programmers like this: Programmer is someone who thinks and then researches and tries to make code work to his desires (engineer of a sort). Coder is someone who researches and then writes code but doesn't necessarily understands what and why it's working but is happy happy ).
This is an example of what I mean. Rust itertools has this https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.k_smallest which probably from my understading (correct me if I am wrong :)) is this https://en.wikipedia.org/wiki/Sorting_network. In C you gotta implement/make it yourself
22:58
btw I am talking about day1 part2 of the 2022 AoC
22:59
so I feel like you learn a lot more about engeering in general but you also have to re-implement the wheel (since rust prob has it already).
23:00
in contrast to rust which already has it and you just use it
23:00
programming vs coding
23:01
i disagree
Avatar
plz disagree in greater detail :)
Avatar
// Compare function for qsort int cmpfunc(const void* a, const void* b) { return (*(int*)a - *(int*)b); } // Function to return K'th smallest // element in a given array int kthSmallest(int arr[], int N, int K) { // Sort the given array qsort(arr, N, sizeof(int), cmpfunc); // Return k'th element in the sorted array return arr[K - 1]; }
23:02
see
23:02
is this programming
23:02
a quick google and copy
23:02
its no different
23:02
u just complain about having more functions available in std
23:02
but u can do the same with C
23:02
its why i find this argument pointless
23:04
but its because u focus "programming" or "engineeriing" to simple algorithm exercises
23:04
engineering is how you architect applications in whole
23:04
etc
Avatar
was this (that k_smallest is using) https://en.wikipedia.org/wiki/Sorting_network true btw?
23:04
well
23:04
idk
23:04
Note: This is functionally-equivalent to self.sorted().take(k) but much more efficient.
Avatar
its just that
23:04
sort and take the k element
23:05
doesnt sound related
Avatar
[4,3,6,1] -> k = 3 -> [1,3,4]
Avatar
I mean how the sorting works
23:06
the algorithm
Avatar
pub(crate) fn k_smallest<T: Ord, I: Iterator<Item = T>>(mut iter: I, k: usize) -> BinaryHeap<T> { if k == 0 { return BinaryHeap::new(); } let mut heap = iter.by_ref().take(k).collect::<BinaryHeap<_>>(); iter.for_each(|i| { debug_assert_eq!(heap.len(), k); // Equivalent to heap.push(min(i, heap.pop())) but more efficient. // This should be done with a single `.peek_mut().unwrap()` but // `PeekMut` sifts-down unconditionally on Rust 1.46.0 and prior. if *heap.peek().unwrap() > i { *heap.peek_mut().unwrap() = i; } }); heap }
23:07
this is itertools version
23:07
idk if its same as std
23:07
ah std returns a iterator
23:07
not a binary heap
Avatar
btw how did you find it? (asking bcs I was also looking for crate::k_smallest::k_smallest(self, k))
Avatar
ah wait
23:08
u linked to itertools
23:08
u are using a library in the first place!
23:08
I am not against using libs
Avatar
so ur comparision is already completly wrong
23:09
u also have libs in C
23:09
for common algos
23:09
biased
Avatar
Avatar
Mr.Gh0s7
btw how did you find it? (asking bcs I was also looking for crate::k_smallest::k_smallest(self, k))
👍 1
23:10
i go sleep
23:10
gn
Avatar
gn and ty
Avatar
Avatar
Ryozuki
u dont need to specifically push rbp tho
the ABI requires you to AFAIK
23:20
IMO it's nice that you can use good algorithms without implementing everything yourselves
23:20
even C has qsort 😉
Avatar
yeah but I went researching about sorting an array of fixed length and I found about this https://en.wikipedia.org/wiki/Sorting_network
Avatar
I did some leetcode today, I'm soooo out of practice 😦
Avatar
:O leetcode sounds fun
Avatar
Avatar
Mr.Gh0s7
yeah but I went researching about sorting an array of fixed length and I found about this https://en.wikipedia.org/wiki/Sorting_network
btw Learath have you heard about this before?
Avatar
I've heard about it before, however I'm not sure how relevant they are in practice
Avatar
chillerdragon BOT 2023-11-20 23:47:03Z
Wot you doing?
Replying to @Jupstar ✪ yeah but i can't cleanly block IPs that way
23:47
What even are you scanning?
Replying to @Jupstar ✪ well let's hope the servers where the master servers don't report me for…
Avatar
Avatar
heinrich5991
even C has qsort 😉
hmm it appears that qsort uses quicksort which in worst-case performance is O(n^2) while Bitonic sort worst-case is O(log^2(n)).
23:57
xD I completely missed these two last msgs from chiller I read BOT and thought it was github kek
Exported 308 message(s)