ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<scientes> kristate, now
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kristate> scientes: hey
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 260 seconds]
<scientes> back
mnoronha has joined #zig
mnoronha has quit [Quit: The Lounge - https://thelounge.github.io]
mnoronha has joined #zig
_whitelogger has joined #zig
MajorLag has quit [Ping timeout: 272 seconds]
MajorLag has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
MajorLag has quit [Ping timeout: 240 seconds]
MajorLag has joined #zig
mnoronha has joined #zig
bheads has quit [Remote host closed the connection]
mnoronha has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mnoronha has quit [Ping timeout: 268 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 260 seconds]
m6w6 has quit [Ping timeout: 265 seconds]
m6w6 has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
strmpnk has quit [Ping timeout: 245 seconds]
strmpnk has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 244 seconds]
davr0s has joined #zig
ft3 has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
ryanmtate has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 260 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
bheads has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
bheads has quit [Ping timeout: 244 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 272 seconds]
bheads has joined #zig
return0xe has quit [Quit: Leaving]
return0e has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 260 seconds]
mnoronha has joined #zig
ft3 has quit [Ping timeout: 272 seconds]
mnoronha has quit [Ping timeout: 256 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
bheads has quit [Ping timeout: 240 seconds]
ryanmtate has quit [Remote host closed the connection]
darithorn has joined #zig
mnoronha has joined #zig
return0e has quit [Ping timeout: 248 seconds]
MajorLag has quit [Read error: Connection reset by peer]
MajorLag has joined #zig
mnoronha has quit [Ping timeout: 260 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0e has joined #zig
davr0s has joined #zig
DutchGh0st has joined #zig
<DutchGh0st> hi!
<unique_id> hello
<DutchGh0st> part2 += (f[start] - 48) & - @boolToInt(u64, f[start] == f[half]); <-- that complains about the boolToInt builtin function, I wonder what I did wrong there
<DutchGh0st> I did import std
<unique_id> boolToInt just takes a bool, no type
<DutchGh0st> or well, forget about the u64 there,
<DutchGh0st> but https://ziglang.org/documentation/master/#boolToInt does not work for me
<DutchGh0st> comptime var fd = @boolToInt(false); complains also
<unique_id> @boolToInt(f[start] == f[half])
<DutchGh0st> error: invalid builtin function: 'boolToInt'
<unique_id> you must not be on the master branch. https://ziglang.org/documentation/0.2.0/ does not have @boolToInt according to the documentation
<DutchGh0st> uff
<DutchGh0st> I donwloaded a nightly build that is later than 0.2.0, but thats a while ago
<unique_id> I just do "git pull" and cd build, make install
<unique_id> to update
<DutchGh0st> Im not on linux :(
<DutchGh0st> I did donwload it from somewhere..mmhhh
<DutchGh0st> found it!
<DutchGh0st> but ugh
<DutchGh0st> all that casting is ugly
<DutchGh0st> if you have a '@embedFile', you can at compile time figure out how many times the character ',' is in it, and make a constant array based on that number? :O
<unique_id> oh heck yes, we have embedFile. That's going to be useful! Yes DutchGh0st I believe you should be able to do that.
<DutchGh0st> oh good lord
<DutchGh0st> thats gonna be fun with Advent Of Code this year
<unique_id> having said that, processing data at comptime is probably fairly slow at the moment
<DutchGh0st> so if you have const byteslice out of the file, you could basically split at some character, and convert to ints if the file is like "10,20,30,40"
kristate has quit [Remote host closed the connection]
<DutchGh0st> But well, doesnt matter if the build time is slow, everybody only competes on runtime with advent of code ^^
Barabas has joined #zig
<unique_id> I just tried your idea. fn count_commas(comptime slice: []const u8) ..., then const array_size = count_commas(@embedFile("test.txt")); Then var a: [array_size]u8; Only issue was I had put the "comptime" keyword before the count_commas call.
<unique_id> had to*
<unique_id> so: const array_size = comptime count_commas(@embedFile("test.txt"));
<Barabas> How's that an issue?
<unique_id> it's not
<Barabas> ok
<DutchGh0st> so that worked? :D
<unique_id> yep
<DutchGh0st> thats neat!
<Barabas> > Bug: const ptr: [*]u64 = &integers; where integers is a const array.
<Barabas> That's not a bug I think. You probably should do
<Barabas> const ptr: [*]const u64 = &integers; where integers is a const array.
<unique_id> It's a bug that led to a segfault. I was getting a pointer to a non-const array which was in reality const.
<unique_id> I should have to do your suggestion yes
<Barabas> Ah!
Barabas has quit [Ping timeout: 252 seconds]
<DutchGh0st> just a little question, if you have a function that does take const [] u8, but does not declare its local variables as comptime var,
<DutchGh0st> can you still call 'comptime func("whatever")' ?
<DutchGh0st> for example this atoi() function, https://github.com/DutchGhost/Zigerator/blob/master/src/atoi.zig ?
<unique_id> It worked for me: https://pastebin.com/raw/RjPm40zx
<unique_id> I don't know much about comptime, I haven't given myself time to learn it/read about it. I just tried removing comptime from the parameter and that worked too. Inside a function, you can use a comptime block: comptime { }, and put anything you want in there like function calls and see if it works.
<unique_id> DutchGh0st: Search for this string in the documentation: compile-time and run-time
<unique_id> it discusses how functions can be called both at run-time and compile-time
<DutchGh0st> yes! thank you!
<DutchGh0st> if I may ask, what are you currently using Zig for, unique_id ?
<unique_id> I'm creating a video game :)
<DutchGh0st> oh! what kinda game?
<unique_id> open world procedurally generated
<DutchGh0st> cool! :D
<DutchGh0st> Do you know the guy called 'Jonathan BLow' ?
<unique_id> nobody has made the game that I want to play, so I have to make it myself xD
<unique_id> I follow his work, he's great
<DutchGh0st> do you have any experience in making games?
<DutchGh0st> before you started this one?
<unique_id> No. People recommend starting on easy games. I've only been trying to make this game for years, slowly picking up the technical proficiency to do so.
<unique_id> Unfortunately I got sidetracked into creating my own programming language before Zig came along. But then I got stuck on not knowing how OOP-like I wanted my programs to be, since I was rather new to programming back then. I was also toying with the idea of storing source code in a binary format and seeing how far that idea could go
<DutchGh0st> damn
<DutchGh0st> thats more than I did with programming so far haha
<unique_id> well ive been programming for many many years, just very poorly after I went from c# to c++ since I couldn't stand the language. Now I like my life again :)
<DutchGh0st> I was happy when I could write 'let x = 10; let y = 5; let z = x + y;' as my own 'language'
<DutchGh0st> but never got any further than that because the source to do that was messy and big, and I just didnt know what I was doing haha
<DutchGh0st> I got my first programming class ... almost 2 years ago nearly now, started in Java (for school)
<DutchGh0st> then on my own I discovered python, sombody told me about Rust one day which I became really interested in, and somehow I stumbled upon Zig a few months ago
<unique_id> cool, I assume that most people dont travel far outside of java/c#/python
<DutchGh0st> because that's what they get in school, and thats where you can find jobs in
<DutchGh0st> I don't do Sofware Engineer currently at school, Im hoping to do so by the start of this years college, but if I ask my friend who does Software Engineer what the heap is, he does not know
<MajorLag> comptime is a bit difficult to reason about sometimes. part of the problem is that it is still pretty buggy. really powerful though when you start getting the hang of it.
<DutchGh0st> so...they dont get that stuff at my school? which is weird
<DutchGh0st> but I got to go! I'd like to see a bit of gameplay when your game is finished far enough unique_id !!
<DutchGh0st> have a nice day! byyee!
<unique_id> okay bye, and yes i will post stuff in a few months
<unique_id> Wow it sure is crucial to exit at the correct time out of a recursive MSD radix sort. It's the difference between it taking fractions of a millisecond and seconds! Whoops.
DutchGh0st has quit [Ping timeout: 252 seconds]
<unique_id> But I'll be using an LSD version probably. It's for sorting draw calls :)
darithorn has quit [Quit: WeeChat 2.2]
kristate has joined #zig
kristate has quit [Ping timeout: 240 seconds]
mahmudov has quit [Ping timeout: 256 seconds]
darithorn has joined #zig
hoppetosse has joined #zig
MajorLag has quit [Ping timeout: 265 seconds]
MajorLag has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig