Dima
its the purest dependency hell
\Device\NUL
https://harmful.cat-v.org/software/
Dima
this is epic
pavel
who use std::expected ?
Aquatica
who use std::expected ?
Isn’t it a C++23 feature?
Anonymous
why you guys program in c/c++? which features of the language you think is the best?
Anonymous
yep
chakiwinja
줄리아 우지야노바
why you guys program in c/c++? which features of the language you think is the best?
metaprogramming. The best and the worst part of language at once
Ludovic 'Archivist'
make is a GNU software
No, GNU make is a GNU software, make is not. GNU make and Make are completely incompatible nowadays
Ludovic 'Archivist'
https://suckless.org/sucks/
Suckless software mostly sucks and is not usable by a normal human, only by crazy people like us
LD
We are a crypto HFT firm. Is there a channel to advertise for a C++ developer role?
Ludovic 'Archivist'
Chri~
pls someone can help me? I am making a program that tells me the higher number among the numbers entered by the user. The quantity of numbers is up to the user sry I traduce all #include <iostream> using namespace std; int computation (int max [], int n) { int i; int maximum = max [0]; for (i = 1; i <n; i ++) if (max [i]> maximum) maximum = max [i]; maximum return; } int main () { int quantity; int number; int i; int max [] = {number}; cout << "how many numbers do you want to insert?"; cin >> quantity; for (i = 1, i <= quant, i ++); cout << "insert the numbers, always returning between one and the other"; cin >> number; cout << "Largest in given array is"; << calculation (max); return 0; }
chakiwinja
not sure if it's helpful, I'm learning c instead of c++ and I'm still a beginner myself 😅
Chri~
okk ty!
chakiwinja
oh and in the for loop in main you're using , instead of using ;
chakiwinja
not sure if the missing curly brackets are an issue
Thadeu
Do you know a material (reading/teaching) on different parallelism or asynchronous techniques using pure C89 or C99? I know about libuv, libev, libevent, async.h but Im looking for some material to correctly reason about (not discover by guess)
Anonymous
Since I hate and tired of CMake, what build system you recommend to use?
Anonymous
Build2
It's actually good + got a package manager which seems better than vcpkg
Anonymous
why it is better?
there's no microsoft 😆
Thadeu
Are you looking for a book on how to reason about concurrent code and not one that delves into how to program concurrency/parallelism?
All only used some parallelism/concurrency on nodejs, and through webservers. I know there is fork, epoll... but to me it is a great mess, a letter soup. I'm looking for a materialto understand concepts,differences etc. and in some way how implement in C
Hussein
Do you know a material (reading/teaching) on different parallelism or asynchronous techniques using pure C89 or C99? I know about libuv, libev, libevent, async.h but Im looking for some material to correctly reason about (not discover by guess)
try to avoid libevent because it is bit of a legacy libev is a library for asychronous programming using a callback funcion so you are expected to do your networking with <sys/socket.h> but note that libev has slightly better performance than the others because it is more low level and close to the kernel libraries which are usually the fastest thing you can get out of your system
Hussein
Do you know a material (reading/teaching) on different parallelism or asynchronous techniques using pure C89 or C99? I know about libuv, libev, libevent, async.h but Im looking for some material to correctly reason about (not discover by guess)
libuv is MUCH easier to use it is also a networking library so you will use its functions to do networking whether TCP or UDP also it is used to make nodejs async functions
Hussein
Do you know a material (reading/teaching) on different parallelism or asynchronous techniques using pure C89 or C99? I know about libuv, libev, libevent, async.h but Im looking for some material to correctly reason about (not discover by guess)
there is another one called libhv its functionality is almost the same as libuv it is even easier to use than libuv and maintains pretty good performance competing with it but libuv has slightly better documentation
Hussein
All only used some parallelism/concurrency on nodejs, and through webservers. I know there is fork, epoll... but to me it is a great mess, a letter soup. I'm looking for a materialto understand concepts,differences etc. and in some way how implement in C
epoll isn’t really hard to use as you think on linux try writing this in the terminal “man epoll” and scroll down to the examples section that might help you note that epoll is for linux only so you have to use kqueue for BSDs (including MacOS) so unless you are planning to make your own asynchronous networking library for your project (which is a very good practice for learning), it would annoying to do so because you would have to write two versions of your code, one for linux and one for the BSDs
pavel
It's actually good + got a package manager which seems better than vcpkg
looks good but seems not popular with lack of support
G
all nice people! is it possible for a .dll to receive stdin and send stdout?
Pavel
all nice people! is it possible for a .dll to receive stdin and send stdout?
If you add such code to your dll it will work (if it's called, of course)
Pavel
So, yes
G
So, yes
thanks, can you give me a site on the subject ?
Anonymous
hello, do you know some good static analysis tool?? because I tested cppdepend and cppcheck and doesn't work well... thanks :)
Abhishek
Question regarding C++ chrono and thread library. Why does: for(int i = 0; i < 20; i++) std::this_thread::sleep_for(1ms); (Around 0.318 seconds elapsed) Take much longer (nearly 10 times longer) than: std::this_thread::sleep_for(20ms); (Around 0.032 seconds elapsed)
Abhishek
Sleep is for loop is affected by scheduling. Actual time to wake the thread maybe more than 1ms
True but Apparently using microseconds for the same temporal range doesn't cause this issue... STRANGE
You know me
Oh, that sounds weird then. Will try it out. Meanwhile lets see if others have any inputs.
Abhishek
Just luck
Or a precision error as internally chrono uses int
pavel
Or a precision error as internally chrono uses int
Nope. 1s converts to 1000us without any loss
Abhishek
Yes but high_precision_clock::now() doesn't
Abhishek
Maintain precision
pavel
It's two different things
Abhishek
It's two different things
Yes one is a time_slot while the other is a duration... I had to convert between them...
Anonymous
Setting sleep inside of a loop is not the best way to implement what you wanna do
pavel
Yes but high_precision_clock::now() doesn't
Return performance counter time in ns. If you then cast it to chrono seconds of course you'll lost some precision
Abhishek
Setting sleep inside of a loop is not the best way to implement what you wanna do
I had to make a check to exit the sleep if a condition is true.
pavel
Sleep don't measure time, just ask system to suspend thread to at least some time, but don't guarantee thread will sleep exactly this time. Just system restriction
Abhishek
I guess a dynamic delay based on current cycle's execution time like in game engines might be the way to go
pavel
If you need something more precise, do active sleep, just an empty loop with elapsed time checking
Abhishek
Anonymous
I did...
Slower?
Abhishek
Again... For some reason 1000us works and 1ms doesn't... I've been trying to figure our how...
Abhishek
Abhishek
Game loop not such stable
An incremental inner compensation loop like in the classic Writter's game loop
Abhishek
Then use 1000us ! If it works better with what you wanna do..
I am... I was just curious as to why though...
Anonymous
I am... I was just curious as to why though...
The main reason is that loops take much longer to execute