00:23:29 | FromDiscord | <Schelz> can somebody tell me why this ``proc testfunc(a, b: cint): int {.importcpp: "testfunc(@)", header: "function.h".} = result = a+b echo testfunc(2, 3) ``↵returns ``undefined reference to testfunc(int, int)`` |
00:23:49 | FromDiscord | <Schelz> (edit) removed "" | "result" => "↵result" |
00:24:04 | FromDiscord | <Schelz> (edit) "``proc" => "↵``proc" |
00:24:14 | FromDiscord | <Schelz> (edit) "can somebody tell me why this ↵``proc testfunc(a, b: cint): int {.importcpp: "testfunc(@)", header: "function.h".} = ↵result = a+b echo testfunc(2, 3) ``↵returns ``undefined reference to testfunc(int, int)``" => "sent a long message, see http://ix.io/3RrZ" |
00:35:15 | PMunch | Get it while it's hot! Ratel v0.2.0: https://github.com/PMunch/ratel/tree/v0.2.0 |
00:35:34 | FromDiscord | <Elegantbeef> Nah hot stuff burns |
00:35:48 | PMunch | @Elegantbeef, it uses nimscripter ;) |
00:35:55 | * | neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat) |
00:36:04 | FromDiscord | <Elegantbeef> Shame |
00:36:26 | FromDiscord | <b4mbus> |
00:36:43 | FromDiscord | <Elegantbeef> Like i said in the issue though pmunch `requires "compiler"` is nothing but a headache |
00:37:35 | * | ltriant joined #nim |
00:37:44 | PMunch | I know.. |
00:37:52 | PMunch | But what I did in nimlsp is more of a headache :P |
00:38:34 | FromDiscord | <Elegantbeef> Just make a config with `--path:"$nim"` and it solves the versioning issue |
00:39:09 | FromDiscord | <Elegantbeef> Given that ratel is using it for a binary i think it should be fine |
00:39:11 | PMunch | Hmm, is $nim set automatically in a config? |
00:39:49 | FromDiscord | <Elegantbeef> It will use add the active compiiler's path to the library path, so yes |
00:40:04 | FromDiscord | <Elegantbeef> It's set somewhere atleast |
00:40:27 | FromDiscord | <Elegantbeef> Wonder if I can always use that config, no clue |
00:40:28 | * | neurocyte0917090 joined #nim |
00:41:02 | FromDiscord | <Elegantbeef> Does putting a `nimscripter.nims` in `src` work... hmmm |
00:41:03 | PMunch | I just tried to pass it as a configuration option and that obviously failed |
00:41:18 | PMunch | What do you mean? |
00:41:55 | FromDiscord | <Elegantbeef> well ideally I make it so the program doesnt need `--path:"$nim"` |
00:42:12 | FromDiscord | <Elegantbeef> So if i move the config to the `src` directory, it might use that? |
00:42:36 | * | ltriant quit (Ping timeout: 272 seconds) |
00:44:00 | PMunch | Ah, no I don't think so |
00:44:15 | PMunch | That's why I do `import boardConf` in Ratel |
00:44:43 | FromDiscord | <Elegantbeef> Ugh |
00:44:58 | FromDiscord | <Elegantbeef> Adding nim to the path isnt the end of the world, but it very much isnt ideal |
00:45:08 | PMunch | Oh wait, it might actually use it for binary building |
01:01:37 | * | icebattle quit (Ping timeout: 240 seconds) |
01:16:16 | PMunch | Yup, just pushed a tiny fix to the repo to use that instead |
01:16:43 | PMunch | By the way, do you know why it messes up if I add the `os` import? |
01:17:22 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/issues/11 |
01:17:34 | FromDiscord | <Elegantbeef> I looked at it, still not certain how to fix it |
01:17:47 | PMunch | Ah, bummer |
01:18:08 | PMunch | I wanted to check if a file existed in the upload hook and if not run the build hook manually |
01:18:17 | PMunch | *automatically |
01:20:28 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter/vmops.nim might work for you |
01:20:53 | FromDiscord | <Elegantbeef> Might need more ops exposed |
01:21:13 | PMunch | I guess I could check if it was listed in listFiles |
01:21:27 | FromDiscord | <Elegantbeef> Well that module can always be expanded |
01:22:14 | PMunch | Yeah I know, I just want to easy the friction of anyone wanting to use this |
01:24:33 | FromDiscord | <Mysterysib> Hey, are there any docs for lambdas in nim? |
01:25:00 | FromDiscord | <Elegantbeef> Lambdas in nim are just anonymous functions, there are sugar for `=>` and `->` in std/sugar |
01:26:02 | FromDiscord | <Elegantbeef> Do you have any more elaborate questions? |
01:32:22 | FromDiscord | <Mysterysib> Thanks. Just playing around with it atm, but I'm trying to figure out the position of the anon function in the params and how to define both the data type and lambda itself |
01:32:58 | FromDiscord | <Elegantbeef> `var myAnon = proc(a: int, b: string): float = echo a, " ", b` |
01:33:27 | FromDiscord | <Mysterysib> ahhh perfect tysm, proc was what I missed thought I could just write it |
01:34:26 | FromDiscord | <Elegantbeef> With sugar imported you can write it `(a: int, b: string): float => echo a, " ", b` afaik, though i dont really use anonymous procedures much |
01:35:16 | FromDiscord | <Mysterysib> I like them sometimes just so that the code is easier to read and I don't have hundreds of small functions doing one or two operations and are only used once |
01:36:04 | FromDiscord | <Evrensel Kişilik> meoooow |
01:36:15 | FromDiscord | <Evrensel Kişilik> i got a cute name for online debugger |
01:36:18 | FromDiscord | <Evrensel Kişilik> https://debugme.online/ |
01:36:43 | FromDiscord | <Mysterysib> sadly debug.me was probably taken :l |
01:36:46 | FromDiscord | <Mysterysib> but it's still cute |
01:37:00 | FromDiscord | <Evrensel Kişilik> yessss |
01:37:40 | FromDiscord | <loaf> i know i keep asking dumb questions but is there a way to use all parts of an array in a proc without it making a for loop |
01:37:51 | FromDiscord | <Mysterysib> while ago I was making a website for certain crypto exchanges and I secured xch.io, and the exchange was named ExchangeDog, but I quit paying for it |
01:38:09 | FromDiscord | <Elegantbeef> "use all parts"? |
01:38:14 | FromDiscord | <loaf> like instead of |
01:38:56 | FromDiscord | <loaf> sent a code paste, see https://play.nim-lang.org/#ix=3Rs9 |
01:39:10 | FromDiscord | <loaf> more like proc(array.all) |
01:39:16 | FromDiscord | <Elegantbeef> `import std/sequtils; myArray.apply(myProc)` |
01:39:42 | FromDiscord | <loaf> oh okay |
01:39:57 | FromDiscord | <Elegantbeef> can also do `applyIt` |
01:40:36 | FromDiscord | <Mysterysib> I was thinking of using a lambda for that but that's a lot better. Apply reminds me of something.. forget what, some data science language. maybe R |
01:41:05 | FromDiscord | <huantian> If proc doesnt return a value the for loop is probably the best |
01:41:07 | FromDiscord | <huantian> Imo |
01:41:11 | FromDiscord | <Elegantbeef> yea templates that expose an `it` are nicer than lambdas 😛 |
01:41:25 | FromDiscord | <Elegantbeef> There is a variant of `apply` that doesnt mutate the collection |
01:41:51 | FromDiscord | <loaf> is it functionally still just a for loop? |
01:42:00 | FromDiscord | <Elegantbeef> Of course |
01:42:17 | FromDiscord | <Mysterysib> What's an `it`? |
01:42:28 | FromDiscord | <Elegantbeef> There's no otherway unless you inline it |
01:43:00 | FromDiscord | <Elegantbeef> `applyIt` makes a variable for each iteration which is `it` so you then can do things like `[10, 20, 30].applyIt(echo it)` which would echo each element |
01:43:30 | FromDiscord | <Mysterysib> That's really cool |
01:47:19 | PMunch | I really want Eritrea to start dishing out their TLD |
01:47:25 | PMunch | That way I could try and snatch pet.er |
01:47:42 | FromDiscord | <Elegantbeef> Ah yes pet her |
01:47:54 | PMunch | Pet her? I hardly know her! |
01:48:21 | FromDiscord | <Elegantbeef> Didnt expect that response from you 😀 |
01:48:34 | PMunch | Haha, why not= |
01:48:48 | FromDiscord | <loaf> what if the proc takes multiple arguments |
01:48:50 | FromDiscord | <huantian> Sounds like Ethoslab :p |
01:49:25 | FromDiscord | <Elegantbeef> Expect it more from someone who was from an English country |
01:50:27 | FromDiscord | <Elegantbeef> Use `applyIt` or just use a for loop↵(@loaf) |
01:50:33 | FromDiscord | <Elegantbeef> There isnt any reason really to avoid it |
01:51:07 | PMunch | I've been on the internet for longer than some of the people in this channel, my repertoire of english jokes and slangs is quite impressive |
01:51:24 | FromDiscord | <Elegantbeef> But you still sometimes forget V and W are different 😛 |
01:51:36 | FromDiscord | <loaf> i guess the main reason to avoid it is to easily fit it on one line |
01:51:48 | FromDiscord | <Elegantbeef> `for x in arr: proc(x, y)` |
01:51:53 | FromDiscord | <loaf> okay yeah |
01:51:54 | PMunch | Well that's just my pronunciation :P |
01:51:55 | FromDiscord | <Elegantbeef> We did it we one lined it |
01:52:07 | FromDiscord | <huantian> Why are people so obsessed with onelining |
01:52:19 | FromDiscord | <loaf> why bother with apply at all then |
01:52:19 | FromDiscord | <Elegantbeef> Cause one lining means the code is simple or something |
01:52:26 | FromDiscord | <Elegantbeef> It's why i write C++ on one line |
01:52:32 | FromDiscord | <huantian> It’s fine when its short like that, but its just horrible to read when it gets long |
01:52:33 | FromDiscord | <Elegantbeef> Cause apply is more FPy and there are FPy people |
01:52:43 | PMunch | I mean I tend to one-line quite a few things |
01:52:45 | FromDiscord | <huantian> And it mutates the array as well |
01:52:58 | FromDiscord | <Elegantbeef> It doesnt have to mutate |
01:53:04 | PMunch | Sometimes it just makes it easier to read the code if each line does it's own logic |
01:53:05 | FromDiscord | <Elegantbeef> There are pure variants of apply |
01:53:33 | FromDiscord | <Elegantbeef> I'm not opposed to one lining, but we're trying to one line for no real reason at points |
01:53:41 | * | icebattle joined #nim |
01:53:44 | FromDiscord | <Elegantbeef> Like i hate one line if expressions |
01:54:00 | PMunch | If you have one important function call between five loops which just applies a function to an array I'd rather have 6 lines 5 of which are fairly similar than a bunch of lines where I might miss the important procedure call |
01:54:22 | PMunch | I mean sometimes they make sense |
01:54:53 | PMunch | I love ternaries in C and the similar if statements in Nim |
01:55:01 | FromDiscord | <Elegantbeef> It's harder to read imo |
01:55:09 | PMunch | Naming things is hard, why create more variables than I have to? |
01:55:15 | FromDiscord | <Elegantbeef> I dont mind if expressions, i use them frequently, my issue is doing it on one line is just hard to read |
01:55:36 | PMunch | Ah right |
01:55:39 | PMunch | Fair enough |
01:55:49 | PMunch | Depends a bit on how long it is though |
01:56:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rsi |
01:56:15 | PMunch | For example for Ratel I had `if not fileExists(file): build(file & ".nim")` |
01:56:18 | FromDiscord | <Elegantbeef> Eh i never one line if expressions regardless of length |
01:56:29 | PMunch | At the top of the procedures which needed the file |
01:56:38 | PMunch | That's a oneliner I appreciate |
01:56:56 | FromDiscord | <Elegantbeef> Yea i pretty much avoid all one liners |
01:57:01 | FromDiscord | <Elegantbeef> I prefer vertical over horizontal code |
01:57:09 | PMunch | Like the procedure itself is one line, so adding a two line check to it doesn't make much sense |
01:57:19 | PMunch | Now the procedure is suddenly more check than content |
01:57:49 | PMunch | Just flip your monitor around, problem solved! |
01:57:58 | FromDiscord | <Elegantbeef> Lol |
01:58:12 | FromDiscord | <Elegantbeef> I have 3 monitors so let me put them all in portrait mode so i can program in java |
01:58:19 | PMunch | Haha |
01:58:29 | PMunch | I actually have one of my three monitors in portrait mode |
01:58:34 | FromDiscord | <Elegantbeef> Fuck i meant landscape |
01:58:36 | PMunch | Mostly have IRC on it though :P |
01:58:47 | FromDiscord | <Elegantbeef> Hey same |
01:58:50 | FromDiscord | <Elegantbeef> Two landscape 1 portrait |
01:59:00 | FromDiscord | <Elegantbeef> portrait is best aspect for splitting imo |
01:59:06 | PMunch | Splitting? |
01:59:19 | FromDiscord | <Elegantbeef> having multiple windows open |
01:59:37 | PMunch | Hmm, I guess in a way |
01:59:37 | FromDiscord | <huantian> I wanna do that thing when you get two vertical monitors and have the, right next to each other |
01:59:39 | FromDiscord | <Elegantbeef> 9\:16 split gives you more horizontal space vs landscape |
01:59:58 | PMunch | True |
02:00:05 | FromDiscord | <Elegantbeef> Most applications benefit from horizontal space i reason |
02:00:18 | PMunch | I prefer moving my head side to side though |
02:00:57 | PMunch | But maybe I should try and flip all my monitors just for fun |
02:01:09 | PMunch | Maybe I'll like it |
02:01:09 | FromDiscord | <Elegantbeef> You dont game do you? 😛 |
02:01:16 | FromDiscord | <huantian> Diagonal monitor is the best |
02:01:20 | PMunch | Haha, actually just gotten into some Elden Ring |
02:01:26 | PMunch | But man do I suck at that game |
02:01:36 | FromDiscord | <Elegantbeef> First soulslike? |
02:01:39 | PMunch | Well I guess it's a Souls game so it's supposed to be hard.. |
02:01:43 | PMunch | Yeah |
02:02:00 | FromDiscord | <Elegantbeef> Ah welcome to hell |
02:02:14 | PMunch | I don't really play much to begin with, but this was so hyped and I was curious how it would run on Linux via Proton on day 1 |
02:02:23 | FromDiscord | <Elegantbeef> My favourite souls like isnt even a from software game, it's salt and sanctuary so I'm an odd duck |
02:02:28 | PMunch | I mean the game is fun, and really cool aesthetic |
02:02:32 | FromDiscord | <Elegantbeef> Yea worked "flawlessly" day 1 i heard |
02:02:38 | FromDiscord | <Elegantbeef> Minus the stutter issue |
02:02:46 | FromDiscord | <huantian> I never got into those kinds of game |
02:03:01 | PMunch | Tiny stutter and I have to use experimental Proton, but apart from that it's flawless |
02:03:14 | PMunch | Oh and the cutscenes seems to be a bit oddly timed |
02:03:28 | PMunch | Like the text seems to go out of sync with the animations |
02:03:35 | FromDiscord | <huantian> I like games for the graphics but dying is too easy |
02:03:59 | PMunch | I do want to get my hands on an old wired Xbox 360 controller though |
02:04:17 | PMunch | I feel like the game was really designed for controllers |
02:04:18 | FromDiscord | <Elegantbeef> Wait are you playing it without a controller? |
02:04:29 | PMunch | Mhm, keyboard and mouse |
02:04:39 | FromDiscord | <Elegantbeef> Well there's your problem |
02:04:46 | PMunch | But I mean to get on my horse it's E+right arrow |
02:05:03 | PMunch | Which means I need to move my hand off-of my mouse and have two hands on the keyboard |
02:05:15 | PMunch | And moving is just a pain, basically impossible to strafe |
02:05:31 | FromDiscord | <Elegantbeef> Yea DS with KBM is masochistic |
02:05:44 | nrds | <Prestige99> been playing apex on linux, been great |
02:05:50 | FromDiscord | <Elegantbeef> It's a game series that really only becomes playable with a controller |
02:05:54 | nrds | <Prestige99> well, performance-wise |
02:06:08 | PMunch | Haha, good to know it's not just me thinking I'd be better at it with a controller :P |
02:06:11 | FromDiscord | <Elegantbeef> My trusty steam controller got me through most of DS1 and DS3 😛 |
02:07:19 | FromDiscord | <Elegantbeef> Apex does work well, cant wait for more games. Still waiting for hunt showdown though seems that's never going to happen |
02:08:45 | PMunch | I remember playing MDK back in the day (yes I'm old..) and getting my ass handed to me. Tried it a few years later with a controller and wiped the floor with my enemies :P |
02:08:59 | PMunch | Some guys really just aren't meant for keyboard and mouse |
02:09:10 | FromDiscord | <Elegantbeef> MDK? |
02:09:16 | PMunch | Ooh, maybe I should get myself a steam controller |
02:09:22 | PMunch | https://en.wikipedia.org/wiki/MDK |
02:09:27 | FromDiscord | <Elegantbeef> Good luck they're no longer produced |
02:10:23 | PMunch | Old shooter game, IIRC it was one of the first games where you could actually snipe because the rendering engine was optimised so well you could actually have large levels without an oppressive distance fog |
02:10:36 | FromDiscord | <Elegantbeef> At one point valve sold their remaining stock for $1 a controller iirc, sadly was too late could've got a second one, i really like mine |
02:11:02 | PMunch | "Because the game was attempting things never before seen in a PC game, the team decided to write their own programming language from scratch." |
02:11:24 | PMunch | Damn, not even just a new rendering engine, they made a completely new language for it |
02:14:21 | PMunch | The game's original system requirements were a 60 MHz Pentium (although 90 MHz was recommended), 16MB of RAM, 17MB of hard drive storage for basic installation (37MB for full installation) |
02:14:35 | PMunch | For a fully software-rendered 3D game |
02:16:12 | FromDiscord | <typedeck> How do i know if {.compile:"foo.c".} gets linked correctly? |
02:16:35 | PMunch | It should be |
02:16:48 | PMunch | I mean I guess you know by testing if it works.. |
02:17:00 | FromDiscord | <typedeck> It doesnt, lol |
02:17:21 | PMunch | What exactly are you trying to do? |
02:17:55 | FromDiscord | <typedeck> sent a code paste, see https://paste.rs/usa |
02:18:05 | PMunch | I mean the game is a bit basic, but all of this crammed into 17MB?! https://www.youtube.com/watch?v=7KxhI2xSfTA |
02:18:40 | FromDiscord | <typedeck> it crashes on execution |
02:19:10 | FromDiscord | <typedeck> when staticly linked it says can not find ref to said functions |
02:20:15 | FromDiscord | <typedeck> sent a code paste, see https://paste.rs/rz4 |
02:20:17 | PMunch | Most likely you've just messed up a signature |
02:20:40 | PMunch | May I interest you in Futhark? The main example is basically exactly what you're trying to do: https://github.com/pmunch/futhark |
02:20:40 | FromDiscord | <typedeck> buggers, I ran it through c2nim |
02:20:59 | PMunch | Ah, well there's your problem :P |
02:21:12 | FromDiscord | <typedeck> oh c2nim not so good? |
02:21:25 | PMunch | Personally I've never gotten it to work |
02:21:31 | PMunch | Which is why I wrote Futhark |
02:22:11 | FromDiscord | <typedeck> oh nice, ill read up on it |
02:22:37 | PMunch | I mean you could literally just copy the example which actually uses stb_image |
02:23:40 | FromDiscord | <Elegantbeef> Depending what you're doing/wanting you could also use Pixie and dont have to worry about linking 😛 |
02:23:44 | FromDiscord | <typedeck> which parts of the example is using the futhark module |
02:24:03 | FromDiscord | <typedeck> the importc: and static: ? |
02:24:14 | PMunch | Nope, only the importc |
02:24:25 | PMunch | static is just Nim for "run this on compile-time" |
02:24:47 | PMunch | It's only the `importc` block there which is Futhark code |
02:26:57 | FromDiscord | <typedeck> syspath for windows would be \mingw64\include instead of clang/12.0.1/include ? |
02:27:39 | PMunch | Yeah that would probably work |
02:28:00 | PMunch | You do need clang though for Futhark to work, so you can just as well link to the libraries that it ships |
02:28:50 | FromDiscord | <typedeck> I see that now, futhark failed ot build |
02:28:54 | FromDiscord | <typedeck> (edit) "ot" => "to" |
02:29:20 | PMunch | Yeah, see the installation section for more details: https://github.com/pmunch/futhark#installation |
02:30:04 | PMunch | The paths on Windows are also a bit messy. I've developed the whole thing on Linux and haven't found anyone with enough Nim knowhow who runs Windows to help me make it more robust over there |
02:30:45 | PMunch | But once you've got it running it's basically magic |
02:32:05 | PMunch | But I've gotta go to bed now |
02:32:11 | * | PMunch quit (Quit: leaving) |
02:32:15 | FromDiscord | <typedeck> ty for the help! |
02:37:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "The paths on Windows": yeah, I had some trouble too, but as he said, when everything is set up, it works like magic |
02:39:01 | FromDiscord | <typedeck> im fighting spaces in paths, lol |
02:39:53 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rst |
02:40:29 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @typedeck "im fighting spaces in": ah exactly the same trouble as me |
02:40:41 | FromDiscord | <System64 ~ Flandre Scarlet> okay so copy the LLVM folder to C:\ |
02:40:50 | FromDiscord | <typedeck> lol ofc |
02:40:55 | FromDiscord | <System64 ~ Flandre Scarlet> you did that? |
02:41:57 | FromDiscord | <typedeck> yeah that worked |
02:42:28 | FromDiscord | <typedeck> wonder how you pass spaces to --passL |
02:42:55 | FromDiscord | <System64 ~ Flandre Scarlet> no idea |
02:43:45 | FromDiscord | <huantian> Try putting literal “ around the path inside the string |
02:44:31 | FromDiscord | <typedeck> no that completely breaks it |
02:44:48 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rsu |
02:45:09 | FromDiscord | <huantian> No like \” |
02:45:15 | FromDiscord | <huantian> (edit) "\”" => "\\”" |
02:45:20 | FromDiscord | <Elegantbeef> do \`--passL\:"-L'C\:\\Program Files\\LLVM\\bin'" |
02:46:01 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix= |
02:46:08 | FromDiscord | <typedeck> breaks at the space still |
02:46:35 | FromDiscord | <Rika> doesn’t look like it to me |
02:47:11 | FromDiscord | <typedeck> for one its not looking in C: but in project directory in the last one |
02:47:23 | FromDiscord | <System64 ~ Flandre Scarlet> try --passL:"-L'C:/Program Files/LLVM/bin |
02:47:31 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "Files/LLVM/bin" => "Files/LLVM/bin'"" |
02:47:56 | FromDiscord | <typedeck> sent a code paste, see https://paste.rs/ZP4 |
02:48:17 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rsv |
02:48:50 | FromDiscord | <typedeck> same with single quotes |
02:48:50 | FromDiscord | <System64 ~ Flandre Scarlet> and ``--passL:"-L'C:/Program\ Files/LLVM/bin'"`` ??? |
02:49:17 | FromDiscord | <typedeck> same with that |
02:49:17 | FromDiscord | <Rika> That sounds broken, might be a nimble issue |
02:50:37 | * | neurocyte0917090 quit (Ping timeout: 240 seconds) |
02:50:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @typedeck "same with that": try to copy the llvm folder into the root of C: |
02:51:14 | FromDiscord | <typedeck> yeah that worked |
02:51:23 | FromDiscord | <typedeck> im just fiddling with spaced directories |
02:51:58 | FromDiscord | <System64 ~ Flandre Scarlet> you still try with spaces? |
02:53:02 | FromDiscord | <typedeck> the spaces paths are broken, ill just use C:/, just that llvm installs in "Program Files" so kinda awkward |
02:53:52 | * | ltriant joined #nim |
02:54:04 | FromDiscord | <System64 ~ Flandre Scarlet> copy the LLVM folsze inro C:/↵And then, do --passL:"-LC:/LLVM/bin |
02:54:39 | FromDiscord | <typedeck> yup, works |
02:54:56 | FromDiscord | <System64 ~ Flandre Scarlet> nice |
02:55:04 | FromDiscord | <System64 ~ Flandre Scarlet> now what does it say? is it installed? |
02:55:34 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix= |
02:55:55 | FromDiscord | <System64 ~ Flandre Scarlet> Nice, here you go! |
02:59:24 | * | ltriant quit (Ping timeout: 240 seconds) |
03:15:39 | * | arkurious quit (Quit: Leaving) |
03:19:59 | FromDiscord | <typedeck> wow ok i figured out my problem at large, the mingw gcc in my path compiled binaries that were not compatable with the mingw that nim uses |
03:20:24 | FromDiscord | <typedeck> so i had to remove my previous mingw from the path and add the mingw dist with nim |
03:20:44 | FromDiscord | <typedeck> (edit) "dist" => "that distributes" |
03:21:22 | FromDiscord | <typedeck> maybe have {.compile} use dist mingw gcc instead of path |
03:22:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @typedeck "wow ok i figured": which bins are you trying to compile? |
03:22:43 | FromDiscord | <typedeck> {.compile:"stb_image.c".} works now, even without futhark |
03:24:32 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3RsC |
03:26:46 | FromDiscord | <typedeck> hmm i guess i just didnt have mingw64 isntall |
03:26:57 | FromDiscord | <typedeck> (edit) "isntall" => "installed" |
03:27:23 | FromDiscord | <typedeck> (edit) "installed" => "installed, but {.compile} didnt check that it was using 64bit" |
03:27:36 | FromDiscord | <typedeck> (edit) "hmm i guess i just didnt have mingw64 installed, but {.compile} didnt check that it was using ... 64bit" added "32bit instead of" |
03:33:31 | * | ltriant joined #nim |
03:35:37 | FromDiscord | <Bung> wheres old version nim document ? didn't it exists here? https://nim-lang.org/documentation.html |
03:36:25 | FromDiscord | <xflywind> Which version you need? |
03:36:32 | FromDiscord | <Bung> 1.4 |
03:37:08 | FromDiscord | <xflywind> You can specify the version number like this: https://nim-lang.org/1.4.8/tut1.html |
03:38:14 | FromDiscord | <Bung> oh, that's nice |
03:40:13 | FromDiscord | <Bung> I just add CI to nimlsp https://github.com/bung87/nimlsp/runs/5436490105?check_suite_focus=true it only fails on windows, dont know the reason |
03:40:28 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=3RsH |
04:01:05 | * | rockcavera quit (Remote host closed the connection) |
04:03:00 | NimEventer | New thread by Elcritch: Fidget UI: animation using Nim async , see https://forum.nim-lang.org/t/8982 |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:34:23 | * | ltriant quit (Ping timeout: 256 seconds) |
04:53:53 | * | slowButPresent quit (Quit: leaving) |
05:21:21 | FromDiscord | <sOkam!> In reply to @sOkam! "Any clue what I": Any pointers?↵It must be in front of my face, but I'm super lost↵What type of cases would case this type of error? |
05:21:47 | FromDiscord | <Elegantbeef> Isnt it clear |
05:21:50 | FromDiscord | <sOkam!> It has worked before, I'm just restructuring and I must have missed something |
05:21:57 | FromDiscord | <Elegantbeef> You're passing a ptr uint32 instead of Gluint |
05:22:24 | FromDiscord | <sOkam!> In reply to @Elegantbeef "You're passing a ptr": but its pointing to the same thing than before |
05:22:50 | FromDiscord | <Elegantbeef> Missing a converter? |
05:23:34 | FromDiscord | <sOkam!> This is the original code, I'm just changing the structure of things https://github.com/nimgl/nimgl/blob/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/examples/topengl.nim#L72 |
05:25:05 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Missing a converter?": could it change anything that the values are initialized like this? https://media.discordapp.net/attachments/371759389889003532/949900404559327302/unknown.png |
05:25:21 | FromDiscord | <Elegantbeef> `uint32` |
05:25:48 | FromDiscord | <sOkam!> it has worked before with uint32 |
05:26:32 | FromDiscord | <Elegantbeef> What's the error |
05:26:32 | FromDiscord | <sOkam!> Which is what the original uses https://github.com/nimgl/nimgl/blob/309d6ed8164ad184ed5bbb171c9f3d9d1c11ff81/examples/topengl.nim#L55 |
05:26:35 | FromDiscord | <Elegantbeef> And line |
05:27:54 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3RsV |
05:29:41 | FromDiscord | <demotomohiro> I think GLsizei is unsigned int. |
05:29:44 | FromDiscord | <sOkam!> Its something to do with the value of that vbo thing, but it has been uint32 before and it worked. So its something to do with the restructuring https://media.discordapp.net/attachments/371759389889003532/949901577630658610/unknown.png |
05:30:21 | * | ltriant joined #nim |
05:31:20 | FromDiscord | <demotomohiro> Which type is mismatching? Please show all error messages. |
05:31:33 | FromDiscord | <sOkam!> how to show more error messages? |
05:31:40 | FromDiscord | <Elegantbeef> lol |
05:31:48 | FromDiscord | <Elegantbeef> The issue is they're doing `glGenBuffers (1, x)` |
05:31:49 | FromDiscord | <sOkam!> thats all the output of the cli |
05:31:54 | FromDiscord | <Elegantbeef> That's a command call with tuple |
05:32:00 | FromDiscord | <Elegantbeef> remove the fucking spaces! |
05:32:20 | FromDiscord | <demotomohiro> Maybe, space between procedure name and `(` is a root of problem. |
05:32:38 | FromDiscord | <sOkam!> ill try |
05:33:01 | FromDiscord | <Elegantbeef> that's not a anger "fucking" it's a laughing |
05:33:08 | FromDiscord | <Rika> beef wtf so rude |
05:33:15 | FromDiscord | <Rika> i cant believe you |
05:33:16 | FromDiscord | <Elegantbeef> lol rika |
05:33:26 | FromDiscord | <sOkam!> 😄 |
05:33:32 | FromDiscord | <Rika> now youre laughing at me wtf |
05:33:36 | FromDiscord | <sOkam!> welp that changed the error line, so yep |
05:34:28 | FromDiscord | <Elegantbeef> RFC\: Make it so a command call that gets a tuple unpacks the tuple if it matches the arguments of a overload 😛 |
05:34:52 | FromDiscord | <Rika> not a good idea id say |
05:35:00 | * | ltriant quit (Ping timeout: 240 seconds) |
05:38:05 | FromDiscord | <Elegantbeef> I agree morer just a joke due to this common noob trabp |
05:38:08 | FromDiscord | <Elegantbeef> trap even |
05:38:40 | FromDiscord | <Rika> morer |
05:38:44 | FromDiscord | <Rika> trabp |
05:39:22 | FromDiscord | <Elegantbeef> Will i ever be able to type and proofread a message, guess we'll never know |
05:41:36 | FromDiscord | <demotomohiro> If Nim compiler found command call syntax with 1 tuple arugment but no matching proc, how about to show message like "You might need to remove space between proc name and `(`". |
05:41:48 | FromDiscord | <Elegantbeef> That also could work |
05:43:00 | FromDiscord | <Rika> that would work best |
05:43:15 | FromDiscord | <Elegantbeef> Who makes the PR? |
05:43:25 | FromDiscord | <Elegantbeef> I votee RIka |
05:43:33 | FromDiscord | <Elegantbeef> That one was my keyboard |
05:43:56 | FromDiscord | <Rika> no |
05:44:05 | FromDiscord | <Rika> i dont write PRs or RFCs |
05:44:10 | FromDiscord | <Rika> i mean i could but eh |
05:44:11 | FromDiscord | <Rika> idk |
05:44:37 | FromDiscord | <Mysterysib> Does nim have a this pointer? |
05:44:51 | FromDiscord | <Elegantbeef> Nim isnt C#/Java so no |
05:45:17 | FromDiscord | <Elegantbeef> Unless you mean something else by "this pointer\: |
05:45:19 | FromDiscord | <Mysterysib> Doesn't C++ have it to? |
05:45:33 | FromDiscord | <Elegantbeef> Sure Nim isnt OOP though |
05:45:38 | FromDiscord | <demotomohiro> C++ has this pointer. |
05:45:39 | FromDiscord | <Rika> nim is closer to C |
05:45:41 | FromDiscord | <Rika> than C++ |
05:45:44 | FromDiscord | <Rika> in this sense |
05:45:45 | FromDiscord | <Elegantbeef> It doesnt have class scopes so `this` is ambigious |
05:45:59 | FromDiscord | <Mysterysib> Yeah I feel that it's like C |
05:46:05 | FromDiscord | <Rika> everything is a regular function and there is no sense of class bound functions |
05:46:39 | FromDiscord | <Rika> it (kinda) doesnt really need class bound functions because of mcs anyway |
05:46:44 | FromDiscord | <Elegantbeef> Well typehooks are type bounds 😀 |
05:47:12 | FromDiscord | <demotomohiro> If first parameter is ref or pointer, I assume it is this pointer. |
05:47:20 | FromDiscord | <Rika> by type bound i mean functions that come with the type without explicit import or explicit storage in the type |
05:48:39 | FromDiscord | <demotomohiro> In C++, compiler implicitly pass this pointer. In Nim, you pass it explicitly. |
05:49:39 | FromDiscord | <loaf> so i have a list of objects, with some types being inherited from others. is there a way to only get a specific type? |
05:49:55 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Rt5 |
05:50:51 | FromDiscord | <loaf> like for example |
05:51:34 | FromDiscord | <Rika> In reply to @sOkam! "does object have a": objects are always empty unless specified otherwise, wdym? |
05:51:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rt7 |
05:51:58 | FromDiscord | <loaf> oh |
05:51:58 | FromDiscord | <demotomohiro> You can search for a specific type using `of` operator. |
05:53:05 | FromDiscord | <sOkam!> In reply to @Rika "objects are always empty": ah nvm, i was reading the wrong number 🧑🔧 |
05:53:47 | FromDiscord | <sOkam!> it printed a number once, fixed it, printed a different one next, but misread and thought it was the same line giving the issue |
05:55:40 | FromDiscord | <Rika> classic |
05:59:07 | FromDiscord | <Elegantbeef> Guess i should note that you can get any child type of that subtype with `of` |
06:08:32 | FromDiscord | <sOkam!> are there any extra tools to debug nim code, other than the compiler? |
06:08:54 | FromDiscord | <Elegantbeef> Native debuggers such as GDB |
06:09:12 | FromDiscord | <Elegantbeef> Since you're doing graphics programming render doc also is there to help |
06:10:16 | FromDiscord | <Elegantbeef> Unless you're talking about static errors |
06:10:23 | FromDiscord | <Elegantbeef> Then nope, read the error message and fix the code 😛 |
06:20:37 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Since you're doing graphics": 😮 ty for pointing me towars that app? it looks poggers 🤩 |
06:20:50 | FromDiscord | <sOkam!> (edit) "app?" => "app!" |
06:21:28 | FromDiscord | <Elegantbeef> I regret it now 😛 |
06:29:52 | FromDiscord | <loaf> is there a way to make sure the output of a proc is the same subtype as the input if it can take anything under the larger type? |
06:51:09 | FromDiscord | <Mysterysib> i'm starting to go crazy with pointers and other stuff. I want to pass a function to another function, but not a C function, a regular nim function |
06:51:32 | FromDiscord | <Rika> You don’t need pointers for that |
06:51:58 | FromDiscord | <Mysterysib> Yeah I tend to think that when I cant figure something out the solution is pointers xd |
06:52:04 | FromDiscord | <loaf> i guess the easy way to do that would be to make the result of the function a variable right? |
06:52:36 | FromDiscord | <Rika> In reply to @loaf "i guess the easy": ? |
06:54:36 | FromDiscord | <Mysterysib> Basically I'm attempting to write a function that takes any function as its variable and determines the number of possible return values it has using a for loop (this would be awfully slow in runtime, but it's a statically compiled function) |
06:55:09 | FromDiscord | <Mysterysib> I was trying to figure out how to get the number of parameters a function has and the type |
06:55:24 | FromDiscord | <Mysterysib> I cannot do it when the function takes a string, but otherwise I can |
06:55:36 | FromDiscord | <Mysterysib> (edit) "can" => "should be able to" |
06:55:54 | FromDiscord | <Elegantbeef> Macros are how you'd do that |
06:56:38 | FromDiscord | <Elegantbeef> "possible return values" what does that even mean |
06:56:52 | FromDiscord | <Elegantbeef> `proc doThing: int` can return `int.low .. int.high` |
07:04:10 | FromDiscord | <Rika> You can’t make a runtime function do that (and it doesn’t really make sense to since functions are static anyway) |
07:09:05 | FromDiscord | <Mysterysib> sent a long message, see https://paste.rs/NgN |
07:09:13 | FromDiscord | <Mysterysib> I am like way over my head in this, but yeah |
07:09:42 | FromDiscord | <Mysterysib> I'm guessing there is a much better way to do this with something completely different |
07:09:43 | FromDiscord | <Rika> I can’t read that mess of format |
07:10:01 | FromDiscord | <Mysterysib> (edit) "http://ix.io/3Rto" => "http://ix.io/3Rtp" |
07:10:12 | FromDiscord | <Elegantbeef> Use 3 back ticks before and after (\`) and write the pseudo code |
07:12:12 | FromDiscord | <Elegantbeef> What are you after? |
07:12:30 | FromDiscord | <Elegantbeef> Like written words of the behaviour you want |
07:12:58 | FromDiscord | <Elegantbeef> Remove any aspect of Nim semantics or ideas from the equation |
07:13:33 | FromDiscord | <Mysterysib> In a nutshell, to create functions of which the runtime code and parameters are dependent on the results of another function, that reads a file and parses + does logic on it (so the output is variant on the file) |
07:14:15 | FromDiscord | <Elegantbeef> Is this a long winded way of saying "I want to precompute a cache from a file"? |
07:14:40 | FromDiscord | <Elegantbeef> What does this file contain? |
07:16:18 | FromDiscord | <Mysterysib> The file is a .har in json format storing a bunch of data from request and response to a site. And I guess the shortest way to say this is I want my code to be able to modify itself |
07:16:48 | FromDiscord | <Elegantbeef> Let's see one instance of this file and what you want to happen |
07:17:43 | FromDiscord | <Mysterysib> I think in C++ it's done with templates if that gives you a better idea of what I mean |
07:17:52 | FromDiscord | <Mysterysib> Okay |
07:18:01 | FromDiscord | <Elegantbeef> Nim has generics, but i still dont know what you're trying to do |
07:20:28 | FromDiscord | <Mysterysib> sent a long message, see http://ix.io/3Rtq |
07:21:14 | FromDiscord | <Mysterysib> (edit) "http://ix.io/3Rtr" => "https://paste.rs/NOH" |
07:21:21 | FromDiscord | <Mysterysib> (edit) "http://ix.io/3Rts" => "https://paste.rs/Fmp" |
07:21:50 | FromDiscord | <Mysterysib> now some other Json files may not have a certain datatype, like say some have floats, others do not |
07:23:22 | FromDiscord | <Mysterysib> Based on the number of datatypes (which are in my case statement cases) the original function with the case statement will recursively call itself until its worked with all the data in the json file (already got this part figure out) |
07:23:48 | FromDiscord | <Elegantbeef> I still have 0 clue what's going on |
07:24:05 | FromDiscord | <Elegantbeef> I'm looking for input -\> output for a single case |
07:24:07 | FromDiscord | <Mysterysib> I'm sooorrry okay let me try this |
07:24:31 | FromDiscord | <Mysterysib> A function has a case statement. There are different cases, that end in different returns. |
07:25:27 | FromDiscord | <Mysterysib> This function calls itself recursively while it processes all the data in a dataset, so you get a bunch of returns |
07:25:44 | FromDiscord | <Mysterysib> the return value is stored in an array, or even just echoed |
07:26:18 | FromDiscord | <Mysterysib> but based on the amount and datatype of these possible cases and their returns, I want to define a custom function |
07:26:50 | FromDiscord | <Mysterysib> for instance, with a dynamic number of parameters |
07:26:57 | FromDiscord | <Elegantbeef> Well i can only say read the json data from a macro and emit the procedures |
07:27:05 | FromDiscord | <Elegantbeef> Cause i cannot understand anything you're wanting |
07:30:23 | FromDiscord | <Rika> `that end in different returns` makes no sense, same object with different kind?↵`so you get a bunch of returns` also makes no sense, what does this mean? |
07:30:34 | FromDiscord | <Rika> `but based on the amount and datatype of these possible cases and their returns` ????????? |
07:36:53 | FromDiscord | <Mysterysib> I think I need to use macros. The docs on them are confusing to me, so I will have to practice until I get it |
07:37:12 | FromDiscord | <Mysterysib> but look, this is the code with the different returns and datatypes |
07:37:20 | FromDiscord | <Mysterysib> sent a long message, see http://ix.io/3Rtx |
07:37:31 | FromDiscord | <Mysterysib> (edit) "http://ix.io/3Rtx" => "https://paste.rs/ULN" |
07:38:59 | FromDiscord | <Mysterysib> (edit) "long message," => "code paste," | "http://ix.io/3Rty" => "https://play.nim-lang.org/#ix=3Rtz" |
07:41:56 | FromDiscord | <feldharke> What GUI should I use if I want populate data in a grid(view)? |
07:46:50 | FromDiscord | <Elegantbeef> Are you talking about what library or what program? 😀 |
07:54:00 | FromDiscord | <feldharke> In reply to @Elegantbeef "Are you talking about": Library I think. Programming with Nim |
07:57:32 | FromDiscord | <Elegantbeef> You could use illwill if you want TUI. Gintro, wNim(if windows), or WxNim should be useable for a table gui, not that i know how to use any of them well 😛 |
08:01:34 | FromDiscord | <feldharke> In reply to @Elegantbeef "You could use illwill": Havent' found a database front-end example yet. Do you know one? |
08:01:55 | FromDiscord | <Elegantbeef> Nope |
08:09:34 | FromDiscord | <Hamid_Bluri> Hey, I wanna copy a `NimNode` without it's children |
08:09:43 | FromDiscord | <Hamid_Bluri> what should I do? |
08:10:05 | FromDiscord | <Elegantbeef> `copyNimNode` |
08:11:08 | FromDiscord | <Hamid_Bluri> thanks beef |
08:11:16 | FromDiscord | <Elegantbeef> Or just `newNimNode(myNode.kind)` |
08:31:25 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
08:33:15 | * | jmdaemon joined #nim |
08:43:08 | * | [RMS] quit (Ping timeout: 256 seconds) |
08:45:11 | * | ltriant joined #nim |
08:49:56 | * | ltriant quit (Ping timeout: 256 seconds) |
08:50:53 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=3RtN |
08:51:06 | FromDiscord | <aph> idk why but it works with code runner |
08:51:20 | FromDiscord | <aph> i want to use vscode's terminal because code runner's one is read only |
08:51:35 | FromDiscord | <aph> `nim c --run test.nim` is the command i ran |
08:51:41 | FromDiscord | <aph> thx :) |
08:54:16 | FromDiscord | <demotomohiro> Did you try to recompile the code while your executable is still running? |
08:56:38 | FromDiscord | <demotomohiro> If so, you need to stop your `test.exe`. |
08:57:35 | FromDiscord | <demotomohiro> Maybe anti-virus software open `test.exe`. |
09:07:55 | * | ltriant joined #nim |
09:14:52 | * | ltriant quit (Ping timeout: 256 seconds) |
09:26:54 | * | rawrrr joined #nim |
09:30:50 | * | ltriant joined #nim |
09:35:24 | * | ltriant quit (Ping timeout: 240 seconds) |
09:56:47 | FromDiscord | <aph> oh thx |
09:56:54 | FromDiscord | <aph> sorry late response |
10:07:05 | * | ltriant joined #nim |
10:10:31 | * | Zectbumo quit (Remote host closed the connection) |
10:17:40 | * | ltriant quit (Ping timeout: 272 seconds) |
10:19:09 | * | jjido joined #nim |
11:06:49 | * | ltriant joined #nim |
11:11:36 | * | ltriant quit (Ping timeout: 256 seconds) |
11:12:53 | NimEventer | New post on r/nim by Wouter-van-Ooijen: specify address of a variable, see https://reddit.com/r/nim/comments/t7wnrr/specify_address_of_a_variable/ |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:32 | * | supakeen joined #nim |
12:06:34 | NimEventer | New thread by Mardiyah: The dynamical scope of proc, see https://forum.nim-lang.org/t/8986 |
12:07:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:11:05 | * | Gustavo6046 quit (Quit: Leaving) |
12:12:12 | * | ltriant joined #nim |
12:17:00 | * | ltriant quit (Ping timeout: 240 seconds) |
12:38:01 | * | krux02 joined #nim |
12:48:27 | * | [R] joined #nim |
13:27:29 | * | ltriant joined #nim |
13:28:25 | * | wyrd quit (Remote host closed the connection) |
13:28:48 | * | wyrd joined #nim |
13:32:44 | * | ltriant quit (Ping timeout: 272 seconds) |
14:07:49 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RuS |
14:10:09 | FromDiscord | <auxym> nim doesn't support anonymous unions so you'll need to create an object type def for the union |
14:11:12 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/kwL |
14:12:08 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RuT |
14:17:53 | FromDiscord | <Waldecir Santos> How do I check if a variable is nil ? I'm doing `if isNil(myObj):` and I keep getting `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
14:18:24 | FromDiscord | <Rika> Then a different variable is nil |
14:19:40 | FromDiscord | <Waldecir Santos> But the traceback points to `if isNil(myObj):` |
14:22:45 | FromDiscord | <Rika> more info is needed then |
14:39:00 | * | jmdaemon quit (Ping timeout: 256 seconds) |
14:44:14 | * | arkurious joined #nim |
15:09:46 | Amun-Ra | there's sth wrong with myObj (type/address it points to/etc.) |
15:11:27 | FromDiscord | <Rika> okay...? |
15:21:33 | Amun-Ra | I mean that's my reply for Waldecir Santos |
15:21:49 | FromDiscord | <Rika> didnt realise |
15:21:59 | FromDiscord | <Rika> i dont think that would be the case |
15:23:26 | Amun-Ra | I had silimar issue, I forgot what was the case |
15:23:29 | Amun-Ra | cause* |
15:32:16 | * | vicecea quit (Remote host closed the connection) |
15:32:48 | * | vicecea joined #nim |
15:35:58 | * | PMunch joined #nim |
15:45:56 | * | nrds quit (Remote host closed the connection) |
15:46:13 | * | nrds joined #nim |
16:08:20 | * | jjido joined #nim |
16:18:21 | * | ltriant joined #nim |
16:23:06 | * | ltriant quit (Ping timeout: 260 seconds) |
16:41:05 | * | PMunch quit (Quit: leaving) |
17:02:31 | FromDiscord | <Phil> ... I am confused, why does nim take issue with some characters in const strings?↵`const ID = "(?P<id>[\d]+)"` this causes a "Invalid character constant" error during compilation.↵The goal I'm trying to achieve with this is having constants of partial regular expressions to put into my URLs. Because typing the same regex for a URL parameter that is just going to denote "this is the name of a dnd campaign" gets old fast (same for ids of |
17:03:24 | FromDiscord | <Rika> `\d` is an escape character |
17:03:32 | FromDiscord | <typedeck> try """ """ |
17:03:46 | FromDiscord | <Rika> either make it raw `r"(?P<id>[\d]+)"` or escape the `\` by doubling `\\` |
17:03:53 | FromDiscord | <Phil> Ohhh wait, when I wrote it in the url as a `re""` it didn't interpret that as such and thus didn't cause issues |
17:04:01 | FromDiscord | <Rika> yes |
17:04:04 | FromDiscord | <Phil> (edit) "`re""`" => "`re"<Lots of stuff>"`" |
17:04:05 | FromDiscord | <typedeck> or is """ """ just multiline ? |
17:04:12 | FromDiscord | <Rika> In reply to @typedeck "or is """ """": just multiline |
17:04:16 | FromDiscord | <Rika> actually |
17:04:19 | FromDiscord | <Rika> idk if it makes it raw |
17:04:21 | FromDiscord | <Rika> i dont think it does |
17:04:41 | FromDiscord | <Phil> Fixes compiling issues as well though |
17:05:01 | FromDiscord | <Phil> I'd like to write that as string for now since I assemble these strings into actual regex's later |
17:05:14 | FromDiscord | <Rika> wdym |
17:05:20 | FromDiscord | <Rika> raw strings are just strings |
17:05:28 | FromDiscord | <Rika> interpreted differently |
17:05:33 | FromDiscord | <Rika> but ultimately still strings |
17:05:42 | FromDiscord | <Phil> doesn't re transform a string into a special type of sorts? |
17:05:50 | FromDiscord | <Phil> Or did I jump somewhere? |
17:05:51 | FromDiscord | <Rika> re does |
17:05:53 | FromDiscord | <Rika> r doesnt |
17:06:03 | FromDiscord | <Phil> Ohhhhh check |
17:06:52 | FromDiscord | <Phil> Well, """ appears to also do raw string (I think?), I'll stick with r though since that conveys more clearly that its intentionally a raw string |
17:07:49 | FromDiscord | <Rika> it probably does |
17:09:12 | * | rockcavera joined #nim |
17:09:13 | * | rockcavera quit (Changing host) |
17:09:13 | * | rockcavera joined #nim |
17:09:27 | FromDiscord | <Phil> now, time to rewrite like 30 urls |
17:19:13 | * | slowButPresent joined #nim |
17:39:15 | FromDiscord | <DMI-1407> btw nim uses clang by default to compile C code right ? |
17:39:27 | FromDiscord | <DMI-1407> (edit) "?" => "?↵(i forgot where i found the info)" |
17:39:42 | FromDiscord | <typedeck> on windows its gcc |
17:39:47 | FromDiscord | <DMI-1407> crap |
17:40:00 | FromDiscord | <DMI-1407> can i change that ? |
17:40:22 | FromDiscord | <typedeck> https://nim-lang.org/docs/nimc.html#compiler-selection |
17:40:50 | FromDiscord | <DMI-1407> ok |
17:40:54 | FromDiscord | <DMI-1407> (edit) "ok" => "ok, thanks" |
17:43:44 | FromDiscord | <typedeck> its defined in nim-1.6.4\config\nim.cfg |
17:48:27 | rockcavera | DMI-1407, I use gcc, clang, vcc and tcc on windows with no problems. |
17:50:09 | rockcavera | you can add the "bin" folder of each compiler in the %PATH% of windows, or configure the config\nim.cfg |
17:50:37 | rockcavera | just the vcc that you don't need... |
18:04:00 | FromDiscord | <b4mbus> How would I make nimlsp recognize nimble packages? |
18:10:45 | FromDiscord | <ynfle> In reply to @b4mbus "How would I make": It should if they are in ~/.nimble/pkgs and imported. I does for me |
18:10:49 | FromDiscord | <ynfle> Not package names though |
18:11:03 | FromDiscord | <ynfle> Is there a way to check if a variable is var or let? |
18:14:11 | FromDiscord | <DMI-1407> dunno if you can catch the exception... but you cant write a second time into an let... 😅 |
18:15:09 | FromDiscord | <ynfle> Ya but I want to compiler if it's not |
18:15:21 | FromDiscord | <ynfle> stil want to |
18:15:50 | FromDiscord | <b4mbus> In reply to @ynfle "Is there a way": prolly with macros? |
18:16:47 | FromDiscord | <b4mbus> In reply to @ynfle "It should if they": some of them are there and some not |
18:16:57 | FromDiscord | <b4mbus> w8 |
18:17:39 | FromDiscord | <b4mbus> ok it does indeed work, I had to nimble-run again |
18:17:43 | FromDiscord | <b4mbus> thanks |
18:20:18 | FromDiscord | <b4mbus> ok |
18:20:21 | FromDiscord | <b4mbus> got it |
18:21:45 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Yeah, see the installation": https://github.com/WohlSoft/SDL-Mixer-X↵Okay I want to Futhark this (I have the header and the DLL) but the header includes some other SDL2 headers, so, I'm affraid it becomes messy |
18:28:05 | * | kayabaNerve joined #nim |
18:32:25 | FromDiscord | <ynfle> In reply to @b4mbus "prolly with macros?": I can't seem to figure out a way |
18:33:41 | FromDiscord | <huantian> ~~what if you check if assigning to it compiles~~ |
18:34:15 | FromDiscord | <ynfle> In reply to @huantian "~~what if you check": True either way for some reason |
18:36:10 | FromDiscord | <krisppurg> sent a long message, see http://ix.io/3Rwq |
18:36:44 | FromDiscord | <huantian> I’d assume modals are still a wip? |
18:38:24 | FromDiscord | <huantian> Is that what they’re called I cannot remember |
18:38:49 | FromDiscord | <krisppurg> well I actually was implementing them like 2 or 3 weeks ago, but then I had to put it on hold. |
18:42:59 | FromDiscord | <huantian> Ah neato |
18:43:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @krisppurg "Sorry for the late": Oh alright! I should give it a try |
18:43:56 | FromDiscord | <huantian> I would recommend using dimscmd if you’re going to do commands |
18:45:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @huantian "I would recommend using": is it the same thing? |
18:56:52 | FromDiscord | <huantian> It’s like an “addon” |
19:01:41 | FromDiscord | <krisppurg> dimscmd is much more user friendly basically |
19:02:03 | FromDiscord | <System64 ~ Flandre Scarlet> Good to know |
19:13:41 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:31:15 | * | jjido joined #nim |
19:36:12 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=3RwH |
19:37:29 | Amun-Ra | don't assume string layout |
19:39:36 | FromDiscord | <gibson> okay, thanks. I'll avoid this whole debacle. |
19:40:30 | Amun-Ra | I mean it will, sooner or later, shoot you in your foot (prolly sooner than later) ;) |
19:44:47 | FromDiscord | <gibson> I was trying to give an often-called external C function direct access to a list of complex nim datatype for fast read access, while retaining fancy nim types in the object, such as string. I'll force the nim-side to use cstring with a "Deal with it" attitude. I'll use cstringutils where I can. |
19:46:27 | Amun-Ra | I usually represent low level api 1:1 and then write high level api that protects me/the user from shooting the foot |
19:51:13 | FromDiscord | <gibson> Hmm, I think what I'm looking for is something like an Entity Component System, where the high-level nim code would look like an object description, but the underlying code would be separated arrays that would allow easy interoperability with C. For now I'll do something simpler. |
19:52:09 | FromDiscord | <gibson> (edit) "description," => "description of related fields," | "description of related fields,but the underlying code would be separated arrays ... that" added "by field" |
19:56:14 | * | rwb is now known as rb |
19:59:56 | * | ltriant joined #nim |
20:04:31 | * | ltriant quit (Ping timeout: 245 seconds) |
20:15:26 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3RwP |
20:22:33 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3RwQ |
20:22:35 | FromDiscord | <tandy> this doesnt work \:( |
20:26:48 | * | Gustavo6046 joined #nim |
20:32:02 | * | jmdaemon joined #nim |
20:32:31 | FromDiscord | <tandy> nvm i figured out a better solution \:) |
20:51:55 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:58:05 | * | jjido joined #nim |
21:00:32 | FromDiscord | <b4mbus> How do I put a quote in a regex ;-; |
21:00:48 | FromDiscord | <b4mbus> doesnt seem to work for some reason |
21:00:49 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rx1 |
21:00:59 | FromDiscord | <b4mbus> it basically generates hella syntax errors |
21:04:17 | * | PMunch joined #nim |
21:11:39 | * | PMunch quit (Quit: leaving) |
21:15:20 | * | Zectbumo joined #nim |
21:24:01 | FromDiscord | <ynfle> Use triple quotes on the outer one and remove the backslashes |
21:28:43 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:38:21 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
21:41:42 | FromDiscord | <b4mbus> In reply to @ynfle "Use triple quotes on": Thanks, worked |
21:42:16 | * | wyrd quit (Ping timeout: 240 seconds) |
21:42:29 | FromDiscord | <ynfle> 👍 |
21:46:01 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxd |
21:46:16 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxe |
21:47:40 | * | ltriant joined #nim |
21:48:18 | FromDiscord | <b4mbus> It does correctly match the values, correctly splits them |
21:48:23 | FromDiscord | <b4mbus> But Im not sure about the conversion part |
21:48:46 | FromDiscord | <b4mbus> And with the `.get()` I assume the input is always correct, not point in error handling for now |
21:49:27 | * | wyrd joined #nim |
21:50:07 | FromDiscord | <typedeck> looks like it doesnt like 3 length hex codes |
21:51:32 | FromDiscord | <b4mbus> Well I can implement literally everything or some parts of it by hand but the Nims stdlib is so big that I assumed I'd find all the tools I needed |
21:51:54 | FromDiscord | <typedeck> what are your trying to do hex string to int? |
21:51:59 | FromDiscord | <typedeck> (edit) "do" => "do," |
21:52:19 | FromDiscord | <b4mbus> (?) Well I said what I wanna do |
21:52:24 | FromDiscord | <b4mbus> I have some codepoints in hex |
21:52:38 | FromDiscord | <b4mbus> I want to convert them to utf8 characters |
21:53:32 | FromDiscord | <typedeck> maybe fromHex[uint8](codepoint) |
21:53:46 | FromDiscord | <typedeck> mmm no thats too small |
21:54:03 | FromDiscord | <typedeck> erm idk |
21:54:12 | FromDiscord | <typedeck> try it and see |
21:54:22 | FromDiscord | <b4mbus> Well aight I'll just implement some stuff by hand |
21:54:35 | FromDiscord | <b4mbus> In reply to @typedeck "maybe fromHex[uint8](codepoint)": A codepoint can range from 1 to 4 bytes, technically even 6 |
21:55:23 | FromDiscord | <typedeck> yeah so just parse as the largest uint and then chop off values not defeined by utf-8 |
21:56:49 | FromDiscord | <ynfle> https://nim-lang.org/docs/strutils.html#parseHexInt%2Cstring |
21:58:44 | * | kayabaNerve joined #nim |
22:02:11 | FromDiscord | <b4mbus> In reply to @ynfle "https://nim-lang.org/docs/strutils.html#parseHexInt": well yeah but that will just give me the codepoint in an integer form but I want to turn the codepoint into a sequence of UTF8 encoded characters |
22:06:13 | FromDiscord | <Elegantbeef> Add the characters to a string then use `toRunes` |
22:06:22 | FromDiscord | <typedeck> .mapIt(fromHex[int32](it).Rune) |
22:07:04 | FromDiscord | <b4mbus> :OOOOOOOOOO |
22:07:27 | FromDiscord | <b4mbus> that works |
22:07:30 | FromDiscord | <b4mbus> hell yeah, thanks a lot |
22:07:30 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rxo |
22:07:51 | FromDiscord | <b4mbus> Im wondering, why cant I do `it.fromHex[int32]().Rune`, but `fromHex[int32](it).Rune` is fine? |
22:08:30 | FromDiscord | <typedeck> i think cause its casting, but im not sure |
22:09:21 | FromDiscord | <Elegantbeef> No the issue is MCS doesnt work with generics |
22:09:29 | FromDiscord | <Elegantbeef> you need to do `it.fromHex[: int32]().Rune` |
22:09:43 | FromDiscord | <typedeck> whats mcs? |
22:10:06 | FromDiscord | <Elegantbeef> Method call syntax |
22:11:23 | FromDiscord | <b4mbus> what's with the `:` there? |
22:12:38 | FromDiscord | <ynfle> In reply to @b4mbus "what's with the `:`": Clarify it's a generic param as apposed to array index |
22:14:01 | FromDiscord | <Elegantbeef> It makes it so the procedure is resolved properly |
22:14:41 | FromDiscord | <Elegantbeef> `it.fromHex[int]` is taken as a `[]` operator of `it.fromHex` but `it.fromHex[:int]` is taken as `fromHex[int](it)` |
22:14:47 | FromDiscord | <typedeck> would be cool if Rune could be thrown in since it is implemented as int32 |
22:15:54 | FromDiscord | <ynfle> In reply to @typedeck "would be cool if": It is |
22:16:18 | FromDiscord | <Elegantbeef> Well it's a distinct, so that's kinda the point 😛 |
22:16:18 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix= |
22:16:26 | FromDiscord | <typedeck> yeah... |
22:17:24 | FromDiscord | <typedeck> ah i see |
22:18:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rxp |
22:19:07 | FromDiscord | <huantian> Is it better to have the method return sig be T or Rune here |
22:19:22 | FromDiscord | <huantian> Ig it doesn’t matter since T is always Rune |
22:19:58 | FromDiscord | <Elegantbeef> Well you dont want to make it so you have to call `strutils.fromhex` everywhere |
22:21:32 | FromDiscord | <typedeck> sent a code paste, see https://play.nim-lang.org/#ix=3Rxq |
22:21:37 | FromDiscord | <ynfle> Ya |
22:21:40 | FromDiscord | <Elegantbeef> It's a type conversion yes |
22:21:48 | FromDiscord | <Elegantbeef> Command syntax instead of method call syntax |
22:22:08 | FromDiscord | <Elegantbeef> Command syntax is `()` less calls |
22:22:28 | FromDiscord | <ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Rxr |
22:23:14 | FromDiscord | <Elegantbeef> But `Rune (it,)` is not 😛 |
22:23:36 | FromDiscord | <ynfle> That's an issue with nimfmt |
22:24:25 | FromDiscord | <Elegantbeef> It doesnt let you do dumb things? |
22:25:11 | FromDiscord | <ynfle> See first example https://github.com/FedericoCeratto/nimfmt#examples with the foo call |
22:25:35 | FromDiscord | <Elegantbeef> Yea like i said it doesnt let you do dumb things |
22:25:48 | FromDiscord | <ynfle> How do you echo a tuple? |
22:25:52 | FromDiscord | <Elegantbeef> If you have a procedure which has a single argument that's a tuple |
22:26:11 | FromDiscord | <huantian> I do wish we had a full Nim formatted like pythons black |
22:26:11 | FromDiscord | <Elegantbeef> Who the fuck echo's a tuple they constructed on the line of the echo? |
22:26:43 | FromDiscord | <ynfle> 🤷♂️ |
22:26:48 | FromDiscord | <huantian> Maybe you’re testing a custom $ you made for your tuple 😛 |
22:27:17 | FromDiscord | <Elegantbeef> Sure |
22:27:23 | FromDiscord | <Elegantbeef> And then who makes a custom `$` for a tuple |
22:27:36 | FromDiscord | <Elegantbeef> Way to ruin everything |
22:28:49 | FromDiscord | <Elegantbeef> If you're making operators or procedures for specific tuples i hate you, you need help 😛 |
22:28:55 | FromDiscord | <ynfle> In reply to @huantian "Maybe you’re testing a": It won't ruin anything because `$` would disambiguate tuple, versus multiple params |
22:29:42 | FromDiscord | <Elegantbeef> What? |
22:29:45 | FromDiscord | <Elegantbeef> `$` would effect all tuples of that type |
22:29:50 | FromDiscord | <Elegantbeef> They are not distinct |
22:31:23 | FromDiscord | <ynfle> That's not what I was trying to say, but what I was trying to say wasn't right either |
22:31:45 | FromDiscord | <Elegantbeef> Ok i'm mostly joking anyway so it doesnt matter |
22:38:12 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
23:07:48 | * | jmdaemon quit (Ping timeout: 272 seconds) |
23:25:39 | * | jmdaemon joined #nim |
23:29:10 | * | jmdaemon quit (Client Quit) |
23:30:44 | FromDiscord | <Waldecir Santos> How can I clone on `ref object` ? deepCopy is the write tool for the job ? |
23:32:00 | * | jmdaemon joined #nim |
23:32:02 | FromDiscord | <Elegantbeef> Depends on the fields but probably |
23:32:34 | FromDiscord | <Waldecir Santos> My object have another object and a `Option[seq[T]]` |
23:32:52 | FromDiscord | <Waldecir Santos> I'll play around with it, thank you @ElegantBeef ! |