<< 02-11-2023 >>

00:21:29*derpydoo quit (Quit: derpydoo)
00:51:49*Maksimilan joined #nim
00:52:44*Maksimilan_ joined #nim
00:56:12*Maksimilan quit (Ping timeout: 240 seconds)
00:59:16*Maksimilan__ joined #nim
01:03:19*Maksimilan_ quit (Ping timeout: 264 seconds)
02:00:07*lucerne quit (Read error: Connection reset by peer)
02:00:26*lucerne joined #nim
02:02:49FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4KAV
02:03:21FromDiscord<ravinder387> sayHi' is not GC-safe as it accesses 'data' which is a global using GC'ed memory.. Error
02:03:26FromDiscord<ravinder387> what should i do
02:08:44FromDiscord<hugop707> iirc you should put the variable declaration and thread creation inside a main function and call that
02:12:23FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4KAW
02:12:43FromDiscord<ravinder387> then how i get data as return
02:14:27FromDiscord<hugop707> you cant return from threads, you would need to pass a pointer to the data and write to that
02:14:36FromDiscord<hugop707> as an argument to the function
02:15:12FromDiscord<hugop707> and can only pass one argument to threads afaik, so youd need to pass both together in an object or a tuple
02:15:51FromDiscord<hugop707> but for this example it doesnt make sense because the threads would be trying to access the same memory at the same time, and that would create a race condition
02:16:51FromDiscord<ravinder387> so i need to use std/locks
02:18:28FromDiscord<hugop707> well, i guess but then why use threads to begin with, you wouldnt be saving time
02:19:51*xet7_ joined #nim
02:20:17*xet7_ quit (Remote host closed the connection)
02:20:27*xet7 quit (Quit: Leaving)
02:21:24*xet7 joined #nim
02:22:10FromDiscord<hugop707> that would create 8 threads, tell them to access `data` and each one would try to add 0, 0-1, 0-2, 0-3, 0-4, 0-5, 0-6, 0-7 and 0-8 to it
02:27:51FromDiscord<hugop707> sent a code paste, see https://play.nim-lang.org/#ix=4KAY
02:28:32FromDiscord<hugop707> threads can be hard to get a handle of at first
02:31:44FromDiscord<ravinder387> I have a data = 1..1000 f(x) = x + 9 I want to apply f(x) on each element of data
02:32:17FromDiscord<ravinder387> e.g [1,2.........] => 10, 11 ,.......
02:33:08FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4KB0
02:34:13FromDiscord<hugop707> then you could split the data into as many threads as you are gonna use, pass each thread different independent data, and make it store it somewhere independent aswell, then use some logic to join everything together
02:34:54FromDiscord<ravinder387> you could split the data into as many threads ? how can i split data between threads
02:35:51FromDiscord<michaelb.eth> also note you can’t use `ref` across threads because reference counting with ARC/ORC isn’t atomic so even if you force the compiler to allow it you’ll crash with SIGSEGV
02:36:03FromDiscord<hugop707> sent a code paste, see https://paste.rs/YXsoM
02:36:45FromDiscord<hugop707> sent a code paste, see https://play.nim-lang.org/#ix=4KB3
02:37:15FromDiscord<hugop707> or directly write it back to the `dataforThread` sequence, it depends on how you want to do it
02:37:16FromDiscord<michaelb.eth> (edit) "SIGSEGV" => "SIGSEGV. Locks don’t alleviate that problem with `ref` but may be useful for non-ref data"
02:56:32FromDiscord<hugop707> sent a code paste, see https://play.nim-lang.org/#ix=4KB5
03:05:03*fallback quit (Ping timeout: 240 seconds)
03:05:34*edr quit (Quit: Leaving)
03:26:04FromDiscord<ravinder387> thanks brother
03:39:32FromDiscord<ravinder387> data: ptr seq[int] ... it is ptr i think i also need to dealloc
03:39:45FromDiscord<ravinder387> i think ref is automatically handle by nim
03:41:28FromDiscord<ravinder387> do i need to write dealloc(data)
03:42:25FromDiscord<hugop707> no because its not heap allocated here
03:42:46FromDiscord<ravinder387> oh i see
03:44:31FromDiscord<hugop707> well im not sure tbh
03:44:39FromDiscord<hugop707> lemme see
03:45:23NimEventerNew thread by elcritch: Cosmo3 multi-os fat binaries with threads , see https://forum.nim-lang.org/t/10589
03:45:38FromDiscord<odexine> nice forum post
03:45:51FromDiscord<odexine> "The interesting part to me is:" forum bug?
03:46:01FromDiscord<odexine> oh there it is
04:05:37*fallback joined #nim
05:45:03NimEventerNew thread by Charles: With what parameters does echo call fwrite? Trying to implement fwrite in Nim., see https://forum.nim-lang.org/t/10590
06:25:07FromDiscord<nnsee> In reply to @sys64 "Seems it doesn't show": it depends on how you're compiling it, but to export a function from the wasm side, you'd probably have to mark it with the `exportc` pragma just so Nim doesn't mangle the name, and then pass `-s EXPORTED_FUNCTIONS='["whatever"]'` to the emcc backend
06:26:53FromDiscord<nnsee> In reply to @sys64 "I don't understand why": because at the end of the day it is simply a computation engine
06:27:22FromDiscord<nnsee> and is supposed to be host-agnostic (the host in this case being JS)
07:00:09*advesperacit joined #nim
07:07:47FromDiscord<Chronos [She/Her]> In reply to @michaelb.eth "also note you can’t": `GC_ref` + `GC_unref` 😎
07:08:03FromDiscord<Chronos [She/Her]> Don't channels do copies for when passing across threads tho?
07:11:00FromDiscord<Elegantbeef> They used to deepcopy with refc, don't know about arc/orc
07:11:13FromDiscord<Elegantbeef> Really should use nim-lang/threading's channels with arc/orc
07:44:05*PMunch joined #nim
07:56:25*PMunch quit (Quit: leaving)
07:56:46*PMunch joined #nim
07:59:00FromDiscord<demotomohiro> In reply to @takemichihanagaki3129 "Are `--passL` passed to": Run Nim with `--listcmd` that shows how Nim calls backend C compiler.↵You will see Nim calls gcc (not ld) with options you specified with `--passL`.↵gcc calls ld when linking. If you need to pass options to ld through gcc, you would need to use `--passL:"-Wl,--option-to-ld"`.
08:06:46*redj quit (Remote host closed the connection)
08:08:08*redj joined #nim
08:43:14Amun-Rannsee: I prefer comma seprated syntax -s EXPORTED_FUNCTIONS=_func1,_func2
08:43:43Amun-Raalso, don't forget leading underscores
08:45:52FromDiscord<nnsee> thanks for the tips
08:46:16FromDiscord<nnsee> my knowledge of wasm is pretty surface level, only dabbled in it a small bit
08:46:59Amun-RaI wrote a small example yesterday, my memory is still fresh. :>
08:48:02Amun-Rabtw. you can call such exported function via Module._funcname(args) but from what I see result type defaults to number
08:48:54Amun-Rait's better to do this way: let func = Module.cwrap('func', 'return_type', ['arg_types']);
08:49:15Amun-Rathat requires additional -s 'EXPORTED_RUNTIME_METHODS=cwrap
08:58:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "it depends on how": I just try to call a JS function
08:59:29FromDiscord<nnsee> have a look at https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html
08:59:39Amun-RaI wrote two test cases yesterday (calling wasm from js), C & Nim; I'll write wasm->js today
09:01:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "have a look at": I tried EM_ASM, I don't have access to Document
09:02:15Amun-Rawhich is weird, I used EM_ASM yesterday with document.write and everything was hunky dory
09:02:31FromDiscord<Chronos [She/Her]> In reply to @sys64 "I tried EM_ASM, I": It's `document`, no?
09:03:01Amun-Rayes
09:05:39FromDiscord<Chronos [She/Her]> I'm wondering if System64 used `Document` instead now
09:06:07Amun-Rasame
09:08:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "I'm wondering if System64": No I used document
09:08:33FromDiscord<Chronos [She/Her]> Ah, then no idea
09:08:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "which is weird, I": and did you used document.createElement?
09:09:31Amun-Rano, document.write
09:09:46Amun-Raand it worked
09:10:21FromDiscord<System64 ~ Flandre Scarlet> Also, what is your setup?↵Can you provide a minimal exemple of a main loop that calls a proc that calls EM_ASM with document.createElement like me?↵Also, what is your Emscripten version?
09:11:03Amun-RaI posted the complete sample yesterday, sec
09:11:42FromDiscord<System64 ~ Flandre Scarlet> Ah yeah I remember↵I just have this argument problem
09:12:12Amun-Raplay nim is 502
09:13:46Amun-RaI'll try to write more useful example today
09:14:30FromDiscord<System64 ~ Flandre Scarlet> Alright, thanks
09:16:04Amun-RaI'll need that sooner or later in my browser, too ;>
10:19:54FromDiscord<gyatsoyt> Code:↵let value = pieceValue[piece_type] + evaluatePiece(piece, square, endGame)↵Error:↵In the image https://media.discordapp.net/attachments/371759389889003532/1169581641472167976/Screenshot_2023_1102_154859.png?ex=6555ecc9&is=654377c9&hm=4e1ff24634bad71e59e82ab47ea549d915d131c602692160d0339a5a0d025c7b&
10:20:08FromDiscord<gyatsoyt> (edit) "Code:↵let value = pieceValue[piece_type] + evaluatePiece(piece, square, endGame)↵Error:↵In the image https://media.discordapp.net/attachments/371759389889003532/1169581641472167976/Screenshot_2023_1102_154859.png?ex=6555ecc9&is=654377c9&hm=4e1ff24634bad71e59e82ab47ea549d915d131c602692160d0339a5a0d025c7b&" => "sent a code paste, see https://play.nim-lang.org/#ix=down for DDOS"
10:35:57FromDiscord<that_dude.> Wasn't this a case where you were mixing enums and ints?
10:38:53FromDiscord<Asbjørn> What do y'all do for error handling?↵↵Exceptions? Option types? Object variants?
10:39:05PMunchExceptions mostly
10:39:38PMunchHad some fun with them yesterday as well in case you missed it: https://peterme.net/labelled-exceptions-for-smoother-error-handling.html
10:43:12FromDiscord<Chronos [She/Her]> I think jsony is having an issue with distincts :/
10:43:25FromDiscord<Phil> In reply to @Asbjørn "What do y'all do": Option types only if you want to express that a field may exist or not.↵Use Result types (that's a status package) if you want the equivalent for "This may be a value or something might've gone wrong during its execution"
10:43:40FromDiscord<Chronos [She/Her]> Oh Playground is down
10:43:40FromDiscord<Phil> Myself I tend to use exceptions
10:43:49FromDiscord<michaelb.eth> In reply to @chronos.vitaqua "I think jsony is": it has built-in distinct -> base
10:44:05FromDiscord<Chronos [She/Her]> Ah?
10:44:26FromDiscord<Chronos [She/Her]> Oh this is odd
10:44:39FromDiscord<Chronos [She/Her]> Then my custom dumpHook just did something wrong ig
10:45:08PMunch@Phil, I'm fixing the playground, so don't reboot it :P
10:45:30FromDiscord<Phil> Caught red-handed!
10:45:34FromDiscord<Chronos [She/Her]> https://www.toptal.com/developers/hastebin `toJson(semVer(1, 2, 3))` returns nothing, removing the hook fixes it but still seems like a bug
10:45:35FromDiscord<Phil> (edit) "Caught ... red-handed!" added "me"
10:46:17PMunchHmm, disk is full again
10:46:36FromDiscord<Phil> Wait, how
10:46:45FromDiscord<Phil> I literally rebuilt that thing 2 weeks ago
10:46:50FromDiscord<Phil> Or is it just temp stuff?
10:47:04PMunchThat's what I'm trying to figure out
10:47:11FromDiscord<michaelb.eth> https://github.com/treeform/jsony/blob/master/src/jsony.nim#L631-L633↵↵https://github.com/treeform/jsony/blob/master/src/jsony.nim#L591-L594
10:47:28FromDiscord<nnsee> In reply to @Asbjørn "What do y'all do": i used to mostly use explicit result types because i like that style of handling exceptions. but Peter's labelled exceptions might get me to move over to exceptions
10:47:56FromDiscord<Chronos [She/Her]> In reply to @michaelb.eth "https://github.com/treeform/jsony/blob/master/src/j": Yeah I know now, this stills seems like odd behaviour
10:48:22PMunch6.1G in the overlay2 folder..
10:48:37FromDiscord<Chronos [She/Her]> In reply to @Asbjørn "What do y'all do": Normally exceptions but I've been getting used to `Result` types from https://github.com/arnetheduck/nim-results
10:50:01FromDiscord<michaelb.eth> In reply to @Asbjørn "What do y'all do": https://github.com/arnetheduck/nim-results↵↵gives you `Result[T, E]`, and an `Opt[T]` that can be used in place of std/options
10:54:26FromDiscord<michaelb.eth> In reply to @PMunch "6.1G in the overlay2": i guess it’s not fast enough yet, but would be cool if the playground could be a wasm-ified container that runs in the user’s browser and the editor ui talked to that, so self-contained and never any server to fillbup
10:54:33FromDiscord<michaelb.eth> (edit) "fillbup" => "fill up"
10:57:09FromDiscord<michaelb.eth> > it’s not fast enough yet↵i mean the software stack that makes it possible, too slow and a bit fragile atmoresent
10:57:11FromDiscord<Yardanico> In reply to @michaelb.eth "i guess it’s not": that's VERY funny actually lol
10:57:18FromDiscord<michaelb.eth> (edit) "atmoresent" => "at present"
10:57:18FromDiscord<Yardanico> because a guy from the nim telegram has already done exactly that
10:57:23FromDiscord<Yardanico> nim vm running in the browser through wasm
10:57:29FromDiscord<Yardanico> https://nimplay.eu.org/
10:57:35FromDiscord<Yardanico> it's nimscript so the same limitations apply
10:57:44FromDiscord<Yardanico> but it runs entirely in the browser
10:57:46FromDiscord<michaelb.eth> i meant the whole thing, Linus OS and all
10:57:50FromDiscord<Yardanico> oh
10:57:54FromDiscord<Yardanico> that'll be quite slow but possible
10:57:55FromDiscord<michaelb.eth> (edit) "Linus" => "Linux"
10:58:13FromDiscord<michaelb.eth> its not achingly slow, but still too slow
10:58:55FromDiscord<michaelb.eth> nice thing would be its the full deal, not just nimscripy
10:59:00FromDiscord<michaelb.eth> (edit) "nimscripy" => "nimscript"
11:00:13FromDiscord<michaelb.eth> https://github.com/ktock/container2wasm
11:00:47PMunchNext person who asks for a nice Nim project to start off with I know what to ask for..
11:01:11PMunchA program which just takes a file piped from `du` and shows me something like the output from Baobab
11:01:15FromDiscord<Phil> In reply to @yardanico "it's nimscript so the": So it's basically just the nim vm?↵Or is it essentially "compiling" the code-snippet in your browser via the compiler?
11:01:22FromDiscord<Yardanico> In reply to @isofruit "So it's basically just": just the nim vm
11:01:23FromDiscord<Yardanico> via wasm
11:01:43FromDiscord<Yardanico> https://github.com/gabbhack/nimplay
11:06:36PMunchHmm, df -h says the drive is filled to the brim. But du -ahx only lists 17/25Gb..
11:12:18PMunchIt's normal that they differ a bit, but 8Gb?
11:14:35PMunchHmm, I think Docker just got hung up and had some lingering open files
11:14:46PMunchAlso found a 4Gb swapfile which was a bit excessive
11:14:55PMunchPlayground is back up now with 56% full disk
11:16:10FromDiscord<Phil> .... 4GB swapfile for all of the 1GB of RAM xD
11:16:19FromDiscord<Phil> That's a lot of swap!
11:16:47FromDiscord<Phil> In reply to @yardanico "via wasm": That is kinda sick
11:17:24FromDiscord<Yardanico> and if you check, the total file size is ~5mb for the wasm stuff
11:17:35FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1169596159443091477/image.png?ex=6555fa4e&is=6543854e&hm=805e594df6c68815a19bf1ebea3caaf9c5f3dd321c94bf24c0777a7f3a4f6fcb&
11:17:44FromDiscord<Phil> But the tech stack overall feels kinda fragil.↵Like nim code, generating c code, compiled to an intermediate representation in WASM that gets turned on-the-fly into machine instructions which turn instructions it receives at runtime into machine instructions
11:17:44FromDiscord<Yardanico> ofc it's even lower after transparent network compression
11:18:13FromDiscord<Yardanico> there's no C code involved here
11:18:21FromDiscord<Phil> We go nim --> Wasm directly?
11:18:24FromDiscord<Yardanico> again, it's the Nim VM (think nimscripter) compiled into wasm
11:18:30FromDiscord<Yardanico> (edit) "nimscripter)" => "nimscripter/nim secret)"
11:18:37FromDiscord<Yardanico> (edit) "nimscripter/nim secret)" => "nimscripter/`nim secret`/`nim e`)"
11:19:06FromDiscord<Phil> I assume the nim VM is written in nim (?), my total lack of knowledge in that area is shining I guess
11:19:17FromDiscord<Yardanico> it's part of the compiler, and the whole compiler is in nim, so yes
11:19:25FromDiscord<Yardanico> In reply to @yardanico "": the funny thing is that the 4.8 mb data file is the whole nim stdlib
11:19:28FromDiscord<Yardanico> the wasm is only 800kb
11:19:39FromDiscord<Yardanico> and ofc after compression it'll be much lower
11:19:55FromDiscord<Phil> So you can compile nim code to wasm directly, no going through C?
11:20:15FromDiscord<Yardanico> it is going through C, but only when compiling
11:20:24FromDiscord<Yardanico> after you compile the VM it'll directly execute nim code and give you the results
11:20:27FromDiscord<Yardanico> since the whole VM is already in wasm
11:20:37FromDiscord<Yardanico> the thing itself is compiled via emscripten
11:20:38FromDiscord<Phil> Check, that's the mental image I had
11:20:52FromDiscord<Phil> May have phrased it poorly
11:21:15FromDiscord<Phil> Was trying to type out the path from "nim-compiler-source-code" to "executed machine instructions from code provided at runtime"
11:21:31FromDiscord<Phil> (edit) "runtime"" => "runtime to a compiled compiler""
11:21:59FromDiscord<Phil> I wonder if we have too many abstraction layers nowadays
11:22:31FromDiscord<Phil> Or if it's actually a valid amount of abstraction layers given how much stuff at once becomes possible through them
11:24:10FromDiscord<Yardanico> In reply to @isofruit "I wonder if we": certainly better than https://news.ycombinator.com/item?id=38043033
11:24:23FromDiscord<Yardanico> https://shadow.goose.icu/
11:24:25FromDiscord<Phil> JS executing JS
11:24:30FromDiscord<Phil> I am scared Yard
11:25:24FromDiscord<Phil> Insert "That thing, that frightens me" meme
11:26:28FromDiscord<Yardanico> In reply to @isofruit "I am scared Yard": we need serenityos compiled into wasm and rendered into the canvas
11:26:34FromDiscord<Yardanico> so we could open web pages through its built-in browser
11:27:26FromDiscord<Phil> ... the browser browser
11:27:30FromDiscord<_nenc> Ahhhhhhh
11:28:00FromDiscord<_nenc> Browser in browser, this is killing how browsers are being part of the open and freedom technology of web
11:28:17FromDiscord<Phil> I wonder if this goes against the disturbing content rule
11:40:20FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "yes but it's more": I tried multithreading and yeah, this is a mistake↵I should use async instead !!
11:45:14*hexeme quit (Ping timeout: 255 seconds)
11:47:52*hexeme joined #nim
11:49:10FromDiscord<jmgomez> In reply to @jviega "Anyone know if there": `--app:staticLib`
11:52:12FromDiscord<jviega> That I did figure out, I had tried, and it doesn't name it properly amusingly. Nor does it link in dependencies needed to be a stand-alone .a
11:52:16FromDiscord<jviega> But thank you
11:54:42FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=down for DDOS
11:55:25FromDiscord<jviega> Oh interesting, thank you
12:04:21*edr joined #nim
12:42:36NimEventerNew Nimble package! docchanger - Replaces substrings in .docx files with data, that is parsed from a json config file., see https://github.com/nirokay/docchanger
12:43:50FromDiscord<nnsee> In reply to @NimEventer "New Nimble package! docchanger": 🤨 https://media.discordapp.net/attachments/371759389889003532/1169617866002276432/image.png?ex=65560e85&is=65439985&hm=9f5ab999da2b9f8bf88fdd3d5c745a222efbc400a95117e8b095629afeb92114&
12:44:08PMunch@Phil, I think I created that swap for a particularly large update at some point :P Forgot to resize it afterwards
12:57:38FromDiscord<jviega> Wow. I've never been part of a tech community with this much ultra conservative vitriol actually.
12:58:29PMunch@jviega, is that in reference to anything in particular?
12:59:05FromDiscord<jviega> Yeah the image Ras posted, but it's not the first thing I've seen like that
12:59:05PMunchOh right.. Images don't come through IRC
12:59:14FromDiscord<jviega> Ahh
13:02:33PMunchLooking at their GitHub profile I think this might just be a joke not landing very well
13:03:00PMunchBut I do agree that in general the Nim community for some reason has a weird penchant for that kind of stuff
13:03:53PMunchBut let's not get into that here
13:05:08FromDiscord<jviega> Agreed, I prefer to just focus on the tech
13:05:34FromDiscord<Chronos [She/Her]> In reply to @PMunch "But I do agree": Not weird considering everything :p
13:07:33PMunchWell, maybe not weird. Maybe we should throw in some questions in the next Nim community poll if we should get tougher on cracking down on such things
13:08:04PMunchThat brings a whole political debate on what to ban and what not to ban though, which is kinda why we haven't done it thus far
13:08:20FromDiscord<Chronos [She/Her]> If the majority of the community is more right leaning then they'd obviously vote no aha
13:08:51FromDiscord<Chronos [She/Her]> I'd say just be respectful of others political views, and discrimination against anyone because of how they think or act, when they aren't harming anyone, isn't okay
13:08:57FromDiscord<Chronos [She/Her]> General catch-a
13:09:01FromDiscord<Chronos [She/Her]> Catch-all
13:11:17PMunchThat's pretty much what we try to follow
13:11:45PMunchBut there are all kinds of edge-cases in human communications unfortunately
13:20:12FromDiscord<Chronos [She/Her]> Fair
13:24:45FromDiscord<Chronos [She/Her]> Hm, rn I'm wondering of the best way to structure my code... Again lol
13:25:32FromDiscord<Chronos [She/Her]> Because I have some code that relies on the chat program's instance but not sure how I should keep it around? A ref object is probably better for this tbh
13:40:07FromDiscord<takemichihanagaki3129> In reply to @demotomohiro "Run Nim with `--listcmd`": Sure, thanks a lot!
13:41:57PMunch@jviega, did you find your linker commands by the way?
13:49:46FromDiscord<jviega> Well, I know what I need to do to figure out how to get a working .a I just backburnered it a bit because it was significantly more work than just finding that flag
13:51:43PMunchAh, I see
13:52:11FromDiscord<jviega> Thank you 🙂
14:03:49NimEventerNew thread by lou15b: Which smartptrs to use?, see https://forum.nim-lang.org/t/10591
14:20:48FromDiscord<Chronos [She/Her]> Oof I'm really struggling to figure out how to intelligently pass my `SupernovaeInstance` type to modules that need it
14:20:59FromDiscord<Chronos [She/Her]> Like, globals are the main issue here
14:21:50FromDiscord<Chronos [She/Her]> Want to avoid them, if possible
14:26:11FromDiscord<Chronos [She/Her]> Hm... Looking at it rn, seems Prologue is fine with closures
14:26:36FromDiscord<Chronos [She/Her]> So I could have an entrypoint and pass my instance object to them
14:26:51FromDiscord<Chronos [She/Her]> But I don't know if that'll fuck with memory management aha
14:30:44*derpydoo joined #nim
14:32:31FromDiscord<Chronos [She/Her]> Wonder if there's any point to using groups in Prologue hm
14:34:19*PMunch quit (Quit: leaving)
14:36:46*PMunch joined #nim
14:40:17FromDiscord<Phil> groups?
14:45:28FromDiscord<takemichihanagaki3129> How can I override a system's procedure, template?
14:46:25FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=down for DDOS
14:46:50FromDiscord<takemichihanagaki3129> (edit)
14:47:10FromDiscord<takemichihanagaki3129> (edit)
14:48:04FromDiscord<takemichihanagaki3129> (edit)
14:52:24FromDiscord<takemichihanagaki3129> In reply to @takemichihanagaki3129 "I'm trying to override": I will try with `{.redefine.}`
15:08:53FromDiscord<Chronos [She/Her]> In reply to @isofruit "groups?": Yeah, groups for API routes and such
15:16:56FromDiscord<Phil> I don't get it, do you want something that generates CRUD controllers for a given object?
15:17:19FromDiscord<Phil> Because when you speak groups my mind goes to user group concepts and associated permissions
15:17:36FromDiscord<Phil> (edit) "Because when you speak groups my mind goes to user group concepts and associated permissions ... " added "management"
15:19:43FromDiscord<Phil> Ohhhhh you mean the prologue routing thing for stuff
15:19:55FromDiscord<Phil> Wow that didn't trigger
15:21:14FromDiscord<Phil> In reply to @chronos.vitaqua "Yeah, groups for API": It's for the most part really neat if you can get it to work for you
15:22:16FromDiscord<Phil> You can define middlewares, urls etc. that are specific to a set of endpoints really nicely
15:22:57FromDiscord<Phil> For example say you have a CRUD endpoint group for a given entity.↵Well they always must be under the same URL, so putting them into a group for that is really neat and makes it simpler to later change URLs if you need to
15:23:38FromDiscord<Phil> It allows you to cluster things together that should be clustered together, limiting ways how future changes can shoot you in the foot by restricting freedom
15:24:13FromDiscord<Phil> The main reason I didn't use it because back then I was not really knowledgeable, didn't understand it and couldn't get it to work for me in 3 minutes
15:24:31FromDiscord<Phil> (edit) "minutes" => "minutes, while normal routing worked."
15:24:40FromDiscord<Phil> So I just used normal routing
15:25:05FromDiscord<Phil> (edit) "So" => "And I didn't have scenarios where I wanted a specific piece of middleware for a particular set of endpoints but not for others. ↵So"
15:26:13FromDiscord<Phil> Note that it's not a big deal, just a small neat thing
15:27:26FromDiscord<Phil> Entity = an ORM model type
15:27:36FromDiscord<Phil> (edit) "type" => "type. E.g. in norm a norm model"
15:33:18FromDiscord<Chronos [She/Her]> In reply to @isofruit "Wow that didn't trigger": It's fine aha
15:33:49FromDiscord<Chronos [She/Her]> In reply to @isofruit "And I didn't have": Fair enough
15:39:52*PMunch quit (Quit: leaving)
15:45:29FromDiscord<Phil> TBH I would've benefitted from it.↵I have like 5 controllers sitting on this url:↵` re fmt"/character/pk/{ID_PATTERN}/", `
15:45:44FromDiscord<Phil> It would have been a hell of a lot smarter to only have to define that url once instead of 5 times
15:46:26FromDiscord<Phil> And that kind of thing I have across 20 different entities that have their own controllers
15:50:47FromDiscord<Chronos [She/Her]> Fair aha, I'm using it to model my API for the most part tbh
15:58:20FromDiscord<nnsee> if i have a bunch of different output binaries defined in my nimble project, is there any way to build them in parallel?
15:59:54FromDiscord<Chronos [She/Her]> In reply to @nnsee "if i have a": Spawn new processes maybe? Not too sure how else it could be done, since it's not like you have access to threading and stuff to make them build at the same time
16:00:32FromDiscord<Chronos [She/Her]> Maybe Confy would be of interest? It's basically a library for letting you create your own build scripts, and since it's Nim code (compiled to C), would probably be perfect for that stuff
16:10:26FromDiscord<nnsee> > since it's not like you have access to threading and stuff↵why not? Make has had the `--jobs` flag for literal decades
16:10:38FromDiscord<nnsee> i don't see why it needs to be some inherent limitation for nimble
16:19:09FromDiscord<Chronos [She/Her]> In reply to @nnsee "i don't see why": It uses Nimscript
16:19:46FromDiscord<Chronos [She/Her]> Nimscript in it's current state just doesn't support anything related to threading because you'd have to implement support for it in the VM :p
16:23:17FromDiscord<Phil> In reply to @nnsee "if i have a": Hmmm are they trivial to compile in parallel?
16:23:34FromDiscord<Phil> Because e.g. for my webdev project the C --> Binary step eats up around every CPU core I have
16:23:45FromDiscord<Phil> trivial being in terms of computation cost
16:24:15FromDiscord<nnsee> In reply to @chronos.vitaqua "It uses Nimscript": er, what? the config file does, sure... but it's not like nimble itself is written in nimscript
16:24:17FromDiscord<Phil> Because if your CPU is being eaten up most of the time anyway then compiling them in order doesn't make much of a difference to in parallel
16:25:07FromDiscord<nnsee> In reply to @isofruit "Hmmm are they *trivial*": yes, most of my cores are sitting at idle when compiling
16:25:23FromDiscord<Phil> In that case my first guess would be to look at if nimscript can trigger jobs
16:25:31FromDiscord<Phil> because I know nim has procs for that
16:25:59FromDiscord<nnsee> if it's too much of a hassle then it's no problem, i just wondered whether there was a flag for it that i was missing or something
16:26:49FromDiscord<Phil> https://nim-lang.org/docs/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29
16:27:12FromDiscord<Phil> Now to see whether nimscript can run that.↵Alternatively you could build that as a tiny binary and trigger that binary from a nimble task
16:29:09FromDiscord<Phil> Yeah I don't see it for nimscript
16:29:32FromDiscord<nnsee> why are we talking about nimscript?
16:29:45FromDiscord<nnsee> the build command itself is invoked from nim-land
16:29:46FromDiscord<nnsee> https://github.com/nim-lang/nimble/blob/603e329442059947d63e4c1b2ef5294f1f544485/src/nimble.nim#L167C15-L167C15
16:29:51FromDiscord<Phil> Because I see nimble I think nimble task which is nimscript
16:30:40FromDiscord<nnsee> anyways i can see from the code that there's no support for parallelization whatsoever so that answers my question :p
16:31:29FromDiscord<Phil> Oh you wanted to see if nimble itself can do it, not if you can write a nimscript task to do so
16:31:36FromDiscord<nnsee> yup
16:31:45FromDiscord<Phil> Okay, my bad, I went at it from the user perspective
16:31:53FromDiscord<nnsee> yeah my bad, maybe i wasn't too clear on it
16:42:11FromDiscord<Chronos [She/Her]> In reply to @nnsee "er, what? the config": The `.nimble` tasks are Nimscript, though
16:43:02FromDiscord<Chronos [She/Her]> In reply to @nnsee "the build command itself": I don't get it, do you mean `nimble build` then? If so, I defo misunderstood-
16:43:10FromDiscord<nnsee> yes
16:43:17FromDiscord<Phil> In reply to @chronos.vitaqua "The `.nimble` tasks are": He meant whether nimble from within nimble can do parallel building
16:43:29FromDiscord<Chronos [She/Her]> Aah okay sorry then aha
16:43:42FromDiscord<desi.> https://rumble.com/v3t85wy-baby-buffalo-vs-lion.html
16:43:42FromDiscord<Phil> No worries, I fell for the exact same misunderstanding 😄
16:43:47FromDiscord<nnsee> for reference, this is the entirety of my nimble file https://media.discordapp.net/attachments/371759389889003532/1169678248402243654/image.png?ex=655646c1&is=6543d1c1&hm=acc9ce409d12bad15def29990d773c4b06cbe5d208f2f5af3ad6a3f3e4338c6a&
16:43:52FromDiscord<nnsee> to build those bins, i just do `nimble build`
16:43:58FromDiscord<nnsee> was hoping it could do those in parallel
16:44:02FromDiscord<Phil> In reply to @desi. "https://rumble.com/v3t85wy-baby-buffalo-vs-lion.htm": You have 15 seconds to explain how this is relevant to nim or I'll assume you're a spambot
16:44:11FromDiscord<Phil> And act accordingly
16:44:47FromDiscord<Phil> Time's up
16:44:51FromDiscord<Chronos [She/Her]> Lol
16:45:01FromDiscord<Chronos [She/Her]> In reply to @nnsee "was hoping it could": Don't think so rip
16:45:50FromDiscord<Chronos [She/Her]> But I did suggest Confy as an alternative as a buildscript :p
16:45:58FromDiscord<Chronos [She/Her]> Buildscript lib
16:49:53FromDiscord<Phil> Ain't nothing getting between me and just using raw nimble tasks!
16:50:05FromDiscord<Phil> No additional abstraction layers!
16:59:38FromDiscord<Chronos [She/Her]> Just have a tasks folder 😎
16:59:40NimEventerNew thread by Araq: NIR, see https://forum.nim-lang.org/t/10594
17:25:54FromDiscord<Chronos [She/Her]> What would I name a proc that has the sole purpose of being used for running code in `asyncCheck`? Not sure how to name it oof
17:26:38FromDiscord<Chronos [She/Her]> Oh, `initialiseTasks`?
17:30:05FromDiscord<Chronos [She/Her]> Doing that yeet
17:57:26FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
18:36:08*Maksimilan__ quit (Read error: Connection reset by peer)
18:44:58*Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:46:18*Batzy joined #nim
18:49:57FromDiscord<curome> sent a long message, see down for a while due to DDOS. thanks, buddy!
18:56:08*neceve joined #nim
19:05:24FromDiscord<griffith1deadly> In reply to @curome "Ok so i tried": just skill issue bro
19:11:36FromDiscord<curome> In reply to @griffith1deadly "just skill issue bro": But it's your skill issue if you can't help
19:19:10*krux02 joined #nim
19:20:21*krux02 quit (Remote host closed the connection)
19:24:58FromDiscord<griffith1deadly> In reply to @curome "But it's your skill": https://github.com/treeform/pixie/blob/master/src/pixie/common.nim#L56
19:32:04FromDiscord<curome> In reply to @griffith1deadly "https://github.com/treeform/pixie/blob/master/src/p": Ty
19:36:18FromDiscord<Phil> In reply to @curome "Ok so i tried": for reference `export` typically means that whoever imports the module with said export statement also gets access to the exported symbol.
19:38:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
19:38:34FromDiscord<Phil> (edit)
19:40:44FromDiscord<Phil> Therefore the template `dataIndex` should still be available if you import images.nim, hmm
19:42:11FromDiscord<Phil> Therefore that change should not have broken anything on your end just because the dataIndex template was moved, hmm
19:43:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
19:45:51FromDiscord<curome> Why doesn't it compiles then:boom: ↵↵Im also searching for binaries, but idk, ig that all you can help
19:47:50FromDiscord<Phil> ...? Binaries? What binaries?↵↵Also I can't tell you why your code doesn't compile, I have not yet learned the magical arts of mindreading to see the code through your eyes 😛
19:49:46FromDiscord<curome> In reply to @isofruit "...? Binaries? What binaries?": Binaries i mean compiled
19:50:08FromDiscord<curome> In reply to @isofruit "...? Binaries? What binaries?": Not my code↵Anuken/mindustry is what i want
19:50:12FromDiscord<Phil> No I get that, but compiled of what?
19:50:39FromDiscord<curome> (edit) "code↵Anuken/mindustry" => "code↵Anuken/animdustry"
19:51:20FromDiscord<Phil> Like, are you looking for the binary output of a project you're compiling?↵Or the binary of the nim compiler?
19:51:37FromDiscord<curome> I want to play animdustry
19:51:42FromDiscord<curome> That's the goal
19:52:27FromDiscord<Phil> https://anuke.itch.io/mindustry ?
19:52:38FromDiscord<curome> In reply to @isofruit "https://anuke.itch.io/mindustry ?": Animdustry
19:54:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
19:54:39FromDiscord<Phil> Going by the name of "main"
19:54:53FromDiscord<Phil> or main.exe if you're on windows I'd assume
20:10:24FromDiscord<curome> sent a long message, see down for a while due to DDOS. thanks, buddy!
20:12:21FromDiscord<Phil> I mean, warnings depends on the nim version
21:18:44FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
21:21:25Amun-Raheh
21:22:41FromDiscord<Elegantbeef> `range['A'..'Z'](ord('A') + ind)`
21:23:20FromDiscord<user2m> Ahhh I fiured it'd eb easier than that
21:23:46FromDiscord<Elegantbeef> I mean you can use `toSeq('A'..'Z')[ind]` but that allocates a sequence
21:25:11FromDiscord<user2m> fair eneough I'll just write a shortand proc
21:25:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
21:27:17FromDiscord<user2m> beautiful
21:30:12Amun-Rahmm
21:30:38Amun-Raplay.nim works for you?
21:32:10Amun-Raall the links I see on irc look like:
21:32:29Amun-RaElegantbeef | sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
21:43:20*advesperacit quit ()
21:54:35*derpydoo quit (Read error: Connection reset by peer)
21:57:43FromDiscord<ElegantBeef> Playground works, ixio doesnt
22:29:03*neceve quit (Ping timeout: 240 seconds)
23:13:23FromDiscord<taperfade> guys
23:13:38FromDiscord<taperfade> why did some nim stuff break
23:13:52FromDiscord<jviega> Is that a setup for a joke?
23:13:57FromDiscord<taperfade> no..
23:14:03FromDiscord<taperfade> my modules literally dont work
23:14:05FromDiscord<taperfade> or smth
23:14:10FromDiscord<jviega> Then get a bit more specific 🙂
23:14:23FromDiscord<taperfade> i guess ill switch to scratch
23:14:24FromDiscord<taperfade> jk
23:14:27FromDiscord<taperfade> uhh
23:14:27FromDiscord<jviega> Or, really, a LOT more specific
23:15:48FromDiscord<taperfade> sent a code paste, see https://play.nim-lang.org/#ix=down for a while due to DDOS. thanks, buddy!
23:17:04FromDiscord<taperfade> (edit)
23:17:58FromDiscord<jviega> Did you just upgrade versions? I'd say downgrade and report a bug if so?
23:19:40FromDiscord<taperfade> ikd
23:19:41FromDiscord<taperfade> idk
23:19:49FromDiscord<taperfade> it just started happening
23:20:51FromDiscord<Elegantbeef> It no do the worky!
23:22:38FromDiscord<taperfade> yeah
23:22:41FromDiscord<taperfade> not malwareing
23:22:43FromDiscord<taperfade> jk
23:22:54FromDiscord<taperfade>