00:29:36 | FromDiscord | <albassort> In reply to @chronos.vitaqua "Really? Weird": something to do with an outdated built i was building off the wrong version |
00:29:46 | FromDiscord | <albassort> took me an hour to figure out |
00:29:46 | FromDiscord | <albassort> lole |
00:29:58 | FromDiscord | <albassort> i think my development woes are over now though and i can finally work |
00:35:06 | FromDiscord | <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:48 | FromDiscord | <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:40 | NimEventer | New 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:54 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> tag all the GTK code with `GTK` then you can do `{.forbids: [GTK].}`! |
04:44:51 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/YkcfmLih |
04:45:52 | FromDiscord | <Phil> Ah, gtask isn't wrapped by owlkettle though.↵Yeah we likely should get around to that |
04:46:35 | FromDiscord | <Phil> Though I'd prefer a nim internal solution rather than a GTK solution for multithreading first |
04:52:40 | FromDiscord | <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:27 | FromDiscord | <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:38 | FromDiscord | <Phil> So you're only paying the price of change detection, not a full re-render |
05:07:57 | FromDiscord | <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:24 | FromDiscord | <hedy.cwd> sent a code paste, see https://play.nim-lang.org/#pasty=KdpbZzyr |
05:47:22 | FromDiscord | <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:28 | FromDiscord | <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:29 | FromDiscord | <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:59 | FromDiscord | <Phil> (edit) "separete" => "separate" |
07:19:34 | FromDiscord | <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:36 | FromDiscord | <abb3v> but im not sure how |
07:21:54 | FromDiscord | <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:18 | FromDiscord | <abb3v> a http server? |
07:22:24 | FromDiscord | <abb3v> I feel like that adds massive overhead |
07:22:35 | FromDiscord | <Phil> Ah sorry, DB makes me think of webdev which means http server etc. |
07:22:40 | FromDiscord | <abb3v> ohhh |
07:22:43 | * | wheatengineer quit (Ping timeout: 246 seconds) |
07:22:54 | FromDiscord | <abb3v> Hang on, would you like me to show you the project? |
07:23:12 | FromDiscord | <Phil> I don't have the mental capacity atm to do that in-depth level of thinking really |
07:23:33 | FromDiscord | <abb3v> Ah oof. |
07:23:40 | FromDiscord | <abb3v> The program isn't complex, its a simple db lol |
07:24:08 | FromDiscord | <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:53 | FromDiscord | <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:31 | FromDiscord | <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:37 | FromDiscord | <abb3v> This program isn't that complex though. |
07:27:08 | FromDiscord | <abb3v> sent a code paste, see https://play.nim-lang.org/#pasty=QvcKnKRi |
07:27:40 | FromDiscord | <abb3v> With `getPkgCount`, the program is at 0.020s to run. Without it, it's at 0.003. |
07:27:59 | FromDiscord | <abb3v> So program halts for package count, regardless of where it's called. |
07:28:08 | FromDiscord | <abb3v> So I need to run this elsewhere. |
07:28:21 | FromDiscord | <Phil> Ah, sqlite, yeah you'll not get away with async |
07:28:30 | FromDiscord | <abb3v> 😭 |
07:28:49 | FromDiscord | <abb3v> any way to move "getPkgCount" to another thread? |
07:29:02 | FromDiscord | <abb3v> Or is there another way to alternatively speed that up? |
07:29:16 | FromDiscord | <Phil> You could look into just using taskpool and combine that with System.Channel to phone back the result |
07:29:30 | FromDiscord | <Phil> If you don't want taskpool for a threadpool you can just use createThread yourself |
07:32:45 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/dkOLiVMe |
07:33:03 | FromDiscord | <Phil> (edit) "https://pasty.ee/GqzWpYAY" => "https://pasty.ee/YbIDiNzX" |
07:33:10 | FromDiscord | <abb3v> 👍 will try |
07:35:17 | FromDiscord | <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:50 | FromDiscord | <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:22 | FromDiscord | <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:45 | FromDiscord | <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:56 | FromDiscord | <demotomohiro> On linux and windows, Nim calls gcc to compile generated C code. |
13:48:01 | * | dv^_^ quit (Ping timeout: 255 seconds) |
13:49:12 | FromDiscord | <demotomohiro> Nim supports other C compilers, Clang, visual C++, tcc or etc. |
13:52:47 | FromDiscord | <fakuivan> Cool |
13:53:27 | FromDiscord | <fakuivan> Any idea of what the binary sizes look like? |
13:53:39 | FromDiscord | <fakuivan> For a hello world at least |
14:01:14 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=kLslLbeb |
14:07:34 | FromDiscord | <demotomohiro> It can be about 18kb when compiled with options to optimize size. |
14:24:15 | Amun-Ra | fakuivan: c99 compliant compiler is fine |
14:24:38 | Amun-Ra | C standard is one thing, POSIX one is anothe |
14:26:56 | FromDiscord | <fakuivan> In reply to @demotomohiro "It can be about": Oh that's pretty good |
14:27:43 | Amun-Ra | fe: if your implementation does not have mmap, use -d=usemalloc |
14:28:39 | FromDiscord | <fakuivan> Tried doing rust on openwrt, might as well install the python interpreter for how bloated rust binaries are |
14:28:50 | FromDiscord | <fakuivan> I might give nim a try for embedded stuff |
14:29:01 | Amun-Ra | rust is "special" |
14:29:54 | FromDiscord | <thedistantforest> sent a code paste, see https://play.nim-lang.org/#pasty=bfxKYaAQ |
14:30:58 | FromDiscord | <Robyn [She/Her]> Huh, what does Rust add to binaries? |
14:31:09 | FromDiscord | <Robyn [She/Her]> In reply to @fakuivan "Tried doing rust on": MicroPython is an option tbf lmao |
14:33:03 | Amun-Ra | and C++ |
14:35:45 | * | dv^_^ joined #nim |
14:42:30 | FromDiscord | <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:37 | FromDiscord | <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:40 | FromDiscord | <pmunch> It always go to C, at least by default. |
14:47:01 | FromDiscord | <ambient3332> rust binary size is both a blessing and a curse, mostly a blessing |
14:47:13 | FromDiscord | <ambient3332> no need for DLL hell |
14:47:26 | FromDiscord | <zumi.dxy> for llvm IR there is an unofficial project: https://github.com/arnetheduck/nlvm |
14:48:04 | FromDiscord | <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:35 | FromDiscord | <thedistantforest> sent a code paste, see https://play.nim-lang.org/#pasty=HzQrjuoV |
15:01:40 | FromDiscord | <Robyn [She/Her]> Hm I feel like there's another way, but I can't remember it |
15:02:07 | FromDiscord | <Robyn [She/Her]> Was it using import C and passing `-ldwmapi` to the linker or something? |
15:03:54 | FromDiscord | <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:10 | FromDiscord | <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:35 | FromDiscord | <Robyn [She/Her]> Yeah I was thinking about the static way |
15:28:20 | FromDiscord | <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:25 | NimEventer | New 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:11 | FromDiscord | <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:07 | FromDiscord | <Robyn [She/Her]> Oh wait |
22:13:16 | FromDiscord | <Robyn [She/Her]> Aaaaah the result is empty if the exact match is found |
22:13:36 | FromDiscord | <Robyn [She/Her]> It only returns what isn't known to the user |
22:20:03 | FromDiscord | <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:18 | FromDiscord | <Robyn [She/Her]> Beef, you able to enlighten me? Since you talk about strscans so much |
22:28:42 | * | krux02_ joined #nim |
22:29:45 | FromDiscord | <Robyn [She/Her]> Aaah screw it |
22:30:44 | FromDiscord | <leorize> sometimes it might be faster to just write a scanner |
22:30:58 | * | krux02 quit (Ping timeout: 246 seconds) |
22:34:39 | FromDiscord | <Robyn [She/Her]> Yeah, that's what I'm gonna do now |
23:25:56 | FromDiscord | <Robyn [She/Her]> I wonder how hard it'd be to translate Nim's AST to Python's AST |
23:29:23 | FromDiscord | <leorize> not that easy |
23:29:40 | FromDiscord | <leorize> the main issue is that it's lossy because we have structures that does not exist in python |
23:30:12 | FromDiscord | <Elegantbeef> `type X = distinct Y` explodes Python's AST! 😄 |
23:30:31 | FromDiscord | <leorize> heck it will explodes nim ast if you write it in a particular way |
23:31:18 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "the main issue is": I'd say that's fine for a one way translation |
23:31:28 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "`type X = distinct": Oh yeah Python doesn't have the concept of distinct |
23:33:59 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=QxViwLgM |
23:34:25 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "heck it will explodes": Oh god you're not wrong |
23:34:34 | FromDiscord | <Robyn [She/Her]> Why is Nim's AST fragile at times? |
23:34:35 | FromDiscord | <Elegantbeef> Just classes |
23:34:35 | FromDiscord | <Elegantbeef> It also does not have type sections |
23:34:55 | FromDiscord | <Elegantbeef> Why is the entire compiler fragile? |
23:35:45 | FromDiscord | <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:13 | FromDiscord | <Robyn [She/Her]> Duck typing should 'solve' most issues regarding that, anyway |
23:36:18 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Why is the entire": Yeah, why? |
23:36:40 | FromDiscord | <Elegantbeef> Why have a testable spec when you can have a written manual |
23:37:23 | FromDiscord | <Robyn [She/Her]> Wait is the reason literally just not enough tests to cover all possible regressions and such? |
23:37:39 | FromDiscord | <Robyn [She/Her]> (edit) "all" => "as many" |
23:45:26 | FromDiscord | <Elegantbeef> Well a testable spec helps tremendously for finding bugs |
23:46:48 | FromDiscord | <Robyn [She/Her]> Oh well |