00:00:02 | * | marcus quit (Remote host closed the connection) |
00:00:42 | * | marcus joined #nim |
00:03:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "you need to set": Good to know |
00:12:55 | FromDiscord | <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:44 | FromDiscord | <_gumbercules> In reply to @sys64 "Even by increasing, I": that won't fix the blocking on the main thread warning |
00:43:12 | FromDiscord | <_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:37 | FromDiscord | <michaelb.eth> sanity check... if I have a `var a: array[N, int]` all the members are initialized to `0`, right? |
03:14:03 | FromDiscord | <Elegantbeef> Yes |
03:49:04 | FromDiscord | <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:48 | FromDiscord | <odexine> what are you attempting to achieve? |
03:53:43 | FromDiscord | <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:40 | FromDiscord | <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:50 | FromDiscord | <michaelb.eth> (edit) "int8`" => "int8]`" |
03:55:54 | FromDiscord | <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:26 | FromDiscord | <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:50 | Amun-Ra | from what I see new_seq[byte] is always aligned to 64-bits on 64-bit linux |
04:13:00 | Amun-Ra | https://play.nim-lang.org/#ix=4Kuy |
04:13:45 | Amun-Ra | you can change the alignment of arrays with align pragma, seqs not so much |
04:15:52 | Amun-Ra | https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim#L45 |
04:15:58 | FromDiscord | <michaelb.eth> sure, but what about arrays inside a seq? |
04:16:04 | Amun-Ra | newseqpayload uses alignedalloc |
04:16:18 | Amun-Ra | hmm |
04:16:40 | * | Maksimilan joined #nim |
04:18:06 | Maksimilan | hi |
04:21:24 | Amun-Ra | same https://play.nim-lang.org/#ix=4Kuz |
04:32:37 | NimEventer | New 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:10 | om3ga | How 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:40 | FromDiscord | <Elegantbeef> just bitshift and use bitwise ops |
07:30:12 | om3ga | Elegantbeef, right! thanks! |
07:30:27 | FromDiscord | <Elegantbeef> Using pointer arithmetic to set individual bytes on a integer lies madness |
07:30:59 | FromDiscord | <Chronos [She/Her]> Nah, I think it's a great idea |
07:31:52 | om3ga | I'm not happy too, othervise I cannot get proper value from mmap-ed stream |
07:33:27 | FromDiscord | <Chronos [She/Her]> I was joking lol, but why isn't that working for you? |
07:33:59 | * | redj joined #nim |
07:34:48 | om3ga | the lib faststreams reads only one byte, if I'm not mistaken :) |
07:35:08 | om3ga | trying to adopt it for reading pcaps, for test |
07:35:28 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kv0 |
07:35:34 | FromDiscord | <Chronos [She/Her]> In reply to @om3ga "trying to adopt it": Ah fair |
07:35:44 | FromDiscord | <Elegantbeef> Nice you've printed the first 4 bytes over and over again 😛 |
07:35:53 | FromDiscord | <Elegantbeef> Well first byte |
07:35:54 | FromDiscord | <Elegantbeef> first 8 bits 😄 |
07:36:29 | FromDiscord | <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:23 | FromDiscord | <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:34 | FromDiscord | <Chronos [She/Her]> Shit lol |
08:15:33 | FromDiscord | <4zv4l> is it possible to get runtime variable for padding in format string ?↵like in C with `printf("%s", 10, str)` ? |
08:16:19 | FromDiscord | <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:01 | FromDiscord | <griffith1deadly> proc printf(...) {.importc.} 🥺 |
08:36:42 | * | xet7 joined #nim |
08:45:23 | FromDiscord | <4zv4l> thats what I did but the nim format system doesnt allow that ? |
09:14:56 | Amun-Ra | iirc no |
09:16:45 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4Kvs |
09:16:59 | FromDiscord | <nnsee> from [the nim manual](https://nim-lang.org/docs/manual.html#types-cstring-type) |
09:17:37 | FromDiscord | <nnsee> In reply to @4zv4l "thats what I did": mentioning so you get pinged too |
09:18:00 | Amun-Ra | right, but you have to convert everything to ctypes |
09:18:25 | Amun-Ra | let me write matching example |
09:20:13 | Amun-Ra | https://play.nim-lang.org/#ix=4Kvt |
09:20:43 | Amun-Ra | and problem stats when you decide to make variadic nim proc |
09:20:46 | Amun-Ra | starts |
09:21:40 | FromDiscord | <nnsee> https://play.nim-lang.org/#ix=4Kvu |
09:21:41 | FromDiscord | <nnsee> ? |
09:21:46 | FromDiscord | <nnsee> i'm not too sure what you mean |
09:22:41 | Amun-Ra | fixed number of arguments and fixed format string |
09:23:25 | FromDiscord | <nnsee> can you give an example where it doesn't work? |
09:23:59 | Amun-Ra | let's say I want to have and equivalent of fmt"" |
09:24:38 | Amun-Ra | and I need to write the body of proc myformat(format: string, args: varargs[`$`, string]) |
09:24:39 | FromDiscord | <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:33 | Amun-Ra | we had a joke in C channel, "it compiles and runs, now… what's a SIGSEGV?" ;) |
09:26:42 | Amun-Ra | int and cint sizes do not match |
09:26:48 | Amun-Ra | printf expects cint |
09:27:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "that warning indicates you're": How ? A thread isn't supposed to be blocking |
09:28:06 | Amun-Ra | tbh, I'd use sprintf for that |
09:29:23 | FromDiscord | <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:28 | FromDiscord | <nnsee> TIL |
09:29:33 | FromDiscord | <nnsee> no clue where i got that idea from |
09:29:49 | Amun-Ra | hmm |
09:30:28 | Amun-Ra | tbh that'd be doable but in case of format strings it would require format introspection |
09:30:54 | FromDiscord | <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:44 | Amun-Ra | yes, [c]strings are fine |
09:32:04 | FromDiscord | <nnsee> ah, i see, for some reason i assumed that extended to other types too |
09:33:47 | Amun-Ra | I'm overpedantic in my code regarding this dept. ;) |
09:35:53 | Amun-Ra | but I have to do explicit converts in my libraries calling C ABI - I use dlopen exclusively |
09:35:58 | Amun-Ra | see https://github.com/amnr/dlsdl2/ for example |
09:36:26 | Amun-Ra | that'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:42 | Amun-Ra | (gtk[2-4], x11, xcb are wip) |
09:59:37 | FromDiscord | <nnsee> nice! |
10:02:52 | Amun-Ra | thanks :) |
10:25:18 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KvN |
10:27:27 | Amun-Ra | https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html#interacting-with-code-call-javascript-from-native |
10:27:56 | Amun-Ra | so it should be sth like: |
10:28:18 | Amun-Ra | EM_ASM "console.log($0);", "foo" |
10:30:41 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KvO |
10:33:57 | Amun-Ra | hmm |
10:34:24 | Amun-Ra | that has a different prototype, how about: EM_ASM "console.log('foo');" |
10:35:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "that has a different": I think it will just print "foo" |
10:36:17 | Amun-Ra | yes, I mean: macro EM_ASM␝(code: static[string], args: varargs[typed]) vs template EM_ASM(code: static[string]) |
10:37:07 | Amun-Ra | I never used wasm before, got to go running, good luckk |
10:57:15 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4KvZ |
10:58:06 | FromDiscord | <aintea> Even after copy pasting the expected type into the parameter type, I still get the error |
11:04:07 | PMunch | Hmm, 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:23 | FromDiscord | <odexine> `(func (x: uint): bool = ` -> `(func (x: uint): bool {.closure.} = ` |
11:04:51 | PMunch | I currently use the first kind, explicitly making it an array of an enum. But that means I can shuffle messages on accident |
11:04:55 | FromDiscord | <odexine> In reply to @PMunch "Hmm, there's no way,": i believe that is the case |
11:05:26 | FromDiscord | <aintea> In reply to @odexine "`(func (x: uint): bool": What ? why this ? |
11:05:27 | FromDiscord | <aintea> (edit) "?" => "?" |
11:05:38 | PMunch | With 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:46 | FromDiscord | <odexine> In reply to @aintea "What ? why this": function types `(uint) -> bool` are closures by default IIRC |
11:07:24 | FromDiscord | <odexine> i dont remember the rules for l-value definitions |
11:07:28 | FromDiscord | <odexine> (edit) "i dont remember the rules for l-value ... definitions" added "function" |
11:07:41 | FromDiscord | <odexine> but it seems in this case it defaults to nimcall |
11:42:12 | PMunch | https://peterme.net/labelled-exceptions-for-smoother-error-handling.html |
11:57:53 | * | edr joined #nim |
11:59:12 | FromDiscord | <nnsee> nice |
12:04:57 | FromDiscord | <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:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kwl |
12:11:28 | FromDiscord | <Phil> How does that work under the hood btw? Do you generate an enum over all the Labels on the fly? |
12:11:46 | FromDiscord | <Phil> (edit) "fly?" => "fly which the user then can do a switch case over?" |
12:12:00 | om3ga | @Сhronos template bytesToT[T] (bytes: seq[byte]): T = var result: T for i in 0..<s |
12:12:04 | om3ga | izeof(T): |
12:12:04 | om3ga | result = cast[T](result or bytes[i].T shl (i * 8)) |
12:12:04 | om3ga | result |
12:12:04 | om3ga | var |
12:12:04 | om3ga | seqByte1: seq[byte] = @[0x0A, 0x00, 0x00, 0x00] |
12:12:06 | om3ga | seqByte2: seq[byte] = @[0x14, 0x00] |
12:12:09 | om3ga | seqByte3: seq[byte] = @[0x1E, 0x00, 0x00, 0x00] |
12:12:11 | om3ga | var uint32Res: uint32 = bytesToT[uint32](seqByte1) |
12:12:14 | om3ga | var uint16Res: uint16 = bytesToT[uint16](seqByte2) |
12:12:16 | om3ga | var int32Res: int32 = bytesToT[int32](seqByte3) |
12:12:19 | om3ga | echo uint32Res |
12:12:21 | om3ga | echo uint16Res |
12:12:24 | om3ga | whoops, sorry |
12:12:32 | om3ga | https://play.nim-lang.org/#ix=4Kwm |
12:13:47 | om3ga | Elegantbeef, this works, while when I add this template, it won't work with pcapLib wiritten by PMunch |
12:14:01 | om3ga | seems I need more coffeine |
12:15:26 | om3ga | another variant, using copyMem : https://play.nim-lang.org/#ix=4Kwp |
12:17:32 | om3ga | I made a mistake in second variant, forgot to shift addr where it copies from src |
12:17:35 | FromDiscord | <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:36 | om3ga | ignore it |
12:18:44 | FromDiscord | <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:28 | FromDiscord | <pmunch> Oh yeah, I meant the user code in those branches |
12:20:01 | FromDiscord | <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:16 | FromDiscord | <Phil> Just different text |
12:20:33 | FromDiscord | <Phil> Would that be a correct understanding? |
12:20:53 | FromDiscord | <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:09 | FromDiscord | <pmunch> Yes, that's exactly my assumption |
12:22:44 | FromDiscord | <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:33 | FromDiscord | <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:01 | FromDiscord | <nnsee> you should definitely use the string output for that purpose and the corresponding verification function |
12:26:58 | FromDiscord | <Chronos [She/Her]> Aah alright, thanks Ras! |
12:42:16 | FromDiscord | <griffith1deadly> i can safe pass nim gc types to nim dll? like seq's |
12:48:29 | FromDiscord | <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:49 | FromDiscord | <Chronos [She/Her]> If that's the case, look at NimRTL, because otherwise there will be many issues with the GC |
12:50:23 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Can you elaborate? Is": yes, nim dll loaded by nim program |
12:53:26 | FromDiscord | <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:43 | FromDiscord | <Asbjørn> sent a long message, see http://ix.io/4KwL |
13:09:12 | FromDiscord | <Asbjørn> sent a long message, see http://ix.io/4KwM |
13:10:19 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "even with arc/orc?": Yep |
13:11:09 | FromDiscord | <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:04 | FromDiscord | <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:42 | FromDiscord | <nnsee> wellll, this is a bit of an XY problem |
13:13:47 | FromDiscord | <nnsee> you should modify your code to expect an `openArray` instead of a `seq[byte]` - that way, no conversion is necessary |
13:14:33 | FromDiscord | <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:28 | FromDiscord | <Asbjørn> sent a long message, see http://ix.io/4KwP |
13:35:08 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Yep": and all my defined api for dll should use unsafe code like ptr? |
13:36:24 | FromDiscord | <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:48 | FromDiscord | <Chronos [She/Her]> Which allows for you to pass objects through shared libraries safely, iirc |
13:37:17 | FromDiscord | <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:43 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Which allows for you": then i can use no unsafe pointers? |
13:39:43 | FromDiscord | <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:40 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Then you can just": then that's great! ty! |
13:41:53 | FromDiscord | <griffith1deadly> -d:useNimRtl need to be as compile flag both for application and library? |
13:44:39 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/4KwX |
13:44:48 | FromDiscord | <4zv4l> (edit) "http://ix.io/4KwX" => "http://ix.io/4KwY" |
13:45:17 | FromDiscord | <Chronos [She/Her]> Yep |
13:45:43 | FromDiscord | <nnsee> In reply to @4zv4l "Hi, thanks for that": ah, right |
13:45:48 | FromDiscord | <nnsee> no clue, sorry |
13:45:53 | FromDiscord | <nnsee> not something i've used myself |
13:47:55 | NimEventer | New 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:34 | NimEventer | New thread by GyatsoYT: Error: type mismatch: got <array[1..6, int], int>, see https://forum.nim-lang.org/t/10585 |
15:06:34 | NimEventer | New thread by PMunch: Labelled exceptions for smoother error handling, see https://forum.nim-lang.org/t/10586 |
15:07:43 | NimEventer | New 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:08 | FromDiscord | <nnsee> @gyatsoyt you're better off posting the full error message instead of just the line |
15:11:22 | FromDiscord | <nnsee> the entire message is relevant, as it shows what it was actually expecting |
15:14:01 | PMunch | @nnsee, that's a forum message, not sure they'll see your reply here |
15:14:42 | FromDiscord | <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:11 | om3ga | has anybodu tried faststreams previously? Can't integrate it. Reads totally different values of bytes :\ |
15:40:13 | FromDiscord | <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:36 | FromDiscord | <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:43 | FromDiscord | <nnsee> although it feels incredibly fragile |
15:42:03 | FromDiscord | <jviega> Yeah, I'm fine with the object copy if there's no syntax for it, but ugh |
15:43:06 | FromDiscord | <gyatsoyt> In reply to @nnsee "the entire message is": Well its too big to copy but I'll try |
15:43:14 | FromDiscord | <gyatsoyt> Cz I am on phone |
15:44:09 | FromDiscord | <nnsee> what? why? |
15:44:15 | FromDiscord | <nnsee> just use pastebin or something |
15:47:34 | FromDiscord | <nnsee> or like |
15:47:46 | FromDiscord | <nnsee> you pasted the entire code, can't you just paste the error? |
15:47:56 | FromDiscord | <nnsee> i'm not sure i'm understanding here 😅 |
15:48:11 | FromDiscord | <gyatsoyt> In reply to @nnsee "you pasted the entire": https://srcb.in/TlVV21tLcE |
15:48:13 | FromDiscord | <gyatsoyt> Here take it |
15:48:17 | FromDiscord | <gyatsoyt> This is the whole error |
15:48:56 | FromDiscord | <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:13 | FromDiscord | <nnsee> i have to run right now and can't look at it, but maybe add that error to the forum post |
15:49:20 | FromDiscord | <nnsee> people will be able to help better |
15:49:22 | FromDiscord | <gyatsoyt> Ok |
16:01:58 | NimEventer | New 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:49 | FromDiscord | <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:07 | FromDiscord | <Phil> waiting for nimble? |
16:29:16 | FromDiscord | <Phil> Oh, as in, the package repo |
16:31:36 | FromDiscord | <Phil> Say no more, on it |
16:32:15 | FromDiscord | <jviega> Lol |
16:32:40 | FromDiscord | <jviega> Thanks |
16:34:05 | FromDiscord | <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:20 | NimEventer | New Nimble package! nostr - NOSTR Protocol implementation., see https://github.com/theAkito/nim-nostr |
16:35:20 | NimEventer | New Nimble package! cap10 - A tool to capture and replay command line terminal sessions, see https://github.com/crashappsec/cap10 |
16:39:44 | om3ga | sometimes is very important to read issues, and I would not spend whole day to deal with it: |
16:39:56 | om3ga | https://github.com/status-im/nim-faststreams/issues/39 |
16:40:01 | om3ga | damn haha |
16:41:48 | FromDiscord | <Phil> I read the issue and given my unfamiliarity of in-depth IO knowledge I basically understood nothing 😅 |
16:42:07 | FromDiscord | <Phil> (edit) "I read the issue and given my unfamiliarity of in-depth IO knowledge ... I" added "and memory-management" |
16:42:39 | FromDiscord | <Phil> Basically a use after free because ORC collects a stream before its fully read? |
16:42:51 | om3ga | I spent whole day to use memFileInput |
16:42:52 | FromDiscord | <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:21 | NimEventer | New Nimble package! anycallconv - A macro to create special procedural types for parameters., see https://github.com/sls1005/anycallconv |
16:57:28 | NimEventer | New thread by tcheran: Trying to parallelize zippy file extraction on Windows, see https://forum.nim-lang.org/t/10588 |
17:33:14 | FromDiscord | <System64 ~ Flandre Scarlet> @_gumbercules↵Is it normal I can't interact with the DOM with Emscripten ? |
17:35:00 | * | krux02 joined #nim |
17:48:16 | Amun-Ra | you can; EM_ASM_* |
17:50:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kym |
17:52:19 | FromDiscord | <Phil> Could be the code runs before the document is initialized? |
17:52:34 | FromDiscord | <Phil> Note I don't know jack about emscripten, this is me guessing |
17:52:48 | Amun-Ra | import std/jsffi |
17:52:53 | Amun-Ra | var document* {.importc, nodecl.}: JsObject |
17:53:29 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "var document* {.importc, nodecl.}:": Does it work with Emscripten ? |
17:53:40 | Amun-Ra | good question |
17:53:57 | Amun-Ra | I used emscripten a few times, not even once with nim |
17:54:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/oblxm |
17:57:01 | Amun-Ra | I have to write something with nim+emcc combo |
17:58:18 | FromDiscord | <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:35 | FromDiscord | <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:14 | om3ga | why proc mmsReadData(s: Stream, buffer: pointer, bufLen: int): int , not exported? |
18:44:42 | om3ga | or how to read bytes from newMemMapFileStream? |
18:44:50 | FromDiscord | <Yardanico> import std/streams |
18:44:53 | FromDiscord | <Yardanico> and use the generic streams procs |
18:45:08 | FromDiscord | <Yardanico> e.g. <https://nim-lang.org/docs/streams.html#readData%2CStream%2Cpointer%2Cint> |
18:45:10 | om3ga | Yardanico, I need mmap |
18:45:19 | FromDiscord | <Yardanico> In reply to @om3ga "<@177365113899057152>, I need mmap": again, it's a generic interface to streams |
18:45:34 | NimEventer | New Nimble package! zoominvitr - Automatically send invitations regarding planned Zoom meetings., see https://github.com/theAkito/zoominvitr |
18:45:34 | FromDiscord | <Yardanico> memfiles just provides an implementation of an interface that you can use with streams' procs |
18:45:59 | FromDiscord | <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:24 | FromDiscord | <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:35 | om3ga | Yardanico, you mena readData? |
18:47:03 | om3ga | will readData accept newMemMapFileStream? |
18:47:06 | FromDiscord | <Yardanico> yes, it's defined for the generic Stream object so it will actually call the internal implementation of mmsReadData |
18:47:14 | FromDiscord | <Yardanico> In reply to @om3ga "will readData accept newMemMapFileStream?": yes, it will, that's the whole point of std/streams |
18:47:45 | om3ga | Thanks, I will try again, but I doubt. because for some reason it not work |
18:49:12 | FromDiscord | <Yardanico> works just fine |
18:49:14 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyQ |
18:50:26 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyR |
18:51:01 | om3ga | I need to read byte |
18:51:02 | om3ga | :) |
18:51:05 | om3ga | not the line |
18:51:34 | FromDiscord | <Yardanico> then you just use the different procs from std/streams, they all work |
18:51:58 | om3ga | well, I get type mismatch |
18:52:03 | FromDiscord | <Yardanico> with what code? |
18:52:22 | FromDiscord | <Yardanico> here's my second example but with sequences: |
18:52:26 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/sEzKf |
18:52:41 | om3ga | https://play.nim-lang.org/#ix=4KyT |
18:53:07 | om3ga | https://play.nim-lang.org/#ix=4KyV |
18:53:18 | FromDiscord | <Yardanico> you need to point to the address of it for char |
18:53:31 | om3ga | with .addr is the same |
18:53:39 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyW |
18:54:20 | om3ga | also this: https://play.nim-lang.org/#ix=4KyX |
18:54:57 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyY |
18:54:58 | FromDiscord | <Yardanico> again, this works |
18:55:01 | FromDiscord | <Yardanico> with `addr` |
18:55:18 | FromDiscord | <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:27 | FromDiscord | <Yardanico> oh right, and you don't need to reimplement the wheel actually |
18:56:29 | FromDiscord | <Yardanico> <https://nim-lang.org/docs/streams.html#read%2CStream%2CT> exists |
18:56:55 | om3ga | very strange |
18:57:20 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4KyZ |
18:58:42 | om3ga | https://i.imgur.com/dfLWuxS.png |
18:59:09 | FromDiscord | <Yardanico> how are you calling it? |
18:59:26 | FromDiscord | <Yardanico> and you did import `std/streams` as I said, right? |
18:59:54 | om3ga | yes! |
18:59:56 | om3ga | :) |
19:00:10 | FromDiscord | <Yardanico> well, then I don't know without some more complete code and the full error |
19:00:10 | om3ga | I had it from beginning |
19:00:18 | FromDiscord | <Yardanico> can you make a small self-contained example that doesn't compile for you? |
19:00:26 | FromDiscord | <Yardanico> and yeah, show how `readData` is called |
19:00:38 | om3ga | yes, I just copy/patsed your example |
19:00:52 | om3ga | something weird here |
19:01:09 | om3ga | reboot... |
19:01:13 | FromDiscord | <Yardanico> can you copy and paste my example into a separate nim file and run it? |
19:01:21 | FromDiscord | <Yardanico> because the screenshot you sent shows over 100 lines |
19:01:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @om3ga "https://i.imgur.com/dfLWuxS.png": I like this theme↵Which one is it ? |
19:01:38 | om3ga | of course I pasted it to separate file :) |
19:02:06 | FromDiscord | <Yardanico> so can you just do `nim c file.nim` and show the complete output ? |
19:02:32 | om3ga | System64 ~ Flandre Scarlet: Material Theme High Contrast |
19:02:45 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @om3ga "System64 ~ Flandre Scarlet:": Alright, thanks ! |
19:03:00 | om3ga | Yardanico, same type mismatch |
19:03:09 | FromDiscord | <Yardanico> yes, but can you show the entire output? |
19:03:14 | FromDiscord | <Yardanico> and what's your nim version? |
19:03:32 | om3ga | you mean verbose compiling printout? |
19:03:45 | FromDiscord | <Yardanico> no, just the usual compiler output you get, the whole one |
19:03:49 | om3ga | let me reboot, something weird here with this wsl |
19:03:54 | FromDiscord | <Yardanico> from the command you run to the compiler exiting |
19:09:24 | om3ga | ssd died |
19:10:03 | FromDiscord | <Yardanico> lol |
19:10:47 | om3ga | good that I have code backup |
19:22:02 | Amun-Ra | System64: I made working example, https://play.nim-lang.org/#ix=4Kzd |
19:23:29 | Amun-Ra | https://play.nim-lang.org/#ix=4Kze |
19:33:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "https://play.nim-lang.org/#ix=4Kze": Is it possible to pass arguments? |
19:34:12 | Amun-Ra | make a string |
19:36:09 | Amun-Ra | \0 should be really \\0 |
19:36:27 | Amun-Ra | this is a quick and dirty poc |
19:37:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "make a string": You mean string interpolation? |
19:37:30 | Amun-Ra | ah, no, arguments won't work, that will require changing second argument to emscripten_asm_const_int |
19:38:26 | FromDiscord | <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:27 | Amun-Ra | but there's an alternative - make a few export "C" functions and call them from js |
19:40:17 | Amun-Ra | either via some event (I've never done it) or simple polling |
19:40:57 | FromDiscord | <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:19 | om3ga | Yardanico, thanks, it works |
19:42:26 | Amun-Ra | System64: there's a way - https://github.com/bytecodealliance/wasm-micro-runtime/issues/263 |
19:43:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: there's a way": Sounds interesting |
19:44:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Kzn |
19:44:40 | FromDiscord | <System64 ~ Flandre Scarlet> And the wav export https://media.discordapp.net/attachments/371759389889003532/1169361383532540034/message.nim?ex=65551fa7&is=6542aaa7&hm=cd08832b7067efe35b47d44092aaacbe10ade3213ef115a7475c57116580b1e6& |
19:47:11 | FromDiscord | <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:04 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Kzq |
19:51:47 | Amun-Ra | System64: how about: trigger input file's click from wasm, then call wasm export c function from js and retrieve the data |
19:52:18 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Kzt |
19:52:34 | FromDiscord | <Elegantbeef> Why not `when defined(foo): import std/strformat`? |
19:52:39 | FromDiscord | <Elegantbeef> You can also just do `import std/strformat{.used.}` |
19:53:23 | FromDiscord | <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:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: how about: trigger": Wdym? |
19:54:14 | FromDiscord | <griffith1deadly> In reply to @demotomohiro "Thank you, but I": then like beef said: import std/strformat{.used.} |
19:54:29 | Amun-Ra | call {document.querySelector("#element)".click();} |
19:55:26 | Amun-Ra | element being input file with onclick hooked to the function that'll call wasm function |
19:56:38 | FromDiscord | <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:58 | Amun-Ra | that does not matter |
19:57:20 | FromDiscord | <demotomohiro> @ElegantBeef, @griffith1deadly I tried that `{.used.}` pragma but I got compile error.↵https://play.nim-lang.org/#ix=4Kzw |
19:57:36 | Amun-Ra | the button you're talking about triggers the process, the button i'm talking about triggers the download |
19:58:10 | FromDiscord | <Elegantbeef> Hmm odd |
19:58:23 | FromDiscord | <Elegantbeef> Swore we could use used on a import |
19:58:28 | FromDiscord | <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:53 | Amun-Ra | only the click trigger |
20:00:14 | * | om3ga joined #nim |
20:00:20 | FromDiscord | <demotomohiro> `import std/strformat{.used.}` still result in compile error even with nightly build devel Nim. |
20:00:37 | FromDiscord | <Elegantbeef> Yea I guess I just misremembered |
20:00:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "only the click trigger": Oh alright, and the rest? |
20:01:09 | Amun-Ra | FromDiscord: and the rest is calling {.exportc.} function from js, the function that returns the buffer |
20:02:42 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "FromDiscord: and the rest": Ah alright↵Do you have a small exemple please? |
20:03:02 | Amun-Ra | no, unfortunately |
20:06:38 | FromDiscord | <System64 ~ Flandre Scarlet> But the exportC proc can only return one value, right? |
20:09:59 | Amun-Ra | you can return const char*, that I know |
20:10:29 | FromDiscord | <Elegantbeef> Depending on the runtime you can return multiple values |
20:10:46 | FromDiscord | <Elegantbeef> But multiple return values is not presently standard and is just in a RFC iirc |
20:11:45 | Amun-Ra | (writing wasm target to my image browser is still ahead of me) |
20:12:42 | Amun-Ra | so quick (and dirty method) is: base64 it in wasm, return as string, decode on js side ;) |
20:13:18 | FromDiscord | <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:45 | Amun-Ra | yes |
20:14:08 | FromDiscord | <System64 ~ Flandre Scarlet> So, JS can't call this proc |
20:14:43 | Amun-Ra | yes |
20:15:05 | FromDiscord | <System64 ~ Flandre Scarlet> 🤯 |
20:15:31 | Amun-Ra | I mean you're right |
20:15:39 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Kzx |
20:16:59 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> Right demo the module isn't used until the end |
20:17:43 | FromDiscord | <Elegantbeef> you likely need to make an intermediate module |
20:18:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Kzy |
20:18:15 | FromDiscord | <Elegantbeef> Something like that might not give a warning |
20:18:44 | Amun-Ra | System64, not really, you'll need something like this on JS side either way: https://gist.github.com/TrevorSundberg/74dc4f576b94d19711a4547dcf04af40 |
20:20:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64, not really, you'll": so WASM needs to call this, right? |
20:20:32 | Amun-Ra | yes |
20:20:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "yes": Makes sense↵But I'll have the document error |
20:21:05 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KzA |
20:21:20 | Amun-Ra | System64: what do you need document for? |
20:21:30 | FromDiscord | <takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4KzA" => "https://play.nim-lang.org/#ix=4KzB" |
20:21:41 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: what do you": ``const a = document.createElement('a')`` DOM manipulation |
20:21:52 | FromDiscord | <takemichihanagaki3129> In reply to @Amun-Ra "System64: what do you": A variable availabe at the top of my module. |
20:21:53 | Amun-Ra | System64: do it on js side |
20:22:00 | FromDiscord | <takemichihanagaki3129> (edit) "availabe" => "available" |
20:22:36 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzC |
20:22:41 | FromDiscord | <System64 ~ Flandre Scarlet> (this is just an exemple) |
20:23:08 | FromDiscord | <takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4KzD |
20:23:09 | Amun-Ra | takemichihanagaki3129: run this with nim doc and check which text is being displayed |
20:23:31 | FromDiscord | <takemichihanagaki3129> In reply to @Amun-Ra "<@890300313729400832>: run this with": ok, then! 😉 |
20:23:43 | Amun-Ra | System64: write function on js side and call the function |
20:23:55 | FromDiscord | <takemichihanagaki3129> (edit) "https://play.nim-lang.org/#ix=4KzD" => "https://play.nim-lang.org/#ix=4KzE" |
20:24:11 | Amun-Ra | takemichihanagaki3129: I vote for position 3 with one ident added |
20:24:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: write function on": Oh alright, on the HTML page for exemple? |
20:24:40 | Amun-Ra | mhm |
20:25:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzF |
20:25:42 | FromDiscord | <System64 ~ Flandre Scarlet> Or maybe I did it the wrong way |
20:34:38 | FromDiscord | <takemichihanagaki3129> In reply to @Amun-Ra "<@890300313729400832>: I vote for": I tested, position 3 is tthe right one! Thanks a lot! |
20:35:11 | FromDiscord | <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:47 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KzJ |
20:50:07 | FromDiscord | <user2m> nvm chatgippity set me straight |
20:50:14 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KzL |
20:53:39 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4KzP |
20:53:44 | FromDiscord | <System64 ~ Flandre Scarlet> from JsBind |
20:54:35 | FromDiscord | <leorize> can you link the source? |
20:55:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @leorize "can you link the": https://github.com/yglukhov/jsbind/blob/master/jsbind/emscripten_api.nim |
20:58:32 | FromDiscord | <leorize> it generates an importc version of your proc, and custom code to export the actual one you wrote |
20:59:14 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @leorize "it generates an importc": Oh, so it doesn't use JS ? |
21:00:07 | FromDiscord | <demotomohiro> @ElegantBeef Thank you! It worked. |
21:02:05 | FromDiscord | <leorize> in JS backend it will import the JS proc |
21:02:06 | FromDiscord | <leorize> importc is just import a proc without mangling its name↵(@System64 ~ Flandre Scarlet) |
21:10:15 | * | jmdaemon joined #nim |
21:16:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @leorize "importc is just import": Oh alright |
21:17:42 | FromDiscord | <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:49 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> Yea wasm has no direct access to DOM |
21:23:46 | * | madprops left #nim (Leaving) |
21:24:25 | FromDiscord | <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:36 | FromDiscord | <System64 ~ Flandre Scarlet> And I use Emscripten with WASM |
21:24:56 | FromDiscord | <nnsee> you can't save files to disk even using plain js |
21:25:09 | FromDiscord | <nnsee> best you can get is localstorage |
21:25:11 | FromDiscord | <Elegantbeef> Localstorage api exists |
21:25:20 | FromDiscord | <Elegantbeef> Damn one step ahead of me! |
21:25:39 | FromDiscord | <Elegantbeef> Wait no there is another api for actual file access |
21:25:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @nnsee "best you can get": Yeah but I want the popup window with the file explorer |
21:26:04 | FromDiscord | <nnsee> well you can do that with some effort |
21:26:04 | FromDiscord | <System64 ~ Flandre Scarlet> where the user can tell file's name and destination |
21:26:14 | FromDiscord | <nnsee> just need to interface with the js side |
21:26:30 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @nnsee "just need to interface": yeah this is where I don't understand |
21:27:18 | FromDiscord | <nnsee> have a look at https://developer.mozilla.org/en-US/docs/WebAssembly/Using_the_JavaScript_API |
21:29:23 | FromDiscord | <JJ> ty for the uxn pr btw beef |
21:29:34 | FromDiscord | <Elegantbeef> Cheers |
21:29:49 | FromDiscord | <JJ> i am currently unfortunately dying with school but will get back around to it at Some Point (tm) |
21:30:46 | FromDiscord | <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:11 | FromDiscord | <nnsee> yes |
21:31:31 | FromDiscord | <nnsee> it's not trivial per se, but it's not, like, incredibly hard either |
21:31:32 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1169388276755484742/image.png?ex=655538b3&is=6542c3b3&hm=90f23763346458676a06d44c0e40c1d5b672e11107ba6f23079a6f54008be4ae& |
21:32:05 | FromDiscord | <Elegantbeef> Well @JJ atleast my PR is simple and should be easily merged 😛 |
21:32:47 | FromDiscord | <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:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @nnsee "have a look at": Seems it doesn't show the C/C++ sie |
21:44:38 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "sie" => "sidee" |
21:44:40 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "sidee" => "side" |
21:58:39 | * | neceve quit (Ping timeout: 240 seconds) |
22:00:22 | FromDiscord | <System64 ~ Flandre Scarlet> I don't understand why Emscripten doesn't allow to directly manipulate the DOM |
22:02:52 | FromDiscord | <takemichihanagaki3129> Are `--passL` passed to `gcc` or `ld`?↵If yes, does this mean that I don't need to use `-Wl, option`? |
22:03:11 | FromDiscord | <takemichihanagaki3129> (edit) "yes," => "`ld`," |
22:04:32 | FromDiscord | <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:53 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4KA4 |
22:06:07 | FromDiscord | <user2m> `document.getElementByID(id)` only returns an Element |
22:06:39 | FromDiscord | <user2m> `InputElement {.importc.} = ref object of Element` |
22:28:02 | FromDiscord | <Chronos [She/Her]> `Option[tuple[github: Option[Secret]]]` is this redundant or? |
22:28:51 | FromDiscord | <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:06 | FromDiscord | <Chronos [She/Her]> If any at all |
22:30:52 | FromDiscord | <intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4KAe |
22:31:03 | FromDiscord | <intellij_gamer> (edit) "https://play.nim-lang.org/#ix=4KAe" => "https://play.nim-lang.org/#ix=4KAf" |
22:37:13 | FromDiscord | <Chronos [She/Her]> Hm, wondering if I should use std's logging library or a different one |
22:37:30 | FromDiscord | <Chronos [She/Her]> All I want is coloured output to the terminal for logging tbh |
22:39:57 | FromDiscord | <Elegantbeef> You can easily modify the stdlib logging to do that |
22:40:43 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/logging.nim super simple logger setup using stdlib |
22:43:28 | FromDiscord | <Chronos [She/Her]> Oh epic! Why a `method` though? Any particular reason? |
22:43:48 | FromDiscord | <Chronos [She/Her]> Is that just how the stdlib works? |
22:45:02 | FromDiscord | <Elegantbeef> The stdlib uses method dispatch for overriding since it uses runtime polymorphism |
22:45:09 | FromDiscord | <Elegantbeef> You can have multiple loggers hooked at once |
22:46:09 | FromDiscord | <Chronos [She/Her]> Epic, thanks! |
22:47:34 | FromDiscord | <takemichihanagaki3129> In reply to @takemichihanagaki3129 "Are `--passL` passed to": @ElegantBeef, do you know this answer? |
22:47:53 | FromDiscord | <Elegantbeef> `--passL` is passed to the linker |
22:49:02 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "`--passL` is passed to": So, do I need to use `-Wl`? like `--passL:"-Wl, ..."` |
22:49:49 | FromDiscord | <Elegantbeef> No clue what `-Wl` is |
22:50:04 | FromDiscord | <Chronos [She/Her]> Is it a bad idea to make a global for logging? Lol |
22:50:24 | FromDiscord | <Chronos [She/Her]> Wait I don't even need to do that |
22:50:27 | FromDiscord | <Elegantbeef> That's what stdlib uses |
22:50:56 | FromDiscord | <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:01 | FromDiscord | <takemichihanagaki3129> (edit) "linke↵↵source:" => "linker↵↵source:" |
22:51:13 | FromDiscord | <Elegantbeef> You don't need `-Wl` then |
22:51:36 | FromDiscord | <Elegantbeef> If you want to supply other linker arguments you can just pass them using `--passL` |
22:53:39 | FromDiscord | <takemichihanagaki3129> In reply to @Elegantbeef "If you want to": Thanks a lot! |
23:02:16 | * | jmdaemon quit (Ping timeout: 255 seconds) |