<< 29-11-2020 >>

00:03:00FromDiscord<iWonderAboutTuatara> I see
00:03:01FromDiscord<iWonderAboutTuatara> thanks!
00:09:24*hmmm quit ()
00:14:43*wiml joined #nim
00:31:07*krux02 quit (Remote host closed the connection)
00:33:35FromDiscord<notchris> If I have an enum of the type NamedColor, how can i use it as an int
00:33:58FromDiscord<notchris> i have a procedure that expects an int, but i wanted to pass in an enum which represents the int
00:35:06FromDiscord<notchris> ohh I do ord(), sorry!
00:42:07FromDiscord<notchris> @iWonderAboutTuatara you have to build raylib to generate the so, or use homebrew, get the raylib cask
00:42:18FromDiscord<ElegantBeef> Chris i've got to ask as i'm interested, did you do the hint thing yet?
00:42:21FromDiscord<notchris> For raygui, its more difficult since its not built into raylib by default
00:42:32*wiml quit (Ping timeout: 260 seconds)
00:42:33FromDiscord<iWonderAboutTuatara> Oh is it a seperate process for raygui?
00:42:47FromDiscord<notchris> Wow good timing @ElegantBeef I was about to do that
00:42:53FromDiscord<notchris> have it open now lmao
00:43:03FromDiscord<ElegantBeef> Ah, i'm just interested in seeing if it works
00:43:20FromDiscord<notchris> @iWonderAboutTuatara if youre on osx, its like 1 or two more steps, it was annoying though, i have it working on osx latest
00:43:37FromDiscord<ElegantBeef> I'm uncertain if they're on macos, but it should be similar for linux
00:43:49FromDiscord<iWonderAboutTuatara> I'm on Linux which should be similar
00:43:51FromDiscord<iWonderAboutTuatara> Yeah
00:44:08FromDiscord<iWonderAboutTuatara> I don't think we have brew in Linux?
00:44:10FromDiscord<iWonderAboutTuatara> Not sure
00:44:12FromDiscord<iWonderAboutTuatara> Might be in apt
00:44:18FromDiscord<ElegantBeef> We do, but it's just a package manager
00:44:28FromDiscord<notchris> The only thing to watch out for id say
00:44:33FromDiscord<notchris> Is once you do install raylib
00:44:47FromDiscord<notchris> the so may be named differently than what the package is looking for, so you may need ot make a dlink
00:44:58FromDiscord<notchris> i think that happened to me
00:44:58FromDiscord<ElegantBeef> You dont want to install raylib, you want to dynamically link it afaik, so you can ship it
00:45:33FromDiscord<notchris> yeah sorry i used poor terminology
00:45:53FromDiscord<notchris> brb gonna grab a snapple
00:45:55FromDiscord<ElegantBeef> I suppose you could statically link it though, but seems like trouble when they didnt even know where to get the .so (no offence) 😄
00:46:21FromDiscord<notchris> in their defense, the build steps arent documented super well for multi os
00:47:52FromDiscord<notchris> btw I can confirm multiple issues with raygui still exist, mainly input /textbox stuff, the 2d/3d rendering was great though, was able to run multiple shaders and apply custom materials on objects etc
00:51:41FromDiscord<iWonderAboutTuatara> this is so confusing
00:51:44FromDiscord<iWonderAboutTuatara> I got a make error
00:51:53FromDiscord<iWonderAboutTuatara> sent a long message, see http://ix.io/2FRw
00:52:02FromDiscord<iWonderAboutTuatara> (edit) "long message," => "code paste," | "http://ix.io/2FRw" => "https://play.nim-lang.org/#ix=2FRx"
00:52:13FromDiscord<ElegantBeef> oh you're installing
00:52:24FromDiscord<iWonderAboutTuatara> oh I should sudo?
00:52:25FromDiscord<ElegantBeef> for that you need sudo to move it to the directory, but like i said you dont want to make install
00:52:28FromDiscord<iWonderAboutTuatara> or should I not install at all?
00:52:41FromDiscord<ElegantBeef> you want the dynamic shared library
00:52:50FromDiscord<iWonderAboutTuatara> how do I get that without installing?
00:53:02FromDiscord<ElegantBeef> I guess you can install it
00:53:15FromDiscord<ElegantBeef> Just need to ship it with the binary whenever you ship your application
00:53:20FromDiscord<notchris> @ElegantBeef this one, right? SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT
00:53:35FromDiscord<iWonderAboutTuatara> how do I do that?
00:53:43FromDiscord<iWonderAboutTuatara> just copy the folder it's installed to?
00:54:04FromDiscord<ElegantBeef> After installing `locate libraylib.so` and cp it from there next to your binary
00:54:17FromDiscord<ElegantBeef> @notchris `SDL_HINT_VIDEO_HIGHDPI_DISABLED`
00:54:36FromDiscord<notchris> Awesome, trying now
00:55:04FromDiscord<iWonderAboutTuatara> that should be fine right?
00:55:12FromDiscord<iWonderAboutTuatara> or is there a better way?
00:55:29FromDiscord<ElegantBeef> I mean i told you what i'd do, idk much about libraries though
00:55:41FromDiscord<iWonderAboutTuatara> I'm extremely new to this
00:55:41*wiml joined #nim
00:55:53FromDiscord<iWonderAboutTuatara> This kind of thing is quite a bit easier in python than C
00:56:02FromDiscord<iWonderAboutTuatara> so i have no idea what I'm doing
00:56:11FromDiscord<ElegantBeef> It's the exact same in python as in C
00:56:20FromDiscord<ElegantBeef> If you need a library, you have to build it and get the so
00:56:25FromDiscord<iWonderAboutTuatara> how would I dynamically link it?
00:56:31FromDiscord<iWonderAboutTuatara> In python everything is in pip
00:56:38FromDiscord<iWonderAboutTuatara> pip handles everything
00:56:47FromDiscord<ElegantBeef> ~~Uncertain if that's true~~
00:56:49*lmariscal quit (Quit: I'm Out!)
00:56:53FromDiscord<ElegantBeef> Just copy it next to the binary when you ship it
00:57:07FromDiscord<ElegantBeef> After you install it, the .so will be in your search path so should work
00:57:21FromDiscord<iWonderAboutTuatara> just `locate libraylib.so` and cp it?
00:57:33FromDiscord<iWonderAboutTuatara> Got it
00:57:35FromDiscord<iWonderAboutTuatara> that's not bad at all
00:57:36FromDiscord<iWonderAboutTuatara> thanks!
00:57:39FromDiscord<ElegantBeef> np
00:58:04FromDiscord<ElegantBeef> Though like i said you might be able to statically link it, but i'm uncertain how to do that
00:58:27FromDiscord<iWonderAboutTuatara> How would I locate it?
00:58:27FromDiscord<ElegantBeef> Which means the so would be included in the binary, so it's actually "dependancy less"
00:58:36FromDiscord<ElegantBeef> locate is a command
00:58:42FromDiscord<iWonderAboutTuatara> I don't necessarily need it to be dependany less
00:58:45FromDiscord<iWonderAboutTuatara> oh do I need to install it?
00:58:50FromDiscord<iWonderAboutTuatara> Ubuntu doesn't seem to recognize
00:58:52FromDiscord<ElegantBeef> I mean it's installed on my system
00:58:58FromDiscord<ElegantBeef> I'm un an ubuntu derived
00:59:03FromDiscord<iWonderAboutTuatara> there's an apt package called mlocate apparently
00:59:07FromDiscord<iWonderAboutTuatara> might be installed by default
00:59:12FromDiscord<iWonderAboutTuatara> are you on popos?
00:59:17FromDiscord<ElegantBeef> No regolith
00:59:23FromDiscord<iWonderAboutTuatara> never heard of it
00:59:36FromDiscord<ElegantBeef> @notchris i dont like that i dont hear a celebratory hoorah
00:59:48FromDiscord<ElegantBeef> It's just ubuntu with i3wm-gaps and gnome intergration
01:00:10FromDiscord<ElegantBeef> So gtk applications use an easy to customize colour theme and i can use gnome settings to control my system
01:00:26FromDiscord<iWonderAboutTuatara> looks super nice actually
01:01:55FromDiscord<notchris> haha @ElegantBeef so far im testing on 800x600
01:02:02FromDiscord<notchris> toggling that flag yields...
01:02:06FromDiscord<notchris> https://media.discordapp.net/attachments/371759389889003532/782411027375456286/Screen_Shot_2020-11-28_at_8.01.27_PM.png
01:02:12FromDiscord<ElegantBeef> In theory it should now be a 800x600 px window
01:02:23FromDiscord<notchris> so 1/4 the size
01:02:27FromDiscord<ElegantBeef> yea
01:02:44FromDiscord<notchris> hmm
01:02:53FromDiscord<ElegantBeef> Which it seems it is, no?
01:03:13FromDiscord<notchris> It does, but the window would also need to factor that in
01:03:20FromDiscord<ElegantBeef> I'd say try with nico
01:03:28FromDiscord<ElegantBeef> It has that whole scale image to window size
01:03:35FromDiscord<notchris> well im trying this on a vanilla sdl2 project
01:03:40FromDiscord<notchris> because on nico, we're using opengl renderer
01:03:43FromDiscord<notchris> so we can use shaders
01:03:54FromDiscord<ElegantBeef> It's not on by default though iirc
01:04:04FromDiscord<notchris> I think it is
01:04:22FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/782411601227677736/unknown.png
01:04:25FromDiscord<notchris> Err, you're right its off
01:04:31FromDiscord<notchris> oh you mean opengl being off?
01:04:35FromDiscord<ElegantBeef> yea
01:04:40FromDiscord<notchris> yeah we had to enable opengl
01:04:41FromDiscord<JSGRANT> Would there be any point in trying to get "idiomatic 'dear imgui' bindings" for Nim -- or does it map close enough as-is via cimgui? Haven't messed with imgui in-general but just recently saw https://github.com/hoffstadt/DearPyGui and it seemed very nice to use. (Know there are some pretty-straight bindings out there for Nim -- just don't know how idiomatic it feels with no context lol)
01:04:52FromDiscord<notchris> you pass a flag in the compilation to enable opengl for nico
01:05:07FromDiscord<notchris> which isnt in the docs
01:05:13FromDiscord<notchris> iirc
01:05:15FromDiscord<ElegantBeef> I mean imgui is immeditate GUI, so even idiomatic it should be.... identical
01:05:17FromDiscord<ElegantBeef> Yea i know that
01:05:20*lmariscal joined #nim
01:05:32FromDiscord<ElegantBeef> I did show where it imports opengl, so i'd hope i know how to enable it 😛
01:05:42FromDiscord<iWonderAboutTuatara> apparently mlocate takes >20 minutes to install on windows
01:05:44FromDiscord<iWonderAboutTuatara> so that's fun
01:05:44FromDiscord<notchris> lmao
01:05:49FromDiscord<notchris> that was you, wasn't it @ElegantBeef
01:06:00FromDiscord<ElegantBeef> @JSGRANT how do you suggest nimdiomatic IMGUI
01:06:28FromDiscord<ElegantBeef> I mean it's in `/usr/local/lib/`
01:06:54FromDiscord<ElegantBeef> Just locate atleast on linux isnt too long to install and works quickly
01:08:05FromDiscord<ElegantBeef> Uh oh exelotl is here to call me out 😄
01:08:52FromDiscord<JSGRANT> @ElegantBeef I mean I don't know the api in-general and/or really at-all; To make any suggestions -- just find it weird that such an attempt in Python is "that popular" but it may just be ... because it doesn't nicely map via Python so there is more concious effort needed so more attiention / focus there generally
01:09:04FromDiscord<exelotl> I was about to change the topic completely lol
01:09:19FromDiscord<ElegantBeef> imgui is a lot of `if button: #doThing here`
01:09:47FromDiscord<ElegantBeef> It's a very declarative UI method
01:10:22FromDiscord<ElegantBeef> Impbox has his own imgui implemented for nico you could look at for a nim example of an imgui https://github.com/ftsf/nico/blob/master/examples/gui.nim#L21
01:10:27FromDiscord<exelotl> re: my question the other day about getting the number of values in an `enum` - is there a better way to get a full set than `{T.low .. T.high}` ?
01:11:22FromDiscord<JSGRANT> @ElegantBeef Oh wow, yeah that's pretty simple & clean
01:11:27FromDiscord<ElegantBeef> I think that'd be the cleanest method exelotl
01:11:50FromDiscord<ElegantBeef> You could do something silly where you figureout the size you need and just write that many bytes as `0xff`
01:12:00FromDiscord<ElegantBeef> Since "all" is just the entire bitset enabled
01:12:24FromDiscord<exelotl> hehe, yeah could do that, but I guess there's no point
01:12:45FromDiscord<ElegantBeef> exelotl you sometimes worry about weird things 😛
01:12:58FromDiscord<ElegantBeef> ~~Guess that's why you're making a GBA game in 2020~~
01:13:39FromDiscord<exelotl> I want to rewrite this file to be pure Nim https://github.com/exelotl/natu/blob/master/natu/private/input.nim :P
01:14:01FromDiscord<ElegantBeef> ah
01:15:06FromDiscord<exelotl> the funny thing is, the original C module had an enum-like thing going (KI_A = 1, KI_B = 2, etc.)
01:15:13FromDiscord<exelotl> I didn't know about Nim sets at the time
01:15:31FromDiscord<exelotl> I looked at it and thought "what's the point in that" and got rid of it xD
01:15:47FromDiscord<ElegantBeef> @JSGRANT obviously though you could use macros/templates to make it a bit less redundant, but for the most part imgui already pretty idiomatic, although i think the dear imgui due to interoping to C++(C?) does do some things a little weird
01:17:09FromDiscord<ElegantBeef> I assume the tonc.h is just a basic input manager file
01:18:04FromDiscord<JSGRANT> Wonder if there are any notable "pure nim immediate-mode guis" floating around; Seems like a neat project
01:18:32FromDiscord<ElegantBeef> The one i just showed you was 😛
01:19:38FromDiscord<ElegantBeef> Seems like atleast on github no one is embarking on that
01:19:38FromDiscord<JSGRANT> @ElegantBeef Oh, that's a seperate immediate-mode gui ; Which name just happens to be imgui ...? lol
01:19:50FromDiscord<ElegantBeef> imgui... is just immediate mode gui
01:20:04FromDiscord<ElegantBeef> i hate that dearimgui is the default "imgui" people think of
01:20:43FromDiscord<exelotl> wait there a library that's just called imgui? xD
01:20:48*mbomba joined #nim
01:20:50FromDiscord<exelotl> there isn't
01:21:06FromDiscord<ElegantBeef> https://github.com/ocornut/imgui
01:21:13FromDiscord<JSGRANT> Isn't Dear Imgui a rename or something?
01:21:19FromDiscord<ElegantBeef> the repo is imgui, but dearimgui is the name of it now
01:21:34FromDiscord<JSGRANT> Yeah, was going to say
01:21:35FromDiscord<ElegantBeef> It's a horrid case of the name being what it is, so it just confusues people
01:22:19FromDiscord<JSGRANT> Probably for like 3/4th of people aware of it equivicate the concept and that "shorthand"
01:22:20FromDiscord<ElegantBeef> not all imguis are imgui but imgui is an imgui
01:23:01FromDiscord<ElegantBeef> This is why nuklear is cool 😄
01:23:16FromDiscord<JSGRANT> Is nuklear the C one?
01:23:20FromDiscord<notchris> all of the nuklear builds for me have faildd
01:23:22FromDiscord<ElegantBeef> It has a name that's not ambigious
01:23:23FromDiscord<ElegantBeef> Yea
01:23:40FromDiscord<ElegantBeef> I have never used nuklear, have use the nimgl imgui bidnings and they're pretty nice
01:24:00FromDiscord<ElegantBeef> Think zachary did the wrapper for nuklear and they're a bit outdated iirc
01:24:02FromDiscord<ElegantBeef> or rely on bgfx
01:24:04FromDiscord<ElegantBeef> dont recall 😛
01:24:40FromDiscord<JSGRANT> _still sorta-kinda wants to try to replace his stream setup with immediate-mode graphics ... to get away from all this freaking web-tech / widget bloat and has been loosely looking at options. Are there any other biggens besides Dear Imgui & Nuklear to look out for?_
01:24:56FromDiscord<ElegantBeef> You could try nimx/fidget instead 😄
01:25:24FromDiscord<Daniel> https://github.com/Immediate-Mode-UI/Nuklear
01:25:43FromDiscord<Daniel> Yea, go with fidget, it uses Figma drag and drop gui builder.
01:25:45FromDiscord<ElegantBeef> They arent imgui's but they're gui frameworks
01:26:00FromDiscord<JSGRANT> Is Fidget themeable? Haven't really messed with it
01:26:08FromDiscord<ElegantBeef> I've honestly never used the figma editor, which probably causes treeform an anyuerism
01:26:13FromDiscord<ElegantBeef> You'd have to make the theming yourself
01:26:45FromDiscord<JSGRANT> Yeah, not too interested in the wysiwug styled editor / builder for guis
01:27:43FromDiscord<JSGRANT> Does this basically entail CSS I'm guessing?
01:27:51FromDiscord<ElegantBeef> Well whatever you want
01:27:57FromDiscord<ElegantBeef> You could use nimscript to theme it if you so wished
01:28:10FromDiscord<ElegantBeef> Got my moe fork doing just that for reference
01:29:34FromDiscord<ElegantBeef> It is as simple as passing in a hexcolour into `fill`
01:29:39FromDiscord<ElegantBeef> For fidget that is
01:29:41FromDiscord<JSGRANT> Will need to look into my options more; Really want to get "something" going by mid next-year. I was considering an immediate-mode gui more-so with the intention I could run some sort of shader in the gaps behind it or something for a visual boost
01:30:22FromDiscord<ElegantBeef> Well fidget does use shaders to render
01:30:28FromDiscord<JSGRANT> Right now, all the streamlab widgets use a disgusting amount of resources on this budget workstaiton computer
01:30:33*a_chou joined #nim
01:30:58FromDiscord<JSGRANT> And want to start actually streaming once-a-week next year doing somesort of gamedev; Godot (x Nim) or otherwise
01:31:45FromDiscord<ElegantBeef> Just be like pmunch and program things to make your stream/life better whilst streaming
01:34:04FromDiscord<JSGRANT> @ElegantBeef Also yeah, I'll def look into it; I just have VERY LIMITED knowledge in this domain -- the most I've ever done via a 'real gui' was a few GTK apps like a decade ago (which btw, Ginto looks like a decent option generally ... probably not for this though).
01:34:26FromDiscord<JSGRANT> @ElegantBeef Honestly that's probably the way to go; Just perma-dogfood it.
01:35:01FromDiscord<ElegantBeef> I also have 0 knowledge here 😛
01:35:08*lritter quit (Ping timeout: 272 seconds)
01:35:32FromDiscord<ElegantBeef> I want to make a text editor so i have tried fidget/nimx for those, but i'm just questioning if i should attempt to
01:36:08FromDiscord<JSGRANT> @ElegantBeef Make a text-editor ... with a gui scenebuillder for fidget in fidget lol
01:36:19FromDiscord<JSGRANT> fidgma
01:36:31FromDiscord<iWonderAboutTuatara> so I've built it and libraylib.so to the same folder as the file
01:36:52FromDiscord<iWonderAboutTuatara> but the compile still fails with the same error
01:36:55FromDiscord<iWonderAboutTuatara> any idea why/
01:37:21FromDiscord<ElegantBeef> I mean the text editor i want to make is more akin to like a Vim + tmux, but a gui rendered editor, with easy splits/movement between windows
01:37:32FromDiscord<ElegantBeef> so it's next to the binary?
01:38:09FromDiscord<iWonderAboutTuatara> yeah
01:38:29FromDiscord<JSGRANT> @ElegantBeef So a non-gross https://onivim.io/ ? lol
01:38:34FromDiscord<ElegantBeef> Well i'm uncertain why it's not working
01:39:02FromDiscord<ElegantBeef> Sorta
01:39:13FromDiscord<JSGRANT> I'd want something closer to https://github.com/rxi/lite tbh
01:39:18FromDiscord<iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782420388105814056/unknown.png
01:39:37FromDiscord<iWonderAboutTuatara> `could not load: libraylib.so↵(compile with -d:nimDebugDlOpen for more information)↵Error: execution of an external program failed: '/mnt/d/Scripts/Misc/Nim/Nim/nim-chess/chess '`
01:40:20FromDiscord<ElegantBeef> Yea i mean it'd be similar to vscode or sublime, just with more a tiling window manager feel
01:40:56FromDiscord<ElegantBeef> I figure i could have "widgets" which are just nimscript files, but considering i dont even have way to render text little far
01:41:30*pietroppeter quit (Quit: Connection closed for inactivity)
01:43:05FromDiscord<iWonderAboutTuatara> any idea what I should do to try to fix it?
01:43:21FromDiscord<iWonderAboutTuatara> I don't think I've explicitly told the compiler to load libraylib.so
01:43:32FromGitter<matrixbot> `Benjamin` I'm planning to use fidget to make a simple markdown editor with live preview, but I'm still slowly checking fidget out to see if it's at all viable.
01:43:58FromDiscord<Rebel> I mean you can check if that file even exists first....
01:44:01FromDiscord<Rebel> `find / -name libraylib.so`
01:46:22FromDiscord<iWonderAboutTuatara> it's in the same directory
01:46:33FromDiscord<iWonderAboutTuatara> it's right next to the .nim file actually
01:50:47*a_chou quit (Remote host closed the connection)
02:01:03FromDiscord<Rebel> Ok I may or may not be blind lol
02:01:17FromDiscord<iWonderAboutTuatara> lol
02:02:27FromDiscord<Rebel> And you did google the error right?
02:02:31FromDiscord<Rebel> You did try this right?
02:02:32FromDiscord<Rebel> https://github.com/raysan5/raylib/issues/706
02:02:32disbot[build] Cannot find libraylib.so.2
02:02:57FromDiscord<iWonderAboutTuatara> I don't think this quite applies here because I don't have .2 or .301 there
02:03:05*hsh quit (Quit: Connection closed for inactivity)
02:03:22FromDiscord<Rebel> If you move the so file to `/usr/local/lib` does it work?
02:03:42FromDiscord<iWonderAboutTuatara> I odn't tihnk I've tried that
02:03:54FromDiscord<iWonderAboutTuatara> i will try
02:03:56FromDiscord<iWonderAboutTuatara> lets see
02:04:55wimlHey all, the compiler gives a handful of [ObservableStores] warnings on my code (lots of async procs). Is there a good writeup or resource somewhere for what problems this can cause and the best ways to deal with them?
02:05:40FromDiscord<iWonderAboutTuatara> I stilll get the error could not load libraylib.so
02:06:22FromDiscord<Rebel> Did you compile with the extra flag for more information? As well as maybe `--verbosity:3`?
02:07:00FromDiscord<iWonderAboutTuatara> I will try that now
02:07:05FromDiscord<iWonderAboutTuatara> I've never heard of the extra flag
02:07:25FromDiscord<Rebel> `(compile with -d:nimDebugDlOpen for more information)`
02:07:25FromDiscord<iWonderAboutTuatara> could not load: libraylib.so↵(compile with -d:nimDebugDlOpen for more information)↵Error: execution of an external program failed: '/mnt/d/Scripts/Misc/Nim/Nim/nim-chess/chess '↵/home/runner/work/nightlies/nightlies/nim-1.4.0/compiler/extccomp.nim(398, 15) compiler msg initiated here [MsgOrigin]
02:08:07FromDiscord<iWonderAboutTuatara> it does't give me any more information
02:08:14FromDiscord<Rebel> oh maybe try moving it here lol `/usr/lib/local`
02:08:17FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2FS4
02:11:52FromDiscord<iWonderAboutTuatara> really weird
02:13:42FromDiscord<iWonderAboutTuatara> any ideas?
02:13:52FromDiscord<iWonderAboutTuatara> oh try moving the script to usrliblocal?
02:16:54FromDiscord<iWonderAboutTuatara> that didn't work
02:17:08FromDiscord<iWonderAboutTuatara> after compiling with sudo I get the same error
02:19:12FromDiscord<Rebel> Idk just keep googling I doubt you are the only person to ever come across this error could also check github issues and see if someone else had the same issue.
02:20:41FromDiscord<notchris> @iWonderAboutTuatara so libraylib.so is in usr/local/lib ?
02:21:02*apahl quit (Ping timeout: 264 seconds)
02:21:03FromDiscord<notchris> or w/e on linux
02:22:40*apahl joined #nim
02:24:34FromDiscord<iWonderAboutTuatara> yeah
02:24:44FromDiscord<iWonderAboutTuatara> usr/local/lib
02:25:14FromDiscord<notchris> and its called libraylib.so
02:25:15FromDiscord<notchris> ?
02:25:53FromDiscord<iWonderAboutTuatara> yes
02:26:10FromDiscord<iWonderAboutTuatara> in ls it showsup as libraylib.so@ but the file itse'f is called libraylib.so
02:26:40FromDiscord<ElegantBeef> What bindings are you using?
02:26:56FromDiscord<iWonderAboutTuatara> !repo raylib-forever
02:26:57disbothttps://github.com/Ryan1729/nim-raylib-forever-raylib-audio-bug -- 9nim-raylib-forever-raylib-audio-bug: 11 15 0⭐ 0🍴
02:27:03FromDiscord<iWonderAboutTuatara> nevermind
02:27:12FromDiscord<iWonderAboutTuatara> Raylib Forever by Guevara chan
02:27:18FromDiscord<iWonderAboutTuatara> https://github.com/Guevara-chan/Raylib-Forever
02:27:43FromDiscord<notchris> im using those on osx, no issue
02:28:09FromDiscord<iWonderAboutTuatara> it's completely possible that I'm doing something wrong
02:28:09FromDiscord<notchris> @iWonderAboutTuatara whats the result of `test -f "user/local/lib/libraylib.so"`
02:28:31FromDiscord<iWonderAboutTuatara> nothign
02:28:42FromDiscord<iWonderAboutTuatara> just makes a new line in terminal
02:29:45FromDiscord<notchris> oops
02:29:48FromDiscord<notchris> `test -f user/local/lib/libraylib.so && echo "exists."`
02:30:12FromDiscord<iWonderAboutTuatara> still an empty line
02:30:13FromDiscord<iWonderAboutTuatara> weird
02:30:38FromDiscord<iWonderAboutTuatara> ah no it exists
02:30:50FromDiscord<iWonderAboutTuatara> I had to adapt the syntax a little but it echos exists
02:30:56FromDiscord<iWonderAboutTuatara> test -f /usr/local/lib/libraylib.so && echo "exists"
02:31:02FromDiscord<iWonderAboutTuatara> (edit) "test" => "`test" | ""exists"" => ""exists"`"
02:32:19FromDiscord<notchris> @iWonderAboutTuatara sorry i goofed
02:32:22FromDiscord<notchris> thats not right
02:32:35FromDiscord<notchris> you want `test -f user/local/lib/libraylib.so`
02:32:43FromDiscord<iWonderAboutTuatara> user?
02:32:45FromDiscord<notchris> then do
02:32:48FromDiscord<iWonderAboutTuatara> on linux it's usr I think
02:32:50FromDiscord<notchris> right
02:32:57FromDiscord<notchris> then `eho $?`
02:32:59FromDiscord<notchris> echo
02:32:59FromDiscord<iWonderAboutTuatara> but that did echo "exists"
02:33:20FromDiscord<iWonderAboutTuatara> says that it expected the name of a variable
02:33:32FromDiscord<notchris> ok from the start, im sorry that was messy
02:33:47FromDiscord<iWonderAboutTuatara> no issue lol
02:33:52FromDiscord<notchris> `test -f usr/local/lib/libraylib.so`
02:33:57FromDiscord<notchris> then
02:34:02FromDiscord<notchris> `echo $?`
02:34:08FromDiscord<notchris> it should be 0 for not found, 1 for found
02:34:16FromDiscord<notchris> as the result
02:34:51FromDiscord<notchris> https://media.discordapp.net/attachments/371759389889003532/782434367006834688/Screen_Shot_2020-11-28_at_9.34.41_PM.png
02:34:55FromDiscord<iWonderAboutTuatara> 0
02:35:04FromDiscord<notchris> right, so it cant find the file
02:35:07FromDiscord<iWonderAboutTuatara> weird
02:35:21FromDiscord<notchris> you said the file was a dynamic link righ
02:35:28FromDiscord<notchris> can you find the source
02:35:34FromDiscord<iWonderAboutTuatara> possibly?
02:35:41FromDiscord<iWonderAboutTuatara> I'm not really a unix person so idk how all this wokrs
02:35:43FromDiscord<notchris> right click on your current so
02:35:50FromDiscord<notchris> see if it says like show original or something
02:35:59FromDiscord<iWonderAboutTuatara> 8 https://media.discordapp.net/attachments/371759389889003532/782434655076483082/unknown.png
02:36:10FromDiscord<notchris> ok thats ur prob
02:36:14FromDiscord<notchris> copy the one that says
02:36:16FromDiscord<iWonderAboutTuatara> I'm using WSL meaning I have no gui
02:36:19FromDiscord<notchris> .3.0.0
02:36:21FromDiscord<notchris> or w/e
02:36:27FromDiscord<notchris> and rename it so libraylib.so
02:36:33FromDiscord<iWonderAboutTuatara> .3.0.0 or .301?
02:37:10FromDiscord<iWonderAboutTuatara> weirdly, it says they're the same file
02:37:11FromDiscord<notchris> copy libraylib.so.3.0.0
02:37:26FromDiscord<iWonderAboutTuatara> for both of them
02:37:51FromDiscord<notchris> https://media.discordapp.net/attachments/371759389889003532/782435122631671828/Screen_Shot_2020-11-28_at_9.34.41_PM.png
02:37:54FromDiscord<notchris> oops
02:38:02FromDiscord<notchris> https://media.discordapp.net/attachments/371759389889003532/782435172011212820/Screen_Shot_2020-11-28_at_9.37.42_PM.png
02:38:07FromDiscord<notchris> the white one, copy it
02:38:12FromDiscord<notchris> rename is libraylib.so
02:38:20FromDiscord<notchris> (edit) "is" => "it"
02:38:20FromDiscord<iWonderAboutTuatara> right, it tells me they're the same file
02:38:37FromDiscord<iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782435318019653682/unknown.png
02:38:40FromDiscord<notchris> then rename the one with the @ to something else for a second
02:38:48FromDiscord<notchris> then try to copy the other one
02:38:50FromDiscord<notchris> and rename it
02:39:03FromDiscord<notchris> or
02:39:11FromDiscord<notchris> change the line in your raylib.nim
02:39:18FromDiscord<notchris> to point to libraylib.so.3.0.0
02:39:25FromDiscord<iWonderAboutTuatara> oh
02:39:41FromDiscord<iWonderAboutTuatara> I just moved libraylib.so to libraylib2.so
02:39:48FromDiscord<notchris> k
02:39:52FromDiscord<iWonderAboutTuatara> and copied 3.0.0 to .so
02:39:55FromDiscord<notchris> nicee
02:40:07FromDiscord<notchris> now make sure u remove ur nim apps binary and then re-run
02:40:37FromDiscord<iWonderAboutTuatara> I still get the same error
02:41:17FromDiscord<notchris> take a pic of the dir files
02:41:27FromDiscord<notchris> now that youve renamed
02:41:31FromDiscord<iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782436040933376070/unknown.png
02:42:00FromDiscord<notchris> why is is u/l/lib
02:42:03FromDiscord<notchris> does it just truncate the names
02:42:11FromDiscord<iWonderAboutTuatara> in the display yeah
02:42:16FromDiscord<notchris> gotcha
02:43:40FromDiscord<notchris> hmm
02:43:44FromDiscord<notchris> wait are those all in a cmake dir
02:43:51FromDiscord<notchris> not in usr/local/lib/cmake
02:44:06FromDiscord<notchris> or is that in the same dir
02:44:17FromDiscord<notchris> yeah nm
02:44:21FromDiscord<iWonderAboutTuatara> no it's just in the same dir yeah
02:44:31FromDiscord<iWonderAboutTuatara> it shares a dir with /cmake
02:45:13FromDiscord<notchris> try adding
02:45:20FromDiscord<notchris> `-d:nimDebugDlOpen` to your build command
02:45:41FromDiscord<notchris> maybe you can find out where its looking for the file
02:49:25FromDiscord<notchris> @Trustable
02:49:25FromDiscord<iWonderAboutTuatara> libraylib.so: cannot open shared object file: No such file or directory↵could not load: libraylib.so↵Error: execution of an external program failed: '/mnt/d/Scripts/Misc/Nim/Nim/nim-chess/chess '
02:49:28FromDiscord<notchris> oops
02:49:30FromDiscord<iWonderAboutTuatara> lmaooo
02:49:36FromDiscord<notchris> @iWonderAboutTuatara Maybe try this
02:49:39FromDiscord<notchris> in raylib.nim
02:49:45FromDiscord<notchris> https://media.discordapp.net/attachments/371759389889003532/782438117457133568/Screen_Shot_2020-11-28_at_9.49.18_PM.png
02:49:54FromDiscord<notchris> see how i added the path to the pragma
02:50:03FromDiscord<notchris> idk if thats standard, but it didn't break my proj
02:50:33FromDiscord<iWonderAboutTuatara> still failed
02:50:38FromDiscord<notchris> did you remove the binary
02:50:39FromDiscord<iWonderAboutTuatara> could not load: usr/local/lib/libraylib.so↵Error: execution of an external program failed: '/mnt/d/Scripts/Misc/Nim/Nim/nim-chess/chess '
02:50:42FromDiscord<iWonderAboutTuatara> but it updated
02:50:45FromDiscord<notchris> oh ok
02:50:46FromDiscord<notchris> hm
02:50:47FromDiscord<iWonderAboutTuatara> do you need to rm the bianary?
02:50:48FromDiscord<iWonderAboutTuatara> wil try that
02:50:58FromDiscord<iWonderAboutTuatara> could not load: usr/local/lib/libraylib.so↵Error: execution of an external program failed: '/mnt/d/Scripts/Misc/Nim/Nim/nim-chess/chess '
02:51:41FromDiscord<iWonderAboutTuatara> oh wait no that wa sjust be being dumb
02:51:48FromDiscord<iWonderAboutTuatara> it worked now
02:51:55FromDiscord<notchris> Wooooo
02:51:57FromDiscord<iWonderAboutTuatara> but it can't find raygui.so
02:52:00FromDiscord<notchris> correct
02:52:15FromDiscord<iWonderAboutTuatara> ok so that's intentional?
02:52:21FromDiscord<iWonderAboutTuatara> how do I get raygui.so?
02:52:22FromDiscord<notchris> https://github.com/raysan5/raygui
02:52:24FromDiscord<notchris> you have to build it
02:52:28FromDiscord<notchris> with like cmake
02:53:01FromDiscord<notchris> it was less easy for me than raylib on osx
02:53:06FromDiscord<notchris> hopefuly it wont be hard for you
02:54:23FromDiscord<iWonderAboutTuatara> oh and do the same thing with this
02:54:23FromDiscord<iWonderAboutTuatara> got it
02:54:25FromDiscord<iWonderAboutTuatara> thanks!
02:54:44FromDiscord<notchris> i think you want to build in `https://github.com/raysan5/raygui/tree/master/projects/CMake`
02:54:59FromDiscord<notchris> np good luck!
02:55:59FromDiscord<iWonderAboutTuatara> so when I distribute this, what do I do with libraylib.so?
02:56:05FromDiscord<iWonderAboutTuatara> also, how do I compile this for other platforms?
02:56:23FromDiscord<iWonderAboutTuatara> will it be built into the binaries?
02:56:56FromDiscord<iWonderAboutTuatara> by the way, I instead of using from /u/l/l I changed it to ./ so I just put libraylib.so next to the raylib.nim file
02:57:05FromDiscord<iWonderAboutTuatara> to make it easier to manage
02:57:09FromDiscord<notchris> nice
02:57:15FromDiscord<notchris> i cannot answer those questions
02:57:19FromDiscord<notchris> not experienced enough
02:57:32FromDiscord<notchris> but it seems like you should be able to compile
02:57:49FromDiscord<iWonderAboutTuatara> and the binary should hopefully work on other machines without too much fiddling?
02:58:08FromDiscord<notchris> My guess is yes, but i don't know exactly how it works
02:59:28FromDiscord<iWonderAboutTuatara> Thanksf or the help!
02:59:34FromDiscord<iWonderAboutTuatara> I guess I'll cross that bridge when I get to it
02:59:36FromDiscord<iWonderAboutTuatara> thank you!
02:59:46FromDiscord<notchris> haha np man, good luck and have fun
03:02:56FromDiscord<iWonderAboutTuatara> weirdly, removing the gui code then running doesn't spawn a window
03:03:15FromDiscord<notchris> you tested the basic example?
03:03:42FromDiscord<notchris> hmm
03:03:59FromDiscord<notchris> try this one https://github.com/Guevara-chan/Raylib-Forever/blob/master/examples/core/camera_2d.nim
03:10:24FromDiscord<iWonderAboutTuatara> still no
03:10:28FromDiscord<iWonderAboutTuatara> weird
03:11:38FromDiscord<iWonderAboutTuatara> seems to be a wsl issue
03:14:04FromDiscord<iWonderAboutTuatara> it's looking like I should just use native windows instead of wsl
03:18:40FromDiscord<ElegantBeef> ~~Or native linux~~
03:19:12FromDiscord<ElegantBeef> Are you attempting to run the linux build throug the cli?
03:22:35*wiml quit (Quit: Leaving)
03:27:00ForumUpdaterBotNew thread by Niminem: I make my first $ with Nim in two days, see https://forum.nim-lang.org/t/7172
03:28:33FromDiscord<Revenant> hiya, i'm trying do give `{.byaddr.}` a nicer syntax. this is my unsuccessful attempt so far:
03:28:55FromDiscord<Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSg
03:29:16FromDiscord<Revenant> but i'm just getting this error
03:29:30FromDiscord<Revenant> any tips?
03:29:30FromDiscord<Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSh
03:29:42FromDiscord<Revenant> (edit) "do" => "to"
03:30:47*Evolver joined #nim
03:31:54FromDiscord<Revenant> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2FSi
03:49:08FromDiscord<Revenant> okay, i got it to work... kinda... not sure what the implications of setting `typ` always to `nil` are though
03:49:19FromDiscord<Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSl
03:54:49FromDiscord<iWonderAboutTuatara> yeah I realized that you can't really mae the linux cli pop a window
03:54:53FromDiscord<iWonderAboutTuatara> so I have to use windows
04:01:32FromDiscord<ElegantBeef> I believe WSL2 can open windows
04:01:48*bung joined #nim
04:05:18*mbomba quit (Quit: WeeChat 3.0)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:36*supakeen joined #nim
04:13:03FromGitter<halloleo> Hey , Nim people seem to be on Discord more than on Gitter, right? Which Discord and how best to join? Many thanks!
04:15:41FromDiscord<ElegantBeef> You can use IRC, Matrix, or Discord 😄
04:16:49FromDiscord<ElegantBeef> http://discord.gg/nim is the url for discord
04:26:29*abm quit (Quit: Leaving)
04:32:05*nixfreak quit (Ping timeout: 240 seconds)
04:51:11*thomasross quit (Ping timeout: 256 seconds)
04:59:47*superbia1 joined #nim
05:01:56*superbia quit (Ping timeout: 240 seconds)
05:04:51*mbomba joined #nim
05:17:20*mbomba quit (Quit: WeeChat 3.0)
05:34:33*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:34:40*njoseph joined #nim
05:45:47FromDiscord<InventorMatt> is there a way or at least any easy way to use varargs for indexing nimnodes?
05:46:03*waleee-cl quit (Quit: Connection closed for inactivity)
05:47:15leorize[m]1wdym?
05:50:09*bung quit (Ping timeout: 265 seconds)
05:56:24*bung joined #nim
06:08:23FromDiscord<InventorMatt> like i have a seq of indices for a nimnode and want to access that index just using a seq
06:09:05FromDiscord<InventorMatt> so instead of foo[0][1][0] i can do foo[@[0,1,0]]
06:14:16FromDiscord<ElegantBeef> @InventorMatt how about this? https://play.nim-lang.org/#ix=2FSE
06:15:17FromDiscord<ElegantBeef> Varargs also works like an open array, so should be fine?
06:16:42FromDiscord<ElegantBeef> Alternatively you can replace it with an `openArray[int]` to not interfere with the normal `[]`
06:29:41FromDiscord<InventorMatt> So far I am not sure if that will work. I'm trying `[]=` with it but changing it to var with it's not changing the node I want
06:41:26FromDiscord<ElegantBeef> Weirdly it seems to be copying
06:47:08FromDiscord<InventorMatt> I probably messed up changing it to a var incorrectly
06:48:42FromDiscord<ElegantBeef> I mean NimNode is a ref object so it shouldnt require `var` afaik
06:50:19FromDiscord<InventorMatt> I probably did it wrong then
06:50:31FromDiscord<ElegantBeef> I mean i'm having issues aswell so... 😄
06:52:17FromDiscord<ElegantBeef> guess might have to use templates or macros
06:54:53FromDiscord<InventorMatt> I was thinking a macro would work but I wanted to test my options first
06:55:07FromDiscord<ElegantBeef> Yea i thought the proc would work due to them being ref objects
07:04:04FromDiscord<ElegantBeef> @InventorMatt Well i just made the macro if you want it https://play.nim-lang.org/#ix=2FSL
07:06:03FromDiscord<InventorMatt> awesome, thanks.
07:07:04FromDiscord<ElegantBeef> Hmm technically that could be a generic indention method
07:07:23FromDiscord<ElegantBeef> Aslong as the type implements `[]`
07:10:03*apahl quit (Ping timeout: 272 seconds)
07:10:42*apahl joined #nim
07:12:19*narimiran joined #nim
07:17:50FromDiscord<InventorMatt> is there a way to convert a symbol input to get it to work? like the seq is generated from a different proc first
07:20:46FromDiscord<ElegantBeef> Does it matter?
07:24:03FromDiscord<InventorMatt> I think so. https://play.nim-lang.org/#ix=2FSU here is what I am trying to do. I want to basically unwrap a loop and use i in the body to convert to the number
07:24:33*mbomba joined #nim
07:25:26FromDiscord<ElegantBeef> There has to be a better way 😄
07:25:52FromDiscord<ElegantBeef> I mean than my macro
07:25:59*habamax joined #nim
07:27:12FromDiscord<InventorMatt> yeah, I mainly need this because I need a for loop where the index is a static compiletime value
07:45:58*audiofile joined #nim
07:47:13audiofilewhy nim have max limit on integer size unlike python
07:47:55FromDiscord<ElegantBeef> Cause nim is statically typed and uses fixed size ints
07:48:32mipriit's not a python clone. nimble search bignum and you'll find a few libraries that'll give you those.
07:50:05FromDiscord<ElegantBeef> Dynamically sized ints are a bit hard to deal with you want stack allocated types 😄
07:52:10audiofileoh I see, didn't know it was based on beign statically typed! thanks for explain
07:52:26audiofilethe uniform function call syntax is cool!
07:52:28FromDiscord<ElegantBeef> Well you can do dynamically sized ints but it gets weird to do arrays
07:53:20FromDiscord<ElegantBeef> Afaik it's a performance/usabillity thing
07:54:10audiofilelike dynamically resizing memory if int is too big?
07:54:28miprithe type system is not really the issue. it you plotted languages by type system and whether they have bignums as a default type you'd see a relationship, but one factor doesn't cause the other, they're just both caused by wanting efficient code by default
07:55:27mipricomputers have registers that hold numbers represented by a fixed size of bits, and efficient operations on them. bignums require a lot of software on top of that.
07:55:47FromDiscord<ElegantBeef> Yea i was more saying that due to the type system and with stack allocated objects you dont really want to default to bignums assuming you change the size of them on the fly
07:55:52mipribut again you have them if you want.
07:56:40FromDiscord<ElegantBeef> I guess i'm bringing in the type system just cause i'm daft 😄
07:57:34audiofilewhat is the differencee between 'ref object of' and 'object of' is it call by reference vs call by value?
07:57:52FromDiscord<ElegantBeef> one is a reference object, one isnt
07:58:17audiofilereference object meaning if I change a value, the referred object's value is also changed right?
07:58:23FromDiscord<ElegantBeef> Yea
07:58:26mipriit's reference semantics vs. value semantics, yes. basically what you're thinking of.
07:58:53audiofilethanks I needed those search keywords
07:59:27audiofilealso % is used for creating json object ???
07:59:36audiofileI find it a bit odd that there is an operator just for that
07:59:57miprihttps://nim-lang.org/docs/json.html#%25%2Cstring
08:00:11mipriit's not a built-in operator, the json library defines it
08:00:16audiofileoverloading?
08:00:27audiofileinteresting!
08:00:38audiofilefirst time encountering a library defining a symbol hmm
08:01:18mipristrformat gives you &"strings" by defining `&`. system has `$` for stringification
08:02:09audiofileoh didn't realize those were libraries mb
08:02:22audiofilewhat does % do then if json is not imported
08:02:34audiofilenot sure how it should be used otherwise, if it is at all being used
08:02:48mipriit doesn't do anything.
08:03:00miprihttps://play.nim-lang.org/#ix=2FT6 <- you should define operators more sparingly than this.
08:03:13mipribut obviously %%% isn't a prefix operator that exists in the language that that code is just overloading
08:04:05FromDiscord<ElegantBeef> Nim has userdefined operators
08:04:12miprihttps://nim-lang.org/docs/manual.html#lexical-analysis-operators
08:05:39*vicfred quit (Quit: Leaving)
08:06:34*vicfred joined #nim
08:06:46FromDiscord<iWonderAboutTuatara> I seem to be getting the same issues I was having on linux on windows
08:07:04FromDiscord<iWonderAboutTuatara> I ahve libraylib.dll located inside my folder
08:07:08FromDiscord<iWonderAboutTuatara> right next to the script
08:07:13FromDiscord<iWonderAboutTuatara> and it's telling me ti can't find it
08:07:39*vicfred quit (Max SendQ exceeded)
08:08:11*vicfred joined #nim
08:12:58*tane joined #nim
08:39:23*narimiran quit (Ping timeout: 260 seconds)
08:43:54FromDiscord<iWonderAboutTuatara> I really do not understand these errors at all
08:44:04FromDiscord<iWonderAboutTuatara> I've tried everything I can think of and it still doesn't work
08:45:13*audiofile quit (Ping timeout: 256 seconds)
08:45:15FromDiscord<cabboose> Try Dependency Walker do see whether the dll has dependencies too
08:47:00FromDiscord<iWonderAboutTuatara> would it give me a "could not load error" if that were the case?
08:47:04FromDiscord<iWonderAboutTuatara> but raylib has no dependencies
08:50:02FromDiscord<Imperatorn> Is it the right raylib.dll tho? 🤔
08:51:01FromDiscord<Imperatorn> I did some experimentation with raylib in D two weeks ago and Iirc there are multiple libs
08:54:00FromDiscord<Imperatorn> @iWonderAboutTuatara yes dependency walker will show. If that fails you can try Process Monitor, really helpful: https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
08:58:03*mbomba quit (Ping timeout: 260 seconds)
09:00:06*ee7[m] quit (Quit: Idle for 30+ days)
09:10:22*Vladar joined #nim
09:25:54FromDiscord<iWonderAboutTuatara> I'm not sure if it's the right one @Imperatorn
09:26:05FromDiscord<iWonderAboutTuatara> I downloaded the mingw64 binaries and dll
09:26:34FromDiscord<iWonderAboutTuatara> from the relases on github
09:26:39FromDiscord<Imperatorn> Hmm, not at my computer atm. But I think I used the msvc one
09:26:47FromDiscord<iWonderAboutTuatara> oh the msvc one?
09:26:50FromDiscord<Imperatorn> Not sure
09:26:55FromDiscord<iWonderAboutTuatara> will try that
09:27:00FromDiscord<iWonderAboutTuatara> It hink nim uses mingw though
09:28:40FromDiscord<iWonderAboutTuatara> that did it!
09:28:43FromDiscord<iWonderAboutTuatara> That was the entire problem
09:28:49FromDiscord<iWonderAboutTuatara> wow, the amount of time I spent troubleshooting that
09:28:54FromDiscord<iWonderAboutTuatara> thanks @Imperatorn you legend
09:29:43FromDiscord<tomck> hello! I'm getting an error trying to capture an openArray into a proc that I know is safe: https://play.nim-lang.org/#ix=2FTp
09:30:28FromDiscord<tomck> how can i get around this via pointers?↵I tried to get a pointer to the first element with `let myPtr = myOpenArray[0].addr` the index the pointer with `myPtr[ii]`, but it seems like nim doesn't expect anything inside the `[]` brackets?
09:30:30FromDiscord<Imperatorn> @iWonderAboutTuatara np
09:30:55FromDiscord<tomck> bit lost here... can i get a pointer to an `openArray[T]`?
09:33:25FromDiscord<iWonderAboutTuatara> I'm a little bit confused by what you're trying to do here
09:33:46FromDiscord<ElegantBeef> This is just a minimal example of them capturing an open array inside an anonymous proc
09:33:55FromDiscord<iWonderAboutTuatara> oh I see not a direct thing
09:34:16FromDiscord<iWonderAboutTuatara> weird that the compiler dislikes this, doesn't seem lke it should be unsane
09:34:18FromDiscord<iWonderAboutTuatara> unsafe
09:35:16FromDiscord<ElegantBeef> Well the array is lent
09:35:28FromDiscord<InventorMatt> with a seq and probably an array it appears to works fine
09:36:26FromDiscord<iWonderAboutTuatara> it works for seq
09:36:38*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:36:43FromDiscord<iWonderAboutTuatara> I think you'd want to just do a union type
09:37:29*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
09:37:52*pbb joined #nim
09:37:59*vicfred quit (Quit: Leaving)
09:38:25FromDiscord<iWonderAboutTuatara> https://play.nim-lang.org/#ix=2FTr
09:38:28FromDiscord<iWonderAboutTuatara> this is a workaround
09:38:49FromDiscord<iWonderAboutTuatara> it's a little bit hacky, but you can use a union type, make it a generic and have a generic array lenght
09:38:53FromDiscord<iWonderAboutTuatara> (edit) "lenght" => "length"
09:39:06FromDiscord<iWonderAboutTuatara> this works fine for this example
09:39:28FromDiscord<iWonderAboutTuatara> It's apparently safe to copy arrays & seq but not openarray, because of some implementation detail
09:42:03FromDiscord<tomck> can i just hack around it with pointers inside the function, rather than messing up my api like that?
09:42:37FromDiscord<tomck> basically:↵↵If I have a `ptr T`, how can i access `T[1]`? (since `T[]` is just `T[0]`)
09:42:59FromDiscord<ElegantBeef> you do `ptr uncheckedArray[T}`
09:43:13FromDiscord<tomck> ok
09:43:15FromDiscord<ElegantBeef> (edit) "uncheckedArray[T}`" => "uncheckedArray[T]`"
09:43:24FromDiscord<tomck> how do i get from openArray to uncheckedArray?
09:43:37FromDiscord<ElegantBeef> You probably cant
09:43:48FromDiscord<ElegantBeef> Rather shouldnt
09:44:16FromDiscord<tomck> ok, how do i get from `ptr T` to `ptr uncheckedArray[T]`?
09:44:30FromDiscord<ElegantBeef> Cast
09:45:42FromDiscord<tomck> ahhhh got it, i was trying to cast from `ptr T` to `uncheckedArray[T]`, rather than `ptr uncheckedArray[T]`, thanks
09:45:48FromDiscord<tomck> brill, that works now
09:47:07*mbomba joined #nim
09:47:25*mbomba quit (Client Quit)
10:09:26*Sembei joined #nim
10:10:50*superbia1 quit (Quit: WeeChat 2.9)
10:43:03*opal quit (Ping timeout: 240 seconds)
10:45:25*opal joined #nim
10:47:58*bung_ joined #nim
10:49:00*kiwi_83 joined #nim
10:49:09kiwi_83when should I use the distinct eyword
10:49:21kiwi_83https://nim-by-example.github.io/types/distinct/ this one
10:49:56*bung quit (Ping timeout: 272 seconds)
10:51:07FromDiscord<Rika> if you have a type that can be perfectly represented by another but dont want to share its procs, or something
10:51:52*bouzu_ joined #nim
11:13:15*narimiran joined #nim
11:41:47narimiranA release candidate for Nim 1.4.2 is out! Get it from the nightlies: https://github.com/nim-lang/nightlies/releases/tag/2020-11-28-version-1-4-74c687e395c946111652c7bef4780b0aa2391cbf or using choosenim: choosenim @74c687e
11:54:35*kiwi_83 quit (Quit: Connection closed)
12:04:25*krux02 joined #nim
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:36*supakeen joined #nim
12:33:30FromDiscord<ProfessorEevee> Deja Vu
13:07:53*vsantana joined #nim
13:23:48*hmmm joined #nim
13:24:05*vsantana quit (Quit: Leaving.)
13:25:32*vsantana joined #nim
13:28:30*fredrikhr joined #nim
13:31:27FromDiscord<sheerluck> I was reading https://rosettacode.org and rosettacode says "Hey sheerluck try `--verbosity:0`" and I tried and I expected to see nothing but nim still printed some dots, actually 27 of them. Isn't this wierd? "Hey Nim be really quiet, compile with literally zero verbosity" "Well, ok, but... do you fancy some dots?"↵And why 27? Do you know that 27 is special number for "Weird Al" Yankovic? (https://weirdal.fandom.com/wiki/27)
13:33:02FromDiscord<Rika> do you remember the hint module things in nim 1.0?
13:33:04FromDiscord<Rika> those are the dots
13:33:08FromDiscord<Rika> one dot per line
13:33:28FromDiscord<Rika> like "Hint: Processing system" or whatever i forgot
13:34:49FromDiscord<sheerluck> I think `--verbosity:0` should mean "no dots"
13:36:10FromDiscord<Rika> it should, imo
13:36:15FromDiscord<Rika> im just explaining what they are
13:36:42*bouzu_ quit (Quit: Leaving)
13:37:34leorize[m]1@sheerluck you can add --hints:off to get rid of the dots
13:37:43FromDiscord<sheerluck> oh
13:38:07FromDiscord<sheerluck> thank you!
13:38:34*PMunch joined #nim
13:38:56FromDiscord<lqdev> Rika it was `Hint: system [Processing]`
13:39:00leorize[m]1why verbosity 0 doesn't disable hints I'm not sure, but no one has ever PR-ed something to change that afaik
13:41:33FromDiscord<Rika> someone should (not me because im way too busy rn ahaha)
13:51:05*narimiran quit (Ping timeout: 240 seconds)
14:03:05*luis1 joined #nim
14:16:17*shad0w_ joined #nim
14:17:04FromDiscord<exelotl> cast[ptr UncheckedArray[T]] is so long to type lol
14:18:06*shad0w_ quit (Remote host closed the connection)
14:21:56FromDiscord<haxscramper> Implicit "unsafe protection" by making everything long to type
14:22:01*shad0w_ joined #nim
14:22:34EvolverIs https://snapcraft.io/nim-lang safe to install?
14:23:11FromDiscord<haxscramper> Most likely yes, but I would recommend using `choosenim` - https://nim-lang.org/install_unix.html
14:24:00FromDiscord<haxscramper> "Installation using choosenim" section
14:24:35*shad0w_ quit (Remote host closed the connection)
14:25:13*bung_ quit (Ping timeout: 256 seconds)
14:25:18leorize[m]1Evolver: its not officially supported by the project but the author of the snap do frequent the forum
14:28:47FromGitter<lf-araujo> Hi everyone, how do I have access from stdin passed from a pipe in nim? I have something like cat "text" | ./util.nim ⏎ How do I read that string from within util.nim?
14:29:29*bung joined #nim
14:30:42FromDiscord<haxscramper> I think you can just do `let text = stdin.readAll()` or `for line in stdin.lines: echo line`
14:31:39FromGitter<lf-araujo> thanks, will try this
14:32:20FromDiscord<haxscramper> Fore more operations on `File` (`stdin` has typeo of `File`) you should check out https://nim-lang.org/docs/io.html#readAll%2CFile & related procs. Note that `io` is imported implicitly, so no need to `import std/io`
14:34:50FromGitter<lf-araujo> thank you very much, this works...
14:37:19*hmmm quit (Ping timeout: 260 seconds)
14:50:59*hmmm joined #nim
14:53:59*NimBot joined #nim
14:55:26*lritter joined #nim
14:57:46EvolverCan't the Nim people at least have a free book? What's up with the one non-free book?
14:58:15EvolverPython probably has had a dozen free books for a dozen years
14:58:51FromDiscord<haxscramper> I've never read the book actually, and you can learn all that is needed from tutorial and manual. Manning has some chapters that can be viewed for free AFAIK
14:58:58Evolverok thx
14:59:58FromDiscord<ProfessorEevee> What would be the Nim variant of `def init(self)` for classes/object types?
15:00:06FromDiscord<ProfessorEevee> (edit) "types?" => "types in Python?"
15:01:12FromDiscord<ProfessorEevee> sent a code paste, see https://play.nim-lang.org/#ix=2FWn
15:01:35FromDiscord<ProfessorEevee> lol I don't think I know the right terminology to ask my question properly
15:02:10FromDiscord<Rika> proc initPerson(<arguments here>): Person = ...
15:02:38FromDiscord<ProfessorEevee> ah so I would have to do it manually
15:03:14FromDiscord<haxscramper> Yes, right now implicit initialization is not supported. Default-constructed objects are zero-filled memory
15:04:21FromDiscord<ProfessorEevee> Alright, that makes sense. Thank you
15:15:18*nixfreak joined #nim
15:19:16*bung quit (Ping timeout: 240 seconds)
15:21:44*opal quit (Remote host closed the connection)
15:22:11*opal joined #nim
15:22:20*bung joined #nim
15:23:04*abm joined #nim
15:24:46*waleee-cl joined #nim
15:39:20*vsantana quit (Quit: Leaving.)
15:46:51*luis1 quit (Ping timeout: 260 seconds)
16:14:26*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
16:14:48*pbb joined #nim
16:21:03*pbb quit (Ping timeout: 272 seconds)
16:23:18*pbb joined #nim
16:39:05*superbia joined #nim
16:43:28*superbia quit (Client Quit)
17:12:36PMunchUhm: Error: type mismatch: got <Constraint> but expected 'Constraint = object'
17:17:12EvolverIs there a link to recommended tutorial/conference videos on the Nim website? If not, should there be?
17:21:33PMunchHmm, there isn't one no
17:21:50PMunchYou can start with the ones from NimConf 2020
17:21:57PMunchThose are all pretty good
17:22:44*junland quit (Quit: %ZNC Disconnected%)
17:23:32*junland joined #nim
17:26:05FromDiscord<haxscramper> Nim on hackernews top page again - https://news.ycombinator.com/item?id=25242926
17:27:23*junland quit (Client Quit)
17:28:50*junland joined #nim
17:31:09EvolverHN is a mixed bag, but it can randomly be useful for evangelism. It's bad for comments as they're heavily censored. Particularly, comments that expand the limited silicon-valley bubble are flagged and the user perma-ghosted just because they said something different.
17:32:06*narimiran joined #nim
17:34:16FromDiscord<ProfessorEevee> How would one go about converting a string to an integer? The `uri` module port is a string, but I can't use it in the with `net.Port`
17:34:31FromDiscord<haxscramper> `parseInt()`
17:34:56FromDiscord<haxscramper> https://nim-lang.org/docs/strutils.html#parseInt%2Cstring
17:35:57FromDiscord<ProfessorEevee> ah yep. thank you
17:36:44*junland quit (Quit: %ZNC Disconnected%)
17:37:35*junland joined #nim
17:50:41FromDiscord<For Your Health> Is there something similar to open arrays for type definitions? So say I have a 2d polygon type that can have a variable number of sides, am I forced to use a sequence even if I only instantiate pentagons?
17:51:38PMunchWell you can have it generic
17:53:24PMunchhttps://play.nim-lang.org/#ix=2FXn
17:54:56FromDiscord<For Your Health> Interesting, I will try that out. Thanks!
17:58:13PMunchCuriously enough the object doesn't have to actually use the generic
17:58:27PMunchSo you can use this to add compile-time only values to a type
18:00:50FromGitter<pebauer68> where could i find an example for addTimer() ?
18:02:51FromGitter<pebauer68> proc print_hello(): Callback= ⏎ echo "hello" ⏎ addTimer(1000,false,print_hello()) ⏎ What is missing here ? The timed call does not repeat ? [https://gitter.im/nim-lang/Nim?at=5fc3e24bb956e94695a78712]
18:05:09FromDiscord<dk> dumb question: how do you reraise in the except clause?
18:05:51bung@zah you there?
18:08:27Zevv!last disruptek
18:08:28disbotdisruptek spoke in 12disbot 23 hours ago
18:08:47Zevvunmute the dude please, he'll behave
18:08:51Zevvfor a day or two
18:10:28PMunchI can't remember how to do it..
18:11:23FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#exception-handling-raise-statement `If no exception name is given, the current exception is re-raised.`
18:11:36FromDiscord<haxscramper> Just `raise` with no arguments
18:11:50PMunchDid that do the trick?
18:16:11FromDiscord<dk> ty
18:17:54*hnOsmium0001 joined #nim
18:18:57*bung quit (Quit: Lost terminal)
18:41:35*vsantana joined #nim
18:44:21*Jesin quit (Quit: Leaving)
18:47:59*thomasross joined #nim
18:52:49*vsantana quit (Quit: Leaving.)
18:55:28*superbia joined #nim
19:06:44*Jesin joined #nim
19:17:58*superbia quit (Quit: WeeChat 2.9)
19:37:39*bunbunbunbunny joined #nim
19:52:25*habamax quit (Quit: leaving)
20:01:16*ee7[m] joined #nim
20:10:10*sagax quit (Read error: Connection reset by peer)
20:23:59*sagax joined #nim
20:29:38FromDiscord<neow> hello, I'd like to ask for help
20:29:56FromDiscord<neow> what is the best way to get a single bit of choice from a uint8?
20:30:20*ChanServ quit (shutting down)
20:33:13FromDiscord<lqdev> @neow https://nim-lang.org/docs/bitops.html see `testBit`
20:33:32FromDiscord<lqdev> unfortunately its anchor is broken so i didn't link to it
20:36:06FromDiscord<neow> oh thanks a lot
20:36:11FromGitter<ynfle> What's the best way to "reset" a `seq`? ie. should I use `setLen(0)`?
20:36:23FromDiscord<neow> I was looking for the "byte" and "bit" library but bitops has escaped my attention
20:36:39Prestige@ynfle yes
20:36:59FromGitter<ynfle> Thanks
20:37:57FromDiscord<Quibono> Is there any interest in a library to handle currency data?
20:41:05Prestigeprobably
20:46:49*dddddd quit (Quit: dddddd)
20:50:50*dddddd joined #nim
20:50:54*oprypin quit (Quit: Bye)
20:51:04*oprypin joined #nim
20:52:58*oprypin quit (Client Quit)
20:53:07*oprypin joined #nim
21:00:47*abm quit (Quit: Leaving)
21:01:35*abm joined #nim
21:02:25FromGitter<deech> Is there a way to include some C/C++ header files in a Nimble package?
21:05:49PMunchSure, just put them in the folder?
21:05:55FromDiscord<lqdev> @deech it should just work out of the box
21:05:56miprihttps://github.com/dom96/untar includes some header files as part of the zlib include, but there's nothing in the .nimble about them. they're just in the src directory
21:06:00FromDiscord<lqdev> unless it's a hybrid package
21:06:39FromDiscord<lqdev> in which case you need to change your installExt variable in the .nimble file to `installExt = @["nim", "c", "h"]` or something
21:07:26FromGitter<deech> How do I use them in a dependency? Can I just do `{.emit: "#include "someHeader.H".}`
21:08:53FromGitter<deech> Presumably the compiler's `--cincludedirs` flag needs to know where it is?
21:10:16mipriin typical use the most I'd is {.push, header: "../headers/someheader.h".}, or use <> like normal and ensure that's in the include path
21:10:29mipriand {.pop.} after the definitions that use it
21:11:26FromDiscord<Recruit_main707> what are you exactly trying to do, if you are going to use the headers you use them as usual by wrapping the functions/types needed
21:11:57FromGitter<deech> That makes sense but what is the header path when used in a dependency?
21:12:46*narimiran quit (Quit: leaving)
21:14:05mipriC compilers have a list of roots for <> pathing, there's absolute pathing, and there's pathing relative to the directory your source code is in. The last works the same in Nim, untar has an example again (with {.compile.}, not headers specifically)
21:16:17FromGitter<deech> You're right! But here's the scenario, package A includes some header files, I do `nimble install` on package A and the header file ends up somewhere in `nimbleDir`, package B depends on A but also needs the header, what path do I use for the header in package B?
21:17:08*hmmm quit (Ping timeout: 260 seconds)
21:18:41*vsantana joined #nim
21:19:15miprithe filesystem paths there include exact version numbers. I would tryo to avoid this scenario.
21:20:44*sagax quit (Ping timeout: 272 seconds)
21:37:39*bung joined #nim
21:39:38*bunbunbunbunny quit (Ping timeout: 256 seconds)
21:45:14FromDiscord<j-james> Is there a nice way to replace only the first occurence of a substring within a string?
21:49:31*bunbunbunbunny joined #nim
21:54:36*bunbunbunbunny quit (Ping timeout: 240 seconds)
21:57:23miprithat's an impressive gap in functionality
21:58:03miprinim-regex can do it with a limit of 1
21:59:05mipri!eval import regex; echo "this this".replace(re"this", "like", limit = 1) # if the bot has that
21:59:13NimBotlike this
22:00:35FromDiscord<j-james> wow, yikes
22:02:24*hmmm joined #nim
22:05:38FromDiscord<j-james> In that case, is there an easier way to get the total number of substrings within a string?
22:06:01*Vladar quit (Quit: Leaving)
22:08:16*nixfreak quit (Ping timeout: 240 seconds)
22:09:27miprieasier than what? the easy way is to use a regex again.
22:11:37*bung quit (Ping timeout: 264 seconds)
22:14:05FromDiscord<ajusa> I'm having some trouble integrating both vim and nim with the quickfix window, does anyone else know why this is happening? https://media.discordapp.net/attachments/371759389889003532/782731133510746162/unknown.png
22:14:45FromDiscord<j-james> oh, i didn't mean easier than, whoops
22:15:08FromDiscord<ajusa> Specifically, vim seems to be picking up the makefile as the error rather than the nim file line number. Not sure if I have an issue in my makefile, my vimrc, or in some other area.
22:15:10FromDiscord<j-james> getting the total number of substrings within a string is a seperate problem i haven't found an answer to
22:15:45FromDiscord<ElegantBeef> https://nim-lang.org/docs/nre.html#findAll%2Cstring%2CRegex%2Cint
22:16:37FromDiscord<j-james> ah, thank you
22:18:09*superbia joined #nim
22:21:12FromDiscord<j-james> (edit) In that case, is there also a way to get the total number of substrings within a string?
22:28:23*xet7_ joined #nim
22:28:35*vicfred joined #nim
22:30:31*xet7 quit (Ping timeout: 260 seconds)
22:33:40hmmmis there a lib that can parse "1.000.000,00 " as int one million
22:37:59superbiahow do you parse 1.000.000,50
22:41:55*bung joined #nim
22:42:08FromDiscord<Quibono> Dat internationalization support do.
22:42:36FromDiscord<Quibono> I mean it'd be pretty easy to convert that.
22:46:43*bung quit (Ping timeout: 256 seconds)
22:47:03*tane quit (Quit: Leaving)
22:49:56FromDiscord<ElegantBeef> hmmm this is what i'd do https://play.nim-lang.org/#ix=2FYD
22:50:28FromDiscord<ElegantBeef> Doesnt work for non iternational, but you can fix that 😛
22:50:41FromDiscord<Quibono> ElegantBeef I'm kinda disgusted to finish what I was going to do.
22:50:53FromDiscord<Quibono> Now that I've seen a decent way to do it.
22:51:04FromDiscord<ElegantBeef> It's not that decent as it's not universal
22:51:34FromDiscord<Quibono> https://play.nim-lang.org/#ix=2FYE
22:51:38FromDiscord<Quibono> This is how far I got lol
22:51:43FromDiscord<Quibono> It would be universal tho.
22:52:23*a_chou joined #nim
22:52:24FromDiscord<ElegantBeef> mine or yours?
22:52:31FromDiscord<Quibono> Mine but I didn't finish
22:52:37FromDiscord<Quibono> Because it's ugly as sin
22:52:59FromDiscord<ElegantBeef> Well mine just needs a flag of "decimalComma"
22:53:24FromDiscord<Quibono> Also thanks for using a case statement, because I've yet to use one and they seem nice.
22:54:22FromDiscord<ElegantBeef> Lol no problem
22:55:12FromDiscord<ElegantBeef> An issue i see that's hard to solve for automatically, is something like `100.350`
22:55:38FromDiscord<ElegantBeef> Where it's ambigious if it's a decimal or 100s seperator
22:55:50FromDiscord<Quibono> Unless like you knew it was a currency.
22:56:05FromDiscord<Quibono> (One which only had two places specifically)
22:56:07*bunbunbunbunny joined #nim
22:56:27FromDiscord<ElegantBeef> Yea in this case i chose a bad right hand cause a decimal would drop the 0
22:56:42bunbunbunbunnyhey all
22:56:45*nixfreak joined #nim
22:56:54FromDiscord<ElegantBeef> but anyway it's not possible to solve automatically, and there is a reason nim doesnt use commas depending on your system
22:56:56bunbunbunbunnypretty new to nim and just wondering how can i pass a mutable sequence to a proc?
22:57:04FromDiscord<ElegantBeef> `var seq[T]`
22:57:28FromDiscord<ElegantBeef> C# changes float stringification based off your language and it just invites issues
22:57:47bunbunbunbunnyso the param input would be (my_variable_name: var seq[int])?
22:57:49FromDiscord<ElegantBeef> You forget that then you send something to someone that uses commas, and it fails to work
22:57:52FromDiscord<ElegantBeef> yep
22:58:09FromDiscord<ElegantBeef> The snake casing hurts me 😛
22:58:19bunbunbunbunnyoh do we not use snake case?
22:58:30FromDiscord<ElegantBeef> Snake casing is not Nim idiomatic
22:58:35FromDiscord<ElegantBeef> It doesnt really matter
22:58:41bunbunbunbunnycamelcase?
22:58:45FromDiscord<ElegantBeef> Yea
22:58:48bunbunbunbunnygotcha
22:58:58FromDiscord<Quibono> @ElegantBeef When can we get Black for nim? 😮
22:59:00FromDiscord<ElegantBeef> But like i said it doesnt matter as `my_variable_name` is the same as `myVariableName` in nim
22:59:14FromDiscord<ElegantBeef> We drop casing after first character and remove `_`
22:59:14bunbunbunbunnyyep
22:59:25bunbunbunbunnyis this a common error: Unhandled exception: index -1 not in 0 .. 14 [IndexDefect]?
22:59:33bunbunbunbunnynot sure why its giving me this
22:59:41FromDiscord<ElegantBeef> cause you're indexing with -1
22:59:51bunbunbunbunnyhmm
22:59:52FromDiscord<ElegantBeef> are you trying to get the backwards index? `length -1`?
23:00:05bunbunbunbunnyyeah i used this: for i, val in arr_to_sort[1 .. ^1]:
23:00:06FromDiscord<ElegantBeef> if so `[^1]` gives that
23:00:20FromDiscord<ElegantBeef> is the arr empty?
23:00:35bunbunbunbunnynope
23:01:17bunbunbunbunnyah nvm i found my bug
23:01:17bunbunbunbunny:D
23:01:32FromDiscord<ElegantBeef> are your purposely removing `0` from that selection?
23:01:43bunbunbunbunnyyeah i wanted to iterate from the 1st element -> last
23:02:13FromDiscord<ElegantBeef> So... the second element? 😛
23:02:37FromDiscord<ElegantBeef> First to last would be `0..^1`
23:02:43bunbunbunbunnyo
23:02:51bunbunbunbunnyfirst as in second i mean
23:02:55bunbunbunbunnyi go by 0 based
23:03:20FromDiscord<ElegantBeef> Yea but it's not zeroth element, it's the first element 😄
23:03:28bunbunbunbunnylol true
23:03:28bunbunbunbunny:D
23:04:14*vsantana quit (Quit: Leaving.)
23:10:39*vsantana joined #nim
23:13:20*bung joined #nim
23:13:49*xet7_ is now known as xet7
23:14:05*xet7 quit (Quit: Leaving)
23:14:26*xet7 joined #nim
23:17:53*bung quit (Ping timeout: 260 seconds)
23:24:59*a_chou quit (Quit: a_chou)
23:25:18*vsantana quit (Quit: Leaving.)
23:25:35*bunbunbunbunny quit (Ping timeout: 260 seconds)
23:26:15voltistWhat does the RangeDefect error mean? I can't find any info about it on the docs
23:28:03*bunbunbunbunny joined #nim
23:28:42PMunchBasically it's the exception that gets thrown when something is not in the right range
23:28:57PMunch!eval var x = @[1, 2]; echo x[3]
23:29:00NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: index 3 not in 0 .. 1 [IndexDefect]
23:29:15PMunchOh, that's and IndexDefect
23:29:20PMunch!eval var x = @[1, 2]; echo x[0..3]
23:29:24NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system.nim(2551) []↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: index 2 not in 0 .. 1 [IndexDefect]
23:29:44PMunch!eval var x: range[0..10]; x = 100
23:29:46NimBotCompile failed: /usercode/in.nim(1, 26) Error: conversion from int literal(100) to range 0..10(int) is invalid
23:29:53PMunchHmm
23:31:54PMunch!eval var x: range[0..10]; import strutils; x = parseInt("200")
23:31:58NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: value out of range: 200 notin 0 .. 10 [RangeDefect]
23:31:58*bunbunbunbunny quit (Read error: Connection reset by peer)
23:32:03PMunchAh, there we go
23:32:56voltistInteresting
23:32:59voltistI'm getting "value out of range [RangeDefect]"
23:38:54voltistOh hey I figured it out
23:39:10voltistI was trying to cast a number that is bigger than the largest int into an int
23:40:05FromDiscord<j-james> !eval import re; echo(len(findAll("testtest-test", re("\")))
23:40:09NimBotCompile failed: /usercode/in.nim(1, 53) Error: invalid character constant
23:40:54FromDiscord<j-james> Does anyone know why Nim doesn't like a single escaped ``?
23:41:05FromDiscord<j-james> (the code above is actually `import re; echo(len(findAll("testtest-test", re("\")))`)
23:43:57FromDiscord<ElegantBeef> I think it's attempting to find the character `\` so you can do either `\\` or `"""\"""`
23:44:27FromDiscord<ElegantBeef> It gives `Error: invalid character constant` which is why i suspect that error
23:46:37*PMunch quit (Quit: leaving)
23:46:42FromDiscord<j-james> Hmm, that's very surprising
23:47:04FromDiscord<ElegantBeef> Not really
23:47:25FromDiscord<ElegantBeef> `\` is the escape character for special characters `\` isnt a special character as such it errors
23:47:56FromDiscord<ElegantBeef> you need to escape the escape character so that it interprets it as `\` which is what `\\` does
23:48:22FromDiscord<ElegantBeef> Or the triple string which inteprets everything as the actual raw characters
23:48:43FromDiscord<j-james> `` isn't the match-0-or-more character?
23:48:48FromGitter<raydf> Hello everyone, does anyone knows about some code example for dynamic loading of scripts for code-splitting with js backend?
23:49:25FromGitter<raydf> I would like to get something like dynamic imports: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fc43385150b213e98025e2a]
23:49:34FromDiscord<ElegantBeef> james i suggest using regexpal and switching it over to the pcre mode to see what you need/want
23:50:47FromDiscord<ElegantBeef> Raydf nim's JS backend is aimed at clientside browsers, so uncertain how you dynamically load modules there
23:51:05FromDiscord<ElegantBeef> I suppose you could make a macro to `emit` the code you wanted?
23:52:06FromGitter<gogolxdong> Is there any browser kernel in Nim?
23:53:50FromDiscord<ElegantBeef> I cannot find one
23:54:13FromDiscord<ElegantBeef> There is https://github.com/jangko/nimCEF
23:54:44FromGitter<gogolxdong> Have you heard of miniblink?
23:55:04FromDiscord<ElegantBeef> Nopep
23:55:35FromDiscord<ElegantBeef> As a majority of it's readme is chinese i can see why i havent:D
23:56:20FromGitter<raydf> @ElegantBeef i'm looking for some kind of code splitting for a karax.nim app. I'm looking to work on a webapp that i would like to only load the scripts needed for a route
23:57:05FromDiscord<ElegantBeef> Idk i've barely looked at the JS backend so i dont know how karax works
23:57:29FromGitter<raydf> ok, thx for the reply
23:58:59FromDiscord<ElegantBeef> If all the js you're wanting to import is exported Nim i have a feeling you'd have a lot of redundant code because of how Nim creates JS
23:59:50FromDiscord<ElegantBeef> I'm uncertain how you'd handle importing nim modules due to the fact that nim imports need to be at the global level