<< 02-06-2024 >>

00:29:36FromDiscord<albassort> In reply to @chronos.vitaqua "Really? Weird": something to do with an outdated built i was building off the wrong version
00:29:46FromDiscord<albassort> took me an hour to figure out
00:29:46FromDiscord<albassort> lole
00:29:58FromDiscord<albassort> i think my development woes are over now though and i can finally work
00:35:06FromDiscord<Robyn [She/Her]> Aah
01:00:02*nazgulsenpai_ quit (Quit: ZNC 1.8.2 - https://znc.in)
01:03:27*nazgulsenpai joined #nim
02:52:42*beholders_eye quit (Read error: Connection reset by peer)
02:53:48FromDiscord<albassort> WOOOOOOOOOOOOOOOOOOOOOOOO
02:58:22*beholders_eye joined #nim
04:13:49*beholders_eye quit (Read error: Connection reset by peer)
04:15:32*fallback quit (Read error: Connection reset by peer)
04:19:56*beholders_eye joined #nim
04:20:40NimEventerNew thread by paalon: Package name and file name convention for Nim, see https://forum.nim-lang.org/t/11689
04:22:22*beholders_eye quit (Read error: Connection reset by peer)
04:28:19*beholders_eye joined #nim
04:37:54FromDiscord<Phil> In reply to @guttural666 "at the moment I'm": Do not ever access GTK stuff from a second thread, it is not thread safe
04:41:33FromDiscord<Elegantbeef> tag all the GTK code with `GTK` then you can do `{.forbids: [GTK].}`!
04:44:51FromDiscord<Phil> sent a long message, see https://pasty.ee/YkcfmLih
04:45:52FromDiscord<Phil> Ah, gtask isn't wrapped by owlkettle though.↵Yeah we likely should get around to that
04:46:35FromDiscord<Phil> Though I'd prefer a nim internal solution rather than a GTK solution for multithreading first
04:52:40FromDiscord<Phil> sent a long message, see https://pasty.ee/gbUwkQuO
04:55:23*beholders_eye quit (Read error: Connection reset by peer)
05:01:06*beholders_eye joined #nim
05:05:27FromDiscord<Phil> Particularly since owlkettle only has its own layer of state in order to check if anything changed any only sync to GTK if that is the case
05:05:38FromDiscord<Phil> So you're only paying the price of change detection, not a full re-render
05:07:57FromDiscord<Phil> At least I think that's what owlkettle did, been a while since I looked at the DSL.↵@can.l can you confirm?
05:24:16*beholders_eye quit (Read error: Connection reset by peer)
05:29:48*beholders_eye joined #nim
05:44:24FromDiscord<hedy.cwd> sent a code paste, see https://play.nim-lang.org/#pasty=KdpbZzyr
05:47:22FromDiscord<hedy.cwd> update: cursor shows up only when I resize the terminal...
05:56:32*wheatengineer joined #nim
06:06:06*beholders_eye quit (Read error: Connection reset by peer)
06:11:48*beholders_eye joined #nim
06:37:28FromDiscord<abb3v> Is there documentation for moving a single function to a seperate thread? for async calling.
06:57:51*wheatengineer-fa joined #nim
07:00:19*wheatengineer quit (Read error: Connection reset by peer)
07:00:21*beholders_eye quit (Read error: Connection reset by peer)
07:01:40*wheatengineer joined #nim
07:03:28*wheatengineer-fa quit (Ping timeout: 246 seconds)
07:05:55*beholders_eye joined #nim
07:11:31*beholders_eye quit (Read error: Connection reset by peer)
07:17:22*beholders_eye joined #nim
07:18:29FromDiscord<Phil> In reply to @abb3v "Is there documentation for": I mean, there's createThread to execute a given function in a separete thread.↵If you just want async, why not just use std/asyncdispatch or chronos?
07:18:59FromDiscord<Phil> (edit) "separete" => "separate"
07:19:34FromDiscord<abb3v> In reply to @isofruit "I mean, there's createThread": I have a program which is reading from an SQLDB, but it takes like 0.017 seconds to do that, because it hangs the rest of the program. so i need to move SQL to another thread.
07:19:36FromDiscord<abb3v> but im not sure how
07:21:54FromDiscord<Phil> Ooff.↵The clean version for that is to use async procs and a http server that supports async-dispatch + a db that has a nim package with async support. I don't know which one does because I myself use sqlite which doesn't do async, but I assume there's a postgres package somewhere out there with support
07:22:18FromDiscord<abb3v> a http server?
07:22:24FromDiscord<abb3v> I feel like that adds massive overhead
07:22:35FromDiscord<Phil> Ah sorry, DB makes me think of webdev which means http server etc.
07:22:40FromDiscord<abb3v> ohhh
07:22:43*wheatengineer quit (Ping timeout: 246 seconds)
07:22:54FromDiscord<abb3v> Hang on, would you like me to show you the project?
07:23:12FromDiscord<Phil> I don't have the mental capacity atm to do that in-depth level of thinking really
07:23:33FromDiscord<abb3v> Ah oof.
07:23:40FromDiscord<abb3v> The program isn't complex, its a simple db lol
07:24:08FromDiscord<Phil> I can just give you the general surface level advice:↵The least amount of insanity lies in using async with this type of thing.↵It is annoying, because you'll need to manage the futures and figure out when/how you want to `waitFor` them, but it is a lot less insane then the alternative
07:24:53FromDiscord<Phil> Though I guess if you're not in webdev the alternative is manageable and you just write yourself a mailbox.↵But then you still need to decide when/how to check if you received something in that mailbox and now you're back to square one
07:25:31FromDiscord<Phil> sorry, by mailbox I mean "A thread that executes the function and sends a message back to the main-thread with the result"
07:25:37FromDiscord<abb3v> This program isn't that complex though.
07:27:08FromDiscord<abb3v> sent a code paste, see https://play.nim-lang.org/#pasty=QvcKnKRi
07:27:40FromDiscord<abb3v> With `getPkgCount`, the program is at 0.020s to run. Without it, it's at 0.003.
07:27:59FromDiscord<abb3v> So program halts for package count, regardless of where it's called.
07:28:08FromDiscord<abb3v> So I need to run this elsewhere.
07:28:21FromDiscord<Phil> Ah, sqlite, yeah you'll not get away with async
07:28:30FromDiscord<abb3v> 😭
07:28:49FromDiscord<abb3v> any way to move "getPkgCount" to another thread?
07:29:02FromDiscord<abb3v> Or is there another way to alternatively speed that up?
07:29:16FromDiscord<Phil> You could look into just using taskpool and combine that with System.Channel to phone back the result
07:29:30FromDiscord<Phil> If you don't want taskpool for a threadpool you can just use createThread yourself
07:32:45FromDiscord<Phil> sent a long message, see https://pasty.ee/dkOLiVMe
07:33:03FromDiscord<Phil> (edit) "https://pasty.ee/GqzWpYAY" => "https://pasty.ee/YbIDiNzX"
07:33:10FromDiscord<abb3v> 👍 will try
07:35:17FromDiscord<Phil> The key ingredients for this are:↵https://nim-lang.org/docs/system.html#Channel↵https://nim-lang.org/docs/system.html#recv%2CChannel%5BTMsg%5D↵https://nim-lang.org/docs/typedthreads.html#createThread,Thread[TArg],proc(TArg),TArg
07:55:34*ntat joined #nim
08:28:24*xet7 quit (Remote host closed the connection)
08:58:19*beholders_eye quit (Read error: Connection reset by peer)
08:58:45*beholders_eye joined #nim
09:50:41*ntat quit (Quit: Leaving)
10:10:04*SchweinDeBurg quit (Read error: Connection reset by peer)
10:10:43*wheatengineer joined #nim
10:15:55*SchweinDeBurg joined #nim
11:28:50FromDiscord<ingo_61476> What if you move opening the DB to outside dnfPkg() ? The next question would be proper index? Can you turn the query into a prepared statement?
11:37:22FromDiscord<ingo_61476> Or maybe use asyncstream 'channels' to move the query to SQLite and the result back?
11:43:11*nils` joined #nim
11:52:36*dtomato quit (Remote host closed the connection)
11:54:55*wheatengineer quit (Remote host closed the connection)
12:00:22*dtomato joined #nim
13:20:53*beholders_eye quit (Read error: Connection reset by peer)
13:26:29*beholders_eye joined #nim
13:37:45FromDiscord<fakuivan> Can the nim compiler target c to be compiled with gcc? I'm messing around with an embedded Linux for which I was able to find a crusty not-even-c++11-supporting version of gcc. I'd like to avoid writing linked lists, macros and doing string length arithmetic (aka c).
13:47:56FromDiscord<demotomohiro> On linux and windows, Nim calls gcc to compile generated C code.
13:48:01*dv^_^ quit (Ping timeout: 255 seconds)
13:49:12FromDiscord<demotomohiro> Nim supports other C compilers, Clang, visual C++, tcc or etc.
13:52:47FromDiscord<fakuivan> Cool
13:53:27FromDiscord<fakuivan> Any idea of what the binary sizes look like?
13:53:39FromDiscord<fakuivan> For a hello world at least
14:01:14FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=kLslLbeb
14:07:34FromDiscord<demotomohiro> It can be about 18kb when compiled with options to optimize size.
14:24:15Amun-Rafakuivan: c99 compliant compiler is fine
14:24:38Amun-RaC standard is one thing, POSIX one is anothe
14:26:56FromDiscord<fakuivan> In reply to @demotomohiro "It can be about": Oh that's pretty good
14:27:43Amun-Rafe: if your implementation does not have mmap, use -d=usemalloc
14:28:39FromDiscord<fakuivan> Tried doing rust on openwrt, might as well install the python interpreter for how bloated rust binaries are
14:28:50FromDiscord<fakuivan> I might give nim a try for embedded stuff
14:29:01Amun-Rarust is "special"
14:29:54FromDiscord<thedistantforest> sent a code paste, see https://play.nim-lang.org/#pasty=bfxKYaAQ
14:30:58FromDiscord<Robyn [She/Her]> Huh, what does Rust add to binaries?
14:31:09FromDiscord<Robyn [She/Her]> In reply to @fakuivan "Tried doing rust on": MicroPython is an option tbf lmao
14:33:03Amun-Raand C++
14:35:45*dv^_^ joined #nim
14:42:30FromDiscord<pmunch> In reply to @fakuivan "Oh that's pretty good": Sizes can get even smaller as well. I've successfully run Nim on an Attiny85
14:43:37FromDiscord<fakuivan> Does the compiler always target another c compiler or can you do direct to llvm ir, use the gcc backend or something like that?
14:46:40FromDiscord<pmunch> It always go to C, at least by default.
14:47:01FromDiscord<ambient3332> rust binary size is both a blessing and a curse, mostly a blessing
14:47:13FromDiscord<ambient3332> no need for DLL hell
14:47:26FromDiscord<zumi.dxy> for llvm IR there is an unofficial project: https://github.com/arnetheduck/nlvm
14:48:04FromDiscord<pmunch> In reply to @ambient3332 "no need for DLL": At least in Nim you get a choice. You can always statically link if you'd like
14:50:35FromDiscord<thedistantforest> sent a code paste, see https://play.nim-lang.org/#pasty=HzQrjuoV
15:01:40FromDiscord<Robyn [She/Her]> Hm I feel like there's another way, but I can't remember it
15:02:07FromDiscord<Robyn [She/Her]> Was it using import C and passing `-ldwmapi` to the linker or something?
15:03:54FromDiscord<fakuivan> In reply to @pmunch "Sizes can get even": how's the interop like with the platform libraries? do you have to build shims or can you just use the library by importing the header files in a specific way?
15:14:45*PMunch joined #nim
15:23:10FromDiscord<demotomohiro> In reply to @chronos.vitaqua "Hm I feel like": There are 2 ways to call functions in dll.↵One way is use dynlib module and load dll and functions at runtime.↵Another way is import functions like static lib.
15:23:35FromDiscord<Robyn [She/Her]> Yeah I was thinking about the static way
15:28:20FromDiscord<pmunch> In reply to @fakuivan "how's the interop like": You need to provide a signature for Nim to call the C code. It's pretty simple though, and can possibly be automated with Futhark. But you don't need to create shims or anything like that.
15:44:13*ntat joined #nim
15:47:57*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
15:51:54*SchweinDeBurg joined #nim
16:07:01*krux02 joined #nim
16:24:43*beholders_eye quit (Ping timeout: 268 seconds)
17:14:20*rockcavera quit (Remote host closed the connection)
17:16:36*rockcavera joined #nim
17:56:31*SebastianM joined #nim
18:07:08*lucasta joined #nim
18:09:44*beholders_eye joined #nim
18:28:21*beholders_eye quit (Ping timeout: 268 seconds)
18:46:19*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
18:47:49*adium left #nim (Leaving)
19:12:46*ntat quit (Quit: Leaving)
19:53:25NimEventerNew Nimble package! nimsutils - Common utils for Nimscript, see https://github.com/FyraLabs/nimsutils
20:18:04*beholders_eye joined #nim
20:44:32*PMunch quit (Quit: leaving)
20:59:16*beholders_eye quit (Ping timeout: 246 seconds)
21:09:19*m5zs7k quit (Ping timeout: 268 seconds)
21:10:02*beholders_eye joined #nim
21:15:27*m5zs7k joined #nim
21:25:57*rockcavera quit (Ping timeout: 268 seconds)
21:31:43*rockcavera joined #nim
22:11:11FromDiscord<Robyn [She/Her]> With `strscans`, how can I do an exact match until a certain character? Do I need a custom matcher for that? :/
22:13:07FromDiscord<Robyn [She/Her]> Oh wait
22:13:16FromDiscord<Robyn [She/Her]> Aaaaah the result is empty if the exact match is found
22:13:36FromDiscord<Robyn [She/Her]> It only returns what isn't known to the user
22:20:03FromDiscord<Robyn [She/Her]> Not sure how to represent something like `Struct[arg: type, arg, arg: type]:` with `strscans` and I'm getting frustrated
22:20:18FromDiscord<Robyn [She/Her]> Beef, you able to enlighten me? Since you talk about strscans so much
22:28:42*krux02_ joined #nim
22:29:45FromDiscord<Robyn [She/Her]> Aaah screw it
22:30:44FromDiscord<leorize> sometimes it might be faster to just write a scanner
22:30:58*krux02 quit (Ping timeout: 246 seconds)
22:34:39FromDiscord<Robyn [She/Her]> Yeah, that's what I'm gonna do now
23:25:56FromDiscord<Robyn [She/Her]> I wonder how hard it'd be to translate Nim's AST to Python's AST
23:29:23FromDiscord<leorize> not that easy
23:29:40FromDiscord<leorize> the main issue is that it's lossy because we have structures that does not exist in python
23:30:12FromDiscord<Elegantbeef> `type X = distinct Y` explodes Python's AST! 😄
23:30:31FromDiscord<leorize> heck it will explodes nim ast if you write it in a particular way
23:31:18FromDiscord<Robyn [She/Her]> In reply to @leorize "the main issue is": I'd say that's fine for a one way translation
23:31:28FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "`type X = distinct": Oh yeah Python doesn't have the concept of distinct
23:33:59FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=QxViwLgM
23:34:25FromDiscord<Robyn [She/Her]> In reply to @leorize "heck it will explodes": Oh god you're not wrong
23:34:34FromDiscord<Robyn [She/Her]> Why is Nim's AST fragile at times?
23:34:35FromDiscord<Elegantbeef> Just classes
23:34:35FromDiscord<Elegantbeef> It also does not have type sections
23:34:55FromDiscord<Elegantbeef> Why is the entire compiler fragile?
23:35:45FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "It also does not": You can do `'MyClass'` to reference a class, at least in type hints
23:36:13FromDiscord<Robyn [She/Her]> Duck typing should 'solve' most issues regarding that, anyway
23:36:18FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Why is the entire": Yeah, why?
23:36:40FromDiscord<Elegantbeef> Why have a testable spec when you can have a written manual
23:37:23FromDiscord<Robyn [She/Her]> Wait is the reason literally just not enough tests to cover all possible regressions and such?
23:37:39FromDiscord<Robyn [She/Her]> (edit) "all" => "as many"
23:45:26FromDiscord<Elegantbeef> Well a testable spec helps tremendously for finding bugs
23:46:48FromDiscord<Robyn [She/Her]> Oh well