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/
dongcarl has quit [Quit: The Lounge - https://thelounge.chat]
dongcarl has joined #zig
craigo has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 260 seconds]
mmx870 has quit [Quit: Ping timeout (120 seconds)]
mmx870 has joined #zig
ur5us has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 256 seconds]
nephele_ is now known as nephele
dongcarl has quit [Quit: The Lounge - https://thelounge.chat]
dongcarl has joined #zig
dddddd has quit [Ping timeout: 264 seconds]
aerona has joined #zig
<pixelherodev> andrewrk: guess what I did today? :D
<pixelherodev> #5422 is just about ready to merge :)
marijnfs has joined #zig
<pixelherodev> Tests pass locally, and I was able to enable one of the ones that was previously failing :)
<pixelherodev> Fully rebased against master, I removed some of the changes you added and replaced with a wrapping API over ZIRCases
<pixelherodev> Altered the error testing implementation to more closely match the one you added
marijnfs_ has quit [Ping timeout: 264 seconds]
gazler__ has joined #zig
gazler_ has quit [Ping timeout: 258 seconds]
reductum has joined #zig
redj has quit [Ping timeout: 260 seconds]
redj has joined #zig
Stephie has quit [Ping timeout: 240 seconds]
<andrewrk> pixelherodev, nice!
Stephie has joined #zig
<andrewrk> in other news, the compile error "TODO: type coercion of anon struct literal to struct" is gone
<daurnimator> yay!
<daurnimator> there's a couple of verbose places around dealing with std.json.StringifyOptions and std.LinearFifo.LinearFifoOptions that should be made terse
waleee-cl has quit [Quit: Connection closed for inactivity]
fraktor has joined #zig
aerona has quit [Quit: Leaving]
<andrewrk> nice
marnix has joined #zig
vroomerify has joined #zig
vroomerify has quit [Remote host closed the connection]
vroomerify has joined #zig
<pixelherodev> andrewrk: rereview would be appreciated
* pixelherodev will finish the patches tomorrow
<andrewrk> pixelherodev, I'll be sure to get to it tonight before bed :)
<pixelherodev> :)
<pixelherodev> oh and
<pixelherodev> for the record, CI actually passed
<andrewrk> beautiful
<pixelherodev> Azure had an issue provisioning th3 macos run though
<pixelherodev> so resubmitting the build should pass (and waste electricity)
ur5us has quit [Ping timeout: 256 seconds]
<andrewrk> I'm comfortable testing during the merge process. The CI is just a time saver if it's green
vroomerify has quit [Remote host closed the connection]
Techcable has quit [Quit: ZNC - http://znc.in]
Techcable has joined #zig
Techcable has quit [Quit: ZNC - http://znc.in]
Techcable has joined #zig
opDispatch has quit [Quit: Konversation terminated!]
frett27_ has joined #zig
Patrice_ has joined #zig
frett27 has quit [Ping timeout: 265 seconds]
frett27_ has quit [Ping timeout: 264 seconds]
_Vi has joined #zig
tdc has joined #zig
marnix has quit [Ping timeout: 264 seconds]
cole-h has quit [Quit: Goodbye]
_Vi has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
alexnask has joined #zig
wilsonk has quit [Ping timeout: 260 seconds]
_Vi has joined #zig
puzzleddev has joined #zig
dermetfan has joined #zig
reductum has quit [Quit: WeeChat 2.8]
wilsonk has joined #zig
fraktor has quit [Ping timeout: 246 seconds]
marnix has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
squeek502_ has quit [Ping timeout: 260 seconds]
squeek502 has joined #zig
tines9 has quit [Ping timeout: 256 seconds]
tines9 has joined #zig
shachaf has quit [Ping timeout: 246 seconds]
shachaf has joined #zig
nikita` has joined #zig
dddddd has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
ifreund has quit [Quit: WeeChat 2.8]
Patrice_ has quit [Ping timeout: 256 seconds]
ifreund has joined #zig
nmeum has quit [Remote host closed the connection]
nmeum has joined #zig
ifreund has quit [Ping timeout: 265 seconds]
ifreund has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
doublex has quit [Remote host closed the connection]
doublex has joined #zig
Patrice_ has joined #zig
frett27_ has joined #zig
kushalp_ has joined #zig
gonz__ has joined #zig
cncl_ has joined #zig
gpanders_ has joined #zig
][_R_][ has joined #zig
redj_ has joined #zig
haliucin1s has joined #zig
SimonN has joined #zig
doublex has quit [Ping timeout: 256 seconds]
Patrice_ has quit [Read error: Connection reset by peer]
kushalp has quit [Read error: Connection reset by peer]
cncl has quit [Ping timeout: 265 seconds]
gonz_ has quit [Read error: Connection reset by peer]
gpanders has quit [Quit: ZNC - https://znc.in]
redj has quit [Remote host closed the connection]
[RMS] has quit [Quit: No Ping reply in 180 seconds.]
haliucinas has quit [Ping timeout: 265 seconds]
SimonNa has quit [Ping timeout: 265 seconds]
hermier has quit [Ping timeout: 265 seconds]
cncl_ is now known as cncl
gonz__ is now known as gonz_
kushalp_ is now known as kushalp
drewr has quit [Ping timeout: 256 seconds]
drewr has joined #zig
doublex has joined #zig
cole-h has joined #zig
rzezeski has joined #zig
gonzus has joined #zig
<gonzus> Great job to those involved in the zig show presentations.
<pixelherodev> Thanks! :)
<gonzus> Question to Andrew: are you planning to continue your video casts?
<gonzus> I ask because they are focused on different content, and... I miss them :-)
<BaroqueLarouche> Thanks gonzus :)
<mq32> gonzus: thanks!
<mq32> i wanted to answer to an issue on github
<mq32> now i have my own generators implementation:
<mq32> only thing needed to make this *awesome* is to be able to create anonymous tuples
<ifreund> gonzus: andrew mentioned that he's planning on doing one soonish after a little more work on stage2 is done
<gonzus> Ah, great, thanks for the info ifreund
<scientes> I don't really see why we had to port compiler_rt to zig.
<scientes> and deal with the bugs
xackus has joined #zig
<companion_cube> mq32: I don't see an assignment to `is_finished?
<mq32> done.* = true
<mq32> i could encapsulate that into a anonymous function in the Generator thing itself
<companion_cube> oh I see. Why doesn't the function return a tuple instead?
<companion_cube> or is that what you meant? :D
<companion_cube> if it returned `{?*u32, bool}`
<mq32> doesn't work for generators ;)
<mq32> it's async
<mq32> you can also generate data forever
<companion_cube> ah I see
<companion_cube> could you pass the `resume_loc` as an argument instead?
<companion_cube> a nice API would be `yield(the_frame, the_value, is_done)` I guess
<companion_cube> instead of having a global
gonzus has quit [Remote host closed the connection]
<mq32> i can try…
<fengb> mq32: all of these userland generators are incompatible with async functions
<mq32> yeah
<mq32> i know
<fengb> If you try passing one it, it breaks pretty spectacularly
<mq32> still wanna play a bit though
<mq32> it even breaks when calling yield() instead of doing it locally
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
<mq32> yeah, async is not suitable for generators :D
<fengb> It's suitable... if we didn't have to contend with real async
<fengb> We need another primitive to tell the difference between real async and generator
<companion_cube> it's because `suspend` cannot return a value, right?
<mq32> no
<fengb> Nah, you can work around that. The harder part is that userland generators look identical to async functions
<mq32> because you resume to something else than your generator
<fengb> So when you use a real async function, the contexts blend together
<companion_cube> hmmm
<mq32> and if you call an async functon in a generator, it may return to the generator or the event loop
<mq32> depending on the problem
<companion_cube> I don't have the mental model for that stuff
<companion_cube> is it me, or is zig removing C's footguns and adding new ones? 🙃
<fengb> Eh... C doesn't have async or generators
<companion_cube> doesn't change the end result
<fengb> Zig doesn't have generators either
<fengb> We're not removing or adding anything here
<companion_cube> well, it's a question of what's idiomatic
<companion_cube> async is idiomatic in zig, but it's tricky
<fengb> Generators ain't idiomatic :P
<fengb> That's what I learned spending a month or so on it
<mq32> aaaand i found a miscompilation!
st4ll1 has quit [Ping timeout: 256 seconds]
st4ll1 has joined #zig
marnix has quit [Ping timeout: 246 seconds]
<pixelherodev> More stage2 work coming soon :D
<tgschultz> goddamnit git...
<mq32> fengb: do you see any problem with that? https://godbolt.org/z/6jzQMT
<mq32> it *should* pass the right args, but it doesn't
<ifreund> what'd git do this time?
<tgschultz> I'm sure it's doing what it is supposed to do, that's just not what I need it to do for my simple use case. I worked it out though by just forcing the push.
<fengb> You're trying to build a type using comptime values. That's not gonna work
<fengb> The fix is... pretty horrible
<mq32> so the problem is this hack: @TypeOf(.{ @as(args[0].arg_type.?, undefined) })
<fengb> Yeah, it's a comptime known value so it becomes a comptime only field
<fengb> You need to convince the value to be runtime known: https://godbolt.org/z/usoJn8
<fengb> It gets really messy
<fengb> We need the tuple{} syntax :P
<mq32> problem is that @TypeOf enforces comptime evaluation
<mq32> which means … i cannot do that in this case :(
<fengb> My hack works. I reference a global variable
<fengb> Well... "works". I haven't tested it other than making sure the compiler is doing what I had expected
<fengb> And then decided this is terrible and nobody should use it
<fengb> Oh this only works with ints. I had a different prototype for bitcasts and it was even worse looking
<mq32> oh
<mq32> i understand
<fengb> Oh ha, that's less terrible
dermetfan has quit [Ping timeout: 256 seconds]
<fengb> I wish I thought of that :/
<mq32> kinda cool solution still
<mq32> except for the tuple hack
<fengb> It's a much saner tuple hack than what I big brained
<fengb> I might actually borrow that for wazm
<mq32> you're welcome
<scientes> Why doesn't orelse chain?
<scientes> this.foo() orelse this.foo() orelse this.foo() orelse....
<ifreund> i think you just need parentheses
<ifreund> this.foo() orelse (this.foo() orelse (this.foo() orlse 42)))
<scientes> lmao
<fengb> That also force evaluates all of them
<ifreund> lol
<fengb> Should we have short circuiting like `and` keyword?
<ifreund> i'd be for that
<ifreund> i think it makes a lot of sense
<fengb> (Actually I don't know if it's eager, but it looks eager to me based on those rules)
<scientes> fengb, ++
<scientes> looks like I was runnning into an unrelated bug
dermetfan has joined #zig
<mq32> fengb: i made it better
<mq32> way better
<fengb> That looks almost identical to my version
<mq32> haha lol
<mq32> power of zig: let two people indenpendently write the same code
<fengb> Except you split out the context and the generator creation, which I didn't bother
<mq32> usability of that is actually quite high until you enable event looping 🙃
<fengb> Yep, that's where I decided this isn't good
<fengb> Most of my usecases for generators ended up being solved by an async stream anyway
D3zmodos has left #zig ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
riba has joined #zig
<mq32> hehe
<mq32> yeah this was more a game to me, i don't really have use for endless generators
Akuli has joined #zig
dtz has quit [Quit: Idle for 30+ days]
<fengb> And you discovered not-shitty userland tuples :D
<xackus> andrewrk will stage2 have two kinds of IR like stage1, which has IrInst{Src,Gen}? i haven't analyzed the new stage2 code too much
<scientes> yeah we don't need closures
<scientes> because you can just do a struct, and put all your variables in there, and then have an init() function
<scientes> right?
<leeward> Is Zig IR specified?
<scientes> leeward, neither the old nor the new
<scientes> nowhere nears
<scientes> leeward, the stage1 is basically "build it as quickly as possible"
<scientes> although there was a clear refactoring into the two passes
<scientes> the first pass is type legalization
<leeward> Is there a plan to specify it, as part of allowing non-LLVM backends?
<scientes> no
<scientes> the specification is the language
<scientes> (I do not speak for the zig project)
<ifreund> I wouldn't be surprised to see it specified eventually, though that's far down the line
<pixelherodev> ZIR is probably going to be relatively standardized.
<pixelherodev> That's basically a requirement for contributor friendliness
<pixelherodev> I wouldn't be surprised it gets iterated on a bit first, but I *would* be surprised if it doesn't happen.
<leeward> I'm just asking because it helps with validating tools for use in safety-critical systems.
<ifreund> huh, is ?*c_void supposed to coerce to *c_void?
<pixelherodev> No
<pixelherodev> Well
<pixelherodev> Hmm
<pixelherodev> No
<pixelherodev> I'm 99% sure
<pixelherodev> That's a normal Zig pointer to a special C type
<pixelherodev> I could easily be wrong actually, I don't know if pointers to C types are considered special types
<ifreund> i don't think they are
<ifreund> only [*c] should be weird afaik
<fengb> Stage 1 IR is implementation detail. I think stage 2 ZIR will have some semblence of spec / stability
<leeward> I'm pretty sure the way to get ?*c_void to *c_void is the same as going from ?*u32 to *u32.
<pixelherodev> What fengb said
<leeward> Yeah, that seems reasonable.
<pixelherodev> as I've mentioned in discord, I plan on making a new Stage1 compiler using ZIR
<ifreund> well ?*c_void is coercing to *c_void for me
<ifreund> oops one sec
vroomerify has joined #zig
<leeward> That sounds wrong.
<ifreund> yeah i agree
<ifreund> i'm gonna open an issue
<pixelherodev> andrewrk: would I encounter any issues trying to use ZIR for e.g. C?
factormystic has quit [Read error: Connection reset by peer]
shakesoda has quit [Quit: Connection closed for inactivity]
factormystic has joined #zig
<ifreund> hmm, how far along is the testing framework for stage2? Would turning all the open issues for stage1 bugs into stage 2 tests be a helpful thing to do?
<ifreund> i mean they would be disabled by default until stage2 supports the features of course
<pixelherodev> ifreund: as of this morning, pretty good :)
<pixelherodev> But no, that's not useful yet
<pixelherodev> We need the Zig AST -> ZIR PR merged first
<pixelherodev> Once that's done, I'll extend the test harness to support testing Zig source instead of ZIR
<pixelherodev> Then we can worry about stage1 tests
<ifreund> ah yeah right, we're still in ZIR land
<pixelherodev> Not for long :D
<pixelherodev> Andrew has the AST -> ZIR PR open
<ifreund> i know, things are moving!
<pixelherodev> Yeah, it's really nice
<pixelherodev> I'm going to try to get function calls with arguments finished today
<pixelherodev> Then any other PRs I may have open
<pixelherodev> Then I'm going to alternate between tackling more ZIR work, finishing and simplifying the testing framework (adding convenient API wrappers), and my alternate stage1
<scientes> pixelherodev, in C++?
<pixelherodev> No.
<pixelherodev> C.
factormystic has quit [Read error: Connection reset by peer]
<pixelherodev> I'm not using LLVM for this, I'm using ZIR.
<scientes> oh gotcha
<pixelherodev> and I want a compiler that doesn't depend in >4M lines of C++
<pixelherodev> s/in/on
<ifreund> heh, found myself a nice workaround for the c_void issue https://paste.rs/iSM
<pixelherodev> I have an intense dislike for LLVM after the LLVM 10 nonsense
<scientes> pixelherodev, but then you don't have an optimizing compiler
<pixelherodev> Unless, and here's a thought
<pixelherodev> a) I write basic optimizations myself
<scientes> pixelherodev, and the CPU has far more lines than that....
<pixelherodev> b) I don't care to optimize all that much
<pixelherodev> and c) it's only intended to build stage2, so performance is irrelevant
<ifreund> i mean the goal of stage 1 is just to build stage2 right
<ifreund> yeah
<pixelherodev> Rather, generated code performance isn't relevant
<scientes> the C) one is very valid to me
<leeward> ifreund: That is quite the work around.
<pixelherodev> The idea is to do only very basic optimizations
<pixelherodev> Enough that the build stage2 is at least reasonably useful
<pixelherodev> And can then build itself in a reasonable timeframe
<ifreund> leeward: only in zig can you do shit like this to work around compiler bugs :D
<pixelherodev> Here's the kicker though
<pixelherodev> This is going to be part of my project tricarbon
<pixelherodev> Which means, any optimizers I write for this will be usable for my other projects
<pixelherodev> and vice versa
<ifreund> nice so it's gonna be ZIR -> RISC V in C?
<pixelherodev> I might do that
<pixelherodev> It's multiple components
<pixelherodev> First, Zig parser / AST builder
<pixelherodev> Second, AST -> ZIR
<pixelherodev> Third, comptime executor
<pixelherodev> Fourth, ZIR backend
<ifreund> right, comptime
<pixelherodev> Each one will be usable on its own
<pixelherodev> So the comptime executor will be able to be integrated into stage2 for instance
<vroomerify> Sorry to interject here -- I'm a new-comer attempting to build zig from source. When I run "cmake .." it says (missing: CLANG_LIBRARIES), I'm running Arch Linux and I've installed "llvm", "clang", and "lld", so I thought I had everything installed, but apparently not. Do I need to set an environment variable?
<scientes> leeward, yeah I've done similar stuff
<pixelherodev> vroomerify: That's the LLVM 10 stuff I was whining about earlier
<pixelherodev> You need to set CLANG_somethingorother_DYLIB in CMake
<scientes> leeward, also its invalid because you need to do *align(4) u32
<scientes> oh nvm
<pixelherodev> Or LLVM_somethingorother_DYLIB maybe?
<scientes> I mean ?*align(4) c_void
<scientes> or *align(1) u32
<ifreund> vroomerify: from the arch PKGBUILD you need -DZIG_PREFER_CLANG_CPP_DYLIB=ON
<ifreund> idk why you need it on arch, i don't need it on void
<ifreund> well i do know why, llvm 10 is slightly broken
<vroomerify> ifreund / pixelherodev, thanks for the heads-up. When you say PKGBUILD, are you referring to a file in/associated with the zig package for arch?
<pixelherodev> yeah that's the one
<pixelherodev> uh
<pixelherodev> was responding to ifreund
<pixelherodev> sorry
<pixelherodev> Just do `cmake . -DZIG_PREFER_CLANG_CPP_DYLIB=ON` in the build folder
<scientes> woah this is interesting
<pixelherodev> what is it?
<scientes> basically regexp-style optimizations in LLVM which means that the speed does not slow down so much as you add more optimizations
<rom1504> I'm following the project and wondering what's the thing that could make zig really used by people. It seems having a package manager would be a good feature. I see it's planned but apparently a second priority to the self compiler. A bit confused about that. What does self compiling provides ? (In addition to being cool)
<scientes> rom1504, a cmopiler is a really good proof that the language is in decent shape
<scientes> go-lang is one of the few that seriously delayed self-hosting
<pixelherodev> self-hosted compilation is a must for any language that wants to be taken seriously
<ifreund> also there's good reason to prefer writing code in zig over c/c++
<rom1504> Ok, so you'd say being able to self compile is a blocker for people starting to build things with zig ?
<rom1504> I can imagine along the path of building a self compiler the language might change and it could explain the blocking part
<rom1504> One of the biggest weakness of c and c++ is how annoying it is to use and combine dependencies (and publish new packages), so that's definitely something that would make people consider using zig (to have a package manager)
<rom1504> And all new languages have some kind of package manager (with more or less success)
<rom1504> But I see zig is developing quite nicely, I guess Andrew has a big plan :)
<pixelherodev> Eh, I actually prefer that C projects tend to have fewer dependencies
<pixelherodev> A package manager is all well and good, as long as we don't turn into Cargo / NPM / etc
<ifreund> ^
<pixelherodev> Easier packaging, yes.
<ifreund> it's more of a culture thing really
<pixelherodev> Bloated dependency graphs, hell no.
<pixelherodev> For sure
<pixelherodev> Doesn't make it any less annoying though
<pixelherodev> :P
<ifreund> but yeah, zig is already far enoungh along that I'm very happy to have chosen it for my project
<ifreund> a few rough edges here and there, but worth it to be writing in a modern language with much stronger pointer typing and nice error handling
<ifreund> also comptime is awesome
<leeward> I would be happy to switch entirely from C to right now if the implementation could handle it.
<ifreund> i can even have a nice compile error :) https://paste.rs/GIy
factormystic has joined #zig
<afontain_> also, I'd appreciate if it coud play well with distribution package managers. For example, it shouldn't try to download dependencies from the internet (python and cargo tend to do that). It also shouldn't be too anoying about version requirements: breaking ABI "just because you can" isn't nice, nor is using an outdated version of the dependency just because you can ask the package manager to use the old version.
<afontain_> (note that using outdated dependencies is also a problem in the C world)
<pixelherodev> Working with distribution package managers is a must for me
<pixelherodev> I won't touch any packages that don
<pixelherodev> 't
<ifreund> yeah same
<afontain_> (breaking ABI is also something that exists in the C world, but soname differences mitigate that)
<ifreund> C packaging is pretty messy tbh, theres a reason there are so many different takes on package managment
<scientes> ifreund, not as messy as it is diverse
<ifreund> but yeah I want distro packagers to be pleasantly surprised by zig packaging not cursing it
doublex has quit [Ping timeout: 244 seconds]
<ifreund> scientes: it could be argued that the diversity stems from the fact that there's no knockdown way to do it well
<pixelherodev> ifreund: it could also be argued that it's because there *is no right way*
<pixelherodev> Some languages try to enforce their "correct way"
<pixelherodev> it never ends well.
<ifreund> fair
<scientes> pixelherodev, the problems come with naming too many namespaces in too many places
<pixelherodev> ?
<scientes> like how C developed a need for header files (which isn't part of the language), because of how declarations need to be forward declared
<scientes> which was all about supporting extremely-low-memory systems
<leeward> C needs header files because interfaces shouldn't live with specification, and tooling didn't exist in the '70s to auto-generate documentation from code.
<scientes> leeward, but it isn't part of the language
<leeward> That's a matter of semantics.
<leeward> Or are you talking about the preprocessor's #include?
<ifreund> that's how headers work yeah
<ifreund> headers are part of the preprocessor not C
<scientes> sometimes I write C with #include "foo*.c*"
<scientes> just to make it simpler
<leeward> CPP is specified in the standard.
<leeward> That's how C99 got to have variadic macros.
<pixelherodev> scientes: that's... questionable, to say the least
<andrewrk> xackus, yes, one maps to the text format, one is an in-memory format, but can be serialized to the text format
<pixelherodev> Ooh, idea
<pixelherodev> A zig build system port to C
<pixelherodev> It's straightforward enough to be pretty simple
<pixelherodev> Better yet, @export it
<pixelherodev> A C API wrapper
<ifreund> the point is to be able to write a build.c instead?
<pixelherodev> Yeah
<ifreund> idk, i'd rather just write it in zig :D
<pixelherodev> The idea is for my stage1 compiler
<pixelherodev> and potentially the official one
<pixelherodev> Remove the dependency on CMake
<leeward> I don't think the world needs another build system, but I don't write code on Windows so I can just use Make.
tdc has quit [Ping timeout: 256 seconds]
<companion_cube> or ninja
<pixelherodev> ^
marnix has joined #zig
<leeward> If I'm using ninja, it's wrapped in Make and I don't have to know about it.
<leeward> :P
<pixelherodev> Uh, what?
<scientes> make is gross
<pixelherodev> That's... yeah
<pixelherodev> Make is awful
doublex has joined #zig
<pixelherodev> Ninja is waaay better
<leeward> Make is good at its job; it's just very old.
<companion_cube> leeward: you can genrate ninja from zig
<pixelherodev> The idea is a simple build system with no dependencies other than a C compiler - no CMake, no python (Meson), etc
<pixelherodev> leeward: ninja is much better at Make's job
<pixelherodev> lol
<scientes> but ninja can't call ffi
<scientes> anyways, its about data structures and algorithms
<scientes> not names of things
<leeward> pixelherodev: Ninja is much newer than Make, and it's not as good at the job of having humans edit it.
<pixelherodev> True
<ifreund> make isn't bad at all for simple projects
<leeward> It's fine, but when I write a 20-line C program it comes with a Makefile.
<ifreund> i quite like meson for larger C/C++ things though
<scientes> I like writing zig where you don't need any build system
<scientes> just a build-exe or build-lib
<scientes> THAT is the way it should be done
<pixelherodev> lol
<pixelherodev> no
<pixelherodev> For the same reason cproc shouldn't be invoked directly
<fengb> If we adopt gopath way, that could be achieved :P
<pixelherodev> Nobody wants to repeatedly type out `$COMPILER $SOURCES -o $OUTPUT $FLAGS $LIBRARIES` repeatedly
<leeward> pixelherodev: Yeah, I get why we have zig build, and I'm not too cranky about it (still a little cranky) but the "no extra programs" thing is kinda weak. You can always just build the program that builds your code along side the compiler, or as part of it, and use a DSL for specifying DAGs.
<pixelherodev> `ninja` / `make` / `zig build` is totally fine
<scientes> except build.zig is equilivent to wget foo.sh; sh foo.sh
<pixelherodev> scientes: how so?
marnix has quit [Ping timeout: 256 seconds]
<pixelherodev> leeward: what "no extra programs" thing?
<leeward> pixelherodev: build.zig only depends on the zig compiler, right? Make only depends on a C compiler if you have a source distribution.
<ifreund> scientes: if you're doing that you could just add the #!/bin/zig run shebang and chmod +x
<pixelherodev> leeward: the build system, yeah, but you *can* depend on other programs too if you need to
<ifreund> i think you need slightly more that in the shebang though
<pixelherodev> For sure
<pixelherodev> That wouldn't work correctly, I don't think
<pixelherodev> Yeah no
<leeward> Shebangs don't like lots of command line arguments.
<pixelherodev> You need `zig build` because you need the build_runner
<leeward> #!/bin/zig-repl though
<pixelherodev> #!/usr/bin/zig-build
<ifreund> this works for me:
<ifreund> /bin/zig run $0 ; exit
chapl has joined #zig
<ifreund> oops, should be one more / at the beginning
<chapl> andrewk, are you there?
<chapl> I misspelled his name. Omg. @andrewrk
<andrewrk> hello
<chapl> You just were in the Discord. I wanted to ask you if you could help us solve the Zig + JNI issue for Windows.
<chapl> @andrewrk
<andrewrk> you have my divided attention
chapl has quit [Quit: Leaving]
riba has quit [Ping timeout: 256 seconds]
vroomerify46 has joined #zig
vroomerify46 has quit [Remote host closed the connection]
vroomerify has quit [Remote host closed the connection]
vroomerify has joined #zig
redj_ is now known as redj
<vroomerify> Where is the current code for building glibc, I'm assuming it's all in glibc.cpp? I'm trying to get a feel for this issue: https://github.com/ziglang/zig/issues/4313
<vroomerify> Full-disclaimer, I know nothing about this topic, but I figure the best way to learn is to attempt to solve the issue.
haliucin1s has quit [Read error: Connection reset by peer]
haliucinas has joined #zig
wootehfoot has joined #zig
<pixelherodev> andrewrk: what's the progress on AST -> ZIR? Estimated timeline for merge?
Barabas has joined #zig
<Barabas> Good evening!
<ifreund> o7
<Barabas> I'm having trouble finding my way around getting the command line arguments and opening a file.
<Barabas> and now I found that we have a `getCwd` in `std.process` but there's also `cwd` in `std.fs`
<ifreund> for getting the args your program is passed `std.process.args()` will return an iterator
<ifreund> for opening a file you generally do `std.fs.cwd().openFile()
<Barabas> Thanks
<ifreund> if you're on a posix system you can also get the args directly with std.os.argv
<Barabas> I am not.
ur5us has joined #zig
<leeward> So I'm trying to cross compile an SDL application for Windows, and it looks like I'm missing a library called Mmtimer. It's the one with timeBeginPeriod and timeEndPeriod. Is this a thing the Zig distribution should provide? It seems like it might be part of mingw.
<Barabas> It feels like the error on the `std.process.ArgIterator.next` is at the wrong level. I expect to be able to do `while (try it.next(allocator)) |next_arg|` not ehm... whatever it is I have to do now :P
<ifreund> that looks awkward indeed, i always us posixNext() cause my stuff doesn't support windows. Let me try and find a clean way
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 has joined #zig
<ifreund> Barabas: this isn't too bad https://paste.rs/JXD
<leeward> It seems like there are a bunch of windows libraries that aren't getting linked...maybe I need dynamic linking?
dingenskirchen1 is now known as dingenskirchen
<Barabas> ifreund: Yeah, that's awkward imho.
betawaffle has quit [Ping timeout: 256 seconds]
betawaffle has joined #zig
Akuli has quit [Remote host closed the connection]
<ifreund> i blame windows
<fengb> There’s also argsAlloc, but that allocates all the memories
<leeward> Windows is easy to blame. Coming from a sane environment, it's pretty awful.
<Barabas> Everything is easy to blame if you're used to the other thing.
<fengb> It’d work better if we switched to UTF16
<ifreund> nooooo
<fengb> But who wants that
<Barabas> Windows guys in the 90s?
<ifreund> posix is objectively better in this case IMO
<Barabas> Anyway... it works, but it doesn't open relative files.... I think...
vroomerify has quit [Remote host closed the connection]
daex has quit [Ping timeout: 265 seconds]
<Barabas> It's like this: https://paste.rs/jp3
<leeward> ifreund: objectively and IMO, eh? Not that I disagree.
<ifreund> you're right, retract that IMO
<leeward> :)
<ifreund> Barabas: arg handling could be https://paste.rs/RkD
<fengb> IMO = in my objective
<Barabas> ifreund: Thanks! That looks better indeed.
<Barabas> Apart from relative paths not really working on windows I just have to figure out why my json that was in a static string and now in a file suddenly doesn't work anymore.
<Barabas> Oh cool, that was just me.
puzzleddev has quit [Quit: Leaving]
dermetfan has quit [Ping timeout: 272 seconds]
nikita` has quit [Quit: leaving]
xackus has quit [Ping timeout: 265 seconds]
return0e[m] has quit [*.net *.split]
hamoko[m] has quit [*.net *.split]
<Barabas> Thanks guys and good night :)
<ifreund> night!
sammich has quit [*.net *.split]
pltrz has quit [*.net *.split]
Snektron has quit [*.net *.split]
ky0ko has quit [*.net *.split]
rom1504 has quit [*.net *.split]
Barabas has quit [Ping timeout: 245 seconds]
<andrewrk> pixelherodev, hopefully today, workin on it
ky0ko has joined #zig
sammich has joined #zig
Snektron has joined #zig
rom1504 has joined #zig
pltrz has joined #zig
<ifreund> who needs @Type(.EnumLiteral) when you have @TypeOf(.foobar) :D
<andrewrk> pixelherodev, working on this test case: https://clbin.com/B1PeP
<andrewrk> then for fun going to benchmark what happens with a million print(); :-)
return0e[m] has joined #zig
hamoko[m] has joined #zig
dingenskirchen has quit [Read error: Connection reset by peer]
dingenskirchen has joined #zig
return0e[m] has quit [*.net *.split]
hamoko[m] has quit [*.net *.split]
<pixelherodev> Oh neat :)
<pixelherodev> andrewrk: I'll try to get ZIR function arguments submitted tomorrow :)
<pixelherodev> That should allow for more AST -> ZIR testing :)
sammich has quit [*.net *.split]
pltrz has quit [*.net *.split]
ky0ko has quit [*.net *.split]
Snektron has quit [*.net *.split]
rom1504 has quit [*.net *.split]
nephele has quit [*.net *.split]
bgiannan has quit [*.net *.split]
bsrd has quit [*.net *.split]
watzon has quit [*.net *.split]
afontain_ has quit [*.net *.split]
ifreund[m] has quit [*.net *.split]
BitPuffin has quit [*.net *.split]
danyspin97 has quit [*.net *.split]
scientes has quit [*.net *.split]
shodan45 has quit [*.net *.split]
nickster has quit [*.net *.split]
crimson_penguin has quit [*.net *.split]
zannzen[m] has quit [*.net *.split]
BaroqueLarouche has quit [*.net *.split]
fengb has quit [*.net *.split]
pmwhite has quit [*.net *.split]
dch has quit [*.net *.split]
mgxm has quit [*.net *.split]
dottedmag has quit [*.net *.split]
torque has quit [*.net *.split]
casaca has quit [*.net *.split]
tyler569 has quit [*.net *.split]
Cadey has quit [*.net *.split]
hspak has quit [*.net *.split]
shinzo has quit [*.net *.split]
terinjokes has quit [*.net *.split]
blueberrypie has quit [*.net *.split]
Bastian[m] has quit [*.net *.split]
procnto has quit [*.net *.split]
utzig has quit [*.net *.split]
cole-h has quit [*.net *.split]
slowtype1 has quit [*.net *.split]
Tharro has quit [*.net *.split]
cbarrett has quit [*.net *.split]
Cynthia has quit [*.net *.split]
l1x has quit [*.net *.split]
tributarian has quit [*.net *.split]
lukeholder has quit [*.net *.split]
lohengrin has quit [*.net *.split]
commander has quit [*.net *.split]
cow-orker has quit [*.net *.split]
Nilium has quit [*.net *.split]
gpanders_ has quit [*.net *.split]
tines9 has quit [*.net *.split]
jzelinskie has quit [*.net *.split]
euantor has quit [*.net *.split]
nikki93 has quit [*.net *.split]
eddyb[legacy] has quit [*.net *.split]
lunamn has quit [*.net *.split]
linuxgemini has quit [*.net *.split]
johnLate has quit [*.net *.split]
andrewrk has quit [*.net *.split]
rooke has quit [*.net *.split]
Flaminator has quit [*.net *.split]
cota has quit [*.net *.split]
Techcable has quit [*.net *.split]
dongcarl has quit [*.net *.split]
marijnfs has quit [*.net *.split]
marler8997_ has quit [*.net *.split]
skrzyp has quit [*.net *.split]
jwmerrill has quit [*.net *.split]
so has quit [*.net *.split]
factormystic has quit [*.net *.split]
redj has quit [*.net *.split]
squeek502 has quit [*.net *.split]
gazler__ has quit [*.net *.split]
mmx870 has quit [*.net *.split]
WilhelmVonWeiner has quit [*.net *.split]
leeward has quit [*.net *.split]
nerthus has quit [*.net *.split]
drp has quit [*.net *.split]
swills has quit [*.net *.split]
edr has quit [*.net *.split]
mikdusan has quit [*.net *.split]
niftynei has quit [*.net *.split]
Amun_Ra has quit [*.net *.split]
alva has quit [*.net *.split]
Sphax has quit [*.net *.split]
haliucinas has quit [*.net *.split]
ifreund has quit [*.net *.split]
greenfork has quit [*.net *.split]
tgschultz has quit [*.net *.split]
iwq has quit [*.net *.split]
Prf_Jakob has quit [*.net *.split]
GreaseMonkey has quit [*.net *.split]
doublej472 has quit [*.net *.split]
via has quit [*.net *.split]
doublex has quit [*.net *.split]
frett27_ has quit [*.net *.split]
wootehfoot has quit [*.net *.split]
Stephie has quit [*.net *.split]
shachaf has quit [*.net *.split]
dputtick has quit [*.net *.split]
oats has quit [*.net *.split]
tralamazza has quit [*.net *.split]
Ekho has quit [*.net *.split]
ttmrichter has quit [*.net *.split]
s-ol has quit [*.net *.split]
neptunepink has quit [*.net *.split]
letoram has quit [*.net *.split]
diginet has quit [*.net *.split]
nycex has quit [*.net *.split]
rzezeski has quit [*.net *.split]
AlexMax has quit [*.net *.split]
yawniek has quit [*.net *.split]
drvirgilio has quit [*.net *.split]
flokli has quit [*.net *.split]
SimonN has quit [*.net *.split]
][_R_][ has quit [*.net *.split]
wilsonk has quit [*.net *.split]
wjlroe has quit [*.net *.split]
mq32 has quit [*.net *.split]
chivay has quit [*.net *.split]
dom96 has quit [*.net *.split]
pixelherodev has quit [*.net *.split]
betawaffle has quit [*.net *.split]
kushalp has quit [*.net *.split]
alexnask has quit [*.net *.split]
pangey has quit [*.net *.split]
guan has quit [*.net *.split]
Biolunar has quit [*.net *.split]
rappet has quit [*.net *.split]
tracernz has quit [*.net *.split]
tdeo has quit [*.net *.split]
mixi has quit [*.net *.split]
mattmurr has quit [*.net *.split]
Yardanico has quit [*.net *.split]
urluck has quit [*.net *.split]
JX7P has quit [*.net *.split]
gchristensen has quit [*.net *.split]
m6w6 has quit [*.net *.split]
mht has quit [*.net *.split]
M-ou-se has quit [*.net *.split]
st4ll1 has quit [*.net *.split]
knebulae has quit [*.net *.split]
jicksaw has quit [*.net *.split]
idxu has quit [*.net *.split]
lqd has quit [*.net *.split]
companion_cube has quit [*.net *.split]
nore has quit [*.net *.split]
ovf has quit [*.net *.split]
dddddd has quit [*.net *.split]
Snetry has quit [*.net *.split]
bbrittain has quit [*.net *.split]
ave_ has quit [*.net *.split]
benaiah has quit [*.net *.split]
meowray has quit [*.net *.split]
Ziemas has quit [*.net *.split]
bens has quit [*.net *.split]
Thalheim has quit [*.net *.split]
losinggeneration has quit [*.net *.split]
JoshAshby has quit [*.net *.split]
metheflea has quit [Ping timeout: 260 seconds]
so has joined #zig
ifreund[m] has joined #zig
dom96 has joined #zig
pixelherodev has joined #zig
chivay has joined #zig
mq32 has joined #zig
wjlroe has joined #zig
wilsonk has joined #zig
][_R_][ has joined #zig
bsrd has joined #zig
SimonN has joined #zig
bgiannan has joined #zig
nephele has joined #zig
cota has joined #zig
Flaminator has joined #zig
andrewrk has joined #zig
linuxgemini has joined #zig
johnLate has joined #zig
lunamn has joined #zig
euantor has joined #zig
jzelinskie has joined #zig
rooke has joined #zig
tines9 has joined #zig
gpanders_ has joined #zig
Cadey has joined #zig
tyler569 has joined #zig
torque has joined #zig
mgxm has joined #zig
dottedmag has joined #zig
casaca has joined #zig
dch has joined #zig
fengb has joined #zig
BaroqueLarouche has joined #zig
niftynei has joined #zig
Amun_Ra has joined #zig
edr has joined #zig
mikdusan has joined #zig
swills has joined #zig
drp has joined #zig
leeward has joined #zig
WilhelmVonWeiner has joined #zig
nerthus has joined #zig
mmx870 has joined #zig
gazler__ has joined #zig
squeek502 has joined #zig
redj has joined #zig
factormystic has joined #zig
utzig has joined #zig
procnto has joined #zig
m6w6 has joined #zig
M-ou-se has joined #zig
mht has joined #zig
gchristensen has joined #zig
JX7P has joined #zig
Yardanico has joined #zig
mixi has joined #zig
urluck has joined #zig
tdeo has joined #zig
tracernz has joined #zig
Biolunar has joined #zig
rappet has joined #zig
guan has joined #zig
pangey has joined #zig
alexnask has joined #zig
kushalp has joined #zig
via has joined #zig
doublej472 has joined #zig
Prf_Jakob has joined #zig
iwq has joined #zig
tgschultz has joined #zig
greenfork has joined #zig
ifreund has joined #zig
haliucinas has joined #zig
Sphax has joined #zig
Nilium has joined #zig
commander has joined #zig
cow-orker has joined #zig
lohengrin has joined #zig
lukeholder has joined #zig
Cynthia has joined #zig
l1x has joined #zig
cbarrett has joined #zig
Tharro has joined #zig
slowtype1 has joined #zig
cole-h has joined #zig
JoshAshby has joined #zig
Thalheim has joined #zig
meowray has joined #zig
Ziemas has joined #zig
losinggeneration has joined #zig
bens has joined #zig
benaiah has joined #zig
ave_ has joined #zig
bbrittain has joined #zig
Snetry has joined #zig
dddddd has joined #zig
blueberrypie has joined #zig
terinjokes has joined #zig
shinzo has joined #zig
hspak has joined #zig
danyspin97 has joined #zig
scientes has joined #zig
shodan45 has joined #zig
nickster has joined #zig
crimson_penguin has joined #zig
BitPuffin has joined #zig
Techcable has joined #zig
marijnfs has joined #zig
marler8997_ has joined #zig
dongcarl has joined #zig
skrzyp has joined #zig
jwmerrill has joined #zig
nikki93 has joined #zig
GreaseMonkey has joined #zig
mattmurr has joined #zig
oats has joined #zig
tralamazza has joined #zig
_whitelogger has joined #zig
pmwhite has joined #zig
pmwhite has joined #zig
cbarrett has joined #zig
alva has joined #zig
CommunistWolf has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
metheflea has joined #zig
metheflea has joined #zig
metheflea has quit [Changing host]
CommunistWolf has joined #zig
afontain_ has joined #zig
doublex has joined #zig
Bastian[m] has joined #zig
watzon has joined #zig
sammich has joined #zig
ovf has joined #zig
Snektron has joined #zig
pltrz has joined #zig
<blueberrypie> epic netsplit
_Vi has quit [Ping timeout: 260 seconds]
return0e[m] has joined #zig
hamoko[m] has joined #zig
AlexMax has joined #zig
zenxhd has joined #zig
BitPuffin has joined #zig
BaroqueLarouche has joined #zig
fengb has joined #zig
ifreund has quit [Quit: WeeChat 2.8]
ifreund has joined #zig
xackus has joined #zig