00:03:00 | FromDiscord | <iWonderAboutTuatara> I see |
00:03:01 | FromDiscord | <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:35 | FromDiscord | <notchris> If I have an enum of the type NamedColor, how can i use it as an int |
00:33:58 | FromDiscord | <notchris> i have a procedure that expects an int, but i wanted to pass in an enum which represents the int |
00:35:06 | FromDiscord | <notchris> ohh I do ord(), sorry! |
00:42:07 | FromDiscord | <notchris> @iWonderAboutTuatara you have to build raylib to generate the so, or use homebrew, get the raylib cask |
00:42:18 | FromDiscord | <ElegantBeef> Chris i've got to ask as i'm interested, did you do the hint thing yet? |
00:42:21 | FromDiscord | <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:33 | FromDiscord | <iWonderAboutTuatara> Oh is it a seperate process for raygui? |
00:42:47 | FromDiscord | <notchris> Wow good timing @ElegantBeef I was about to do that |
00:42:53 | FromDiscord | <notchris> have it open now lmao |
00:43:03 | FromDiscord | <ElegantBeef> Ah, i'm just interested in seeing if it works |
00:43:20 | FromDiscord | <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:37 | FromDiscord | <ElegantBeef> I'm uncertain if they're on macos, but it should be similar for linux |
00:43:49 | FromDiscord | <iWonderAboutTuatara> I'm on Linux which should be similar |
00:43:51 | FromDiscord | <iWonderAboutTuatara> Yeah |
00:44:08 | FromDiscord | <iWonderAboutTuatara> I don't think we have brew in Linux? |
00:44:10 | FromDiscord | <iWonderAboutTuatara> Not sure |
00:44:12 | FromDiscord | <iWonderAboutTuatara> Might be in apt |
00:44:18 | FromDiscord | <ElegantBeef> We do, but it's just a package manager |
00:44:28 | FromDiscord | <notchris> The only thing to watch out for id say |
00:44:33 | FromDiscord | <notchris> Is once you do install raylib |
00:44:47 | FromDiscord | <notchris> the so may be named differently than what the package is looking for, so you may need ot make a dlink |
00:44:58 | FromDiscord | <notchris> i think that happened to me |
00:44:58 | FromDiscord | <ElegantBeef> You dont want to install raylib, you want to dynamically link it afaik, so you can ship it |
00:45:33 | FromDiscord | <notchris> yeah sorry i used poor terminology |
00:45:53 | FromDiscord | <notchris> brb gonna grab a snapple |
00:45:55 | FromDiscord | <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:21 | FromDiscord | <notchris> in their defense, the build steps arent documented super well for multi os |
00:47:52 | FromDiscord | <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:41 | FromDiscord | <iWonderAboutTuatara> this is so confusing |
00:51:44 | FromDiscord | <iWonderAboutTuatara> I got a make error |
00:51:53 | FromDiscord | <iWonderAboutTuatara> sent a long message, see http://ix.io/2FRw |
00:52:02 | FromDiscord | <iWonderAboutTuatara> (edit) "long message," => "code paste," | "http://ix.io/2FRw" => "https://play.nim-lang.org/#ix=2FRx" |
00:52:13 | FromDiscord | <ElegantBeef> oh you're installing |
00:52:24 | FromDiscord | <iWonderAboutTuatara> oh I should sudo? |
00:52:25 | FromDiscord | <ElegantBeef> for that you need sudo to move it to the directory, but like i said you dont want to make install |
00:52:28 | FromDiscord | <iWonderAboutTuatara> or should I not install at all? |
00:52:41 | FromDiscord | <ElegantBeef> you want the dynamic shared library |
00:52:50 | FromDiscord | <iWonderAboutTuatara> how do I get that without installing? |
00:53:02 | FromDiscord | <ElegantBeef> I guess you can install it |
00:53:15 | FromDiscord | <ElegantBeef> Just need to ship it with the binary whenever you ship your application |
00:53:20 | FromDiscord | <notchris> @ElegantBeef this one, right? SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT |
00:53:35 | FromDiscord | <iWonderAboutTuatara> how do I do that? |
00:53:43 | FromDiscord | <iWonderAboutTuatara> just copy the folder it's installed to? |
00:54:04 | FromDiscord | <ElegantBeef> After installing `locate libraylib.so` and cp it from there next to your binary |
00:54:17 | FromDiscord | <ElegantBeef> @notchris `SDL_HINT_VIDEO_HIGHDPI_DISABLED` |
00:54:36 | FromDiscord | <notchris> Awesome, trying now |
00:55:04 | FromDiscord | <iWonderAboutTuatara> that should be fine right? |
00:55:12 | FromDiscord | <iWonderAboutTuatara> or is there a better way? |
00:55:29 | FromDiscord | <ElegantBeef> I mean i told you what i'd do, idk much about libraries though |
00:55:41 | FromDiscord | <iWonderAboutTuatara> I'm extremely new to this |
00:55:41 | * | wiml joined #nim |
00:55:53 | FromDiscord | <iWonderAboutTuatara> This kind of thing is quite a bit easier in python than C |
00:56:02 | FromDiscord | <iWonderAboutTuatara> so i have no idea what I'm doing |
00:56:11 | FromDiscord | <ElegantBeef> It's the exact same in python as in C |
00:56:20 | FromDiscord | <ElegantBeef> If you need a library, you have to build it and get the so |
00:56:25 | FromDiscord | <iWonderAboutTuatara> how would I dynamically link it? |
00:56:31 | FromDiscord | <iWonderAboutTuatara> In python everything is in pip |
00:56:38 | FromDiscord | <iWonderAboutTuatara> pip handles everything |
00:56:47 | FromDiscord | <ElegantBeef> ~~Uncertain if that's true~~ |
00:56:49 | * | lmariscal quit (Quit: I'm Out!) |
00:56:53 | FromDiscord | <ElegantBeef> Just copy it next to the binary when you ship it |
00:57:07 | FromDiscord | <ElegantBeef> After you install it, the .so will be in your search path so should work |
00:57:21 | FromDiscord | <iWonderAboutTuatara> just `locate libraylib.so` and cp it? |
00:57:33 | FromDiscord | <iWonderAboutTuatara> Got it |
00:57:35 | FromDiscord | <iWonderAboutTuatara> that's not bad at all |
00:57:36 | FromDiscord | <iWonderAboutTuatara> thanks! |
00:57:39 | FromDiscord | <ElegantBeef> np |
00:58:04 | FromDiscord | <ElegantBeef> Though like i said you might be able to statically link it, but i'm uncertain how to do that |
00:58:27 | FromDiscord | <iWonderAboutTuatara> How would I locate it? |
00:58:27 | FromDiscord | <ElegantBeef> Which means the so would be included in the binary, so it's actually "dependancy less" |
00:58:36 | FromDiscord | <ElegantBeef> locate is a command |
00:58:42 | FromDiscord | <iWonderAboutTuatara> I don't necessarily need it to be dependany less |
00:58:45 | FromDiscord | <iWonderAboutTuatara> oh do I need to install it? |
00:58:50 | FromDiscord | <iWonderAboutTuatara> Ubuntu doesn't seem to recognize |
00:58:52 | FromDiscord | <ElegantBeef> I mean it's installed on my system |
00:58:58 | FromDiscord | <ElegantBeef> I'm un an ubuntu derived |
00:59:03 | FromDiscord | <iWonderAboutTuatara> there's an apt package called mlocate apparently |
00:59:07 | FromDiscord | <iWonderAboutTuatara> might be installed by default |
00:59:12 | FromDiscord | <iWonderAboutTuatara> are you on popos? |
00:59:17 | FromDiscord | <ElegantBeef> No regolith |
00:59:23 | FromDiscord | <iWonderAboutTuatara> never heard of it |
00:59:36 | FromDiscord | <ElegantBeef> @notchris i dont like that i dont hear a celebratory hoorah |
00:59:48 | FromDiscord | <ElegantBeef> It's just ubuntu with i3wm-gaps and gnome intergration |
01:00:10 | FromDiscord | <ElegantBeef> So gtk applications use an easy to customize colour theme and i can use gnome settings to control my system |
01:00:26 | FromDiscord | <iWonderAboutTuatara> looks super nice actually |
01:01:55 | FromDiscord | <notchris> haha @ElegantBeef so far im testing on 800x600 |
01:02:02 | FromDiscord | <notchris> toggling that flag yields... |
01:02:06 | FromDiscord | <notchris> https://media.discordapp.net/attachments/371759389889003532/782411027375456286/Screen_Shot_2020-11-28_at_8.01.27_PM.png |
01:02:12 | FromDiscord | <ElegantBeef> In theory it should now be a 800x600 px window |
01:02:23 | FromDiscord | <notchris> so 1/4 the size |
01:02:27 | FromDiscord | <ElegantBeef> yea |
01:02:44 | FromDiscord | <notchris> hmm |
01:02:53 | FromDiscord | <ElegantBeef> Which it seems it is, no? |
01:03:13 | FromDiscord | <notchris> It does, but the window would also need to factor that in |
01:03:20 | FromDiscord | <ElegantBeef> I'd say try with nico |
01:03:28 | FromDiscord | <ElegantBeef> It has that whole scale image to window size |
01:03:35 | FromDiscord | <notchris> well im trying this on a vanilla sdl2 project |
01:03:40 | FromDiscord | <notchris> because on nico, we're using opengl renderer |
01:03:43 | FromDiscord | <notchris> so we can use shaders |
01:03:54 | FromDiscord | <ElegantBeef> It's not on by default though iirc |
01:04:04 | FromDiscord | <notchris> I think it is |
01:04:22 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/782411601227677736/unknown.png |
01:04:25 | FromDiscord | <notchris> Err, you're right its off |
01:04:31 | FromDiscord | <notchris> oh you mean opengl being off? |
01:04:35 | FromDiscord | <ElegantBeef> yea |
01:04:40 | FromDiscord | <notchris> yeah we had to enable opengl |
01:04:41 | FromDiscord | <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:52 | FromDiscord | <notchris> you pass a flag in the compilation to enable opengl for nico |
01:05:07 | FromDiscord | <notchris> which isnt in the docs |
01:05:13 | FromDiscord | <notchris> iirc |
01:05:15 | FromDiscord | <ElegantBeef> I mean imgui is immeditate GUI, so even idiomatic it should be.... identical |
01:05:17 | FromDiscord | <ElegantBeef> Yea i know that |
01:05:20 | * | lmariscal joined #nim |
01:05:32 | FromDiscord | <ElegantBeef> I did show where it imports opengl, so i'd hope i know how to enable it 😛 |
01:05:42 | FromDiscord | <iWonderAboutTuatara> apparently mlocate takes >20 minutes to install on windows |
01:05:44 | FromDiscord | <iWonderAboutTuatara> so that's fun |
01:05:44 | FromDiscord | <notchris> lmao |
01:05:49 | FromDiscord | <notchris> that was you, wasn't it @ElegantBeef |
01:06:00 | FromDiscord | <ElegantBeef> @JSGRANT how do you suggest nimdiomatic IMGUI |
01:06:28 | FromDiscord | <ElegantBeef> I mean it's in `/usr/local/lib/` |
01:06:54 | FromDiscord | <ElegantBeef> Just locate atleast on linux isnt too long to install and works quickly |
01:08:05 | FromDiscord | <ElegantBeef> Uh oh exelotl is here to call me out 😄 |
01:08:52 | FromDiscord | <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:04 | FromDiscord | <exelotl> I was about to change the topic completely lol |
01:09:19 | FromDiscord | <ElegantBeef> imgui is a lot of `if button: #doThing here` |
01:09:47 | FromDiscord | <ElegantBeef> It's a very declarative UI method |
01:10:22 | FromDiscord | <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:27 | FromDiscord | <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:22 | FromDiscord | <JSGRANT> @ElegantBeef Oh wow, yeah that's pretty simple & clean |
01:11:27 | FromDiscord | <ElegantBeef> I think that'd be the cleanest method exelotl |
01:11:50 | FromDiscord | <ElegantBeef> You could do something silly where you figureout the size you need and just write that many bytes as `0xff` |
01:12:00 | FromDiscord | <ElegantBeef> Since "all" is just the entire bitset enabled |
01:12:24 | FromDiscord | <exelotl> hehe, yeah could do that, but I guess there's no point |
01:12:45 | FromDiscord | <ElegantBeef> exelotl you sometimes worry about weird things 😛 |
01:12:58 | FromDiscord | <ElegantBeef> ~~Guess that's why you're making a GBA game in 2020~~ |
01:13:39 | FromDiscord | <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:01 | FromDiscord | <ElegantBeef> ah |
01:15:06 | FromDiscord | <exelotl> the funny thing is, the original C module had an enum-like thing going (KI_A = 1, KI_B = 2, etc.) |
01:15:13 | FromDiscord | <exelotl> I didn't know about Nim sets at the time |
01:15:31 | FromDiscord | <exelotl> I looked at it and thought "what's the point in that" and got rid of it xD |
01:15:47 | FromDiscord | <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:09 | FromDiscord | <ElegantBeef> I assume the tonc.h is just a basic input manager file |
01:18:04 | FromDiscord | <JSGRANT> Wonder if there are any notable "pure nim immediate-mode guis" floating around; Seems like a neat project |
01:18:32 | FromDiscord | <ElegantBeef> The one i just showed you was 😛 |
01:19:38 | FromDiscord | <ElegantBeef> Seems like atleast on github no one is embarking on that |
01:19:38 | FromDiscord | <JSGRANT> @ElegantBeef Oh, that's a seperate immediate-mode gui ; Which name just happens to be imgui ...? lol |
01:19:50 | FromDiscord | <ElegantBeef> imgui... is just immediate mode gui |
01:20:04 | FromDiscord | <ElegantBeef> i hate that dearimgui is the default "imgui" people think of |
01:20:43 | FromDiscord | <exelotl> wait there a library that's just called imgui? xD |
01:20:48 | * | mbomba joined #nim |
01:20:50 | FromDiscord | <exelotl> there isn't |
01:21:06 | FromDiscord | <ElegantBeef> https://github.com/ocornut/imgui |
01:21:13 | FromDiscord | <JSGRANT> Isn't Dear Imgui a rename or something? |
01:21:19 | FromDiscord | <ElegantBeef> the repo is imgui, but dearimgui is the name of it now |
01:21:34 | FromDiscord | <JSGRANT> Yeah, was going to say |
01:21:35 | FromDiscord | <ElegantBeef> It's a horrid case of the name being what it is, so it just confusues people |
01:22:19 | FromDiscord | <JSGRANT> Probably for like 3/4th of people aware of it equivicate the concept and that "shorthand" |
01:22:20 | FromDiscord | <ElegantBeef> not all imguis are imgui but imgui is an imgui |
01:23:01 | FromDiscord | <ElegantBeef> This is why nuklear is cool 😄 |
01:23:16 | FromDiscord | <JSGRANT> Is nuklear the C one? |
01:23:20 | FromDiscord | <notchris> all of the nuklear builds for me have faildd |
01:23:22 | FromDiscord | <ElegantBeef> It has a name that's not ambigious |
01:23:23 | FromDiscord | <ElegantBeef> Yea |
01:23:40 | FromDiscord | <ElegantBeef> I have never used nuklear, have use the nimgl imgui bidnings and they're pretty nice |
01:24:00 | FromDiscord | <ElegantBeef> Think zachary did the wrapper for nuklear and they're a bit outdated iirc |
01:24:02 | FromDiscord | <ElegantBeef> or rely on bgfx |
01:24:04 | FromDiscord | <ElegantBeef> dont recall 😛 |
01:24:40 | FromDiscord | <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:56 | FromDiscord | <ElegantBeef> You could try nimx/fidget instead 😄 |
01:25:24 | FromDiscord | <Daniel> https://github.com/Immediate-Mode-UI/Nuklear |
01:25:43 | FromDiscord | <Daniel> Yea, go with fidget, it uses Figma drag and drop gui builder. |
01:25:45 | FromDiscord | <ElegantBeef> They arent imgui's but they're gui frameworks |
01:26:00 | FromDiscord | <JSGRANT> Is Fidget themeable? Haven't really messed with it |
01:26:08 | FromDiscord | <ElegantBeef> I've honestly never used the figma editor, which probably causes treeform an anyuerism |
01:26:13 | FromDiscord | <ElegantBeef> You'd have to make the theming yourself |
01:26:45 | FromDiscord | <JSGRANT> Yeah, not too interested in the wysiwug styled editor / builder for guis |
01:27:43 | FromDiscord | <JSGRANT> Does this basically entail CSS I'm guessing? |
01:27:51 | FromDiscord | <ElegantBeef> Well whatever you want |
01:27:57 | FromDiscord | <ElegantBeef> You could use nimscript to theme it if you so wished |
01:28:10 | FromDiscord | <ElegantBeef> Got my moe fork doing just that for reference |
01:29:34 | FromDiscord | <ElegantBeef> It is as simple as passing in a hexcolour into `fill` |
01:29:39 | FromDiscord | <ElegantBeef> For fidget that is |
01:29:41 | FromDiscord | <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:22 | FromDiscord | <ElegantBeef> Well fidget does use shaders to render |
01:30:28 | FromDiscord | <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:58 | FromDiscord | <JSGRANT> And want to start actually streaming once-a-week next year doing somesort of gamedev; Godot (x Nim) or otherwise |
01:31:45 | FromDiscord | <ElegantBeef> Just be like pmunch and program things to make your stream/life better whilst streaming |
01:34:04 | FromDiscord | <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:26 | FromDiscord | <JSGRANT> @ElegantBeef Honestly that's probably the way to go; Just perma-dogfood it. |
01:35:01 | FromDiscord | <ElegantBeef> I also have 0 knowledge here 😛 |
01:35:08 | * | lritter quit (Ping timeout: 272 seconds) |
01:35:32 | FromDiscord | <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:08 | FromDiscord | <JSGRANT> @ElegantBeef Make a text-editor ... with a gui scenebuillder for fidget in fidget lol |
01:36:19 | FromDiscord | <JSGRANT> fidgma |
01:36:31 | FromDiscord | <iWonderAboutTuatara> so I've built it and libraylib.so to the same folder as the file |
01:36:52 | FromDiscord | <iWonderAboutTuatara> but the compile still fails with the same error |
01:36:55 | FromDiscord | <iWonderAboutTuatara> any idea why/ |
01:37:21 | FromDiscord | <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:32 | FromDiscord | <ElegantBeef> so it's next to the binary? |
01:38:09 | FromDiscord | <iWonderAboutTuatara> yeah |
01:38:29 | FromDiscord | <JSGRANT> @ElegantBeef So a non-gross https://onivim.io/ ? lol |
01:38:34 | FromDiscord | <ElegantBeef> Well i'm uncertain why it's not working |
01:39:02 | FromDiscord | <ElegantBeef> Sorta |
01:39:13 | FromDiscord | <JSGRANT> I'd want something closer to https://github.com/rxi/lite tbh |
01:39:18 | FromDiscord | <iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782420388105814056/unknown.png |
01:39:37 | FromDiscord | <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:20 | FromDiscord | <ElegantBeef> Yea i mean it'd be similar to vscode or sublime, just with more a tiling window manager feel |
01:40:56 | FromDiscord | <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:05 | FromDiscord | <iWonderAboutTuatara> any idea what I should do to try to fix it? |
01:43:21 | FromDiscord | <iWonderAboutTuatara> I don't think I've explicitly told the compiler to load libraylib.so |
01:43:32 | FromGitter | <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:58 | FromDiscord | <Rebel> I mean you can check if that file even exists first.... |
01:44:01 | FromDiscord | <Rebel> `find / -name libraylib.so` |
01:46:22 | FromDiscord | <iWonderAboutTuatara> it's in the same directory |
01:46:33 | FromDiscord | <iWonderAboutTuatara> it's right next to the .nim file actually |
01:50:47 | * | a_chou quit (Remote host closed the connection) |
02:01:03 | FromDiscord | <Rebel> Ok I may or may not be blind lol |
02:01:17 | FromDiscord | <iWonderAboutTuatara> lol |
02:02:27 | FromDiscord | <Rebel> And you did google the error right? |
02:02:31 | FromDiscord | <Rebel> You did try this right? |
02:02:32 | FromDiscord | <Rebel> https://github.com/raysan5/raylib/issues/706 |
02:02:32 | disbot | ➥ [build] Cannot find libraylib.so.2 |
02:02:57 | FromDiscord | <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:22 | FromDiscord | <Rebel> If you move the so file to `/usr/local/lib` does it work? |
02:03:42 | FromDiscord | <iWonderAboutTuatara> I odn't tihnk I've tried that |
02:03:54 | FromDiscord | <iWonderAboutTuatara> i will try |
02:03:56 | FromDiscord | <iWonderAboutTuatara> lets see |
02:04:55 | wiml | Hey 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:40 | FromDiscord | <iWonderAboutTuatara> I stilll get the error could not load libraylib.so |
02:06:22 | FromDiscord | <Rebel> Did you compile with the extra flag for more information? As well as maybe `--verbosity:3`? |
02:07:00 | FromDiscord | <iWonderAboutTuatara> I will try that now |
02:07:05 | FromDiscord | <iWonderAboutTuatara> I've never heard of the extra flag |
02:07:25 | FromDiscord | <Rebel> `(compile with -d:nimDebugDlOpen for more information)` |
02:07:25 | FromDiscord | <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:07 | FromDiscord | <iWonderAboutTuatara> it does't give me any more information |
02:08:14 | FromDiscord | <Rebel> oh maybe try moving it here lol `/usr/lib/local` |
02:08:17 | FromDiscord | <iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2FS4 |
02:11:52 | FromDiscord | <iWonderAboutTuatara> really weird |
02:13:42 | FromDiscord | <iWonderAboutTuatara> any ideas? |
02:13:52 | FromDiscord | <iWonderAboutTuatara> oh try moving the script to usrliblocal? |
02:16:54 | FromDiscord | <iWonderAboutTuatara> that didn't work |
02:17:08 | FromDiscord | <iWonderAboutTuatara> after compiling with sudo I get the same error |
02:19:12 | FromDiscord | <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:41 | FromDiscord | <notchris> @iWonderAboutTuatara so libraylib.so is in usr/local/lib ? |
02:21:02 | * | apahl quit (Ping timeout: 264 seconds) |
02:21:03 | FromDiscord | <notchris> or w/e on linux |
02:22:40 | * | apahl joined #nim |
02:24:34 | FromDiscord | <iWonderAboutTuatara> yeah |
02:24:44 | FromDiscord | <iWonderAboutTuatara> usr/local/lib |
02:25:14 | FromDiscord | <notchris> and its called libraylib.so |
02:25:15 | FromDiscord | <notchris> ? |
02:25:53 | FromDiscord | <iWonderAboutTuatara> yes |
02:26:10 | FromDiscord | <iWonderAboutTuatara> in ls it showsup as libraylib.so@ but the file itse'f is called libraylib.so |
02:26:40 | FromDiscord | <ElegantBeef> What bindings are you using? |
02:26:56 | FromDiscord | <iWonderAboutTuatara> !repo raylib-forever |
02:26:57 | disbot | https://github.com/Ryan1729/nim-raylib-forever-raylib-audio-bug -- 9nim-raylib-forever-raylib-audio-bug: 11 15 0⭐ 0🍴 |
02:27:03 | FromDiscord | <iWonderAboutTuatara> nevermind |
02:27:12 | FromDiscord | <iWonderAboutTuatara> Raylib Forever by Guevara chan |
02:27:18 | FromDiscord | <iWonderAboutTuatara> https://github.com/Guevara-chan/Raylib-Forever |
02:27:43 | FromDiscord | <notchris> im using those on osx, no issue |
02:28:09 | FromDiscord | <iWonderAboutTuatara> it's completely possible that I'm doing something wrong |
02:28:09 | FromDiscord | <notchris> @iWonderAboutTuatara whats the result of `test -f "user/local/lib/libraylib.so"` |
02:28:31 | FromDiscord | <iWonderAboutTuatara> nothign |
02:28:42 | FromDiscord | <iWonderAboutTuatara> just makes a new line in terminal |
02:29:45 | FromDiscord | <notchris> oops |
02:29:48 | FromDiscord | <notchris> `test -f user/local/lib/libraylib.so && echo "exists."` |
02:30:12 | FromDiscord | <iWonderAboutTuatara> still an empty line |
02:30:13 | FromDiscord | <iWonderAboutTuatara> weird |
02:30:38 | FromDiscord | <iWonderAboutTuatara> ah no it exists |
02:30:50 | FromDiscord | <iWonderAboutTuatara> I had to adapt the syntax a little but it echos exists |
02:30:56 | FromDiscord | <iWonderAboutTuatara> test -f /usr/local/lib/libraylib.so && echo "exists" |
02:31:02 | FromDiscord | <iWonderAboutTuatara> (edit) "test" => "`test" | ""exists"" => ""exists"`" |
02:32:19 | FromDiscord | <notchris> @iWonderAboutTuatara sorry i goofed |
02:32:22 | FromDiscord | <notchris> thats not right |
02:32:35 | FromDiscord | <notchris> you want `test -f user/local/lib/libraylib.so` |
02:32:43 | FromDiscord | <iWonderAboutTuatara> user? |
02:32:45 | FromDiscord | <notchris> then do |
02:32:48 | FromDiscord | <iWonderAboutTuatara> on linux it's usr I think |
02:32:50 | FromDiscord | <notchris> right |
02:32:57 | FromDiscord | <notchris> then `eho $?` |
02:32:59 | FromDiscord | <notchris> echo |
02:32:59 | FromDiscord | <iWonderAboutTuatara> but that did echo "exists" |
02:33:20 | FromDiscord | <iWonderAboutTuatara> says that it expected the name of a variable |
02:33:32 | FromDiscord | <notchris> ok from the start, im sorry that was messy |
02:33:47 | FromDiscord | <iWonderAboutTuatara> no issue lol |
02:33:52 | FromDiscord | <notchris> `test -f usr/local/lib/libraylib.so` |
02:33:57 | FromDiscord | <notchris> then |
02:34:02 | FromDiscord | <notchris> `echo $?` |
02:34:08 | FromDiscord | <notchris> it should be 0 for not found, 1 for found |
02:34:16 | FromDiscord | <notchris> as the result |
02:34:51 | FromDiscord | <notchris> https://media.discordapp.net/attachments/371759389889003532/782434367006834688/Screen_Shot_2020-11-28_at_9.34.41_PM.png |
02:34:55 | FromDiscord | <iWonderAboutTuatara> 0 |
02:35:04 | FromDiscord | <notchris> right, so it cant find the file |
02:35:07 | FromDiscord | <iWonderAboutTuatara> weird |
02:35:21 | FromDiscord | <notchris> you said the file was a dynamic link righ |
02:35:28 | FromDiscord | <notchris> can you find the source |
02:35:34 | FromDiscord | <iWonderAboutTuatara> possibly? |
02:35:41 | FromDiscord | <iWonderAboutTuatara> I'm not really a unix person so idk how all this wokrs |
02:35:43 | FromDiscord | <notchris> right click on your current so |
02:35:50 | FromDiscord | <notchris> see if it says like show original or something |
02:35:59 | FromDiscord | <iWonderAboutTuatara> 8 https://media.discordapp.net/attachments/371759389889003532/782434655076483082/unknown.png |
02:36:10 | FromDiscord | <notchris> ok thats ur prob |
02:36:14 | FromDiscord | <notchris> copy the one that says |
02:36:16 | FromDiscord | <iWonderAboutTuatara> I'm using WSL meaning I have no gui |
02:36:19 | FromDiscord | <notchris> .3.0.0 |
02:36:21 | FromDiscord | <notchris> or w/e |
02:36:27 | FromDiscord | <notchris> and rename it so libraylib.so |
02:36:33 | FromDiscord | <iWonderAboutTuatara> .3.0.0 or .301? |
02:37:10 | FromDiscord | <iWonderAboutTuatara> weirdly, it says they're the same file |
02:37:11 | FromDiscord | <notchris> copy libraylib.so.3.0.0 |
02:37:26 | FromDiscord | <iWonderAboutTuatara> for both of them |
02:37:51 | FromDiscord | <notchris> https://media.discordapp.net/attachments/371759389889003532/782435122631671828/Screen_Shot_2020-11-28_at_9.34.41_PM.png |
02:37:54 | FromDiscord | <notchris> oops |
02:38:02 | FromDiscord | <notchris> https://media.discordapp.net/attachments/371759389889003532/782435172011212820/Screen_Shot_2020-11-28_at_9.37.42_PM.png |
02:38:07 | FromDiscord | <notchris> the white one, copy it |
02:38:12 | FromDiscord | <notchris> rename is libraylib.so |
02:38:20 | FromDiscord | <notchris> (edit) "is" => "it" |
02:38:20 | FromDiscord | <iWonderAboutTuatara> right, it tells me they're the same file |
02:38:37 | FromDiscord | <iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782435318019653682/unknown.png |
02:38:40 | FromDiscord | <notchris> then rename the one with the @ to something else for a second |
02:38:48 | FromDiscord | <notchris> then try to copy the other one |
02:38:50 | FromDiscord | <notchris> and rename it |
02:39:03 | FromDiscord | <notchris> or |
02:39:11 | FromDiscord | <notchris> change the line in your raylib.nim |
02:39:18 | FromDiscord | <notchris> to point to libraylib.so.3.0.0 |
02:39:25 | FromDiscord | <iWonderAboutTuatara> oh |
02:39:41 | FromDiscord | <iWonderAboutTuatara> I just moved libraylib.so to libraylib2.so |
02:39:48 | FromDiscord | <notchris> k |
02:39:52 | FromDiscord | <iWonderAboutTuatara> and copied 3.0.0 to .so |
02:39:55 | FromDiscord | <notchris> nicee |
02:40:07 | FromDiscord | <notchris> now make sure u remove ur nim apps binary and then re-run |
02:40:37 | FromDiscord | <iWonderAboutTuatara> I still get the same error |
02:41:17 | FromDiscord | <notchris> take a pic of the dir files |
02:41:27 | FromDiscord | <notchris> now that youve renamed |
02:41:31 | FromDiscord | <iWonderAboutTuatara> https://media.discordapp.net/attachments/371759389889003532/782436040933376070/unknown.png |
02:42:00 | FromDiscord | <notchris> why is is u/l/lib |
02:42:03 | FromDiscord | <notchris> does it just truncate the names |
02:42:11 | FromDiscord | <iWonderAboutTuatara> in the display yeah |
02:42:16 | FromDiscord | <notchris> gotcha |
02:43:40 | FromDiscord | <notchris> hmm |
02:43:44 | FromDiscord | <notchris> wait are those all in a cmake dir |
02:43:51 | FromDiscord | <notchris> not in usr/local/lib/cmake |
02:44:06 | FromDiscord | <notchris> or is that in the same dir |
02:44:17 | FromDiscord | <notchris> yeah nm |
02:44:21 | FromDiscord | <iWonderAboutTuatara> no it's just in the same dir yeah |
02:44:31 | FromDiscord | <iWonderAboutTuatara> it shares a dir with /cmake |
02:45:13 | FromDiscord | <notchris> try adding |
02:45:20 | FromDiscord | <notchris> `-d:nimDebugDlOpen` to your build command |
02:45:41 | FromDiscord | <notchris> maybe you can find out where its looking for the file |
02:49:25 | FromDiscord | <notchris> @Trustable |
02:49:25 | FromDiscord | <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:28 | FromDiscord | <notchris> oops |
02:49:30 | FromDiscord | <iWonderAboutTuatara> lmaooo |
02:49:36 | FromDiscord | <notchris> @iWonderAboutTuatara Maybe try this |
02:49:39 | FromDiscord | <notchris> in raylib.nim |
02:49:45 | FromDiscord | <notchris> https://media.discordapp.net/attachments/371759389889003532/782438117457133568/Screen_Shot_2020-11-28_at_9.49.18_PM.png |
02:49:54 | FromDiscord | <notchris> see how i added the path to the pragma |
02:50:03 | FromDiscord | <notchris> idk if thats standard, but it didn't break my proj |
02:50:33 | FromDiscord | <iWonderAboutTuatara> still failed |
02:50:38 | FromDiscord | <notchris> did you remove the binary |
02:50:39 | FromDiscord | <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:42 | FromDiscord | <iWonderAboutTuatara> but it updated |
02:50:45 | FromDiscord | <notchris> oh ok |
02:50:46 | FromDiscord | <notchris> hm |
02:50:47 | FromDiscord | <iWonderAboutTuatara> do you need to rm the bianary? |
02:50:48 | FromDiscord | <iWonderAboutTuatara> wil try that |
02:50:58 | FromDiscord | <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:41 | FromDiscord | <iWonderAboutTuatara> oh wait no that wa sjust be being dumb |
02:51:48 | FromDiscord | <iWonderAboutTuatara> it worked now |
02:51:55 | FromDiscord | <notchris> Wooooo |
02:51:57 | FromDiscord | <iWonderAboutTuatara> but it can't find raygui.so |
02:52:00 | FromDiscord | <notchris> correct |
02:52:15 | FromDiscord | <iWonderAboutTuatara> ok so that's intentional? |
02:52:21 | FromDiscord | <iWonderAboutTuatara> how do I get raygui.so? |
02:52:22 | FromDiscord | <notchris> https://github.com/raysan5/raygui |
02:52:24 | FromDiscord | <notchris> you have to build it |
02:52:28 | FromDiscord | <notchris> with like cmake |
02:53:01 | FromDiscord | <notchris> it was less easy for me than raylib on osx |
02:53:06 | FromDiscord | <notchris> hopefuly it wont be hard for you |
02:54:23 | FromDiscord | <iWonderAboutTuatara> oh and do the same thing with this |
02:54:23 | FromDiscord | <iWonderAboutTuatara> got it |
02:54:25 | FromDiscord | <iWonderAboutTuatara> thanks! |
02:54:44 | FromDiscord | <notchris> i think you want to build in `https://github.com/raysan5/raygui/tree/master/projects/CMake` |
02:54:59 | FromDiscord | <notchris> np good luck! |
02:55:59 | FromDiscord | <iWonderAboutTuatara> so when I distribute this, what do I do with libraylib.so? |
02:56:05 | FromDiscord | <iWonderAboutTuatara> also, how do I compile this for other platforms? |
02:56:23 | FromDiscord | <iWonderAboutTuatara> will it be built into the binaries? |
02:56:56 | FromDiscord | <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:05 | FromDiscord | <iWonderAboutTuatara> to make it easier to manage |
02:57:09 | FromDiscord | <notchris> nice |
02:57:15 | FromDiscord | <notchris> i cannot answer those questions |
02:57:19 | FromDiscord | <notchris> not experienced enough |
02:57:32 | FromDiscord | <notchris> but it seems like you should be able to compile |
02:57:49 | FromDiscord | <iWonderAboutTuatara> and the binary should hopefully work on other machines without too much fiddling? |
02:58:08 | FromDiscord | <notchris> My guess is yes, but i don't know exactly how it works |
02:59:28 | FromDiscord | <iWonderAboutTuatara> Thanksf or the help! |
02:59:34 | FromDiscord | <iWonderAboutTuatara> I guess I'll cross that bridge when I get to it |
02:59:36 | FromDiscord | <iWonderAboutTuatara> thank you! |
02:59:46 | FromDiscord | <notchris> haha np man, good luck and have fun |
03:02:56 | FromDiscord | <iWonderAboutTuatara> weirdly, removing the gui code then running doesn't spawn a window |
03:03:15 | FromDiscord | <notchris> you tested the basic example? |
03:03:42 | FromDiscord | <notchris> hmm |
03:03:59 | FromDiscord | <notchris> try this one https://github.com/Guevara-chan/Raylib-Forever/blob/master/examples/core/camera_2d.nim |
03:10:24 | FromDiscord | <iWonderAboutTuatara> still no |
03:10:28 | FromDiscord | <iWonderAboutTuatara> weird |
03:11:38 | FromDiscord | <iWonderAboutTuatara> seems to be a wsl issue |
03:14:04 | FromDiscord | <iWonderAboutTuatara> it's looking like I should just use native windows instead of wsl |
03:18:40 | FromDiscord | <ElegantBeef> ~~Or native linux~~ |
03:19:12 | FromDiscord | <ElegantBeef> Are you attempting to run the linux build throug the cli? |
03:22:35 | * | wiml quit (Quit: Leaving) |
03:27:00 | ForumUpdaterBot | New thread by Niminem: I make my first $ with Nim in two days, see https://forum.nim-lang.org/t/7172 |
03:28:33 | FromDiscord | <Revenant> hiya, i'm trying do give `{.byaddr.}` a nicer syntax. this is my unsuccessful attempt so far: |
03:28:55 | FromDiscord | <Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSg |
03:29:16 | FromDiscord | <Revenant> but i'm just getting this error |
03:29:30 | FromDiscord | <Revenant> any tips? |
03:29:30 | FromDiscord | <Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSh |
03:29:42 | FromDiscord | <Revenant> (edit) "do" => "to" |
03:30:47 | * | Evolver joined #nim |
03:31:54 | FromDiscord | <Revenant> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2FSi |
03:49:08 | FromDiscord | <Revenant> okay, i got it to work... kinda... not sure what the implications of setting `typ` always to `nil` are though |
03:49:19 | FromDiscord | <Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2FSl |
03:54:49 | FromDiscord | <iWonderAboutTuatara> yeah I realized that you can't really mae the linux cli pop a window |
03:54:53 | FromDiscord | <iWonderAboutTuatara> so I have to use windows |
04:01:32 | FromDiscord | <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:03 | FromGitter | <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:41 | FromDiscord | <ElegantBeef> You can use IRC, Matrix, or Discord 😄 |
04:16:49 | FromDiscord | <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:47 | FromDiscord | <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:15 | leorize[m]1 | wdym? |
05:50:09 | * | bung quit (Ping timeout: 265 seconds) |
05:56:24 | * | bung joined #nim |
06:08:23 | FromDiscord | <InventorMatt> like i have a seq of indices for a nimnode and want to access that index just using a seq |
06:09:05 | FromDiscord | <InventorMatt> so instead of foo[0][1][0] i can do foo[@[0,1,0]] |
06:14:16 | FromDiscord | <ElegantBeef> @InventorMatt how about this? https://play.nim-lang.org/#ix=2FSE |
06:15:17 | FromDiscord | <ElegantBeef> Varargs also works like an open array, so should be fine? |
06:16:42 | FromDiscord | <ElegantBeef> Alternatively you can replace it with an `openArray[int]` to not interfere with the normal `[]` |
06:29:41 | FromDiscord | <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:26 | FromDiscord | <ElegantBeef> Weirdly it seems to be copying |
06:47:08 | FromDiscord | <InventorMatt> I probably messed up changing it to a var incorrectly |
06:48:42 | FromDiscord | <ElegantBeef> I mean NimNode is a ref object so it shouldnt require `var` afaik |
06:50:19 | FromDiscord | <InventorMatt> I probably did it wrong then |
06:50:31 | FromDiscord | <ElegantBeef> I mean i'm having issues aswell so... 😄 |
06:52:17 | FromDiscord | <ElegantBeef> guess might have to use templates or macros |
06:54:53 | FromDiscord | <InventorMatt> I was thinking a macro would work but I wanted to test my options first |
06:55:07 | FromDiscord | <ElegantBeef> Yea i thought the proc would work due to them being ref objects |
07:04:04 | FromDiscord | <ElegantBeef> @InventorMatt Well i just made the macro if you want it https://play.nim-lang.org/#ix=2FSL |
07:06:03 | FromDiscord | <InventorMatt> awesome, thanks. |
07:07:04 | FromDiscord | <ElegantBeef> Hmm technically that could be a generic indention method |
07:07:23 | FromDiscord | <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:50 | FromDiscord | <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:46 | FromDiscord | <ElegantBeef> Does it matter? |
07:24:03 | FromDiscord | <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:26 | FromDiscord | <ElegantBeef> There has to be a better way 😄 |
07:25:52 | FromDiscord | <ElegantBeef> I mean than my macro |
07:25:59 | * | habamax joined #nim |
07:27:12 | FromDiscord | <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:13 | audiofile | why nim have max limit on integer size unlike python |
07:47:55 | FromDiscord | <ElegantBeef> Cause nim is statically typed and uses fixed size ints |
07:48:32 | mipri | it's not a python clone. nimble search bignum and you'll find a few libraries that'll give you those. |
07:50:05 | FromDiscord | <ElegantBeef> Dynamically sized ints are a bit hard to deal with you want stack allocated types 😄 |
07:52:10 | audiofile | oh I see, didn't know it was based on beign statically typed! thanks for explain |
07:52:26 | audiofile | the uniform function call syntax is cool! |
07:52:28 | FromDiscord | <ElegantBeef> Well you can do dynamically sized ints but it gets weird to do arrays |
07:53:20 | FromDiscord | <ElegantBeef> Afaik it's a performance/usabillity thing |
07:54:10 | audiofile | like dynamically resizing memory if int is too big? |
07:54:28 | mipri | the 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:27 | mipri | computers 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:47 | FromDiscord | <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:52 | mipri | but again you have them if you want. |
07:56:40 | FromDiscord | <ElegantBeef> I guess i'm bringing in the type system just cause i'm daft 😄 |
07:57:34 | audiofile | what is the differencee between 'ref object of' and 'object of' is it call by reference vs call by value? |
07:57:52 | FromDiscord | <ElegantBeef> one is a reference object, one isnt |
07:58:17 | audiofile | reference object meaning if I change a value, the referred object's value is also changed right? |
07:58:23 | FromDiscord | <ElegantBeef> Yea |
07:58:26 | mipri | it's reference semantics vs. value semantics, yes. basically what you're thinking of. |
07:58:53 | audiofile | thanks I needed those search keywords |
07:59:27 | audiofile | also % is used for creating json object ??? |
07:59:36 | audiofile | I find it a bit odd that there is an operator just for that |
07:59:57 | mipri | https://nim-lang.org/docs/json.html#%25%2Cstring |
08:00:11 | mipri | it's not a built-in operator, the json library defines it |
08:00:16 | audiofile | overloading? |
08:00:27 | audiofile | interesting! |
08:00:38 | audiofile | first time encountering a library defining a symbol hmm |
08:01:18 | mipri | strformat gives you &"strings" by defining `&`. system has `$` for stringification |
08:02:09 | audiofile | oh didn't realize those were libraries mb |
08:02:22 | audiofile | what does % do then if json is not imported |
08:02:34 | audiofile | not sure how it should be used otherwise, if it is at all being used |
08:02:48 | mipri | it doesn't do anything. |
08:03:00 | mipri | https://play.nim-lang.org/#ix=2FT6 <- you should define operators more sparingly than this. |
08:03:13 | mipri | but obviously %%% isn't a prefix operator that exists in the language that that code is just overloading |
08:04:05 | FromDiscord | <ElegantBeef> Nim has userdefined operators |
08:04:12 | mipri | https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
08:05:39 | * | vicfred quit (Quit: Leaving) |
08:06:34 | * | vicfred joined #nim |
08:06:46 | FromDiscord | <iWonderAboutTuatara> I seem to be getting the same issues I was having on linux on windows |
08:07:04 | FromDiscord | <iWonderAboutTuatara> I ahve libraylib.dll located inside my folder |
08:07:08 | FromDiscord | <iWonderAboutTuatara> right next to the script |
08:07:13 | FromDiscord | <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:54 | FromDiscord | <iWonderAboutTuatara> I really do not understand these errors at all |
08:44:04 | FromDiscord | <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:15 | FromDiscord | <cabboose> Try Dependency Walker do see whether the dll has dependencies too |
08:47:00 | FromDiscord | <iWonderAboutTuatara> would it give me a "could not load error" if that were the case? |
08:47:04 | FromDiscord | <iWonderAboutTuatara> but raylib has no dependencies |
08:50:02 | FromDiscord | <Imperatorn> Is it the right raylib.dll tho? 🤔 |
08:51:01 | FromDiscord | <Imperatorn> I did some experimentation with raylib in D two weeks ago and Iirc there are multiple libs |
08:54:00 | FromDiscord | <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:54 | FromDiscord | <iWonderAboutTuatara> I'm not sure if it's the right one @Imperatorn |
09:26:05 | FromDiscord | <iWonderAboutTuatara> I downloaded the mingw64 binaries and dll |
09:26:34 | FromDiscord | <iWonderAboutTuatara> from the relases on github |
09:26:39 | FromDiscord | <Imperatorn> Hmm, not at my computer atm. But I think I used the msvc one |
09:26:47 | FromDiscord | <iWonderAboutTuatara> oh the msvc one? |
09:26:50 | FromDiscord | <Imperatorn> Not sure |
09:26:55 | FromDiscord | <iWonderAboutTuatara> will try that |
09:27:00 | FromDiscord | <iWonderAboutTuatara> It hink nim uses mingw though |
09:28:40 | FromDiscord | <iWonderAboutTuatara> that did it! |
09:28:43 | FromDiscord | <iWonderAboutTuatara> That was the entire problem |
09:28:49 | FromDiscord | <iWonderAboutTuatara> wow, the amount of time I spent troubleshooting that |
09:28:54 | FromDiscord | <iWonderAboutTuatara> thanks @Imperatorn you legend |
09:29:43 | FromDiscord | <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:28 | FromDiscord | <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:30 | FromDiscord | <Imperatorn> @iWonderAboutTuatara np |
09:30:55 | FromDiscord | <tomck> bit lost here... can i get a pointer to an `openArray[T]`? |
09:33:25 | FromDiscord | <iWonderAboutTuatara> I'm a little bit confused by what you're trying to do here |
09:33:46 | FromDiscord | <ElegantBeef> This is just a minimal example of them capturing an open array inside an anonymous proc |
09:33:55 | FromDiscord | <iWonderAboutTuatara> oh I see not a direct thing |
09:34:16 | FromDiscord | <iWonderAboutTuatara> weird that the compiler dislikes this, doesn't seem lke it should be unsane |
09:34:18 | FromDiscord | <iWonderAboutTuatara> unsafe |
09:35:16 | FromDiscord | <ElegantBeef> Well the array is lent |
09:35:28 | FromDiscord | <InventorMatt> with a seq and probably an array it appears to works fine |
09:36:26 | FromDiscord | <iWonderAboutTuatara> it works for seq |
09:36:38 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:36:43 | FromDiscord | <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:25 | FromDiscord | <iWonderAboutTuatara> https://play.nim-lang.org/#ix=2FTr |
09:38:28 | FromDiscord | <iWonderAboutTuatara> this is a workaround |
09:38:49 | FromDiscord | <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:53 | FromDiscord | <iWonderAboutTuatara> (edit) "lenght" => "length" |
09:39:06 | FromDiscord | <iWonderAboutTuatara> this works fine for this example |
09:39:28 | FromDiscord | <iWonderAboutTuatara> It's apparently safe to copy arrays & seq but not openarray, because of some implementation detail |
09:42:03 | FromDiscord | <tomck> can i just hack around it with pointers inside the function, rather than messing up my api like that? |
09:42:37 | FromDiscord | <tomck> basically:↵↵If I have a `ptr T`, how can i access `T[1]`? (since `T[]` is just `T[0]`) |
09:42:59 | FromDiscord | <ElegantBeef> you do `ptr uncheckedArray[T}` |
09:43:13 | FromDiscord | <tomck> ok |
09:43:15 | FromDiscord | <ElegantBeef> (edit) "uncheckedArray[T}`" => "uncheckedArray[T]`" |
09:43:24 | FromDiscord | <tomck> how do i get from openArray to uncheckedArray? |
09:43:37 | FromDiscord | <ElegantBeef> You probably cant |
09:43:48 | FromDiscord | <ElegantBeef> Rather shouldnt |
09:44:16 | FromDiscord | <tomck> ok, how do i get from `ptr T` to `ptr uncheckedArray[T]`? |
09:44:30 | FromDiscord | <ElegantBeef> Cast |
09:45:42 | FromDiscord | <tomck> ahhhh got it, i was trying to cast from `ptr T` to `uncheckedArray[T]`, rather than `ptr uncheckedArray[T]`, thanks |
09:45:48 | FromDiscord | <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:09 | kiwi_83 | when should I use the distinct eyword |
10:49:21 | kiwi_83 | https://nim-by-example.github.io/types/distinct/ this one |
10:49:56 | * | bung quit (Ping timeout: 272 seconds) |
10:51:07 | FromDiscord | <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:47 | narimiran | A 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:30 | FromDiscord | <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:27 | FromDiscord | <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:02 | FromDiscord | <Rika> do you remember the hint module things in nim 1.0? |
13:33:04 | FromDiscord | <Rika> those are the dots |
13:33:08 | FromDiscord | <Rika> one dot per line |
13:33:28 | FromDiscord | <Rika> like "Hint: Processing system" or whatever i forgot |
13:34:49 | FromDiscord | <sheerluck> I think `--verbosity:0` should mean "no dots" |
13:36:10 | FromDiscord | <Rika> it should, imo |
13:36:15 | FromDiscord | <Rika> im just explaining what they are |
13:36:42 | * | bouzu_ quit (Quit: Leaving) |
13:37:34 | leorize[m]1 | @sheerluck you can add --hints:off to get rid of the dots |
13:37:43 | FromDiscord | <sheerluck> oh |
13:38:07 | FromDiscord | <sheerluck> thank you! |
13:38:34 | * | PMunch joined #nim |
13:38:56 | FromDiscord | <lqdev> Rika it was `Hint: system [Processing]` |
13:39:00 | leorize[m]1 | why verbosity 0 doesn't disable hints I'm not sure, but no one has ever PR-ed something to change that afaik |
13:41:33 | FromDiscord | <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:04 | FromDiscord | <exelotl> cast[ptr UncheckedArray[T]] is so long to type lol |
14:18:06 | * | shad0w_ quit (Remote host closed the connection) |
14:21:56 | FromDiscord | <haxscramper> Implicit "unsafe protection" by making everything long to type |
14:22:01 | * | shad0w_ joined #nim |
14:22:34 | Evolver | Is https://snapcraft.io/nim-lang safe to install? |
14:23:11 | FromDiscord | <haxscramper> Most likely yes, but I would recommend using `choosenim` - https://nim-lang.org/install_unix.html |
14:24:00 | FromDiscord | <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:18 | leorize[m]1 | Evolver: its not officially supported by the project but the author of the snap do frequent the forum |
14:28:47 | FromGitter | <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:42 | FromDiscord | <haxscramper> I think you can just do `let text = stdin.readAll()` or `for line in stdin.lines: echo line` |
14:31:39 | FromGitter | <lf-araujo> thanks, will try this |
14:32:20 | FromDiscord | <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:50 | FromGitter | <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:46 | Evolver | Can't the Nim people at least have a free book? What's up with the one non-free book? |
14:58:15 | Evolver | Python probably has had a dozen free books for a dozen years |
14:58:51 | FromDiscord | <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:58 | Evolver | ok thx |
14:59:58 | FromDiscord | <ProfessorEevee> What would be the Nim variant of `def init(self)` for classes/object types? |
15:00:06 | FromDiscord | <ProfessorEevee> (edit) "types?" => "types in Python?" |
15:01:12 | FromDiscord | <ProfessorEevee> sent a code paste, see https://play.nim-lang.org/#ix=2FWn |
15:01:35 | FromDiscord | <ProfessorEevee> lol I don't think I know the right terminology to ask my question properly |
15:02:10 | FromDiscord | <Rika> proc initPerson(<arguments here>): Person = ... |
15:02:38 | FromDiscord | <ProfessorEevee> ah so I would have to do it manually |
15:03:14 | FromDiscord | <haxscramper> Yes, right now implicit initialization is not supported. Default-constructed objects are zero-filled memory |
15:04:21 | FromDiscord | <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:36 | PMunch | Uhm: Error: type mismatch: got <Constraint> but expected 'Constraint = object' |
17:17:12 | Evolver | Is there a link to recommended tutorial/conference videos on the Nim website? If not, should there be? |
17:21:33 | PMunch | Hmm, there isn't one no |
17:21:50 | PMunch | You can start with the ones from NimConf 2020 |
17:21:57 | PMunch | Those are all pretty good |
17:22:44 | * | junland quit (Quit: %ZNC Disconnected%) |
17:23:32 | * | junland joined #nim |
17:26:05 | FromDiscord | <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:09 | Evolver | HN 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:16 | FromDiscord | <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:31 | FromDiscord | <haxscramper> `parseInt()` |
17:34:56 | FromDiscord | <haxscramper> https://nim-lang.org/docs/strutils.html#parseInt%2Cstring |
17:35:57 | FromDiscord | <ProfessorEevee> ah yep. thank you |
17:36:44 | * | junland quit (Quit: %ZNC Disconnected%) |
17:37:35 | * | junland joined #nim |
17:50:41 | FromDiscord | <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:38 | PMunch | Well you can have it generic |
17:53:24 | PMunch | https://play.nim-lang.org/#ix=2FXn |
17:54:56 | FromDiscord | <For Your Health> Interesting, I will try that out. Thanks! |
17:58:13 | PMunch | Curiously enough the object doesn't have to actually use the generic |
17:58:27 | PMunch | So you can use this to add compile-time only values to a type |
18:00:50 | FromGitter | <pebauer68> where could i find an example for addTimer() ? |
18:02:51 | FromGitter | <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:09 | FromDiscord | <dk> dumb question: how do you reraise in the except clause? |
18:05:51 | bung | @zah you there? |
18:08:27 | Zevv | !last disruptek |
18:08:28 | disbot | disruptek spoke in 12disbot 23 hours ago |
18:08:47 | Zevv | unmute the dude please, he'll behave |
18:08:51 | Zevv | for a day or two |
18:10:28 | PMunch | I can't remember how to do it.. |
18:11:23 | FromDiscord | <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:36 | FromDiscord | <haxscramper> Just `raise` with no arguments |
18:11:50 | PMunch | Did that do the trick? |
18:16:11 | FromDiscord | <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:38 | FromDiscord | <neow> hello, I'd like to ask for help |
20:29:56 | FromDiscord | <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:13 | FromDiscord | <lqdev> @neow https://nim-lang.org/docs/bitops.html see `testBit` |
20:33:32 | FromDiscord | <lqdev> unfortunately its anchor is broken so i didn't link to it |
20:36:06 | FromDiscord | <neow> oh thanks a lot |
20:36:11 | FromGitter | <ynfle> What's the best way to "reset" a `seq`? ie. should I use `setLen(0)`? |
20:36:23 | FromDiscord | <neow> I was looking for the "byte" and "bit" library but bitops has escaped my attention |
20:36:39 | Prestige | @ynfle yes |
20:36:59 | FromGitter | <ynfle> Thanks |
20:37:57 | FromDiscord | <Quibono> Is there any interest in a library to handle currency data? |
20:41:05 | Prestige | probably |
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:25 | FromGitter | <deech> Is there a way to include some C/C++ header files in a Nimble package? |
21:05:49 | PMunch | Sure, just put them in the folder? |
21:05:55 | FromDiscord | <lqdev> @deech it should just work out of the box |
21:05:56 | mipri | https://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:00 | FromDiscord | <lqdev> unless it's a hybrid package |
21:06:39 | FromDiscord | <lqdev> in which case you need to change your installExt variable in the .nimble file to `installExt = @["nim", "c", "h"]` or something |
21:07:26 | FromGitter | <deech> How do I use them in a dependency? Can I just do `{.emit: "#include "someHeader.H".}` |
21:08:53 | FromGitter | <deech> Presumably the compiler's `--cincludedirs` flag needs to know where it is? |
21:10:16 | mipri | in 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:29 | mipri | and {.pop.} after the definitions that use it |
21:11:26 | FromDiscord | <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:57 | FromGitter | <deech> That makes sense but what is the header path when used in a dependency? |
21:12:46 | * | narimiran quit (Quit: leaving) |
21:14:05 | mipri | C 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:17 | FromGitter | <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:15 | mipri | the 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:14 | FromDiscord | <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:23 | mipri | that's an impressive gap in functionality |
21:58:03 | mipri | nim-regex can do it with a limit of 1 |
21:59:05 | mipri | !eval import regex; echo "this this".replace(re"this", "like", limit = 1) # if the bot has that |
21:59:13 | NimBot | like this |
22:00:35 | FromDiscord | <j-james> wow, yikes |
22:02:24 | * | hmmm joined #nim |
22:05:38 | FromDiscord | <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:27 | mipri | easier than what? the easy way is to use a regex again. |
22:11:37 | * | bung quit (Ping timeout: 264 seconds) |
22:14:05 | FromDiscord | <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:45 | FromDiscord | <j-james> oh, i didn't mean easier than, whoops |
22:15:08 | FromDiscord | <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:10 | FromDiscord | <j-james> getting the total number of substrings within a string is a seperate problem i haven't found an answer to |
22:15:45 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nre.html#findAll%2Cstring%2CRegex%2Cint |
22:16:37 | FromDiscord | <j-james> ah, thank you |
22:18:09 | * | superbia joined #nim |
22:21:12 | FromDiscord | <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:40 | hmmm | is there a lib that can parse "1.000.000,00 " as int one million |
22:37:59 | superbia | how do you parse 1.000.000,50 |
22:41:55 | * | bung joined #nim |
22:42:08 | FromDiscord | <Quibono> Dat internationalization support do. |
22:42:36 | FromDiscord | <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:56 | FromDiscord | <ElegantBeef> hmmm this is what i'd do https://play.nim-lang.org/#ix=2FYD |
22:50:28 | FromDiscord | <ElegantBeef> Doesnt work for non iternational, but you can fix that 😛 |
22:50:41 | FromDiscord | <Quibono> ElegantBeef I'm kinda disgusted to finish what I was going to do. |
22:50:53 | FromDiscord | <Quibono> Now that I've seen a decent way to do it. |
22:51:04 | FromDiscord | <ElegantBeef> It's not that decent as it's not universal |
22:51:34 | FromDiscord | <Quibono> https://play.nim-lang.org/#ix=2FYE |
22:51:38 | FromDiscord | <Quibono> This is how far I got lol |
22:51:43 | FromDiscord | <Quibono> It would be universal tho. |
22:52:23 | * | a_chou joined #nim |
22:52:24 | FromDiscord | <ElegantBeef> mine or yours? |
22:52:31 | FromDiscord | <Quibono> Mine but I didn't finish |
22:52:37 | FromDiscord | <Quibono> Because it's ugly as sin |
22:52:59 | FromDiscord | <ElegantBeef> Well mine just needs a flag of "decimalComma" |
22:53:24 | FromDiscord | <Quibono> Also thanks for using a case statement, because I've yet to use one and they seem nice. |
22:54:22 | FromDiscord | <ElegantBeef> Lol no problem |
22:55:12 | FromDiscord | <ElegantBeef> An issue i see that's hard to solve for automatically, is something like `100.350` |
22:55:38 | FromDiscord | <ElegantBeef> Where it's ambigious if it's a decimal or 100s seperator |
22:55:50 | FromDiscord | <Quibono> Unless like you knew it was a currency. |
22:56:05 | FromDiscord | <Quibono> (One which only had two places specifically) |
22:56:07 | * | bunbunbunbunny joined #nim |
22:56:27 | FromDiscord | <ElegantBeef> Yea in this case i chose a bad right hand cause a decimal would drop the 0 |
22:56:42 | bunbunbunbunny | hey all |
22:56:45 | * | nixfreak joined #nim |
22:56:54 | FromDiscord | <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:56 | bunbunbunbunny | pretty new to nim and just wondering how can i pass a mutable sequence to a proc? |
22:57:04 | FromDiscord | <ElegantBeef> `var seq[T]` |
22:57:28 | FromDiscord | <ElegantBeef> C# changes float stringification based off your language and it just invites issues |
22:57:47 | bunbunbunbunny | so the param input would be (my_variable_name: var seq[int])? |
22:57:49 | FromDiscord | <ElegantBeef> You forget that then you send something to someone that uses commas, and it fails to work |
22:57:52 | FromDiscord | <ElegantBeef> yep |
22:58:09 | FromDiscord | <ElegantBeef> The snake casing hurts me 😛 |
22:58:19 | bunbunbunbunny | oh do we not use snake case? |
22:58:30 | FromDiscord | <ElegantBeef> Snake casing is not Nim idiomatic |
22:58:35 | FromDiscord | <ElegantBeef> It doesnt really matter |
22:58:41 | bunbunbunbunny | camelcase? |
22:58:45 | FromDiscord | <ElegantBeef> Yea |
22:58:48 | bunbunbunbunny | gotcha |
22:58:58 | FromDiscord | <Quibono> @ElegantBeef When can we get Black for nim? 😮 |
22:59:00 | FromDiscord | <ElegantBeef> But like i said it doesnt matter as `my_variable_name` is the same as `myVariableName` in nim |
22:59:14 | FromDiscord | <ElegantBeef> We drop casing after first character and remove `_` |
22:59:14 | bunbunbunbunny | yep |
22:59:25 | bunbunbunbunny | is this a common error: Unhandled exception: index -1 not in 0 .. 14 [IndexDefect]? |
22:59:33 | bunbunbunbunny | not sure why its giving me this |
22:59:41 | FromDiscord | <ElegantBeef> cause you're indexing with -1 |
22:59:51 | bunbunbunbunny | hmm |
22:59:52 | FromDiscord | <ElegantBeef> are you trying to get the backwards index? `length -1`? |
23:00:05 | bunbunbunbunny | yeah i used this: for i, val in arr_to_sort[1 .. ^1]: |
23:00:06 | FromDiscord | <ElegantBeef> if so `[^1]` gives that |
23:00:20 | FromDiscord | <ElegantBeef> is the arr empty? |
23:00:35 | bunbunbunbunny | nope |
23:01:17 | bunbunbunbunny | ah nvm i found my bug |
23:01:17 | bunbunbunbunny | :D |
23:01:32 | FromDiscord | <ElegantBeef> are your purposely removing `0` from that selection? |
23:01:43 | bunbunbunbunny | yeah i wanted to iterate from the 1st element -> last |
23:02:13 | FromDiscord | <ElegantBeef> So... the second element? 😛 |
23:02:37 | FromDiscord | <ElegantBeef> First to last would be `0..^1` |
23:02:43 | bunbunbunbunny | o |
23:02:51 | bunbunbunbunny | first as in second i mean |
23:02:55 | bunbunbunbunny | i go by 0 based |
23:03:20 | FromDiscord | <ElegantBeef> Yea but it's not zeroth element, it's the first element 😄 |
23:03:28 | bunbunbunbunny | lol true |
23:03:28 | bunbunbunbunny | :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:15 | voltist | What does the RangeDefect error mean? I can't find any info about it on the docs |
23:28:03 | * | bunbunbunbunny joined #nim |
23:28:42 | PMunch | Basically it's the exception that gets thrown when something is not in the right range |
23:28:57 | PMunch | !eval var x = @[1, 2]; echo x[3] |
23:29:00 | NimBot | /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:15 | PMunch | Oh, that's and IndexDefect |
23:29:20 | PMunch | !eval var x = @[1, 2]; echo x[0..3] |
23:29:24 | NimBot | /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:44 | PMunch | !eval var x: range[0..10]; x = 100 |
23:29:46 | NimBot | Compile failed: /usercode/in.nim(1, 26) Error: conversion from int literal(100) to range 0..10(int) is invalid |
23:29:53 | PMunch | Hmm |
23:31:54 | PMunch | !eval var x: range[0..10]; import strutils; x = parseInt("200") |
23:31:58 | NimBot | /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:03 | PMunch | Ah, there we go |
23:32:56 | voltist | Interesting |
23:32:59 | voltist | I'm getting "value out of range [RangeDefect]" |
23:38:54 | voltist | Oh hey I figured it out |
23:39:10 | voltist | I was trying to cast a number that is bigger than the largest int into an int |
23:40:05 | FromDiscord | <j-james> !eval import re; echo(len(findAll("testtest-test", re("\"))) |
23:40:09 | NimBot | Compile failed: /usercode/in.nim(1, 53) Error: invalid character constant |
23:40:54 | FromDiscord | <j-james> Does anyone know why Nim doesn't like a single escaped ``? |
23:41:05 | FromDiscord | <j-james> (the code above is actually `import re; echo(len(findAll("testtest-test", re("\")))`) |
23:43:57 | FromDiscord | <ElegantBeef> I think it's attempting to find the character `\` so you can do either `\\` or `"""\"""` |
23:44:27 | FromDiscord | <ElegantBeef> It gives `Error: invalid character constant` which is why i suspect that error |
23:46:37 | * | PMunch quit (Quit: leaving) |
23:46:42 | FromDiscord | <j-james> Hmm, that's very surprising |
23:47:04 | FromDiscord | <ElegantBeef> Not really |
23:47:25 | FromDiscord | <ElegantBeef> `\` is the escape character for special characters `\` isnt a special character as such it errors |
23:47:56 | FromDiscord | <ElegantBeef> you need to escape the escape character so that it interprets it as `\` which is what `\\` does |
23:48:22 | FromDiscord | <ElegantBeef> Or the triple string which inteprets everything as the actual raw characters |
23:48:43 | FromDiscord | <j-james> `` isn't the match-0-or-more character? |
23:48:48 | FromGitter | <raydf> Hello everyone, does anyone knows about some code example for dynamic loading of scripts for code-splitting with js backend? |
23:49:25 | FromGitter | <raydf> I would like to get something like dynamic imports: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5fc43385150b213e98025e2a] |
23:49:34 | FromDiscord | <ElegantBeef> james i suggest using regexpal and switching it over to the pcre mode to see what you need/want |
23:50:47 | FromDiscord | <ElegantBeef> Raydf nim's JS backend is aimed at clientside browsers, so uncertain how you dynamically load modules there |
23:51:05 | FromDiscord | <ElegantBeef> I suppose you could make a macro to `emit` the code you wanted? |
23:52:06 | FromGitter | <gogolxdong> Is there any browser kernel in Nim? |
23:53:50 | FromDiscord | <ElegantBeef> I cannot find one |
23:54:13 | FromDiscord | <ElegantBeef> There is https://github.com/jangko/nimCEF |
23:54:44 | FromGitter | <gogolxdong> Have you heard of miniblink? |
23:55:04 | FromDiscord | <ElegantBeef> Nopep |
23:55:35 | FromDiscord | <ElegantBeef> As a majority of it's readme is chinese i can see why i havent:D |
23:56:20 | FromGitter | <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:05 | FromDiscord | <ElegantBeef> Idk i've barely looked at the JS backend so i dont know how karax works |
23:57:29 | FromGitter | <raydf> ok, thx for the reply |
23:58:59 | FromDiscord | <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:50 | FromDiscord | <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 |