<< 09-10-2018 >>

00:03:04FromGitter<timotheecour> @zetashift ⏎ ⏎ > @timotheecour how are you liking karax? Pros/cons considering you also use react? ⏎ ⏎ I need to use it more to get a better answer but haven’t hit a brick wall yet; one minor con is lack of JSX (maybe would be worth supporting via a DSL stored as a string?); another con is I now have 2 react logic interacting (nim’s and react’s builtin one), and the “main” one needs to refresh
00:03:04FromGitter... the “slave” one manually; it’s doable; maybe this approach could be improved. Obvious pro is it allows pushing more logic into Nim [https://gitter.im/nim-lang/Nim?at=5bbbf0386e5a401c2d3ab46c]
00:05:00*abm quit (Read error: Connection reset by peer)
00:09:54*NimBot joined #nim
00:14:57FromGitter<timotheecour> @exelotl indeed, I think we need “one true regex library” that covers all the feature set currently available to avoid duplicating effort; having it in a separate repo makes improvements easier than if it were in stdlib though (breaking changes are less damaging) ; eg of feature in nim-regex that’s not in re/nre: it allows defining a regex pattern at CT
00:16:00FromGitter<kayabaNerve> @timotheecour Can we get a one true game engine while we're at?
00:16:21FromGitter<kayabaNerve> https://imgs.xkcd.com/comics/standards.png
00:26:49flaviuI'd like to say that nre is fairly well decoupled from PCRE, and comes with an extensive test suite :)
00:27:02*ftsf joined #nim
00:28:03flaviuand that find/replace are surprisingly hard to get right
00:32:02FromGitter<timotheecour> @kayabaNerve a regex engine is not comparable to a game engine ; having 2 standard library modules re, nre is definitely not a common thing amongst other languages; btw I didn’t mean let’s create a 3rd regex stdlib module; instead I recommend merging whatever features from re that are missing from nre into nre (rather than other way around as I’ve argued in https://githu
00:32:02FromGitter... b.com/nim-lang/Nim/issues/7278#issuecomment-427689302 )
00:33:33FromGitter<timotheecour> @flaviu I think we should write somewhere (in https://github.com/nim-lang/Nim/issues/7278 or https://github.com/nim-lang/Nim/issues/8150) the features from re that aren’t in nre; do you have a list?
00:34:01*opi_ quit (Quit: ZNC - http://znc.in)
00:34:41*opi_ joined #nim
00:39:07flaviu@timotheecour I do not, but the main one would be multiReplace.
00:40:40flaviunre has no need for `=~` because of how it works; startsWith and endsWith are not needed since this can be done with '^' and '$'. cstrings are not supported by pcre because they are easy to turn into strings and I didn't want to bother
00:40:43FromGitter<kayabaNerve> @timotheecour 1) I know. 2) I agree. 3) Sounds like a good plan. 4) You can't meet everyone's needs.
00:41:45flaviu@kayabaNerve when it comes to regex matching, I believe you can. it's a contained problem
00:42:33flaviuif you have some need that isn't being met, let me know and I'll see what I can figure out.
00:46:01FromGitter<zetashift> Any macro-gods here? I got an error saying: ```..\..\..\..\..\.nimble\pkgs\godot-0.7.17\nim\godotmacros.nim(514, 23) Error: type mismatch: got <int literal(0)> but expected 'bool' ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbbfa49e65a634336a5b277]
00:46:10FromGitter<zetashift> trying my hand at getting it to work with 0.19
00:54:48FromGitter<kayabaNerve> #L 493: `for meth in obj.methods:` I told them they HAD to stay clean after rehab. They're no longer welcome in my house!
00:55:01FromGitter<kayabaNerve> @zetashift ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbbfc65e65a634336a5c105]
00:55:31FromGitter<kayabaNerve> I'm pretty sure the `else` is the issue. I'm looking into what they were trying to do.
00:56:00*vlad1777d quit (Remote host closed the connection)
00:56:42FromGitter<kayabaNerve> `for string in refClasses` when refClasses is only used there on that one line and has no declaration. 0_o
00:56:50*vlad1777d joined #nim
00:59:19*arecaceae quit (Ping timeout: 246 seconds)
01:01:24*arecaceae joined #nim
01:04:11FromGitter<zetashift> it's declared in godotnim no?
01:05:28FromGitter<zetashift> I changed the isNil to `== ""`
01:13:10*vivus quit (Remote host closed the connection)
01:14:36*darithorn joined #nim
01:24:04FromGitter<kayabaNerve> I only looked over the one file
01:26:39*endragor joined #nim
01:27:56FromGitter<kayabaNerve> It's a seq[string]. The code is trying to use this: https://nim-lang.org/docs/system.html#in.t%2Cuntyped%2Cuntyped
01:27:58FromGitter<kayabaNerve> So never mind.
01:28:51FromGitter<kayabaNerve> Eh. The docs may not be updated. The else is the line of the error.
01:31:17*endragor quit (Ping timeout: 252 seconds)
01:53:08*vlad1777d quit (Ping timeout: 268 seconds)
02:04:22*banc quit (Quit: ZNC - http://znc.in)
02:09:38*Elronnd is now known as math
02:09:47*math is now known as Elronnd
02:16:56*endragor joined #nim
02:21:05*banc joined #nim
02:47:25FromGitter<gogolxdong> What's the difference between libagar and nuklear?
03:09:46bozaloshtshgogolxdong: they're different GUI libraries?
03:10:23enthus1astlibagar has more build in widgets and also some other stuff like socket handling etc
03:13:26FromGitter<gogolxdong> does this mean libagar is better?
03:15:33FromGitter<gogolxdong> It could handle event loop like keyboard as nuklear doesn't right?
03:16:24*darithorn quit ()
03:18:27*darithorn joined #nim
03:22:24*chemist69 quit (Ping timeout: 252 seconds)
03:24:00enthus1astafaik libagar was made for a game
03:24:12*chemist69 joined #nim
03:24:15enthus1astsorry must sleep 5 am here
03:24:46enthus1astn8
03:24:59*enthus1ast quit (Remote host closed the connection)
03:27:22*rockcavera quit (Remote host closed the connection)
03:32:27FromGitter<gogolxdong> good night!
03:45:16*alexnask joined #nim
03:48:32FromGitter<zacharycarter> Agar looks like a retained GUI mode solution
03:48:43FromGitter<zacharycarter> where as nuklear / imgui are immediate mode GUI solutions
03:49:17FromGitter<zacharycarter> @gogolxdong - I'm a bit surprised you're having this much difficulty getting nuklear's input capabilities to work - I know they're not ideal and they rely on C buffers if I recall, but they do work and i have gotten input to work in nuklear before
03:49:34FromGitter<zacharycarter> unfortunately GUI is like the last thing on my plate atm in regards to game dev stuff I need to figure out
03:50:07FromGitter<zacharycarter> but once I get to the point where I need nuklear - which shouldn't be TOO to far off - i'll need to start working on an editor before too long here - I can share whatever I learn / remember
03:53:38FromGitter<gogolxdong> https://github.com/gogolxdong/guardian
03:54:17FromGitter<zacharycarter> let me take a quick look - maybe I'll spot something I can recognize as being an issue
03:55:10AlexMax@zacharycarter I know somebody who used agar in production and ended up regretting it
03:55:28FromGitter<zacharycarter> well - they're just totally different modes of GUI
03:55:30AlexMaxI'm not sure why or how exactly, but agar doesn't seem like an especially active project
03:55:43FromGitter<zacharycarter> retained mode GUI solutions retain their state from frame to frame
03:55:53FromGitter<zacharycarter> and only re-draw what changes
03:56:14FromGitter<zacharycarter> immediate mode GUIs aren't concerned with that - they just re-draw everything every frame
03:56:28FromGitter<zacharycarter> at a basic level anyway - there are a lot of nuances there between implementations
03:56:38AlexMaxI don't think it was a matter of immediate vs retained, I think it was just a buggy project and didn't give the kind of customization necessary
03:56:47FromGitter<zacharycarter> gotcha - I can buy that
03:56:58AlexMaxlast i checked it still used subversion
03:57:08FromGitter<zacharycarter> I mean - tbh - I may not even end up using nuklear
03:57:19FromGitter<zacharycarter> I might end using imgui - because bgfx seems to prefer it
03:57:28FromGitter<zacharycarter> but I'll cross that road when I come to it
03:58:13AlexMaxI've been lazy and putting off continuing work on nuklear
03:58:17AlexMaxand my own project :P
03:58:37FromGitter<zacharycarter> it's tough to stay motivated
04:03:46FromGitter<zacharycarter> @gogolxdong - working on getting guardian compiling - almost there
04:09:52FromGitter<zacharycarter> welp - I got it to CTD :) - I'm just missing a font-related file I think
04:10:05FromGitter<zacharycarter> unfortunately - I forgot my power cord at my parents house, so I won't be of much more help for a few hours
04:10:20FromGitter<zacharycarter> I'm going to drive over there and get it - I need it for the morning anyway. guess I'm sleeping over there tonight
04:10:23FromGitter<zacharycarter> be back on in a bit
04:10:31FromGitter<gogolxdong> imgui is a bit higher stared than nuklear.
04:14:23*ftsf_ joined #nim
04:14:23*ftsf quit (Read error: Connection reset by peer)
04:16:13FromGitter<gogolxdong> What's CTD? I used Deng.ttf file of Windows .What's it like for you?
04:17:38FromGitter<gogolxdong> learned a lot of GUI library recently so far, sdl, wxWidgets, nuklear, agar, imgui, endless...
04:30:30FromGitter<gogolxdong> Is that Crash To Desktop (CTD)?
04:32:07*alexnask quit (Ping timeout: 246 seconds)
04:36:29*ftsf__ joined #nim
04:40:15*ftsf_ quit (Ping timeout: 268 seconds)
05:41:14*nsf joined #nim
05:45:22*darithorn quit ()
05:56:00*MyMind joined #nim
05:56:43*Sembei quit (Ping timeout: 245 seconds)
06:05:24*krux02 joined #nim
06:08:47FromGitter<zacharycarter> @gogolxdong - I'm pretty sure I know what your problem is without having run the code
06:08:55FromGitter<zacharycarter> @gogolxdong - well it's been around quite a bit longer
06:09:30FromGitter<zacharycarter> and yeah- CTD = crash to desktop
06:09:52FromGitter<zacharycarter> I'm not on windows - so I probably don't have Deng.ttf available
06:10:04FromGitter<zacharycarter> although I see it's included in the repo
06:10:08FromGitter<zacharycarter> so I'm not sure what the CTD is all about
06:11:01FromGitter<zacharycarter> Assertion failed: (atlas->temporary.alloc), function nk_font_atlas_clear, file nimnuklear/src/nuklear_font.c, line 3344.
06:11:37FromGitter<zacharycarter> `NK_ASSERT(atlas->temporary.alloc);`
06:14:46FromGitter<gogolxdong> I tried Windows and Linux .
06:14:51FromGitter<zacharycarter> ah
06:14:56FromGitter<zacharycarter> I see you're targeting cpp
06:14:58FromGitter<zacharycarter> that might be the problem
06:15:27FromGitter<zacharycarter> but I get different errors with cpp
06:15:44FromGitter<zacharycarter> hrm
06:16:12FromGitter<zacharycarter> yeah I'm on osx so that could also be an issue
06:18:16FromGitter<zacharycarter> I wonder if the bindings are working
06:18:33FromGitter<zacharycarter> this define - `NK_INCLUDE_DEFAULT_ALLOCATOR`- is supposed to set whether or not the default allocator is included
06:19:32FromGitter<zacharycarter> there definitely appear to be some issues with these bindings
06:20:10FromGitter<zacharycarter> for instance - https://github.com/gogolxdong/guardian/blob/master/nimnuklear/nuklear.nim#L239 - is going to be an issue
06:20:29FromGitter<gogolxdong> where invokes this def?
06:20:48FromGitter<zacharycarter> just search for - NK_INCLUDE_DEFAULT_ALLOCATOR - in your project
06:20:55FromGitter<zacharycarter> you'll see it's in the nuklear source
06:20:57FromGitter<zacharycarter> and in the bindings
06:21:57FromGitter<zacharycarter> also
06:22:15FromGitter<zacharycarter> make sure you're paying credence to this warning - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbc4917271506518ddd62ec]
06:25:03FromGitter<gogolxdong> yes, I see them , it's all #ifdef NK_INCLUDE_DEFAULT_ALLOCATOR but where `defines` NK_INCLUDE_DEFAULT_ALLOCATOR?
06:25:26FromGitter<zacharycarter> it looks like it's defined as an include flag here
06:25:44FromGitter<zacharycarter> https://github.com/gogolxdong/guardian/blob/master/nimnuklear/nuklear.nim#L10-L13
06:25:48FromGitter<zacharycarter> which I'm not sure is sufficient
06:27:37FromGitter<gogolxdong> you can try to remove the flag and run.
06:27:50FromGitter<tim-st> @Araq I saw string matches openArray[char], so it would be easy to change strutils to work on openArray[char] where resizing to bigger size is not possible and otherwise stay with string only match. That would allow zero copying buffers with toOpenArray and use them as strings. Would you allow this change?
06:27:55FromGitter<zacharycarter> well - it's this whole bit here
06:28:03FromGitter<zacharycarter> The following flags if defined need to be defined for both header and implementation:
06:28:11FromGitter<zacharycarter> this is why if you look at my old bindings
06:28:14FromGitter<zacharycarter> I did things this way
06:28:49FromGitter<zacharycarter> https://github.com/zacharycarter/nuklear-nim/blob/master/src/bind.c
06:29:32FromGitter<zacharycarter> because like it says - it needs to be defined for the header AND implementation
06:29:43FromGitter<zacharycarter> well - it's not that it's defined / needing to remove the define
06:29:52FromGitter<zacharycarter> it's that the define needs to be at the implementation level - not the include level
06:30:57FromGitter<gogolxdong> means need an implementation of NK_INCLUDE_DEFAULT_ALLOCATOR?
06:31:12FromGitter<zacharycarter> no
06:31:25FromGitter<zacharycarter> it just means that it needs to defined both in a header file and in whatever file includes that header file
06:31:29FromGitter<zacharycarter> if you want to use that feature
06:31:41FromGitter<zacharycarter> in other words - if you somehow defined that flag in the C code that gets generated by nim
06:31:45FromGitter<zacharycarter> everything would probably be fine
06:32:04FromGitter<zacharycarter> I don't think including it as a compiler / linker flag though - is going to be sufficient
06:32:06FromGitter<zacharycarter> is what I'm trying to say
06:32:15FromGitter<gogolxdong> ok
06:32:25*alexnask joined #nim
06:33:06krux02good morning
06:33:16FromGitter<zacharycarter> hi!
06:33:35FromGitter<gogolxdong> Is #define NK_INCLUDE_DEFAULT_ALLOCATOR in nuklear.h sufficient?
06:33:35krux02I guess it is late your you now
06:34:02FromGitter<gogolxdong> and all c source code?
06:34:29FromGitter<zacharycarter> well - I'm not sleeping tonight anyway so it's all the same :P
06:34:38FromGitter<zacharycarter> @gogolxdong - you shouldn't need to touch nuklear.h
06:34:46FromGitter<zacharycarter> you just need some source file that includes nuklear.h
06:34:50FromGitter<zacharycarter> that also has a #define NK_INCLUDE_DEFAULT_ALLOCATOR
06:34:52FromGitter<zacharycarter> inside of it
06:34:54FromGitter<zacharycarter> like a .c file
06:35:03FromGitter<zacharycarter> that's why I linked to that bind.c file I did
06:35:22FromGitter<zacharycarter> because it shows how I worked through this - thanks to krux02's help - way back in the day
06:35:26FromGitter<zacharycarter> like 2 years ago :P
06:35:59FromGitter<zacharycarter> brb - I need to run to the store and get some heartburn meds, indigestion is killing me
06:36:29krux02zacharycarter:, you are welcome
06:38:27*Vladar joined #nim
06:41:19FromGitter<tim-st> is there a proc that copies array[char] to string?
06:55:38FromGitter<gogolxdong> added #define NK_INCLUDE_DEFAULT_ALLOCATOR where includes "nuklear.h" , sufficent?
07:01:37FromGitter<gogolxdong> heartburn ? need sleep at night, don't stay up too late.
07:01:58krux02tim-st: yes
07:02:25krux02tim-st: $cast[cstring](arr[0].addr)
07:06:51FromGitter<zacharycarter> @gogolxdong meh - I slept after work today, that was undoing - and I slept too much this past eekend
07:07:10FromGitter<zacharycarter> @gogolxdong - heartburn = common word in the US for indigestion
07:07:44FromGitter<zacharycarter> @gogolxdong should be - if you want to put up a PR or something I can reproduce manually on my end and test - or just let me know what file you changed and what you added
07:07:59FromGitter<zacharycarter> I don't know why I just pinged you three times in a row lol - sorry
07:08:50FromGitter<technicallyagd> Hi guys, nice to meet you all.
07:09:00FromGitter<zacharycarter> howdy
07:09:14FromGitter<gogolxdong> no problem.
07:10:15FromGitter<technicallyagd> I just discovered Nim about a week ago while searching for a language to build games from scratch
07:10:39FromGitter<zacharycarter> ah cool
07:11:03FromGitter<timotheecour> welcome @technicallyagd :)
07:11:10FromGitter<zacharycarter> not sure what you mean by - from scratch - I think that's probably somewhat of a subjective term - but I assume you mean without the aid of a game engine like unity / UE4 / godot etc
07:11:23FromGitter<zacharycarter> either way - glad to have you aboard :)
07:11:25FromGitter<technicallyagd> @timotheecour thanks :D
07:11:47FromGitter<technicallyagd> Yep I have tried all three of them already
07:12:24*ftsf__ quit (Quit: Leaving)
07:12:35FromGitter<gogolxdong> pushed, so that you can try and see whether works on MacOS.
07:13:12FromGitter<zacharycarter> well - depending on the complexity of the game / whatever you're trying to build - it can be an easier or more difficult road to plow - sometimes both
07:13:23FromGitter<zacharycarter> row to plow
07:13:25FromGitter<zacharycarter> whatever the term is
07:13:45FromGitter<zacharycarter> I think I had it right the first time :p
07:13:51FromGitter<technicallyagd> lol
07:14:05FromGitter<zacharycarter> @gogolxdong - pulling
07:15:57FromGitter<zacharycarter> hrm - @gogolxdong - no I don't think what you did is going to help - let me try to fix this and push up a PR
07:16:35FromGitter<gogolxdong> ok, thanks, seems I didn't understand well.
07:17:07FromGitter<zacharycarter> np - if you don't do a lot of C programming / work with single header libs a lot, it 's not the most straightforward thing in the world
07:17:56*stefanos82 quit (Quit: Quitting for now...)
07:21:58FromGitter<technicallyagd> Does anyone have experience working with Vulkan API with Nim?
07:22:16FromGitter<zacharycarter> nope :/ I don't target specific graphics APIs anymore
07:22:27FromGitter<technicallyagd> bgfx?
07:22:33FromGitter<zacharycarter> yup
07:23:28FromGitter<technicallyagd> I was going to use it as well, but it doesn't seem to have very robust testing, so it feels a bit icky
07:23:53FromGitter<zacharycarter> most graphics libraries like that won't have traditional unit tests
07:24:14FromGitter<zacharycarter> and if they do - it's was probably a waste of time to autho rthem
07:24:17FromGitter<zacharycarter> author*
07:24:23FromGitter<technicallyagd> really? how so?
07:24:55FromGitter<zacharycarter> well - because you're writing against a standardized API - and you're very close to the hardware / software interface
07:25:07FromGitter<zacharycarter> assuming you're using the specification correctly - you should be able to rely on the specification
07:25:16FromGitter<zacharycarter> you could spend time writing tests to ensure your code is correct
07:25:19FromGitter<zacharycarter> or you could just write correct code
07:25:26FromGitter<zacharycarter> there's not a lot of business logic per se - to test
07:26:01FromGitter<zacharycarter> also - the author of BGFX is a very good developer, and IMO writes some of the best C++ code I've read in a while
07:26:14FromGitter<zacharycarter> his project is constantly updated and improved upon and has stayed that way since its inception
07:26:26FromGitter<zacharycarter> so I have mucho faith when it comes to BGFX
07:26:48FromGitter<gogolxdong> sounds good.
07:26:54FromGitter<technicallyagd> Hmm I think I am convinces lol
07:27:18FromGitter<zacharycarter> I'm not saying use bgfx - it adds complexity in certain aspects
07:27:39FromGitter<zacharycarter> but I'd much rather not be caught in the situation where some major OS vendor decides to start supporting a graphics API all of a sudden
07:27:50FromGitter<zacharycarter> or decides that in order to work with one you need some type of bridge to their proprietary API
07:27:51FromGitter<technicallyagd> lol
07:28:00FromGitter<zacharycarter> done with that sort of nonsense
07:28:00FromGitter<technicallyagd> OpenGL and Apple
07:28:32FromGitter<zacharycarter> I feel like my mac book pro might blow up if I actually type in the name after writing all of that
07:28:47FromGitter<technicallyagd> LOL
07:29:53FromGitter<technicallyagd> Did you read your EULA fully? It might be legal for them to do that
07:30:03FromGitter<zacharycarter> probably
07:30:28FromGitter<zacharycarter> if south park taught us anything - it's that we could all one day become part of a humancentipad
07:31:58krux02fish or ice cream?
07:32:03FromGitter<zacharycarter> haha
07:32:42krux02I had to see the movie that episode was based on.
07:33:07FromGitter<technicallyagd> God, no.
07:33:07FromGitter<zacharycarter> @gogolxdong - ooph this is not going so great - I eliminated the CTD but introduced a host of other errors - but I think I know how to fix maybe - we'll see :P
07:33:18FromGitter<zacharycarter> haha - yeah that was one I tried to duck seeing krux02
07:33:20krux02that is a movie, where you can just watch the trailer, and you know everything. THe movie is just a longer version of that.
07:33:29FromGitter<zacharycarter> lol exactly
07:33:37krux02"duck seeing" ?
07:33:46FromGitter<zacharycarter> or like dodge
07:33:46FromGitter<zacharycarter> avoid
07:33:51FromGitter<technicallyagd> I think knowing the movie title gives you 90% of the plot already
07:33:54krux02ok
07:33:55FromGitter<zacharycarter> I need to stop using US slang
07:35:23krux02the evil doctor in human centipede is an actor that is sometimes here and there on public television doing boring movies.
07:35:36FromGitter<technicallyagd> Anyways, another tiny problem I had with bgfx was its own shader language, which I couldn't find good extension on vscode to support it
07:36:01FromGitter<zacharycarter> it's very close to GLSL
07:36:08krux02I don't know if you have the same kind of boring movies in the us as we have here in Germany
07:36:18FromGitter<zacharycarter> but yeah - I wouldn't expect to find a VS code extension for it
07:36:21FromGitter<technicallyagd> Sharknado?
07:36:46krux02but knows human centipede changed the way I see him in other movies now.
07:38:11*platoff joined #nim
07:38:20krux02well not really that important. but no not sharknado.
07:38:58FromGitter<technicallyagd> I meant boring movies like sharknado? or the slow-paced academic kind of movie?
07:40:21krux02I mean Rosamunde Pilcher kind of movies
07:41:19FromGitter<technicallyagd> @zacharycarter I could only get basic syntax high lighting by using GLSL syntax. Do you have suggestion on authoring bgfx's shader code?
07:45:24FromGitter<technicallyagd> I don't think I have watched any movie based on her work, but I think I get what you mean now
07:56:12FromGitter<zacharycarter> ooph - it seems like there is a LOT of confusion around nuklear in our community and it's implementation
07:56:45FromGitter<zacharycarter> I would urge folks to read the docs - because I think there's a misconception about how the library works - but I'm just basing things off what I've read and heard recently about the lib
07:56:51FromGitter<zacharycarter> it doesn't work in a single header / split up format
07:57:03FromGitter<zacharycarter> the author has simply moved the implementation into separate source files
07:57:22FromGitter<zacharycarter> you still include the library - as a single header - in fact @gogolxdong - it appears you're missing an entire.h file :P
07:57:30FromGitter<zacharycarter> the one at the root of the nuklear repo
07:57:32FromGitter<zacharycarter> which pulls in everything else
07:57:52FromGitter<zacharycarter> @technicallyagd - I would look at other projects using BGFX / the examples and start there
07:58:10FromGitter<zacharycarter> it really is extremely similar to GLSL - there is helper stuff built in to make your life easier
07:58:25FromGitter<zacharycarter> but I don't think it's so far off / different that you'll need any sort of special tool to bridge the gap
07:58:50FromGitter<zacharycarter> and tbh - I don't know what the ideal way to author shaders is - I generally have just kind of worked with them / recompiled until i've gotten the correct result - which isn't ideal
07:58:59FromGitter<gogolxdong> which file, it's the repository of submodule updated.
07:59:06FromGitter<technicallyagd> @zacharycarter Oh sorry, I meant to ask what editor has the best support for it?
07:59:08FromGitter<zacharycarter> probably the best info you can get in this area - is to hop into bgfx's gitter channel and ask there - I'm sure branimir has some insight
07:59:32FromGitter<zacharycarter> ah - not sure there either - I usually use an online interactive shader editor and just use GLSL till I get the shader I want - and then adapt to bgfx
07:59:49FromGitter<zacharycarter> http://www.kickjs.org/example/shader_editor/shader_editor.html - is one I've used before
08:00:04FromGitter<zacharycarter> @gogolxdong this one - https://github.com/vurtun/nuklear/blob/master/nuklear.h
08:00:09FromGitter<technicallyagd> Cool! thank you
08:00:32FromGitter<zacharycarter> it seems the confusion - is that folks saw - https://github.com/vurtun/nuklear/tree/master/src - which contains a nuklear.h file
08:00:40FromGitter<zacharycarter> along with all the other .c files
08:00:45FromGitter<zacharycarter> and thought that suddenly the library had been modularlized
08:00:55FromGitter<zacharycarter> it's still a single header file - just the source has been broken out into multiple source files is all
08:01:17FromGitter<zacharycarter> you still interact with the library in the same way - as when I originally authored the bindings
08:01:26FromGitter<zacharycarter> so like - all those compile pragmas at the top of your nuklear nim file are wrong
08:01:36FromGitter<zacharycarter> basically the library should be included - exactly as I had done it - in my repo
08:01:40FromGitter<zacharycarter> otherwise things aren't going to work
08:02:07FromGitter<zacharycarter> @technicallyagd np! I have quite a bit of experience in BGFX - and hope to be gaining a lot more in the next few weeks, so please poke at me if you have questions or need help
08:02:56FromGitter<zacharycarter> @gogolxdong - regarding your text editor thing - I want to guess at what was going on - my guess is that every frame the buffer was getting overridden and what had been typed into the text box previously was lost?
08:03:05FromGitter<zacharycarter> is that assumption correct at all?
08:03:06*gmpreussner_ quit (Ping timeout: 252 seconds)
08:03:38FromGitter<gogolxdong> It's by design for now.
08:03:58*gmpreussner joined #nim
08:04:01FromGitter<zacharycarter> well yes - the thing is because nuklear is immediate mode - it's not going to do any state retention
08:04:17FromGitter<zacharycarter> so you're responsible for maintaining the state from one draw call to the next
08:04:35FromGitter<zacharycarter> it's very weird / not normally how you would expect a library to behave and takes getting used to
08:04:40FromGitter<gogolxdong> I'm confused by your words, what is all wrong at the top of the nim file?
08:05:02FromGitter<zacharycarter> all of the {.compile.} pragmas that are compiling the c files
08:05:09FromGitter<zacharycarter> all you need is one C source file
08:05:33FromGitter<zacharycarter> that looks like - https://github.com/zacharycarter/nuklear-nim/blob/master/src/bind.c
08:06:03FromGitter<zacharycarter> and the file it needs to include is - https://github.com/vurtun/nuklear/blob/master/nuklear.h
08:06:20FromGitter<zacharycarter> you can just git submodule nuklear wherever you create that C file
08:06:24FromGitter<zacharycarter> if you look at my repo - that's exactly what I did
08:09:21FromGitter<zacharycarter> I'll try to make a PR that fixes it
08:09:53FromGitter<gogolxdong> shashlick and Alex mentioned to generate nuklear bindings by nimgen,(didn't remember exact words), and I met issue with your bindings at editString , so I tried the new generated .
08:10:02FromGitter<zacharycarter> gotcha
08:10:15FromGitter<zacharycarter> yeah - all this is fixable - just getting it right
08:10:28FromGitter<zacharycarter> I think Alex and Shashlick may be a bit confused about how Nuklear works
08:11:40FromGitter<gogolxdong> you say you are going to work on bgfx+imgui?
08:12:01FromGitter<zacharycarter> well - potentially - I know that BGFX has built in support for imgui
08:12:08FromGitter<zacharycarter> so I'm not sure if it will end up being an easier road or not to go down
08:12:59FromGitter<gogolxdong> what kind of game are you going to develop? Have you tried any AR game?
08:13:18FromGitter<zacharycarter> nope! I don't have much interest in AR / VR - at least not in making games using those tecs
08:13:19FromGitter<zacharycarter> techs
08:13:37FromGitter<zacharycarter> I'm going to focus on RTS games primarily - but my ambitions are to build an engine, not so much a singular title
08:13:59FromGitter<zacharycarter> I want to solve problems I've had in prior iterations of my engine, add an editor, and add a PBR rendering pipeline
08:14:07FromGitter<zacharycarter> I also want the entire thing to be easier to get up and running with
08:16:24FromGitter<gogolxdong> Is there a RTS game name you want to spell?
08:18:37FromGitter<zacharycarter> sure - age of empires, warcraft2
08:18:55FromGitter<zacharycarter> hrm - I'm not quite sure about all these `importc` pragmas next to all these type definitions
08:18:59FromGitter<mratsim> Command and Conquer, Red Alert :P
08:19:03FromGitter<zacharycarter> they're causing me errors when trying to compile the bindings
08:19:23FromGitter<zacharycarter> I didn't have these in my original set of bindings - which could be an omission on my part
08:19:23FromGitter<gogolxdong> we are the same age people I think.
08:19:53FromGitter<gogolxdong> which I played.
08:20:52FromGitter<zacharycarter> unfortunately - I don't have time to fix all of these type defs - assuming they're problematic
08:21:00FromGitter<zacharycarter> I have to get ready to leave for work in a bit
08:21:32FromGitter<zacharycarter> @gogolxdong - I can't promise you that I will get the nuklear bindings working - but I can say that within the next month I plan to be starting work on the editor for the engine
08:21:45FromGitter<zacharycarter> and by then I'll need to have some sort of immediate mode GUI solution figured out
08:22:01FromGitter<zacharycarter> whether it be nuklear or imgui
08:22:19FromGitter<gogolxdong> no problem, I will manage by myself.
08:22:20FromGitter<zacharycarter> I do think you can do what you're trying to do - I'm not sure if you'd be better served or not by a retained mode solution
08:22:44FromGitter<zacharycarter> well - I can certainly try to help when I have more bandwidth - I think others can probably help too - because I know there is quite a bit of interest in nuklear
08:22:54FromGitter<zacharycarter> the best path might to just be to get the existing bindings working with the latest version of nuklear
08:22:58FromGitter<zacharycarter> which I don't imagine - would be too much work
08:23:07FromGitter<zacharycarter> and then to go from there - that way at least you have SOMETHING that works
08:23:32FromGitter<zacharycarter> and I think that would probably be a much easier task for me to take on - rather than trying to fix bindings that I didn't produce / aren't even sure that they work entirely in the first place
08:24:13FromGitter<dandevelo> What convention do you use to name private members? I used to prefix them with _ in C/C++ but I can not do this in Nim. What is your alternative?
08:24:31FromGitter<zacharycarter> don't have a convention?
08:24:34FromGitter<gogolxdong> no worry, it's generated by nimgen and better be solved automatically too.
08:25:29FromGitter<zacharycarter> I never really understood the need for such a convention in the first place
08:25:49FromGitter<zacharycarter> but I never wrote much C++ so don't listen to me either :P
08:26:02FromGitter<zacharycarter> I just haven't needed anything like that for Nim - at least to make my life easier
08:26:04FromGitter<gogolxdong> all I know is NEP-1. https://nim-lang.org/docs/nep1.html
08:26:53FromGitter<zacharycarter> @gogolxdong - I agree it would be better to auto-generate them, but if the automatic generation is borked / isn't proven to work - it's not worth automatic
08:27:08FromGitter<zacharycarter> better to get it right manually first - and then worry about automating
08:27:42FromGitter<dandevelo> @zacharycarter this might be useful when you have a method setting a private member. e.g: I have an url: string field and want to set it using object.url = "https..." and also do some validation when setting it so i declare a method url=(
08:28:17FromGitter<zacharycarter> yeah - I guess this is more of a OOP problem than anything else
08:28:20FromGitter<zacharycarter> or at least that's how it sounds
08:29:23FromGitter<narimiran> @dandevelo private members don't have `*` at the end, so they are kept private? :)
08:29:52FromGitter<narimiran> `myPublicMember*: int`; `myPrviateMember: int`
08:30:03FromGitter<zacharycarter> but that's not a convention for naming
08:30:06FromGitter<dandevelo> @narimiran please read above regarding the method for setting the private member
08:30:44FromGitter<narimiran> ok, sorry, didn't read carefully
08:31:12FromGitter<zacharycarter> https://forum.nim-lang.org/t/1092
08:31:17FromGitter<zacharycarter> is a topic on the subject
08:31:42FromGitter<dandevelo> @zacharycarter yes, read that one before asking here
08:31:55FromGitter<dandevelo> doesn't seem to have an answer
08:34:43FromGitter<zacharycarter> can't you do like - `m_` with Nim?
08:34:55FromGitter<zacharycarter> I know it's not what you want - but I think there are workarounds to your problem
08:35:14FromGitter<Bennyelg> @zacharycarter did you try this ⏎ https://elm-lang.org/ ?
08:35:17FromGitter<zacharycarter> I think this is probably some of the reasoning behind why Nim restricts its syntax like this in the first place
08:35:37*PMunch joined #nim
08:35:38FromGitter<zacharycarter> I'm not a big fan of Elm - I mean I like some of its design philosophies but the language is a mess IMO
08:35:55FromGitter<Bennyelg> looks like f# syntax
08:36:18FromGitter<zacharycarter> well they're both functional languages so they do have some similarities
08:36:27FromGitter<zacharycarter> although Elm I believe is strictly geared towards web dev - JS / NodeJS
08:36:35FromGitter<Bennyelg> yea
08:36:49FromGitter<zacharycarter> I just wouldn't use Elm - I wouldn't have used it before and I really wouldn't use it now
08:37:02FromGitter<narimiran> @zacharycarter you can't do `m_` because Nim strips all underscores from the names
08:37:07FromGitter<zacharycarter> I think there's a lot of internal upheaval in that community / issues with how the language has been progressing
08:37:15FromGitter<zacharycarter> ah - good point @narimiran
08:37:18FromGitter<Bennyelg> great
08:38:08FromGitter<technicallyagd> @narimiran so `m_url` will just become `murl`?
08:38:16FromGitter<narimiran> @technicallyagd yup
08:38:56FromGitter<narimiran> you can use `m_url` in your code, but you cannot name *another* variable `murl`, `mUrl`, `mur_l`, `murl_`, etc.
08:40:34PMunchI've only tried Elm once, but I kinda liked it
08:41:10PMunchBut as zacharycarter said, it's very geared towards webdev and that's not something I do often enough that I cared to try it again
08:41:51PMunchnarimiran, you can't name a variable murl_ at all
08:42:01PMunchTrailing underscore is not allowe
08:42:31FromGitter<narimiran> PMunch, yeah, I got a bit carried away with the examples :)
08:44:45*abm joined #nim
08:52:45*rokups joined #nim
09:22:13*SenasOzys joined #nim
09:25:41*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:34:12*dddddd joined #nim
09:40:27FromGitter<xmonader> ipaddress for nim?
09:41:17FromGitter<zetashift> The net module?
09:41:31FromGitter<zetashift> https://nim-lang.org/docs/net.html
09:47:09FromGitter<xmonader> @zetashift nah i'm thinking of someting like netaddr or ipaddress in python lib
09:48:04FromGitter<xmonader> actually it might just work thanks
10:21:15*xet7 joined #nim
10:21:53*platoff joined #nim
10:30:04*alexnask quit (Ping timeout: 240 seconds)
10:41:04*elrood joined #nim
10:47:54FromGitter<zetashift> oh man that godotnim bug I was stumbling on was something that went wrong through the gdobj macro, and reading through the code I know absolutely nothing about it ;P. I'll just 0.18 for now
11:04:10PMunchzetashift, how is the workflow with Nim and Godot?
11:04:18PMunchI've been meaning to try it out but never got around to it
11:06:41Araqzetashift, before giving up, grep for 'nnkPar'
11:06:57Araqthat might be changed to 'nnkTupleConstr', new in 0.19
11:07:19Araqand speaking from experience, you can try this code change without thinking about it :-)
11:13:40FromGitter<zetashift> @PMunch it's great, I use Godot 3.0 with VSCode for the nim editing, basically everything translates from gdscript to nim really well. So you can follow the godot docs really well. Only thing different is signals emitting/receiving but that was a one time learn and endragor was really helpful with it
11:14:15PMunchHmm, interesting
11:14:28PMunchYou should do a write-up on how to set it up and the signals trick :)
11:14:29FromGitter<zetashift> So you just `nake build` and press F5 in the editor to see your changes
11:14:55PMunchThat's pretty neat
11:15:16PMunchNo way to get F5 to run nake for you?
11:15:27FromGitter<zetashift> that's...pretty genius
11:15:31FromGitter<zetashift> I wouldn't know how to
11:16:31FromGitter<zetashift> would probably be better if the nake build also runs the sample in the editor since you press F5 in the editor for checking out other things too
11:17:31PMunchHmm
11:18:26FromGitter<zetashift> Also one thing that I did ran into was `yield`-ing stuff in godot. It don't play well and even the docs mention that things like this is best done in GDScript
11:18:36PMunchhttp://docs.godotengine.org/en/3.0/getting_started/editor/command_line_tutorial.html
11:18:48PMunchAccording to this that should be as simple as calling "godot" in the project folder
11:18:52FromGitter<zetashift> thanks!
11:19:22FromGitter<zetashift> I'm gonna try and get it to work on 0.19 for one more time
11:22:19FromGitter<zetashift> searching for nnkPar and nnkTuleContr gets me no matches :(
11:23:04Araqok, too bad, but it was worth a try
11:26:34FromGitter<zetashift> the empty string and empty seqs for so easy to fix but damn these I might've did something wrong to the godotmacros.nim so I'll try running through it again
11:30:35*skelett joined #nim
11:37:44*SenasOzys quit (Ping timeout: 268 seconds)
11:40:15FromGitter<zetashift> Should I correct the nil state of string with `""`? E.g. `let s: string = nil` would be `let s: string = ""`
11:40:16endragorzetashift: I'll work on adapting godot-nim to Nim v0.19 "soon". The important thing is to keep it backward-compatible with v0.17 and v0.18
11:41:15FromGitter<zetashift> oh noice you guys use it in production right? I thought I would gave it a whirl instead of not doing anything
11:42:18endragorI don't care much about 0.19 - too many changes there for our projects to migrate to it, that's why it gets delayed
11:44:32FromGitter<zetashift> @endragor thanks I didn't know about the backward-compatible goal, I'll just keep use choosenim for now
11:44:55FromGitter<zetashift> and try out PMunch link to make nake build also run godot
11:47:01FromGitter<xmonader> Valid bug? ⏎ ⏎ ```"10.147.17.184/24" ⏎ Invalid IP Address. Address contains an invalid character``` [https://gitter.im/nim-lang/Nim?at=5bbc95355331811c2e7414cc]
11:52:08PMunchxmonader / isn't really part of an IP
11:53:05PMunchIt's denotes the subnet
11:56:04FromGitter<xmonader> I know but i expected to be able to specify subnets and query the hosts and such not sure if that's how it should be? or even IpNetwork class should be available instead
11:56:24PMunchWhat are you trying to parse that string with?
11:56:37FromGitter<xmonader> parseIpAddress?
11:56:59*tzui joined #nim
11:57:53PMunchYeah, that just parses a single IP address
11:58:09*tzui left #nim (#nim)
12:01:21*rockcavera joined #nim
12:12:04*stefanos82 joined #nim
12:22:29FromGitter<zacharycarter> planetis[m]: thank you!
12:50:00planetis[m]actually i also have trouble understanding them, a blog post by their creator would be nice
12:55:01planetis[m]i am trying to make my matrix library more optimized but so far nothing
13:25:55*owner_ joined #nim
13:25:56*Tortice quit (Read error: Connection reset by peer)
13:26:21*owner_ is now known as Guest51934
13:26:29*alexnask joined #nim
13:30:25alexnask@Araq on cppDefine, should not all the standard C and C++ keywords be automatically mangled using the existing mechanism and then let the user add cppDefines to their nim.cfg for additional ones, or do you suggest that the default nim.cfg include cppDefine's of typeof and restrict and let the rest of the keywords be handled like they are now?
13:33:45Araqthe latter
13:33:58Araqand also, the list of keywords is constantly changing
13:35:43alexnaskRight,Fair enough
13:39:30FromGitter<kaushalmodi> Yay! Araq is on a merge spee! 🎉
13:39:41FromGitter<kaushalmodi> s/spee/spree
13:40:57*endragor quit (Remote host closed the connection)
13:41:11*endragor joined #nim
13:41:19*endragor quit (Remote host closed the connection)
13:44:03FromGitter<narimiran> +1 on that yay!
13:54:56*endragor joined #nim
13:59:12*floppydh quit (Quit: WeeChat 2.2)
13:59:54*endragor quit (Ping timeout: 264 seconds)
14:01:13*alexnask quit (Ping timeout: 246 seconds)
14:09:49krux02I have a nice hello world, I didn't know it was valid Nim syntax: http://ix.io/1oMd
14:11:14AraqI called this feature of Nim "syntax harmony" :P
14:11:30PMunchHaha, that is a nice one
14:11:34Araqthere is syntax and then there is semantics and Nim decouples them
14:11:56Araqand this must be great because I used an OO word.
14:12:18PMunchSo what's happening is that echo accepts varargs and get's "hello" and a block which resolves to "a & b" and then echo concatenates them?
14:12:53Araqyep
14:13:39PMunchAh good
14:13:51PMunchAs long as I'm able to explain what's going on I'm happy :P
14:14:18PMunchI was afraid the string had something to do with it
14:14:52FromGitter<malkomalko> TIL: http://ix.io/ nice!
14:17:08FromGitter<kaushalmodi> there's also pbpt.pw that allows linking individual lines: https://ptpb.pw/w3Jg/nim#L-2
14:18:17FromGitter<kaushalmodi> krux02: nice snippet, and PMunch, thanks for the explanation :)
14:18:59PMunchmalkomalko, yeah ix is nice. I've set up a keyboard shortcut that sends my current selection to ix.io and puts the link in my clipboard. Super practical for IRC
14:19:51FromGitter<malkomalko> love all the things
14:27:12*Vladar quit (Remote host closed the connection)
14:27:22FromGitter<zacharycarter> okay - destructors and RAII make much more sense to me now
14:27:48FromGitter<zacharycarter> I'm still not understanding all the copy / move semantics involved - but I guess that's the next step in understanding I need to get to
14:28:07FromGitter<zacharycarter> https://www.hackcraft.net/raii/#sect0 - was a very good / helpful read
14:28:13*narimiran joined #nim
14:29:39*krux02- joined #nim
14:32:09*krux02- quit (Remote host closed the connection)
14:32:30*krux02- joined #nim
14:34:51*PMunch quit (Quit: Leaving)
14:43:47*TheLemonMan joined #nim
14:46:32TheLemonMancool, now that the manual snippets are also run we can expect more CI timeouts :D
14:48:12Araqhum? they always were run
14:48:56FromGitter<imdaveho> @Araq for finish.exe on windows, do we have to use MingW?
14:49:23FromGitter<imdaveho> I have VS 2017 buildtools installed, isn't that sufficient?
14:49:26TheLemonMannot during the `nim doc` pass though
14:50:50Araqimdaveho, maybe but then finish.exe doesn't detect it, it only detects mingw
14:51:05AraqTheLemonMan, the manual uses the 'nim rst2html' command
14:51:25FromGitter<iffy> I'm having trouble resetting my password on the forum. Is this a common issue?
14:51:29AraqI recently tested clang v7 on Windows and was surprised how well it works
14:51:49Araqso maybe we'll ship clang with Nim and drop the finish.exe
14:52:40Araqbut we can't ship VS 2017 buildtools and VS changes so much between its versions
14:52:54Araqthat it's hard to detect
14:53:21Araqalso tbh... it's setup with its env vars and the lack of a builtin assembler is just crap
14:56:36FromGitter<imdaveho> hmm that's fine -- for a language that *actually* considers the windows devs out there, the setup process is sure clunky -- so if you ship with clangv7 orr whatever to get ppl bootstrapped asap, that would be great
14:56:55FromGitter<imdaveho> also choosenim...needs 64-bit support and some work to get it up to rustup level...
14:57:09FromGitter<imdaveho> maybe that's something I could look into contributing...but again, I'm not at your guy's level
14:57:16narimiranwhen talking about windows: please make choosenim use 64-bit version
14:57:53narimiranif there is only one version supported, let it be 64-bit one
15:01:39Araqbut every 64bit windows can run the 32 bit version
15:01:41TheLemonManshashlick_ was working on it, it seems ( https://github.com/dom96/choosenim/pull/63 )
15:01:55*nsf quit (Quit: WeeChat 2.2)
15:04:02narimiranAraq: and every 32-bit user (a minority of total users) can install nim via official download, not via choosenim ;)
15:04:10*shashlick_ quit (Remote host closed the connection)
15:04:31*shashlick joined #nim
15:04:36*FromGitter * arnetheduck is accepting patches for `nlvm` windows support :)
15:04:38*federico3 quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
15:05:01*federico3 joined #nim
15:05:05shashlickwell, that choosenim PR also adds ability to install binary on windows, avoiding the full build process
15:05:11shashlickbunch of other fixes
15:05:42shashlickwill be cool if it got some code reviews
15:05:46Araqnarimiran, fair enough I guess
15:07:11FromGitter<manterolat> @Araq, for #9154 (pr #9193), should the path creation be done in commands.nim?
15:07:38Araqnah when writing the file
15:07:54Araqif there is an error the dirs shouldn't be generated
15:09:14FromGitter<manterolat> Got it! Should I still check whether the outfile is in fact a directory inside commands.nim?
15:09:23Araqno.
15:09:59TheLemonManthat's not in line with what gcc does
15:14:03narimiranAraq: can you please expand why `rotateLeft` can't be discardable? or: why is the return value of it so important?
15:14:17AraqI don't like .discardable
15:14:37Araqproc foo(): auto = discardableProc() # what does it mean?
15:14:50Araqlanguage features interact.
15:14:54narimiranok, there's another solution: proc which mutates its first argument shouldn't return some unexpected int in the first place
15:15:13Araqyeah but that would be a breaking change
15:15:27Araqand we need to focus on bugfixes IMO
15:15:50narimirani know, that's why i thought discardable could be good idea there (even if it is not generally preferrable)
15:16:02krux02Araq: maybe there is a linter tool that automatically reports usages of auto and discardable as bad in a PR
15:16:06krux02I think there is
15:16:24TheLemonManI hate `auto`
15:16:37FromGitter<kaushalmodi> krux02: just add a grep command to the script: in travis and fail if match found? :)
15:16:50Araqgah don't you dare
15:16:58FromGitter<kaushalmodi> hehe
15:17:44narimirankrux02: btw, discardable is used twice in the same file, and it is there for the last three years
15:18:09Araqwe don't need no linters, we can use 'grep' instead and Unix is my IDE because I love stringly typed environments that don't work now and didn't work back in the 70ies either
15:23:08narimiranthis is the discardable we're talking about: https://github.com/nim-lang/Nim/pull/9192/commits/7aaceb628fcdb251fe9295bf7b92728fb8f4557a#diff-0496518dc73089ad36ee9fc78572c73eR533
15:25:14narimirancan *anybody*, without further investigation, tell what value does this return? and bonus question: would you expect `myCollection.rotateLeft()` to yell at you because you didn't handle some return value?
15:26:12krux02narimiran, I know what it does, I implemented it
15:26:13narimiran(that should have been `myCollection.rotateLeft(myValue)`)
15:26:58narimirankrux02: why didn't you document the return value? ;)
15:27:04krux02it "rotates" the elements in the collection by `myValue` elements to the left, and returns some useless value
15:27:38krux02I forgot, I implemented it with the c++ version in mind
15:27:39*Trustable joined #nim
15:27:54krux02and the c++ version returns an iterator
15:28:01narimirankrux02: https://github.com/nim-lang/Nim/pull/9192#issuecomment-427389720
15:28:12narimiranthere are two c++ versions
15:28:12krux02that "iterator" doesn't exist in Nim, so it returns an index
15:29:19FromGitter<manterolat> Araq, how should I throw an error in `myClose()` in jsgen.nim for the outFile issue? globalError and localError both seem to need a PProc to be called
15:30:05krux02I agree the return value is for the most part not interesting. So discardable is actually ok here. But Araq doesn't like discardable, so it isn't.
15:30:37krux02narimiran, are you using rotateLeft?
15:30:44narimiranyes i am
15:31:30narimiranwell, if you say it is ok here, it might convince Araq :)
15:31:32krux02cool, I had to actually argue that rotateLeft is useful
15:31:59krux02narimiran: "might"
15:32:36narimiran"so, you're telling me there's a chance" :)
15:33:06narimirani'm sure there are lots of things he don't like/prefer, but.... :)
15:35:09krux02I am telling you, if discardable is useful for anything, then it is this procedure
15:35:33narimiranAraq: ^
15:36:07krux02but I think he doesn't like it, because he doesn't like the implementation of discardable.
15:36:49Araqalright so use the .discardable here
15:37:42Araqand I smell another "I hate for loops" in disguise :P
15:37:56narimiranthank you :)
15:38:43Araqoh no I take it back, rotateLeft is not just a single for loop
15:49:43Araqnarimiran, https://github.com/nim-lang/Nim/pull/7036
15:49:59Araqclose/accept? I think these aliases always do more harm than good
15:50:23narimiranAraq: thank for the reminder! will delete those crazy `-+-=` symbols
15:50:47narimiranbut IMO, `+=` is quite useful (i know i use it quite often)
15:51:40*hzx joined #nim
15:52:22narimiranoh, i already deleted those crazies
15:52:23krux02Araq: I have seen often, that `+=` is faster that a distinct `+` and `=`
15:52:46*narimiran should buy krux02 a beer
15:52:53krux02and I have seen a lot of generic code that implemented `+` based on `+=`
15:52:59krux02(and copy)
15:53:15Araqyes but look at this PR
15:53:22Araqit doesn't nothing of these things
15:53:29krux02I know
15:53:53krux02but for the discussion, I don't think a generic `+=` based on `+` and `=` is better.
15:54:01narimiranhow can i make it better? can *I* make it better, or is somebody more experienced needed for that?
15:54:28krux02I think the += should be implemented faster, it shouldn't allocate a new hash set object and then assign it.
15:54:47krux02it is misleading, when there as a custom += operator, it should be fast and modifying
15:55:46narimirani'm all for it (that fast version), but i'll probably need a guidance how to do it
15:56:21krux02those operators should be aliases for incl and excl
15:56:26krux02I just looked in the file
15:56:40krux02the implementation is stupid
15:58:18krux02narimiran, it is already implemented it just has a different name
15:58:27krux02look in the source code
15:58:50narimiranoh sweet
15:58:54narimiranwill make the changes
16:03:44Araqno, we have incl and add and += and these are never aliases
16:04:11Araqand yeah, 'incl' should maybe have been 'add' instead but that's a different issue
16:04:25FromGitter<rokups> got back to coroutines a bit. basic implementation with manual switching (tested only on linux): https://gist.github.com/6b31385af70b71ac5e691aded306ab14 and depends on https://github.com/septag/deboost.context/tree/master/asm
16:04:42Araqok probably in system.nim += exists for sets :-/
16:04:55Araqhttps://github.com/nim-lang/Nim/pull/7735 do we want this?
16:05:28FromGitter<imdaveho> also, @Araq I hate bikeshedding, but is there a reason `*` is used to specify pub methods? since it resembles a common pattern for representing pointers
16:07:12narimiranAraq: ok, if `+=` shouldn't be alias for `incl` then we can close that old PR of mine, and i won't be making a new one
16:08:36narimiranbtw, impressive rate of resolving PRs/issues! please keep up with this, i'm enjoying it! (and i'm sure i'm not the only one)
16:11:34FromGitter<mratsim> @imdaveho it’s from Modula, and forcing people to spell ptr is good
16:11:44FromGitter<manterolat> Is there a better way of showing an error inside jsgen.nim without showing a file/line number? I'm currently doing `newLineInfo(m.config, AbsoluteFile "", 0, 0)`, but it doesn't seem like the best way to do this
16:12:16Araqit's from Oberon and I wouldn't do it this way today, but it's also not too terrible
16:13:09Araqand 'T * x' is a multiplication, not a pointer declaration :P
16:13:22FromGitter<mratsim> for sets, how about `^=` and `v=` ;)
16:13:30Araqwe don't copy mistakes from C here, we make our own mistakes
16:14:10FromGitter<mratsim> the export marker looks fine to me, maybe the only issue is implementation in the parser
16:14:11FromGitter<rokups> Araq im curious - how would you do it today?
16:14:34Araqpublic by default, trailing underscore for private
16:14:50Araqbut the underscore only at the declaration site, like so:
16:14:57Araqproc foo_(): string = "hi"
16:15:07Araqecho foo() # not: echo foo_()
16:15:31FromGitter<mratsim> python uses starting underscore
16:16:00FromGitter<mratsim> trailing is used by convention for proc that mutates their input
16:16:10FromGitter<mratsim> like reverse vs reverse_
16:16:18FromGitter<mratsim> instead of reversed ;)
16:16:31narimiranwell, in julia it is denoted by trailing !
16:16:34FromGitter<rokups> yeah that does make sense. i prefer leading underscore but got used to trailing one by now. nim2.0 and underscore privates when :trollface:
16:16:35AraqPython uses sorted though iirc
16:17:03FromGitter<mratsim> maybe it’s just in numerical libraries then
16:17:17FromGitter<mratsim> I see that in Torch so it might even come from Lua
16:18:21FromGitter<bung87> good for non english programmers
16:18:40narimiranbw, in scikit-learn, trailing _ is used for variables, and it has yet another meaning ;)
16:19:19FromGitter<bung87> s
16:19:19FromGitter<bung87> v
16:19:22FromGitter<rokups> what meaning is that?
16:21:48narimirani haven't used it for a long time, so maybe i don't remember exactly, but it has to do with pre- or post- training/fitting, or something like that
16:22:00FromGitter<alehander42> Araq that would be very confusing, because `_` would be basically an operator (with absolutely similar behavior like `*` but for "make-it-private" instead of public)
16:22:21FromGitter<alehander42> but people are used to `ident with *` meaning `*` is part of the name
16:22:42AraqI was asked how I would do it nowadays
16:22:57FromGitter<alehander42> yeah and I am saying that `_` seems worse to me :D
16:22:58AraqI am aware that you all like Nim and never what I do
16:23:55FromGitter<alehander42> you should learn something from Nim, Araq
16:24:22narimiran:D
16:24:33FromGitter<zacharycarter> I am fundamentally confused
16:24:41FromGitter<zacharycarter> I've established that @alehander42 is TheLemonMan
16:24:45FromGitter<zacharycarter> but who is TheLemonBoy ?>
16:24:49FromGitter<zacharycarter> and why are there so many lemons?
16:25:02FromGitter<rokups> Araq its your job as a leader to be not liked ;)
16:25:04TheLemonManthe fuq?
16:25:08federico3alehander12
16:25:11FromGitter<kaushalmodi> lol
16:25:14FromGitter<zacharycarter> oh wait
16:25:18FromGitter<zacharycarter> oh god
16:25:19FromGitter<zacharycarter> this is so confusing
16:25:20narimiranTheLemonMan: oh shut up, alehander!
16:25:28FromGitter<alehander42> well I was trying to hide it
16:25:30FromGitter<zacharycarter> lolol
16:25:39FromGitter<alehander42> but i think the hair gave it out
16:26:07FromGitter<zacharycarter> I feel like I'm following like three different people in PRs or maybe just one and I never know
16:27:38TheLemonManwe are two separate entities afaik
16:27:47narimiranbtw, did you know that Araq and dom96 are the same person, too?
16:28:09FromGitter<bung87> hehe
16:28:10FromGitter<zacharycarter> well
16:28:11narimiranAraq was on vacation, and there was no sign of dom96, too. coincidence? i don't think so!
16:28:17FromGitter<zacharycarter> yeah - that conspiracy theory got leaked the other day
16:28:21FromGitter<zacharycarter> might still be true
16:28:25FromGitter<zacharycarter> jury is still out
16:28:29FromGitter<alehander42> that absolutely makes sense btw was just thinking about that
16:28:52FromGitter<zacharycarter> I think we need to establish some sort of investigative body to get to the bottom of all these mysteries within the Nim community
16:28:59FromGitter<alehander42> overally i am not sure if any of you people exist
16:29:08FromGitter<zacharycarter> and I'm about to make like four more accounts
16:29:12FromGitter<zacharycarter> and start fixing things and asking questions in irc
16:29:16FromGitter<zacharycarter> just to compete
16:30:20FromGitter<alehander42> i've also suspected for a long time that @timotheecour is just a rogue ai
16:30:36FromGitter<zacharycarter> I buy it
16:30:48FromGitter<bung87> haha
16:31:05FromGitter<bung87> intersting
16:31:33FromGitter<kaushalmodi> btw Araq, any help on what this failure means? https://travis-ci.org/nim-lang/Nim/jobs/439199217
16:31:44FromGitter<kaushalmodi> it failed in 37 mins but I don't see an error message
16:32:17FromGitter<kaushalmodi> and the parallel travis job in the same PR passed
16:32:45TheLemonManthat's the usual fragment_alloc failure on osx, it's good to go
16:32:47federico3search for Gotten on the raw log
16:33:10FromGitter<alehander42> look at all those people trying to derail the conversation to actual compiler development, typical russian bots
16:33:46FromGitter<kaushalmodi> federico3: Thanks, would have never occurred to search for that (searched for error, failure, fail, etc. but didn't help_
16:35:03TheLemonManyou could also search for `FAIL:`
16:35:03FromGitter<kaushalmodi> TheLemonMan: hmm so the .2 builds are on osx. TIL
16:35:51FromGitter<kaushalmodi> TheLemonMan: turns out I hadn't searched for "fail" :)
16:36:13TheLemonManall the builds are run on linux and osx (and windows by appvoyeur)
16:36:41*darithorn joined #nim
16:36:48FromGitter<mratsim> I gave up on OSX builds, Travis is too random ...
16:37:02FromGitter<kaushalmodi> I knew that that linus/osx tests were happening, but never took time to figure out the .1 vs .2 Travis jobs
16:37:13FromGitter<kaushalmodi> .. and that appveyor is just for windows
16:37:18FromGitter<mratsim> also Ubuntu 14.04 has been end of lifed in July and it’s still the default in Travis
16:39:05TheLemonManmratsim, now that I've enabled the caching of the .choosenim folder it works pretty well
16:39:33TheLemonManthe biggest problems I had (beside a bug in criterion.nim) were the random failures during the toolchain bootstrap
16:53:15narimiran`expr` is now `untyped`?
16:53:39TheLemonManyes
16:56:02FromGitter<alehander42> wasn't `expr` removed years ago
16:56:35narimiran@alehander42 i'm going through (very) old issues to see what has already been fixed and what could i tackle
16:56:54*stefanos82 quit (Quit: Quitting for now...)
16:57:37FromGitter<alehander42> aahh nice
17:02:06*arecaceae quit (Remote host closed the connection)
17:02:28*arecaceae joined #nim
17:03:55FromGitter<kaushalmodi> I picked up an arbitrary old issue and the issue is still valid. Any term rewriting macro experts here? (I have no clue what those are). But I reran a snippet from the manual and it's not outputting what it says in the manual: https://github.com/nim-lang/Nim/issues/2901
17:04:18FromGitter<manterolat> @Araq, should I throw an error if the output file is a directory, or should I just create the directory and leave it at that?
17:05:04Araqcreate the directory
17:05:49Araqthis whole mkdir vs mkdir -r vs rmdir -rf is all a design bug because "That wouldn't be a syscall"
17:06:48Araqand every 'rm' operation that cannot be undone unless the HD was full and so stuff needed to be overwritten is also a design mistake
17:07:14FromGitter<kdheepak> The httpclient doesn't work in JS, any easy way to make such code portable?
17:07:38leorizeuhmm... write a js backend for it? :P
17:07:44leorizethen everyone profits
17:07:46Araqonly at the app level, use a 'when defined(js): ... else: ...'
17:08:03FromGitter<manterolat> Alright, should I add it to the current PR, or make a new branch since the previous one has useless commits?
17:08:18FromGitter<kdheepak> Thanks the `when defined(js)` helps a little.
17:08:40Araqleorize, that typically is much more work than fixing it in the application layer
17:08:46FromGitter<kaushalmodi> @manterolat You can force push to the same PR branch
17:08:55leorizeor you can just push it
17:09:04leorizeand the merger will squash them for you
17:09:15FromGitter<manterolat> Ah, didn't know that, thanks!
17:09:15Araqyep.
17:10:54Araqkaushalmodi, https://github.com/nim-lang/obsolete
17:11:28FromGitter<kaushalmodi> Araq: I'd suggest renaming that repo
17:11:31FromGitter<kaushalmodi> to obsolete-packages
17:11:41FromGitter<kaushalmodi> "nim-lang/obsolete" doesn't look good
17:11:50FromGitter<kaushalmodi> obsolete what?
17:11:53FromGitter<kaushalmodi> language?
17:11:57FromGitter<kaushalmodi> packages?
17:11:58Araqhmm
17:12:15Araqgot a shorter alternative?
17:12:37FromGitter<kaushalmodi> ex-packages?
17:12:44leorize"graveyard"?
17:12:46TheLemonManobslt-pkgs
17:12:56FromGitter<kaushalmodi> yeah graveyard +1
17:13:03Araqok
17:13:16narimiran...until SJWs see that you're using that :P
17:13:56Araqhuh? how could that be offensive?
17:13:57FromGitter<kaushalmodi> SJWs?
17:14:08Araqnah, spare me, I don't even want to know
17:14:14narimiranAraq: everything is offensive if you try enough :P
17:14:20FromGitter<zacharycarter> yeah - someone will find a way
17:14:29FromGitter<zacharycarter> just get fancy with it and use some synonym that no one knows
17:14:33*shadowbane quit (Quit: Konversation terminated!)
17:14:40FromGitter<zacharycarter> like
17:14:40FromGitter<zacharycarter> columbarium
17:15:01narimiran@zacharycarter i feel offended by that name!!! :P
17:15:11Araqok, so let's use nim-lang/concentration-camp
17:15:14FromGitter<zacharycarter> I was just waiting for everyone to be like - hah stupid
17:15:18FromGitter<zacharycarter> I know what that means
17:15:25narimiranAraq: hahahah
17:15:42narimirannim would raise to the top spot at HN/reddit, that's for sure
17:15:58*shadowbane joined #nim
17:16:19Araqhttps://github.com/nim-lang/graveyard
17:17:00*Vladar joined #nim
17:17:52Araqdamn, "coffins" would have been shorter
17:18:14TheLemonManwell, it's a single coffin for more corpses
17:18:25FromGitter<kaushalmodi> lol
17:18:37FromGitter<kaushalmodi> why make it easy to access obsolete packages?
17:18:50TheLemonMannostalgia factor
17:19:02FromGitter<kaushalmodi> I'd make the URL the longest possible.. use that long URL if you are so desperate to use an obsolete pkg :P
17:19:44narimiranwell, you would still use `import longDeadFoo`, not the github link
17:20:01FromGitter<kaushalmodi> yeah, that too
17:20:09FromGitter<kaushalmodi> the url is relevant only for the nimble PR
17:21:09FromGitter<kaushalmodi> actually the url will be used for docs
17:21:21FromGitter<kaushalmodi> (do we want autogenerated docs for obsolete pkgs?)
17:22:10FromGitter<kaushalmodi> if so, we can have https://nim-lang.github.io/graveyard/xmldom
17:23:06FromGitter<alehander42> `/past` would be shortest
17:23:10TheLemonManxmldom ... xml _dom_ ... written by dom96 ... coincidence?
17:23:32Araqyes
17:24:04FromGitter<kaushalmodi> "past" doesn't give the same meaning as "graveyard"
17:24:12FromGitter<kaushalmodi> I hope we are sticking with the latter
17:24:16FromGitter<kaushalmodi> /bikeshedding
17:27:36FromGitter<alehander42> now I see why unix is full of `kill / zombie / daemon`
17:28:37Araqyeah but these are ok with me, these have grown vowels
17:37:36TheLemonManmanterolat, that should also apply to the C backend
17:37:44TheLemonManand maybe to the various doc ones too
17:43:42*kapil____ joined #nim
17:45:09*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
17:56:13*anamok joined #nim
17:57:20TheLemonManAraq, you can pull the trigger on #8723 too if you want
18:05:18FromGitter<dm1try> Araq, could explain why did you merge #9183? it looks like the most terrible solution from solutions provided earlier
18:06:12FromGitter<dm1try> the initial problem is not solved(nasty workaround is provided), in addition, the context about this workaround is hidden now
18:08:54*wildlander joined #nim
18:09:25Araqdm1try, it looked good to me (TM)
18:09:39Araqand all you said was "thumbs down" to it
18:10:04FromGitter<dm1try> yep, I commented in the related issue
18:10:14Araqplus I share the concerns about "callSoon"
18:10:35Araq(what does it mean, "soon"? Why can't it be called immediately instead?)
18:12:04*rokups quit (Quit: Connection closed for inactivity)
18:16:16Araqlink please
18:16:28FromGitter<dm1try> I'm not sure about the concerns you are talking^
18:16:33FromGitter<dm1try> see https://github.com/nim-lang/Nim/pull/9159#issuecomment-426871190, this comment shows that dom96 did not get that he was fixing
18:17:03FromGitter<dm1try> https://github.com/nim-lang/Nim/pull/9159#issuecomment-426885001
18:18:12Araqgah, I misread your answer
18:18:38FromGitter<dm1try> besides that any provided solution looks like a workaround for current futurestream implementation, I mostly worried about collabaration on the code
18:18:58FromGitter<dm1try> as the solution from dom96 totally hides the context/problem
18:19:16FromGitter<dm1try> I don't think this great for the collobaration, IMHO
18:19:43Araqcollaboration?
18:20:08*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
18:20:14FromGitter<dm1try> If someone will improve/fix the code in the future
18:20:30FromGitter<dm1try> it might be easier to do with a proper context
18:21:07FromGitter<dm1try> anyway, I got it, it looks good to you
18:21:19Araqhey hey
18:21:37AraqI'm only a human being
18:21:58*Widdershins quit (Quit: WeeChat 2.1)
18:22:34*Widdershins joined #nim
18:23:10Araqand I still don't understand what you dislike about dom's fix
18:28:49FromGitter<dm1try> the problem did not solved, call to the `complete` still calls the `read` callback. the provided workaround allows to call `read` future many times(this behaviour even contradict this a comment in next line https://github.com/nim-lang/Nim/pull/9183/files#diff-e13cc97dd4bb5249bb6d7aef936700d2R87)
18:30:07Araqok, can you please create a PR for it? It's fine to also revert dom's changes if that's what it takes
18:30:14FromGitter<dm1try> so yes, the reader will actually read the missed data in such way
18:30:37FromGitter<dm1try> but this behaviour even not documented in any way
18:35:08Araqok
18:38:40FromGitter<kaushalmodi> Araq: https://github.com/nim-lang/Nim/pull/9261 is passing tests on linux and windows (fails on osx because of fragments_nim); ready to merge :)
18:40:12*darithorn quit ()
18:40:58Araqcould also have fixed the trailing commas, they are ugly
18:41:38FromGitter<kaushalmodi> those were just tests
18:43:14*amk joined #nim
18:43:29*BitPuffin joined #nim
18:43:54anamokhi
18:44:15FromGitter<iffy> I have some `{.compileTime.}` procs that produce NimNodes. How do I insert those NimNodes into the AST instead of returning the NimNode as a variable? I'm guessing the only way is through a template or macro, correct?
18:44:39Araqnah
18:45:06anamokIf I want to create a new operator, e.g. "func `+`*(s, t: string): string = s & t", then should it be a func or a template? I never know which one to choose. Could someone explain that to me?
18:46:10Araqalways choose in this order: func, proc, template, macro
18:46:32FromGitter<iffy> Araq: what's my other option?
18:46:59FromGitter<iffy> Suppose `var p:NimNode = someCompileTimeProc()`
18:47:01Araqa NimNode is a ref, you can update it by add'ing a son
18:47:19*zachk joined #nim
18:47:23FromGitter<iffy> how would I insert p into the next line, for instance
18:47:39Araq"next line"?
18:48:17FromGitter<iffy> Right, so I have a proc that returns a NimNode. Right now, I'm assigning it to p. But rather than do that I'd like to insert the NimNode at the place where the proc was called
18:48:52FromGitter<iffy> feels like a macro to me... so now I'm wondering what the difference is between a macro and what I'm asking
18:50:09Araqplease describe what you're trying to do at a high level
18:50:16Araq*on
18:50:47FromGitter<iffy> Araq: https://forum.nim-lang.org/t/4292
18:51:12FromGitter<iffy> You can ignore the title; the first 3 paragraphs describe what I'm trying to do
18:52:25anamokOK, but what's the difference between a func and a template? If it works with both (in several of my cases), then why is func better than a template?
18:52:25FromGitter<iffy> I'm now trying to achieve it using `{.compileTime.}` procs (mimicking what the macros library does)
18:53:18FromGitter<alehander42> @anamoc functions are simpler conceptually, easier to debug
18:53:50FromGitter<alehander42> sometimes template might make sense as an optimization, but in general you should start with proc
18:53:57Araqiffy, as a starting point for learning Nim's macros that's way too hard but e.g. the 'cligen' nimble package does just that iirc
18:54:29FromGitter<iffy> hehe, I'm getting the feeling it's way to hard
18:54:34FromGitter<iffy> k, I will check out that package
18:54:47Araqyou're asking for a parser generator built via Nim's macro system
18:55:04FromDiscord_<Shield> I use templates to force inlining
18:55:07Araqthat's still missing, my currently best attempt is 'scanf'
18:55:53Araqand it's easier when you don't think about the "Parser" type/object but instead how to produce the parsing proc body
19:00:00FromGitter<iffy> Araq: I was trying to not build a parser for the body of mkParser, but rather use normal procs/funcs/template/macros in the body
19:00:34FromGitter<iffy> I'm probably being confusing
19:01:34Araqhere is a good example of a macro for introduction
19:01:41Araqwrite a macro 'm' so that
19:01:48Araqm a, b, c:
19:01:53Araq someProc
19:02:00Araqgets transformed into
19:02:09AraqsomeProc(a); someProc(b); someProc(c)
19:02:56anamokI'm just curious: why is string concatenation done with `&` instead of `+`?
19:03:29FromGitter<alehander42> @iffy something you can do is to define setup code and tmp variable in mkParser and then generate invocations to those flag etc procs with tmpParserVar as argument
19:04:13FromGitter<iffy> Araq: I'd use a template for that: ⏎ ⏎ ```template m(a:untyped, b:untyped, c:untyped, p:untyped) = ⏎ p(a) ⏎ p(b) ⏎ p(c)``` [https://gitter.im/nim-lang/Nim?at=5bbcfbadbbdc0b250511b2dd]
19:04:21FromGitter<kaushalmodi> Araq: Should nre, parseutils2, etc. be also moved there?
19:04:41FromGitter<kaushalmodi> I know there were talks about deprecating those, but not sure on the latest development about those
19:04:53FromGitter<iffy> @alehander42 instead of generating invocations, I'm looking for a way to just use the invocations within the body of mkParser
19:05:06FromGitter<iffy> trying to leverage Nim instead of invent my own DSL
19:05:19*nsf joined #nim
19:05:20FromGitter<kaushalmodi> s/moved there/moved to the graveyard
19:05:56FromGitter<alehander42> @iffy you can do this, i am saying to just convert
19:06:31FromGitter<alehander42> ```flag(..) ⏎ otherstuff(..) ⏎ # to ⏎ flag(tmpParser, ..) ⏎ otherStuff(tmpParser, ..)``` [https://gitter.im/nim-lang/Nim?at=5bbcfc3738449236610ed94f]
19:06:35FromGitter<manterolat> TheLemonMan: Alright, working on C (is cgen.nim separate from the c++ one?)
19:08:26FromGitter<iffy> @alehander42 my goal is to define an object type that represents what can be returned from parsing a string. I'm not sure how converting the calls to runtime calls will help me do that. Don't I have to have types defined at/during compile time?
19:09:39Araqiffy, you cannot do that because 'm' takes a variable number of arguments :P
19:09:51FromGitter<alehander42> well I thought flag should be a runtime proc
19:10:20Araqkaushalmodi: yeah but 'nre' probably deserves its own Nimble package and not in 'graveyard'
19:10:29FromGitter<iffy> that's what I'm trying to say, I want flag to be a compile-time proc (or something) that helps me generate a type definition
19:10:31FromGitter<alehander42> i'd just use a table of string => string log name, variant with possible values(argInt, argText etc) instead of special type
19:10:46FromGitter<iffy> Araq: okay, I'll try again :)
19:11:15Araqanamok, so that @[1, 3] + @[1, 2] can be @[2, 5]
19:11:33Araqand @[1, 3] & @[1, 2] can be @[1, 3, 1, 2]
19:11:57Araqwhich is the only thing that makes sense, I don't understand how other languages *can* use '+' for this
19:12:38Araqit's like you've only seen dogs in your life and then you see an elephant for the first time and also call it a "dog"
19:13:35anamokI see, thanks for the explanation
19:14:22*crem quit (Quit: WeeChat 1.9)
19:22:02*crem joined #nim
19:22:46anamok`echo @[1, 2] + @[3, 4]` produces a type mismatch error
19:23:16FromGitter<iffy> Araq: Not pretty, but I think it fits the bill: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbd0024c7bf7c3662e1b5ea]
19:24:14narimiranAraq: should the complete /web folder be deleted? both website.ini and nimblepkglist.nim?
19:25:40*crem quit (Client Quit)
19:25:47FromGitter<kaushalmodi> anamok: I would have to guess that Araq was trying to show the difference of what a "+" meant as an idea vs "&"
19:26:03FromGitter<kaushalmodi> How I see is that "+" adds things
19:26:12FromGitter<kaushalmodi> concatenation is a bit different than addition
19:26:24anamokoh, ok
19:26:32FromGitter<kaushalmodi> So instead of overloading the "+" for string concat, a new op "&" is used
19:27:04FromGitter<iffy> @alehander42 @Araq I guess the answer I'm hearing is, "no, there's not a way to take the NimNode result of a `{.compileTime.}` proc and insert it into the AST at a particular point." Or, in relation to my forum post: "There's no way for the desired transformation to occur if `mkParser` is a compileTime proc"
19:27:40FromGitter<iffy> `mkParser` would have to be either a template or macro, correct?
19:27:50FromGitter<kaushalmodi> anamok: You might find these useful as you are learning Nim: https://narimiran.github.io/nim-basics/, my notes: https://scripter.co/notes/nim/ (still getting updated)
19:28:13FromGitter<alehander42> @iffy you can call compile time proc-s from other macros and do whatever you want with their return values
19:28:22FromGitter<alehander42> that's how most bigger macros work
19:28:37FromGitter<iffy> okay, so it has to start with a macro, though?
19:28:41FromGitter<iffy> (or template)
19:28:59FromGitter<manterolat> TheLemonMan, apparently docgen already creates dirs when needed. Just added it to cgen
19:29:10FromGitter<alehander42> well mkParser has to be a macro, because you invoke it directly in the source code
19:29:19FromGitter<iffy> okay
19:29:26narimiranone more closed/merged PR and we'll drop below 100 open PRs! wow, impressive!!
19:29:53FromGitter<iffy> and that helps make it clearer in my head what's going on; thank you!
19:29:55*crem joined #nim
19:29:58anamokkaushalmodi, I started with Nim Baics, I loved it. Scripter's Notes is also on my "to read" list. Thanks.
19:30:15FromGitter<kaushalmodi> I wouldn't put it on "to read" :P
19:30:22FromGitter<kaushalmodi> just search it for what you might need
19:30:28narimirananamok: thanks for the feedback :)
19:30:46anamoknarimiran: we are waiting for Part 2 ;)
19:31:10narimiranheh, for part 2 i need to get better first ;)
19:31:39FromGitter<iffy> As a feature request, it would be really neat if I could insert the result of a compileTime proc into the AST at the point it was called :)
19:32:22FromGitter<iffy> The difference from macros being: the body of the proc is executed normally as written
19:32:36Araqiffy, now I understand your question better, yes
19:32:39FromGitter<alehander42> that wouldn't really make sense for untyped macros: when you invoke a macro, the whole point is that it has full control on what to do with the code block you passed
19:32:42FromGitter<iffy> But there are probably reasons not to do that that I'm not aware of
19:32:49Araqyou "start" with a template or a macro and these call .compileTime proc helpers
19:33:00*darithorn joined #nim
19:33:24FromGitter<alehander42> @iffy but you can easily just include the body in your generated final NimNode
19:33:40FromGitter<iffy> well, I want the body to be filled with compileTime procs, too
19:34:35FromGitter<alehander42> ah, so e.g. you want
19:34:36FromGitter<iffy> something liked `proc mkParser(name:string, p:proc()):NimNode = p()`
19:34:49FromGitter<iffy> (but it does stuff before and after `p()`
19:35:55FromGitter<alehander42> is there a reason you insist mkParser to be a compile time proc?
19:36:33FromGitter<iffy> so I don't have to interpret `flag` but can just let it be called like a normal proc
19:36:45FromGitter<alehander42> what i got til now is that you'd like ⏎ ⏎ ```mkParser(..): ⏎ flag(..) ⏎ flag(....)``` ⏎ ⏎ to call the macro mkParser, generate some code and then add to that code the NimNode result from each flag(..) ? [https://gitter.im/nim-lang/Nim?at=5bbd034df659e67772893f47]
19:37:56FromGitter<iffy> yes, I think you're understanding me
19:38:27FromGitter<alehander42> well, this just requires
19:38:31FromGitter<alehander42> flag to be a macro too
19:38:35FromGitter<iffy> I want each flag to influence what mkParser returns (it might do several things to the tree, but in my forum post I tried to limit it to generating an object type def and help text)
19:38:37FromGitter<alehander42> mkParser generates
19:39:09FromGitter<alehander42> ```setup code ⏎ flag(..) ⏎ flag(....)``` ⏎ ⏎ and then the flag macros are expanded one by one further [https://gitter.im/nim-lang/Nim?at=5bbd03dde65a634336ad7f8a]
19:39:31FromGitter<iffy> yes
19:39:40FromGitter<iffy> and they have access to some variables defined with the setup code
19:39:50FromGitter<iffy> (probably a fragile design)
19:40:27FromGitter<alehander42> that's why I suggested you to just rewrite them inside the macro to accept a parser variable
19:41:23FromGitter<iffy> would I get auto-completion in my editor with those transformations?
19:41:27FromGitter<alehander42> on the other hand, if you want each flag to influence a type which is generated in the setup code, I think you have to analyze them *while* you're in mkParser
19:42:45FromGitter<kaushalmodi> Araq: Should there be a small stdlib for XDG dirs? https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
19:42:56FromGitter<alehander42> auto-completion for what? for flag or for the custom type?
19:43:01Araqiffy, there is some nimsuggest support for "inside macro" but it bitrot, sad.
19:43:05FromGitter<kaushalmodi> then nim core can use that, and so can 3rd party cli apps
19:43:21FromGitter<iffy> @alehander42 completion for `flag` and it's expected args
19:43:26FromGitter<iffy> its
19:43:34Araqin theory macros don't hurt nimsuggest much :-)
19:44:46Araqkaushalmodi, that's one of these things that make me want to vomit
19:45:05FromGitter<alehander42> well as I said, you can always define flag noop proc-s with the right signature if you want both autocompletion and max flexibility in the macro
19:45:06FromGitter<timotheecour> @araq could you please merge https://github.com/nim-lang/Nim/pull/9265 once green ? the regression broke a bunch of my code ; thanks!
19:45:42Araqinstead of fixing their stupid directory hierarchy where everything is spread over every directory, they patch over it
19:46:25*PMunch joined #nim
19:47:09FromGitter<kaushalmodi> Well, I feel that the XDG structure puts things where a user expects
19:48:34Araqtimotheecour: consider it done
19:48:36FromGitter<kaushalmodi> right now we have `getConfigDir`. In the xdg lib, we can instead have `getXdgConfig(app: string)` and make it general purpose
19:49:10FromGitter<iffy> @alehander42 k, so in your last paste (that starts with `setup code`) each of those flag calls will be expanded *after* `mkParser` has completely finished, right?
19:49:14Araqnothing in "XDG" is "general purpose", it's lipstick on a pig
19:49:41FromGitter<kaushalmodi> at have seen quite a many cli apps stick to that convention
19:49:50FromGitter<kaushalmodi> it makes it easy to arrange my config files
19:58:15*runvnc joined #nim
20:00:46planetis[m]@iffy check a post about macros, it might help https://github.com/nim-lang/website/pull/108
20:07:56*Guest51934 left #nim (#nim)
20:08:18*Tortice joined #nim
20:28:02*runvnc quit (Quit: leaving)
20:32:22*Trustable quit (Remote host closed the connection)
20:32:42*runvnc joined #nim
20:34:51*narimiran quit (Ping timeout: 268 seconds)
20:37:49*PMunch quit (Remote host closed the connection)
20:46:18FromGitter<timotheecour> @araq ; existing guide mentions the exact opposite of what you said; see https://github.com/nim-lang/Nim/pull/9221#issuecomment-428336341 : see https://nim-lang.github.io/Nim/contributing.html /cc @Araq ⏎ ⏎ > The preferred documentation style is to begin with a capital letter
20:46:53FromGitter<timotheecour> I’m writing a PR to do some cleanups in that doc; what should the default be: capital or lowercase?
20:48:10*Vladar quit (Remote host closed the connection)
20:48:28Araqjust. stop fixing the case.
20:48:44*shpx joined #nim
20:49:00FromGitter<timotheecour> well you wrote a comment about that here: https://github.com/nim-lang/Nim/pull/9221#issuecomment-428195658
20:49:25FromGitter<timotheecour> which conflicts with guidelines we already have here https://nim-lang.github.io/Nim/contributing.html
20:49:29Araqthe only reason I accepted it is that I want people to get the T-shirts
20:51:02FromGitter<timotheecour> hacktoberfest aside, we shouldn’t have conflicting guidelines (and I dont’ have PR that fix case btw); so either I remove this guideline from contributing.rst or I change uppercase to lowercase in that rst doc
20:51:29Araqif you want this settled, count it and see what dominates
20:54:04FromGitter<iffy> Araq and alehander42 thank you for being patient with my questions. I think I've finally figured out a workable solution: https://forum.nim-lang.org/t/4292#26711
21:02:16FromGitter<kaushalmodi> The lowercase starting docstrings look weird to me.
21:07:57*elrood quit (Quit: Leaving)
21:12:01shashlickany feedback appreciated - https://github.com/nim-lang/nimble/issues/549
21:15:42*zama quit (Ping timeout: 272 seconds)
21:16:32*zama joined #nim
21:19:24FromGitter<slomp> Hi there, ⏎ Quick question about push/pop pragmas: ⏎ Is there a way to push/pop a `passC` pragma? ⏎ The main use case I have in mind would be to use it around `compile` pragmas: ⏎ ... [https://gitter.im/nim-lang/Nim?at=5bbd1b5cf659e6777289f9b1]
21:24:50*nsf quit (Quit: WeeChat 2.2)
21:30:16planetis[m]how would you call a 'string' concept and its definition?
21:30:25AraqStringLike
21:34:46FromGitter<alehander42> @iffy this can be improved
21:35:26FromGitter<iffy> really? great!
21:36:06*PrimHelios quit (Read error: Connection reset by peer)
21:36:10FromGitter<alehander42> https://forum.nim-lang.org/t/4292#26711
21:38:32FromGitter<iffy> @alehander42 where does that `block` code go? In the code calling `mkParser` or inside `mkParser`?
21:38:43FromGitter<alehander42> in the code generated by mkParser
21:39:04FromGitter<alehander42> i just did it to make sure tmpParser is not clashing with something
21:39:42FromGitter<iffy> k, I'll try doing it as you suggest and see how it goes; thank you!
21:40:23FromGitter<alehander42> typicall not needed, because macros are hygienic, but here flag is a different macro, so one needs to hardcode a name , e.g. somethingparser (afaik)
21:42:26*kapil____ quit (Quit: Connection closed for inactivity)
21:48:07FromGitter<manterolat> Araq: Just pushed to let the exceptions bubble up. I tested it and it shows an error when you try to create a path that already exists as a file
21:49:51Araqof course it does, contrary to popular belief exceptions cause "error message could be better" bugs
21:50:37Araqand cut down the boilerplate, it's a tradeoff and if you do the cost-benefit analysis they will win.
21:50:55Araqthat would be my guess.
21:53:14*vlad1777d joined #nim
21:53:48FromGitter<manterolat> I see. I kept trying to get a similar result with `localError`, `globalError` and `internalError`, but completely forgot an exception would appear on the screen
21:55:40*vegax87 quit (Ping timeout: 250 seconds)
22:05:39*vegax87 joined #nim
22:15:39*krux02 quit (Remote host closed the connection)
22:15:47*krux02- quit (Remote host closed the connection)
22:26:05*dddddd quit (Read error: Connection reset by peer)
22:28:19FromGitter<malkomalko> Where is `func` defined? I ripgrep'd over the source and nothing jumped out
22:30:16Araqit's a keyword, nkFuncDef in the AST
22:30:29Araqnew with 0.19, kind of
22:30:41Araqso update your source code highlighter
22:30:44Araq;-)
22:31:59FromDiscord_<exelotl> ahhh the desire for cyclic dependencies has really pierced a gaping hole in my engine plans
22:33:15FromGitter<malkomalko> thank you
22:34:19FromGitter<mratsim> func is just sugar for proc {.noSideEffect.} though it might get new stuff in the future regarding purity/memory safety or something
22:35:51FromGitter<malkomalko> Yup, I was just trying to poke around in the source. I'm watching an older video on oreilly with our very own Araq
22:36:35FromGitter<mratsim> If you want to own Araq I’m pretty sure there is a lifetime issue
22:37:47FromGitter<malkomalko> Yahtze!
22:50:38FromGitter<zacharycarter> can anyone suggest some good reading material on the whole push / deepCopy stuff regarding ownership semantics - I think I understand the basics of RAII now - but there is a lot in the blog post about destructors that I still don't quite understand
22:51:31Araqhmm well in a nutshell, you take the whole object graph and copy it over to the other thread's heap
22:51:34FromGitter<zacharycarter> I'm assuming it all ties together somehow - I get that RAII allows you to initialize and then free up resources once something goes out of scope - but I'm still not quite sure how it all plays into parallelism and dealing with Nim's memory model & default GC
22:52:15FromGitter<zacharycarter> okay - do you just do this on thread creation? and then keep it updated?
22:52:37FromGitter<zacharycarter> btw - these are going to be very dumb questions
22:52:41FromGitter<zacharycarter> haha - just forewarning you
22:53:14AraqI don't think you know what "dumb questions" are :P
22:53:23FromGitter<zacharycarter> :) that makes me feel better
22:54:51*BitPuffin quit (Remote host closed the connection)
22:55:24FromGitter<zacharycarter> is this what copying the object graph is basically? - https://www.justsoftwaresolutions.co.uk/threading/thread-safe-copy-constructors.html
22:55:46FromGitter<zacharycarter> I'm looking at the last section - where he's describes what he's doing as forwarding constructors
22:56:22FromGitter<zacharycarter> I'd essentially need to replicate this kind of thing?
22:56:28*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:56:53Araqnah, I don't think so
22:57:08FromGitter<zacharycarter> ah okay
22:57:20Araqwhat destructors and moves and assignments give us are the building blocks for atomicPtr and uniquePtr
22:57:48Araq'ref' most probably will stay with the current thread-local tracing sematics (allows cycles)
22:58:23Araq'string' and 'seq' are getting a hidden "allocator" thing that can be set to "allocate from the shared heap"
22:58:51*anamok quit (Ping timeout: 252 seconds)
22:58:57Araqeffectively turning Nim into a "shared heap" language
22:59:02*shpx joined #nim
22:59:41Araqthat covers the memory management aspects, then you still need to cover the application/library level concurrency/parallelism
23:00:14FromGitter<zacharycarter> well - tbh - my lack of understanding in the former is greatly contributing to my frustration with the latter
23:00:32Araqand my favourite still is locking via Nim's lock levels and '.guard' annotations for this but many will prefer some Go-like channel thing
23:00:43FromGitter<zacharycarter> but I think your explanation above - and connecting the dots so to speak - is going to help me greatly
23:01:08FromGitter<zacharycarter> not having a computing background kills me in these regards
23:01:21FromGitter<zacharycarter> but when I can kind of see how keywords are related to one another
23:01:34FromGitter<zacharycarter> it helps me progress down a study path for gaining understanding
23:01:38Araqand here destructors shine yet again, the channels can be closed automatically when they go out of scope
23:01:51FromGitter<zacharycarter> when I just am jostling a bunch of terms around - I have no idea wtf I'm doing
23:02:20*SenasOzys joined #nim
23:02:33FromGitter<zacharycarter> yeah - destructors and RAII seem very powerful - I have written very small programs / games in C++ - but C++ is also why I failed out of high school comp sci
23:02:57FromGitter<zacharycarter> and then when I tried to double down - got a 2 on the university placement exam out of 5 - which garnered me zero credit :P
23:03:23*SenasOzys quit (Remote host closed the connection)
23:03:25Araqin the pre-destructor Nim these problems were essentially unsolvable IMO and that's why Nim pretty much still sucks at these things
23:03:29FromGitter<zacharycarter> some of this stuff is definitely starting to click for me though - so thank you for your continued explanations
23:04:00FromGitter<zacharycarter> well - it's very cool to see a way being figured out - even if I can't understand it through appreciation
23:04:11FromGitter<zacharycarter> I do get that these things are there with C++ and Rust and other languages
23:04:19FromGitter<zacharycarter> I also realize that like - Haskell for instance - has nothing comparable
23:04:41FromGitter<zacharycarter> and based on the article I read today - any language with a non-deterministic GC doesn't really have this either
23:04:51FromGitter<zacharycarter> and most of the programmers I work with - fail to free anything really
23:05:00*amk quit (Remote host closed the connection)
23:05:03Araqso yeah, it's not just the docs that suck here, without the destructors/sinks we were stuck in a local optimum
23:05:21*amk joined #nim
23:05:39FromGitter<zacharycarter> well - I will contribute as much as I can to the docs if I can wrangle these concepts
23:06:06FromGitter<zacharycarter> because I need to get a grip on them in order to do what I want to do with Nim
23:06:24FromGitter<zacharycarter> which is the only language I really feel like doing this in tbh
23:06:34Araqhe he
23:06:55Araqhttps://github.com/nim-lang/Nim/issues/9263 I'm looking at this, exciting times, is my spec wrong or only the implementation...
23:08:04*SenasOzys joined #nim
23:08:43*anamok joined #nim
23:09:39FromGitter<zacharycarter> okay - I am starting to see how sinks play into things - it takes so long for it to click into my head that this what I read when I read the rust docs - or at least the concepts are analogous
23:10:03FromGitter<zacharycarter> and yes - this doesn't seem like it's fun to debug along with everything else that already is going on with the language
23:10:15FromGitter<zacharycarter> I imagine it's like maintaining two languages at once in a sense
23:10:19Araqno, it is fun
23:10:39FromGitter<zacharycarter> well - I just mean all the upkeep
23:10:39Araq:-)
23:10:51FromGitter<zacharycarter> I know the research and toying and playing is fun
23:11:04FromDiscord_<treeform> Hmm can I put a some command in "config.nims" that works kind of like 'nimble develop' which forces a packadge to come from a directory.
23:11:18FromDiscord_<treeform> I guess kind of like adding stuff to PYTHONPATH works in pythong?
23:11:31FromGitter<zacharycarter> it'd be great though - if you could be freed up to do most of that and then have other responsibilities lifted off of your plate - but I don't know how that balance works today anyway
23:11:32Araqtreeform --path option
23:11:53FromGitter<zacharycarter> oh - I want to ask a kind of related question
23:13:00FromGitter<zacharycarter> https://github.com/zacharycarter/frag/blob/master/src/frag.nim - here I have some templates and macros to basically allow me to import modules at compile time that exist in a subdirectory
23:13:48FromGitter<zacharycarter> I found this project someone was working on called tart - and forked it and got it working with 0.18.1 - but the project has a lot of neat ideas I'd like to further explore / keep if possible
23:14:00FromGitter<zacharycarter> one is providing hooks that get implemented inside modules
23:14:30FromGitter<zacharycarter> but I'm finding that if I want to have a local example modules folder - I need to provide relative paths - which looks really ugly
23:14:44FromGitter<zacharycarter> like here - https://github.com/zacharycarter/frag/blob/master/modules/game.nim
23:15:31FromGitter<zacharycarter> the original author didn't seem to have this problem - https://github.com/sheosi/tart/blob/master/modules/testGame.nim
23:15:41FromGitter<zacharycarter> but I have no idea why his setup works and mine doesn't
23:15:56FromGitter<zacharycarter> I'm wondering if it's because he has his lib installed
23:15:57*wildlander quit (Quit: Konversation terminated!)
23:16:05Araq--path command line option
23:16:28FromGitter<zacharycarter> ah - okay - yeah I can make that work
23:16:32FromGitter<zacharycarter> thank you
23:16:47FromDiscord_<treeform> Araq, does not appear that --path works the way I want. I added `--path:"/p/andrelytics/chrono/"` where chrono.nim lives, but its still says "Error: cannot open file: chrono"
23:17:17Araqtreeform: The compiler tells you what config files it reads
23:17:27*amk quit (Quit: Leaving)
23:19:05FromDiscord_<treeform> Araq, thanks it was the wrong file, I got it to work now!
23:19:08FromDiscord_<treeform> you are the best
23:19:51Araqthe compiler often gets blamed for its verbosity but it helps
23:24:36*SenasOzys quit (Read error: Connection reset by peer)
23:24:48*SenasOzys joined #nim
23:27:39FromDiscord_<treeform> I been writing nim code 90% of the time for about 6 months now its great. Thank you!
23:31:59*shpx quit (Read error: Connection reset by peer)
23:35:40Araqha, these are always the best comments, thanks :-)
23:46:10FromDiscord_<treeform> Araq, I would like to fix this JS issue, but I am not sure how you want to handle the fix? https://github.com/nim-lang/Nim/issues/8367
23:50:28*runvnc quit (Quit: Lost terminal)
23:59:01*anamok quit (Ping timeout: 246 seconds)
23:59:06*darithorn quit ()