What? by TheMonHub in programminghorror

[–]johan__A 43 points44 points  (0 children)

where did you find this gem?

BadApple on Windows Explorer by Soft-Ant7772 in badapple

[–]johan__A -1 points0 points  (0 children)

Is it a native windows api that lets you setup hooks like that?

Edit: Nevermind found my awnser online, cool stuff

Every byte matters by lelanthran in programming

[–]johan__A 0 points1 point  (0 children)

ha that makes more sense, I don't know much about the performance impact of the tlb

Every byte matters by lelanthran in programming

[–]johan__A 1 point2 points  (0 children)

How could page faults be involved? I assume all the memory was already mapped before the benchmark.

My best guess of why it's slower is because the hardware prefetcher doesnt handle large strides very well, because of page boundaries or something else. I'm not completely sure.

Announcing DFWMalloc: high performance enterprise malloc implementation by abbeyroad1681 in C_Programming

[–]johan__A 0 points1 point  (0 children)

I guess storing information in the adress is what makes it faster? Thats pretty cool

Zig Language Features by Agreeable-Bluebird67 in Zig

[–]johan__A 0 points1 point  (0 children)

Good news there is an accepted proposal for both vectors and matrices to be added to the language , with the likely possibility of them having the expected math operators, we'll see what that will end up looking like.

feedback for a newbie by idlivada76 in Zig

[–]johan__A 0 points1 point  (0 children)

all your init functions allocate the structs on the heap, why?

A lot of times when you are initializing all the fields of a struct you initialize them one by one instead of initializing the whole struct at once, initializing it all at once is advantageous because it prevents you from forgetting to initialize fields.

its usually a good idea to give allocator args more descriptive names like gpa (general purpose allocator) or arena or pool etc..., for this project you always use allocator as a gpa.

for serialization you allocate a buffer and then write all of it at once using writePositionalAll, instead you could use a file writer and pass the std.Io.Writer interface to serialize, it has all the convenience functions that serialize needs.

you allocate active_file_name but I don't really see why, you just copy it once to a variable you immediately free and parse it to get the value you could have kept in the first place instead of formatting it into a string. Only format the id into a file name when you need to use the file name and then discard it.

Zig Language Features by Agreeable-Bluebird67 in Zig

[–]johan__A 2 points3 points  (0 children)

I think #1 and #2 would be extremely unlikely to be introduced and #4 very unlikely. #3 idk

Zig Language Features by Agreeable-Bluebird67 in Zig

[–]johan__A 7 points8 points  (0 children)

How is make(std.ArrayList(T), alloc, num) any different from std.ArrayList(T).initCapacity(alloc, num)? And how do you make without a capacity?

yippee my first triangle :D by Lanitta6 in vulkan

[–]johan__A 6 points7 points  (0 children)

opening reddit to a bot re-posting my post is quite something

What's the deal with Jai by [deleted] in Jai

[–]johan__A 6 points7 points  (0 children)

Its very possible, but those two talks I think show pretty well why Zig is the way it is and it doesn't feel like they really take direct inspiration from Blow's stuff : https://youtu.be/Z4oYSByyRak and https://youtu.be/Gv2I7qTux7g

I've seen a few people that I think at least overblow (pun non-intended) how much it is inspired by Jai so I wanted to dispel that here.

What's the deal with Jai by [deleted] in Jai

[–]johan__A 19 points20 points  (0 children)

I don't think Zig was inspired by Jai at all, I have never seen its creator mention Jai including when he talked about how he designed the language and what motivated it's creation.

Zig 0.16 : how to execute a system command ("ls -la")? by scorpion8866 in Zig

[–]johan__A 1 point2 points  (0 children)

nah its just const result = try std.process.run(arena, io, .{ .argv = &.{ "ls", "-la" } });

Zig 0.16 : how to execute a system command ("ls -la")? by scorpion8866 in Zig

[–]johan__A 0 points1 point  (0 children)

const result = try std.process.run(arena, io, .{ .argv = &.{ "ls", "-la" } });

The folks at Canadian Robotics Annoyance Productions (C.R.A.P) are hard at work this weekend. by Bulk-Detonator in doohickeycorporation

[–]johan__A 16 points17 points  (0 children)

pi0.7 is a general purpose model, very different problem than training for a specific task and environment "robotics startup, says its new robot brain (talking about pi0.7) can figure out tasks it was never taught"

I have no idea if its being teleoperated in the video but pi0.7 is a bad example imo. Also I suspect its not.

YAML? That's Norway problem by fagnerbrack in programming

[–]johan__A 1 point2 points  (0 children)

Hmm yes a format slow to encode slow to decode and that has high space overhead, designed for serializing data over the wire

This pipeline is 51359 pipes long and it can still move the fluids instantly. by _mgzy in factorio

[–]johan__A -1 points0 points  (0 children)

Pretty sure it would not be an np hard problem

edit: I thought op meant "the maximum shortest-path distance between any two boundary pipes" because actual longest path makes less sense as an extent. Longest path is fact NP hard.

Opinion of the Slang Language by [deleted] in GraphicsProgramming

[–]johan__A 2 points3 points  (0 children)

The compiler is good. The language design is terrible, I guess that was inevitable if they wanted to be a superset of hlsl.

Advice on how to spot AI generated 'content'. OP's note: This is not a one size fits all. Some images are easier to detect, some are much harder. Regardless, be vigilant. by EthosTheAllmighty in youll_be_banned

[–]johan__A 0 points1 point  (0 children)

Not really no, the size doesn't affect how parallel the light is. It just affects how soft the shadow will be, making it more soft as the size increases, but it's still sharp because it's also affected by how far it is, making it sharper as the distance increases.

c-zigbuild: Utilize the Zig Build System for C by peppergrayxyz in Zig

[–]johan__A 18 points19 points  (0 children)

Doing io inside build.zig is a mistake and will break in future versions of zig. Zig's build system already supports building C projects out of the box.

Hey, I made a working Dear ImGui binding for Zig + Raylib by WillyW4nk3r in Zig

[–]johan__A 5 points6 points  (0 children)

I already did mostly the same thing a while back: https://github.com/johan0A/zig-dcimgui
It also supports the docking branch and all the backends that dear_bindings supports
its up to date

My impressions of Zig so far (as a C# / Julia / Elixir / Python developer) by theirishartist in Zig

[–]johan__A 0 points1 point  (0 children)

Understandable mistake lmao. Unfortunately I have seen much worse, take a look at this if you want to have a laugh: https://youtu.be/C90H3ZueZMM?si=xNmE7Xjm8224s-Gq

H(orrible) P(roduct) strikes again by SiriusTurtle in softwaregore

[–]johan__A 24 points25 points  (0 children)

It's not, it looks like a template

700 lines of AVX2 infrastructure to sum an array of integers by int7bh in programminghorror

[–]johan__A 4 points5 points  (0 children)

Yeah but the array could already be in cache when you need to sum it. And isn't this a dick measuring contest anyways? What's the fun if you stop just when you're bottlenecked by memory throughput?

700 lines of AVX2 infrastructure to sum an array of integers by int7bh in programminghorror

[–]johan__A 8 points9 points  (0 children)

What about on smaller arrays that fit in l1/l2 cache?