<< 12-05-2024 >>

00:13:47*beholders_eye quit (Read error: Connection reset by peer)
00:19:49*beholders_eye joined #nim
00:25:07*fallback quit (Quit: IRCNow and Forever!)
00:36:02FromDiscord<eightbit_dboy> Hmm... https://media.discordapp.net/attachments/371759389889003532/1239013176054382602/rn_image_picker_lib_temp_b4539f26-eb4f-4786-93b5-4d6eee012ea4.jpg?ex=66416070&is=66400ef0&hm=24ac7eef513125d688e122d6d5886e2a001b9c7de79d9f81384ce7206d644c64&
00:37:43*fallback joined #nim
00:38:14FromDiscord<Robyn [She/Her]> Have you `chmod +x` it?
00:39:46FromDiscord<eightbit_dboy> I'll try that in a bit.
00:40:00FromDiscord<eightbit_dboy> The xfce session is root, however.
00:40:44FromDiscord<Robyn [She/Her]> `+x` is to mark it as executable, doesn't matter who owns it
00:40:56FromDiscord<Robyn [She/Her]> (edit) "`+x`" => "`chmod +x`"
00:41:34FromDiscord<eightbit_dboy> I'll try that.
01:00:02*nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in)
01:02:29*nazgulsenpai joined #nim
01:10:32*cnx quit (Remote host closed the connection)
01:12:48*cnx joined #nim
01:39:44*gst quit (Ping timeout: 250 seconds)
01:41:51*beholders_eye quit (Ping timeout: 268 seconds)
02:14:01*fallback quit (Read error: Connection reset by peer)
02:46:33*fallback joined #nim
03:16:53*def- quit (Quit: -)
03:32:38FromDiscord<Robyn [She/Her]> In reply to @eightbit_dboy "I'll try that.": Did it work?
03:32:44FromDiscord<Robyn [She/Her]> Just curious aha
03:37:37*lucasta quit (Quit: Leaving)
03:43:03*krux02_ quit (Remote host closed the connection)
03:54:27*def- joined #nim
03:59:04*def- quit (Client Quit)
04:00:29*def- joined #nim
04:02:25*SchweinDeBurg quit (Read error: Connection reset by peer)
04:06:37*SchweinDeBurg joined #nim
04:08:48*SchweinDeBurg quit (Max SendQ exceeded)
04:08:54*def- quit (Quit: -)
04:09:31*def- joined #nim
04:13:46*SchweinDeBurg joined #nim
04:15:34*SchweinDeBurg quit (Max SendQ exceeded)
04:16:47*def- quit (Quit: -)
04:17:07*def- joined #nim
04:23:07*xet7 joined #nim
04:30:22FromDiscord<eightbit_dboy> In reply to @chronos.vitaqua "Did it work?": Been busy, will do it in a bit. Watching Smiling Friends with my fiance.
04:31:58*SchweinDeBurg joined #nim
04:33:28*SchweinDeBurg quit (Max SendQ exceeded)
04:38:17*SchweinDeBurg joined #nim
04:39:41*SchweinDeBurg quit (Max SendQ exceeded)
05:07:10*SchweinDeBurg joined #nim
05:08:32*SchweinDeBurg quit (Max SendQ exceeded)
05:14:01*SchweinDeBurg joined #nim
05:16:21*xet7 quit (Ping timeout: 255 seconds)
05:19:46*SchweinDeBurg quit (Remote host closed the connection)
05:20:09*SchweinDeBurg joined #nim
05:24:19*SchweinDeBurg quit (Max SendQ exceeded)
05:37:59*xet7 joined #nim
05:42:29*ntat joined #nim
05:42:31*jkl quit (Quit: Gone.)
05:43:03*SchweinDeBurg joined #nim
05:45:06*jkl joined #nim
05:49:21FromDiscord<eightbit_dboy> In reply to @chronos.vitaqua "Did it work?": Still says not found
05:51:14FromDiscord<eightbit_dboy> https://media.discordapp.net/attachments/371759389889003532/1239092499985989646/rn_image_picker_lib_temp_b1676d13-8bc7-4c40-ae5d-30d4d04a375b.jpg?ex=6641aa51&is=664058d1&hm=01d92020d827c99e441cf6b852610e19dc99f61b18852f58c9d844ee73dbe0b8&
05:59:56*xet7 quit (Remote host closed the connection)
06:05:22FromDiscord<eightbit_dboy> https://media.discordapp.net/attachments/371759389889003532/1239096058206883860/image.png?ex=6641ada1&is=66405c21&hm=4f1efa356144fc71e4fa18d376e9e6a9649adaf625eb4bffc85ae606509a63b1&
06:25:37FromDiscord<Phil> Wait, I hear gcc problems?
06:26:00FromDiscord<Phil> Is it the latest gcc version 14.1?
06:38:11FromDiscord<linuxarch> When I try to import a c function from nim it says: could not import: hash_password
06:38:28FromDiscord<linuxarch> sent a code paste, see https://play.nim-lang.org/#pasty=RyHxueeN
06:38:36FromDiscord<linuxarch> (edit) "https://play.nim-lang.org/#pasty=PmYXeGnZ" => "https://play.nim-lang.org/#pasty=CGHHQaPS"
06:38:59FromDiscord<linuxarch> sent a code paste, see https://play.nim-lang.org/#pasty=LBvCoKGG
06:39:47FromDiscord<Elegantbeef> You need a `header` pragma or to `--passL:"-lyourLib"`
06:40:08FromDiscord<linuxarch> ohh
06:40:29FromDiscord<linuxarch> imma look into the header pragma, thank you!
06:41:36FromDiscord<Phil> ... hmmm something is hotspinning, I just don't see what
06:47:28FromDiscord<Elegantbeef> Hotspinning is fairly evident as the metal is generally molten
06:48:13FromDiscord<Phil> My issue is I don't see which while loop would cause it. All the loops from me have an echo in them and given I don't see anything printing in the terminal I can only assume that somebody elses loop is hotspinning
06:48:57FromDiscord<Phil> To get a decent flamegraph just using --debugger:native and -d:useMalloc should be all that's needed right?
06:49:06FromDiscord<Elegantbeef> Yea
06:49:20FromDiscord<Elegantbeef> I for one use hotspot for my flamegraphs
06:50:11FromDiscord<Phil> Could you link? Googling throws irrelevant search results at me
06:50:19FromDiscord<Phil> Wait, is it the kdab thing?
06:50:35FromDiscord<Elegantbeef> Yep
06:50:37FromDiscord<Elegantbeef> It uses perf
06:50:55FromDiscord<Elegantbeef> Though valgrind has callgrind which generates a nice callgraph
06:52:14FromDiscord<Phil> Does that output a file somewhere or does it print to the terminal
06:52:19FromDiscord<Phil> Because if it prints to the terminal I'm confused
06:52:21FromDiscord<Elegantbeef> Which?
06:52:37FromDiscord<Elegantbeef> callgrind outputs a file you then can open in kcachegrind
06:52:40FromDiscord<Phil> Ah, callgrind.out, I see it
06:54:30FromDiscord<Phil> Errr.... does callgrind require a GUI?
06:54:39FromDiscord<Phil> I'm mostly waiting while hotspot compiles
06:55:22FromDiscord<Elegantbeef> I've only ever used callgrind with kcachegrind
06:58:02FromDiscord<Phil> ... is there a way to make that more readable as in "This proc took up so and so much time, this other proc took up so and os much time"?↵I am struggling with interpreting this because I see a million symbols I've never seen before (_dl_start, dl_main etc.)
06:59:24FromDiscord<Phil> But.... but... I compiled with --debugger:native ! https://media.discordapp.net/attachments/371759389889003532/1239109652256657448/image.png?ex=6641ba4a&is=664068ca&hm=d05913d5e5d6b499892181222a1765a822401f40c1212e6b94f53f7376dfde67&
07:00:25FromDiscord<Elegantbeef> Look at bottom up and sort by cycles
07:01:32FromDiscord<Phil> Oh I'm an idiot, wrong binary >-<
07:01:44FromDiscord<Elegantbeef> No comment
07:09:40FromDiscord<Phil> While I couldn't figure out bottom-up, it did lead me to taskpools syncall being the issue
07:09:48FromDiscord<Phil> Now I'm compiling with their debugflag and lets see whats going on
07:10:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=YBlMWwQP
07:11:26FromDiscord<Phil> And that appears to be the case given this callgrind from letting this run for exactly 3s and exit after https://media.discordapp.net/attachments/371759389889003532/1239112685183041626/image.png?ex=6641bd1d&is=66406b9d&hm=0428ffc7bc2458782517ce0f6b971b570f78b528e01be7c656db5d0a8bb5ea2c&
07:17:39FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=iHzrIAXz
07:21:21FromDiscord<Phil> I'm struggling with making a simplified example because the simplest one I can make doesn't trigger this behavior so I'm struggling to isolate the exact problem.↵To help narrow it down it would help to understand what exactly this is trying to do here to see what is causing this
07:26:08FromDiscord<Elegantbeef> Also phil are you calling a spinlock a "hotspin"?
07:26:14FromDiscord<Phil> This is specifically only a problem if `longRunningTaskCount < workerThreadCount`.↵If I increase the number of tasks with such loops to 2, the problem disappears (but obviously now I can't get any additional work done)
07:26:29FromDiscord<Phil> In reply to @Elegantbeef "Also phil are you": ... a what now?
07:26:46FromDiscord<Elegantbeef> > a spinlock is a lock that causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking whether the lock is available.
07:26:52FromDiscord<Phil> I know hotspin as essentially code that puts the Thread at 100% for no reason, like `while true: discard`
07:27:36FromDiscord<Elegantbeef> I've never heard of that term before, I get what it meant, but yea
07:27:39FromDiscord<Phil> I don't know if this is a lock-related problem or not, I don't see any obvious lock-contention
07:28:42FromDiscord<Phil> Huh, I know it from my Bioinformatics prof from like ... shit I'm old, 8 years ago at this point
07:29:30FromDiscord<Phil> But google doesn't know it either. Is there a term for code that essentially 100%s the CPU while doing no work? Is it called spinlock even if the code causing the CPU to 100% isn't necessarily lock-related?
07:30:56FromDiscord<Phil> Also, are you assuming a spinlock because of ThreadSignalPtr? I don't think it does that, because you can block on ThreadSignalPtr forever without it 100%ing the CPU
07:31:22FromDiscord<Elegantbeef> Think that's just a spinloop
07:31:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=pIoADkOK
07:31:32FromDiscord<polylokh_39446> busy wait's the other name.
07:32:04FromDiscord<Phil> I'll use spinloop then going forward if that's the more broadly used term
07:33:44FromDiscord<Elegantbeef> Hey a spinloop running is the OS's fault! It should solve the halting problem
07:47:22NimEventerNew thread by Isofruit: How to catch exceptions in Chronos raised by asyncCheck'd Futures?, see https://forum.nim-lang.org/t/11589
08:08:28*def- quit (Quit: -)
08:28:16*def- joined #nim
08:56:33*def- quit (Quit: -)
08:56:54*def- joined #nim
08:59:58FromDiscord<ruehc> there is something strange here the ``hashtag`` octal reprsentation of it is ``43`` why is it showing me the plus sign ??? and 35 is the decimal of it showing the hashtag what ??? https://media.discordapp.net/attachments/371759389889003532/1239139997202907199/423.png?ex=6641d68d&is=6640850d&hm=a5b833717354a4de0ad0275571d6c3cd81eaa384f4e530d0ac3e918c7fe2b48e&
09:01:20FromDiscord<Elegantbeef> Those are decimal values
09:04:01FromDiscord<ruehc> In reply to @Elegantbeef "Those are decimal values": i converted it to octal
09:04:08FromDiscord<ruehc> 43 is octal
09:04:17FromDiscord<Phil> 35 decimal is 23 hexadecimal is # in UTF8
09:04:19FromDiscord<odexine> \43 is interpreted as decimal in Nim
09:04:26FromDiscord<ruehc> 35 = 43 is in octal
09:05:06FromDiscord<odexine> \35 will show the character with decimal value 35
09:05:18*coldfeet joined #nim
09:07:22FromDiscord<ruehc> so what i understand is nim whenever i pass a decimal value it will be considered octal ?
09:11:57FromDiscord<Phil> sent a long message, see https://pasty.ee/DyMRhHGU
09:12:27FromDiscord<Elegantbeef> `0x1`
09:12:33FromDiscord<Phil> At least in echo. Then again, I tend to not really swap between bases
09:13:02FromDiscord<Elegantbeef> or `'\x43`
09:13:37FromDiscord<Elegantbeef> Actually that's hex
09:14:18FromDiscord<Phil> Can confirm, that converts to C
09:15:21FromDiscord<ruehc> \u{00000023}
09:15:25FromDiscord<ruehc> this is also hex
09:19:35FromDiscord<odexine> Nothing for octal in strings no
09:19:50FromDiscord<odexine> Hex or decimal only
09:20:05FromDiscord<ruehc> \u{} this works in strings
09:21:35FromDiscord<odexine> Not octal though
09:22:02FromDiscord<ruehc> this is more sufficient for memory representation
09:23:35FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=JOVzMbim
09:29:53FromDiscord<marioboi3112> anyone tried building aporia for linux https://media.discordapp.net/attachments/371759389889003532/1239147526410731550/image.png?ex=6641dd90&is=66408c10&hm=5c7cf9d7f60466ba1239e7e3138d8c52514da5ea0133a4bfc025d7d919425dba&
09:32:54FromDiscord<ruehc> In reply to @marioboi3112 "anyone tried building aporia": same issue for windows
09:33:12FromDiscord<marioboi3112> In reply to @ruehc "same issue for windows": so its their problem?
09:33:20FromDiscord<ruehc> In reply to @marioboi3112 "so its their problem?": yeah probably
09:33:33FromDiscord<marioboi3112> In reply to @ruehc "yeah probably": alright thanks
09:33:38FromDiscord<ruehc> u welcome
09:45:14FromDiscord<odexine> In reply to @ruehc "this is more sufficient": I was under the impression that you wanted specifically octal
09:45:30FromDiscord<odexine> mb
09:47:59FromDiscord<madonuko> is there not a `lsdir()` function in nim? can't find in `std/[os, paths, files]`
09:48:56FromDiscord<odexine> https://nim-lang.org/docs/dirs.html#walkDir.i%2CPath
09:49:28FromDiscord<madonuko> In reply to @odexine "https://nim-lang.org/docs/dirs.html#walkDir.i%2CPat": petition to add this in See Also https://media.discordapp.net/attachments/371759389889003532/1239152452272390195/9aeklzM.png?ex=6641e226&is=664090a6&hm=a0821e5fb541ccbb3573f4fc8a41744e44b73282f0abbcc0624c096b026276e5&
09:49:43FromDiscord<odexine> I swore it always was
09:49:57FromDiscord<madonuko> thanks
10:10:22FromDiscord<ruehc> what if i was using the \\" and i want to disable all the escapes in the string ? if r ``raw-string`` doesn't work what is the solution ? https://media.discordapp.net/attachments/371759389889003532/1239157713322115073/756.png?ex=6641e70d&is=6640958d&hm=177a0b001817038cdd2a3d275aa561c991b9f3df055c5cc3a52a01af97cc9311&
10:11:59FromDiscord<polylokh_39446> you want to disable all escapes but that one? There's no special option for that. Don't disable escapes, or append strings. Or, this is Nim with easy execution at compile-time, you can write it however you like and fix it up during the compile.
10:12:03*SchweinDeBurg quit (Ping timeout: 260 seconds)
10:13:43FromDiscord<polylokh_39446> You can also write that as `r"hello "" world"` instead
10:13:50*SchweinDeBurg joined #nim
10:13:51FromDiscord<ruehc> i want a raw string
10:13:59FromDiscord<polylokh_39446> raw strings don't handle escapes.
10:14:17FromDiscord<ruehc> but raw string means disbales all special escapes
10:14:27FromDiscord<polylokh_39446> yes that's what they'er for
10:14:33FromDiscord<ruehc> (edit) "disbales" => "disable"
10:14:43FromDiscord<ruehc> yes so how to get the raw string ?
10:14:47FromDiscord<ruehc> r doesn't work
10:14:58FromDiscord<polylokh_39446> `r"hello world` is a raw string, it works fine
10:15:09FromDiscord<ruehc> but \\" doesn't work
10:15:15FromDiscord<polylokh_39446> it's an escape, escapes don't work
10:15:28FromDiscord<polylokh_39446> You can also write that as `r"hello "" world"` instead
10:15:34FromDiscord<ruehc> but it works with \r \n and others
10:15:38FromDiscord<ruehc> except \\"
10:15:46FromDiscord<polylokh_39446> it doesn't work with \r\n, raw strings don't interpret escapes
10:15:54FromDiscord<ruehc> it does i can show you
10:16:06FromDiscord<polylokh_39446> if you mean that you want a literal \ and " in your raw string, then you need to double the "" all the same
10:16:29FromDiscord<polylokh_39446> this is all in <https://nim-lang.org/docs/manual.html#lexical-analysis-raw-string-literals>
10:17:06FromDiscord<ruehc> is ``r""`` the only ``prefix`` available ?
10:17:16FromDiscord<polylokh_39446> no, that's also at the link.
10:17:49FromDiscord<polylokh_39446> you can write your own function, and even have it take a static string so that it runs at compiletime, and use it isntead of `r`
10:19:44FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=BWkNVSiX
10:20:22FromDiscord<ruehc> ok i understand
10:20:23*SchweinDeBurg quit (Ping timeout: 264 seconds)
10:20:24FromDiscord<polylokh_39446> well I guess that doesn't necessarily run at compiletime, just because I said `static`
10:23:06FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=llVShbfp
10:24:09FromDiscord<ruehc> wow that is cool u created your own prefix
10:26:54*coldfeet quit (Remote host closed the connection)
10:31:31*SchweinDeBurg joined #nim
11:06:34FromDiscord<Robyn [She/Her]> In reply to @eightbit_dboy "Still says not found": That's really odd :|
11:25:06*SchweinDeBurg quit (Ping timeout: 252 seconds)
11:26:58*SchweinDeBurg joined #nim
11:35:42*SchweinDeBurg quit (Ping timeout: 268 seconds)
11:37:25*SchweinDeBurg joined #nim
11:39:41*ntat quit (Quit: Leaving)
11:39:56*beholders_eye joined #nim
11:42:31FromDiscord<kots> !eval echo """\"\n"""
11:42:35NimBot\"\n
11:42:54FromDiscord<kots> !eval """\"\n"""
11:42:57NimBotCompile failed: /usercode/in.nim(1, 1) Error: expression '"""\"\n"""' is of type 'string' and has to be used (or discarded)
11:43:20FromDiscord<kots> Imagine that I wrote `\"` there
11:43:25*SchweinDeBurg quit (Ping timeout: 268 seconds)
11:44:47FromDiscord<polylokh_39446> !eval echo "\\\""
11:44:50NimBot\"
11:45:19FromDiscord<kots> !eval echo """\\"\n"""
11:45:20FromDiscord<polylokh_39446> discord making this easy.
11:45:23NimBot\\"\n
11:45:42FromDiscord<polylokh_39446> anyway, for a non-raw string, there's nothing special you need to do. Strings have escapes.
11:46:04FromDiscord<kots> Triple quoted string literals seem to do what atlas wanted
11:46:22FromDiscord<kots> Literal `\"` and no other escapes
11:47:12*SchweinDeBurg joined #nim
11:47:50FromDiscord<polylokh_39446> not that escape either, but yeah that seems right
11:53:22*beholders_eye quit (Read error: Connection reset by peer)
11:53:27*kotrcka joined #nim
11:57:47*def- quit (Quit: -)
11:58:04*def- joined #nim
11:58:55*SchweinDeBurg quit (Ping timeout: 260 seconds)
11:59:20*beholders_eye joined #nim
12:04:46*SchweinDeBurg joined #nim
12:05:11FromDiscord<nocturn9x> omg nimble is so damn stupid
12:05:13FromDiscord<nocturn9x> `Warning: A package "[email protected]" with checksum "b4335e064ec81ddbd7e9ffb5de1bfbfceca4d0e8" already exists the the cache.`
12:05:21FromDiscord<nocturn9x> yes thanks I know, can you freaking install it then?
12:05:44FromDiscord<nocturn9x> if you do some changes, then `nimble install` and then revert them and do it again, nimble will say the package is cached but not change the symlink of the installed binary
12:05:47FromDiscord<nocturn9x> like wtf
12:06:02*def- quit (Quit: -)
12:06:56*def- joined #nim
12:12:12*SchweinDeBurg quit (Ping timeout: 260 seconds)
12:13:31FromDiscord<ieltan> unfortunately Nimble is steaming shit
12:14:08*SchweinDeBurg joined #nim
12:19:45*SchweinDeBurg quit (Ping timeout: 256 seconds)
12:21:28*SchweinDeBurg joined #nim
12:25:45*beholders_eye quit (Read error: Connection reset by peer)
12:31:02FromDiscord<nocturn9x> agreed
12:31:10FromDiscord<nocturn9x> but like if you implement caching
12:31:14FromDiscord<nocturn9x> at least do it right
12:31:14FromDiscord<nocturn9x> jeez
12:31:35FromDiscord<nocturn9x> cuz like it clearly works
12:31:41FromDiscord<nocturn9x> all it has to do is change the symlink
12:31:48*beholders_eye joined #nim
12:33:47*coldfeet joined #nim
12:36:08*SchweinDeBurg quit (Ping timeout: 268 seconds)
12:44:27FromDiscord<solitudesf> worst thing is how you are forced to delete package directories manually, because it refuses to uninstall packages because something depends on them. even when its a binary or local package, so it makes no sense to stop you from deleting it.
12:47:00*SchweinDeBurg joined #nim
12:48:01FromDiscord<Robyn [She/Her]> Time to make a Cargo-like Nim package manager :)
12:48:41FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Is it a bit": A shame this doesn't have autocomplete or anything though
12:48:42FromDiscord<Robyn [She/Her]> A shame this doesn't have autocomplete or anything though
12:52:41FromDiscord<solitudesf> In reply to @chronos.vitaqua "Time to make a": the only thing wrong with nimble is that its bugged
12:58:52*def- quit (Quit: -)
12:59:39*def- joined #nim
13:00:29*beholders_eye quit (Ping timeout: 240 seconds)
13:01:43FromDiscord<ieltan> In reply to @chronos.vitaqua "Time to make a": I don't use rust, what would a cargo-like nim package manager even look like?
13:03:41FromDiscord<Phil> In reply to @solitudesf "the only thing wrong": And that it relies on a centralized package.json↵And that it has security issues with how it handles nimble file parsing afaik
13:03:57FromDiscord<Phil> (edit) "package.json↵And" => "package.json (you can't do e.g. a .npmrc file equivalent)↵And"
13:06:01FromDiscord<solitudesf> In reply to @isofruit "And that it relies": you dont have to rely on centralized packages.json.↵what kind of security issues, besides being able to run arbitrary code at any point?
13:06:24*coldfeet_ joined #nim
13:06:31FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=WiATSPAQ
13:06:48*coldfeet_ quit (Client Quit)
13:06:54FromDiscord<Robyn [She/Her]> There's also feature flags which work well as Nim `define`s
13:06:58*SchweinDeBurg quit (Ping timeout: 268 seconds)
13:07:16FromDiscord<Phil> In reply to @solitudesf "you dont have to": You do in the sense that you can't say (afaik) "Ey, instead of that one packages.json on github, refer to that local mirror I installed on a local server" or the like
13:07:18FromDiscord<solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=owKBSHoa
13:07:48FromDiscord<Phil> Also yeah, the kinds of security issues you just mentioned. Afaik it enables executing the code of the nimble file when parsing it
13:08:01FromDiscord<Robyn [She/Her]> In reply to @solitudesf "which part of that": Feature flags, but that's it really
13:08:12FromDiscord<Phil> Which apparently wasn't done in Atlas (?), which makes it infinitely saner in that regard
13:08:23FromDiscord<Robyn [She/Her]> I just really like how cargo looks and works from my small time in Rust land
13:08:43FromDiscord<Phil> In reply to @chronos.vitaqua "I just really like": Just admit you like toml files 😛
13:09:13FromDiscord<solitudesf> In reply to @chronos.vitaqua "I just really like": the only reason you prefer cargo instead of nimble, is cargo is actually maintained.
13:09:37FromDiscord<Phil> I guess another interesting project could actually be to just contribute to atlas
13:10:08FromDiscord<kots> In reply to @isofruit "I guess another interesting": This is the correct answer
13:10:08FromDiscord<Phil> Though I'd need to start using it first 😅
13:10:13FromDiscord<Robyn [She/Her]> In reply to @isofruit "Just admit you like": Perhaps :P↵They feel like the best format for configuration and such
13:10:24FromDiscord<Robyn [She/Her]> In reply to @solitudesf "the only reason you": That and the format lol
13:10:45FromDiscord<solitudesf> In reply to @isofruit "I guess another interesting": miss me with that workspace shit
13:11:15FromDiscord<Phil> In reply to @solitudesf "miss me with that": I mean, if you just treat it as "1 project = 1 workspace" won't it feel kinda similar to just using normal nimble?
13:11:24*SchweinDeBurg joined #nim
13:11:31FromDiscord<solitudesf> In reply to @chronos.vitaqua "That and the format": i WANT my config files to be arbitrary code, i want to be able to randomly `exec("rm -rf ~")`.
13:12:43FromDiscord<Phil> Just as a disclaimer - I haven't used Atlas yet, merely Eclipse for half a year when I started coding, which also has a workspace mentality from what I recall. The workspace metaphor was...grating from what I remember but I think that can be minimized in annoyance
13:12:57FromDiscord<solitudesf> In reply to @isofruit "I mean, if you": yeah, and now all my projects are 1 folder deep for no reason. when i can just use localdeps with nimble and not get cancer.
13:13:02FromDiscord<ruehc> what does first character mean ? https://media.discordapp.net/attachments/371759389889003532/1239203685507010642/7465.png?ex=664211dd&is=6640c05d&hm=eb2b235e8e007a6639ecad900d044f0879e45a36942e16d5d1025e43a24c55e2&
13:13:15FromDiscord<Phil> Which one?
13:13:38FromDiscord<ruehc> sent a code paste, see https://play.nim-lang.org/#pasty=mmRyOhHR
13:13:47FromDiscord<Phil> In reply to @solitudesf "i WANT my config": I feel like it'd be valid to have that kind of stuff in tasks, not on a global level in the nimble file itself
13:14:02FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#pasty=fyeBEOHh
13:14:12FromDiscord<solitudesf> In reply to @isofruit "I feel like it'd": i dont care about valid, i want to powertrip from the possibilities.
13:14:44FromDiscord<Phil> In reply to @solitudesf "i dont care about": You can powertrip while at the same time not being enabled to rm -rf anyone that downloads your lib
13:15:03FromDiscord<solitudesf> now you're just gatekeeping my power
13:15:19FromDiscord<Phil> In that scenario I feel very validated in wanting to do so
13:18:21FromDiscord<ruehc> In reply to @isofruit "In that scenario I": you didn't answer me bro
13:18:44FromDiscord<Phil> Rika did
13:19:22*coldfeet_ joined #nim
13:19:33FromDiscord<ruehc> where ?
13:19:39FromDiscord<odexine> In reply to @odexine "if the first character": hi
13:19:49FromDiscord<ruehc> In reply to @odexine "if the first character": what do u mean ?
13:19:55*SchweinDeBurg quit (Ping timeout: 268 seconds)
13:19:56FromDiscord<Phil> That is not to say I understand your reply, I am not seeing any text "first character" in that screenshot so I don't get either way what's going on, but Rika apparently did
13:20:12FromDiscord<Phil> Are we in regex territory or what?
13:20:14FromDiscord<odexine> if i have an operator `+=!-$%` then the rule follows OP8 because the first character is `+`
13:20:47FromDiscord<ruehc> https://media.discordapp.net/attachments/371759389889003532/1239205634704932984/Inked7465_LI.jpg?ex=664213ae&is=6640c22e&hm=65b3b35c7c0f627acb2c98a63b99b72fe524c95dec79393f56ed4d7d35d36229&
13:21:01FromDiscord<ruehc> In reply to @odexine "if i have an": do those mean i have to define them myself ?
13:21:06FromDiscord<Phil> Yes and what is this table about?
13:21:18FromDiscord<ruehc> In reply to @isofruit "Yes and what is": precedence
13:21:19FromDiscord<odexine> it means in the case where someone defines that operator, be it you or someone else
13:21:42FromDiscord<odexine> if the operator exists then the precedence is OP8
13:21:49*SchweinDeBurg joined #nim
13:21:57*coldfeet_ quit (Client Quit)
13:21:58FromDiscord<odexine> or level 8, whatever
13:32:33*SchweinDeBurg quit (Ping timeout: 272 seconds)
13:34:11*SchweinDeBurg joined #nim
13:41:23FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=abmmSeiZ
13:42:58FromDiscord<polylokh_39446> do it at runtime, or use I/O that works at compile time like staticRead
13:44:10FromDiscord<Robyn [She/Her]> In reply to @solitudesf "i WANT my config": `tasks/myScript.nim` would be nicer
13:44:10*coldfeet_ joined #nim
13:44:21FromDiscord<madonuko> In reply to @polylokh_39446 "do it at runtime,": `fmWrite`?
13:44:37FromDiscord<madonuko> also this is runtime nimscript
13:44:46NimEventerNew Nimble package! happyx-ui - UI library for HappyX web framework, see https://github.com/HapticX/happyx-ui
13:44:48*SchweinDeBurg quit (Ping timeout: 252 seconds)
13:45:01FromDiscord<Robyn [She/Her]> In reply to @madonuko "also this is runtime": `writeFile` should work
13:46:34*SchweinDeBurg joined #nim
13:47:44FromDiscord<madonuko> alright it does thanks
13:49:42FromDiscord<madonuko> oh hell yeah I'm cooking so hard https://media.discordapp.net/attachments/371759389889003532/1239212910946025482/uF5RKTT.png?ex=66421a75&is=6640c8f5&hm=90f527f5d79ed7ba94e378c76c31ae842ea3e8c9d3e450c3c9437c66cfba2931&
13:50:07*coldfeet_ quit (Quit: leaving)
13:50:39FromDiscord<_nenc> In reply to @ruehc "what does first character": It means that for a operator which is made of symbols(for example, +, -, , /) instead of letters(a-z), its precedence depends on its first character, in which "first character" means `s[0]` for string `s`
13:51:27FromDiscord<_nenc> (edit) "`s`" => "`s`↵for example `++`'s first character is `+`, `%`'s first character is `%`, `$!`'s first character is `$`"
13:51:45FromDiscord<_nenc> (edit) "," => "\,"
13:54:57*SchweinDeBurg quit (Ping timeout: 256 seconds)
13:56:54*SchweinDeBurg joined #nim
13:57:48*coldfeet quit (Remote host closed the connection)
14:00:39FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=DSejBJBR
14:04:13FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=GPHsFUnO
14:06:45FromDiscord<solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=anRBkJGT
14:08:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @solitudesf "no. is your Context": I have a global variable yes
14:11:33FromDiscord<System64 ~ Flandre Scarlet> But normaly it should be destroyed at the end of the program
14:12:30FromDiscord<solitudesf> In reply to @sys64 "But normaly it should": i remeber there was an issue with globals not getting destroyed, but it looks like its no longer that case.
14:12:35FromDiscord<solitudesf> (edit) "remeber" => "remember"
14:12:44FromDiscord<solitudesf> (edit) "that" => "the"
14:13:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @solitudesf "i remember there was": Here seems it's still the case
14:13:29FromDiscord<System64 ~ Flandre Scarlet> or maybe I have to recompile everything? Any ways to force recompiling everything?
14:13:34*SchweinDeBurg quit (Ping timeout: 268 seconds)
14:14:06FromDiscord<solitudesf> everything is recompiled anyway
14:14:48FromDiscord<System64 ~ Flandre Scarlet> So there is an huge problem
14:15:21FromDiscord<solitudesf> yep, minimize and file an issue
14:15:29*SchweinDeBurg joined #nim
14:17:23*coldfeet joined #nim
14:17:38*krux02 joined #nim
14:22:51*SchweinDeBurg quit (Ping timeout: 256 seconds)
14:23:17*coldfeet quit (Quit: leaving)
14:24:49*SchweinDeBurg joined #nim
14:28:38*coldfeet joined #nim
14:29:28FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=yqnlJRac
14:30:47*SchweinDeBurg quit (Ping timeout: 256 seconds)
14:32:11*SchweinDeBurg joined #nim
14:33:57FromDiscord<System64 ~ Flandre Scarlet> Sooo it works?... Quite weird...
14:36:01*ntat joined #nim
14:47:55FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=JPZtTIbt
14:48:00FromDiscord<solitudesf> In reply to @sys64 "Sooo it works?... Quite": because it should work. do you have a reproducible example?
14:48:29*SchweinDeBurg quit (Ping timeout: 240 seconds)
14:50:46*SchweinDeBurg joined #nim
14:52:35FromDiscord<madonuko> In reply to @madonuko "`c2nim` generated this piece": nvm I think I can turn everything into a pointer
15:14:52*beholders_eye joined #nim
15:16:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @solitudesf "because it should work.": I fixed the issue
15:34:12*ntat quit (Ping timeout: 255 seconds)
15:35:02*ntat joined #nim
15:43:42FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=TshTBqaV
15:45:27FromDiscord<Phil> No clue, what does dumpTree say to the nimnodes that produces?
15:46:55FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=oEVpuiOH
15:47:36FromDiscord<aintea> It has its own node kind
15:47:50FromDiscord<aintea> whereas my macro is considered as an indent
15:54:59FromDiscord<Robyn [She/Her]> In reply to @aintea "whereas my macro is": Probably because dot expressions (and most operators for that matter) are special cased to support that syntax, Nim doesn't exactly support custom operators
15:55:02*def- quit (Quit: -)
15:55:20FromDiscord<Robyn [She/Her]> You could try defining `--->` though and seeing if that works?
15:55:56*def- joined #nim
16:03:20*SchweinDeBurg quit (Ping timeout: 268 seconds)
16:03:32FromDiscord<pmunch> In reply to @chronos.vitaqua "Probably because dot expressions": Nim does support custom operators though. This seems more like a bug that anything
16:05:35FromDiscord<Robyn [She/Her]> In reply to @pmunch "Nim does support custom": Wait it does?
16:05:50FromDiscord<Robyn [She/Her]> I thought it only supported them if they were using characters allowed in existing operators
16:06:03*craigbro joined #nim
16:06:31FromDiscord<pmunch> https://nim-lang.org/docs/manual.html#lexical-analysis-operators
16:06:59FromDiscord<pmunch> Not really, you can even do unicode operators
16:07:49FromDiscord<Robyn [She/Her]> Aaah okay
16:07:49FromDiscord<aintea> Is there something like the splat operator in python ? or julia ?
16:08:11FromDiscord<aintea> To pass on tuples to functions that take multiple arguments
16:09:09FromDiscord<Robyn [She/Her]> In reply to @aintea "Is there something like": `std/macros` has `unpackVarargs`, you could probably take that code and modify it to work on a tuple
16:09:44FromDiscord<Robyn [She/Her]> Oh actually you're in luck @aintea
16:09:45FromDiscord<Robyn [She/Her]> https://github.com/Nimberite-Development/Trigger-Nim/blob/main/src/trigger.nim#L22
16:09:59FromDiscord<aintea> Oh really nice
16:10:02FromDiscord<Robyn [She/Her]> I've written a macro for this exact purpose :)
16:10:20FromDiscord<aintea> thank you very much
16:10:30FromDiscord<aintea> nim is awesome but its users are more awesome
16:10:42FromDiscord<aintea> (but can its users expand at compile time ? I don't think so)
16:11:00FromDiscord<odexine> how do you know that
16:11:05FromDiscord<odexine> what if i can
16:11:08FromDiscord<Robyn [She/Her]> In reply to @aintea "thank you very much": No worries! :)
16:11:23FromDiscord<Robyn [She/Her]> In reply to @aintea "(but can its users": Yeah we did, in the womb :)
16:11:29FromDiscord<aintea> Dammit
16:11:32craigbroi can expand at compile time, if by compile time you mean breakfast
16:11:58FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=giiJOToo
16:12:08FromDiscord<aintea> let's expand nim a bit
16:12:11FromDiscord<Robyn [She/Her]> Templates are your saviour
16:12:18FromDiscord<aintea> I'm learning them
16:12:28FromDiscord<aintea> too much for my brain
16:12:33FromDiscord<Robyn [She/Her]> `template `<>`(a, b: untyped): untyped = a & b`
16:12:44FromDiscord<Robyn [She/Her]> (edit) "`template `<>`(a, b: untyped): untyped =" => "sent" | "& b`" => "code paste, see https://play.nim-lang.org/#pasty=JWLHhwAg"
16:13:01FromDiscord<Robyn [She/Her]> :)
16:13:26FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=lbOYtwnP
16:13:44FromDiscord<Robyn [She/Her]> Why `.`?
16:13:52FromDiscord<aintea> so templates are basically macros for "simple stuff" that doesn't interact directly with the ast tree ?
16:13:57FromDiscord<Robyn [She/Her]> Macros are used for directly manipulating the AST
16:13:59FromDiscord<aintea> (edit) "https://play.nim-lang.org/#pasty=CZhACQro" => "https://play.nim-lang.org/#pasty=nbfxCGyP"
16:14:09FromDiscord<aintea> (edit) removed "tree"
16:14:24FromDiscord<Robyn [She/Her]> In reply to @aintea "so templates are basically": Yep! Templates are essentially "paste this code!"
16:14:26FromDiscord<aintea> In reply to @chronos.vitaqua "Why `.`?": missinput
16:14:29*SchweinDeBurg joined #nim
16:14:39FromDiscord<aintea> In reply to @chronos.vitaqua "Yep! Templates are essentially": nice
16:14:43FromDiscord<Robyn [She/Her]> You can use them how you would a proc, too
16:15:06FromDiscord<aintea> is that a good idea to try to use templates everywhere ? Or just where they belong
16:16:19FromDiscord<Robyn [She/Her]> Only where they belong, really
16:16:33FromDiscord<Robyn [She/Her]> They can impact compile times because the compiler has to still resolve them
16:16:44FromDiscord<Robyn [She/Her]> For simple statements though, not much harm
16:16:57FromDiscord<grumblygibson> The way I think about it is that templates make debugging more difficult and the code harder to reason about. Prefer this order: func, proc, template, macro.
16:16:58FromDiscord<aintea> okay
16:17:27FromDiscord<grumblygibson> (edit) "The way I think about it is that templates ... make" added "(can)"
16:17:31FromDiscord<aintea> I'm dreaming of something that can expand that compile time
16:17:34FromDiscord<aintea> no functions
16:17:37FromDiscord<aintea> only macros
16:17:46FromDiscord<aintea> (that's called a nightmare)
16:17:58FromDiscord<aintea> anyway, thanks you for the help
16:18:02FromDiscord<aintea> and for the advice
16:19:40FromDiscord<Robyn [She/Her]> No sweat!
16:20:03FromDiscord<Robyn [She/Her]> In reply to @grumblygibson "The way I think": `func`s are painful with `mixin`s and generics unfortunately
16:22:43FromDiscord<grumblygibson> Can you elaborate? I'd love to know since I don't have experience yet with those + funcs.
16:23:41FromDiscord<Robyn [She/Her]> It just causes the Nim compiler to complain about `mixin`ed functions and side effects, really
16:27:26FromDiscord<grumblygibson> I think that's the point of funcs though, that they ensure and convey those guarantees?
16:27:58*coldfeet quit (Quit: leaving)
16:28:03FromDiscord<aintea> is there something like the `compileTime` pragma but that just tries to evaluate it at compiletime, and if not possible just evaluates it at runtime ? something like `constexpr` in c++ ?
16:28:28FromDiscord<grumblygibson> what is "if not possible"?
16:28:44FromDiscord<aintea> if it errors
16:28:46FromDiscord<aintea> something like this
16:29:20FromDiscord<Robyn [She/Her]> In reply to @grumblygibson "I think that's the": Yeah it is, but would be nice to make it so mixins could enforce these guarantees too
16:29:50FromDiscord<Robyn [She/Her]> In reply to @aintea "is there something like": Doesn't Nim do this already, though?
16:30:05FromDiscord<odexine> in limited situations
16:31:03FromDiscord<aintea> In reply to @chronos.vitaqua "Doesn't Nim do this": I don't know
16:31:12FromDiscord<aintea> oops, sorry for the ping
16:31:41FromDiscord<grumblygibson> @aintea yes,nim let's you do that. https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement
16:31:56FromDiscord<grumblygibson> (edit) "let's" => "lets"
16:32:24FromDiscord<aintea> I would never have guessed that when lets you do that
16:32:25FromDiscord<aintea> thanks
16:33:14FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=vUzRPhPZ
16:33:24FromDiscord<grumblygibson> when is always compiletime if.
16:33:27FromDiscord<aintea> or does nim evaluates at comiple time when possible
16:33:48FromDiscord<aintea> (edit) "comiple" => "compile"
16:33:53FromDiscord<grumblygibson> no
16:34:23FromDiscord<nocturn9x> you see
16:34:29FromDiscord<nocturn9x> there's days where nim really tries hard to make me hate it
16:34:30FromDiscord<nocturn9x> but some days
16:34:37FromDiscord<nocturn9x> some days I love it so much
16:34:40FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=MgKWcGsx
16:34:43FromDiscord<nocturn9x> nimpy is a _godsend_
16:35:03FromDiscord<nocturn9x> no need to mess with the raw buffer API or something like that
16:35:10FromDiscord<nocturn9x> just bam, make a numpy array from nim
16:35:18FromDiscord<nocturn9x> actually awesome™️
16:37:04FromDiscord<grumblygibson> Nim shines in the areas where there is std lib support, or some kind soul has labored to make a module like nimpy. Imagine if nim had the rust size community and rust size ecosystem of modules. Would love a Nim foundation.
16:38:24FromDiscord<aintea> What ? You really would like a Nm foundation ?
16:38:41FromDiscord<aintea> I must legally say that I do not belong to the Nim foundation
16:43:22*xet7 joined #nim
16:51:02FromDiscord<Clonkk> If you are interested in handling numpy array from Nim we developed this a while ago https://github.com/SciNim/scinim/blob/main/scinim/numpyarrays.nim↵(@nocturn9x)
16:51:16FromDiscord<Clonkk> It is base on Numpy but extend array API
16:52:02FromDiscord<Clonkk> Some docs present here \: https://scinim.github.io/getting-started/external_language_integration/nim_with_py.html
16:57:16FromDiscord<madonuko> is it possible to suppress this https://media.discordapp.net/attachments/371759389889003532/1239260116440711338/PGgBABp.png?ex=6642466c&is=6640f4ec&hm=ab814b6a64b99ec749807c0ce13ab4f532ebe6e6583130276e5168be5eb1624a&
16:58:02FromDiscord<nocturn9x> In reply to @Clonkk "If you are interested": ohh, fancy
16:58:07FromDiscord<nocturn9x> lemme try
16:58:17FromDiscord<polylokh_39446> 1. catch it↵2. add it to your raises↵3. remove the raises
16:58:51FromDiscord<polylokh_39446> (edit) "1." => "a." | "it↵2." => "it↵b." | "raises↵3." => "raises↵c."
16:58:53FromDiscord<nocturn9x> can I convert an arraymancer array to numpy as well?
16:59:32FromDiscord<madonuko> In reply to @polylokh_39446 "a. catch it b.": kinda dumb how there's not an unchecked version
17:00:50FromDiscord<Clonkk> Yes we have conversion proc in the files i linked you↵(@nocturn9x)
17:00:55FromDiscord<nocturn9x> sweet
17:01:08FromDiscord<nocturn9x> see this is the stuff that makes nim so freaking cool
17:01:08FromDiscord<Clonkk> https://github.com/SciNim/scinim/blob/67207e89a11a62ceb671da45e8032039f20eef12/scinim/numpyarrays.nim#L174
17:01:12FromDiscord<nocturn9x> and makes me hopeful
17:01:16FromDiscord<Clonkk> https://github.com/SciNim/scinim/blob/67207e89a11a62ceb671da45e8032039f20eef12/scinim/numpyarrays.nim#L182
17:01:25FromDiscord<nocturn9x> the interop with other languages is just so nice
17:01:35FromDiscord<Clonkk> This is currently done by copy to avoid dangling pointer
17:02:10FromDiscord<Clonkk> If you are interesting in scientific computing, there is also https://github.com/SciNim/nimjl which allows you to call Julia code from Nim
17:02:24FromDiscord<polylokh_39446> In reply to @madonuko "kinda dumb how there's": d. getOrDefault
17:02:42FromDiscord<madonuko> In reply to @polylokh_39446 "d. getOrDefault": yeah nah that's the exact same issue but it becomes uhh Exception
17:02:51FromDiscord<madonuko> so after all the effort you still need catch
17:04:09FromDiscord<polylokh_39446> all that effort? Then catch it and re-raise it as a defect. This is the same thing as an "unsafe" version that panics on error.
17:05:30FromDiscord<madonuko> eh, what I really mean is… if `key in CMDENVS` is true, then `CMDENVS[key]` must not raise KeyError
17:06:02FromDiscord<madonuko> so the workaround is to just do a `try` `except`
17:06:13FromDiscord<madonuko> to properly suppress the error
17:11:08FromDiscord<odexine> nim doesnt have flow typing (or in this case, flow exceptions)
17:12:33FromDiscord<madonuko> I think I can pray on the compiler for optimising this out
17:12:43FromDiscord<madonuko> gcc
17:13:07FromDiscord<polylokh_39446> mainly, a modern CPU will get the branch prediction right every time and it won't matter
17:13:08FromDiscord<kots> try: return CMDENVS[key] except KeyError: ...
17:13:17FromDiscord<kots> No raises and no double lookup
17:13:40FromDiscord<madonuko> In reply to @k0ts "try: return CMDENVS[key] except": true
17:15:01FromDiscord<madonuko> sent a code paste, see https://play.nim-lang.org/#pasty=XUTdnTXy
17:15:03FromDiscord<polylokh_39446> you can `doAssert false` there, but raising a defect will satisfy `raises: []` since it's uncatachable and will come with a message and a useful backtrace. It's what go and rust do when they panic()
17:15:03FromDiscord<madonuko> pretty nice
17:15:36FromDiscord<madonuko> In reply to @polylokh_39446 "you can `doAssert false`": ah…
17:22:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=qnRObcJX
17:30:35*xet7 quit (Remote host closed the connection)
17:39:32FromDiscord<Phil> Now why this manages to trigger taskpool so that one thread essentially rabidly tries to steal work from another is completely beyond me, I do not understand threadpools well enough to make that assessment
17:46:29FromDiscord<Robyn [She/Her]> In reply to @aintea "oops, sorry for the": It's fine!
17:56:10FromDiscord<Phil> @mratsim I opened an issue regarding the work-steal problem which so far looks to me like a bug (?). I migth also be using taskpools wrong and ThreadSignalPtr is just fundamentally not mixable with threadpools, I dunno.↵https://github.com/status-im/nim-taskpools/issues/41↵↵This problem also affects weave_io in the seemingly same way (I can see the 100%ing of a CPU core of mine, just can't figure out the flag necessary to see the same l
17:56:36FromDiscord<Phil> (edit) "@mratsim I opened an issue regarding the work-steal problem which so far looks to me like" => "sent" | "bug (?). I migth also be using taskpools wrong and ThreadSignalPtr is just fundamentally not mixable with threadpools, I dunno.↵https://github.com/status-im/nim-taskpools/issues/41↵↵This problem also affects weave_io in the seemingly same way (I can see the 100%ing of a CPU core of mine, just can't figure out the flag necess
17:58:29*kotrcka quit (Remote host closed the connection)
18:12:10*beholders_eye quit (Ping timeout: 255 seconds)
18:14:32*gst joined #nim
18:21:17FromDiscord<eightbit_dboy> In reply to @chronos.vitaqua "That's really odd :|": Yup.
18:22:57*sunling joined #nim
18:23:15*sunling quit (Remote host closed the connection)
18:24:38FromDiscord<linuxarch> is there a better way to call c code from nim other than using a .so, I just can't seem to call it, ive tried all dynlib ways Ive found, either it can't use the .so or when it can it can't access the function
18:24:50FromDiscord<linuxarch> (edit) ".so," => ".so?"
18:34:27*xet7 joined #nim
18:35:16FromDiscord<Phil> I mean, that's dynamic linking. You can also statically link, but that requires having the lib in a shape that can statically compile
18:35:25FromDiscord<Phil> Which might mean you need to compile it that way.
18:35:32FromDiscord<Phil> And depending on what it is that may take a long tim
18:35:34FromDiscord<Phil> (edit) "tim" => "time"
18:36:01FromDiscord<Phil> Like, if we're talking opensll, strap in for an hour or more
18:36:15FromDiscord<graveflo> In reply to @linuxarch "is there a better": what do you mean access it?
18:36:22FromDiscord<Phil> (edit) "opensll," => "openssl,"
18:41:16NimEventerNew thread by xtr00: Issue: regression on 2.x.x: push warning[HoleEnumConv]:off does not work., see https://forum.nim-lang.org/t/11590
18:50:55*xet7 quit (Quit: Leaving)
18:51:10*xet7 joined #nim
18:51:25*xet7 quit (Remote host closed the connection)
18:51:43*xet7 joined #nim
18:52:23FromDiscord<linuxarch> In reply to @graveflo "what do you mean": call a c function (that i made) from nim
18:53:09FromDiscord<linuxarch> In reply to @isofruit "Like, if we're talking": just a self made argon2 library
18:53:48FromDiscord<graveflo> so you wrapped the function with `importc` ?
18:54:22FromDiscord<Phil> Did you follow the guide from demotomohiro?
18:54:40FromDiscord<linuxarch> Im using that: proc hash_password(password: cstring, salt: cstring, hash_len: cint, memory: cint, iterations: cint, parallelism: cint): cstring {.cdecl, importc: "hash_password", dynlib: "libargon2.so".}
18:55:54FromDiscord<graveflo> did you try using the header and pass the dynlib path to the nim compiler with `passL`?
18:56:16FromDiscord<linuxarch> I tried with the header but passL did not work
18:56:20FromDiscord<linuxarch> header did not work also
18:56:30FromDiscord<linuxarch> but passL gave compilation error
18:57:13FromDiscord<graveflo> what are the errors
18:57:44FromDiscord<Phil> (Sidenote: I tend to always reference: https://internet-of-tomohiro.netlify.app/nim/clibrary.en)
18:59:56FromDiscord<linuxarch> sent a long message, see https://pasty.ee/JuCDIHVa
19:00:01FromDiscord<linuxarch> (edit) "https://pasty.ee/oFuLSFGZ" => "https://pasty.ee/zWEGWENd"
19:01:28FromDiscord<graveflo> The header should be a .h not .so
19:02:18FromDiscord<linuxarch> sent a code paste, see https://play.nim-lang.org/#pasty=lHkMWxWH
19:04:14FromDiscord<graveflo> Try removing dynlib pragma and use passL instead
19:04:23*beholders_eye joined #nim
19:05:12FromDiscord<odexine> missing comma
19:05:22FromDiscord<odexine> `header: "libargon2.h" importc: "hash_password",`
19:05:28FromDiscord<odexine> `header: "libargon2.h", importc: "hash_password",`
19:06:01FromDiscord<odexine> is this a copy mistake or?
19:06:03FromDiscord<linuxarch> I put the comma in but still same thing
19:06:07FromDiscord<graveflo> You'd think that would crash
19:06:16FromDiscord<odexine> In reply to @graveflo "You'd think that would": you would lol weird it doesnt
19:06:17FromDiscord<linuxarch> In reply to @odexine "is this a copy": I just put it wrong
19:06:28FromDiscord<odexine> okay so a copy mistake
19:07:22FromDiscord<odexine> do you need the header pragma
19:07:51FromDiscord<linuxarch> I mean I just want to call the function, as long as it works its fine
19:08:18FromDiscord<graveflo> If passL doesnt work try putting a print statement after the function call to see if uts core dumping or something
19:08:45FromDiscord<linuxarch> im calling it like this:↵echo hash_password("password".cstring, "salt1234567890".cstring, 64, 1024 1024, 3, 2)
19:57:23*def- quit (Quit: -)
19:57:45*def- joined #nim
20:00:41*def- quit (Client Quit)
20:00:58*def- joined #nim
20:06:54FromDiscord<solitudesf> what is the error without header pragma?
20:11:25*ntat quit (Quit: Leaving)
20:53:22FromDiscord<linuxarch> could not import: hash_password↵Error: execution of an external program failed: '/home/frederico/.cache/nim/main_d/main_7AF03C97555F80782659E5823250628888B16195'
20:53:37FromDiscord<linuxarch> using that: `proc hash_password(password: cstring, salt: cstring, hash_len: cint, memory: cint, iterations: cint, parallelism: cint): cstring {.cdecl, importc: "hash_password", dynlib: "libargon2.so".}`
20:53:44FromDiscord<linuxarch> no header pragma
20:54:34FromDiscord<Elegantbeef> Does `libargon2` actually havea `hash_password`?
20:54:36FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=OmxqWpVA
20:55:06FromDiscord<morgan> so progress on my clap library, i now have working saving and loading in my abstraction layer. as long as you only want an audio effect with no midi and no timeline position and no ui (yet of varying degrees on all of these), it should be pretty easy to write a plugin with it
20:55:39FromDiscord<morgan> oh also the abstraction layer doesn't currently have any way to handle additional user data, just parameters for now
20:55:43FromDiscord<morgan> but that's on my todo list
20:55:45FromDiscord<linuxarch> In reply to @Elegantbeef "Does `libargon2` actually havea": I opened it on a dissasembler: https://media.discordapp.net/attachments/371759389889003532/1239320131855974487/image.png?ex=66427e50&is=66412cd0&hm=46bdf74f4c1bec8c2a774d2f5e3eab8c6e1ddee5847c128b6568ff6641b42bbf&
20:56:02FromDiscord<linuxarch> I compiled it with cmake
20:56:09FromDiscord<Elegantbeef> https://github.com/P-H-C/phc-winner-argon2/blob/master/include/argon2.h it's not in here
20:56:35FromDiscord<linuxarch> wdym, libargon2 is my own library for testing purposes
20:57:04FromDiscord<Elegantbeef> You defined it and exported it then compiled a shared library?
20:57:06FromDiscord<linuxarch> sent a code paste, see https://play.nim-lang.org/#pasty=wZvyoWBj
20:58:27FromDiscord<linuxarch> In reply to @Elegantbeef "You defined it and": do I need to export it in C? is it not already exported?
20:58:32FromDiscord<Elegantbeef> Are you sure you're not accidentally loading the system library instead of your library?
20:58:41FromDiscord<linuxarch> In reply to @linuxarch "do I need to": In C++ you need to extern C but not in pure C right?
20:58:44FromDiscord<Elegantbeef> I didn't know what language you were loading from
20:59:11FromDiscord<linuxarch> In reply to @Elegantbeef "Are you sure you're": now that you mention, might be...
20:59:28FromDiscord<linuxarch> Can I specify the .so from the current directory?
20:59:33FromDiscord<linuxarch> like ./libargon2.so
20:59:40FromDiscord<linuxarch> or should I just change the name?
21:00:03FromDiscord<Elegantbeef> No clue about relative paths with dynlib
21:00:19FromDiscord<Elegantbeef> If you use passL you can use the same mechanisms as C to explicitly state a path
21:01:41FromDiscord<linuxarch> oh ok
21:02:25FromDiscord<linuxarch> is there any docs on passl?
21:02:50FromDiscord<polylokh_39446> and the C mechanism to hard-code a path into the executable for dynamic linking is `-Wl,-rpath,/custom/rpath/`. You'll also need --dylibOverride:whatever to prevent Nim from handling this itself.
21:02:54FromDiscord<Elegantbeef> It's quite literally the C linker argument
21:03:13FromDiscord<polylokh_39446> (edit) "--dylibOverride:whatever" => "--dynlibOverride:whatever"
21:03:15FromDiscord<Elegantbeef> You only need `dynlibOverride` if you use dynlib
21:03:18FromDiscord<Elegantbeef> If you do not use `dynlib` but use the C linker to link you're fine
21:03:51FromDiscord<linuxarch> oh ok
21:04:03FromDiscord<linuxarch> I will try to passL then
21:11:07*xet7 quit (Remote host closed the connection)
21:11:27*def- quit (Quit: -)
21:11:27FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=tBAvhvap
21:11:54*def- joined #nim
21:15:17FromDiscord<maxtachine> sent a code paste, see https://play.nim-lang.org/#pasty=yiOjhsxe
21:15:41FromDiscord<maxtachine> basically its just giving me an empty string in my nim translation
21:17:40FromDiscord<polylokh_39446> `cast[LPSTR](msgBuffer)`↵`(LPSTR)&msgBuffer`↵these are teh same?
21:17:48FromDiscord<polylokh_39446> (edit) "teh" => "the"
21:18:45FromDiscord<maxtachine> i forgot to try addr msgBuffer
21:19:13FromDiscord<maxtachine> still doesnt work
21:20:21FromDiscord<Elegantbeef> Nim strings are not pointers
21:20:30FromDiscord<Elegantbeef> you want `cstring(msgBuffer)`
21:20:45FromDiscord<Elegantbeef> or `msgBuffer[0].addr`
21:21:13FromDiscord<maxtachine> In reply to @Elegantbeef "or `msgBuffer[0].addr`": this one doesnt work
21:21:25FromDiscord<maxtachine> or at least not in the copyMem
21:21:49FromDiscord<polylokh_39446> the Nim string there is `message`; `msgBuffer` is an LPSTR - a cstring
21:22:06FromDiscord<Elegantbeef> Wait I misread
21:22:12FromDiscord<maxtachine> https://media.discordapp.net/attachments/371759389889003532/1239326783468343367/image.png?ex=66428482&is=66413302&hm=b07509bd1c5247bdb726e98d4c27b2fc7c26de0c2045efd3419ac3e73655d71c&
21:22:47FromDiscord<polylokh_39446> I don't understand how this is supposed to work though. FormatMessageA takes a cstring, not a ptr cstring, so the buffer has to be already be allocated for it to write to, but it's not in either verison
21:23:19FromDiscord<maxtachine> the C++ function works tho
21:24:22*beholders_eye quit (Read error: Connection reset by peer)
21:25:12FromDiscord<polylokh_39446> <https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagea> has it using a stacka-allocated array to write to. You sure your C++ function isn't working accidentally?
21:26:29*dv^_^ quit (Quit: dv^_^)
21:26:37FromDiscord<polylokh_39446> nevermind, that's FormatMessage (no A) that's doing that.
21:28:25FromDiscord<polylokh_39446> >A pointer to a buffer that receives the null-terminated string that specifies the formatted message. If dwFlags includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in lpBuffer.
21:29:13FromDiscord<polylokh_39446> ... is this, is it taking a (char,size_t) pair to write to an existing buffer, and a (char,0) buffer to allocate, and it just lies about the type of that parameter?
21:30:01*beholders_eye joined #nim
21:30:15FromDiscord<polylokh_39446> that's what it seems like, and in that case you need to pass `cast[this shit isn't typed anyway who cares](msgBuffer.addr)`
21:31:48FromDiscord<polylokh_39446> yeah, with `FORMAT_MESSAGE_ALLOCATE_BUFFER` you need to pass a `ptr cstring`, not a `cstring`. You just need to cast to cstring to bypass type checking.
21:33:42FromDiscord<polylokh_39446> when you pass `cast[LPSTR](msgBuffer)`, the `msgBuffer` is a `cstring` with the value of NULL, and probably there are multiple NULL checks that result in you getting an empty string instead of a segfault
21:53:09FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=XjLRZBNQ
21:53:42FromDiscord<demotomohiro> sent a long message, see https://pasty.ee/UpDKxvIg
21:53:52FromDiscord<linuxarch> In reply to @Elegantbeef "It's quite literally the": Im not really used to C, I know this is wrong but how do I use it correctly? Ive seen some docs about this but can't seem to find it again:↵--passL="L. -l:libargon2.so"
21:54:52FromDiscord<polylokh_39446> what you meant to write is `--passL="-L. -largon2'
21:55:00FromDiscord<polylokh_39446> (edit) "-largon2'" => "-largon2"`"
21:56:39FromDiscord<linuxarch> Thank you!
21:56:40FromDiscord<demotomohiro> In reply to @linuxarch "Im not really used": These linker options are explained here: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Link-Options.html#index-Libraries
21:57:09FromDiscord<linuxarch> In reply to @demotomohiro "These linker options are": ty
21:58:00FromDiscord<polylokh_39446> but what you actually need to do depends on when what you're doing is failing. Is it failing to link during compilation? Can you complete a `nim c` and get a binary but then the binary doesn't start? Does `ldd yourprogram` yet find all of the libraries that it lists?
21:59:27FromDiscord<linuxarch> `$ nim c src/main.nim --passL="-L. -largon2"↵Hint: used config file '/home/frederico/.choosenim/toolchains/nim-2.0.4/config/nim.cfg' [Conf]↵Hint: used config file '/home/frederico/.choosenim/toolchains/nim-2.0.4/config/config.nims' [Conf]↵Error: arguments can only be given if the '--run' option is selected`
21:59:42FromDiscord<polylokh_39446> put the flag before src/main.nim
21:59:51*lucasta joined #nim
21:59:53FromDiscord<linuxarch> however `nim c src/main.nim --passL="-L. -largon2"` works but I am trying to discover how to call the function
22:00:46FromDiscord<linuxarch> sent a long message, see https://pasty.ee/jmzgszlv
22:00:46*dv^_^ joined #nim
22:01:09FromDiscord<polylokh_39446> this is Nim complaining before any linker flags matter
22:01:15FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=navgocdQ
22:01:25FromDiscord<linuxarch> In reply to @linuxarch "It worked but not": nevermind
22:01:45FromDiscord<linuxarch> This is caused by me calling the function as if It was a nim defined function
22:01:47FromDiscord<solitudesf> sent a code paste, see https://play.nim-lang.org/#pasty=EagSSHNv
22:01:54FromDiscord<linuxarch> In reply to @linuxarch "This is caused by": that I forgot to delete
22:02:02FromDiscord<linuxarch> (edit) "delete" => "comment out"
22:02:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @solitudesf "yes": Alright, good
22:02:26FromDiscord<linuxarch> yep now it worked
22:03:14FromDiscord<linuxarch> sent a code paste, see https://play.nim-lang.org/#pasty=xxYFMFOD
22:22:42*beholders_eye quit (Read error: Connection reset by peer)
22:22:49*krux02 quit (Quit: Leaving)
22:28:13*beholders_eye joined #nim
22:33:05FromDiscord<Alexei Cyplenkov> I'm new to Nim. Does it use the lambda calculus of Alfonzo Church?
22:33:05FromDiscord<Alexei Cyplenkov> Is it a purely functional language
22:39:49FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=JfLgYZrc
22:40:18FromDiscord<Elegantbeef> It surely copies, just not deeply
22:54:27*beholders_eye quit (Read error: Connection reset by peer)
23:00:01*beholders_eye joined #nim
23:01:41FromDiscord<Robyn [She/Her]> Ah so the references inside should be preserved
23:09:59*beholders_eye quit (Read error: Connection reset by peer)
23:10:25*beholders_eye joined #nim
23:27:58FromDiscord<morgan> In reply to @Alexei Cyplenkov "Is it a purely": no it is not purely functional. but it does make a distinction between procedures (with side effects) and functions (without or with as little as the compiler can manage to enforce)
23:39:49*rez joined #nim