00:47
kristoff_it has joined #zig
00:51
kristoff_it has quit [Ping timeout: 252 seconds]
01:00
<
andrewrk >
Xe: that example with json parsing sounds a lot like erlang
01:00
<
Xe >
i'm going to have to look more into erlang
01:01
<
andrewrk >
I saw your blog article on lobsters this morning! Fun stuff. Also liked the templeos one
01:02
<
Xe >
i like how easy it is to reason about memory in zig
01:02
<
Xe >
i don't have to fight anything
01:06
<
Xe >
andrewrk: thanks again for your work on zig, so much
01:06
<
Xe >
it's making programming fun
01:07
lygaret has joined #zig
01:10
<
andrewrk >
Xe: glad to hear it. I agree with you, I just wish it was at 1.0 already
01:11
<
Xe >
you and me both
01:11
<
andrewrk >
Making a programming language is a means to an end for me... Not the end in and of itself
01:49
marijnfs__ has joined #zig
01:52
marijnfs_ has quit [Ping timeout: 248 seconds]
02:06
lygaret has quit [Quit: Leaving.]
02:15
redj has quit [Read error: Connection reset by peer]
02:20
redj has joined #zig
03:42
return0e has quit [Read error: Connection reset by peer]
03:42
return0e_ has joined #zig
04:46
kristoff_it has joined #zig
04:51
kristoff_it has quit [Ping timeout: 272 seconds]
05:06
return0e has joined #zig
05:07
return0e_ has quit [Ping timeout: 268 seconds]
06:37
redj has quit [Read error: Connection reset by peer]
06:39
redj has joined #zig
06:48
porky11 has joined #zig
07:18
return0e has quit [Read error: Connection reset by peer]
07:19
return0e has joined #zig
08:51
kristoff_it has joined #zig
08:55
kristoff_it has quit [Ping timeout: 258 seconds]
09:29
avoidr has joined #zig
10:32
_whitelogger has joined #zig
10:49
<
daurnimator >
Is there a 'sliceCast' around
10:50
<
daurnimator >
This isn't pretty.... @ptrCast([*]myType, x.ptr)[0..x.len*@sizeOf(x[0])/@sizeOf(myType))
10:51
Ichorio has joined #zig
11:08
_whitelogger has joined #zig
11:23
<
nrdmn >
are there any linux kernel modules in zig yet?
11:57
corecode has quit [Ping timeout: 258 seconds]
11:58
tralamazza has quit [Ping timeout: 276 seconds]
12:08
tralamazza has joined #zig
12:15
<
daurnimator >
nrdmn: nope. though that's something I've been wanting to see
12:20
<
daurnimator >
nrdmn: I'm curious if you can rewrite some of the macros (e.g. module_init/module_exit/MODULE_LICENSE) in zig
12:22
<
nrdmn >
I'm sure that would be possible, but it'd break if the kernel devs decide to change the module api
12:22
corecode has joined #zig
12:23
corecode has left #zig [#zig]
12:23
<
nrdmn >
I'm not quite happy yet with how I included printk. It happens to be compiled into stub.o (pulled in by linux/module.h).
12:23
<
nrdmn >
And I wouldn't want to extend stub.c for any kernel function that I use
12:27
<
daurnimator >
nrdmn: can you not just: @cImport("include/linux/printk.h");
12:39
return0e has quit [Read error: Connection reset by peer]
12:42
<
nrdmn >
daurnimator: this is what I wrote: const kernel = @cImport(@cInclude("linux/printk.h"));
12:44
porky11 has quit [Ping timeout: 252 seconds]
12:45
<
daurnimator >
nrdmn: don't you need to add `-isystem /lib/modules/$(uname -r)/build/include` to your zig invocation?
12:47
return0e has joined #zig
12:51
<
nrdmn >
hmm, still getting the same error messages as before. The kernel's makefile does quite a bit of other stuff and I'm not sure replicating all of this in zig is the right way
12:52
<
daurnimator >
nrdmn: can you see what -D arguments the makefile passes?
12:52
<
daurnimator >
you could then add them with @cDefine
12:53
<
daurnimator >
(use V=1 with the kernel makefile)
12:55
<
nrdmn >
there must be some way that doesn't circumvent the kernel's build system, no?
12:57
<
daurnimator >
maybe can look at how kernel modules written in rust or fortran are done? I think there might be one or two around?
13:01
<
andrewrk >
My marathon race starts in 14 minutes
13:04
<
nrdmn >
andrewrk: good luck!
13:05
<
scientes >
wow, 26.2 miles andrewrk ?
13:05
<
scientes >
oh hes already offf...
13:07
<
daurnimator >
nrdmn: well now I'm just finding zig bugs :)
13:07
<
daurnimator >
nrdmn: e.g. cimport.zig:335:27: error: invalid digit: '"' pub const KERN_SOH = c"\x1";
13:08
<
daurnimator >
==> zig's @cImport is generating invalid zig internally
13:10
<
andrewrk >
I posted a pic on Twitter. Spot the Easter egg
13:18
very-mediocre has joined #zig
13:26
<
Xe >
you know what you doing
13:31
porky11 has joined #zig
13:33
<
nrdmn >
daurnimator: is it really that simple?
13:42
<
daurnimator >
nrdmn: maybe.... trying to iron out the kinks...
14:02
<
daurnimator >
okay another zig bug I think.... if you try and export the result of a comptime function call it gets replaced with zeros
14:09
<
nrdmn >
daurnimator: this doesn't happen with [n]u8
14:12
<
daurnimator >
nrdmn: oh right... is it trying to export the slice?
14:12
<
daurnimator >
instead of the contents
14:17
<
daurnimator >
nrdmn: yep that was it. fix incoming
14:20
<
nrdmn >
how would you export a slice if you actually wanted to? Append [0..] to the function call?
14:22
<
daurnimator >
nrdmn: I think slices don't have a defined memory layout; it should be a compile error to export one.
14:22
<
daurnimator >
nrdmn: gist updated
14:23
<
nrdmn >
oh, I got zig to segfault :D
14:29
<
nrdmn >
daurnimator: can you reproduce that?
14:39
<
nrdmn >
now after I've changed some of my include paths I'm getting cimport.zig:341:27: error: invalid digit: '"'
14:56
return0e has quit [Ping timeout: 272 seconds]
14:57
return0e has joined #zig
15:14
very-mediocre has quit [Ping timeout: 256 seconds]
15:16
<
nrdmn >
daurnimator: what did you change?
15:16
<
daurnimator >
nrdmn: well I commened out the actual printk calls pending issue 2611
15:17
<
daurnimator >
nrdmn: but otherwise I realised the vermagic is taken care of by the kernel build system
15:18
very-mediocre has joined #zig
15:38
<
nrdmn >
daurnimator: why did you name the constant at the bottom _1?
15:57
<
daurnimator >
nrdmn: simple fix :)
15:57
<
daurnimator >
nrdmn: get much further with that fix?
15:58
<
nrdmn >
I haven't tried yet, wait a sec
16:01
<
nrdmn >
hmm, I'm getting a different error message for #2611. What version of zig are you using?
16:02
<
daurnimator >
nrdmn: pretty much master
16:02
<
daurnimator >
nrdmn: I applied your fix and am now getting an assertion elsewhere
16:06
<
nrdmn >
without it, I get `invalid digit: '"'`
16:06
<
daurnimator >
nrdmn: oh I think your fix is correct. just now it gets further into compiling printk.h and fails more spectacularly
16:07
<
nrdmn >
what did you change?
16:08
<
daurnimator >
nrdmn: in my gist I uncommented the defines of
__KERNELL__ and MODULE, and uncommented the include of printk;
16:14
return0e has quit [Ping timeout: 272 seconds]
16:14
return0e has joined #zig
16:16
<
nrdmn >
now I'm getting an assertion too, but no stack trace :(
16:31
<
daurnimator >
nrdmn: the stack trace may take a while to appear
16:37
kristoff_it has joined #zig
17:16
kristoff_it has quit [Ping timeout: 248 seconds]
17:28
kristoff_it has joined #zig
17:33
kristoff_it has quit [Ping timeout: 244 seconds]
18:02
hio has joined #zig
18:17
fengb has joined #zig
18:22
<
fengb >
Oops... reading logs for yesterday
18:22
<
fengb >
^ total non-sequitor today :P
18:34
Akuli has joined #zig
18:35
<
Akuli >
how do i tell zig 0.4.0 to put the compiled executable to a sane location? i'm using build.zig, and it keeps hiding the executable to zig-cache/o/qHOQFrFreaVliU2TIscbHp3BtJO8fee1IdR1b84dJsN1_1ayT-zpIlj7fziI3hVf/nameofexecutable or something
18:47
fsateler has joined #zig
18:50
<
Akuli >
then: $ zig build run -Dfile=some/path/to/file
18:56
<
emekankurumeh[m] >
i usually do "builder.setInstallPrefix(".");" and run `zig build install` when you will put the executable in bin in your cwd
19:11
gamester has joined #zig
19:11
<
gamester >
Akuli: exe.setOutputDir("...")
19:13
<
gamester >
const exe = builder.addExecutable("name", "main.zig"); exe.setOutputDir("dir")
19:18
gamester has left #zig ["Leaving"]
19:40
Akuli has quit [Quit: Leaving]
19:41
very-mediocre has quit [Quit: Page closed]
19:51
rain2 has joined #zig
19:52
rain1 has quit [Ping timeout: 245 seconds]
20:15
cameris has joined #zig
20:39
Ichorio has quit [Ping timeout: 250 seconds]
20:42
fengb has quit [Ping timeout: 256 seconds]
20:47
porky11 has quit [Quit: Leaving]
21:33
pellsson has quit [Ping timeout: 246 seconds]
21:45
cameris has quit [Quit: leaving]
22:12
mrkishi has joined #zig
22:15
marijnfs has joined #zig
22:17
sammich has quit [Read error: Connection reset by peer]
22:35
kristoff_it has joined #zig
22:39
kristoff_it has quit [Ping timeout: 258 seconds]
22:49
marijnfs has quit [Quit: WeeChat 2.4]
22:49
<
tgschultz >
man, really need @unionInit() right now
23:06
kristoff_it has joined #zig
23:11
kristoff_it has quit [Ping timeout: 252 seconds]
23:39
<
mrkishi >
hey, folks. just experimenting with zig and really enjoying it so far. I hope you don't mind some newbie questions coming your way :P