/dpt/ - daily programming thread

old what are you working on Any Forums?

Attached: sicp.jpg (1280x720, 139.59K)

Other urls found in this thread:

kristoff.it/blog/zig-colorblind-async-await/
ziglearn.org/
twitter.com/SFWRedditImages

nyanplasuplasu

'ate python
'ate numpy
'ate pandas
'ate scipy
'ate GIL
luv me ggplot
luv me R
luv me %>%
luv me vectors

Quit spamming the board with these generals, retard. One per day.

%>% is honestly great.

We were here before you were born and will be here after you are dead

Attached: 1626576728608.png (1084x885, 1.09M)

nakadagashiya

No.

you're mom was compiled by me man

Any Forums is a /dpt/ board
stop creating non-/dpt/ threads on it

No nigger its Any Forums - gnu

what you're referring to as gnu is in fact deez gnuts

Attached: g.png (291x69, 41.15K)

my brain registers that background as a Dominions iv map tile

>deez guhnewts
Who?

it's a winblows desktop

Learning Zig. Best language out there.

redpill me on zig, as someone who knows both C++ and Rust

god i wish that were me

it is like rust but even more gay

Bring back /prog/ and we'll leave.

RIP, fucking moot

>redpill me on zig, as someone who knows both C++ and Rust
One Zig pill coming up.

>concurrency
Built in event loop style N:M threading builtin, unlike C++. Just add one line of code and you're able to run millions of coroutines with ease. Solving the C10k (and C10M) problem was never easier.

pub const io_mode = .evented;

kristoff.it/blog/zig-colorblind-async-await/

>performant
It's a compiled language with a backend that uses LLVM, so it has all of the optimizations that Clang will ever give you in C++ or Rust.

Tired of all the complex memory management? Just use the 'defer' keyword user, EZ RAII style cleanup but much more flexible. Want to be be even lazier? Have a single arena allocator scoped per task and forget about memory management entirely!

>exceptions/errors
This is where Zig really shines. It has all the features of exceptions, but with the low cost/overhead benefits that error handling provides. There's no runtime overhead to errors, but you still get stack traces. To give you a taste:

try parseNumber(str); // Try to parse a number, or return an error up the stack if it fails.
parseNumber() catch |err| switch(err){
error.InvalidChar => {...}, // Arbitrary error handling code.
error.TooLarge => { return maxInt(i64); },
// If we don't handle the all errors parseNumber() returns, the switch statement will give a compile error.
};


>inheritance
Just like Rust it doesn't have inheristance because it doesn't need it. Composition and interfaces to the max! Rust has traits, but they're a pain when you're reading the code and you can't tell where methods on an object are coming from.

Embrace the future that is Zig. Head on over to ziglearn.org/ to get started! Need help? IRC is #zig on libera.chat.

pub fn helloWorld(req: Request, res: Response) !void {
try res.print("Hello {}!", req.queryParam("name") orelse "World");
}

Eww, disgusting looking code. No thanks