00:20:00 | * | pch joined #nim |
00:20:29 | pch | how again do I round a float and then place it into an integer type |
00:21:46 | pch | I want to `var integer: int16 = math.[neededproc](float)` pretty much |
00:22:32 | pch | and google is being absolutely useless since everything I can find assumes you never want to do this ever and should always keep it in the floats haha teehee |
00:24:53 | FromDiscord | <Recruit_main707> https://nim-lang.org/docs/math.html#round%2Cfloat32 |
00:25:19 | FromDiscord | <Recruit_main707> docs and ctrl + f are way more useful than plain google usually |
00:26:23 | FromDiscord | <Recruit_main707> ah, didnt read correctly |
00:26:58 | FromDiscord | <Recruit_main707> but i think you can then just safely cast it:↵`var integer: int16 = round(float).int16` |
00:27:11 | pch | that's not a cast that's a conversion |
00:27:28 | pch | ill do the conversion with reluctance |
00:27:32 | FromDiscord | <Elegantbeef> `cast[int16](myFloat)` |
00:28:00 | FromDiscord | <Elegantbeef> Cast in nim is a bit cast which means it does not give a value close to the input |
00:28:22 | FromDiscord | <Recruit_main707> wait that works? |
00:28:31 | FromDiscord | <Elegantbeef> Why wouldnt it work? |
00:28:58 | FromDiscord | <Elegantbeef> You might need `cast[ptr int16](myFloat.addr)[]` as i think casting like this can be UB |
00:29:17 | FromDiscord | <Elegantbeef> Might be wrong about the UB though |
00:29:59 | FromDiscord | <Recruit_main707> because cast takes the raw bytes, but floats and ints arent represented in the same way afaik |
00:30:38 | FromDiscord | <Elegantbeef> Sure but they asked for a cast not a conversion |
00:30:57 | FromDiscord | <Elegantbeef> They said and i quote "that's not a cast that's a conversion" 😛 |
00:31:35 | FromDiscord | <Recruit_main707> i thought he was just correcting me xD |
00:31:44 | FromDiscord | <Elegantbeef> Ah |
00:32:43 | FromDiscord | <Elegantbeef> You'd round and manually convert it unless you want to write a `converter toInt16(f: float): int16 = int16 f` |
00:33:09 | FromDiscord | <Elegantbeef> Converter is generally to be avoided though, as it causes many headaches |
00:33:20 | FromDiscord | <Recruit_main707> id round it inside the converter |
00:34:03 | FromDiscord | <Recruit_main707> anyways, its clearly too late for solving issues, bye bye |
00:34:11 | FromDiscord | <Elegantbeef> Depends on what you're after i guess |
00:34:30 | FromDiscord | <Elegantbeef> But it's only 18\:34 |
00:34:50 | FromDiscord | <Recruit_main707> 1:34 here :p |
00:37:09 | pch | no I didn't ask for a cast or conversion |
00:37:21 | pch | I asked for a proc that would just result in an integer after rounding |
00:37:43 | pch | but a conversion is fine |
00:37:45 | pch | a cast will not work |
00:38:19 | pch | @Elegantbeef you were slightly off and I was looking at a different window, sorry |
00:38:37 | * | jmdaemon quit (Ping timeout: 240 seconds) |
00:38:44 | pch | a cast will result in a horribly screwed up number that is NOT what I am wanting |
00:40:59 | pch | what I'm doing is that I'm writing performance-imperative code that's going to be run potentially tens of thousands of times a second, in a rasterizer |
00:42:27 | pch | so literally any compiler-optimizable way of turning normalized buffer coords into buffer postions is what I need |
00:44:29 | FromDiscord | <Elegantbeef> Hey i didnt get the first message here! I take no blame 😛 |
00:45:13 | pch | oh it's fine |
00:45:40 | pch | oh, this is a long-time user btw who pops in and out I'm just completely getting rid of my old nick for these purposes |
00:45:46 | pch | previously known as kinkinkijkin |
00:53:55 | NimEventer | New question by itil memek cantik: Nim source file which after it's normalized, see https://stackoverflow.com/questions/71475788/nim-source-file-which-after-its-normalized |
00:57:57 | NimEventer | New thread by Mardiyah: To have source file has been normalized, see https://forum.nim-lang.org/t/9012 |
02:52:44 | nrds | <Prestige99> What's the best way to do something like https://play.nim-lang.org/#ix=3Shp ? I get an error about redefining projectionAxes |
02:53:37 | nrds | <Prestige99> Which I find a bit odd.. |
02:55:45 | FromDiscord | <Elegantbeef> Nim doesnt allow reusing field names |
02:56:07 | FromDiscord | <Elegantbeef> So make one `pProjectionAxes` and the other `rProjectionAxes` with a property |
02:56:34 | nrds | <Prestige99> weird because only one should exist when the object is created, but alright |
02:56:45 | nrds | <Prestige99> just expected this to work 😛 |
02:57:06 | FromDiscord | <Elegantbeef> Well yea but it's a case of `projectionAxes` is ambiguous without knowing the kind statically |
03:00:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/T9Z |
03:01:12 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues/368 there is this RFC |
03:27:53 | pch | oh dear I've just found out that nobody teaches softrast-friendly rasterization methods anymore |
03:28:24 | pch | and instead teaches the dummy complex methods that are faster only if you are running on a massive vector processor |
03:31:57 | * | mahlon quit (Ping timeout: 250 seconds) |
03:34:34 | * | ltriant_ joined #nim |
03:34:50 | * | mahlon joined #nim |
03:35:21 | * | ltriant quit (Ping timeout: 245 seconds) |
03:45:20 | FromDiscord | <Girvo> Hi all 🙂 |
03:46:48 | * | arkurious quit (Quit: Leaving) |
03:46:54 | * | jmdaemon joined #nim |
03:48:27 | FromDiscord | <Girvo> Is there a common Either[L, R] or Result[Ok, Err] type similar to Option[T]? I know there are a couple libraries, was just wondering I guess what the current go-to is for error/result return vals. `(bool, string)` as the return works for what I'm doing right now, but figured I'd ask! |
03:50:41 | FromDiscord | <Elegantbeef> either use `std/options` or one of the libraries, exceptions are how you're "supposed" to do it |
03:51:25 | FromDiscord | <Girvo> Alrighty cheers |
04:03:14 | FromDiscord | <Girvo> I'm having fun writing an AT command response parser right now. Fun, fun, fun... 😭 |
04:04:47 | FromDiscord | <Girvo> Reckon I might write a PEG for it, considering its at least semi-structured. No idea what the performance/memory pressure will be like with it though. Wish me luck! |
04:10:29 | * | slowButPresent quit (Quit: leaving) |
04:11:16 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3ShG |
04:11:21 | FromDiscord | <Girvo> Any obvious thing I'm doing wrong? |
04:13:43 | FromDiscord | <Girvo> `testament r tests/test0.nim` gives the same error |
04:29:41 | FromDiscord | <Girvo> Man even trying to get the old `unittest` module working is proving fun with the crazy `nim.cfg` I have to have for this embedded stuff to work |
04:30:18 | FromDiscord | <Girvo> `C:\nim\lib\std\exitprocs.nim(10, 8) Error: cannot open file: unittest` when I use `--skipCfg -r` on a simple `import unittest` based suite |
04:30:38 | FromDiscord | <Girvo> (edit) "`C:\nim\lib\std\exitprocs.nim(10," => "`C:\Users\JoshGirvin\Code\lithium\lithium\src\tests\test0.nim(1," |
04:31:23 | FromDiscord | <Girvo> If I change it to `import std/unittest` it now "works" but fails on `import locks` somewhere in `exitprocs.nim` -- almost like its broken the `std` prefix being automatically added? |
04:32:11 | * | rockcavera quit (Remote host closed the connection) |
04:38:50 | FromDiscord | <Elegantbeef> Why are you importing `locks`? |
04:38:59 | FromDiscord | <Girvo> I'm not haha |
04:39:02 | * | rockcavera joined #nim |
04:39:02 | * | rockcavera quit (Changing host) |
04:39:02 | * | rockcavera joined #nim |
04:39:06 | FromDiscord | <Girvo> Hence why I'm very confused 😄 |
04:39:22 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3ShK |
04:51:15 | pch | hmm, how again do I make a type that's an array of a programmer-defined size but a very specific contained type |
04:51:34 | pch | and passes its size as an arg |
04:55:08 | FromDiscord | <Elegantbeef> `type MyType[size: static int] = array[size, MyType]` |
04:55:18 | FromDiscord | <Elegantbeef> Sorry that'll not work\: `type MyType[size: static int] = array[size, MyOtherType]` |
05:07:52 | FromDiscord | <Elegantbeef> @Girvo\: what's the config? |
05:08:23 | FromDiscord | <Elegantbeef> Oh the issue is you want `--skipProjCfg:on` |
05:08:25 | FromDiscord | <Elegantbeef> Atleast i think |
05:08:27 | FromDiscord | <Girvo> Ohhhhh |
05:08:27 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=3ShY |
05:08:33 | FromDiscord | <Girvo> Sweet cheers I'll give it a try! |
05:08:46 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/953157790342467614/image.png |
05:08:47 | FromDiscord | <Elegantbeef> Whole lot of them |
05:09:40 | FromDiscord | <Girvo> Okay i'll have a play, cheers |
05:09:58 | FromDiscord | <Girvo> Boom! `skipParentCfg` is what I was after 😄 |
05:10:00 | FromDiscord | <Girvo> Works, cheers! |
05:10:27 | FromDiscord | <Elegantbeef> No problem |
05:12:21 | FromDiscord | <Girvo> Now I can write this damned `pegs` parser for AT commands without pulling my hair out deploying it to the real microcontroller lol |
05:24:25 | FromDiscord | <Elegantbeef> AT commands? |
05:27:07 | * | Guest4 joined #nim |
05:32:19 | * | rockcavera quit (Remote host closed the connection) |
05:33:36 | * | Guest4 quit (Quit: Client closed) |
06:52:22 | FromDiscord | <Generic> pch: normal cpus are vector processors now |
07:12:44 | NimEventer | New Nimble package! argon2_highlevel - A high-level Nim Argon2 password hashing library, see https://github.com/termermc/argon2-highlevel |
07:17:12 | FromDiscord | <Elegantbeef> Congrats termer i now get to criticize your code |
07:18:18 | FromDiscord | <Elegantbeef> Hmm is termer even heree? |
07:43:02 | FromDiscord | <Mysterysib> Hey when I try to install a package I get `In file included from /Users/evan/.cache/nim/balls_r/stdlib_system.nim.c:7:↵/opt/local/lib/nim/lib/nimbase.h:269:10: fatal error: 'limits.h' file not found↵#include <limits.h>`. I know limits.h is in the XCode Developer Tools library on OSX, but what do I modify to get nimble to include it when compiling .C ? |
07:43:38 | FromDiscord | <Mysterysib> Like, the CFlags so I can add -L/path/to/libs to it |
07:44:00 | FromDiscord | <Elegantbeef> `--cincludes:DIR` |
07:45:00 | FromDiscord | <Elegantbeef> Or you can do `--passC:` to pass to the C compiler or `--passL:` to pass to the linker |
07:55:23 | * | PMunch joined #nim |
07:55:40 | FromDiscord | <Mysterysib> Erm, now I get `Undefined symbols for architecture x86_64:↵ "_main", referenced from:↵ implicit entry/start for main executable↵ld: symbol(s) not found for architecture x86_64` What could this possibly mean? |
07:56:14 | FromDiscord | <Elegantbeef> Are you attempting to cross compile on a M1? |
07:56:36 | FromDiscord | <Mysterysib> Nope, simply to compile for my Intel chip |
07:57:31 | FromDiscord | <Elegantbeef> Hmm dont know what to say you're on a modern Nim version right? |
07:57:57 | FromDiscord | <Mysterysib> Yeah, and I tried both clang and gcc |
07:58:32 | FromDiscord | <Elegantbeef> What are you trying to install btw? |
07:58:43 | FromDiscord | <Mysterysib> Oh okay `/usr/bin/clang -c` finally worked. It was a a package |
07:59:01 | FromDiscord | <Mysterysib> Basically using the system clang versus the one I installed using a package manager, and added the -c flag |
07:59:01 | FromDiscord | <Elegantbeef> yea but what package |
07:59:41 | FromDiscord | <Mysterysib> [email protected] |
08:00:14 | FromDiscord | <Mysterysib> Is there a way of specifying the compiler itself to nimble? |
08:00:23 | FromDiscord | <Mysterysib> Because I was debugging using my own commands, not nimble |
08:01:03 | FromDiscord | <Elegantbeef> you can do `--cc` with a shellscript that calls the proper one |
08:02:20 | PMunch | Can't you just set the gcc config variable? |
08:02:30 | FromDiscord | <Elegantbeef> Oh right you can do that too |
08:02:36 | FromDiscord | <Elegantbeef> I was thinking about the zig compiler issue |
08:05:00 | FromDiscord | <Mysterysib> `Error: arguments can only be given if the '--run' option is selected` what does this mean? |
08:05:10 | FromDiscord | <Mysterysib> I tried including --run and I get the same error |
08:05:22 | * | jjido joined #nim |
08:05:31 | FromDiscord | <Elegantbeef> Arguments for install go before the package name i think |
08:05:48 | FromDiscord | <Elegantbeef> Or if this is using nim it's cause you're doing `nim c myFile.nim --someArg` |
08:06:55 | NimEventer | New thread by Oyster: WZeeGird and wChart app on windows are labled as Real Protect-PENGSD5! virus, see https://forum.nim-lang.org/t/9014 |
08:24:14 | FromDiscord | <System64 ~ Flandre Scarlet> How can I put something in the stream please? https://media.discordapp.net/attachments/371759389889003532/953206980720336927/unknown.png |
08:25:07 | FromDiscord | <Elegantbeef> `steam: ptr UncheckedArray[uint8]` |
08:25:16 | FromDiscord | <Elegantbeef> stream\ |
08:25:23 | FromDiscord | <Elegantbeef> then just `stream[i] = val` |
08:26:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "then just `stream[i] =": I don't have i↵In C it looks like that https://media.discordapp.net/attachments/371759389889003532/953207632385179698/unknown.png |
08:27:23 | FromDiscord | <Elegantbeef> I dont know what `>>=` does for a pointer |
08:27:43 | PMunch | x = x shr y |
08:27:49 | FromDiscord | <Elegantbeef> Wait never mind i cant read |
08:27:53 | FromDiscord | <Elegantbeef> It doesnt asign it in that code |
08:28:35 | FromDiscord | <Elegantbeef> `cast[ptr int16](stream)[] = sampleValueInterpolated.int16` |
08:31:32 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Siy |
08:32:23 | PMunch | Well it would be `stream = cast[ptr uint8](cast[int](stream) + 1)` or something similar |
08:32:31 | PMunch | But it would be better to rewrite it to use indexes |
08:33:00 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Well it would be": It's the SDL audio callback |
08:33:11 | PMunch | Okay? |
08:33:44 | PMunch | You should still try to avoid pointer arithmetic when simple indexes will suffice |
08:34:27 | PMunch | fg |
08:34:36 | PMunch | Oops, wrong window |
08:34:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/zpV |
08:36:20 | FromDiscord | <System64 ~ Flandre Scarlet> so it absolutely wants a pointer to uint8 |
08:39:01 | FromDiscord | <Rika> ptr UncheckedArray[uint8] is "equivalent" to ptr uint8 |
08:39:44 | FromDiscord | <System64 ~ Flandre Scarlet> It says that now https://media.discordapp.net/attachments/371759389889003532/953210880328343552/unknown.png |
08:40:06 | FromDiscord | <System64 ~ Flandre Scarlet> for SDL it's not the same thing |
08:40:26 | FromDiscord | <Rika> for your binding it isnt |
08:40:31 | FromDiscord | <Rika> can you control the binding |
08:40:59 | FromDiscord | <System64 ~ Flandre Scarlet> I have 2 SDL bindings, I don't know which is the right one |
08:42:34 | PMunch | You still take in the ptr uint8 argument, but you cast it to a `ptr UncheckedArray[uint8]` in your body |
08:46:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/g1x |
08:46:17 | FromDiscord | <Mysterysib> I got how to set CFLAGS, but now I get the error `ld: library not found for -lm` 😵 |
08:46:35 | FromDiscord | <Mysterysib> No idea where this library even is on OSX, google isn't helping |
08:46:40 | FromDiscord | <Mysterysib> it's just libmath afaik |
08:48:57 | FromDiscord | <Mysterysib> This is the linker error now |
08:49:03 | FromDiscord | <Mysterysib> It does compile to .o files |
08:49:05 | FromDiscord | <Mysterysib> finally |
08:49:23 | PMunch | Can you compile C code on this machine? |
08:49:25 | FromDiscord | <demotomohiro> You have C compiler but don't have standard library looks strange. Maybe your compiler doesn't require `-lm` option to use math.h? |
08:49:32 | FromDiscord | <Mysterysib> Idt it does |
08:49:36 | PMunch | Your C compiler setup seems to be completely broken.. |
08:49:44 | FromDiscord | <Mysterysib> Yeah, I can. I've compiled tons of difficult to compile stuff |
08:49:55 | PMunch | Hmm, weird |
08:49:58 | FromDiscord | <Mysterysib> I believe it is just OSX |
08:50:05 | FromDiscord | <Mysterysib> I never had to specify -lm |
08:50:14 | PMunch | But plenty of other people use Nim on OSX without issues |
08:50:17 | FromDiscord | <Mysterysib> if I leave out the CFlags I'm adding in, it simply calls clang |
08:50:26 | FromDiscord | <Mysterysib> Hmmm |
08:50:53 | FromDiscord | <Mysterysib> Let's try this 😆 mv /usr/local/bin/clang /usr/local/bin/clang.bak |
08:50:54 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:51:26 | FromDiscord | <Elegantbeef> This is where i point out system that C code is just doing indexing in the dumbest way possible |
08:51:27 | PMunch | How did you install Nim? |
08:51:32 | FromDiscord | <Mysterysib> It worked!!!!! |
08:51:36 | FromDiscord | <Rika> 64, you're trying to write a uint16 into a uint8? |
08:51:53 | FromDiscord | <Mysterysib> I got rid of my packaged clang literally by renaming it and it worked without even supplying any additional arguments |
08:52:01 | FromDiscord | <Elegantbeef> It's a for loop that's dumbly written afact |
08:52:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "64, you're trying to": My audio output is int16 |
08:52:53 | FromDiscord | <Rika> but the array is a uint8 array |
08:53:01 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "but the array is": it's my buffer |
08:53:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SiA |
08:53:27 | FromDiscord | <Elegantbeef> The fact it's using a while loop and stupid pointer arithmetic is beside the point |
08:54:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ySv |
08:54:01 | FromDiscord | <Rika> this would break once you change endianness no? lol |
08:54:11 | FromDiscord | <Elegantbeef> Endianess doesnt change locally |
08:54:16 | FromDiscord | <Rika> i know |
08:54:18 | FromDiscord | <Rika> but in another system |
08:54:22 | FromDiscord | <Rika> this wouldnt work |
08:54:23 | FromDiscord | <Elegantbeef> This is for SDL2 audio |
08:54:39 | PMunch | @System64_~_Flandre_Scarlet, but if you do stream++ you go one byte in, and if you then write a uint16 into there you're overriding one of the bytes the last write did.. |
08:54:42 | FromDiscord | <Elegantbeef> Who the fuck is using a BE system with SDL2? |
08:55:12 | FromDiscord | <Rika> In reply to @Elegantbeef "Who the fuck is": i dont like making assumptions like these xd |
08:55:19 | FromDiscord | <Rika> well whatever |
08:56:54 | FromDiscord | <Elegantbeef> That C code was suspect at best |
08:57:18 | FromDiscord | <enthus1ast> what is a "BE" system? |
08:57:22 | FromDiscord | <Rika> big endian |
08:57:23 | FromDiscord | <Elegantbeef> Big endian |
08:57:25 | FromDiscord | <enthus1ast> ah |
08:57:39 | FromDiscord | <Elegantbeef> Only obscure hardware and networking is BE now |
08:58:42 | FromDiscord | <Elegantbeef> Arm and x86 are both LE |
08:58:49 | FromDiscord | <Elegantbeef> Well modern x86 😀 |
08:59:31 | FromDiscord | <demotomohiro> If I remember correctly, play station3 was big endian. |
08:59:41 | FromDiscord | <System64 ~ Flandre Scarlet> bruh cannot compile my C code 'cause undefined reference to WinMain |
08:59:43 | FromDiscord | <Elegantbeef> Powerpc cpu iirc |
09:00:02 | FromDiscord | <Elegantbeef> Yea powerpc was BE |
09:00:11 | FromDiscord | <demotomohiro> Yes, ps3 has powerpc |
09:00:35 | FromDiscord | <Elegantbeef> Hopefully that wasnt you trying to say "See modern CPUs are BE" 😛 |
09:00:48 | FromDiscord | <Generic> even at that time powerpc had a little endian mode |
09:01:07 | FromDiscord | <Generic> same as arm which even at aarch64 still has a big endian mode |
09:01:12 | FromDiscord | <Elegantbeef> Risc-v is also LE, so it's the defacto at this point |
09:01:14 | FromDiscord | <Generic> (though nobody uses it hehe) |
09:01:19 | FromDiscord | <demotomohiro> Someone might make a big endian CPU in future. |
09:01:39 | FromDiscord | <Elegantbeef> When they due tell me so i can crash my sdl2 program on it |
09:01:44 | FromDiscord | <Elegantbeef> they do\ |
09:04:18 | PMunch | @System64_~_Flandre_Scarlet, sounds like you have a linking error |
09:05:20 | FromDiscord | <System64 ~ Flandre Scarlet> fixed |
09:08:10 | FromDiscord | <demotomohiro> How? |
09:09:09 | PMunch | @Elegantbeef, I've been thinking about maybe doing a "This month in Nim" podcast based on the blog posts. Basically just look at the libraries listed there, some general talk about what's been going on with Nim, and of course have a guest of some kind (for example one of the library owners). |
09:10:56 | FromDiscord | <Elegantbeef> Sounds good to me, I'm prohibited from doing that given that ever 3 word i say is a swear 😛 |
09:13:23 | FromDiscord | <Elegantbeef> Could be worth delaying the blogpost so an accompanying video could go with it |
09:15:52 | PMunch | Haha, I do that to in my native tongue :P |
09:16:12 | PMunch | It's a dialect thing |
09:16:53 | FromDiscord | <Elegantbeef> I think there are some statistics that show Canadians actually swear the most of out native english nations 😀 |
09:17:16 | PMunch | And I haven't really started getting anything set up yet, just had the idea right before I left for vacation. |
09:17:24 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SiG |
09:18:43 | PMunch | @System64_~_Flandre_Scarlet, do you want to support the LINEAR_INTERPOLATION mode? |
09:19:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, do you want": not necessary, but why not↵I want to include an interpolation anyways, but the way the guy did the linear interpolation is cryptic |
09:20:02 | FromDiscord | <Elegantbeef> The way the guy did it all is awful |
09:20:42 | FromDiscord | <System64 ~ Flandre Scarlet> I just don't understand at all how the LERP was done↵It's so cryptic |
09:21:46 | PMunch | I mean it looks incorrect.. |
09:21:58 | PMunch | Have you tried it? Does it work at all? |
09:22:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Have you tried it?": yeah it works |
09:22:32 | FromDiscord | <System64 ~ Flandre Scarlet> it produces the waveforms in wave_table2 and wave_table |
09:24:41 | PMunch | Oh yeah it would do something, but does it do linear interpolation? |
09:24:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SiH |
09:24:47 | PMunch | Because I'm pretty sure it doesn't :P |
09:24:51 | FromDiscord | <Elegantbeef> There is the transcribe sensible nim |
09:24:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Oh yeah it would": yeah it does |
09:25:24 | FromDiscord | <System64 ~ Flandre Scarlet> btw what's the difference between let and var? |
09:25:30 | FromDiscord | <Rika> immutability |
09:25:53 | FromDiscord | <System64 ~ Flandre Scarlet> why not just doing Const then |
09:25:54 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "then" => "then?" |
09:26:08 | PMunch | const are compile-time constant, let is runtime constant |
09:26:11 | FromDiscord | <Elegantbeef> Cause const is compile time |
09:26:14 | FromDiscord | <Elegantbeef> `let` is runtiem |
09:26:18 | FromDiscord | <Elegantbeef> runtime even |
09:26:25 | FromDiscord | <Elegantbeef> This isnt JS |
09:26:44 | PMunch | You can read user input into a let for example |
09:27:45 | FromDiscord | <System64 ~ Flandre Scarlet> aaah alright |
09:28:07 | FromDiscord | <demotomohiro> `interpolated = a 2^16 sample[i] + (1 - a) 2^16 sample[(i+1) mod len]` where 0 < a < 1.0. Then, divid `interpolated` with 2^16. Linear interporlation only with integer ops. |
09:28:27 | * | xet7 quit (Remote host closed the connection) |
09:28:49 | FromDiscord | <Elegantbeef> I wonder if that's any more efficient than to float and lerp then back |
09:29:08 | FromDiscord | <Elegantbeef> I mean i reason it is, but how much is more what i mean |
09:30:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SiL |
09:30:37 | FromDiscord | <demotomohiro> I guess that code is supposed to run on old hardware? And float is slow or even unavailable? |
09:30:50 | FromDiscord | <Elegantbeef> I didnt declare it cause i couldnt be arsed to |
09:31:24 | FromDiscord | <System64 ~ Flandre Scarlet> what does it mean? |
09:31:34 | FromDiscord | <Elegantbeef> Sample is the 16 bit integer |
09:31:47 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah, just got it I think |
09:32:09 | PMunch | But sample2 is just timed by the offset while sample1 is timed by a 1 left shifted 16 times, then the whole thing is right shifted 16 times. Wouldn't that completely overshadow sample2? |
09:34:30 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SiM |
09:34:55 | FromDiscord | <Elegantbeef> len - 1 |
09:35:36 | FromDiscord | <System64 ~ Flandre Scarlet> okay so I fixed it, but no sound |
09:36:03 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SiN |
09:36:56 | PMunch | Uhm, he meant `countup(0, len - 1, 2)` |
09:37:33 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Uhm, he meant `countup(0,": len is the lenght of the buffer, so, 4096 samples |
09:37:53 | PMunch | Yeah |
09:38:00 | FromDiscord | <Elegantbeef> and you only want to count up to 4095 when iterating |
09:38:05 | FromDiscord | <Elegantbeef> It's an off by one error by me |
09:38:55 | FromDiscord | <Rika> countup is `0..4096` with `4097` values |
09:39:57 | * | xet7 joined #nim |
09:40:06 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah |
09:40:44 | FromDiscord | <Elegantbeef> Anyway i have you most of the way to the C, I'm too tired to convert the rest, it should be easy |
09:41:04 | FromDiscord | <Rika> In reply to @System64 "Yeah": 4097 values is intentional? |
09:41:19 | FromDiscord | <System64 ~ Flandre Scarlet> No, it's 4096 values |
09:41:28 | FromDiscord | <Rika> then `countup(0, len - 1, 2)` |
09:42:34 | FromDiscord | <System64 ~ Flandre Scarlet> still no sound :// |
09:59:33 | FromDiscord | <demotomohiro> How about to output your sound sample to a text file and see values are correct? |
10:02:51 | * | kenran joined #nim |
10:04:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @demotomohiro "How about to output": ah, lemme see |
10:06:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @demotomohiro "How about to output": I have some values |
10:10:26 | FromDiscord | <demotomohiro> So, I guess your sound samples are good, but there is a problem in sound related code. |
10:11:04 | FromDiscord | <demotomohiro> Can you play simple sound data like sin wave? |
10:11:40 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/X8r |
10:13:14 | FromDiscord | <demotomohiro> Are you sure you set 8bits per sample format? |
10:14:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @demotomohiro "Are you sure you": I set the sample format to 16-bits |
10:14:17 | FromDiscord | <System64 ~ Flandre Scarlet> but the buffer is 8-bits |
10:15:46 | FromDiscord | <demotomohiro> Does your library automatically convert 8bit sample to 16bit sample? |
10:15:56 | FromDiscord | <System64 ~ Flandre Scarlet> I use SDL2 |
10:16:51 | FromDiscord | <demotomohiro> So SDL2 automatically convert 8bit sample to 16bit sample? |
10:17:08 | FromDiscord | <System64 ~ Flandre Scarlet> I have no idea |
10:17:43 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SiY |
10:21:28 | FromDiscord | <demotomohiro> SDL2 doesn't have any documents or samples that explains how to write sample data? |
10:21:40 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/nim-lang/sdl2/blob/master/examples/sdl_audio_callback.nim↵I found an exemple here |
10:23:04 | * | xet7 quit (Quit: Leaving) |
10:23:35 | * | xet7 joined #nim |
10:46:24 | * | Gustavo6046 quit (Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world. <screw you aloo_shu my old line was better and more creative!>) |
10:53:25 | FromDiscord | <System64 ~ Flandre Scarlet> WTF https://media.discordapp.net/attachments/371759389889003532/953244525596377148/unknown.png |
10:53:36 | FromDiscord | <System64 ~ Flandre Scarlet> why I don't have the same thing??? |
10:53:39 | FromDiscord | <System64 ~ Flandre Scarlet> kinda sus |
10:54:02 | FromDiscord | <ripluke> Is there a way to get a randomly generated letter more efficiently than just having to generate a number and map it to a letter |
10:55:16 | FromDiscord | <System64 ~ Flandre Scarlet> you can convert a number to a letter, since letters are numbers |
10:56:06 | FromDiscord | <enthus1ast> there is random.sample |
10:57:00 | FromDiscord | <ripluke> In reply to @enthus1ast "there is random.sample": Ok |
10:58:53 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/pb1 |
11:00:02 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=3Sj5 |
11:00:34 | FromDiscord | <enthus1ast> and in strutils there is a https://nim-lang.org/docs/strutils.html#Letters |
11:03:54 | * | jjido joined #nim |
11:09:47 | FromDiscord | <System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/3Sjd |
11:10:41 | FromDiscord | <Rika> When the code is sus |
11:11:15 | FromDiscord | <System64 ~ Flandre Scarlet> yeah it's sus lol |
11:12:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @System64 "WTF": @Rika is it normal I don't have the same thing in Obtained? |
11:13:46 | FromDiscord | <Rika> I don’t know what you did, I don’t deal with SDL and didn’t really read your code |
11:14:06 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/nim-lang/sdl2/blob/master/examples/sdl_audio_callback.nim↵Just copy pasted this |
11:14:47 | FromDiscord | <Generic> what is the returned sample format? |
11:14:58 | FromDiscord | <Generic> is it maybe just unsigned 16 bit? |
11:16:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Generic "is it maybe just": not even↵It's 33056 |
11:18:02 | FromDiscord | <Generic> you mean 33056 samples/second? |
11:18:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Generic "you mean 33056 samples/second?": not, the format |
11:18:39 | FromDiscord | <Generic> I don't speak sdl enums |
11:19:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Generic "I don't speak sdl": I asked for Signed 16-bits format |
11:20:13 | FromDiscord | <System64 ~ Flandre Scarlet> the obtained format isn't 16-bits or even 8 bits |
11:20:46 | FromDiscord | <Generic> it's floating point apparently |
11:21:22 | FromDiscord | <Generic> nothing to be done here |
11:21:28 | FromDiscord | <System64 ~ Flandre Scarlet> What the |
11:21:39 | FromDiscord | <Generic> SDL has some functions for format and sample rate conversion |
11:22:01 | FromDiscord | <System64 ~ Flandre Scarlet> yeah it's floating point |
11:22:05 | FromDiscord | <System64 ~ Flandre Scarlet> WTF |
11:22:12 | FromDiscord | <System64 ~ Flandre Scarlet> why it send me back Floating Point??? |
11:22:25 | FromDiscord | <System64 ~ Flandre Scarlet> I asked 16-bits |
11:22:31 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "I asked ... 16-bits" added "for" |
11:23:05 | FromDiscord | <Generic> well that's the entire point behind this request thing |
11:24:06 | FromDiscord | <Generic> if the backend doesn't support what you request it gives you a fallback |
11:24:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Generic "if the backend doesn't": Ah so it's my soundcard? |
11:25:24 | FromDiscord | <Generic> it's probably more likely the backend SDL uses for sound on your platform |
11:25:32 | FromDiscord | <System64 ~ Flandre Scarlet> WTF |
11:25:51 | FromDiscord | <System64 ~ Flandre Scarlet> and I think float is 32-bits? |
11:25:59 | FromDiscord | <Generic> yes |
11:26:36 | FromDiscord | <Generic> though you can't directly compare the precision to integers |
11:27:03 | FromDiscord | <System64 ~ Flandre Scarlet> So I guess this is why all audio softwares use float? |
11:27:35 | FromDiscord | <Generic> it's also just easier to deal with while getting good precision |
11:27:55 | FromDiscord | <Generic> I mean fix point is still faster because you can just fit more into a simd register |
11:28:19 | FromDiscord | <Generic> but fixpoint can give some headache if you're not familiar with it |
11:28:34 | FromDiscord | <Rika> Floating point avoids clipping |
11:28:44 | FromDiscord | <Rika> until you convert back |
11:29:16 | FromDiscord | <Generic> well if you use fix point properly you would switch to a fixpoint type with space in the integer range for values which can get there |
11:29:33 | FromDiscord | <fbpyr> https://xkcd.com/2585/ |
11:30:08 | PMunch | Hmm, does anyone know of a good stand-alone database? I've been using SQLite, but I'm struggling with using it efficiently in a multi-threaded scenario |
11:31:05 | PMunch | I just need some persistence for my application.. |
11:36:09 | FromDiscord | <Rika> That’s the most you’ll get serverless I believe |
11:36:32 | FromDiscord | <Rika> Every other solution has a server of some sort or is probably worse that SQLite at multi threading |
11:37:36 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Sjn |
11:40:05 | PMunch | @Rika, but why does the server have to be a separate thing.. |
11:40:27 | FromDiscord | <Rika> Probably a data structure thing |
11:40:44 | FromDiscord | <Rika> Designing a thread safe structure with ACID properties prolly difficult |
11:40:45 | * | vicecea quit (Ping timeout: 256 seconds) |
11:41:00 | FromDiscord | <Rika> I’m not really sure. |
11:46:00 | FromDiscord | <soda> Is there a nimble home envvar? somewhere it would store the packages in? |
11:48:33 | FromDiscord | <Rika> Not that I know of |
11:49:30 | * | jmdaemon quit (Ping timeout: 252 seconds) |
11:51:16 | FromDiscord | <soda> upsetting |
11:51:37 | FromDiscord | <soda> something like $NIM_HOME |
11:51:43 | FromDiscord | <soda> and have all the packages installed under that |
11:52:06 | PMunch | @Rika, oh for sure, but I don't need ACID. I just need the D part.. |
11:52:19 | PMunch | I could just store everything in files I guess |
11:52:34 | PMunch | But that would be quite a bit of overhead I believe |
11:52:47 | FromDiscord | <soda> In reply to @Rika "Not that I know": oh three is |
11:52:54 | FromDiscord | <soda> nimbleDir |
11:53:04 | FromDiscord | <soda> in nimble's config file |
11:53:06 | PMunch | Yes but that's not an environment variable |
11:53:24 | FromDiscord | <soda> yeah but i can do some crap to mimic it at least |
11:53:28 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, oh for sure,": Durability? |
11:53:39 | PMunch | You're able to control the default search directory for packages, and you're even able to pass it during compilation as a flag |
11:53:50 | PMunch | @Rika, yes |
11:54:30 | PMunch | My use-case is data comes in over a HTTP connection, when I reply 200 OK to that HTTP connection I must make sure that I handle that data, even if my program crashes and restarts |
11:54:31 | FromDiscord | <Rika> Why not do some weird ass format yourself, like some mix of a serialisation format + journaling |
11:54:54 | FromDiscord | <Rika> Journals are quick to write since they’re append only and then you can merge it into the main file when needed or when possible |
11:55:16 | PMunch | So I currently store them in a database before replying. And then I have threads selecting data from the database and performing the work I need on them, before deleting the records |
11:56:08 | PMunch | I guess a journal might work, and then just keep the current tasks in memory |
11:56:31 | PMunch | When it restarts it reads the journal and figures out what is done and what needs doing |
11:57:23 | PMunch | I need to have some scheme to avoid the journal growing indefinitely though |
11:57:30 | FromDiscord | <Rika> Well yeah that’s how most databases work |
11:57:32 | FromDiscord | <Rika> https://en.m.wikipedia.org/wiki/Transaction_log |
11:57:50 | FromDiscord | <Rika> This page will be useful for you |
11:58:44 | PMunch | Yeah that's pretty much what I had in mind |
12:07:12 | * | kenran quit (Quit: WeeChat info:version) |
12:09:43 | * | slowButPresent joined #nim |
12:13:09 | om3ga | Hi all!! I can't figure out how to catch exception caused by open() of std/db_mysql. Could you please suggest/help with this? |
12:20:29 | PMunch | `try: except:` doesn't work? |
12:21:45 | termer | <Elegantbeef> Hmm is termer even heree? |
12:21:45 | termer | I am now |
12:37:39 | * | ltriant_ quit (Ping timeout: 256 seconds) |
12:40:06 | * | retronav quit (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
12:40:27 | * | retronav joined #nim |
13:14:47 | FromDiscord | <Phil> In reply to @om3ga "Hi all!! I can't": Is there a reason the normal way of catching an exception doesn't work? Or are you asking what the normal way to catch an exception is? |
13:14:59 | FromDiscord | <Phil> (edit) "In reply to @om3ga "Hi all!! I can't": Is there a reason the normal way of catching an exception doesn't work? Or are you asking what the normal way to catch an exception is? ... " added "(see Pmunch's response)" |
13:15:48 | FromDiscord | <mratsim> In reply to @PMunch "Hmm, does anyone know": Are KV-store suitable? |
13:15:52 | FromDiscord | <mratsim> (edit) "KV-store" => "KV-stores" |
13:16:04 | PMunch | Yeah a KV store should work |
13:16:21 | FromDiscord | <mratsim> then you have lmdb, rocksdb, ... |
13:16:26 | PMunch | I'm implementing a journaling system now, which should hopefully work well enough |
13:17:02 | FromDiscord | <Rika> I fucking forgot about rocks my goodness |
13:17:51 | PMunch | Hmm, rocksdb does look enticing though |
13:20:23 | FromDiscord | <mratsim> just don't try to compile it on a Rpi. |
13:21:01 | FromDiscord | <Rika> Why not? |
13:22:39 | FromDiscord | <mratsim> It takes a whole night |
13:23:54 | Amun-Ra | what am I missing in proc signature? https://play.nim-lang.org/#ix=3SjM |
13:24:07 | om3ga | PMunch, Phil, Thanks! I made it. Text editor caused the problem with formatting. |
13:27:47 | PMunch | Amun-Ra, nimcall: https://play.nim-lang.org/#ix=3SjN |
13:28:14 | PMunch | By default that cb type is a {.closure.}, which is incompatible with that signature |
13:28:40 | Amun-Ra | oh, I see, thanks, this'd be the first time I use nimcall pragma |
13:29:04 | PMunch | It's not super commonly used, so that makes sense |
13:29:22 | PMunch | Alternatively you could make `ill` a closure of course |
13:42:04 | * | rockcavera joined #nim |
13:42:04 | * | rockcavera quit (Changing host) |
13:42:04 | * | rockcavera joined #nim |
13:42:47 | FromDiscord | <auxym> on the topic of kv stores there's also this https://github.com/snej/nimdbx |
13:44:31 | * | kayabaNerve_ quit (Ping timeout: 256 seconds) |
13:47:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:48:29 | * | Guest19 joined #nim |
13:49:00 | * | Guest19 quit (Client Quit) |
13:49:08 | NimEventer | New Nimble package! htmlgenerator - Generate HTML string by nim object, see https://github.com/z-kk/htmlgenerator |
14:18:33 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Sk1 |
14:32:31 | PMunch | Again, it's better to use an unchecked array than pointer arithmetic |
14:33:35 | FromDiscord | <d4rckh> my program compiles successfully but wont run if i use the `--threads:on` flag, if i remove it, it works just fine (of course it fails to compile because im using threads but i didnt specify the flag) https://media.discordapp.net/attachments/371759389889003532/953299930464809010/unknown.png https://media.discordapp.net/attachments/371759389889003532/953299930724831242/unknown.png |
14:33:36 | PMunch | `rawStream: ptr uint8`, `var stream = cast[ptr UncheckedArray[float32]](rawStream)`, then you can simply do: `stream[x] = sampleValue` |
14:33:56 | FromDiscord | <d4rckh> (edit) "flag)" => "flag, if id remoe the threads functionality it would work normally)" |
14:34:41 | PMunch | @d4rckh, well your program crashes |
14:34:48 | PMunch | So you have some sort of programming bug |
14:35:26 | PMunch | It's a bit weird that you don't get a more productive error message though |
14:35:54 | PMunch | But without seeing any code it's hard to tell what you're doing wrong |
14:36:00 | FromDiscord | <d4rckh> ive put a echo hello world all the way at the top before anything and it doesnt print |
14:36:16 | FromDiscord | <d4rckh> also it compiles successfully on my friend's linux machine (im using windows) |
14:38:03 | pch | just woke up to read chat and saw someone try telling me modern CPUs are vector processors |
14:38:23 | pch | I'm trying my hardest not to go on a tirade about how incorrect that is |
14:38:51 | FromDiscord | <d4rckh> also i compiled an older version of the same program that has no threads functionality and got same results, compiles and runs just fine without the threads flag but it compiles and just exits with it |
14:38:54 | pch | tldw having vector capabilities does not a vector processor make |
14:40:26 | FromDiscord | <Daan Breur> In reply to @PMunch "So you have some": Thats what I thought, but when I compile and run it using the same command on linux it works fine |
14:40:35 | FromDiscord | <Daan Breur> yesterday it also worked for him |
14:40:41 | FromDiscord | <Daan Breur> None of the code changed |
14:41:34 | PMunch | Hmm, that sounds strange |
14:41:37 | PMunch | Latest version of Nim? |
14:41:55 | FromDiscord | <Generic> pch: I'm here |
14:42:19 | FromDiscord | <Generic> and I hold true to my statement in that sense |
14:43:09 | pch | @Generic modern CPUs are serial processors with highly propogated optional vectorizing functionality |
14:43:21 | FromDiscord | <Generic> that obviously cpus have all sorts of things (branch predictor, smart prefetching) to make "normal" code as fast as possible |
14:43:22 | pch | a vector processor is one that starts in vectorized mode at all times |
14:43:39 | FromDiscord | <Generic> yes, but they have the highest data throughput with vector instructions |
14:43:47 | FromDiscord | <Daan Breur> sent a code paste, see https://play.nim-lang.org/#ix=3Ska |
14:44:10 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Skb |
14:45:17 | FromDiscord | <Daan Breur> sent a code paste, see https://play.nim-lang.org/#ix=3Skc |
14:45:25 | FromDiscord | <Daan Breur> (edit) "https://play.nim-lang.org/#ix=3Skc" => "https://play.nim-lang.org/#ix=3Skd" |
14:46:01 | pch | @Generic that doesn't matter, having vector capabilities doesn't make a processor a vector processor |
14:46:13 | * | daanb joined #nim |
14:46:15 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/953303119259893850/unknown.png |
14:46:18 | FromDiscord | <d4rckh> im also on 1.6.4 |
14:46:46 | FromDiscord | <Daan Breur> Did you use choosenim to install? |
14:46:54 | pch | example there are a lot of GPU designs popping up recently for machine learning and PBR that are based on distributing vectors over massive scalar designs |
14:47:18 | FromDiscord | <d4rckh> no, i just downloaded the binaries and add them to path like i usually do |
14:47:26 | PMunch | @System64_~_Flandre_Scarlet, oh yeah it won't fix your code, just improve its readability/maintainability (although the way you have done it doesn't really help much..) |
14:47:28 | FromDiscord | <d4rckh> ill reset it up |
14:47:31 | FromDiscord | <Daan Breur> Could that be the issue? |
14:47:45 | FromDiscord | <Daan Breur> Maybe choosenim installs some dependencies? |
14:47:59 | FromDiscord | <d4rckh> it worked every time |
14:48:06 | FromDiscord | <d4rckh> i didnt tell you but i reinstalled windows last night |
14:48:08 | PMunch | Shouldn't be an issue |
14:48:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, oh yeah it": My code looks like the C one |
14:48:25 | PMunch | Well I'm not sure how Windows does threads, it might need some DLL to do it.. |
14:48:36 | PMunch | @System64_~_Flandre_Scarlet, that is not a good thing :P |
14:48:39 | PMunch | C code looks horrible |
14:48:53 | FromDiscord | <Generic> pch, I mean we could continue to argue for ages whether a processors which also has strong vector capabilities is a vector processor |
14:49:03 | FromDiscord | <Daan Breur> Try using choosenim to install it may be an issue with the way C is installed in your windows |
14:49:32 | pch | yes, we could, except there's only one actual correct answer and you're wrong |
14:49:44 | FromDiscord | <Generic> my point was mostly that the reason everybody uses bruteforce methods which paralise well for rasterisation |
14:49:51 | FromDiscord | <d4rckh> nim downloaded mingw |
14:49:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "C code looks horrible": I don't understand everything in the c code too lol↵I didn't wrote the C code |
14:50:19 | FromDiscord | <Generic> even on cpus, is because they're the fastest due to the vector instructions |
14:52:26 | FromDiscord | <mratsim> In reply to @PMunch "Well I'm not sure": threads on Windows are actually easy, Nim createThread/joinThread wraps everything. |
14:53:26 | PMunch | @mratsim, yeah I was thinking of runtime dependencies. Again, I have no idea how threads work on Windows, but a program crashing before main program body stuff is executed tends to be caused by runtime dependencies |
14:55:59 | PMunch | Oh well, gotta run |
14:56:00 | * | PMunch quit (Quit: Leaving) |
14:56:46 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/953305762304782367/unknown.png |
14:56:49 | FromDiscord | <Daan Breur> I ran it on a second windows machine of mine with a fresh nim install and it does error cause of some dll https://media.discordapp.net/attachments/371759389889003532/953305776078848091/unknown.png |
14:57:10 | FromDiscord | <d4rckh> oh yeah it appears for me too |
14:57:17 | FromDiscord | <d4rckh> if i start it from explorer |
14:57:34 | FromDiscord | <Daan Breur> thats also when i run it with `nim c -r` |
14:58:22 | FromDiscord | <Daan Breur> `libwinpthread-1.dll` doesn't get installed apparently |
14:59:36 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/953306475630034944/unknown.png |
14:59:40 | FromDiscord | <d4rckh> if i download the dll |
15:00:01 | FromDiscord | <d4rckh> but it worked before without me having to download that dll |
15:00:08 | FromDiscord | <Daan Breur> Download from where? I hope from MingW releases |
15:00:15 | FromDiscord | <d4rckh> 🙄 |
15:00:53 | FromDiscord | <d4rckh> i dont even know where choosenim installed nim |
15:01:01 | * | kenran joined #nim |
15:01:23 | retronav | hi, how do I convert a DateTime to a Duration? both types are from std/times |
15:03:59 | FromDiscord | <enthus1ast> DateTime is a point in time, Duration is, a duration \:) |
15:04:40 | retronav | Okay, lets assume I need the Duration from the current time to that DateTime |
15:05:12 | FromDiscord | <enthus1ast> then eg\: now() - thatDateTime |
15:07:12 | retronav | Aye, that works. Forgive this newbie if that was silly |
15:07:16 | FromDiscord | <d4rckh> In reply to @d4rckh "": i restarted my laptop and i still get this stupid error, |
15:07:20 | FromDiscord | <d4rckh> (edit) "error," => "error" |
15:08:06 | FromDiscord | <enthus1ast> no, dates are a complex matter \:) (sic), just ask your questions↵(<@709044657232936960_retronav=5b=49=52=43=5d>) |
15:08:49 | retronav | enthus1ast, its working correctly, I'm using the $ to print it in a humane manner, and boy do they print all the milli and micro seconds :( |
15:10:00 | FromDiscord | <enthus1ast> you can call\: `toParts` |
15:10:09 | FromDiscord | <enthus1ast> `myDuration.toParts` |
15:10:24 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/times.html#toParts%2CDuration |
15:10:29 | FromDiscord | <enthus1ast> and just format it yourself |
15:10:43 | retronav | ah nice |
15:11:47 | FromDiscord | <enthus1ast> you can also see how the `$`(dur\: Duration) works |
15:11:58 | FromDiscord | <enthus1ast> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/times.nim#L718 |
15:13:39 | retronav | yes |
15:13:47 | retronav | countdown is really useful in this situation |
15:13:56 | retronav | otherwise it'd been a nastly if else clause |
15:15:25 | * | arkurious joined #nim |
15:24:17 | FromDiscord | <d4rckh> can anyone explain what is GC-safe? 😅 https://media.discordapp.net/attachments/371759389889003532/953312688463831071/unknown.png |
15:24:22 | FromDiscord | <d4rckh> (edit) "is GC-safe?" => "GC-safe is?" |
15:25:41 | FromDiscord | <Daan Breur> I think GC stands for Global Constant, no idea what it means tho. |
15:27:00 | retronav | enthus1ast: that example you sent only does for Weeks, i tried Years instead of Weeks in countdown and it won't work, any ideas why? |
15:28:54 | retronav | ah got it, the toParts would do it till Weeks only |
15:29:07 | FromDiscord | <eyecon> Rather _Garbage Collection_ I think |
15:29:21 | FromDiscord | <Sense> Hey, I am curious is there a library which can interact with clipboard on Windows? |
15:29:32 | FromDiscord | <d4rckh> In reply to @Sense "Hey, I am curious": winim? |
15:30:00 | FromDiscord | <Sense> In reply to @d4rckh "winim?": This is what I first thought about, but maybe I am blind but I haven't see any mention of clipboard |
15:31:18 | FromDiscord | <eyecon> There seems to be somewhat under-documented https://github.com/Guevara-chan/Cliptomania too |
15:35:32 | * | jjido joined #nim |
15:40:38 | FromDiscord | <demotomohiro> https://github.com/nim-lang/Nim/pull/19605#issuecomment-1068130092↵Anyone know if it is possible that you can read more data from a pipe even if the pipe reached to the end of file?↵Or is there any reason to check if the process running in `iterator lines(p: Process): string` in osproc module?↵https://github.com/nim-lang/Nim/blob/4c76f9f1523a72f560138709642c2d51ea365b85/lib/pure/osproc.nim#L454 |
15:46:11 | * | zgasma joined #nim |
15:47:14 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:47:32 | FromDiscord | <Daan Breur> In reply to @eyecon "Rather _Garbage Collection_ I": Could also be |
15:49:10 | FromDiscord | <demotomohiro> In reply to @Sense "This is what I": When you use winim module, you need to read a document like this:↵https://docs.microsoft.com/en-us/windows/win32/dataxchg/clipboard↵↵It seems Cliptomania @eyecon mentioned provides clipboard by using windows API. |
15:52:51 | FromDiscord | <demotomohiro> In reply to @d4rckh "can anyone explain what": Why don't you grep Nim manual when you see a unknown Nim terminology?↵https://nim-lang.org/docs/manual.html#effect-system-gc-safety-effect |
15:54:08 | FromDiscord | <Sense> In reply to @demotomohiro "When you use winim": I will try to use Winim though since it's more maintained than Cliptomania |
15:56:30 | FromDiscord | <d4rckh> In reply to @demotomohiro "Why don't you grep": thanks! |
16:02:56 | FromDiscord | <Daan Breur> In reply to @demotomohiro "Why don't you grep": To be honest I couldn't find it either |
16:03:03 | FromDiscord | <demotomohiro> There are other clipboard libraries: https://nimble.directory/search?query=clipboard |
16:03:20 | FromDiscord | <Daan Breur> Searching the docs is a bit hard |
16:03:32 | FromDiscord | <System64 ~ Flandre Scarlet> is it possible to get the size of an unchecked array? |
16:05:46 | FromDiscord | <demotomohiro> I got that section in Nim manual with just ctrl+f and type "gc safe". |
16:08:30 | FromDiscord | <demotomohiro> In reply to @System64 "is it possible to": I don't think you can. It is called `uncheckedArray` because length of the array is unknown. |
16:08:31 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-unchecked-arrays |
16:09:07 | FromDiscord | <Rika> you cannot unless you can assume that the zeroed out type is an end marker, which might not be right |
16:09:33 | FromDiscord | <demotomohiro> C library usually provide the array size with other variable. |
16:10:10 | FromDiscord | <demotomohiro> If it is not 0 or Null terminated. |
16:10:44 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SkU |
16:11:26 | FromDiscord | <System64 ~ Flandre Scarlet> 'cause it doesn't sound right, so I try to figure out the problem |
16:13:15 | FromDiscord | <demotomohiro> That `len` parameter could be a length of `stream` but I think you should read official manual or reference or any documents that explains about that function. |
16:13:57 | FromDiscord | <auxym> `cast[ptr UncheckedArray[uint8]](stream)` are you sure that's correct? I think that's a double indirection, which might not be waht you want (pointer to a pointer to the data) |
16:14:46 | FromDiscord | <Rika> In reply to @auxym "`cast[ptr UncheckedArray[uint8]](stream)` are you": it is right |
16:15:00 | FromDiscord | <Rika> ptr unchecked[u8] == ptr u8 |
16:15:08 | FromDiscord | <Rika> im lazy |
16:15:13 | arkanoid | are exception raised within async proc supposed to be re-raised outside of it? I'm getting program crash due to unhandled exception even if I check "if myAsyncFuture.failed" |
16:15:26 | FromDiscord | <Rika> In reply to @arkanoid "are exception raised within": not unless you await it afaik |
16:16:27 | * | zgasma_ joined #nim |
16:16:50 | FromDiscord | <exelotl> In reply to @Rika "it is right": yeah, arrays in Nim have value semantics, so you have to use `ptr array` if you want C-like "an array is a pointer to its first element" semantics. |
16:17:29 | * | zgasma_ quit (Client Quit) |
16:18:24 | arkanoid | Rika, how am I supposed to wait for a list of futures without crash? I just want to check for each future if it is failed or not |
16:18:39 | arkanoid | I am doing "discard waitFor all tasks" |
16:18:58 | arkanoid | where tasks is "var tasks = newSeqOfCap[Future[bool]]()" |
16:19:12 | * | zgasma quit (Quit: leaving) |
16:26:14 | arkanoid | the docs says: "If an awaited future completes with an error, then await will re-raise this error. To avoid this, you can use the yield keyword instead of await. The following section shows different ways that you can handle exceptions in async procs." But if I replace "discard waitFor all tasks" with "yield all tasks", I get "Error: unhandled exception: Future still in progress. [ValueError]" |
16:26:32 | FromDiscord | <Rika> yield only works inside another async procedure |
16:26:34 | FromDiscord | <Rika> afaik |
16:26:41 | arkanoid | I am into an async proc |
16:27:02 | FromDiscord | <Rika> im not sure what the issue is then, ive never encountered that issue |
16:47:17 | FromDiscord | <exelotl> Anyone know why I can't use these `typetraits` helpers? https://play.nim-lang.org/#ix=3Sl7 |
16:48:07 | FromDiscord | <exelotl> if you comment out line 4 it then errors on line 5 |
16:49:06 | * | rockcavera quit (Read error: Connection reset by peer) |
16:49:31 | * | rockcavera joined #nim |
16:49:31 | * | rockcavera quit (Changing host) |
16:49:31 | * | rockcavera joined #nim |
16:58:47 | FromDiscord | <Rika> probably fucked with openarray |
17:01:54 | * | supakeen quit (Quit: Bridge terminating on SIGTERM) |
17:03:21 | FromDiscord | <ynfle> In reply to @Rika "probably fucked with openarray": fails with seq as well |
17:03:58 | * | supakeen joined #nim |
17:24:39 | * | zgasma joined #nim |
17:25:12 | * | zgasma quit (Client Quit) |
17:25:56 | FromDiscord | <Shinyzenith> is it possible to directly work with c headers in nim or do I have to call c2nim on them first? |
17:26:27 | FromDiscord | <ynfle> futhark is may be what you are looking for |
17:27:37 | FromDiscord | <demotomohiro> Directly work means using header? https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma |
17:27:47 | * | zgasma joined #nim |
17:28:00 | FromDiscord | <Shinyzenith> In reply to @ynfle "futhark is may be": I'm sorry can you expand on that? |
17:28:06 | FromDiscord | <demotomohiro> header pragma |
17:28:33 | FromDiscord | <Shinyzenith> I'm just trying to interact with wlroots from inside of nim |
17:28:50 | FromDiscord | <demotomohiro> https://github.com/PMunch/futhark |
17:29:30 | FromDiscord | <Shinyzenith> Oh it's a repo |
17:29:57 | FromDiscord | <demotomohiro> Is that a library written by C or C++? |
17:30:03 | FromDiscord | <Shinyzenith> C |
17:30:36 | FromDiscord | <Shinyzenith> I do know nim but haven't written any serious programs with it yet, so I hope to write my first proper project with this :D |
17:31:11 | FromDiscord | <demotomohiro> There are several ways to use C libraries. https://internet-of-tomohiro.netlify.app/nim/faq.en.html#use-nim-with-other-language-how-to-use-cslashcplusplus-libraries-in-nimqmark |
17:32:47 | FromDiscord | <Shinyzenith> Futhark seems to be the one that's being actively maintained so I'll use that for now |
17:33:30 | FromDiscord | <Shinyzenith> @demotomohiro thank you for the help :D |
17:43:10 | * | kenran quit (Quit: WeeChat info:version) |
18:02:18 | * | daanb quit (Quit: Leaving) |
18:13:36 | FromDiscord | <hmmm> boyz what libs can I use to expose to users a search similar to notepad.exe CTRL + F, the simpler the bettah |
18:14:02 | FromDiscord | <enthus1ast> strutils.find? |
18:14:07 | FromDiscord | <hmmm> woah |
18:14:11 | FromDiscord | <hmmm> really? |
18:14:22 | FromDiscord | <enthus1ast> but maybe give more context \:) |
18:14:34 | FromDiscord | <hmmm> I mean notepad.exe uses something like strutils.find 😃 |
18:14:50 | FromDiscord | <Rika> well whats the issue then |
18:14:52 | FromDiscord | <demotomohiro> Do you want to show a dialogbox for user? |
18:15:25 | FromDiscord | <hmmm> hmm I could if I want / need demo |
18:15:33 | FromDiscord | <hmmm> but the notepad way would be best |
18:16:33 | FromDiscord | <Rika> we dont understand what you mean by "notepad way" |
18:16:38 | FromDiscord | <abdu> what best book for practical macros of loop, as ofiicial 'Nim Manual' is too poor on that |
18:16:45 | FromDiscord | <Rika> as in do you want to open a dialogue box? |
18:16:52 | FromDiscord | <Rika> do you just want the searching part? |
18:17:08 | FromDiscord | <enthus1ast> or the shittyness of notepad search? |
18:17:12 | FromDiscord | <hmmm> lol |
18:17:39 | FromDiscord | <hmmm> yea I have a bunch of thousands strings in an archive and would need something that works as a search exactly like you would search in notepad |
18:18:06 | FromDiscord | <enthus1ast> yes then strutils.find should work |
18:18:10 | FromDiscord | <hmmm> the gui part is not a problem, the problem is what library / algo should I use for search |
18:18:13 | FromDiscord | <enthus1ast> you can give a start param |
18:18:13 | FromDiscord | <ynfle> In reply to @abdu "what best book for": Do you want to learn how to use macros? |
18:19:08 | FromDiscord | <hmmm> anyway I will surely try find of strutils, if it works why look for more |
18:23:21 | FromDiscord | <demotomohiro> I can find 2 example code to use for loop macro when I use ctrl+f and type "for loop macro". |
18:27:51 | FromDiscord | <hmmm> hmm |
18:27:59 | FromDiscord | <demotomohiro> I think you can learn how for loop macro takes input statement with `echo loop.treeRepr` where `loop` is a prameter of a for loop macro. |
18:28:49 | FromDiscord | <hmmm> maybe I could use regex |
18:55:09 | * | vicecea joined #nim |
19:00:55 | FromDiscord | <Shinyzenith> @demotomohiro Hi I've hit a roadblock |
19:01:07 | FromDiscord | <Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/953367256627294239/unknown.png |
19:01:32 | FromDiscord | <Shinyzenith> it's in /usr/lib/clang//include/stddef.h |
19:01:35 | FromDiscord | <Shinyzenith> how do I pass that to opir? |
19:04:50 | * | jmdaemon joined #nim |
19:06:44 | * | rockcavera quit (Remote host closed the connection) |
19:18:05 | arkanoid | Rika: I've found out that asyncfutures.all fails as soon as the first inner future fails, so my error was due to this behavior |
19:19:37 | om3ga | Sorry, but I want to ask, will it be some day Nim like other free-form languages? |
19:21:18 | * | krux02 joined #nim |
19:22:48 | nrds | <Prestige99> I don't understand your question |
19:23:30 | FromDiscord | <Zoom> @Prestige\: https://en.wikipedia.org/wiki/Free-form_language |
19:23:44 | om3ga | Prestige, after C it's not really easy switch to new identation |
19:23:52 | FromDiscord | <Zoom> The short answer is "no".↵(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
19:24:08 | om3ga | Zoom :) eh... |
19:26:01 | FromDiscord | <qb> single letter as string to char? like `"H".char` |
19:27:01 | FromDiscord | <enthus1ast> "H"[0] |
19:27:19 | FromDiscord | <enthus1ast> but does "H".char not work? |
19:27:28 | FromDiscord | <enthus1ast> !eval echo "H".char |
19:27:29 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: type mismatch: got 'string' for '"H"' but expected 'char' |
19:27:34 | FromDiscord | <enthus1ast> ... |
19:28:01 | FromDiscord | <enthus1ast> !eval echo "H"[0] |
19:28:03 | NimBot | H |
19:28:16 | FromDiscord | <qb> !eval cast[seq[char]]("Hello?") |
19:28:17 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: expression 'cast[seq[char]]("Hello?")' is of type 'seq[char]' and has to be used (or discarded) |
19:28:24 | FromDiscord | <qb> (edit) "!eval ... cast[seq[char]]("Hello?")" added "echo" |
19:28:36 | FromDiscord | <qb> !eval echo cast[seq[char]]("Hello?") |
19:28:38 | NimBot | @['H', 'e', 'l', 'l', 'o', '?'] |
19:28:44 | FromDiscord | <qb> mkay |
19:35:47 | * | jjido joined #nim |
19:37:33 | * | jmdaemon quit (Ping timeout: 256 seconds) |
19:44:52 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to output a value in a binary file, and then appending the following value and so on?? |
19:44:58 | FromDiscord | <System64 ~ Flandre Scarlet> if yes, how? |
19:45:36 | FromDiscord | <System64 ~ Flandre Scarlet> I have a bunch of samples here, but I want to see if the outputed sound is a square wave https://media.discordapp.net/attachments/371759389889003532/953378448494198854/unknown.png |
19:45:46 | Amun-Ra | sounds like a classic file operation |
19:49:16 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "sounds like a classic": is there a function for that? |
19:49:22 | FromDiscord | <auxym> https://nim-lang.org/docs/io.html#writeBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural |
19:49:28 | FromDiscord | <DarthWader> 👋 |
19:49:36 | FromDiscord | <DarthWader> Hi |
19:50:02 | FromDiscord | <DarthWader> Can I ask question about Nim - FFI |
19:50:21 | FromDiscord | <auxym> hi, yes |
19:51:43 | FromDiscord | <DarthWader> I'm learning nim for better than golang ( plugin and dynamic libraries ) |
19:51:56 | FromDiscord | <DarthWader> Golang not effect for my problems |
19:53:28 | FromDiscord | <DarthWader> I'm coding discord bot for GraphQL + gRPC for my multiple application↵↵APIs coded with go |
19:53:43 | FromDiscord | <DarthWader> And discord bot made with Nim |
19:54:02 | FromDiscord | <DarthWader> But I cant communicate this applications |
19:54:30 | FromDiscord | <DarthWader> How can I with using dynamic libraries |
19:54:39 | FromDiscord | <DarthWader> (edit) "How can I ... with" added "do" |
19:56:19 | FromDiscord | <DarthWader> sent a long message, see http://ix.io/3SlQ |
19:57:52 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3SlR |
19:58:13 | FromDiscord | <DarthWader> I readed Nim functions in wiki and that saying↵↵proc Example() { dynlib: grpc.so } like this |
19:58:16 | FromDiscord | <DarthWader> @auxym |
19:58:30 | FromDiscord | <DarthWader> Sorry for ping 😞 |
20:01:43 | * | jmdaemon joined #nim |
20:05:37 | FromDiscord | <Zoom> @hmmm\: do you have a reason you're using regexes if you're just looking for a word? What's your data your searching in? |
20:07:41 | FromDiscord | <hmmm> no I'm still looking to use strutils find zoom, this was another matter, I'm refactoring and wanted to rename all my "data" vars to something less insane but I'm getting in my search all kinds of dataSomeStuff that I don't want to rename 😃 |
20:07:57 | FromDiscord | <Zoom> Also, in context of regexes, a word usually means specifically `[A-Za-z_]+` |
20:07:58 | FromDiscord | <hmmm> more precisely I wanted a regex that worked on sublimetext |
20:08:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "https://nim-lang.org/docs/io.html#writeBytes%2CFile": it's for writting float32 too? |
20:09:35 | FromDiscord | <auxym> In reply to @System64 "it's for writting float32": https://nim-lang.org/docs/io.html#write%2CFile%2Cfloat32 |
20:09:47 | FromDiscord | <auxym> In reply to @DarthWader "I readed Nim functions": sorry, is there a question? |
20:12:15 | FromDiscord | <auxym> In reply to @DarthWader "Folder structure for discord": sorry just saw your post. Have a look at https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f and https://livebook.manning.com/book/nim-in-action/chapter-8/ |
20:13:50 | FromDiscord | <DarthWader> In reply to @auxym "sorry just saw your": I looked this ( honestly not at all ) but How working this FFI for Nimlang |
20:13:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "https://nim-lang.org/docs/io.html#write%2CFile%2Cfl": Ah nice, and when I write a new value, it appends at the end of the file? |
20:14:37 | FromDiscord | <Schelz> How do I locate a nim packet if its installed ? |
20:14:50 | * | FromDiscord quit (Remote host closed the connection) |
20:15:04 | * | FromDiscord joined #nim |
20:15:20 | FromDiscord | <auxym> In reply to @System64 "Ah nice, and when": yes, as long as you don't close the file. if you re-open it, you have the choice between "write" which wipes your file and re-starts writing at the beginning, or "append" which appends the data at the end |
20:15:53 | FromDiscord | <DarthWader> For example my using library ↵dimscord ( Nim ) and If I build for dynamic library can I use for dimscord applications ( slash command ) |
20:16:09 | FromDiscord | <DarthWader> (edit) "dimscord" => "discord" |
20:16:24 | FromDiscord | <DarthWader> FFI very complex system |
20:19:35 | FromDiscord | <auxym> well, FFI might not be the best place to start when learning Nim |
20:19:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "yes, as long as": Oh alright |
20:19:39 | NimEventer | New thread by Jsc13: Strenc+Parseopt=AssertionDefect, see https://forum.nim-lang.org/t/9015 |
20:20:18 | FromDiscord | <auxym> In reply to @DarthWader "For example my using": for discord did you see https://github.com/krisppurg/dimscord instead of using ffi? |
20:21:22 | FromDiscord | <DarthWader> In reply to @auxym "for discord did you": Yeah and I'm using already |
20:21:56 | FromDiscord | <DarthWader> But I want partition commands and events |
20:22:37 | FromDiscord | <DarthWader> In reply to @DarthWader "Folder structure for discord": Ping slash command , grpc.so ( my client addon ) |
20:22:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "yes, as long as": but if the file doesn't exist? |
20:23:42 | FromDiscord | <Schelz> it will create one |
20:24:05 | FromDiscord | <System64 ~ Flandre Scarlet> it asks for a file https://media.discordapp.net/attachments/371759389889003532/953388134450741348/unknown.png |
20:27:28 | FromDiscord | <Schelz> the name of the file (path) |
20:27:38 | FromDiscord | <Schelz> (edit) "(path)" => "( +path)" |
20:29:36 | FromDiscord | <Schelz> In reply to @System64 "it asks for a": the name of the file ( +path) and the value you want to write in the file |
20:35:26 | * | kayabaNerve joined #nim |
20:36:12 | pch | how do I insert positive infinity into a float field from a literal |
20:42:38 | FromDiscord | <System64 ~ Flandre Scarlet> Okay so Buffer isn't the problem |
20:47:09 | FromDiscord | <auxym> In reply to @DarthWader "But I want partition": ok well, read the nim tutorials, read the FFI resources I linked above, and come back if you have specific questions/errors |
20:49:28 | FromDiscord | <auxym> In reply to @pch "how do I insert": !eval float64.high |
20:49:54 | FromDiscord | <auxym> !eval echo float64.high |
20:49:56 | NimBot | inf |
20:50:04 | FromDiscord | <auxym> that |
20:50:18 | pch | thanks |
21:11:00 | FromDiscord | <Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3Sm8 |
21:11:25 | FromDiscord | <Shinyzenith> (edit) "https://play.nim-lang.org/#ix=3Sma" => "https://play.nim-lang.org/#ix=3Sm9" |
21:12:17 | FromDiscord | <Shinyzenith> sent a code paste, see https://paste.rs/5wi |
21:13:43 | FromDiscord | <Elegantbeef> Wlrdebug\` |
21:13:50 | FromDiscord | <Elegantbeef> Need that capital |
21:14:03 | FromDiscord | <Shinyzenith> Yep I realized that and changed it to Wlrdebug |
21:14:05 | FromDiscord | <Shinyzenith> it's in the error logs |
21:14:16 | FromDiscord | <Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/953400765223931914/unknown.png |
21:14:31 | FromDiscord | <Elegantbeef> What's the definition of `noop`? |
21:14:52 | FromDiscord | <Shinyzenith> Oh that's no longer needed, I removed that too |
21:15:15 | FromDiscord | <Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3Smb |
21:15:41 | FromDiscord | <Shinyzenith> if I get the type mismatch fixed, the missing parameter callback won't take too long |
21:15:58 | FromDiscord | <Elegantbeef> You need to pass a callback as the second parameter |
21:16:08 | FromDiscord | <Elegantbeef> so if you dont want anything pass `nil` |
21:16:40 | FromDiscord | <Elegantbeef> The compiler is saying the issue |
21:16:44 | FromDiscord | <Shinyzenith> huh passing nil fixed it but the type mismatch is also gone |
21:16:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Smd |
21:17:08 | FromDiscord | <Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3Sme |
21:17:10 | FromDiscord | <Elegantbeef> The type mismatch is the callback missing |
21:17:11 | FromDiscord | <Shinyzenith> I thought the typemismatch was for the log level enum |
21:17:19 | FromDiscord | <Shinyzenith> Thank you so much!! |
21:17:27 | FromDiscord | <Shinyzenith> this is why coding at 3 am is bad 🥴 |
21:17:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Smf |
21:18:04 | FromDiscord | <Elegantbeef> No problem |
21:18:48 | FromDiscord | <Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3Smi |
21:19:01 | FromDiscord | <Shinyzenith> Oh and by any chance are you experienced in futhark? |
21:20:47 | FromDiscord | <Elegantbeef> I've used it all of 3 seconds |
21:21:03 | FromDiscord | <Elegantbeef> I know how it works and what it does somewhat |
21:23:12 | FromDiscord | <Shinyzenith> oh |
21:23:24 | FromDiscord | <Shinyzenith> I'll ask either way |
21:23:57 | * | nrds quit (Remote host closed the connection) |
21:24:19 | * | nrds joined #nim |
21:24:32 | FromDiscord | <Shinyzenith> Basically I have a C header files which depends on another header file which is supposed to be made at compile time and then called, this is done via wayland-scanner ↵I can compile the header but I don't know how to get it to futharks workspace for it to work 🥲 |
21:32:19 | * | kaarmu joined #nim |
21:42:55 | * | wyrd quit (Ping timeout: 240 seconds) |
21:45:02 | * | wyrd joined #nim |
22:03:38 | * | kaarmu quit (Quit: WeeChat 3.4.1) |
22:10:15 | * | ltriant joined #nim |
22:45:50 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:42:57 | * | systemdsucks quit (Remote host closed the connection) |
23:45:13 | * | systemdsucks joined #nim |
23:54:01 | FromDiscord | <retkid> after programming in c++ for a day I've fallen in love with Nim all over again |
23:55:23 | FromDiscord | <retkid> sent a code paste, see https://paste.rs/CAW |
23:55:50 | nrds | <Prestige99> Lol |
23:55:51 | FromDiscord | <retkid> everything about this language is antiquated and feels needlessly roundabout, kinda like "we did this solely to make out code look worse" |
23:56:35 | FromDiscord | <retkid> and this isn't an OLD language. Ada came out before this |
23:57:06 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3SmJ |
23:57:09 | FromDiscord | <retkid> or what about |
23:58:19 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3SmK |
23:59:45 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3SmL |
23:59:58 | FromDiscord | <retkid> FUCKING COBOL |