00:00:08 | nrds | <Prestige99> interesting |
00:00:48 | nrds | <Prestige99> Some people haven't been able to play my gamejam game because of glibc version issues, getting web working would be great.. |
00:01:07 | FromDiscord | <Elegantbeef> Just use appimage like a normal person |
00:01:15 | FromDiscord | <Elegantbeef> Or is glibc vs musl the issue? |
00:01:33 | nrds | <Prestige99> they're getting `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found` |
00:01:50 | nrds | <Prestige99> I think they're on 2.33 or something |
00:02:05 | FromDiscord | <Elegantbeef> Well appimage would solve that assuming you build it on an old enough libc |
00:02:23 | FromDiscord | <Elegantbeef> Would solve all your dependancy issues 😛 |
00:02:50 | nrds | <Prestige99> Yeah I'd have to find a way to do so. I tried building the game in a vm with debian stable, but then audio and image loading wouldn't work for some reason |
00:02:53 | nrds | <Prestige99> sdl would just crash at runtime |
00:03:50 | nrds | <Prestige99> same with building the .so files with github actions |
00:04:31 | FromDiscord | <huantian> 👀 that's kinda sick |
00:04:38 | FromDiscord | <Elegantbeef> Indeed |
00:04:53 | FromDiscord | <Elegantbeef> I will need to play with nlvm to get support in both eventually |
00:05:08 | FromDiscord | <huantian> now make it work with string 😏 |
00:05:22 | FromDiscord | <Elegantbeef> I mean i'm not doing any interop except with wasm primitives as of yet |
00:05:32 | FromDiscord | <Elegantbeef> I will try to make it work with complex objects and most datatypes eventually |
00:06:49 | FromDiscord | <Elegantbeef> I'm fairly certain strings will be like Cstrings |
00:07:02 | FromDiscord | <Elegantbeef> Where you request a string from host, it gives you a `ref` and then you do the operations there |
00:07:27 | FromDiscord | <huantian> yeah I'd assume strings would have to be refs |
00:07:32 | FromDiscord | <huantian> or ref-like |
00:07:38 | FromDiscord | <Elegantbeef> That or memory buffers |
00:07:45 | FromDiscord | <Elegantbeef> Eitherway with the Nim code they're going to be statically typed 😛 |
00:08:07 | FromDiscord | <Elegantbeef> The interop should be easier than nimscript atleast |
00:09:29 | FromDiscord | <Elegantbeef> Lol luckily for github email notifications i got to see a silly person needlessly insulting Nim developers 😄 |
00:10:13 | FromDiscord | <Elegantbeef> Anyway yea huan hopefully i can make life supremely easy |
00:10:15 | nrds | <Prestige99> weird group to target :P |
00:10:34 | nrds | <Prestige99> So why are you using wasm for scripting now? |
00:10:34 | FromDiscord | <huantian> nah we're too cool they were intimidated |
00:10:39 | nrds | <Prestige99> just speed? |
00:10:48 | FromDiscord | <Elegantbeef> I'm just doing it for funsies mostly |
00:11:00 | FromDiscord | <Elegantbeef> Plus my next game idea I want to have scripting |
00:11:10 | FromDiscord | <Elegantbeef> And i want it to be \safe( |
00:11:13 | FromDiscord | <Elegantbeef> safe even |
00:12:03 | nrds | <Prestige99> I need to add a UI system to my engine, I created a quick makeshift one during the gamejam |
00:12:07 | nrds | <Prestige99> when I realized I needed it |
00:12:37 | FromDiscord | <Elegantbeef> The benefit of WASM for scripting is it's language agnostic and sandboxed |
00:12:40 | FromDiscord | <Elegantbeef> I feel like those two benefits just make it compelling if it's ergonomic enough |
00:13:40 | FromDiscord | <Elegantbeef> Like realistically you can just setup the API then anyone can use any language to script with the API you give, there is no "You must use X language" |
00:13:44 | nrds | <Prestige99> That's pretty nice to have |
00:14:24 | FromDiscord | <Elegantbeef> The only downside is you need to have the toolchain, but given there are games that use the UE4 sdk for modding it's a very moot point 😄 |
00:16:36 | nrds | <Prestige99> What are you using for physics btw? |
00:16:47 | FromDiscord | <Elegantbeef> Also looking at methods of exporting functions to wasm the funniest was "-sEXPORT\_ALL=1\` |
00:16:51 | FromDiscord | <Elegantbeef> ah yes i want all procedures exported to WASM |
00:16:57 | FromDiscord | <Elegantbeef> What's this physics you speak of? |
00:17:15 | nrds | <Prestige99> Nothing built in to your engine for physics yet? |
00:17:24 | FromDiscord | <Elegantbeef> Have you seen my present project? |
00:17:31 | nrds | <Prestige99> yep |
00:17:35 | FromDiscord | <Elegantbeef> I clearly do not need physics |
00:17:48 | nrds | <Prestige99> Not for that project, no |
00:17:53 | nrds | <Prestige99> but that's not what I was asking |
00:18:01 | FromDiscord | <Elegantbeef> So then why would i have physics |
00:18:01 | FromDiscord | <Elegantbeef> 😄 |
00:18:19 | FromDiscord | <Elegantbeef> I'm not making a framework to rule all framewroks, i'm making a tool to make my game |
00:18:25 | nrds | <Prestige99> The same reason I have shader support but no shader usage in my games lol |
00:18:27 | FromDiscord | <Elegantbeef> If my game doesnt need physics my frameworrk doesnt need physics |
00:18:31 | nrds | <Prestige99> cool |
00:18:45 | FromDiscord | <Elegantbeef> Yea i dont believe in making tooling that isnt needed |
00:23:16 | FromDiscord | <Elegantbeef> The entire API of Truss3D is used or will be used in my project(instanced rendering is the only thing that's not presently, but will be for level rendering and particle systems) |
00:23:17 | FromDiscord | <Elegantbeef> There's a phrase in from scratch gamedev which is "Make a game not an engine" |
00:23:17 | FromDiscord | <Elegantbeef> 'Prestige is greatly annoyed by beef's response' |
00:24:00 | nrds | <Prestige99> Yeah I'm just doing the opposite :P |
00:24:09 | nrds | <Prestige99> More interested in the engine part tbh |
00:24:48 | nrds | <Prestige99> It sounds like appimages aren't going to help my issue, since I'd need to compile it with older deps anyway |
00:25:00 | nrds | <Prestige99> unless I was like on gentoo again, but that wasn't fun |
00:28:24 | nrds | <Prestige99> Wonder how godot does it |
00:31:14 | FromDiscord | <huantian> could you download an old glib version and appimage it with that |
00:31:50 | FromDiscord | <Elegantbeef> Assuming all the libraries are built with a equivlent glib i think so, though dont know how important that is |
00:32:33 | nrds | <Prestige99> Yeah I tried but then sdl would crash |
00:32:37 | nrds | <Prestige99> for some reason |
00:34:06 | nrds | <Prestige99> and all I would get for an error message was `[Exception]` |
00:35:26 | FromDiscord | <Elegantbeef> hmph i'm too dumb to know how to setup these link paths |
00:35:35 | FromDiscord | <Elegantbeef> Hard coding where wasmedge installed on my system is not ideal |
00:36:14 | nrds | <Prestige99> can you set LD_LIBRARY_PATH or do you mean something else? |
00:37:04 | FromDiscord | <Elegantbeef> I mean for compiling my files |
00:37:24 | FromDiscord | <Elegantbeef> have this dumb stuff `switch("passL", "-L/home/jason/.wasmedge/lib -lwasmedge_c")` |
00:38:55 | FromDiscord | <Elegantbeef> Dont think wasmedge is shipped on a package manager and doesnt install itself(by default) to `/usr` so .... uhhh there is no hardset include path |
00:39:17 | FromDiscord | <Elegantbeef> So i guess i need `-d:wasmedgePath:"/some/path"` |
00:39:44 | FromDiscord | <Elegantbeef> Can make a `nim.cfg` for that, so yea seems fine i guess |
00:41:20 | * | lumo_e quit (Ping timeout: 260 seconds) |
00:51:18 | * | pch joined #nim |
00:53:59 | FromDiscord | <Elegantbeef> Well huan if you want another update, i've made it so aside from libclang it's fully portable |
00:54:03 | FromDiscord | <huantian> what if you install wasmedge with your package lmao |
00:54:19 | FromDiscord | <huantian> oh neat, why does it depend on libclang? |
00:54:23 | FromDiscord | <Elegantbeef> Futhark |
00:54:53 | FromDiscord | <huantian> ah |
00:55:04 | FromDiscord | <huantian> also apparently wasmedge is on the aur lol |
00:55:08 | nrds | <Prestige99> nice |
00:55:33 | FromDiscord | <huantian> no idea what the status of that package is tho |
00:55:34 | FromDiscord | <Elegantbeef> I do want to eventually have a `-d:wasmEdgeSkipFuthark` so you can use the generated Nim file which would be hosted on the repo |
00:56:24 | FromDiscord | <Elegantbeef> But i need to talk to pmunch to see if i can get futhark to export the `.nim` in a sub directory with a custom name |
00:58:05 | FromDiscord | <Elegantbeef> Futhark's libclang dependancy will make life a bit fickle, but i do want to try to make this properly portable |
01:01:45 | * | noeontheend quit (Ping timeout: 260 seconds) |
01:20:29 | FromDiscord | <shlomo> hey is their a good guide for the following topics.↵runnable examples:↵testing: |
01:20:33 | FromDiscord | <shlomo> documentation: |
01:22:19 | FromDiscord | <Elegantbeef> Runnable examples are just used for docgen |
01:22:23 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#runnableExamples%2Cstring%2Cuntyped |
01:25:18 | FromDiscord | <shlomo> In reply to @Elegantbeef "Runnable examples are just": that makes sense. I come from python were you can create tests within the docstring of a function |
01:25:32 | FromDiscord | <Elegantbeef> Yea we dont do that here |
01:25:54 | FromDiscord | <shlomo> how would you recomend i Structure tests? |
01:25:57 | FromDiscord | <Elegantbeef> For tests you can checkout `std/unittests` testament or balls |
01:26:36 | FromDiscord | <!Patitotective> are nim binaries compatible between windows? should i build it on the lower supported or? 🤨 |
01:26:50 | FromDiscord | <!Patitotective> (edit) "windows?" => "windows versions?" |
01:26:53 | FromDiscord | <Elegantbeef> No clue i'd imagine 7-11 would be compatible |
01:27:04 | FromDiscord | <huantian> mmm maybe not 7 |
01:27:04 | FromDiscord | <Elegantbeef> Shit is that why they did it |
01:27:08 | FromDiscord | <huantian> 7 is deprecated at this point |
01:27:11 | FromDiscord | <Elegantbeef> Are they shilling 7-11? |
01:27:25 | FromDiscord | <huantian> 😳 |
01:27:53 | FromDiscord | <!Patitotective> actually i only can choose between windows 2022 or 2019 server https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job#choosing-github-hosted-runners lol |
01:29:29 | FromDiscord | <shlomo> In reply to @Elegantbeef "For tests you can": I just checked out the library its pretty cool. by the way why are certain people have BOT beside their name? |
01:30:29 | FromDiscord | <Elegantbeef> I'm from matrix |
01:30:42 | FromDiscord | <Elegantbeef> It's a chat protocol, bridged to discord |
01:30:48 | FromDiscord | <Elegantbeef> There are also irc users but non have talked |
01:32:46 | * | Amun-Ra talks |
01:34:37 | FromDiscord | <Elegantbeef> replies |
01:34:47 | FromDiscord | <Elegantbeef> Beep boop beep |
01:34:48 | FromDiscord | <huantian> continues making conversation |
01:35:09 | FromDiscord | <shlomo> I was honestly wondering whether the nim community had cracked ai ahead of everyone else 🙂 |
01:35:18 | FromDiscord | <Elegantbeef> They did |
01:35:28 | FromDiscord | <Elegantbeef> I mean did not |
01:35:28 | FromDiscord | <Elegantbeef> We are not cylons |
01:35:32 | FromDiscord | <!Patitotective> if i `nim c main --out:MyApp` on windows, will it output `MyApp.exe` or just `MyApp` 🤔 |
01:35:41 | FromDiscord | <Elegantbeef> `.exe` |
01:35:45 | FromDiscord | <!Patitotective> :] |
01:35:50 | FromDiscord | <Elegantbeef> Windows uses extensions like the silly OS it is |
01:36:20 | FromDiscord | <shlomo> In reply to @Elegantbeef "For tests you can": is their a good guide for testament I tried the docs and its a bit confusing for me |
01:36:32 | FromDiscord | <Elegantbeef> You know how you can tell if something is executable, there's a fucking executable flag?! |
01:36:56 | FromDiscord | <Elegantbeef> I do not really know, personally i use `unittests` for all my testing |
01:37:08 | FromDiscord | <Elegantbeef> If i didnt i'd probably use balls |
01:37:47 | termer | test these balls |
01:38:00 | FromDiscord | <Elegantbeef> Sorry i'm not a doctor |
01:38:35 | FromDiscord | <huantian> balls is cool |
01:40:34 | FromDiscord | <shlomo> it looks cool |
01:40:49 | FromDiscord | <Elegantbeef> What does? Disruptek's balls? |
01:40:57 | FromDiscord | <shlomo> yup |
01:40:59 | FromDiscord | <shlomo> i like em |
01:41:05 | FromDiscord | <Elegantbeef> Yes that's the joke he has setup for years |
01:41:16 | FromDiscord | <Elegantbeef> Used to be called his testes |
01:41:37 | FromDiscord | <huantian> 😳😏 |
01:42:34 | FromDiscord | <shlomo> In reply to @Elegantbeef "Yes that's the joke": hey if he implements a open source library he has the right 😂 |
01:51:24 | FromDiscord | <!Patitotective> im trying to make a nimble task that installs my app's dependencies and then use the binary library of one of those dependencies↵but it seems like in windows you need to end your current cmd.exe and open it again so it updates the enviroments variables (in this case `nimble/bin`) ↵so how could i make it work? maybe using the actual binary path? how should i get nimbles binaries path then 🤨 |
01:52:05 | FromDiscord | <Elegantbeef> Manually set the env variable |
01:54:22 | FromDiscord | <!Patitotective> what env variable would it be hehe |
01:54:37 | FromDiscord | <Elegantbeef> How the fuck am i supposed to know |
01:55:24 | FromDiscord | <!Patitotective> :[ |
02:00:34 | FromDiscord | <Elegantbeef> Wait if you just want to get it to run nimble, just path to nimble and use it |
02:21:29 | FromDiscord | <!Patitotective> `exec fmt"set PATH=""%PATH%;{expandTilde(\"~/.nimble/bin\")}"""` 🤔 |
02:25:31 | FromDiscord | <spoon> sent a code paste, see https://play.nim-lang.org/#ix=3WUS |
02:25:36 | FromDiscord | <spoon> i am very confused |
02:26:26 | FromDiscord | <spoon> (this is golf btw, best practices are out the window) |
02:26:32 | FromDiscord | <Elegantbeef> Are you purposely writing ugly code? |
02:26:38 | FromDiscord | <spoon> golf |
02:28:07 | FromDiscord | <spoon> except a semicolon takes up the same space as a newline so i should just use that |
02:28:49 | FromDiscord | <spoon> but i'm still completely lost as to why the first works but not the second |
02:29:29 | FromDiscord | <Elegantbeef> You're assigning k and using it |
02:30:21 | FromDiscord | <Elegantbeef> Also if you're going for code golf you're doing it wrong using `len()` |
02:30:46 | FromDiscord | <spoon> there's an operator for that? |
02:31:03 | FromDiscord | <Elegantbeef> `[1..^1]` |
02:31:16 | FromDiscord | <spoon> ah yeah, i knew i was missing something |
02:31:55 | FromDiscord | <spoon> so, what makes l able to be printed but not k? |
02:32:22 | FromDiscord | <spoon> the error it gives me is there is `undeclared identifier: 'k'` |
02:32:41 | FromDiscord | <Elegantbeef> Yes like i said you're doing `len(k)` inside k's assignment |
02:32:48 | FromDiscord | <spoon> ah yeahh |
02:33:05 | FromDiscord | <spoon> finals week moment |
02:33:06 | FromDiscord | <Elegantbeef> Also why isnt this single lined? |
02:33:17 | FromDiscord | <spoon> couldn't figure out how to format it |
02:34:48 | FromDiscord | <spoon> should probably be looking at some completed golf before do any more but i'll just redo my old ones |
02:35:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/rXr |
02:35:32 | FromDiscord | <Elegantbeef> There |
02:36:07 | FromDiscord | <Elegantbeef> the last split is wrong cause i dont know what it should do |
02:37:10 | FromDiscord | <spoon> parenthacy should also be moved to before the square brackets but yeah |
02:37:33 | FromDiscord | <spoon> aight i see now |
02:45:06 | FromDiscord | <spoon> (are emoji reactions even communicated over the bridge) |
02:49:32 | FromDiscord | <Elegantbeef> Nope reactions are not |
02:49:42 | FromDiscord | <Elegantbeef> Which is odd since matrix supports them and custom emojis work |
02:50:16 | FromDiscord | <huantian> Maybe it’s a discord thing |
02:50:23 | FromDiscord | <spoon> oh matrix got updated since i used it last |
02:50:28 | FromDiscord | <Elegantbeef> Well it's a bridge thing |
02:50:33 | FromDiscord | <spoon> didn't think it was going for feature parity |
02:50:48 | FromDiscord | <Elegantbeef> I might get fed up enough to make my own bridge with blackjacks and hookers |
02:50:59 | FromDiscord | <Elegantbeef> Eh it has more features than discord 😛 |
02:51:12 | FromDiscord | <spoon> does it? |
02:51:22 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/971242605771886653/image.png |
02:51:22 | FromDiscord | <Elegantbeef> 🙂 |
02:51:26 | FromDiscord | <Elegantbeef> Polls! |
02:51:33 | FromDiscord | <spoon> does it even have cross server emoji as an option |
02:51:46 | FromDiscord | <huantian> And it has threads from reply thingy now |
02:52:07 | FromDiscord | <Elegantbeef> Spoon custom discord emojis work across the bridge |
02:52:43 | FromDiscord | <spoon> yeah, just didn't know if it uploaded the emoji as a server emoji, used it, and deleted it to accomplish that |
02:53:19 | FromDiscord | <!Patitotective> zamn https://github.com/Patitotective/ImTemplate/runs/6283532715?check_suite_focus=true#step:4 :[ |
02:53:40 | FromDiscord | <!Patitotective> too descriptive |
03:13:35 | * | Zectbumo quit (Remote host closed the connection) |
03:23:25 | FromDiscord | <!Patitotective> back to github action shell https://media.discordapp.net/attachments/371759389889003532/971250666918010940/unknown.png |
03:23:27 | FromDiscord | <!Patitotective> (edit) "action shell" => "actions hell" |
03:42:15 | FromDiscord | <ynfle> I'm trying to debug a nim program, but when I set a breakpoint and run, it just hangs |
03:43:00 | * | arkurious quit (Quit: Leaving) |
03:44:17 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Manually set the env": daaaaaaaaamn↵it just does not work↵i update it and in the github workflow the path var is actually updated but in the nim code it just fails :[[[[[[[[[[[[[[[[[[[[[↵https://github.com/Patitotective/ImTemplate/runs/6283861397?check_suite_focus=true#step:4 |
03:45:05 | FromDiscord | <!Patitotective> (edit) ":[[[[[[[[[[[[[[[[[[[[[↵https://github.com/Patitotective/ImTemplate/runs/6283861397?check_suite_focus=true#step:4" => ":[[[[[[[[[[[[[[[[[[[[[" |
03:45:09 | FromDiscord | <!Patitotective> anyways |
03:45:13 | FromDiscord | <!Patitotective> good night :[ |
03:45:14 | FromDiscord | <!Patitotective> 🌃 |
03:54:41 | * | slowButPresent quit (Quit: leaving) |
04:04:26 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
04:04:52 | * | bananahead quit (Quit: The Lounge - https://thelounge.chat) |
04:05:55 | * | bananahead joined #nim |
04:11:13 | * | vicfred joined #nim |
04:19:12 | * | Zectbumo joined #nim |
04:39:16 | * | Gustavo6046 joined #nim |
05:34:02 | FromDiscord | <congusbongus> I want to package a windows SDL nim application as a single exe, without having to ship the SDL .dll files. Does anyone know how I can do this? |
05:37:36 | FromDiscord | <Elegantbeef> @congusbongus\: you'd statically link sdl |
05:39:07 | FromDiscord | <mratsim> sent a long message, see http://ix.io/3WVc |
05:40:15 | FromDiscord | <congusbongus> ok I'm using sdl2_nim so I guess I'm out of luck |
05:40:59 | FromDiscord | <Elegantbeef> You can dynlib override |
05:47:04 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "Eitherway i'd liked more": Oh, yeah? 👀 |
05:47:06 | FromDiscord | <Elegantbeef> @congusbongus\: refer to https://nim-lang.org/docs/nimc.html#dynliboverride |
05:47:29 | FromDiscord | <Elegantbeef> Only in cases where the inference is done from the procedure call |
05:47:39 | FromDiscord | <Elegantbeef> So only for lambda's/do notation |
05:48:42 | FromDiscord | <congusbongus> I appreciate the pointer but your link makes it sound like I just need to pass one compiler flag but I'm sure in reality it's much more complicated, especially for something like SDL |
05:48:55 | FromDiscord | <Elegantbeef> it's not much more complicated |
05:49:09 | FromDiscord | <Elegantbeef> You get all your static libraries, and then pass the dynlib override and a path to the library |
05:49:18 | FromDiscord | <Elegantbeef> The most complicated part is getting the static libraries |
05:49:31 | FromDiscord | <Elegantbeef> Personally i'd just recommend using appimage anyway |
05:49:34 | FromDiscord | <Elegantbeef> Much saner to deal with |
05:49:41 | FromDiscord | <Elegantbeef> Unless you're on windows |
05:49:46 | FromDiscord | <Elegantbeef> Then just ship the .dlls |
05:53:35 | * | ltriant quit (Ping timeout: 256 seconds) |
05:53:40 | * | rockcavera quit (Remote host closed the connection) |
05:54:05 | nrds | <Prestige99> I've been struggling to get sdl static linking working for quite a while now |
05:54:17 | nrds | <Prestige99> actually currently working on that problem as we speak |
05:54:32 | FromDiscord | <Elegantbeef> Eh it's generally stupid to static link imo |
05:54:41 | FromDiscord | <Elegantbeef> It's a pain and means the entire binary needs to be shipped |
05:54:48 | FromDiscord | <Elegantbeef> for an update\ |
05:54:56 | nrds | <Prestige99> you say needs, I say can |
05:55:08 | FromDiscord | <Elegantbeef> What? |
05:55:09 | nrds | <Prestige99> also, it's recommended for wasm to statically link |
05:55:20 | FromDiscord | <Elegantbeef> Well yea wasm is an exception |
05:55:34 | FromDiscord | <Elegantbeef> It's not a real PC |
05:56:07 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "It's a pain and": That's different with AppImage? |
05:56:07 | nrds | <Prestige99> been having issues shipping dynamically linked games because the users have old glibc versions |
05:56:20 | FromDiscord | <Elegantbeef> Appimages can self update↵(@ShalokShalom) |
05:56:41 | FromDiscord | <ShalokShalom> With the Launcher, that is? |
05:56:50 | FromDiscord | <Elegantbeef> "The launcher"? |
05:56:51 | FromDiscord | <ShalokShalom> But you still ship the whole binary. |
05:57:00 | FromDiscord | <ShalokShalom> The AppImage Launcher? |
05:57:10 | FromDiscord | <Elegantbeef> No appimages have an update API |
05:57:14 | FromDiscord | <ShalokShalom> Or do you mean, you have build in self update in your software |
05:57:17 | FromDiscord | <ShalokShalom> Aha |
05:58:03 | FromDiscord | <Elegantbeef> Which i think means you can only ship your updated binary instead of a binary including static libraries |
05:58:31 | FromDiscord | <Elegantbeef> Though i could be wrong |
05:59:30 | FromDiscord | <ShalokShalom> Isnt an AppImage always with static libs? |
05:59:39 | FromDiscord | <Elegantbeef> No dynamic |
06:00:19 | FromDiscord | <Elegantbeef> Well you can ship whatever dependencies you want |
06:00:29 | FromDiscord | <Elegantbeef> It doesnt care if it's statically linked or dynamically linked |
06:01:19 | FromDiscord | <ShalokShalom> They are changing that |
06:01:20 | FromDiscord | <ShalokShalom> https://github.com/AppImage/AppImageKit/issues/1193 |
06:01:54 | FromDiscord | <Elegantbeef> That's not for the hsipped binaries |
06:02:02 | FromDiscord | <Elegantbeef> > Hence I am proposing that we replace all ingredients of the AppImages that get produced by this repository with static ones. |
06:02:10 | FromDiscord | <Elegantbeef> That's specifically for AppImageKit |
06:04:06 | FromDiscord | <Elegantbeef> Regardless i'm an idiot that shouldnt be listened to |
06:04:13 | FromDiscord | <Elegantbeef> So if anything i say is wrong attribute it to that |
06:07:08 | * | PMunch joined #nim |
06:09:26 | FromDiscord | <ShalokShalom> Well, I guess it depends on how people from the outside produce their AppImages |
06:09:44 | FromDiscord | <ShalokShalom> I lost oversight over that, it used to be quite confusing a couple of years ago |
06:09:54 | FromDiscord | <ShalokShalom> They had like 4 different ways of building them |
06:10:06 | nrds | <Prestige99> snap, flatpack, and appimage |
06:10:10 | nrds | <Prestige99> iirc snap sucks |
06:11:06 | FromDiscord | <Elegantbeef> Yea snap is proprietary and has many issues |
06:11:20 | FromDiscord | <Elegantbeef> flatpak is best for distibuting software to every distro easily |
06:11:31 | FromDiscord | <Elegantbeef> Appimage is best for games and the like |
06:11:39 | FromDiscord | <Elegantbeef> If you arent on steam atleast |
06:11:51 | FromDiscord | <Elegantbeef> If you're on steam use the steam linux runtime 😄 |
06:14:46 | FromDiscord | <ShalokShalom> I like the cl ergonomics of snap the most |
06:14:57 | FromDiscord | <ShalokShalom> But yeah, non-free server side is a no go |
06:15:37 | FromDiscord | <ShalokShalom> And that people just use it without knowing and questioning that, freaks me out. |
06:16:00 | FromDiscord | <Elegantbeef> Yea i generally avoided snap when i was on ubuntu derivatives |
06:16:13 | FromDiscord | <Elegantbeef> Now i'm on debian and go package manager \> flatpak \> appimage |
06:16:19 | FromDiscord | <ShalokShalom> We are at the point, where Ubuntu user use non-free software, and practicially every single distribution storms to support it |
06:16:51 | FromDiscord | <ShalokShalom> I used Flatpak on KaOS, since it was the only way to get Steam running |
06:17:03 | FromDiscord | <ShalokShalom> Since I am on Arch, no external packages anymore at all |
06:17:11 | FromDiscord | <ShalokShalom> Flatpak was a pain. |
06:17:46 | FromDiscord | <ShalokShalom> Half of the things, like passing controllers and finding the paths was cruel. |
06:17:56 | FromDiscord | <ShalokShalom> Habitat is cool 👍🏻 |
06:19:27 | FromDiscord | <Elegantbeef> Pmunch you about? |
06:19:59 | FromDiscord | <ShalokShalom> https://github.com/habitat-sh/habitat |
06:20:43 | FromDiscord | <ShalokShalom> Rust runtime, works on all major platforms and has an awesome simple description language |
06:21:03 | FromDiscord | <ShalokShalom> But its a bit tied to server software, mostly culturally |
06:22:01 | FromDiscord | <Elegantbeef> Oh he is about but busy in offtopic 😄 |
06:22:52 | FromDiscord | <Elegantbeef> Any idea why i cannot define a destructor for a type imported by futhark? |
06:27:00 | PMunch | @Elegantbeef, probably because it is considered used when it is assigned to a type alias and therefore a default destructor is created for it |
06:27:03 | FromDiscord | <Elegantbeef> Fuuuuck it's a compiler bug |
06:27:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WVh |
06:27:23 | FromDiscord | <Elegantbeef> Perhaps |
06:27:40 | FromDiscord | <Elegantbeef> Guess time for distinct city |
06:28:28 | PMunch | @Elegantbeef, I've done it like this for my COAP wrapper http://ix.io/3WVi/nim |
06:28:57 | FromDiscord | <Elegantbeef> Dude just do `distinct` like it's 2022 |
06:29:25 | PMunch | I used the inner thing because I sometimes needed to attach a bit of extra data :P |
06:29:28 | FromDiscord | <Elegantbeef> Or not |
06:29:44 | PMunch | And I'm not even sure if you can use distinct in that case since the signature needs to be an object? |
06:29:58 | FromDiscord | <Elegantbeef> Nah it works with distincts |
06:30:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/q7u |
06:30:24 | PMunch | Wait, why doesn't your snippet work then? |
06:30:39 | PMunch | Ah the base have to be ref object? |
06:30:42 | FromDiscord | <Elegantbeef> The alias causes it to not work |
06:30:52 | FromDiscord | <Elegantbeef> Yea |
06:31:02 | FromDiscord | <Elegantbeef> Also no it's not the alias existing that's the issue |
06:31:10 | FromDiscord | <Elegantbeef> The compiler just doesnt skip for aliases in destructors |
06:31:19 | PMunch | Ah I see |
06:31:26 | FromDiscord | <Elegantbeef> Which i guess makes sense perhaps |
06:31:37 | FromDiscord | <frobnicate> Doesn't skip? |
06:31:56 | FromDiscord | <Elegantbeef> The compiler has something called `skipTypes` which goes through the type tree to get to the base |
06:32:06 | FromDiscord | <Elegantbeef> It doesnt do that for aliases on destructors |
06:32:26 | FromDiscord | <frobnicate> So Base and Alias both use the destructor, or Alias uses the Base destructor? |
06:32:36 | FromDiscord | <Elegantbeef> The constructor isnt made 😄 |
06:32:41 | FromDiscord | <ShalokShalom> Would you say there are many "exceptions from the rules" in Nim like that? |
06:32:41 | FromDiscord | <frobnicate> Oh |
06:32:46 | FromDiscord | <Elegantbeef> Alias is a type alias it doesnt make an new definition |
06:32:50 | FromDiscord | <Elegantbeef> Destructor i mean |
06:32:59 | FromDiscord | <frobnicate> In reply to @ShalokShalom "Would you say there": Not in my experience |
06:33:01 | FromDiscord | <Elegantbeef> Nim has many "I forgot this AST existed" |
06:33:06 | FromDiscord | <Elegantbeef> Most of my bug fixes are due to that |
06:33:17 | FromDiscord | <ShalokShalom> THIS AST? |
06:33:21 | FromDiscord | <frobnicate> Yeah I was going to say they usually get fixed |
06:33:23 | FromDiscord | <ShalokShalom> Are there more than one? |
06:33:30 | FromDiscord | <Elegantbeef> Well no |
06:33:35 | FromDiscord | <Elegantbeef> This ast as in this feature existed |
06:33:43 | FromDiscord | <ShalokShalom> (edit) "THIS" => ""This"" |
06:33:57 | FromDiscord | <Elegantbeef> If you look at the destructor code there is probably a `skipType` missing to skip over aliases cause someone forgot to consider that |
06:34:24 | FromDiscord | <frobnicate> In reply to @Elegantbeef "The constructor isnt made": To be fair, it doesn't make sense to make a distinct destructor for an alias |
06:34:30 | FromDiscord | <Elegantbeef> As such `Alias = Base` attempts to add a destructor to `Alias` but cannot cause it's a `tyAlias` and not in `{tyObject, tyDistinct}` |
06:34:41 | FromDiscord | <Elegantbeef> Well in this case it'd be beneficial |
06:34:43 | FromDiscord | <ShalokShalom> Is this something property based tests would have caught? |
06:34:58 | FromDiscord | <Elegantbeef> How the fuck am i supposed to know i'm an idiot |
06:35:21 | FromDiscord | <Elegantbeef> In the case it's an alias it should either work or provide an error that it got an alias but expected an object |
06:35:27 | FromDiscord | <ShalokShalom> I guess I am in the right community then |
06:35:30 | FromDiscord | <Elegantbeef> It's a debatable feature |
06:35:51 | FromDiscord | <ShalokShalom> Nim is a debatable feature |
06:36:40 | FromDiscord | <frobnicate> In reply to @Elegantbeef "In the case it's": Yeah I'd say that should error. It's basically "I have a dog, here's a destructor for the dog. You can also call a dog a doggo."↵It's essentially the same concept |
06:36:59 | FromDiscord | <ShalokShalom> Like your comparison |
06:37:11 | FromDiscord | <ShalokShalom> Did you ever think about doing guides? |
06:37:25 | FromDiscord | <frobnicate> Yes. I've tutored in the past |
06:37:27 | FromDiscord | <Elegantbeef> I mean aliases are human friendly types they are not concrete types as such i'd say there is some argument for it working |
06:38:04 | FromDiscord | <Elegantbeef> But i understand why it doesnt and am more annoyed with the error than the lack of working 😄 |
06:38:13 | FromDiscord | <ShalokShalom> Everything seems so untransparent |
06:38:27 | FromDiscord | <Elegantbeef> The compiler is FOSS have a gander 😛 |
06:38:27 | FromDiscord | <ShalokShalom> Lots of hidden values |
06:38:47 | FromDiscord | <ShalokShalom> Everything is assumed to be understood at the implementation level |
06:38:49 | FromDiscord | <Elegantbeef> Eh it's a compiler |
06:38:58 | FromDiscord | <frobnicate> In reply to @Elegantbeef "I mean aliases are": I think an error like "X is an alias, base type defines destructor" or something would help |
06:39:12 | FromDiscord | <Elegantbeef> I mean in this case we cannot use the base type |
06:39:23 | FromDiscord | <Elegantbeef> Unless pmunch implements a `futhar.getBase(WasmString)` |
06:39:29 | FromDiscord | <frobnicate> Then it should be distinct like in your fix |
06:39:29 | FromDiscord | <Elegantbeef> `futhark`\ 😄 |
06:39:30 | FromDiscord | <ShalokShalom> Even more complicated 😅 |
06:40:05 | FromDiscord | <Elegantbeef> I'm very much on the fence what should happen 😄 |
06:40:50 | FromDiscord | <frobnicate> Well if they're different types, they should be distinct. If it's an alias they're still the same type, just with a different name |
06:41:05 | FromDiscord | <Elegantbeef> I know how the type system works 😄 |
06:41:11 | FromDiscord | <frobnicate> Sorry |
06:41:16 | FromDiscord | <Elegantbeef> Hell i've fixed it in some regard! |
06:42:06 | FromDiscord | <Elegantbeef> I do think that using an alias does allow hiding a feature and is quite pointless |
06:42:31 | FromDiscord | <Elegantbeef> Destructors have to be in the file with the type as such there is no reason to have an alias with a destructor in 99.99% of code |
06:42:53 | FromDiscord | <Elegantbeef> If you didnt give the type a descriptive name fuck off |
06:43:24 | FromDiscord | <frobnicate> Right |
06:43:44 | FromDiscord | <frobnicate> Personally I find aliases to be confusing |
06:43:59 | FromDiscord | <Elegantbeef> I find them great where they actually make code more readable |
06:44:02 | FromDiscord | <Elegantbeef> Much better than `using` imo |
06:44:10 | FromDiscord | <frobnicate> Especially when people alias std stuff from cpp |
06:44:14 | FromDiscord | <Elegantbeef> I generally use `distinct` or `enum` instead |
06:44:15 | PMunch | @Elegantbeef, not exactly sure what you expect that procedure to do? |
06:44:55 | FromDiscord | <Elegantbeef> Eh i guess pmunch i could just make a macro if i really hated it which walked up the type skipping aliases to get the base |
06:45:08 | FromDiscord | <Elegantbeef> This would allow making destructors without aliasing |
06:45:14 | PMunch | Exactly, Futhark types aren't special :P |
06:45:23 | FromDiscord | <Elegantbeef> Without distincts/new objects |
06:45:46 | FromDiscord | <frobnicate> Ast magic |
06:46:03 | FromDiscord | <Elegantbeef> More type magic 😛 |
06:46:30 | FromDiscord | <Elegantbeef> Yea i'm certainly going to need this for types that dont need aliases |
06:46:34 | PMunch | I guess you could use the crazy name with lots of numbers |
06:46:41 | PMunch | Don't remember if those are stable though.. |
06:46:53 | FromDiscord | <Elegantbeef> Gensym should not be relied upon |
06:47:12 | PMunch | Did you have a look at the code, is it gensym it uses? |
06:47:16 | FromDiscord | <Elegantbeef> Eh the macro is easy |
06:47:38 | FromDiscord | <Elegantbeef> the `Namenumber` is gen sym |
06:47:44 | FromDiscord | <frobnicate> I thought it was a hash |
06:47:44 | PMunch | Right |
06:47:53 | PMunch | Well Futhark does have a hashing system |
06:48:01 | PMunch | But that is for the final identefiers |
06:48:18 | FromDiscord | <frobnicate> Oh right |
06:49:13 | PMunch | Essentially if you have both a proc and a type named "something" then the first one that is defined will be called "something" and the second one will be "something_proc" or "something_type" depending on what type it is. If there is still a collision it attaches the hash of the original identifier |
06:49:14 | FromDiscord | <Elegantbeef> Pmunch you may want to mention the destructor issue in your docs 😛 |
06:49:50 | FromDiscord | <Elegantbeef> I mean is there a reason you're using the hash and adding `proc`? |
06:49:53 | PMunch | It's basically a way to make 100% sure we don't get name collisions from converting the C space of valid identifiers into the smaller Nim space of valid identifiers |
06:50:03 | FromDiscord | <Elegantbeef> You can just `gensym` the symbol |
06:50:13 | FromDiscord | <Elegantbeef> `gensym` garuentees a unique name |
06:50:26 | PMunch | Sure, but I wanted these identifiers to be stable |
06:50:32 | PMunch | As you say you can't rely on gensym |
06:50:41 | PMunch | My system is deterministic |
06:50:54 | FromDiscord | <Elegantbeef> I mean technically gensym is aswell |
06:50:59 | PMunch | Running Futhark on the same file will always yield the same identifiers |
06:51:09 | FromDiscord | <Elegantbeef> But that's a technicality i dont want to get into |
06:51:22 | FromDiscord | <Elegantbeef> They're temporally stable assuming the code doesnt change 😄 |
06:51:33 | PMunch | That's a big assumption :P |
06:51:54 | FromDiscord | <Elegantbeef> Anyway pmunch is there a way to output just the nim file futhark makes to a specific directory with a name, so i can have a futhark-less version that can just be imported? |
06:52:18 | FromDiscord | <frobnicate> It produces a JSON, no? |
06:52:20 | PMunch | What happens if I have two libraries that use Futhark, won't importing the first mess with the gensym numbers and then mess up the symbols of the second library? |
06:52:40 | PMunch | @Elegantbeef, it already outputs this to the nimcache directory ;) |
06:52:51 | FromDiscord | <Elegantbeef> Yes i just want the nim file though |
06:53:05 | FromDiscord | <Elegantbeef> I dont want to manually have to fetch it, so i guess a nimble task it is then |
06:53:07 | PMunch | Have a look at the COAP wrapper snippet again |
06:53:31 | PMunch | That's how you should do that, that file is the file that comes out in the nimcache folder |
06:53:59 | PMunch | I do want to give it a couple more "modes" though that generates more importable libraries for one thing |
06:54:48 | PMunch | @frobnicate, it produces JSON as an intermediary |
06:55:51 | PMunch | But in a way I think it's a good to require the aliases in order to add destructors. It keeps the C code a bit more separate from the Nim code, so if you need to do the low-level stuff then you know it's still possible. |
06:56:35 | FromDiscord | <Elegantbeef> Yea you're probably right |
06:56:51 | FromDiscord | <Elegantbeef> Also forces you to write slightly more idiomatic code |
06:57:15 | PMunch | A destructor runs the risk of not knowing when an object is stored on the C library side. So if you have a usecase where that doesn't happen and write a destructor for it then to later have a user try to use another low-level function which stores the object on the C side then Nim would happily destroy that object. |
06:57:20 | PMunch | Exactly |
06:57:51 | PMunch | My idea for how to use Futhark is "let Futhark do a 1:1 mapping with C, then write Nim code on top to improve the interface" |
06:58:29 | nrds | <Prestige99> I should try Futhark out for sdl, a lot of the bindings are incorrect |
06:59:20 | FromDiscord | <Asbjørn F> I should just try Futhark in general |
06:59:37 | PMunch | I had to use Futhark to wrap X11 just because the existing bindings lacked a lot of things |
07:10:07 | * | Zectbumo quit (Remote host closed the connection) |
07:14:40 | * | reversem3[m] quit (Quit: Bridge terminating on SIGTERM) |
07:14:43 | * | buster_blue[m] quit (Quit: Bridge terminating on SIGTERM) |
07:19:26 | * | reversem3[m] joined #nim |
07:25:33 | Amun-Ra | I use the same approach, but without futhark |
07:25:34 | * | buster_blue[m] joined #nim |
07:26:35 | PMunch | Same approach as? |
07:26:59 | Amun-Ra | writing low level private abi as in C then expose only high level nim bindings |
07:28:23 | Amun-Ra | no nils, no casts, no ptrs, etc. |
07:29:05 | PMunch | Ah right, yes that is probably the best way to handle C libraries |
07:34:38 | FromDiscord | <Elegantbeef> Anyone know how objects look when exported to WASM procs? Going to be the next thing i look at probably |
07:34:57 | FromDiscord | <Elegantbeef> Pretty surprised how simple it is to compile wasm modules |
07:35:17 | FromDiscord | <Asbjørn F> How would you define a type for what materials are in a product?↵Like something could be 95 % cotton, 5 % elastan |
07:35:25 | FromDiscord | <Elegantbeef> I'm assuming emscripten screams if the type isnt made up of primitives 😄 |
07:35:49 | FromDiscord | <Elegantbeef> You mean programatically? |
07:36:01 | FromDiscord | <Asbjørn F> I'm trying to make a generic "product attribute" but the stuff that defines a product can be quite troublesome |
07:36:07 | FromDiscord | <Elegantbeef> `type Percentage = distinct 0f32..1f32` |
07:36:27 | FromDiscord | <Asbjørn F> Like manufacturer, material, size, color |
07:36:37 | FromDiscord | <Elegantbeef> `type Material = enum Cotton, Nylon, Spandex, ...` |
07:37:00 | FromDiscord | <Elegantbeef> `type Materials = array[Material, Percentage]` 😄 |
07:37:50 | FromDiscord | <Elegantbeef> Depending what you're doing a lot of this is going to be a string |
07:38:08 | FromDiscord | <Elegantbeef> Since you want it typeless and cannot reasonably represent it all with types imo atleast |
07:38:34 | FromDiscord | <Asbjørn F> I'm just trying to make the data at least a bit normalised |
07:39:11 | FromDiscord | <Elegantbeef> Well without knowing the possible values i cannot speak |
07:39:35 | FromDiscord | <Rika> How exact do you need the data to be |
07:40:19 | FromDiscord | <Asbjørn F> sent a code paste, see https://play.nim-lang.org/#ix=3WVs |
07:40:49 | FromDiscord | <Asbjørn F> That's why I needed a normalized system where you can define compound types |
07:41:54 | FromDiscord | <Asbjørn F> Like you have a product, a product has product attributes, a product attribute could be its weight. A different product might not have weight (like clothing, mostly) |
07:41:55 | PMunch | I'd probably do a Attribute variant object, then an enum that holds all the things you have defined yourself along with a Custom value. For all the pre-defined things convert it to proper types like @Elegantbeef did above for Materials, and then or the Custom just store a key/value pair as a string |
07:42:02 | PMunch | That's what I'd do |
07:44:03 | FromDiscord | <Elegantbeef> Seems like the thing to do is go into OOP hell |
07:47:13 | FromDiscord | <Asbjørn F> I'd rather not |
07:47:35 | FromDiscord | <Asbjørn F> I also wanted to avoid any weird inheritance hierarchy |
07:51:10 | FromDiscord | <Asbjørn F> sent a long message, see http://ix.io/3WVx |
07:52:07 | FromDiscord | <Asbjørn F> it would have to be converted from strings |
07:52:10 | FromDiscord | <Elegantbeef> You could have a table of `string, Property` |
07:53:39 | FromDiscord | <Elegantbeef> Property being a big object variant |
08:05:52 | * | supakeen quit (K-Lined) |
08:07:27 | FromDiscord | <Asbjørn F> how the heck do I add that to the db when something could be an enum |
08:08:25 | * | lumo_e joined #nim |
08:09:17 | FromDiscord | <Asbjørn F> Like right now I have a `ProductAttribute` (weight, color) table, `ProductAttributeType` (if it's number, text, whatever), but in the case it's an enum like color, you of course want predefined colors like red, blue... |
08:10:54 | FromDiscord | <Asbjørn F> defining products sucks |
08:19:10 | FromDiscord | <Asbjørn F> I can kinda see why a lot of systems has a huge table with all the attributes and lots of NULL |
08:20:44 | * | Arrrrrrr joined #nim |
08:27:23 | FromDiscord | <Asbjørn F> I'm really close to just storing it as a blob but then I can't look up all small size tshirts for instance :/ |
08:27:45 | FromDiscord | <Elegantbeef> Clearly properties should be a json string that you parse 😛 |
08:27:53 | FromDiscord | <Elegantbeef> The most efficient DB |
08:27:58 | FromDiscord | <Asbjørn F> :c |
08:31:45 | FromDiscord | <Asbjørn F> what's even the performance of a NoSQL? |
08:36:47 | PMunch | @Asbjørn_F, as I said I would store a it as a set of attributes. If an attribute is of a known kind then you store the specific type for that attribute (e.g. a size enum), or if it is unknown you just store it as a string-based key/value pair. |
08:38:22 | FromDiscord | <Asbjørn F> I get that, but now I'm trying to make the schema for it, but it doesn't translate nicely to SQL, when some of it points to tables, and some of it might be custom key/val |
08:40:16 | FromDiscord | <Asbjørn F> For reference, I haven't made any professional product management / ecommerce stuff totally from scratch before, other than for uni |
08:40:38 | PMunch | Ah you need to map this to SQL |
08:40:55 | FromDiscord | <Asbjørn F> Maybe a SQL db doesn't fit this usecase that well, since products are so different |
08:40:58 | * | lumo_e quit (Quit: Quit) |
08:41:09 | PMunch | Well you'd have to flatten the object |
08:41:14 | FromDiscord | <Asbjørn F> right |
08:41:22 | PMunch | Essentially include all fields and leave most of them empty |
08:41:33 | PMunch | Then have one field which tells you which field to read |
08:41:49 | PMunch | Then have a many-to-many relation between attributes and products |
08:41:49 | FromDiscord | <Asbjørn F> yeah I wanted to avoid that, that's usually what I see in other solutions. Giant tables with lots of nulls |
08:42:41 | FromDiscord | <Asbjørn F> I was considering a hybrid approach |
08:42:48 | PMunch | I mean the alternative is to store everything in the database as strings and then parse on the program side |
08:43:04 | FromDiscord | <Asbjørn F> yeah that's what I was initially considering |
08:43:13 | PMunch | I guess you could have attribute with a kind and then one element of each type the SQL implementation you're using supports |
08:43:34 | PMunch | So at least you don't have to convert an int to a string to insert it into the database |
08:43:45 | PMunch | If you use a low-enough level that you can do that directry |
08:43:52 | FromDiscord | <Asbjørn F> I'm leaning towards NoSQL or key/val storage for the product definition |
08:43:59 | PMunch | If you're going through text-based SQL queries then it doesn't matter much anyways |
08:44:42 | FromDiscord | <Asbjørn F> and it's really only the products that are troublesome. The rest is pretty schema friendly |
08:46:01 | * | firq joined #nim |
08:48:13 | NimEventer | New thread by Elcritch: Fidgets!, see https://forum.nim-lang.org/t/9143 |
09:01:45 | * | Zectbumo joined #nim |
09:03:59 | * | mahlon quit (Ping timeout: 256 seconds) |
09:10:19 | FromDiscord | <narimiran> A new release candidate, Nim 1.6.6 RC3, is here:↵https://forum.nim-lang.org/t/9100#59703↵↵Please give it a try and report any regressions. |
09:33:10 | * | ltriant joined #nim |
09:46:41 | * | pch quit (Remote host closed the connection) |
09:48:13 | FromDiscord | <eyecon> In reply to @Asbjørn F "and it's really only": PostgreSQL has JSON types (straight or binary) that you can pack into a column, they've done much to improve performance |
09:49:05 | FromDiscord | <eyecon> https://www.postgresql.org/docs/current/functions-json.html |
09:49:08 | FromDiscord | <Asbjørn F> yeah I looked into the docs for that. They also added constraints for JSON types |
09:49:51 | FromDiscord | <eyecon> Yes, that'd be hard to beat in app code |
09:50:28 | FromDiscord | <Asbjørn F> I'm not really sure how I wanna handle it then. Probably have a table of product definitions, and then a table of actual products that points to a definition? |
09:50:41 | FromDiscord | <Asbjørn F> with the definition and the actual product both being JSOn |
09:50:45 | FromDiscord | <Asbjørn F> (edit) "JSOn" => "JSON" |
09:51:44 | * | analogsalad joined #nim |
09:51:49 | FromDiscord | <eyecon> Have a JSON array of material(string)-to-percentage tuples? |
09:52:12 | FromDiscord | <eyecon> And for the other attributes, whatever they require |
09:52:46 | FromDiscord | <eyecon> But at the end, you cannot leave it completely free because you can't do much with it then other than printing it |
09:52:54 | FromDiscord | <Asbjørn F> right |
09:53:00 | FromDiscord | <eyecon> So you'd need to have some kind of a schema, some required attributes |
09:53:11 | FromDiscord | <Asbjørn F> that's why I wanted a "definition" table, that tells you what stuff is |
09:53:23 | FromDiscord | <Asbjørn F> but it'd still be JSON |
09:53:35 | FromDiscord | <Asbjørn F> since the definitions have to be that dynamic |
09:53:48 | FromDiscord | <eyecon> So you'd read the definition JSON that would tell you what to do with the data in JSON |
09:53:56 | FromDiscord | <eyecon> Do you really need that much freedom |
09:53:57 | FromDiscord | <Asbjørn F> right, that's my idea anyway |
09:54:14 | FromDiscord | <Asbjørn F> Well how would you handle products across all shops and warehouses? |
09:54:31 | FromDiscord | <Asbjørn F> Some sell clothes, clothes don't have weight. Some sell cars, with custom rims |
09:54:40 | FromDiscord | <Asbjørn F> Color matters in some products, not in others |
09:54:43 | FromDiscord | <Asbjørn F> Same with sizes |
09:54:48 | FromDiscord | <Asbjørn F> I found it very difficult |
09:54:58 | FromDiscord | <eyecon> I'm not sure, I'm not involved in the topic either. I'd maybe still hardcode whatever all product types require and version the schema |
09:55:21 | FromDiscord | <eyecon> If you have a new customer, conduct a survey to find out whatever they have that you don't cover, then add the type |
09:55:42 | FromDiscord | <Asbjørn F> But you'd end up with NULLs for the customers who don't fit exactly the mold |
09:55:58 | FromDiscord | <Asbjørn F> Some customers wanna display whether or not something is organic / fairtrade |
09:56:14 | FromDiscord | <eyecon> But they'd be different types hopefully, or yes, you can have NULLs, that's not a bad thing |
09:56:15 | FromDiscord | <Asbjørn F> And you need to be able to sort on it |
09:56:32 | FromDiscord | <Asbjørn F> I try to avoid NULLs 👀 |
09:56:35 | FromDiscord | <eyecon> If you don't know whether something is organic then the organic field is NULL |
09:56:49 | FromDiscord | <eyecon> In reply to @Asbjørn F "I try to avoid": Why? That's a legit piece of info |
09:57:02 | FromDiscord | <eyecon> That you don't know or the data is not present |
09:57:55 | FromDiscord | <Asbjørn F> Something like this sentiment↵<https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/>↵↵But for a car, it doesn't matter if it's organic, for instance, but I don't want the customer to have to worry about listing it as organic |
09:58:14 | FromDiscord | <Asbjørn F> (edit) "Something like this sentiment↵<https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/>↵↵But for a car, it doesn't matter if it's organic, for instance, but I don't want the customer to have to worry about listing it as ... organic" added "not" |
09:58:36 | FromDiscord | <eyecon> But there's a reason why it's invented 😄 |
09:59:08 | FromDiscord | <eyecon> So say you have t-shirts which are sold in a fair-trade shop, and t-shirts that originate from a random cheap shop |
09:59:11 | FromDiscord | <Asbjørn F> I'm gonna try the JSON product pointing to JSON schema thing and see how it goes |
09:59:32 | FromDiscord | <eyecon> Do you really want to have two types, fairtrade_tshirt and sweatshop_tshirt? |
09:59:53 | FromDiscord | <eyecon> Just to avoid that the second one has a field that is NULL? |
10:00:24 | FromDiscord | <Asbjørn F> In reply to @eyecon "Do you really want": they're both going to be Products, just with a different list of attributes. It's a "has-a" relationship, not an "is-a" relationship |
10:00:31 | FromDiscord | <Asbjørn F> I'm trying to make it compositional |
10:00:59 | FromDiscord | <eyecon> OK, let's say a customer wants to have a list of organic t-shirts |
10:01:06 | * | pch joined #nim |
10:01:15 | FromDiscord | <eyecon> Half of your t-shirts have-a "organic" field |
10:01:19 | FromDiscord | <eyecon> The other half doesn't |
10:01:23 | FromDiscord | <eyecon> What do you list? |
10:01:34 | FromDiscord | <Asbjørn F> the organic ones? |
10:01:43 | FromDiscord | <eyecon> And how do you determine that? |
10:01:50 | FromDiscord | <eyecon> The ones that have the field and is true? |
10:02:03 | FromDiscord | <Asbjørn F> yes, that's the assumption |
10:02:18 | FromDiscord | <Asbjørn F> I think it'll be easier if I just show it, so I'm gonna try making a proof of concept |
10:02:29 | FromDiscord | <eyecon> But that's exactly the same thing as having the field in all and setting it to NULL in those that shouldn't be relevant |
10:02:30 | FromDiscord | <Asbjørn F> and then you can tell me how much it sucks 😛 |
10:03:16 | FromDiscord | <eyecon> In reply to @Asbjørn F "and then you can": On the contrary, I honestly find what you're trying to do more correct academically, it's just it sounds somewhat... not practical for real use cases |
10:04:04 | FromDiscord | <Asbjørn F> In reply to @eyecon "On the contrary, I": Yeah that's why I wanna actually try to make it |
10:04:14 | FromDiscord | <eyecon> Oh, OK |
10:04:40 | FromDiscord | <Asbjørn F> It's just the first thing I came up with was so stupid it didn't seem feasible to demo, but I think I can manage this |
10:04:59 | FromDiscord | <Asbjørn F> if my docker doesn't poop on me |
10:05:36 | FromDiscord | <eyecon> Hey, if you're able to come up with that crazy plan, I'm sure that you can actually do it haha |
10:05:44 | FromDiscord | <Asbjørn F> ty |
10:06:37 | FromDiscord | <eyecon> As someone I can't remember said (paraphrased): if you manage to get the right data structures working, the program writes itself |
10:08:03 | FromDiscord | <frobnicate> Yeah that was my focus for this. I work with warehouse software, and it always seems so messy so i wanted to try a cleaner data approach |
10:08:33 | FromDiscord | <frobnicate> Oh btw this is be on mobile lol |
10:08:46 | FromDiscord | <frobnicate> The other one is my work account |
10:11:09 | FromDiscord | <Rika> Hello I saw some DB talk |
10:11:12 | FromDiscord | <Rika> What’s the issue exactly |
10:12:54 | FromDiscord | <frobnicate> Defining products |
10:13:17 | FromDiscord | <frobnicate> Since they're all so different |
10:13:28 | * | jmdaemon quit (Ping timeout: 250 seconds) |
10:14:24 | FromDiscord | <frobnicate> Some are services, some are clothing, some are cars and they have different relevant fields for transport, packaging, manufacturer, color, size and all that |
10:16:13 | FromDiscord | <Rika> Have tables store different categories of products each? Though then you get the “each product needs a unique ID but they’re all in different tables” thing |
10:16:21 | FromDiscord | <Rika> Which I guess isn’t much of an issue but still |
10:16:39 | FromDiscord | <Rika> What’s wrong with nulls by the way |
10:17:22 | NimEventer | New post on r/nim by mavavilj: Dash/Shiny/Power BI alternative using Nim?, see https://reddit.com/r/nim/comments/ui3b75/dashshinypower_bi_alternative_using_nim/ |
10:18:25 | FromDiscord | <frobnicate> In reply to @Rika "What’s wrong with nulls": They talk bad about me behind my back |
10:18:55 | FromDiscord | <frobnicate> And I've been academically conditioned to hate them |
10:22:49 | * | analogsalad quit (Quit: bye) |
10:28:07 | FromDiscord | <eyecon> In reply to @Rika "Have tables store different": Snowflakes or any of the similar newfangled id solutions would solve that I think |
10:31:31 | FromDiscord | <Zoom> Are std[out, err] unavailable in NimScript? If so, why `echo` is? |
11:28:27 | FromDiscord | <planetis> echo works on macros pbl it's a special case |
11:28:36 | FromDiscord | <planetis> (edit) "on" => "in" |
11:30:37 | FromDiscord | <Zectbumo> sent a long message, see https://paste.rs/y7k |
11:32:27 | FromDiscord | <vindaar> because the first is the syntax to define a tuple type. but the second is not the syntax to define an object type |
11:33:10 | FromDiscord | <d4rckh> if i compile my nim project to c, can i invoke code from c++? |
11:40:25 | FromDiscord | <Yardanico> In reply to @d4rckh "if i compile my": Only if that C++ code exports functions with the C FFI |
11:41:21 | FromDiscord | <d4rckh> oh |
11:42:38 | FromDiscord | <Zoom> Thanks. Don't think I'm satisfied with this answer. Considering, NimScript is used for Nimble, you'd expect a bit more IO capabilities than the magic echo.↵(@planetis) |
11:43:26 | FromDiscord | <Zoom> Mind it, I have no idea on how NimVM works/supposed to work |
11:58:54 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
12:02:58 | * | Zectbumo quit (Remote host closed the connection) |
12:10:24 | FromDiscord | <d4rckh> okay, i think i will just use winim |
12:10:46 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/2Ec |
12:11:10 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/MDm |
12:11:23 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3WWx" => "https://play.nim-lang.org/#ix=3WWw" |
12:12:02 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/aoB |
12:12:38 | * | ltriant quit (Ping timeout: 260 seconds) |
12:24:28 | FromDiscord | <eyecon> In reply to @d4rckh "and i defined `TOKEN_INFORMATION_CLASS`": No need, winim already defines it |
12:24:51 | FromDiscord | <d4rckh> oh yeah, its just `tokenIntegrityLevel` |
12:25:32 | * | jjido joined #nim |
12:26:58 | * | slowButPresent joined #nim |
12:29:05 | FromDiscord | <d4rckh> also, how can i allocate the buffer for `GetTokenInformation`? I am doing `tokIntegrity = PTOKEN_MANDATORY_LABEL(LocalAlloc(LPTR, cbSize))` but its telling me `got 'HLOCAL' for 'LocalAlloc(64, cbSize)' but expected 'PTOKEN_MANDATORY_LABEL = ptr TOKEN_MANDATORY_LABEL'` |
12:29:23 | FromDiscord | <d4rckh> trying to rewrite some c++ code into nim |
13:18:26 | * | rockcavera joined #nim |
13:18:26 | * | rockcavera quit (Changing host) |
13:18:27 | * | rockcavera joined #nim |
13:23:47 | * | ltriant joined #nim |
13:25:55 | FromDiscord | <Yardanico> In reply to @d4rckh "also, how can i": you don't need LocalAlloc here at all I think |
13:26:23 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:26:43 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WWX |
13:29:18 | FromDiscord | <d4rckh> oh, now all its left is to convert a `LPSTR` to an actual string |
13:29:43 | FromDiscord | <d4rckh> in c++ i just did `string(lpSid)` but that doesnt work in nim 🤔 |
13:30:13 | FromDiscord | <Yardanico> In reply to @d4rckh "oh, now all its": if it's null terminated, you just do `$cstring(mylpstr)` |
13:31:02 | FromDiscord | <d4rckh> damn, my code compiled after like an hour of fixing stuff |
13:31:08 | FromDiscord | <d4rckh> lets see if it actually works now |
13:32:02 | FromDiscord | <d4rckh> great it didnt work |
13:32:23 | FromDiscord | <d4rckh> (edit) "it didnt work" => "nothing gets pritned" |
13:32:27 | FromDiscord | <d4rckh> (edit) "pritned" => "printef" |
13:32:28 | FromDiscord | <d4rckh> (edit) "printef" => "printed" |
13:36:02 | FromDiscord | <d4rckh> ok i fixed it somehow but its always S-1-16-0.... https://media.discordapp.net/attachments/371759389889003532/971404838288117790/unknown.png |
13:36:11 | FromDiscord | <d4rckh> (edit) "S-1-16-0...." => "S-1-16-0...., even if i open the program as admin" |
14:00:34 | * | duuuuuude joined #nim |
14:01:22 | duuuuuude | what are your thoughts on google dart? |
14:02:45 | FromDiscord | <Yardanico> i think that's more for #offtopic, but personally it doesn't look like a contender for general purpose languages at all |
14:03:04 | FromDiscord | <Yardanico> The reason why people use Dart is Flutter in virtually all cases |
14:05:09 | FromDiscord | <dom96> yeah, let's take discussions about other languages to #nim-offtopic (should be bridged to Discord on IRC) |
14:07:41 | * | PMunch quit (Quit: Leaving) |
14:13:52 | * | arkurious joined #nim |
14:19:10 | * | vicfred quit (Quit: Leaving) |
14:32:13 | FromDiscord | <kraptor> for some reason this check got stuck downloading and cancelled itself, rendering the PR red in CI. Could someone rerun it? Maybe @dom96, who added the original certificate for tests ¡10 years! ago?↵↵https://github.com/nim-lang/Nim/runs/6289577978?check_suite_focus=true |
14:32:43 | FromDiscord | <Yardanico> In reply to @kraptor "for some reason this": there's a hacky way to re-run A CI - close and open the PR :) |
14:33:25 | FromDiscord | <dom96> submitted for re-run |
14:33:34 | FromDiscord | <kraptor> thanks! |
14:33:39 | FromDiscord | <dom96> GitHub really needs more granular status symbols for CI |
14:34:22 | FromDiscord | <dom96> it really annoys me when one test times out and that shows up as a failure |
14:36:49 | nrds | <Prestige99> What would you rather see? |
14:37:11 | * | noxnivi joined #nim |
14:37:26 | noxnivi | good day |
14:37:47 | FromDiscord | <Yardanico> hello |
14:41:01 | FromDiscord | <dom96> hiya |
14:41:19 | FromDiscord | <dom96> Prestige: an amber icon or something |
14:44:01 | nrds | <Prestige99> For timeouts? I would still consider that a failure |
14:51:11 | * | jjido joined #nim |
14:53:51 | FromDiscord | <d4rckh> In reply to @mothumix "you don't need LocalAlloc": I think I actually need it |
14:54:35 | FromDiscord | <dom96> Prestige: yep, timeouts should be treated as "no signal" not a failure in most cases |
14:54:52 | FromDiscord | <dom96> We have so many different CI runs that one timing out shouldn't block someone |
14:55:33 | nrds | <Prestige99> hmm perhaps |
14:57:26 | * | tiorock joined #nim |
14:57:26 | * | tiorock quit (Changing host) |
14:57:26 | * | tiorock joined #nim |
14:57:26 | * | rockcavera is now known as Guest1020 |
14:57:27 | * | Guest1020 quit (Killed (zinc.libera.chat (Nickname regained by services))) |
14:57:27 | * | tiorock is now known as rockcavera |
14:59:05 | * | xet7 quit (Read error: Connection reset by peer) |
15:21:48 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WXP |
15:22:16 | FromDiscord | <d4rckh> I am trying to allocate some memory for `TOKEN_MANDATORY_LABEL` but it tells me that `Error: type mismatch: got 'HLOCAL' for 'LocalAlloc(64, cbSize)' but expected 'PTOKEN_MANDATORY_LABEL = ptr TOKEN_MANDATORY_LABEL'` |
15:23:47 | Amun-Ra | try making a cast |
15:24:03 | Amun-Ra | win32 api can be and is dreadful |
15:24:52 | FromDiscord | <d4rckh> sorry, what do you mean make a cast? |
15:24:58 | Amun-Ra | cast[PTOKEN_MANDATORY_LABEL](LocalAlloc(64, cbSize)) |
15:25:53 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/E4D |
15:26:04 | FromDiscord | <Yardanico> `cast[PTokenMandatoryLabel](LocalAlloc(LPTR, cbSize))` |
15:26:06 | FromDiscord | <Yardanico> something like that |
15:26:46 | FromDiscord | <d4rckh> oh, i thought thats a cast |
15:27:18 | Amun-Ra | that's initialization |
15:29:06 | FromDiscord | <Yardanico> In reply to @Amun-Ra "that's initialization": that's a type conversion |
15:29:32 | FromDiscord | <Yardanico> `A()` or `A(field: value)` is object construction syntax, yes, but `A(b)` is a type conversion |
15:31:30 | FromDiscord | <Zoom> Hey guys. strutils/find is inclusive for both `first` and `last` but uses `last=0` as a default (for "last not provided"), instead of `last=-1`. Don't you think it's a logical error? |
15:32:41 | FromDiscord | <Zoom> I see it was -1 earlier... |
15:32:58 | * | mahlon joined #nim |
15:35:15 | Amun-Ra | Yardanico: yes, you're right |
15:35:46 | FromDiscord | <Yardanico> type conversion only really works for native nim types and it's specified in the manual |
15:35:50 | FromDiscord | <Zoom> I think I'll fix this |
15:36:36 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#type-relations-convertible-relation the first and second big code blocks for relations algorithm |
15:38:08 | FromDiscord | <d4rckh> thanks |
15:38:09 | FromDiscord | <d4rckh> (edit) "thanks" => "thanks!" |
15:42:11 | FromDiscord | <kraptor> nah @dom96, same again... that CI is flaky as hell and keeps being cancelled 😦 |
15:42:47 | * | nrds quit (Remote host closed the connection) |
15:43:46 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
15:46:34 | FromDiscord | <Yardanico> what test is failing btw? |
15:46:59 | FromDiscord | <Yardanico> ah 1 hour timeout |
15:47:25 | * | tiorock joined #nim |
15:47:25 | * | tiorock quit (Changing host) |
15:47:25 | * | tiorock joined #nim |
15:47:26 | * | rockcavera quit (Killed (zirconium.libera.chat (Nickname regained by services))) |
15:47:26 | * | tiorock is now known as rockcavera |
15:48:25 | FromDiscord | <kraptor> no idea, there is no output after nimble downloads packages for testing |
15:48:39 | FromDiscord | <dom96> In reply to @Zoom "Hey guys. strutils/find is": This sounds like it was kept this way for backwards compat |
15:48:46 | FromDiscord | <dom96> In reply to @kraptor "nah <@132595483838251008>, same again...": :( |
15:51:59 | noxnivi | what is the proper way to start a nim project linked with github |
15:52:30 | noxnivi | I mean, I can do "nimble init testproject" but it does not create .gitignore file/folders |
15:52:44 | FromDiscord | <Prestige> You need to do that manually |
15:53:10 | FromDiscord | <Prestige> `git init` if you're unfamiliar |
15:53:41 | noxnivi | ok. presumed so |
15:53:57 | noxnivi | thanks FromDiscord |
15:55:39 | FromDiscord | <Yardanico> @noxnivi it's not FromDiscord, it's the user that's inside the <> in the message itself |
15:55:48 | FromDiscord | <Yardanico> FromDiscord is just a bot bridge that relays messages between IRC and Discord |
15:56:08 | noxnivi | well, I'm starting to realize about that |
15:56:10 | noxnivi | XD |
15:56:21 | noxnivi | so Prestige is the one who answered |
15:56:29 | noxnivi | and Yardanico is you |
15:56:56 | FromDiscord | <Yardanico> yes |
15:57:32 | noxnivi | Ok, thanks Prestige |
15:57:46 | noxnivi | and thanks Yardanico for the clarifying |
15:58:16 | noxnivi | first time i see the discord bridge on IRC |
16:02:02 | Amun-Ra | noxnivi: depending on your irc client, you can setup it to look like this: https://i.postimg.cc/08PgTstF/Screenshot-from-2022-05-04-18-01-05.png |
16:03:03 | * | duuuuuude quit (Ping timeout: 260 seconds) |
16:03:23 | noxnivi | I see Amun-Ra |
16:03:40 | noxnivi | I'll check the settings of this client |
16:03:44 | noxnivi | thanks! |
16:04:07 | Amun-Ra | there are plugins for that |
16:09:47 | FromDiscord | <Yardanico> In reply to @noxnivi "first time i see": well, we had to do it because most of the Nim community was in IRC in the past :) |
16:09:52 | FromDiscord | <Yardanico> nowadays it's mostly Discord |
16:09:57 | FromDiscord | <Yardanico> and Matrix |
16:10:31 | Arrrrrrr | Which one is more populated, matrix or discord (nim community)? |
16:10:35 | noxnivi | yep.. so I've seen |
16:10:53 | FromDiscord | <Yardanico> In reply to @Arrrrrrr "Which one is more": discord |
16:10:58 | noxnivi | so there is a bridge Discord-matrix too |
16:11:03 | noxnivi | ? |
16:11:05 | FromDiscord | <Yardanico> yes |
16:11:19 | FromDiscord | <Yardanico> so if you see people on FromDiscord, they might actually be from matrix :) |
16:11:27 | noxnivi | XD |
16:11:35 | Amun-Ra | do matrix users appear as bots on discord too? |
16:11:39 | FromDiscord | <Yardanico> yes |
16:11:50 | FromDiscord | <Yardanico> because it's still the same discord "webhook" feature |
16:11:57 | Amun-Ra | ah |
16:11:57 | FromDiscord | <Yardanico> in the past we had Matrix <-> IRC and Discord <-> IRC, now we have Matrix <-> Discord and Discord <-> IRC |
16:12:09 | FromDiscord | <Yardanico> i mean not "we", freenode itself has a network-wide matrix bridge |
16:12:14 | FromDiscord | <Yardanico> had |
16:12:27 | Amun-Ra | so I guess that's the only way to interact on discord with the external world |
16:19:57 | * | tiorock joined #nim |
16:19:57 | * | tiorock quit (Changing host) |
16:19:57 | * | tiorock joined #nim |
16:19:57 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
16:19:57 | * | tiorock is now known as rockcavera |
16:31:01 | * | duuuuuude joined #nim |
16:48:31 | * | analogsalad joined #nim |
17:02:26 | noxnivi | bye all |
17:02:31 | * | noxnivi quit (Quit: Leaving) |
17:03:52 | FromDiscord | <kraptor> @Yardanico, PR#19760 and #19758 stuck because of the same timeout issue... 🤦♀️ |
17:06:07 | FromDiscord | <shlomo> How would I create a table storing with the value to be stored are procs that can have different types. Do I need to either use objects or object variants? |
17:28:44 | FromDiscord | <demotomohiro> When you store different types of procs to a table, how do you call them when you take a proc from the table? |
17:36:26 | * | Arrrrrrr quit (Quit: Arrrrrrr) |
17:41:33 | * | omanom joined #nim |
18:02:27 | * | xet7 joined #nim |
18:04:51 | * | kenran joined #nim |
18:13:39 | * | duuuuuude quit (Ping timeout: 256 seconds) |
18:34:59 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3WYX |
18:40:04 | FromDiscord | <dom96> In reply to @Ayy Lmao "Can someone explain to": You want: https://nim-lang.org/docs/system.html#closureScope.t%2Cuntyped I think |
18:40:36 | FromDiscord | <Yardanico> yes |
18:42:42 | FromDiscord | <Ayy Lmao> In reply to @dom96 "You want: https://nim-lang.org/docs/system.html#clo": Interesting, I'm guessing that's not the default behavior for optimization reasons? |
18:43:03 | FromDiscord | <Yardanico> In reply to @Ayy Lmao "Interesting, I'm guessing that's": obviously, `loopNumber` is the same variable for the whole loop |
18:43:11 | FromDiscord | <dom96> not sure about the rationale, but it might be because it matches JS' semantics which works well for our JS backend |
18:43:20 | FromDiscord | <Yardanico> so in your code you just captured `loopNumber` itself, not its position on the current iteration |
18:43:26 | FromDiscord | <Yardanico> (edit) "position" => "value" |
18:45:18 | FromDiscord | <Ayy Lmao> In reply to @mothumix "so in your code": I was under the mistaken impression that each loop created a new `loopNumber` for some reason. It makes sense to optimize by default though. |
18:46:55 | FromDiscord | <Ayy Lmao> I guess it tripped me up because the type was using value semantics. |
18:49:32 | * | Zectbumo joined #nim |
18:49:46 | * | duuuuuude joined #nim |
18:51:25 | FromDiscord | <Yardanico> In reply to @Ayy Lmao "I was under the": yeah it can be a bit confusing, here are the docs in the manual - https://nim-lang.org/docs/manual.html#procedures-closures |
18:51:40 | FromDiscord | <Yardanico> "Since closures capture local variables by reference it is often not wanted behavior inside loop bodies" because of "Any captured variables are stored in a hidden additional argument to the closure (its environment) and they are accessed by reference by both the closure and its enclosing scope (i.e. any modifications made to them are visible in both places)" |
18:52:47 | FromDiscord | <Yardanico> btw @Ayy Lmao fun fact, the only thing that `closureScope` actually does is just creating an anonymous proc and then immediately calling it |
18:52:55 | FromDiscord | <Yardanico> there's also https://nim-lang.org/docs/sugar.html#capture.m,varargs[typed],untyped which is more refined |
18:54:15 | FromDiscord | <Yardanico> `capture` does it a bit differently by creating a proc with the arguments being things that you want to call, and then calling that proc with those arguments (so for value types they get copied) |
18:55:41 | FromDiscord | <Ayy Lmao> @Yardanico Thanks for all the tips. That clears up a lot for me. |
18:57:05 | FromDiscord | <Ayy Lmao> Does `The closure environment may be allocated on the heap or on the stack if the compiler determines that this would be safe.` mean that you can't stack overflow with recursion? |
18:59:03 | FromDiscord | <Yardanico> no |
18:59:18 | FromDiscord | <Yardanico> this statement is just there so that you don't depend on closures being heap allocated as it's an internal detail |
18:59:36 | FromDiscord | <Yardanico> but as far as I know currently closures are always heap allocated, there was a PR for allowing to stack allocate some closures, but it got stale |
18:59:55 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/14881 |
19:02:05 | FromDiscord | <Ayy Lmao> I see. I think I recall the Zig creator talking about doing something like that with recursion so I was just curious if Nim already did it. |
19:03:09 | FromDiscord | <Yardanico> kind of sad that the PR got abandoned, I guess it would've improved closure performance in some cases |
19:03:15 | FromDiscord | <PMunch> The moderation team has decided to lift the ban on Solitude and we believe they will act in good faith and not engage in further bad behavior. Even though the ban is lifted does not mean such behaviour is accepted and such behaviour by any member of our community will result in further bans. |
19:03:16 | FromDiscord | <Yardanico> but I don't know how correct it is and if it would've added new bugs |
19:35:42 | * | Zectbumo quit (Remote host closed the connection) |
19:42:33 | FromDiscord | <Professor Actual Factual> sent a long message, see http://ix.io/3WZd |
19:42:54 | * | lumo_e joined #nim |
19:43:15 | FromDiscord | <Yardanico> In reply to @Professor Actual Factual "Wondering if there is": you can just `staticRead` files that you want |
19:43:25 | FromDiscord | <Yardanico> `const myimage = staticRead("image.png")` and then use `myimage` at runtime |
19:43:37 | FromDiscord | <Yardanico> there's also https://github.com/xmonader/nimassets to pack entire directories automatically |
19:43:53 | FromDiscord | <Yardanico> although it requires a separate CLI command |
19:45:19 | FromDiscord | <Professor Actual Factual> Awesome this looks promising. I was hopeing to embed caddy inside my app as a single executable. ↵Gonna see of this works now↵↵Thanks @Yardanico |
19:45:33 | FromDiscord | <Professor Actual Factual> (edit) "of" => "if" |
19:45:44 | * | jmdaemon joined #nim |
19:46:03 | FromDiscord | <Yardanico> wait, caddy? isn't that a binary? |
19:46:11 | FromDiscord | <Yardanico> how do you plan to execute it if you bundle it right into your binary? |
19:46:21 | FromDiscord | <Yardanico> I think you actually want something like AppImage or similar then |
19:50:39 | FromDiscord | <Professor Actual Factual> Ya caddy is a binary. I wany to package it with my main executable so that the end user only has one main exe.↵↵Never heard of appimage before. Will read more on it |
19:51:04 | FromDiscord | <Yardanico> @Professor Actual Factual "packaging" doesn't just mean that you'll be able to execute it |
19:51:09 | FromDiscord | <Yardanico> you still have to place the executable somewhere else |
19:51:15 | FromDiscord | <Yardanico> I'm actually not even sure if AppImage allows that |
19:51:21 | FromDiscord | <Professor Actual Factual> Hmmm |
19:51:25 | FromDiscord | <Yardanico> to execute a binary you need to have it placed somewhere in the system |
19:51:37 | FromDiscord | <Yardanico> on the filsystem |
19:51:43 | FromDiscord | <Yardanico> so then you execute it as a separate binary |
19:52:28 | FromDiscord | <Professor Actual Factual> Ok. If thats the case then i guess what im trying to accomplish is not gonna work. I originally had them as seperate. But i guess i can provide a zip file to the client instead of a single exe |
19:52:37 | FromDiscord | <Yardanico> yeah that's fine |
19:52:49 | FromDiscord | <Yardanico> just provide a zip that has all the binaries, just clearly tell them what is the main binary of the app |
19:53:09 | FromDiscord | <geekrelief> I'm trying to generate a type from a proc passed into a macro, but I'm running into a generation error. https://play.nim-lang.org/#ix=3WZg any advice on how to do this properly? |
19:54:35 | FromDiscord | <geekrelief> I have no clue what's causing `error: 'ClE_0' undeclared (first use in this function)` |
19:54:56 | FromDiscord | <Yardanico> In reply to @geekrelief "I have no clue": it's the C code for the closure environment of a proc |
19:56:14 | FromDiscord | <geekrelief> So if I add `{.cdecl.}` to my proc, I get a different error about my var expecting a closure type |
19:57:15 | FromDiscord | <geekrelief> it looks like `getTypeImpl` on a proc doesn't return the pragmas |
20:02:50 | * | Zectbumo joined #nim |
20:03:00 | FromDiscord | <geekrelief> If I switch to a `{.cdecl.}` and insert the pragma, https://play.nim-lang.org/#ix=3WZm I get a different error: `Error: illegal capture 'a' because 'myFunc' has the calling convention: <cdecl>` |
20:03:47 | FromDiscord | <Yardanico> In reply to @geekrelief "If I switch to": it should be nimcall for the defaul nim convention (not a closure), but I'm not sure why it errors |
20:04:06 | FromDiscord | <geekrelief> yeah, it's weird, I tried {.nimcall.} too |
20:05:12 | * | duuuuuude quit (Ping timeout: 246 seconds) |
20:06:43 | FromDiscord | <Yardanico> @geekrelief maybe i know the difference |
20:07:07 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WZp |
20:07:16 | FromDiscord | <Yardanico> i'm not sure, but maybe it's because of Ident vs Sym |
20:07:29 | FromDiscord | <geekrelief> hmm |
20:07:50 | FromDiscord | <geekrelief> thanks for the clue, I'll try messing around with this! |
20:13:05 | * | duuuuuude joined #nim |
20:13:26 | FromDiscord | <slomp (Marcos Slomp)> QQ\: Is there a built-in way to get the number of elements of a tuple? |
20:14:18 | FromDiscord | <Yardanico> yes |
20:14:22 | FromDiscord | <Yardanico> https://nim-lang.org/docs/typetraits.html#tupleLen%2Ctypedesc%5B%5D |
20:14:50 | FromDiscord | <Yardanico> or https://nim-lang.org/docs/typetraits.html#tupleLen.t if you want to run it on the tuple itself, not on its type |
20:16:22 | FromDiscord | <geekrelief> @Yardanico That did it! https://play.nim-lang.org/#ix=3WZu kind of ugly, but it works! thanks a bunch! |
20:20:28 | FromDiscord | <slomp (Marcos Slomp)> Thanks! And is there a way to check if a generic type `[T]` is a tuple or a "scalar"? |
20:21:29 | FromDiscord | <Yardanico> to check if it's a tuple you just do `when T is tuple` |
20:21:56 | FromDiscord | <Yardanico> and if by scalar values you mean Ordinal, you can check against https://nim-lang.org/docs/system.html#Ordinal |
20:22:31 | FromDiscord | <slomp (Marcos Slomp)> Hmm, I tried `is tuple` that, but it did not work... |
20:22:45 | FromDiscord | <Yardanico> are you sure you put it with `when`? |
20:22:53 | FromDiscord | <Yardanico> also, can you maybe show the code around that `is tuple` ? |
20:23:03 | FromDiscord | <slomp (Marcos Slomp)> Hold on, I think there's something weird with VS Code and Code Runner... |
20:23:37 | FromDiscord | <slomp (Marcos Slomp)> Ok, now it compiled... Must have been some fluke with Code Runner... |
20:23:40 | FromDiscord | <slomp (Marcos Slomp)> Thanks again! |
20:30:38 | FromDiscord | <slomp (Marcos Slomp)> Ok, so now, one more thing\:↵is there a way to "flatten" a `seq[tuple[float,float,float]]` to an `openArray[float]`?↵I'm looking at the experimental views feature, but can't seem to find a matching case for this type of data reinterpretation. |
20:32:11 | FromDiscord | <Elegantbeef> `cast[ptr UncheckedArray[float]](mySeq[0].addr).toOpenArray(0, mySeq.len 3)` should in theory work but is one ugly boy |
20:32:31 | FromDiscord | <Yardanico> @ElegantBeef but the compiler then won't check the lifetimes of it, no? |
20:32:45 | FromDiscord | <Yardanico> or does it track `cast` for view types? |
20:33:01 | FromDiscord | <Yardanico> "A cast expression cast[T](e) is a path expression." hmm it does |
20:33:04 | FromDiscord | <Yardanico> nice |
20:33:49 | FromDiscord | <Elegantbeef> Cant hold onto open arrays |
20:33:49 | FromDiscord | <Elegantbeef> So what's the issue |
20:34:06 | FromDiscord | <Elegantbeef> No clue but views isnt required here |
20:34:19 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Cant hold onto open": you can with views |
20:34:25 | FromDiscord | <Yardanico> and they explicitly mentioned views "I'm looking at the experimental views feature" |
20:34:50 | * | lumo_e quit (Ping timeout: 260 seconds) |
20:35:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3WZw |
20:35:38 | FromDiscord | <Elegantbeef> Works just fine |
20:35:39 | FromDiscord | <Yardanico> yes, I know |
20:35:40 | FromDiscord | <Elegantbeef> No clue how to do it with views |
20:35:49 | FromDiscord | <Elegantbeef> I think it does still track the lifetime i dont recall though |
20:35:49 | FromDiscord | <Yardanico> but with views you'll be able to store `openArray` itself in a variable |
20:39:04 | FromDiscord | <Elegantbeef> Yard explaining views to me 😄 |
20:39:09 | FromDiscord | <Elegantbeef> I guess the matrix bridge changed the conversation does |
20:39:13 | FromDiscord | <Elegantbeef> conversation a bit\ |
20:39:20 | FromDiscord | <Yardanico> yeah it's quite slow sometimes |
20:39:37 | FromDiscord | <Yardanico> this is how it looks in Discord https://media.discordapp.net/attachments/371759389889003532/971511439795843152/unknown.png |
20:40:01 | FromDiscord | <Elegantbeef> Yea doesnt properly timestamp across to discord |
20:40:06 | FromDiscord | <Elegantbeef> Your messages are marked with proper time stamps |
20:40:24 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/971511638425481316/image.png |
20:41:28 | * | tiorock joined #nim |
20:41:28 | * | tiorock quit (Changing host) |
20:41:28 | * | tiorock joined #nim |
20:41:28 | * | rockcavera quit (Killed (lead.libera.chat (Nickname regained by services))) |
20:41:28 | * | tiorock is now known as rockcavera |
20:42:07 | FromDiscord | <slomp (Marcos Slomp)> In the `doThing` example you gave, if instead of `var a` I had `let a`, would it be reasonable to change `addr` to `unsafeAddr`? |
20:42:35 | FromDiscord | <Elegantbeef> Yea |
20:42:38 | FromDiscord | <Yardanico> yes, but `addr` is getting unified anyway |
20:42:48 | FromDiscord | <Elegantbeef> I'm in 1.7.x mind so `unsafeaddr` is no longer needed 😄 |
20:42:48 | FromDiscord | <Yardanico> so in future nim releases you don't need unsafeAddr anymore |
20:43:19 | FromDiscord | <ElegantBeef> Ok no more matrix for me now 😄 |
20:43:29 | FromDiscord | <ElegantBeef> Bridge is really slow right now |
20:43:35 | FromDiscord | <ElegantBeef> Still beat yard though |
20:44:26 | FromDiscord | <slomp (Marcos Slomp)> sent a code paste, see https://play.nim-lang.org/#ix=3WZy |
20:44:42 | FromDiscord | <ElegantBeef> Without views you cannot capture openarrays presently |
20:44:49 | FromDiscord | <ElegantBeef> You have to pass it as a parameter |
20:49:00 | FromDiscord | <slomp (Marcos Slomp)> Great, thanks for the help! |
20:58:46 | FromDiscord | <ElegantBeef> The worst apart about wasm libraries is that everything is uint32s 😄 |
21:00:36 | * | fallback quit (Ping timeout: 240 seconds) |
21:10:54 | FromDiscord | <that_dude> In reply to @ElegantBeef "Ok no more matrix": Welcome to us normal people :) enjoy your stay |
21:11:39 | FromDiscord | <Elegantbeef> Nyet |
21:11:51 | FromDiscord | <Elegantbeef> Normal people use open software |
21:23:10 | FromDiscord | <that_dude> :( |
21:23:46 | FromDiscord | <exelotl> matrix has some big scalability issues right? |
21:24:01 | FromDiscord | <Elegantbeef> Dont know |
21:24:08 | FromDiscord | <Yardanico> In reply to @exelotl "matrix has some big": not matrix the protocol, but de-facto yes a bit because almost everyone uses the matrix homeserver |
21:24:34 | * | analogsalad quit (Quit: bye) |
21:32:52 | FromDiscord | <exelotl> this is what I read about it that completely put me off: https://bsd.network/@jbauer/107553956970001344 |
21:36:01 | FromDiscord | <Elegantbeef> To be fair you're using discord 😄 |
21:36:30 | FromDiscord | <slomp (Marcos Slomp)> sent a code paste, see https://play.nim-lang.org/#ix=3WZN |
21:37:05 | FromDiscord | <Elegantbeef> `newSeqUnintialized[T]` takes only `SomeNumber` |
21:39:12 | * | fallback joined #nim |
21:44:27 | FromDiscord | <dom96> In reply to @exelotl "this is what I": hm, those are interesting points, thanks for sharing. Matrix itself definitely feels slow to me any time I try to use it: Element takes multiple tens of seconds to load each time. |
21:45:26 | * | Zectbumo quit (Remote host closed the connection) |
21:51:36 | FromDiscord | <tandy> maybe rewriting it in rust will help↵(@dom96) |
21:52:16 | FromDiscord | <exelotl> xD |
21:52:32 | FromDiscord | <tandy> that is actually happening but its for cross platform targetting lol |
21:52:33 | FromDiscord | <exelotl> In reply to @Elegantbeef "To be fair you're": I do in principle think everyone should be using open platforms, I don't _like_ the fact that most of my social life and communities are tied to one company |
21:53:43 | FromDiscord | <exelotl> that's why I run yard's `ircord` bot for the GBAdev community |
21:54:10 | FromDiscord | <exelotl> it only has like 2 users but it still seems worth it to me x) |
21:54:41 | * | lumo_e joined #nim |
21:55:21 | FromDiscord | <exelotl> In reply to @tandy "that is actually happening": oh that's pretty good, I thought you were just memeing :P |
21:55:38 | FromDiscord | <tandy> half \:) |
21:57:20 | * | kenran quit (Quit: WeeChat info:version) |
22:02:40 | FromDiscord | <slomp (Marcos Slomp)> Is `static: assert expr, msg` the ideal way to report errors at compile time? |
22:05:38 | FromDiscord | <dom96> there is also the `{.error: "msg".}` pragma |
22:05:41 | * | Gustavo6046 joined #nim |
22:06:13 | FromDiscord | <dom96> https://nim-lang.org/docs/manual.html#pragmas-error-pragma |
22:06:18 | FromDiscord | <dom96> You can also emit warnings and other things |
22:10:56 | FromDiscord | <slomp (Marcos Slomp)> Nice; is there a way to reference a `static` or `const` variable in the `"msg"` in the `error` pragma? |
22:11:47 | FromDiscord | <Yardanico> In reply to @slomp (Marcos Slomp) "Nice; is there a": just concat it like you'd normally do |
22:12:44 | FromDiscord | <slomp (Marcos Slomp)> perfect! thanks again↵(@Yardanico) |
22:27:56 | FromDiscord | <vindaar> yes, many of these points are very valid. However, tell me one good & usable alternative (that isn't even worse)?↵(@exelotl) |
22:28:17 | FromDiscord | <Elegantbeef> Yea matrix is the best open multimedia protcol |
22:31:02 | FromDiscord | <Zoom> @xflywind\: sorry for that poke at you earlier. Looks like I can't git blame. Fixing that strange suggestion for using a string slice just to return an offset index led to a bit more work on `find`\: https://github.com/nim-lang/Nim/pull/19761 |
22:35:49 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:36:20 | FromDiscord | <dom96> In reply to @vindaar "yes, many of these": Zulip and Mattermost look pretty good |
22:36:59 | FromDiscord | <dom96> (And Discord/slack of course if you don’t care about it being proprietary) |
22:37:21 | FromDiscord | <Elegantbeef> Those are both developer centric |
22:39:52 | * | lumo_e quit (Quit: Quit) |
22:42:28 | FromDiscord | <exelotl> they're good for an internal company chat but I don't think they're that good for an open community. I think people can tolerate signing up for forums since those are for slower, long-form discussions, but I'd guess people don't want to sign up to a separate slack clone any time they want to ask a quick question |
22:44:21 | FromDiscord | <exelotl> (and the Mattermost and Zulip apps are still controlled by single companies, though I guess in theory people could make alternative clients more easily for them) |
22:44:36 | FromDiscord | <Elegantbeef> Think you can self host both, but yea |
22:44:49 | FromDiscord | <vindaar> neither aren't really a matrix alternative. I haven't used zulip, not too familiar with it. But from my understanding they are \~slack alternatives |
22:45:02 | FromDiscord | <Elegantbeef> Yea they're corporate text chats it seems |
22:45:33 | FromDiscord | <Elegantbeef> Which is equally like saying teamspeak is good for conferencing 😄 |
22:46:34 | FromDiscord | <exelotl> XMPP seems pretty underrated, I was able to set up a personal server by following this tutorial and it works well enough... I just don't have anyone to talk to https://landchad.net/xmpp 😅 |
22:48:44 | FromDiscord | <exelotl> I've yet to try any web clients for it though.. There needs to be a "so easy your grandma could use it" client that people can use to join a community at the click of a button |
22:48:47 | FromDiscord | <Zoom> XMPP is very solid but we all missed a critial time window when it could have been presented as an alternative to new shiny things like slack/gitter/discord, and not just a better MSN/IRC |
22:51:15 | FromDiscord | <Zoom> I loved my Miranda on my old windows desktop when it could simultaneously work with GTalk, XMPP, ICQ, Facebook, VK and everything else. It's ridiculous how slow everything modern feels nowadays (except maybe CLI software) in comparison. |
22:51:48 | FromDiscord | <Elegantbeef> This is why open protocols matter you can make things faster 😛 |
22:51:50 | FromDiscord | <Elegantbeef> Shit this just offload works to the users |
22:51:56 | FromDiscord | <Elegantbeef> Fuuuuuck! |
23:00:08 | FromDiscord | <spoon> everything built on electron |
23:29:50 | FromDiscord | <Zoom> Don't really know how to read the CI logs for the compiler. Anyone could take a look and tell me where it fails? https://github.com/nim-lang/Nim/runs/6298112856?check_suite_focus=true Was it trying to build nimpy? |
23:33:33 | FromDiscord | <Zoom> Ah, ok. So my change broke nympylib. No biggie. \:D |
23:34:49 | FromDiscord | <xflywind> In reply to @Zoom "Don't really know how": You can ref https://github.com/nim-lang/Nim/pull/18173 |
23:37:33 | FromDiscord | <Zoom> How could I miss it. Anyway, it all should be openarray[char] |
23:41:05 | FromDiscord | <Zoom> Another giant stalling overhaul, that 18173... 😢 |
23:43:03 | FromDiscord | <Elegantbeef> Imagine wanting code reuse |
23:49:12 | FromDiscord | <Bubblie> quick question |
23:49:19 | FromDiscord | <Bubblie> how good is nimpy for using python modules |
23:49:27 | FromDiscord | <Bubblie> I was thinking of possibly using nim for pytorch or something |
23:51:01 | FromDiscord | <spoon> hmm, i've looked at the arraymancer library for getting into ML |
23:51:10 | FromDiscord | <spoon> how far along is it? |
23:53:03 | FromDiscord | <Bubblie> ? |
23:57:31 | FromDiscord | <spoon> In reply to @Bubblie "?": its a nim tensor library, i havent used it much outside the examples but they showcase neural networks |
23:58:32 | FromDiscord | <Bubblie> very very cool |