<< 01-11-2023 >>

00:00:02*marcus quit (Remote host closed the connection)
00:00:42*marcus joined #nim
00:03:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "you need to set": Good to know
00:12:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "you need to set": Even by increasing, I have this warning https://media.discordapp.net/attachments/371759389889003532/1169066505078579240/image.png?ex=65540d07&is=65419807&hm=c141b44a960636ad2bff78173ea22e2d1251f5385617ba2647ffee1b59bdc2ef&
00:42:44FromDiscord<_gumbercules> In reply to @sys64 "Even by increasing, I": that won't fix the blocking on the main thread warning
00:43:12FromDiscord<_gumbercules> that warning indicates you're blocking on the main thread
01:46:29*marcus quit (Remote host closed the connection)
01:47:09*marcus joined #nim
03:11:37FromDiscord<michaelb.eth> sanity check... if I have a `var a: array[N, int]` all the members are initialized to `0`, right?
03:14:03FromDiscord<Elegantbeef> Yes
03:49:04FromDiscord<michaelb.eth> is it possible to have a seq of aligned arrays?↵I'm a bit inexperienced with the align pragma, not sure if/how what I'm trying is having an effect
03:49:48FromDiscord<odexine> what are you attempting to achieve?
03:53:43FromDiscord<michaelb.eth> trying to speed up part of my `nim_con` imp (for that `related_post_gen` benchmark project) using SIMD similar to what D, C# and Rust do
03:54:40FromDiscord<michaelb.eth> I've got SIMD in play now, but I need to figure out a strategy to eliminate overhead of shunting data from a seq into an `array[N, int8`
03:54:50FromDiscord<michaelb.eth> (edit) "int8`" => "int8]`"
03:55:54FromDiscord<michaelb.eth> so I was thinking maybe the `seq[int8]` could instead be an `seq[array[N, int8]]`, but the arrays need to be aligned, either by 16 or 32 depending on whether I'm using SSE2 or AVX2
03:57:26FromDiscord<michaelb.eth> SIMD comes into play in `proc topN`: https://github.com/michaelsbradleyjr/related_post_gen/blob/e4e67e28859acd0bfab2b51228d09745ac1aad8c/nim_con/related_con.nim#L126-L165
04:09:55*enyc joined #nim
04:12:50Amun-Rafrom what I see new_seq[byte] is always aligned to 64-bits on 64-bit linux
04:13:00Amun-Rahttps://play.nim-lang.org/#ix=4Kuy
04:13:45Amun-Rayou can change the alignment of arrays with align pragma, seqs not so much
04:15:52Amun-Rahttps://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L45
04:15:58FromDiscord<michaelb.eth> sure, but what about arrays inside a seq?
04:16:04Amun-Ranewseqpayload uses alignedalloc
04:16:18Amun-Rahmm
04:16:40*Maksimilan joined #nim
04:18:06Maksimilanhi
04:21:24Amun-Rasame https://play.nim-lang.org/#ix=4Kuz
04:32:37NimEventerNew post on r/nim by GnuChanOS-yt: nim raylib, see https://reddit.com/r/nim/comments/17l4an6/nim_raylib/
04:51:35*Maksimilan quit (Changing host)
04:51:35*Maksimilan joined #nim
04:53:07*Maksimilan_ joined #nim
04:58:47*Maksimilan_ quit (Remote host closed the connection)
04:58:47*Maksimilan quit (Remote host closed the connection)
04:59:13*Maksimilan joined #nim
05:11:50*rockcavera quit (Remote host closed the connection)
06:33:43*Maksimilan quit (Remote host closed the connection)
06:56:12*advesperacit joined #nim
07:26:10om3gaHow to access uint32 variable bytes for assignment? For example cast[ptr UncheckedArray[byte]](result)[i] = byte, where byte = uint8 (type byte) not works
07:29:40FromDiscord<Elegantbeef> just bitshift and use bitwise ops
07:30:12om3gaElegantbeef, right! thanks!
07:30:27FromDiscord<Elegantbeef> Using pointer arithmetic to set individual bytes on a integer lies madness
07:30:59FromDiscord<Chronos [She/Her]> Nah, I think it's a great idea
07:31:52om3gaI'm not happy too, othervise I cannot get proper value from mmap-ed stream
07:33:27FromDiscord<Chronos [She/Her]> I was joking lol, but why isn't that working for you?
07:33:59*redj joined #nim
07:34:48om3gathe lib faststreams reads only one byte, if I'm not mistaken :)
07:35:08om3gatrying to adopt it for reading pcaps, for test
07:35:28FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kv0
07:35:34FromDiscord<Chronos [She/Her]> In reply to @om3ga "trying to adopt it": Ah fair
07:35:44FromDiscord<Elegantbeef> Nice you've printed the first 4 bytes over and over again 😛
07:35:53FromDiscord<Elegantbeef> Well first byte
07:35:54FromDiscord<Elegantbeef> first 8 bits 😄
07:36:29FromDiscord<Elegantbeef> If you want to make `[]=` you need to clear the byte you care about using bitwise ops then copy your byte there
07:37:23FromDiscord<Elegantbeef> You can use `std/bitops` to do that
07:39:23*PMunch joined #nim
07:54:56*antranigv quit (Ping timeout: 258 seconds)
07:58:31*antranigv joined #nim
08:03:34FromDiscord<Chronos [She/Her]> Shit lol
08:15:33FromDiscord<4zv4l> is it possible to get runtime variable for padding in format string ?↵like in C with `printf("%s", 10, str)` ?
08:16:19FromDiscord<4zv4l> `echo fmt"{number:<pad}{fb}"`↵↵here pad is a variable number, but it doesnt work and the format string must be compile time known
08:34:01FromDiscord<griffith1deadly> proc printf(...) {.importc.} 🥺
08:36:42*xet7 joined #nim
08:45:23FromDiscord<4zv4l> thats what I did but the nim format system doesnt allow that ?
09:14:56Amun-Raiirc no
09:16:45FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Kvs
09:16:59FromDiscord<nnsee> from [the nim manual](https://nim-lang.org/docs/manual.html#types-cstring-type)
09:17:37FromDiscord<nnsee> In reply to @4zv4l "thats what I did": mentioning so you get pinged too
09:18:00Amun-Raright, but you have to convert everything to ctypes
09:18:25Amun-Ralet me write matching example
09:20:13Amun-Rahttps://play.nim-lang.org/#ix=4Kvt
09:20:43Amun-Raand problem stats when you decide to make variadic nim proc
09:20:46Amun-Rastarts
09:21:40FromDiscord<nnsee> https://play.nim-lang.org/#ix=4Kvu
09:21:41FromDiscord<nnsee> ?
09:21:46FromDiscord<nnsee> i'm not too sure what you mean
09:22:41Amun-Rafixed number of arguments and fixed format string
09:23:25FromDiscord<nnsee> can you give an example where it doesn't work?
09:23:59Amun-Ralet's say I want to have and equivalent of fmt""
09:24:38Amun-Raand I need to write the body of proc myformat(format: string, args: varargs[`$`, string])
09:24:39FromDiscord<nnsee> In reply to @Amun-Ra "https://play.nim-lang.org/#ix=4Kvt": https://play.nim-lang.org/#ix=4Kvv and this works fine without explicitly converting to ctypes?
09:26:33Amun-Rawe had a joke in C channel, "it compiles and runs, now… what's a SIGSEGV?" ;)
09:26:42Amun-Raint and cint sizes do not match
09:26:48Amun-Raprintf expects cint
09:27:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @_gumbercules "that warning indicates you're": How ? A thread isn't supposed to be blocking
09:28:06Amun-Ratbh, I'd use sprintf for that
09:29:23FromDiscord<nnsee> In reply to @Amun-Ra "int and cint sizes": i was under the assumption that primitives like int and string are implicitly converted to ctypes when calling importc procs
09:29:28FromDiscord<nnsee> TIL
09:29:33FromDiscord<nnsee> no clue where i got that idea from
09:29:49Amun-Rahmm
09:30:28Amun-Ratbh that'd be doable but in case of format strings it would require format introspection
09:30:54FromDiscord<nnsee> oh, from from the manual↵> For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a const string to cstring are safe and will remain to be allowed.
09:31:44Amun-Rayes, [c]strings are fine
09:32:04FromDiscord<nnsee> ah, i see, for some reason i assumed that extended to other types too
09:33:47Amun-RaI'm overpedantic in my code regarding this dept. ;)
09:35:53Amun-Rabut I have to do explicit converts in my libraries calling C ABI - I use dlopen exclusively
09:35:58Amun-Rasee https://github.com/amnr/dlsdl2/ for example
09:36:26Amun-Rathat's a part of my image viewer that I'm slowly releasing to the wild (github)
09:38:36*koltrast_ is now known as koltrast
09:50:42Amun-Ra(gtk[2-4], x11, xcb are wip)
09:59:37FromDiscord<nnsee> nice!
10:02:52Amun-Rathanks :)
10:25:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KvN
10:27:27Amun-Rahttps://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#interacting-with-code-call-javascript-from-native
10:27:56Amun-Raso it should be sth like:
10:28:18Amun-RaEM_ASM "console.log($0);", "foo"
10:30:41FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KvO
10:33:57Amun-Rahmm
10:34:24Amun-Rathat has a different prototype, how about: EM_ASM "console.log('foo');"
10:35:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "that has a different": I think it will just print "foo"
10:36:17Amun-Rayes, I mean: macro EM_ASM␝(code: static[string], args: varargs[typed]) vs template EM_ASM(code: static[string])
10:37:07Amun-RaI never used wasm before, got to go running, good luckk
10:57:15FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#ix=4KvZ
10:58:06FromDiscord<aintea> Even after copy pasting the expected type into the parameter type, I still get the error
11:04:07PMunchHmm, there's no way, short of making the type explicit, to make this array throw an error when one ID is missing is there? https://play.nim-lang.org/#ix=4Kw3
11:04:23FromDiscord<odexine> `(func (x: uint): bool = ` -> `(func (x: uint): bool {.closure.} = `
11:04:51PMunchI currently use the first kind, explicitly making it an array of an enum. But that means I can shuffle messages on accident
11:04:55FromDiscord<odexine> In reply to @PMunch "Hmm, there's no way,": i believe that is the case
11:05:26FromDiscord<aintea> In reply to @odexine "`(func (x: uint): bool": What ? why this ?
11:05:27FromDiscord<aintea> (edit) "?" => "?"
11:05:38PMunchWith the latter the shuffling is now harder because the relationship to an enum value is obvious, but now I can omit messages without error
11:06:46FromDiscord<odexine> In reply to @aintea "What ? why this": function types `(uint) -> bool` are closures by default IIRC
11:07:24FromDiscord<odexine> i dont remember the rules for l-value definitions
11:07:28FromDiscord<odexine> (edit) "i dont remember the rules for l-value ... definitions" added "function"
11:07:41FromDiscord<odexine> but it seems in this case it defaults to nimcall
11:42:12PMunchhttps://peterme.net/labelled-exceptions-for-smoother-error-handling.html
11:57:53*edr joined #nim
11:59:12FromDiscord<nnsee> nice
12:04:57FromDiscord<Phil> In reply to @PMunch "https://peterme.net/labelled-exceptions-for-smoothe": Sweet!↵It is kinda nuts that you basically can tag an exception raised by some called code from your own code and fetch based on that
12:09:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kwl
12:11:28FromDiscord<Phil> How does that work under the hood btw? Do you generate an enum over all the Labels on the fly?
12:11:46FromDiscord<Phil> (edit) "fly?" => "fly which the user then can do a switch case over?"
12:12:00om3ga@Сhronos template bytesToT[T] (bytes: seq[byte]): T = var result: T for i in 0..<s
12:12:04om3gaizeof(T):
12:12:04om3ga result = cast[T](result or bytes[i].T shl (i * 8))
12:12:04om3ga result
12:12:04om3gavar
12:12:04om3ga seqByte1: seq[byte] = @[0x0A, 0x00, 0x00, 0x00]
12:12:06om3ga seqByte2: seq[byte] = @[0x14, 0x00]
12:12:09om3ga seqByte3: seq[byte] = @[0x1E, 0x00, 0x00, 0x00]
12:12:11om3gavar uint32Res: uint32 = bytesToT[uint32](seqByte1)
12:12:14om3gavar uint16Res: uint16 = bytesToT[uint16](seqByte2)
12:12:16om3gavar int32Res: int32 = bytesToT[int32](seqByte3)
12:12:19om3gaecho uint32Res
12:12:21om3gaecho uint16Res
12:12:24om3gawhoops, sorry
12:12:32om3gahttps://play.nim-lang.org/#ix=4Kwm
12:13:47om3gaElegantbeef, this works, while when I add this template, it won't work with pcapLib wiritten by PMunch
12:14:01om3gaseems I need more coffeine
12:15:26om3gaanother variant, using copyMem : https://play.nim-lang.org/#ix=4Kwp
12:17:32om3gaI made a mistake in second variant, forgot to shift addr where it copies from src
12:17:35FromDiscord<pmunch> @Phil I did consider adding cases like that, wouldn't be too hard. But the problem is that it would mostly just lead to copying code everywhere
12:17:36om3gaignore it
12:18:44FromDiscord<Phil> In reply to @pmunch "<@180601887916163073> I did consider": Wouldn't it be just lifting the nimnodes under the "catchLabel" or whatever equivalent and attaching them as child-nodes to a case-statement?
12:19:28FromDiscord<pmunch> Oh yeah, I meant the user code in those branches
12:20:01FromDiscord<Phil> Ohhhhh hm fair. Basically your assumption is that the exception is more likely to be handled in identical fashions every time rather than separate fashions
12:20:16FromDiscord<Phil> Just different text
12:20:33FromDiscord<Phil> Would that be a correct understanding?
12:20:53FromDiscord<pmunch> And to answer your other question, yes it grabs all the labels in the source, adding them to a list. And then in the case branch it builds the enum type. The selected label is stored as an int (since the enum type doesn't exist yet) and converted to the type in the getLabel procedure
12:21:09FromDiscord<pmunch> Yes, that's exactly my assumption
12:22:44FromDiscord<Phil> Hmm it does keep the code simpler since the user by themselves based on their case-statement syntax can decide whether they go for enforcing total coverage of the enum or define a default case
12:25:33FromDiscord<nnsee> In reply to @chronos.vitaqua "Apparently it's fine to": so i looked into it, the binary output for argon2 is unrelated to password hashing and unsuitable for that use
12:26:01FromDiscord<nnsee> you should definitely use the string output for that purpose and the corresponding verification function
12:26:58FromDiscord<Chronos [She/Her]> Aah alright, thanks Ras!
12:42:16FromDiscord<griffith1deadly> i can safe pass nim gc types to nim dll? like seq's
12:48:29FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "i can safe pass": Can you elaborate? Is it a Nim DLL loaded by a Nim program?
12:48:49FromDiscord<Chronos [She/Her]> If that's the case, look at NimRTL, because otherwise there will be many issues with the GC
12:50:23FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Can you elaborate? Is": yes, nim dll loaded by nim program
12:53:26FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "If that's the case,": even with arc/orc?
12:59:36*CO2 quit (Quit: WeeChat 4.1.1)
13:08:43FromDiscord<Asbjørn> sent a long message, see http://ix.io/4KwL
13:09:12FromDiscord<Asbjørn> sent a long message, see http://ix.io/4KwM
13:10:19FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "even with arc/orc?": Yep
13:11:09FromDiscord<Chronos [She/Her]> In reply to @Asbjørn "I really hope this": `cast[seq[byte]](readFile("yourFile")` to get a byte sequence from your file
13:12:04FromDiscord<Chronos [She/Her]> In reply to @Asbjørn "I really hope this": The only difference between a `string` and a `seq[byte]` is the type really, a Nim string isn't null-terminated, since the length is stored within the object
13:12:42FromDiscord<nnsee> wellll, this is a bit of an XY problem
13:13:47FromDiscord<nnsee> you should modify your code to expect an `openArray` instead of a `seq[byte]` - that way, no conversion is necessary
13:14:33FromDiscord<nnsee> as a very simple example of this, see https://nim-lang.org/docs/sequtils.html#count%2CopenArray%5BT%5D%2CT
13:20:27*rockcavera joined #nim
13:23:28FromDiscord<Asbjørn> sent a long message, see http://ix.io/4KwP
13:35:08FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Yep": and all my defined api for dll should use unsafe code like ptr?
13:36:24FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "and all my defined": That's still unsafe, tbh, unmanaged C types are what you'll want, but you could use NimRTL as a shared library which means you compile the GC once, and link compiled applications in Nim against that
13:36:48FromDiscord<Chronos [She/Her]> Which allows for you to pass objects through shared libraries safely, iirc
13:37:17FromDiscord<nnsee> In reply to @Asbjørn "Ah cool. Good advice!": well, the idea is that `openArray[T]` is a generic container type that holds N amount of `T`-s and its length (such as `seq[char]` for strings) and by implementing your procs like that, the compiler produces the correct procedures for each type that can be represented as an `openArray` - so even if you fed the same proc a string or a `seq[byte]`, it would still work without any conversion bei
13:38:43FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Which allows for you": then i can use no unsafe pointers?
13:39:43FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "then i can use": Then you can just pass them however you'd like without worrying about the memory management
13:40:40FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "Then you can just": then that's great! ty!
13:41:53FromDiscord<griffith1deadly> -d:useNimRtl need to be as compile flag both for application and library?
13:44:39FromDiscord<4zv4l> sent a long message, see http://ix.io/4KwX
13:44:48FromDiscord<4zv4l> (edit) "http://ix.io/4KwX" => "http://ix.io/4KwY"
13:45:17FromDiscord<Chronos [She/Her]> Yep
13:45:43FromDiscord<nnsee> In reply to @4zv4l "Hi, thanks for that": ah, right
13:45:48FromDiscord<nnsee> no clue, sorry
13:45:53FromDiscord<nnsee> not something i've used myself
13:47:55NimEventerNew post on r/nim by Robert_Bobbinson: Type errors with Nim., see https://reddit.com/r/nim/comments/17lci8c/type_errors_with_nim/
14:17:35*CO2 joined #nim
15:04:34NimEventerNew thread by GyatsoYT: Error: type mismatch: got <array[1..6, int], int>, see https://forum.nim-lang.org/t/10585
15:06:34NimEventerNew thread by PMunch: Labelled exceptions for smoother error handling, see https://forum.nim-lang.org/t/10586
15:07:43NimEventerNew post on r/nim by PMunch: Labelled exceptions for smoother error handling, see https://reddit.com/r/nim/comments/17le7fl/labelled_exceptions_for_smoother_error_handling/
15:11:08FromDiscord<nnsee> @gyatsoyt you're better off posting the full error message instead of just the line
15:11:22FromDiscord<nnsee> the entire message is relevant, as it shows what it was actually expecting
15:14:01PMunch@nnsee, that's a forum message, not sure they'll see your reply here
15:14:42FromDiscord<nnsee> yeah i know, i just know they've been active here before so it was worth a shot - i can't remember my forum account details and i can't be bothered to create a new one :p
15:31:11om3gahas anybodu tried faststreams previously? Can't integrate it. Reads totally different values of bytes :\
15:40:13FromDiscord<jviega> If I'm using something in posix that returns a ptr SomeStruct, is there some syntax to dereference just a field? Only way I know to handle it is to dereference the variable into an object first. Not sure if that's copying the object if I'm only reading, but thought it was worth asking
15:41:36FromDiscord<nnsee> In reply to @jviega "If I'm using something": my very ugly hack has been simply casting it (which doesn't copy)
15:41:43FromDiscord<nnsee> although it feels incredibly fragile
15:42:03FromDiscord<jviega> Yeah, I'm fine with the object copy if there's no syntax for it, but ugh
15:43:06FromDiscord<gyatsoyt> In reply to @nnsee "the entire message is": Well its too big to copy but I'll try
15:43:14FromDiscord<gyatsoyt> Cz I am on phone
15:44:09FromDiscord<nnsee> what? why?
15:44:15FromDiscord<nnsee> just use pastebin or something
15:47:34FromDiscord<nnsee> or like
15:47:46FromDiscord<nnsee> you pasted the entire code, can't you just paste the error?
15:47:56FromDiscord<nnsee> i'm not sure i'm understanding here 😅
15:48:11FromDiscord<gyatsoyt> In reply to @nnsee "you pasted the entire": https://srcb.in/TlVV21tLcE
15:48:13FromDiscord<gyatsoyt> Here take it
15:48:17FromDiscord<gyatsoyt> This is the whole error
15:48:56FromDiscord<gyatsoyt> In reply to @nnsee "you pasted the entire": Replit let's you copy whole code but not errors for no reason that's why I have problems copying errors
15:49:13FromDiscord<nnsee> i have to run right now and can't look at it, but maybe add that error to the forum post
15:49:20FromDiscord<nnsee> people will be able to help better
15:49:22FromDiscord<gyatsoyt> Ok
16:01:58NimEventerNew thread by lou15b: Malebogia Locker is not re-entrant?, see https://forum.nim-lang.org/t/10587
16:14:51*tiorock joined #nim
16:14:51*tiorock quit (Changing host)
16:14:51*tiorock joined #nim
16:14:51*rockcavera is now known as Guest7279
16:14:51*tiorock is now known as rockcavera
16:18:19*Guest7279 quit (Ping timeout: 264 seconds)
16:26:49FromDiscord<jviega> I just threw together a Nim-based terminal capture/replay tool that doubles as `expect`-like automation for terminal sessions. While waiting for Nimble, if people care to play around with it: https://github.com/crashappsec/cap10
16:29:07FromDiscord<Phil> waiting for nimble?
16:29:16FromDiscord<Phil> Oh, as in, the package repo
16:31:36FromDiscord<Phil> Say no more, on it
16:32:15FromDiscord<jviega> Lol
16:32:40FromDiscord<jviega> Thanks
16:34:05FromDiscord<jviega> My team insisted we share it when they saw it was able to record and play back the `notcurses` demo app, which includes full-on video
16:35:20NimEventerNew Nimble package! nostr - NOSTR Protocol implementation., see https://github.com/theAkito/nim-nostr
16:35:20NimEventerNew Nimble package! cap10 - A tool to capture and replay command line terminal sessions, see https://github.com/crashappsec/cap10
16:39:44om3gasometimes is very important to read issues, and I would not spend whole day to deal with it:
16:39:56om3gahttps://github.com/status-im/nim-faststreams/issues/39
16:40:01om3gadamn haha
16:41:48FromDiscord<Phil> I read the issue and given my unfamiliarity of in-depth IO knowledge I basically understood nothing 😅
16:42:07FromDiscord<Phil> (edit) "I read the issue and given my unfamiliarity of in-depth IO knowledge ... I" added "and memory-management"
16:42:39FromDiscord<Phil> Basically a use after free because ORC collects a stream before its fully read?
16:42:51om3gaI spent whole day to use memFileInput
16:42:52FromDiscord<jviega> It's not surprising, that sounds like the kind of thing I've run into every time I've tried ORC for Chalk. At some point I just gave up and decided I'm in no hurry to switch from refc
16:50:21NimEventerNew Nimble package! anycallconv - A macro to create special procedural types for parameters., see https://github.com/sls1005/anycallconv
16:57:28NimEventerNew thread by tcheran: Trying to parallelize zippy file extraction on Windows, see https://forum.nim-lang.org/t/10588
17:33:14FromDiscord<System64 ~ Flandre Scarlet> @_gumbercules↵Is it normal I can't interact with the DOM with Emscripten ?
17:35:00*krux02 joined #nim
17:48:16Amun-Rayou can; EM_ASM_*
17:50:19FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kym
17:52:19FromDiscord<Phil> Could be the code runs before the document is initialized?
17:52:34FromDiscord<Phil> Note I don't know jack about emscripten, this is me guessing
17:52:48Amun-Raimport std/jsffi
17:52:53Amun-Ravar document* {.importc, nodecl.}: JsObject
17:53:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "var document* {.importc, nodecl.}:": Does it work with Emscripten ?
17:53:40Amun-Ragood question
17:53:57Amun-RaI used emscripten a few times, not even once with nim
17:54:23FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/oblxm
17:57:01Amun-RaI have to write something with nim+emcc combo
17:58:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "I have to write": Yes↵Browser security is annoying and I don't understand why Emscripten didn't implémented something to download stuff easily
18:00:35FromDiscord<michaelb.eth> I have `type Foo = object` (no refs involved) and I have `let foos = newSeq[Foo](N)`. For some procs/funcs that take `foos` as an argument, it speeds up considerably (on some machines) if the parameter is `foos: var seq[Foo]` instead of `foos: seq[Foo]`. But I find it confusing because of `let foos`, i.e. the sequence won't be modified. I don't see anything with `--expandArc` where additional copying happens. What have I misundersto
18:20:31*neceve joined #nim
18:44:14om3gawhy proc mmsReadData(s: Stream, buffer: pointer, bufLen: int): int , not exported?
18:44:42om3gaor how to read bytes from newMemMapFileStream?
18:44:50FromDiscord<Yardanico> import std/streams
18:44:53FromDiscord<Yardanico> and use the generic streams procs
18:45:08FromDiscord<Yardanico> e.g. <https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint>
18:45:10om3gaYardanico, I need mmap
18:45:19FromDiscord<Yardanico> In reply to @om3ga "<@177365113899057152>, I need mmap": again, it's a generic interface to streams
18:45:34NimEventerNew Nimble package! zoominvitr - Automatically send invitations regarding planned Zoom meetings., see https://github.com/theAkito/zoominvitr
18:45:34FromDiscord<Yardanico> memfiles just provides an implementation of an interface that you can use with streams' procs
18:45:59FromDiscord<Yardanico> so you would create the stream with `newMemMapFileStream` and then read it with procs from std/streams, e.g. <https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint>
18:46:24FromDiscord<Yardanico> of course you can instead use <https://nim-lang.org/docs/memfiles.html#open%2Cstring%2CFileMode%2Cint%2Cint%2Cint> to avoid streams
18:46:35om3gaYardanico, you mena readData?
18:47:03om3gawill readData accept newMemMapFileStream?
18:47:06FromDiscord<Yardanico> yes, it's defined for the generic Stream object so it will actually call the internal implementation of mmsReadData
18:47:14FromDiscord<Yardanico> In reply to @om3ga "will readData accept newMemMapFileStream?": yes, it will, that's the whole point of std/streams
18:47:45om3gaThanks, I will try again, but I doubt. because for some reason it not work
18:49:12FromDiscord<Yardanico> works just fine
18:49:14FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyQ
18:50:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyR
18:51:01om3gaI need to read byte
18:51:02om3ga:)
18:51:05om3ganot the line
18:51:34FromDiscord<Yardanico> then you just use the different procs from std/streams, they all work
18:51:58om3gawell, I get type mismatch
18:52:03FromDiscord<Yardanico> with what code?
18:52:22FromDiscord<Yardanico> here's my second example but with sequences:
18:52:26FromDiscord<Yardanico> sent a code paste, see https://paste.rs/sEzKf
18:52:41om3gahttps://play.nim-lang.org/#ix=4KyT
18:53:07om3gahttps://play.nim-lang.org/#ix=4KyV
18:53:18FromDiscord<Yardanico> you need to point to the address of it for char
18:53:31om3gawith .addr is the same
18:53:39FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyW
18:54:20om3gaalso this: https://play.nim-lang.org/#ix=4KyX
18:54:57FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyY
18:54:58FromDiscord<Yardanico> again, this works
18:55:01FromDiscord<Yardanico> with `addr`
18:55:18FromDiscord<Yardanico> just make sure you special case sequences/strings as their addr won't match the address of the data since they have some internal info
18:56:27FromDiscord<Yardanico> oh right, and you don't need to reimplement the wheel actually
18:56:29FromDiscord<Yardanico> <https://nim-lang.org/docs/streams.html#read%2CStream%2CT> exists
18:56:55om3gavery strange
18:57:20FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyZ
18:58:42om3gahttps://i.imgur.com/dfLWuxS.png
18:59:09FromDiscord<Yardanico> how are you calling it?
18:59:26FromDiscord<Yardanico> and you did import `std/streams` as I said, right?
18:59:54om3gayes!
18:59:56om3ga:)
19:00:10FromDiscord<Yardanico> well, then I don't know without some more complete code and the full error
19:00:10om3gaI had it from beginning
19:00:18FromDiscord<Yardanico> can you make a small self-contained example that doesn't compile for you?
19:00:26FromDiscord<Yardanico> and yeah, show how `readData` is called
19:00:38om3gayes, I just copy/patsed your example
19:00:52om3gasomething weird here
19:01:09om3gareboot...
19:01:13FromDiscord<Yardanico> can you copy and paste my example into a separate nim file and run it?
19:01:21FromDiscord<Yardanico> because the screenshot you sent shows over 100 lines
19:01:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @om3ga "https://i.imgur.com/dfLWuxS.png": I like this theme↵Which one is it ?
19:01:38om3gaof course I pasted it to separate file :)
19:02:06FromDiscord<Yardanico> so can you just do `nim c file.nim` and show the complete output ?
19:02:32om3gaSystem64 ~ Flandre Scarlet: Material Theme High Contrast
19:02:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @om3ga "System64 ~ Flandre Scarlet:": Alright, thanks !
19:03:00om3gaYardanico, same type mismatch
19:03:09FromDiscord<Yardanico> yes, but can you show the entire output?
19:03:14FromDiscord<Yardanico> and what's your nim version?
19:03:32om3gayou mean verbose compiling printout?
19:03:45FromDiscord<Yardanico> no, just the usual compiler output you get, the whole one
19:03:49om3galet me reboot, something weird here with this wsl
19:03:54FromDiscord<Yardanico> from the command you run to the compiler exiting
19:09:24om3gassd died
19:10:03FromDiscord<Yardanico> lol
19:10:47om3gagood that I have code backup
19:22:02Amun-RaSystem64: I made working example, https://play.nim-lang.org/#ix=4Kzd
19:23:29Amun-Rahttps://play.nim-lang.org/#ix=4Kze
19:33:49FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "https://play.nim-lang.org/#ix=4Kze": Is it possible to pass arguments?
19:34:12Amun-Ramake a string
19:36:09Amun-Ra\0 should be really \\0
19:36:27Amun-Rathis is a quick and dirty poc
19:37:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "make a string": You mean string interpolation?
19:37:30Amun-Raah, no, arguments won't work, that will require changing second argument to emscripten_asm_const_int
19:38:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "ah, no, arguments won't": Because I need to pass data as string or array of bytes for the download↵But I need to manipulate the DOM to make the browser download something
19:38:27Amun-Rabut there's an alternative - make a few export "C" functions and call them from js
19:40:17Amun-Raeither via some event (I've never done it) or simple polling
19:40:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "but there's an alternative": Sounds quite complex, no?↵What normally happens during WAV export is the main program creates a new thread with the synthesizer data as a long string, and then the thread builds the WAV file
19:41:19om3gaYardanico, thanks, it works
19:42:26Amun-RaSystem64: there's a way - https://github.com/bytecodealliance/wasm-micro-runtime/issues/263
19:43:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: there's a way": Sounds interesting
19:44:23FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kzn
19:44:40FromDiscord<System64 ~ Flandre Scarlet> And the wav export https://media.discordapp.net/attachments/371759389889003532/1169361383532540034/message.nim?ex=65551fa7&is=6542aaa7&hm=cd08832b7067efe35b47d44092aaacbe10ade3213ef115a7475c57116580b1e6&
19:47:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @om3ga "System64 ~ Flandre Scarlet:": This one? https://media.discordapp.net/attachments/371759389889003532/1169362015266017311/image.png?ex=6555203e&is=6542ab3e&hm=34e905a6667219e17545b8929a09439fe8b899976765466cedf9a8760598d768&
19:49:13*om3ga quit (Read error: Connection reset by peer)
19:50:04FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Kzq
19:51:47Amun-RaSystem64: how about: trigger input file's click from wasm, then call wasm export c function from js and retrieve the data
19:52:18FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Kzt
19:52:34FromDiscord<Elegantbeef> Why not `when defined(foo): import std/strformat`?
19:52:39FromDiscord<Elegantbeef> You can also just do `import std/strformat{.used.}`
19:53:23FromDiscord<demotomohiro> In reply to @griffith1deadly "then write at top": Thank you, but I dont like to write that way, because I have many `when defined(foo)`, `when defined(bar)`, `when defined(baz)`.
19:53:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: how about: trigger": Wdym?
19:54:14FromDiscord<griffith1deadly> In reply to @demotomohiro "Thank you, but I": then like beef said: import std/strformat{.used.}
19:54:29Amun-Racall {document.querySelector("#element)".click();}
19:55:26Amun-Raelement being input file with onclick hooked to the function that'll call wasm function
19:56:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "call {document.querySelector("#element)".click();}": The button that triggers the thread is on Dear ImGUI, so on Nim side
19:56:58Amun-Rathat does not matter
19:57:20FromDiscord<demotomohiro> @ElegantBeef, @griffith1deadly I tried that `{.used.}` pragma but I got compile error.↵https://play.nim-lang.org/#ix=4Kzw
19:57:36Amun-Rathe button you're talking about triggers the process, the button i'm talking about triggers the download
19:58:10FromDiscord<Elegantbeef> Hmm odd
19:58:23FromDiscord<Elegantbeef> Swore we could use used on a import
19:58:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "the button you're talking": Oh alright, and I need to run it in EM_ASM?
19:58:53Amun-Raonly the click trigger
20:00:14*om3ga joined #nim
20:00:20FromDiscord<demotomohiro> `import std/strformat{.used.}` still result in compile error even with nightly build devel Nim.
20:00:37FromDiscord<Elegantbeef> Yea I guess I just misremembered
20:00:37FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "only the click trigger": Oh alright, and the rest?
20:01:09Amun-RaFromDiscord: and the rest is calling {.exportc.} function from js, the function that returns the buffer
20:02:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "FromDiscord: and the rest": Ah alright↵Do you have a small exemple please?
20:03:02Amun-Rano, unfortunately
20:06:38FromDiscord<System64 ~ Flandre Scarlet> But the exportC proc can only return one value, right?
20:09:59Amun-Rayou can return const char*, that I know
20:10:29FromDiscord<Elegantbeef> Depending on the runtime you can return multiple values
20:10:46FromDiscord<Elegantbeef> But multiple return values is not presently standard and is just in a RFC iirc
20:11:45Amun-Ra(writing wasm target to my image browser is still ahead of me)
20:12:42Amun-Raso quick (and dirty method) is: base64 it in wasm, return as string, decode on js side ;)
20:13:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "so quick (and dirty": Ah alright↵But the proc that generates the WAV is called from ImGUI, so WASM, not JS
20:13:45Amun-Rayes
20:14:08FromDiscord<System64 ~ Flandre Scarlet> So, JS can't call this proc
20:14:43Amun-Rayes
20:15:05FromDiscord<System64 ~ Flandre Scarlet> 🤯
20:15:31Amun-RaI mean you're right
20:15:39FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Kzx
20:16:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "I mean you're right": Yeah, this is why I said that↵So, I'm kinda stuck
20:17:37FromDiscord<Elegantbeef> Right demo the module isn't used until the end
20:17:43FromDiscord<Elegantbeef> you likely need to make an intermediate module
20:18:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Kzy
20:18:15FromDiscord<Elegantbeef> Something like that might not give a warning
20:18:44Amun-RaSystem64, not really, you'll need something like this on JS side either way: https://gist.github.com/TrevorSundberg/74dc4f576b94d19711a4547dcf04af40
20:20:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64, not really, you'll": so WASM needs to call this, right?
20:20:32Amun-Rayes
20:20:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "yes": Makes sense↵But I'll have the document error
20:21:05FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KzA
20:21:20Amun-RaSystem64: what do you need document for?
20:21:30FromDiscord<takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4KzA" => "https://play.nim-lang.org/#ix=4KzB"
20:21:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: what do you": ``const a = document.createElement('a')`` DOM manipulation
20:21:52FromDiscord<takemichihanagaki3129> In reply to @Amun-Ra "System64: what do you": A variable availabe at the top of my module.
20:21:53Amun-RaSystem64: do it on js side
20:22:00FromDiscord<takemichihanagaki3129> (edit) "availabe" => "available"
20:22:36FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzC
20:22:41FromDiscord<System64 ~ Flandre Scarlet> (this is just an exemple)
20:23:08FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KzD
20:23:09Amun-Ratakemichihanagaki3129: run this with nim doc and check which text is being displayed
20:23:31FromDiscord<takemichihanagaki3129> In reply to @Amun-Ra "<@890300313729400832>: run this with": ok, then! 😉
20:23:43Amun-RaSystem64: write function on js side and call the function
20:23:55FromDiscord<takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4KzD" => "https://play.nim-lang.org/#ix=4KzE"
20:24:11Amun-Ratakemichihanagaki3129: I vote for position 3 with one ident added
20:24:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: write function on": Oh alright, on the HTML page for exemple?
20:24:40Amun-Ramhm
20:25:38FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzF
20:25:42FromDiscord<System64 ~ Flandre Scarlet> Or maybe I did it the wrong way
20:34:38FromDiscord<takemichihanagaki3129> In reply to @Amun-Ra "<@890300313729400832>: I vote for": I tested, position 3 is tthe right one! Thanks a lot!
20:35:11FromDiscord<takemichihanagaki3129> (edit) "In reply to @Amun-Ra "<@890300313729400832>: I vote for": I tested, position 3 ... isthe" added "at the same indentation level of `else`" | "tthe" => "the"
20:47:47FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KzJ
20:50:07FromDiscord<user2m> nvm chatgippity set me straight
20:50:14FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KzL
20:53:39FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzP
20:53:44FromDiscord<System64 ~ Flandre Scarlet> from JsBind
20:54:35FromDiscord<leorize> can you link the source?
20:55:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @leorize "can you link the": https://github.com/yglukhov/jsbind/blob/master/jsbind/emscripten_api.nim
20:58:32FromDiscord<leorize> it generates an importc version of your proc, and custom code to export the actual one you wrote
20:59:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @leorize "it generates an importc": Oh, so it doesn't use JS ?
21:00:07FromDiscord<demotomohiro> @ElegantBeef Thank you! It worked.
21:02:05FromDiscord<leorize> in JS backend it will import the JS proc
21:02:06FromDiscord<leorize> importc is just import a proc without mangling its name↵(@System64 ~ Flandre Scarlet)
21:10:15*jmdaemon joined #nim
21:16:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @leorize "importc is just import": Oh alright
21:17:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "The console says that": @treeform I saw you made some Emscripten tutorials↵Do you know how can I call JS code without having this error while manipulating the document please?
21:19:49FromDiscord<treeform> Are you using Emscripten or Nim's JS mode? I don't know if you can get document in Emscripten. I think you need to write a shim/RPC for all normal JS calls.
21:22:36FromDiscord<Elegantbeef> Yea wasm has no direct access to DOM
21:23:46*madprops left #nim (Leaving)
21:24:25FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "Are you using Emscripten": Woops! That's an huge problem, because I need to save files on the disk
21:24:36FromDiscord<System64 ~ Flandre Scarlet> And I use Emscripten with WASM
21:24:56FromDiscord<nnsee> you can't save files to disk even using plain js
21:25:09FromDiscord<nnsee> best you can get is localstorage
21:25:11FromDiscord<Elegantbeef> Localstorage api exists
21:25:20FromDiscord<Elegantbeef> Damn one step ahead of me!
21:25:39FromDiscord<Elegantbeef> Wait no there is another api for actual file access
21:25:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "best you can get": Yeah but I want the popup window with the file explorer
21:26:04FromDiscord<nnsee> well you can do that with some effort
21:26:04FromDiscord<System64 ~ Flandre Scarlet> where the user can tell file's name and destination
21:26:14FromDiscord<nnsee> just need to interface with the js side
21:26:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "just need to interface": yeah this is where I don't understand
21:27:18FromDiscord<nnsee> have a look at https://developer.mozilla.org/en-US/docs/WebAssembly/Using_the_JavaScript_API
21:29:23FromDiscord<JJ> ty for the uxn pr btw beef
21:29:34FromDiscord<Elegantbeef> Cheers
21:29:49FromDiscord<JJ> i am currently unfortunately dying with school but will get back around to it at Some Point (tm)
21:30:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "have a look at": Wow doesn't sound trivial↵My problem is the following↵You have a thread that generates a WAV file through a seq of bytes↵I need to pass the data to JS, and so JS manages to do the download process
21:31:11FromDiscord<nnsee> yes
21:31:31FromDiscord<nnsee> it's not trivial per se, but it's not, like, incredibly hard either
21:31:32FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1169388276755484742/image.png?ex=655538b3&is=6542c3b3&hm=90f23763346458676a06d44c0e40c1d5b672e11107ba6f23079a6f54008be4ae&
21:32:05FromDiscord<Elegantbeef> Well @JJ atleast my PR is simple and should be easily merged 😛
21:32:47FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "it's not trivial per": The only thing I have for Emscripten is the minimal_shell.html↵This is the only non-nim thing used for compilation
21:34:39*PMunch quit (Quit: leaving)
21:34:56*krux02 quit (Remote host closed the connection)
21:35:01*advesperacit quit ()
21:43:51*tiorock joined #nim
21:43:51*tiorock quit (Changing host)
21:43:51*tiorock joined #nim
21:43:51*rockcavera is now known as Guest4961
21:43:51*Guest4961 quit (Killed (platinum.libera.chat (Nickname regained by services)))
21:43:51*tiorock is now known as rockcavera
21:44:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @nnsee "have a look at": Seems it doesn't show the C/C++ sie
21:44:38FromDiscord<System64 ~ Flandre Scarlet> (edit) "sie" => "sidee"
21:44:40FromDiscord<System64 ~ Flandre Scarlet> (edit) "sidee" => "side"
21:58:39*neceve quit (Ping timeout: 240 seconds)
22:00:22FromDiscord<System64 ~ Flandre Scarlet> I don't understand why Emscripten doesn't allow to directly manipulate the DOM
22:02:52FromDiscord<takemichihanagaki3129> Are `--passL` passed to `gcc` or `ld`?↵If yes, does this mean that I don't need to use `-Wl, option`?
22:03:11FromDiscord<takemichihanagaki3129> (edit) "yes," => "`ld`,"
22:04:32FromDiscord<takemichihanagaki3129> https://stackoverflow.com/questions/6562403/i-dont-understand-wl-rpath-wl↵I was reading this, and Kerrek said that `gcc -Wl,aaa,bbb,ccc` becomes `ld aaa bbb ccc`
22:05:53FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KA4
22:06:07FromDiscord<user2m> `document.getElementByID(id)` only returns an Element
22:06:39FromDiscord<user2m> `InputElement {.importc.} = ref object of Element`
22:28:02FromDiscord<Chronos [She/Her]> `Option[tuple[github: Option[Secret]]]` is this redundant or?
22:28:51FromDiscord<Chronos [She/Her]> I want it so that defining a secret for a service is completely optional so you can support which ever one you think is appropriate
22:29:06FromDiscord<Chronos [She/Her]> If any at all
22:30:52FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4KAe
22:31:03FromDiscord<intellij_gamer> (edit) "https://play.nim-lang.org/#ix=4KAe" => "https://play.nim-lang.org/#ix=4KAf"
22:37:13FromDiscord<Chronos [She/Her]> Hm, wondering if I should use std's logging library or a different one
22:37:30FromDiscord<Chronos [She/Her]> All I want is coloured output to the terminal for logging tbh
22:39:57FromDiscord<Elegantbeef> You can easily modify the stdlib logging to do that
22:40:43FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/logging.nim super simple logger setup using stdlib
22:43:28FromDiscord<Chronos [She/Her]> Oh epic! Why a `method` though? Any particular reason?
22:43:48FromDiscord<Chronos [She/Her]> Is that just how the stdlib works?
22:45:02FromDiscord<Elegantbeef> The stdlib uses method dispatch for overriding since it uses runtime polymorphism
22:45:09FromDiscord<Elegantbeef> You can have multiple loggers hooked at once
22:46:09FromDiscord<Chronos [She/Her]> Epic, thanks!
22:47:34FromDiscord<takemichihanagaki3129> In reply to @takemichihanagaki3129 "Are `--passL` passed to": @ElegantBeef, do you know this answer?
22:47:53FromDiscord<Elegantbeef> `--passL` is passed to the linker
22:49:02FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "`--passL` is passed to": So, do I need to use `-Wl`? like `--passL:"-Wl, ..."`
22:49:49FromDiscord<Elegantbeef> No clue what `-Wl` is
22:50:04FromDiscord<Chronos [She/Her]> Is it a bad idea to make a global for logging? Lol
22:50:24FromDiscord<Chronos [She/Her]> Wait I don't even need to do that
22:50:27FromDiscord<Elegantbeef> That's what stdlib uses
22:50:56FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "No clue what `-Wl`": > The -Wl,xxx option for gcc passes a comma-separated list of tokens as a space-separated list of arguments to the linke↵↵source: https://stackoverflow.com/questions/6562403/i-dont-understand-wl-rpath-wl
22:51:01FromDiscord<takemichihanagaki3129> (edit) "linke↵↵source:" => "linker↵↵source:"
22:51:13FromDiscord<Elegantbeef> You don't need `-Wl` then
22:51:36FromDiscord<Elegantbeef> If you want to supply other linker arguments you can just pass them using `--passL`
22:53:39FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "If you want to": Thanks a lot!
23:02:16*jmdaemon quit (Ping timeout: 255 seconds)