<< 13-05-2025 >>

01:24:54FromDiscord<heysokam> In reply to @devlop_gaming "Are there any working": nimgl/imgui are the only ones that I know. crazy outdated and abandoned, but no idea if they work↵someone used them not long ago, so they might 🤷‍♂️↵another option could be to use `futhark` to create a wrapper for `cimgui`
01:26:04FromDiscord<heysokam> futhark doesn't work for .cpp, so it cannot create bindings for dear directly. it needs a C api
01:28:17*beholders_eye quit (Quit: WeeChat 4.5.1)
01:43:03*disso-peach joined #nim
01:43:11*disso-peach quit (Client Quit)
01:49:05*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
02:00:04FromDiscord<devlop_gaming> In reply to @heysokam "nimgl/imgui are the only": nimgui doesn't work. It have a indentation error.
02:01:24FromDiscord<devlop_gaming> Does nimgl is for opengl pretty sure
02:01:32FromDiscord<devlop_gaming> (edit) removed "Does"
02:04:33FromDiscord<heysokam> good to know. its abandonware, so it survived long enough without updates
02:12:01FromDiscord<devlop_gaming> I found something but it says imgui isn't in package list when I try to add it into my nimble file
02:18:11FromDiscord<devlop_gaming> Wait ik what I can try
02:38:51FromDiscord<devlop_gaming> In reply to @heysokam "good to know. its": How do I get cingui.dll?
02:48:08FromDiscord<heysokam> no idea. maybe someone who uses dear will know 🤷‍♂️
02:49:08FromDiscord<heysokam> I assume you have to compile cimgui, as someone said before, and copy/manage that with your buildsystem
02:49:37FromDiscord<devlop_gaming> Ok
03:01:24*rockcavera quit (Remote host closed the connection)
03:19:25FromDiscord<devlop_gaming> Yea i can't find anything about this issue
03:34:03*alexdaguy joined #nim
03:39:25*alexdaguy quit (Quit: WeeChat 4.6.3)
03:44:23FromDiscord<m4ul3r> In reply to @devlop_gaming "How do I get": There should be a guide on how to compile it - I had to compiled the specific version and had no issues
03:51:11FromDiscord<devlop_gaming> In reply to @m4ul3r "There should be a": Can you show me how to do it?
04:03:15FromDiscord<m4ul3r> In reply to @devlop_gaming "Can you show me": I don’t remember. I did it back in like November and have been using the same DLL 💀
04:03:50FromDiscord<m4ul3r> IIRC, It was as simple as downloading a specific tag of cimgui that matched the version mentioned for the nim code and compiling that
04:10:41FromDiscord<devlop_gaming> But it's asking for a dll so I have to build it
04:17:24FromDiscord<heysokam> cimgui docs should provide info on how its built. would be really suprised if they didn't, given how popular dear is
04:18:04FromDiscord<devlop_gaming> I was looking for that but didn't find it
04:22:02FromDiscord<heysokam> In reply to @devlop_gaming "I was looking for": https://github.com/cimgui/cimgui?tab=readme-ov-file#compilation↵oh, the usual "I have instructions, what do you mean!!" but the instructions are garb if you don't already know how it works 🤷‍♂️
04:41:04*ntat joined #nim
05:44:11FromDiscord<devlop_gaming> What should I do if nim can't open one of my libraries even tho it exists
05:44:15*SchweinDeBurg joined #nim
05:50:20Amun-Rayou should try to find the cause of that
05:50:53FromDiscord<devlop_gaming> It's impossible I don't know a thing about the package manager
05:51:06Amun-Rapackage manager?
05:51:16FromDiscord<devlop_gaming> In reply to @Amun-Ra "you should try to": Can you please just tell me? I already tried everything i could try.
05:51:18Amun-Rawhat system are you on?
05:51:27FromDiscord<devlop_gaming> Windows
05:51:28Amun-Rawindows, am I right?
05:51:58FromDiscord<devlop_gaming> For some reason nim is looking for an old version of cimgui instead of the new installation I installed
05:52:03Amun-Rathere's procmon from sysinternals that you can use to trace your program calls
05:52:36Amun-Raset the filter to monitoring your app only and check for the errors; I bet some paths are not right
05:52:44Amun-Rahttps://learn.microsoft.com/en-us/sysinternals/downloads/procmon
05:52:45FromDiscord<devlop_gaming> How would that work if my program can't run
05:53:00FromDiscord<devlop_gaming> This is too much can you just tell me the problem?
05:53:24Amun-RaI can't for I don't posess a glass ball
05:53:28Amun-Rabut procmon can
05:53:46FromDiscord<devlop_gaming> I don't have time for that
05:53:55Amun-RaI see
05:55:23FromDiscord<devlop_gaming> This language got frustrating quickly
05:55:37Amun-RaIt's a skill issue, not a language one
05:55:58Amun-Raor, like we used to call it back in the days: PEBKAC
05:55:59FromDiscord<devlop_gaming> No it's not i literally never had this issue before
05:57:44FromDiscord<lainlaylie> nim basically assumes that you understand the systems you are using
05:59:28FromDiscord<devlop_gaming> Why does it keep trying to open the old version of the library anyway?? I tried removing the pjgs2, I tried removing the old version myself, I refreshed the pa page lists.
06:02:35FromDiscord<lainlaylie> when you say "open" the library do you mean `import`?
06:03:44FromDiscord<devlop_gaming> When it import a library it has to be able to open the file..
06:03:59FromDiscord<lainlaylie> is that yes or no?
06:04:48FromDiscord<devlop_gaming> No ig
06:05:18FromDiscord<lainlaylie> explain what you mean by open the library then
06:05:41FromDiscord<lainlaylie> it's difficult for anyone to help if nobody actually knows what you're having trouble with
06:05:54FromDiscord<devlop_gaming> I told you already
06:05:59FromDiscord<lainlaylie> good luck
06:07:23FromDiscord<devlop_gaming> I fucking quit. I should have used something else😑
06:10:43Amun-Ratwo months later in the land of something else […]
07:03:57FromDiscord<kcvinker5420> How do you allocate memory for an `UncheckedArray` and how do you free it ?
07:12:15FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#pasty=ltZjuURA
07:12:23FromDiscord<kcvinker5420> (edit) "https://play.nim-lang.org/#pasty=hwPMUGWc" => "https://play.nim-lang.org/#pasty=ZjEVJWey"
07:23:40Amun-Rais this your custom object?
07:25:45FromDiscord<kcvinker5420> In reply to @Amun-Ra "is this your custom": Yes
07:25:50Amun-Rayou can allocate the memory with alloc, alloc0, create etc. and free it with dealloc
07:26:26Amun-Rathere's already WideCString in stdlib, https://nim-lang.org/docs/widestrs.html
07:30:59FromDiscord<kcvinker5420> In reply to @Amun-Ra "there's already WideCString in": Ah, great! I got some nice code samples to work with `UncheckedArray`. Thank you 🙂
07:32:34Amun-Rano worries :)
07:55:35*alexdaguy joined #nim
08:12:33*bcksl quit (Ping timeout: 248 seconds)
08:13:46*end quit (Ping timeout: 244 seconds)
08:15:26*beholders_eye joined #nim
08:29:22*beholders_eye quit (Ping timeout: 272 seconds)
08:34:19*bcksl joined #nim
08:37:14*nils` quit (Ping timeout: 252 seconds)
08:41:22*end joined #nim
08:47:26FromDiscord<microwave3607> where can I find examples for nim?
08:47:40FromDiscord<microwave3607> I'm bashing my head against the wall, can't write anything
08:48:16FromDiscord<olfactoryhallucinations> What type of examples are you looking for?
08:49:58FromDiscord<nnsee> In reply to @microwave3607 "where can I find": https://nimbyexample.com/
08:50:14FromDiscord<olfactoryhallucinations> For very basic examples you have for instance https://nim-by-example.github.io/
08:51:28FromDiscord<janakali> @microwave3607↵https://rosettacode.org/wiki/Category:Nim↵https://github.com/search?q=lang%3Anim&type=code
09:03:00FromDiscord<microwave3607> thanks
09:03:08FromDiscord<microwave3607> so, if I understood right
09:03:17FromDiscord<microwave3607> `ref` isn't like `&` in c++
09:03:26FromDiscord<microwave3607> refs are objects traced by the GC
09:03:37FromDiscord<microwave3607> that I allocate with `new`
09:03:44FromDiscord<microwave3607> did I get it right?
09:03:51FromDiscord<lainlaylie> yes
09:04:21FromDiscord<microwave3607> In reply to @lainlaylie "yes": I don't seem to understand
09:04:47FromDiscord<demotomohiro> `ref` is similar to `std:shared_ptr` in c++.
09:04:47FromDiscord<lainlaylie> ...a shame you seemed an honest man?
09:04:58FromDiscord<0xfab_10> refs are like objects in java
09:04:58FromDiscord<microwave3607> In reply to @lainlaylie "...a shame you seemed": and the things I hold so dear
09:05:01FromDiscord<0xfab_10> or python
09:05:13FromDiscord<microwave3607> In reply to @fabric.input_output "refs are like objects": it was just a lain joke
09:05:25FromDiscord<microwave3607> I got what refs are
09:05:40FromDiscord<microwave3607> but that's a good analogy
09:05:42FromDiscord<microwave3607> thanks
09:05:54FromDiscord<0xfab_10> idk lain
09:05:56FromDiscord<lainlaylie> T() where T is a ref object also allocates, i find it a little nicer than `new`
09:06:27FromDiscord<0xfab_10> typeof(T()[])(...)
09:07:43FromDiscord<0xfab_10> what if instead of `ref T` we had `ref[T, A = GlobalAllocator]`
09:11:11FromDiscord<nnsee> In reply to @microwave3607 "it was just a": more like a lame joke amirite
09:12:03FromDiscord<0xfab_10> gottem
09:15:00*ntat quit (Quit: leaving)
09:50:59FromDiscord<bsljth> Any resource that talks about how to structure a Nim project, specially on how to modularize Nim code?
09:57:39FromDiscord<microwave3607> I would love to read stuff about that too
10:55:03FromDiscord<heysokam> In reply to @microwave3607 "where can I find": I learned with this. best tut for nim↵https://narimiran.github.io/nim-basics/↵the official tutorial is a good side read to this (or read after), but its more sparse
11:07:05*beholders_eye joined #nim
11:45:30*nils` joined #nim
11:51:45FromDiscord<entropydev> Is anyone familiar with libp2p?
12:30:32*ntat joined #nim
12:41:17FromDiscord<kcvinker5420> In reply to @bsljth "Any resource that talks": In my experience, `include` works great. It helps us to make our source code as a single file in front of compiler but practically, we can use multiple files for our convenience.
12:46:03*beholders_eye quit (Ping timeout: 244 seconds)
12:48:08FromDiscord<jseb> now in holidays again, lets continue nim … with the sets (that's what is called « learn bit per bit »)
12:48:34FromDiscord<jseb> (edit) "now in holidays again, lets continue nim … with the sets (that's what is called « learn bit per bit »)" => "sent a code paste, see https://play.nim-lang.org/#pasty=AHPJmoui"
12:48:50FromDiscord<jseb> (edit) "https://play.nim-lang.org/#pasty=PiqEyBST" => "https://play.nim-lang.org/#pasty=UELDSSwX"
12:50:48FromDiscord<jseb> if i `repr(boussole)`, i get an empty dictionnary
12:51:43FromDiscord<Laylie> sets are for testing membership. so you can do `boussole.incl n` and ask if `n in boussole`, for example
12:52:08FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#pasty=GmoxCwZk
12:53:05FromDiscord<jseb> yes there is a null char at the end, not counted
12:53:56FromDiscord<kcvinker5420> In reply to @jseb "yes there is a": Great, thank you 🙂
12:54:11FromDiscord<jseb> In reply to @Laylie "sets are for testing": thank you. I had seen that before, i think i can a value with ord
12:54:58FromDiscord<jseb> (edit) "ord" => "ord↵edit: no i cannot"
12:55:08FromDiscord<jseb> (edit) "In reply to @Laylie "sets are for testing": thank you. I had seen that before, i think i can ... a" added "get"
12:55:19*beholders_eye joined #nim
12:55:22FromDiscord<Laylie> documented here\: https://nim-lang.org/docs/manual.html#types-string-type
12:55:50FromDiscord<Laylie> what value do you want to get?↵(@jseb)
12:56:27FromDiscord<jseb> i thought boussole.n would be the enum value (n)
12:57:34FromDiscord<griffith1deadly> In reply to @fabric.input_output "what if instead of": we will be zig then
12:58:22FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#pasty=dXgBgaSY
12:58:24FromDiscord<jseb> (edit) "https://play.nim-lang.org/#pasty=NeLEmdHH" => "https://play.nim-lang.org/#pasty=xafQuJzz"
13:05:46FromDiscord<Laylie> a set is like a HashSet that's optimized for small types (such as an enum) where membership of the nth possible value is encoded by the value of the nth bit. in that sense the set itself has a value that you can get by casting it to an int. but I'm not sure what the purpose of `boussole.n` would be.
13:14:28FromDiscord<jseb> as it's encoded on bits, then directions.n == (directions.n or directions.e) should returns true.↵i think i will stick with classical enum n=1,e=2,s=4,o=8 (it's for checking walls in a maze)
13:16:05FromDiscord<Laylie> would that be something like `n in {n, e}`? have you checked the table here of set operations? https://nim-lang.org/docs/manual.html#types-set-type
13:17:01FromDiscord<jseb> ah thank you, i was lost in here : https://nim-lang.org/docs/manual.html#set-type-bit-fields (found with index of documentation)
13:43:18FromDiscord<gyatsoyt> Is there a channel here where we can post about our nim projects and ask for contribution?
13:43:47FromDiscord<0xfab_10> In reply to @griffith1deadly "we will be zig": more like C++ https://en.cppreference.com/w/cpp/memory/shared_ptr/allocate_shared
14:40:09FromDiscord<kcvinker5420> Does `=destroy` is guaranteed for every objects we use ?
14:41:01FromDiscord<kcvinker5420> I mean if we have a `=destroy` proc, is it guaranteed that it will run when the objects destroyed ?
14:42:00FromDiscord<kcvinker5420> Why I am asking because, I have 6 instances of an object and I had only one instance called `=destroy`
15:04:45FromDiscord<TFed> can i ask some questions? for my first project better to use sqllite or mysql?
15:04:46FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=UEVDNXOJ
15:07:28*xutaxkamay quit (Ping timeout: 276 seconds)
15:09:12FromDiscord<TFed> and second here in example of how to open mySQL db it says password, Will it encrypt my db? So mysql is more secure then...🤔
15:09:28FromDiscord<TFed> actually my db is for publicly available meta-information about how use different forges
15:09:31FromDiscord<TFed> actually my db is for publicly available meta-information about how to use different forges
15:09:37FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1371866879064412200): and second question is about the example of "how to open mySQL db", and i see a password there..., Will it encrypt my db? So mySQL is more secure then...🤔
15:09:58FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1371866943983845539): actually my db is for publicly available meta-information. I need that to simply know how to work with different forges
15:10:00FromDiscord<0xfab_10> mysql requires a password because you communicate it through the network
15:10:17FromDiscord<0xfab_10> sqlite is just a bunch of functions that you run in your program
15:10:23FromDiscord<0xfab_10> so you don't need password for that
15:10:36FromDiscord<0xfab_10> (edit) "mysql requires a password because you communicate ... it" added "with"
15:13:37FromDiscord<TFed> i will use sqlite then
15:13:49FromDiscord<TFed> thank you for info🙂
15:48:37*alexdaguy quit (Quit: a)
16:41:23*PMunch joined #nim
16:42:53*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
16:54:26*ntat_ joined #nim
17:07:25FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#pasty=sjgQdzVV
17:07:51FromDiscord<jseb> (edit) "https://play.nim-lang.org/#pasty=qvoIdxlR" => "https://play.nim-lang.org/#pasty=WudTEfOk"
17:13:18FromDiscord<griffith1deadly> In reply to @jseb "still struggling with simple": you declared your var `maze` as `seq` but use for initialization a `set`
17:13:36FromDiscord<griffith1deadly> `{}` will produce `set`
17:14:01FromDiscord<griffith1deadly> `@[]` will produce `seq`, `[]` will produce `array`
17:14:22FromDiscord<jseb> ah yes, i remember the @[] … thank you for the reminder !
17:14:43FromDiscord<jseb> i understand all i read, and forget all when i write :(
17:15:17FromDiscord<jseb> and i believe {} is used for dictionnaries too (and () for tuple)
17:43:06*ntat_ quit (Quit: leaving)
17:47:09FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#pasty=quzozmnW
17:47:43FromDiscord<nervecenter> `var maze: seq[Compass]
17:47:46FromDiscord<nervecenter> (edit) "seq[Compass]" => "seq[Compass]`"
17:48:06FromDiscord<jseb> yes, but i cannot do or'ing this way
17:48:36FromDiscord<nervecenter> true
17:48:40FromDiscord<jseb> and i will have to define all combination in the enum (n, no,ne,ns …)
17:49:33FromDiscord<jseb> too bad leaving C for writing C at the end, but that's life
17:51:36FromDiscord<nervecenter> In reply to @jseb "too bad leaving C": `if (maze[0] and ord(n)) != 0:` is a VERY C thing to do, `or`ing bit fields is not typical in Nim at all given better methods
17:52:13FromDiscord<nervecenter> An enum might just be good for internal representation
17:53:28FromDiscord<nervecenter> I'm whipping up an alternate
17:55:28FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=uOjZslRZ
17:55:54FromDiscord<nervecenter> Each mazo location could also be a 4-tuple for better efficiency
17:56:06FromDiscord<nervecenter> (edit) "mazo" => "maze" | "efficiency" => "efficiency, but testing would work differently"
17:59:32FromDiscord<nervecenter> Trying to rework your bit field version
18:06:37FromDiscord<TFed> i still cant compile the `db_connector/db_sqlite` library... probably because i cant reach to libsqlite.so shared object
18:06:48FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=IypYHvSE
18:07:27FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=xaJbBmOk
18:08:22FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=SxyXKBIM
18:08:49*PMunch quit (Quit: leaving)
18:08:50FromDiscord<TFed> sent a long message, see https://pasty.ee/wficDuQk
18:08:57FromDiscord<nervecenter> Probably could keep it slimmer by doing everything in `uint8`
18:09:20FromDiscord<nervecenter> (edit) "https://play.nim-lang.org/#pasty=FjLbZDTo" => "https://play.nim-lang.org/#pasty=dbBMHkcI"
18:19:44FromDiscord<TFed> or can i link that myself🙂
18:34:57*redj quit (Ping timeout: 248 seconds)
18:54:00FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#pasty=HgIRVVDt
18:54:58FromDiscord<jseb> Why a.uint8 and not ord(a) ?
18:55:15FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=jXcPdiaD
18:55:25FromDiscord<TFed> i found this
18:58:43*skippy8 joined #nim
18:59:40FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=fYdtLnvD
19:34:43FromDiscord<nervecenter> In reply to @jseb "Why a.uint8 and not": `ord` only accepts a few built-in types unless you want to define an `ord` proc on `Compass` and `Position`. I just chose to turn them into `uint8` because it's built-in and simple.
19:34:48FromDiscord<nervecenter> (edit) "In reply to @jseb "Why a.uint8 and not": ... `ord`" added "The system"
19:35:21FromDiscord<nervecenter> (edit) "In reply to @jseb "Why a.uint8 and not": The system `ord` only accepts a few built-in types unless you want to define an `ord` proc on `Compass` and `Position`. I just chose to turn them into `uint8` because it's built-in and simple. ... " added "Functionally the same, and the compiler might inline the `ord` calls anyways"
19:37:16FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=cdRKBhmv
19:37:33FromDiscord<nervecenter> Just to make absolutely sure they're not system `int`s
19:39:31FromDiscord<nervecenter> Also I think `is_open` is probably a better name for the boolean checking proc
19:40:23FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1371923807383589025): i found this, no it's not working... library is broken...
19:41:05*ntat quit (Quit: leaving)
19:45:27FromDiscord<leorize> why do this and not using the built-in `set[T]`? It'd generate a bitmap automatically with the correct size↵(@nervecenter)
19:45:32FromDiscord<heysokam> In reply to @nervecenter "In fact if you're": are those bitflags?↵if yes, enum sets solve bitflags in a more ergonomic way, and are fully compatible with C
19:46:15FromDiscord<leorize> do note that compatibility with C is "accidental", aka. an internal implementation detail
19:46:41FromDiscord<leorize> the exact bit ordering is never documented nor tested
19:47:08FromDiscord<heysokam> is there any other way to represent enum sets in C other than enums and bitops?
19:48:25FromDiscord<leorize> if you're happy with how it works now, just submit a documentation update + some tests to make sure the repr stays the way it is
19:48:34FromDiscord<leorize> but no, there's nothing built-in to handle these
19:49:34*ntat joined #nim
19:50:32FromDiscord<TFed> i can just make a wrap around sqlite3 shell command🤔
19:50:42FromDiscord<TFed> i can just make a wrapper around sqlite3 shell command🤔
19:52:17FromDiscord<nervecenter> Never used bitsets before so they slipped my mind
19:52:31FromDiscord<nervecenter> Most of my work code is working at a much higher level
19:53:08FromDiscord<0xfab_10> In reply to @leorize "the exact bit ordering": in js codegen bitsets are objects with the key being the bit offset and the value being `true`
19:53:19FromDiscord<0xfab_10> last time I checked at least
20:09:58*ntat quit (Quit: leaving)
20:19:30FromDiscord<leorize> weird, i'm pretty sure JS has accurate representation of uint32 that can be used for bitsets
20:20:04*ntat joined #nim
20:25:21*beholders_eye quit (Ping timeout: 248 seconds)
20:39:06FromDiscord<Robyn [She/Her]> In reply to @jseb "it seems extremely complicated": Why not just use a seq set
20:39:14FromDiscord<Robyn [She/Her]> `seq[set[Compass]]`
20:53:09*ntat quit (Quit: leaving)
21:23:59*rockcavera joined #nim
21:27:51FromDiscord<tauruuuuuus> can someone ELI5 gotos vs setjmp in nim exceptions?
21:41:12FromDiscord<Elegantbeef> @tauruuuuuus goto uses gotos for the error handling instead of setjmp. When the code errors both go to the error handlers, the only difference afaik is the mechanism to get there
21:42:27FromDiscord<leorize> gotos basically set error global state, then return
21:43:38FromDiscord<leorize> it depends on the caller to know that there's an exception and to handle it
21:44:37FromDiscord<leorize> setjmp on the other hand "saves" the restore point (aka. where a handler exists), then jump straight from `raise` to the restore point, unwinding the stack in the progress
22:14:22*beholders_eye joined #nim
23:06:35*beholders_eye quit (Ping timeout: 252 seconds)