ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
fraktor has joined #zig
<fraktor> Question about Zig's async model; do I need to explicitly insert suspension points, or will that happen automatically?
<pixelherodev> Explicit only, IIUC
<daurnimator> fraktor: depends. only the lowest level code needs to insert them. all callers get them inserted automatically
<daurnimator> s/lowest/innermost/
<fraktor> daurnimator: I see. I've been reading up on Python's async model and it seems similar.
<fraktor> So if I do some intense computation that doesn't do any I/O or anything else that can be async, I need to insert suspension points myself, right?
<daurnimator> fraktor: IIRC python's async model requires explicit `async`/`await` annotations
<daurnimator> fraktor: zig's async avoids "colour". required background reading: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
<fraktor> I see.
<fraktor> But I do need to add suspension points myself if I'm not using a low-level function that does, right?
<daurnimator> yes. in that case you *are* the low-level function
<daurnimator> but those are usually part of the event loop implementation or OS-level wrappers
<daurnimator> we should almost never see them in user-level code
<fraktor> Even if I'm doing intense and slow number crunching and want other "threads" to be able to do their thing?
<daurnimator> fraktor: then you would call a function from the event loop implementation that somewhere deep inside has the actual `suspend` keyword.
<fraktor> I see. Does Zig come with an event loop? (I'm super new to all this_)
<daurnimator> Yes; though it's not well documented, bug free, or fast. i.e. its a usable work in progress
<daurnimator> (just like the rest of the language)
<fraktor> Makes sense. I really can't wait until the language is more mature, since it's really nice to use already, but a bit too volatile for big projects.
<daurnimator> fraktor: the best way is to contribute in an area you have experience/expertise
<fraktor> I have in the past, a couple times.
<fraktor> I've gotten a busy schedule recently, but I'm probably going to have more time in the future to contribute.
<daurnimator> andrewrk: when you get a free moment, would you be able to reply to https://sourceware.org/bugzilla/show_bug.cgi?id=25470#c9 ?
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
qazo has quit [Read error: Connection reset by peer]
xackus has quit [Ping timeout: 256 seconds]
qazo has joined #zig
stripedpajamas has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
rzezeski has quit [Quit: Connection closed for inactivity]
stripedpajamas has quit [Quit: sleeping...]
stripedpajamas has joined #zig
stripedpajamas has quit [Client Quit]
marnix has joined #zig
cole-h has joined #zig
pmwhite has quit [Remote host closed the connection]
pmwhite has joined #zig
SimonNa has quit [Remote host closed the connection]
craigo has joined #zig
qazo has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 260 seconds]
FireFox317 has joined #zig
FireFox317 has quit [Ping timeout: 240 seconds]
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #zig
dermetfan has joined #zig
karrick has quit [Read error: Connection reset by peer]
kwilczynski has quit [Ping timeout: 256 seconds]
tracernz has quit [Ping timeout: 272 seconds]
kwilczynski has joined #zig
karrick has joined #zig
tracernz has joined #zig
euandreh has quit [Remote host closed the connection]
euandreh has joined #zig
ifreund[m] has joined #zig
decentpenguin has quit [Quit: ZNC crashed or something]
cole-h has quit [Quit: Goodbye]
ur5us has joined #zig
Kingsquee has quit []
FireFox317 has joined #zig
heitzmann has quit [Quit: WeeChat 2.9]
heitzmann has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
<scientes> daurnimator, what documentation are you working off of for timer0.zig in the fomu-workshop tree?
<scientes> where are you getting all these magic MMIO addresses?
<scientes> nice job on this!
marnix has quit [Ping timeout: 256 seconds]
marnix has joined #zig
SimonNa has joined #zig
daurnimator has quit [Ping timeout: 244 seconds]
<FireFox317> i'm also trying to run zig on fpga's :P
<leeward> Like on an ARM core on an FPGA? Or are you trying to field-program some gate arrays with it?
daurnimator has joined #zig
<scientes> FireFox317, well this is risc-v
<scientes> also compiles to 560 bytes
<FireFox317> leeward, I have an Xilinx Zynq board which has a dual-core armv7 cpu and programmable logic on the die. Running Zig on the arm core's is pretty easy, but now i'm working on running zig on a riscv-softcore inside the programmable logic and talking to the arm core over an AXI interface.
<ikskuh> :O
<scientes> FireFox317, directly to the risc-v or through memory?
<scientes> as that looks like it is tied to wishbone
<scientes> >
<scientes> support for atomic operations.
<scientes> oh wow, cool
<scientes> this is pretty complete stuff
<FireFox317> ikskuh, my todo list also consists of putting a spu-core in the programmable logic and programming that one with zig (stage2) :P
<ikskuh> haha neat!
<ikskuh> i have a semi-compliant core in VHDL
<scientes> what language does it run?
<FireFox317> scientes, his own isa (spu-2 iirc?)
<ikskuh> yeah, right now i only have a assembler
<ikskuh> FireFox317: if you start doing this, ping me in #spu-mark-ii ;)
<FireFox317> scientes, through memory i guess. Let the soft-core do a specific task and use the arm core for visualisation and stuff
<danyspin97> how can I initialize a [:0] ?
<scientes> FireFox317, I was wondering how I could write a little asic and have it do its own DMA
<scientes> and how to call it from a soft-core
<scientes> people are using llvm to write GPU+CPU stuff
<scientes> so this stuff should be really standard by now
<ikskuh> scientes: what do you mean by ASIC here?
<scientes> ikskuh, just verilog
<ifreund> danyspin97: a null-terminated array literal
<ikskuh> ASIC is just another Tech similar to FPGA, both can implement pretty much the same
<ikskuh> danyspin97: slice something with terminator:
<ifreund> [_:0]u8{1,2,3};
<scientes> ikskuh, yeah, ASIC means actual silicon, but I am trying to talk about how things communicate
<ikskuh> var some = "hell\0 world!";
<ikskuh> some[0..4 :0]
<ikskuh> scientes: that's why i was wondering…
<scientes> ikskuh, like the FOMU is unusual as the FPGA is hooked up directly to the USB pins
<danyspin97> ifreund, ikskuh: what about heap vars?
<scientes> which means you can implement a HID or mass storage device
<FireFox317> ikskuh, sure will do (i'm still in the phase where i'm figuring out how everything works) this zynq chip is quite complex :D
<scientes> FireFox317, have you checked out if the open source symbiflow toolchain works?
<scientes> oh nvm, they don't have any zync support yet
<ikskuh> danyspin97: same difference, you can create a zero-terminated slice out of any normal sliceable type that contains a zero. if there isn't a zero, it will crash
<scientes> but they do have 7-series support
<scientes> so if it is 7-series you could help them out :)
<ifreund> danyspin97: allocate however much memory you want then write whatever you want to it
<FireFox317> yes i'm in the #symbiflow channel and saw you were in some other channels to (##openfpga, #yosys)
<ikskuh> note that arrry with terminator do have a zero terminated slice already
<FireFox317> scientes, ^^
<danyspin97> ifreund, ikskuh: I see... not trivial though. Using a stack var is simpler in this case
<FireFox317> scientes, yeah there is support for zynq fpga's in the symbiflow toolchain. I managed to get blinkly led working on the zynq
<FireFox317> however, there is not a good example yet
<scientes> FireFox317, can you blink it from the arm core?
<FireFox317> yes :D
<scientes> oh sweet
<ikskuh> danyspin97: it doesn't matter if you use a stack or a heap var. same difference
<FireFox317> scientes, i'm working on an example which i will add to symbiflow-examples i think
<FireFox317> scientes, you have an fomu?
<scientes> yes, and I just bought a litefury
<scientes> when i found out it shuts down on overheat as I can't fit the heatsink in my laptop
<scientes> I want a co-processor ABI I can use
<FireFox317> ah it has a pcie interface?
<scientes> m.2 yes pcie
<FireFox317> scientes, ah i see, artix7. so you basically want to have a soft-core running in the fpga logic as a co-processor for your main laptop cpu?
<scientes> maybe I could also just use a serial port type thing
<FireFox317> serial port over pcie?
<scientes> my problem with the fomu is that it is too difficult to build
<scientes> especially when you have to put a usb stack on there to communicate at all
drawkula has joined #zig
<FireFox317> scientes, yeah a simple uart interface is way easier ofcourse. But regarding the fomu it's really nice that you can use a complete open-source toolchain for the ice40. This is not yet the case for the xilinx 7-series chips (artix, zynq etc)
yeti has quit [Ping timeout: 240 seconds]
<FireFox317> scientes, well its possible as i said before, however a lot of the bitstream documentation is not yet reversed engineered (for the xilinx chips)
<scientes> only stuff that doesn't exist on ice40 however :)
<scientes> FireFox317, the problem is that reading these standards has nothing to do with my project
<FireFox317> true that :P and P&R is way harder because the chip is way bigger (VPR is used for xilinx chips instead of nextpnr) however daveshaw started working on a nextpnr-xilinx
<FireFox317> scientes, reading usb and pci-e standards?
<scientes> i want it to feel a little more like programming linux, when I can just program to an interface, rather than have to bootstrap myself
drawkula is now known as yeti
<FireFox317> scientes, i see. I think this has to do with the background of most fpga users. They are more hardware oriented (like me, electrical engineering) and thus the high-level interfaces that software people are used to do not really exist at the fpga level yet. However with the increasing popularity of open-source fpga toolchains this is definitely gonna change i think.
<leeward> I think the constraints there are more around the resources available on the fpga than the toolchain. If you have enough gates, you can give your soft core a bunch of SRAM and run an operating system. Or put a memory controller on it and talk to external DRAM. It's more about what you get and why you're using an fpga in the first place.
waleee-cl has joined #zig
rzezeski has joined #zig
euandreh has left #zig ["ERC (IRC client for Emacs 26.3)"]
<scientes> FireFox317, it would be nice if the open source tools supported the serializer/deserializer
<scientes> and that would be a natural interface
<scientes> leeward, except the whole reason I am interested in FPGAs is that you DONT have to implement a stack machine
<scientes> sequential stack machine
<FireFox317> scientes, you mean the serdes interface on the 7-series? (ISERDES and OSERDES)?
<scientes> yeah
<scientes> the next generation of CPUs are also moving to serial ram interface
<scientes> because ram is now taking up like half of the pins on a CPU, and is limiting bandwidth
<scientes> so those pins are going to be offloaded onto a ram controller
<ikskuh> but you give up transmission speed for this
<ikskuh> <scientes> the next generation of CPUs are also moving to serial ram interface
<ikskuh> can you link me resources for this?
<ikskuh> it's hard to believe this is a good idea
<ikskuh> crazy
<ikskuh> i really wonder how fast the transfer frequencies on those serial links are
<ikskuh> they are as fast as the fastest DDR4
<ikskuh> but with less pins, so we have to get higher transfer rates
<ikskuh> this image is quite funny, you can see marketing people trying to trick other people into the "bigger is better" thinking :D
<ikskuh> 25.6 MBit/s is the transfer rate of DDR4 @ 3.2 GHz whereas serial attached ram has one 25.6 GHz link
<scientes> this was the main thing people seemed interested in at the OpenPOWER summit (I was not there)
<ikskuh> hm
<yeti> scary
<ikskuh> i wonder how high frequencies will go in the future
<ikskuh> btw: at 25.6 GHz serial line we have 1 bit per centi meter vacuum transfer
<scientes> they are talking doing these serial designs in this video https://www.xilinx.com/products/silicon-devices/fpga/artix-7.html
<yeti> they should be thrown on a lonely island with a 4MHz CP/M system and wordstar
<yeti> :-Þ
<ikskuh> so a 10 centimeter wire has ~ 30 bits of data in it :D
<yeti> back to mercury memory...
<yeti> :-Þ
<scientes> core memory :)
<scientes> hand-woven too
<yeti> sound in mercury was funnier
<ikskuh> aaaa, delay line memory <3
<yeti> jip!
<ikskuh> the fond memories of "WTF was Stanley Frankel doing there?!"
<yeti> ±1950
<scientes> ikskuh, I don't see why serial is a bad idea when you already have a pretty high guaranteed latency inherant to capacitance memory
<ikskuh> i know, i wrote my bachelor thesis about a machine from 1966
<ikskuh> scientes: i just wonder if it's worth the tradeoff, that's all
<ikskuh> more pins vs. high frequency domains
<scientes> my point is that you can probably still achieve the same latency
<ikskuh> if i get it right, both latency and transfer rate are the same
<scientes> ikskuh, no. Look at 2.1 https://lwn.net/Articles/250967/
<scientes> capacitance memory must be recharged
<scientes> that is the timings 2,2,3 that memory has on it
<ikskuh> yeah, so?
<scientes> that limits the latency
<ikskuh> that serial memory thing doesn't change *anything* about the memory type
<ikskuh> it changes the way i communicate with the memory
<ikskuh> both systems have DDR4 memory in it
<ikskuh> but the DDR4 isn't attached to the CPU anymore
<ikskuh> but has a parallel->serial translator
<scientes> yeah but you can serialize/deserialize during the recharge
<scientes> (that is my idea)
<fengb> Do we detect arenas-within-arenas?
<scientes> I don't think it costs anything to serialize/deserialize because of this
<scientes> fengb, not last time I checked, but SAMBA has something like that
<scientes> tmalloc
xackus has joined #zig
wootehfoot has joined #zig
dimenus has joined #zig
nvmd has joined #zig
dimenus has quit [Client Quit]
nvmd has quit [Client Quit]
dimenus has joined #zig
<dimenus> andrewrk: how do you build zig in NixOS? have you made your own libclang nix pkg?
wootehfoot has quit [Ping timeout: 256 seconds]
wootehfoot has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
moo has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
wootehfoot has quit [Ping timeout: 256 seconds]
dermetfan has quit [Quit: WeeChat 2.7.1]
marnix has quit [Ping timeout: 264 seconds]
nvmd has joined #zig
cole-h has joined #zig
riba has joined #zig
Akuli has joined #zig
<pmwhite> There is a zig package in nixpkgs. You can copy that and modify it to compile master instead of whatever release nixpkgs uses.
<pmwhite> dimenus: ^^
moo has quit [Ping timeout: 256 seconds]
riba has quit [Ping timeout: 256 seconds]
gazler has quit [Remote host closed the connection]
moo has joined #zig
marnix has joined #zig
craigo has quit [Ping timeout: 256 seconds]
moo has quit [Ping timeout: 264 seconds]
moo has joined #zig
dermetfan has joined #zig
metabulation has joined #zig
moo has quit [Ping timeout: 265 seconds]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
ur5us has joined #zig
<ifreund> I am so thankful for 0xaa
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
cole-h has quit [Quit: Goodbye]
<scientes> 0xAAAAAAAAAAAAAAAAAAAAAAA
<scientes> its screaming :)
<ikskuh> everyone: screams
<ikskuh> zig programmer: 0xAAAAAAAAAAAAAAAAAAAAAAA
cole-h has joined #zig
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
Akuli has quit [Quit: Leaving]
metabulation has quit [Ping timeout: 256 seconds]
dimenus has quit [Quit: WeeChat 2.9]
FireFox317 has quit [Ping timeout: 264 seconds]
dermetfan has quit [Ping timeout: 260 seconds]
stripedpajamas has joined #zig
dermetfan has joined #zig
dermetfan has quit [Ping timeout: 272 seconds]
metabulation has joined #zig
metabulation has quit [Read error: Connection reset by peer]
<ifreund> isn't there some std function to zero-init structs? Or am I imagining things?
<fengb> std.mem.zeroes
<ifreund> ah I was looking in meta, thanks
<ifreund> though, the doc comment makes me think I should just write it out instead
<ifreund> the struct only has 4 fields, it's not *that* much work
marnix has quit [Ping timeout: 256 seconds]
xackus has quit [Ping timeout: 265 seconds]
nvmd has quit [Quit: Later nerds.]
<andrewrk> dimenus, I build llvm, clang, and lld from source, because I end up testing with multiple versions anyway
<pixelherodev> I'm going to see if I can address that CBE design flaw I mentioned on GH yesterday
<pixelherodev> I think it's the only big issue remaining
<pixelherodev> (with CBE)