00:00:00 | FromDiscord | <ElegantBeef> You mean starting multiple processes at once? |
00:00:36 | FromDiscord | <Recruit_main707> Multiprocessing, pipes, all that stuff |
00:00:53 | FromDiscord | <Recruit_main707> It doesn’t seem to be supported in the stdlib either |
00:01:00 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29 |
00:01:02 | FromDiscord | <ElegantBeef> Well you got that |
00:01:10 | FromDiscord | <ElegantBeef> But that blocks until all are done |
00:02:25 | FromDiscord | <ElegantBeef> Might be the best to run all your commands manually using startprocess, though no clue how the piping works with that |
00:03:47 | FromDiscord | <ElegantBeef> Could've sworn i seen a library for what you wanted somewhere 😄 |
00:04:15 | * | Vladar quit (Quit: Leaving) |
00:04:46 | FromDiscord | <~355/113 Man> hmm are these supposed to be absolute paths?↵`Error: unhandled exception: Access is denied.↵Additional info: "(\"assets\", \"bin\")" [OSError]` |
00:05:36 | FromDiscord | <Recruit_main707> It’s something I never really understood, why do we only have multithreading in std but no multiprocessing, from what I’ve seen, multithreading is not better than multiprocessing and vice versa |
00:05:39 | FromDiscord | <ElegantBeef> What's the line of code you tested |
00:06:04 | FromDiscord | <~355/113 Man> oh it should be cpDir not mvDir |
00:07:12 | FromDiscord | <~355/113 Man> yay, now both `nimble run` and double clicking the exe both work |
00:07:59 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PdR |
00:08:33 | FromDiscord | <~355/113 Man> ehhh, run.bat (which contains just `nimble run`) doesn't work though... |
00:08:48 | FromDiscord | <~355/113 Man> (and run.bat is in the same folder as `.nimble`) |
00:08:59 | FromDiscord | <ElegantBeef> Why are you using a bat file to automate a two words? 😄 |
00:09:05 | FromDiscord | <ElegantBeef> Just make a build task in your ide |
00:09:21 | FromDiscord | <ElegantBeef> Assuming you're using an IDE i gues |
00:09:21 | FromDiscord | <ElegantBeef> (edit) "gues" => "guess" |
00:09:23 | FromDiscord | <~355/113 Man> so that I can do `fn+F5, enter` to run from notepad++ |
00:09:36 | FromDiscord | <ElegantBeef> Can notepad++ not run a command then? |
00:09:44 | FromDiscord | <~355/113 Man> that is it running the command |
00:09:54 | FromDiscord | <ElegantBeef> So why not just run `nimble run` |
00:09:55 | FromDiscord | <~355/113 Man> or rather it runs the bat |
00:10:06 | FromDiscord | <~355/113 Man> it can't run the command as far as I can tell |
00:10:09 | FromDiscord | <~355/113 Man> just a file |
00:10:57 | FromDiscord | <~355/113 Man> actually the bat does work, I guess it's just notepad++ not wanting to run it |
00:11:19 | FromDiscord | <~355/113 Man> I guess `.bat` doesn't count as "program" |
00:40:09 | * | xet7 joined #nim |
00:43:23 | * | greaser|q quit (Changing host) |
00:43:23 | * | greaser|q joined #nim |
00:43:27 | * | greaser|q is now known as GreaseMonkey |
00:51:24 | FromDiscord | <Varriount> In reply to @Recruit_main707 "It’s something I never": Sharing resources (memory, files) between threads is less expensive, both memory- and cpu-wise, than sharing resources between processes. |
00:52:35 | FromDiscord | <Varriount> Also, processes have more overhead in general (varies by system). |
01:13:02 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:13:28 | * | njoseph joined #nim |
01:22:38 | GreaseMonkey | alright, i've got a question, with the official Nim SDL2 bindings, how do i access to the "pixels" pointer as if it were an openArray[uint32] ? |
01:23:55 | GreaseMonkey | what goes into the arguments of texture.lockTexture(...) here is a pointer to a pointer to raw pixel data i can write to |
01:24:05 | GreaseMonkey | this is defined as "pixels: ptr pointer" |
01:24:18 | GreaseMonkey | i can extract the *pitch* just fine, defined as "pitch: ptr cint" |
01:35:53 | FromDiscord | <exelotl> mmh, I'm not sure it's possible to access it as an openarray currently (you can try {.experimental:"views".} but it's a pretty broken feature right now) |
01:36:19 | FromDiscord | <exelotl> you can however do `cast[ptr UncheckedArray[uint32]](surface.pixels)` |
01:40:58 | FromDiscord | <exelotl> oh wait, ptr pointer... |
01:43:02 | FromDiscord | <exelotl> seems pretty dodgy, I'm sure it should just be a straight pointer |
01:45:13 | FromDiscord | <exelotl> ah nvm I should've read more carefully, didn't realise it was for lockTexture |
01:57:18 | Prestige | when creating tests in nim, do we need to `import ../../../../src/module` or is there a way without needing to go up a bunch of directories? |
02:00:42 | GreaseMonkey | UncheckedArray[uint32] sounds notably less nasty than the "cast to int, do arithmetic, then cast back to a pointer again" song and dance i've managed to get working |
02:00:52 | * | abm quit (Read error: Connection reset by peer) |
02:05:11 | FromDiscord | <pointystick> Prestige, you can probably setup a config to set the path, e.g.: https://github.com/treeform/nimtemplate/blob/master/tests/config.nims |
02:05:23 | Prestige | oh neat |
02:06:38 | Prestige | also I'm trying to `testament r test/mytest.nim` but it's saying "test does not exist". Only contents currently are `doAssert 1 == 1` |
02:06:45 | Prestige | (on nim stable) |
02:07:06 | Prestige | Which makes me wonder if this is incorrect or outdated: https://nim-lang.github.io/Nim/testament.html |
02:12:04 | Prestige | uh so my tests HAVE to be in ./tests even if I give testament a full path to the test file? How strange |
02:12:51 | Prestige | and I think the test file name has to start with a t... also not mentioned in the docs |
02:20:19 | ForumUpdaterBot | New post on r/nim by abakune: Tagfiles in Nim?, see https://reddit.com/r/nim/comments/liqzkp/tagfiles_in_nim/ |
02:29:06 | FromDiscord | <~355/113 Man> `nimble init` sets up a test environment for you |
02:29:22 | FromDiscord | <ElegantBeef> He's using testament not `unittest` |
02:31:45 | * | asdflkj_2 quit (Ping timeout: 246 seconds) |
02:31:57 | FromDiscord | <~355/113 Man> well could still use the nimble init I would think, all `nimble test` does is compile and run from the test folder as far as I can tell |
02:32:40 | FromDiscord | <ElegantBeef> Yea it's similar to testament |
02:41:47 | Prestige | It's strange there are so many unwritten requirements |
02:47:16 | FromDiscord | <flywind> I also USE testament in MY project. |
02:47:38 | FromDiscord | <ElegantBeef> What's with the emphasis? |
02:48:02 | Prestige | Chandler? |
02:48:51 | FromDiscord | <flywind> MY phone input has some issues |
02:48:54 | Prestige | I hope I can tune testament to not require the t prefix |
02:50:22 | FromDiscord | <flywind> it automatically capitalizes english characters |
02:51:04 | FromDiscord | <flywind> testament r should support no t prefix |
02:52:12 | Prestige | Hmm I'll try again when I'm back home |
03:03:56 | * | lritter quit (Ping timeout: 240 seconds) |
03:05:00 | * | lritter joined #nim |
03:23:04 | Prestige | oh it does, it was just an issue of my filename in general... I wonder why there are restrictions on filenames |
03:23:09 | Prestige | like you can't use . or - |
03:24:54 | FromDiscord | <ElegantBeef> They have to be valid nim module names |
03:25:01 | Prestige | Yeah that's what I mean though |
03:25:23 | FromDiscord | <ElegantBeef> well how do you import `sillymodule.two` |
03:26:03 | FromDiscord | <~355/113 Man> by searching for the last `.` not the first `.`? |
03:26:05 | Prestige | What do you mean? |
03:26:19 | FromDiscord | <~355/113 Man> like `sillymodule.two.nim` |
03:26:25 | Prestige | ^ |
03:26:30 | Prestige | I meant @beef |
03:26:31 | FromDiscord | <ElegantBeef> `.` and `-` are operators in nim |
03:26:43 | FromDiscord | <~355/113 Man> oh for the actual import code |
03:26:44 | Prestige | but if it's in a string? |
03:26:54 | Prestige | import "foo.bar" |
03:27:00 | FromDiscord | <ElegantBeef> Get out |
03:27:16 | Prestige | I have to use quotes anyway |
03:27:21 | Prestige | import "../../../foo" |
03:27:29 | FromDiscord | <ElegantBeef> you dont need the quotes |
03:27:36 | FromDiscord | <ElegantBeef> `import ../../../foo` is valid |
03:28:03 | FromDiscord | <exelotl> ahhh shit, I thought if I exported a module I could refer to that module by name |
03:28:07 | Prestige | really? I thought I had compilation errors without them |
03:28:14 | FromDiscord | <ElegantBeef> Hell no |
03:28:18 | FromDiscord | <ElegantBeef> No issues |
03:28:43 | FromDiscord | <~355/113 Man> I don't have issues |
03:28:54 | FromDiscord | <ElegantBeef> I mean you're in the Nim discord, you clearly do |
03:29:09 | * | lritter quit (Ping timeout: 246 seconds) |
03:29:47 | Prestige | huh weird |
03:31:06 | Prestige | but anyway, still annoying that I can't use . or - in my file names |
03:31:28 | FromDiscord | <ElegantBeef> They arent valid nim identifiers |
03:31:40 | Prestige | Correct |
03:31:52 | Prestige | but it still sucks that I can't use them |
03:31:59 | FromDiscord | <ElegantBeef> Eh, i think it's fine |
03:32:41 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Peu |
03:32:48 | FromDiscord | <~355/113 Man> I figured it out |
03:33:00 | FromDiscord | <ElegantBeef> What? |
03:33:44 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Pev |
03:34:11 | Prestige | could just be "foo" in nim |
03:34:16 | FromDiscord | <~355/113 Man> yea, that's what I mean, at first I thought you meant the import |
03:34:24 | Prestige | I mostly want it for tests, so I can to foo.test.nim |
03:34:28 | FromDiscord | <~355/113 Man> In reply to @Prestige "could just be "foo"": but now your module doesn't match your file name |
03:34:44 | FromDiscord | <exelotl> this completely ruins my plan to modularize my library... :( https://media.discordapp.net/attachments/371759389889003532/809990917250482216/Screenshot_from_2021-02-13_03-33-51.png |
03:34:51 | Prestige | that's fine, could still just be the name up until the first . or - |
03:35:31 | FromDiscord | <exelotl> I wanted to be able to do `import a` followed by `b.bar()` (b is exported after all) |
03:35:32 | FromDiscord | <~355/113 Man> wait, there's an export? |
03:36:40 | FromDiscord | <exelotl> yes, it's for forwarding symbols from other modules |
03:37:53 | FromDiscord | <ElegantBeef> In reply to @Prestige "that's fine, could still": eh then `foo.thingy` and `foo.thingytwo` collide for no reason, arguably it could strip `.` and `-` but then the namespace is ugly |
03:38:48 | * | a_chou joined #nim |
03:38:55 | Prestige | or you could import "foo.thingy" as thingy |
03:39:07 | FromDiscord | <ElegantBeef> Get your strings out of here |
03:39:31 | Prestige | never! |
03:40:12 | Prestige | Also for testament - testing for errors are handled by comments? |
03:41:02 | Prestige | or strings rather |
03:41:08 | FromDiscord | <ElegantBeef> No |
03:41:31 | FromDiscord | <ElegantBeef> It seems the `discard """Your message""` is sent if the next assert fails |
03:42:07 | FromDiscord | <ElegantBeef> I dont really get it, havent used it myself |
03:42:17 | FromDiscord | <ElegantBeef> Maybe flywind or someone that has will speak up now 😄 |
03:42:20 | Prestige | Hm this is confusing. I'm wanting to assert that foo() will throw a specific error |
03:43:36 | FromDiscord | <flywind> doAssertRaises I guess |
03:45:26 | Prestige | oh neat, thanks |
03:45:33 | FromDiscord | <flywind> np |
03:45:38 | * | muffindrake quit (Ping timeout: 264 seconds) |
03:45:50 | FromDiscord | <exelotl> So right now my problem is that each module has prefixed names (`irq` module has `irqInit`, `irqEnable`, etc. `tte` module has `tteInit`, `ttePutc`, `tteWrite`, etc.)↵I want to eliminate the prefixes so the user can do `tte.init()` instead of `tteInit()` I guess the only way to achieve this is by requiring the user to do `import natu/[types, core, irq, tte]` etc. |
03:46:18 | FromDiscord | <exelotl> I really wanted them to be able to do `import natu` and get all the modules |
03:47:06 | FromDiscord | <exelotl> I mean... I could have them do `include natu/prelude` but that sucks |
03:47:12 | * | muffindrake joined #nim |
03:50:20 | FromDiscord | <ElegantBeef> The dumb thing would be `import natu` `importNatuDeps()` |
03:52:10 | FromDiscord | <exelotl> hmmmm |
03:55:06 | FromDiscord | <ElegantBeef> Wait the qualified proc works for me |
03:56:05 | FromDiscord | <ElegantBeef> Ah nvm, false positive |
04:02:55 | FromDiscord | <exelotl> this works... but it's not nice https://media.discordapp.net/attachments/371759389889003532/809998009869795348/Screenshot_from_2021-02-13_04-02-37.png |
04:04:36 | FromDiscord | <exelotl> hard to maintain, will break go-to-definition, docgen etc. |
04:09:10 | FromDiscord | <ElegantBeef> God that's terrible 😄 |
04:11:13 | FromDiscord | <exelotl> thank you >:) |
04:11:30 | FromDiscord | <ElegantBeef> This isnt much better https://media.discordapp.net/attachments/371759389889003532/810000166579863582/unknown.png |
04:12:09 | FromDiscord | <ElegantBeef> Whoops didnt scroll all the way up |
04:12:17 | FromDiscord | <ElegantBeef> There is an `import mod1` in the last one |
04:12:28 | FromDiscord | <exelotl> ah makes sense |
04:14:11 | FromDiscord | <exelotl> ah well, I guess I just gotta accept that users will have to deal with granular imports |
04:14:54 | FromDiscord | <exelotl> the upside to it is that they won't need extra lines for modules that aren't included by default |
04:15:37 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2PeE |
04:16:42 | FromDiscord | <exelotl> it will just become `import natu/[core, types, registers, input, bios, irq, tte, maxmod]` |
04:16:57 | FromDiscord | <exelotl> 😭 |
04:18:05 | FromDiscord | <exelotl> types and registers can probably all go into core I guess, since the lib is useless without those |
04:18:23 | FromDiscord | <exelotl> maybe bios too... |
04:22:46 | * | wasted_youth2 quit (Quit: Leaving) |
04:44:33 | * | spiderstew_ joined #nim |
04:46:17 | * | spiderstew quit (Ping timeout: 272 seconds) |
04:50:10 | FromDiscord | <Rika> inb4 circular dependency after you put types in core |
04:51:48 | * | muffindrake quit (Quit: muffindrake) |
05:08:14 | FromDiscord | <exelotl> xD |
05:43:27 | FromDiscord | <~355/113 Man> hmmmm, I don't understand why i'm getting this error↵`Error: invalid type: 'type array[0..4, VertexArrayObject]' for var` |
05:43:42 | FromDiscord | <~355/113 Man> sent a code paste, see https://paste.rs/0e2 |
05:43:47 | FromDiscord | <ElegantBeef> using `=` not `:` |
05:43:57 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PeS |
05:43:58 | FromDiscord | <ElegantBeef> = is for assignment `:` is for tyoe desc |
05:43:59 | FromDiscord | <~355/113 Man> oh derp |
05:44:01 | FromDiscord | <ElegantBeef> (edit) "tyoe" => "type" |
05:44:30 | FromDiscord | <~355/113 Man> man I love this language but it takes a lot to get used to |
05:45:50 | FromDiscord | <~355/113 Man> does `seq` have an `addAll(array[N, Foo])` |
05:46:56 | FromDiscord | <ElegantBeef> does add not work? |
05:47:33 | FromDiscord | <~355/113 Man> wouldn't that try to add the array itself? |
05:47:42 | FromDiscord | <ElegantBeef> you want to add all the values right? |
05:47:55 | FromDiscord | <~355/113 Man> yea |
05:48:05 | FromDiscord | <~355/113 Man> does `&` work from sequtils? |
05:48:14 | FromDiscord | <ElegantBeef> I mean |
05:48:35 | FromDiscord | <ElegantBeef> !eval var a: seq[int]; a.add([10,2]); echo a |
05:48:38 | NimBot | @[10, 2] |
05:48:50 | FromDiscord | <~355/113 Man> hmm |
05:49:08 | Prestige | Beef: I'm trying to create an instance of XTextProperty https://tronche.com/gui/x/xlib/ICC/client-to-window-manager/converting-string-lists.html - do you know how initialize a property that is of type Pcuchar? |
05:49:38 | Prestige | maybe I just need to make a cuchar and pass addr foo |
05:50:08 | FromDiscord | <ElegantBeef> Yea out of my paygrade 😄 |
05:50:12 | FromDiscord | <ElegantBeef> I cannot even guess |
05:50:49 | Prestige | Probably doesn't help that my knowledge of C is almost nil :P haha |
05:51:10 | FromDiscord | <~355/113 Man> i'm pretty good at C if you want help there |
05:51:30 | FromDiscord | <~355/113 Man> but i'm still a big noob at nim |
05:51:39 | Prestige | If you take a look at the struct I linked, I'm trying to replicate it in Nim |
05:51:54 | Prestige | I think my guess was correct though |
05:52:30 | FromDiscord | <~355/113 Man> what is type Pcuchar? |
05:52:55 | ForumUpdaterBot | New question by Alex Craft: How to instantiate unknown type in macros in Nim?, see https://stackoverflow.com/questions/66182196/how-to-instantiate-unknown-type-in-macros-in-nim |
05:52:57 | Prestige | pointer to a unsigned char |
05:53:05 | Prestige | unsigned (c) char |
05:53:11 | FromDiscord | <~355/113 Man> not `ptr int8`? |
05:53:29 | Prestige | like ptr uint8 I guess? |
05:53:39 | FromDiscord | <~355/113 Man> yea forgot the u |
05:54:21 | Prestige | it looks like I was correct |
05:55:32 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PeX |
05:58:15 | Prestige | I had to create `var value: cuchar` then pass in `addr value` to the function |
06:00:30 | FromDiscord | <~355/113 Man> that sounds wrong to me |
06:01:24 | FromDiscord | <ElegantBeef> That's write afaik |
06:01:27 | FromDiscord | <ElegantBeef> (edit) "write" => "right" |
06:02:05 | FromDiscord | <~355/113 Man> sigh i'm getting kind of tired of operators not returning objects with addresses |
06:02:16 | FromDiscord | <ElegantBeef> Wait is that stack overflow page dead for anyone else? |
06:02:39 | FromDiscord | <~355/113 Man> yep |
06:02:50 | FromDiscord | <ElegantBeef> Lol deletes a SO page |
06:02:54 | FromDiscord | <Rika> In reply to @~355/113 Man "*sigh* i'm getting kind": wdym |
06:02:58 | FromDiscord | <ElegantBeef> Yea ^ |
06:03:59 | ForumUpdaterBot | New thread by Alexeypetrushin: Why `sortedByIt(it.field)` and not `sortedBy(field)`?, see https://forum.nim-lang.org/t/7500 |
06:04:05 | FromDiscord | <~355/113 Man> `addr (mat objmats[i])` has no address |
06:04:12 | FromDiscord | <~355/113 Man> (not even with unsafeAddr) |
06:04:30 | FromDiscord | <~355/113 Man> conversion does the same thing as I found out earlier |
06:06:00 | FromDiscord | <Rika> why would it? |
06:06:15 | FromDiscord | <Rika> its not assigned to anything yet |
06:07:25 | FromDiscord | <~355/113 Man> well it has to live somewhere doesn't it? |
06:07:56 | FromDiscord | <ElegantBeef> Well it's temporary unless assigned |
06:07:58 | FromDiscord | <Rika> not somewhere you should be using |
06:08:25 | FromDiscord | <Rika> its not guaranteed to live after the operation |
06:08:28 | FromDiscord | <~355/113 Man> In reply to @ElegantBeef "Well it's temporary unless": and in this case this temporaryness is just long enough |
06:08:45 | FromDiscord | <Rika> immediate is long enough? |
06:09:15 | FromDiscord | <~355/113 Man> pretty much as far as this scope is concerned |
06:09:40 | FromDiscord | <~355/113 Man> unless it can be deleted while inside the next scope it lives long enough |
06:09:55 | FromDiscord | <~355/113 Man> the address is imediatly passed into a proc |
06:09:55 | * | rockcavera quit (Remote host closed the connection) |
06:10:02 | FromDiscord | <~355/113 Man> (edit) "imediatly" => "immediately" |
06:10:13 | FromDiscord | <Rika> and is also immediately unusable because the value in the address is gone? |
06:10:54 | FromDiscord | <~355/113 Man> it can't even survive into the next scope? |
06:11:04 | FromDiscord | <Rika> its not guaranteed to |
06:11:06 | FromDiscord | <Rika> is it? |
06:11:13 | FromDiscord | <~355/113 Man> I would think so |
06:11:14 | FromDiscord | <Rika> it only needs to live until its assigned |
06:12:50 | FromDiscord | <ElegantBeef> If it's unassigned it might not even get compiled |
06:12:59 | FromDiscord | <Rika> its not just operators btw |
06:13:15 | FromDiscord | <Rika> even `addr " ".repeat(20)` wouldnt work |
06:14:18 | FromDiscord | <Rika> if you want you can make a template that assigns a temp.var and returns the address of that |
06:14:25 | FromDiscord | <~355/113 Man> actually you may be right |
06:14:57 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:15:45 | FromDiscord | <~355/113 Man> yea, idk, something about words keeps making me think things that aren't true |
06:16:00 | FromDiscord | <~355/113 Man> like words instead of symbols |
06:16:14 | FromDiscord | <~355/113 Man> ex: `not` vs `!`, `addr` vs `&` |
06:17:31 | FromDiscord | <Rika> hey its part of getting used to a new language |
06:18:09 | FromDiscord | <ElegantBeef> I much prefer the more descriptive versions `&` and `` are scary |
06:18:29 | FromDiscord | <~355/113 Man> what is `` in Nim? |
06:18:29 | FromDiscord | <Rika> for a type being different to a for a variable is scary |
06:18:37 | FromDiscord | <Rika> for which |
06:18:40 | FromDiscord | <Rika> type or variable |
06:18:44 | FromDiscord | <~355/113 Man> variable |
06:18:47 | FromDiscord | <Rika> [] |
06:18:53 | FromDiscord | <~355/113 Man> oh that's weird |
06:19:00 | FromDiscord | <Rika> var a: ptr int↵a[] # int |
06:19:22 | FromDiscord | <Rika> would you have rathered .deref 😛 |
06:19:25 | FromDiscord | <Rika> a.deref |
06:19:26 | FromDiscord | <Rika> xddd |
06:19:32 | FromDiscord | <~355/113 Man> actually maybe |
06:19:33 | FromDiscord | <ElegantBeef> I was talking about C/C++'s ``, `addr` and `char` vs `ptr UncheckedArray[char]` |
06:19:37 | FromDiscord | <Rika> ngl it doesnt look as cursed as i though |
06:19:41 | FromDiscord | <Rika> t |
06:19:42 | FromDiscord | <Rika> thought |
06:19:47 | FromDiscord | <ElegantBeef> We have autoderef |
06:19:58 | FromDiscord | <Rika> i mean deref as a word instead of [] |
06:20:04 | FromDiscord | <ElegantBeef> Yea i know |
06:20:45 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pf7 |
06:21:29 | FromDiscord | <Rika> it really looks less weird than i thought it would have been |
06:22:20 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pf8 |
06:22:35 | FromDiscord | <~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pf8" => "https://play.nim-lang.org/#ix=2Pf9" |
06:22:43 | FromDiscord | <InventorMatt> it may be better as a template |
06:22:49 | FromDiscord | <Rika> yeah lol |
06:23:01 | FromDiscord | <~355/113 Man> right, forgot about template |
06:23:25 | FromDiscord | <~355/113 Man> template is kind of alike a function macro right? |
06:23:28 | FromDiscord | <~355/113 Man> (edit) "alike" => "like" |
06:23:45 | FromDiscord | <Rika> its code substitution on compile time |
06:24:00 | FromDiscord | <Rika> like a C macro |
06:24:10 | FromDiscord | <~355/113 Man> so yea, like a function macro |
06:24:39 | FromDiscord | <Rika> oh thats what you mean |
06:24:39 | FromDiscord | <~355/113 Man> can templates have no args? |
06:24:43 | FromDiscord | <ElegantBeef> Yep |
06:24:44 | FromDiscord | <Rika> yes |
06:24:49 | FromDiscord | <Rika> fuck you beef wtf how dare you |
06:24:54 | FromDiscord | <~355/113 Man> so I guess just like macros in general then |
06:24:59 | FromDiscord | <ElegantBeef> Sorry rika, you dont find me funny so fuck you |
06:25:01 | FromDiscord | <~355/113 Man> so what are macros in Nim then? |
06:25:03 | FromDiscord | <Rika> lmao |
06:25:10 | FromDiscord | <Rika> they work on the ast |
06:25:17 | FromDiscord | <Rika> much stronger than C macros |
06:25:20 | FromDiscord | <~355/113 Man> ast? |
06:25:23 | FromDiscord | <Rika> you can create DSLs |
06:25:30 | FromDiscord | <Rika> abstract syntax tree or something i forget |
06:25:31 | FromDiscord | <ElegantBeef> They're Lisp inspired macros that work directly with the AST as rika said |
06:25:32 | FromDiscord | <~355/113 Man> words :blobnotlikethis: |
06:25:44 | FromDiscord | <Rika> smh i thought you were good at C |
06:25:51 | FromDiscord | <ElegantBeef> So you just directly make the same AST as your written code does |
06:26:07 | FromDiscord | <~355/113 Man> what is DSL? |
06:26:14 | FromDiscord | <Rika> domain specific language |
06:26:23 | FromDiscord | <Rika> something like a custom language |
06:26:41 | FromDiscord | <Rika> you can create custom languages within nim as long as its wrapped by a macro that changes it back into nim code |
06:26:44 | FromDiscord | <ElegantBeef> My whored one! https://github.com/beef331/constructor#constructor |
06:26:51 | FromDiscord | <Rika> shill. |
06:27:18 | FromDiscord | <ElegantBeef> You can also pass static strings and make your own compiler to Nim 😄 |
06:27:40 | * | mmohammadi9812 joined #nim |
06:27:54 | FromDiscord | <Rika> inb4 "compiling nim with the nim vm" |
06:28:01 | FromDiscord | <Rika> aka max cursed |
06:28:03 | FromDiscord | <~355/113 Man> I actually was helping on a for fun compiler by someone else written in C# right before trying Nim |
06:28:45 | FromDiscord | <Rika> yeah what we mean is that you can make nim compile other code with macros without leaving the nim file |
06:29:13 | FromDiscord | <~355/113 Man> yea, that's interesting |
06:29:37 | FromDiscord | <~355/113 Man> anyways, I got my code working but now my triangles are gone :BlobSadde: |
06:30:12 | FromDiscord | <Rika> do you have an inference as to why |
06:30:25 | FromDiscord | <~355/113 Man> nope |
06:31:37 | FromDiscord | <~355/113 Man> oh wait, I forgot to build the VAOs :Facepalm: |
06:32:37 | FromDiscord | <~355/113 Man> still no triangles |
06:34:02 | ForumUpdaterBot | New thread by Tbutton: Echo doesn't work correctly, see https://forum.nim-lang.org/t/7501 |
06:36:09 | FromDiscord | <Rika> sorry dude ive no damn clue what to do when it comes to graphics so |
07:01:44 | FromDiscord | <~355/113 Man> hmmm, strange, if I don' use a proc I can render, but when I try to use procs I can't render |
07:03:58 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfp |
07:04:06 | FromDiscord | <~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pfp" => "https://play.nim-lang.org/#ix=2Pfq" |
07:11:17 | FromDiscord | <Rika> whatever variable you pass as vao is a let and not a var |
07:12:12 | FromDiscord | <~355/113 Man> it's from an array that's var |
07:12:28 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pft |
07:12:51 | FromDiscord | <~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pft" => "https://play.nim-lang.org/#ix=2Pfu" |
07:13:05 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfv |
07:13:34 | FromDiscord | <Yardanico> You need to use mitems |
07:13:49 | FromDiscord | <~355/113 Man> do what now? |
07:13:49 | FromDiscord | <Yardanico> for i, VAO in VAOs.mitems: |
07:14:01 | FromDiscord | <~355/113 Man> mitems for mutable items? |
07:14:04 | FromDiscord | <Yardanico> yes |
07:14:07 | FromDiscord | <~355/113 Man> ah |
07:14:17 | FromDiscord | <~355/113 Man> I tried var VAO |
07:15:49 | FromDiscord | <~355/113 Man> ` Error: wrong number of variables` |
07:16:04 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfx |
07:16:58 | FromDiscord | <InventorMatt> try mpairs instead of mitems |
07:17:38 | FromDiscord | <~355/113 Man> yeeet, it's working |
07:18:38 | FromDiscord | <~355/113 Man> .... or not |
07:19:13 | FromDiscord | <~355/113 Man> no it's still not working, it's compiling, but still not rendering |
07:20:48 | FromDiscord | <~355/113 Man> any ideas why a proc won't render, but the same code copied and pasted (without the container struct) works just fine? |
07:25:38 | FromDiscord | <~355/113 Man> https://paste.myst.rs/lw43zp4x |
07:29:27 | FromDiscord | <hamidb80> Can anyone give me a link that can explain usage of "distinct types" ? |
07:30:14 | FromDiscord | <~355/113 Man> it just means that there is no implicit conversion between the types I think |
07:33:56 | FromDiscord | <Rika> @~355/113 Man you never change vaoID on the copy paste version? |
07:34:19 | FromDiscord | <~355/113 Man> no |
07:35:02 | FromDiscord | <Rika> and its the same effect when you use VAO.vaoID? |
07:35:23 | * | superbia joined #nim |
07:35:28 | FromDiscord | <~355/113 Man> i'm trying to test that right now, but getting another compile error |
07:35:44 | FromDiscord | <Rika> OH |
07:35:56 | FromDiscord | <~355/113 Man> ah, bufferID and elementID didn't get exported |
07:36:03 | FromDiscord | <Rika> VertexArrayObject.nim line 18 `unsafeAddr VAO.vertices` -> `unsafeAddr VAO.vertices[0]` |
07:36:15 | FromDiscord | <Rika> same for indices |
07:37:04 | FromDiscord | <~355/113 Man> oooh, yea |
07:38:35 | FromDiscord | <~355/113 Man> yep, that worked |
07:39:36 | FromDiscord | <Rika> seqs are laid out differently from arrays |
07:39:53 | FromDiscord | <Rika> have to get address of first element rather than of the whole seq |
07:40:09 | FromDiscord | <~355/113 Man> yea, I didn't catch that |
07:40:17 | FromDiscord | <Rika> theyre equivalent (i'd say coincidentally but its not) for arrays |
07:42:13 | FromDiscord | <~355/113 Man> it works, thanks https://media.discordapp.net/attachments/371759389889003532/810053195841404938/NimblePiE_2021-02-13_00-41-33.mp4 |
07:43:03 | FromDiscord | <Rika> stuttery rotation lol |
07:44:46 | FromDiscord | <~355/113 Man> yea, it's an untimed loop |
07:44:56 | FromDiscord | <~355/113 Man> so it's just running as fast as it can |
07:58:34 | FromDiscord | <Rika> nice, congrats anyway |
08:10:36 | * | mmohammadi_9812 joined #nim |
08:10:37 | * | mmohammadi_9812 quit (Excess Flood) |
08:10:57 | * | mmohammadi_9812 joined #nim |
08:10:58 | * | mmohammadi_9812 quit (Excess Flood) |
08:11:11 | * | mmohammadi_9812 joined #nim |
08:11:12 | * | mmohammadi_9812 quit (Excess Flood) |
08:11:25 | * | mmohammadi_9812 joined #nim |
08:11:27 | * | mmohammadi_9812 quit (Excess Flood) |
08:12:17 | ForumUpdaterBot | New thread by Mantielero: Fmusdk - SIGSEGV with ARC, see https://forum.nim-lang.org/t/7502 |
08:13:25 | * | mmohammadi9812 quit (Ping timeout: 265 seconds) |
08:31:09 | * | synthmeat quit (Ping timeout: 258 seconds) |
08:39:14 | * | grobe0ba_ joined #nim |
08:40:49 | * | synthmeat joined #nim |
08:47:00 | * | Yardanico[m] quit (*.net *.split) |
08:47:01 | * | BauxnaMatrix[m] quit (*.net *.split) |
08:47:02 | * | Clonkk[m] quit (*.net *.split) |
08:47:08 | * | grobe0ba quit (*.net *.split) |
08:47:09 | * | ryanhowe quit (*.net *.split) |
08:47:09 | * | FromGitter quit (*.net *.split) |
08:47:10 | * | grobe0ba_ is now known as grobe0ba |
08:49:46 | * | hyiltiz quit (*.net *.split) |
08:49:48 | * | Jesin quit (*.net *.split) |
08:49:55 | * | zedeus quit (*.net *.split) |
08:49:59 | * | joast quit (*.net *.split) |
08:49:59 | * | Amun_Ra quit (*.net *.split) |
08:50:02 | * | blueberrypie quit (*.net *.split) |
08:50:02 | * | Onionhammer quit (*.net *.split) |
08:50:03 | * | sepples_ quit (*.net *.split) |
08:50:06 | * | matthias[m]5 quit (*.net *.split) |
08:50:06 | * | jess quit (*.net *.split) |
08:50:06 | * | oswin[m] quit (*.net *.split) |
08:50:07 | * | wiltzutm[m] quit (*.net *.split) |
08:50:07 | * | ee7[m] quit (*.net *.split) |
08:50:08 | * | himup[m] quit (*.net *.split) |
08:50:10 | * | Kaivo quit (*.net *.split) |
08:50:13 | * | Northstrider[m] quit (*.net *.split) |
08:50:17 | * | kaletaa quit (*.net *.split) |
08:50:18 | * | ForumUpdaterBot quit (*.net *.split) |
08:50:18 | * | letto quit (*.net *.split) |
08:50:27 | * | Ekho quit (*.net *.split) |
08:50:28 | * | zielmicha__ quit (*.net *.split) |
08:50:29 | * | nikki93 quit (*.net *.split) |
08:50:29 | * | saem quit (*.net *.split) |
08:50:29 | * | npgm quit (*.net *.split) |
08:50:32 | * | EastByte quit (*.net *.split) |
08:50:32 | * | deepend quit (*.net *.split) |
08:50:35 | * | kaputse[m] quit (*.net *.split) |
08:50:36 | * | jk13579[m] quit (*.net *.split) |
08:50:37 | * | Zoom[m] quit (*.net *.split) |
08:50:37 | * | j-james[m] quit (*.net *.split) |
08:50:39 | * | mahlon quit (*.net *.split) |
08:50:41 | * | crem quit (*.net *.split) |
08:50:43 | * | sknebel quit (*.net *.split) |
08:50:48 | * | Yardanico[m] joined #nim |
08:50:48 | * | BauxnaMatrix[m] joined #nim |
08:50:48 | * | Clonkk[m] joined #nim |
08:50:48 | * | ryanhowe joined #nim |
08:50:48 | * | FromGitter joined #nim |
08:52:09 | * | jholland__ quit (Ping timeout: 253 seconds) |
08:52:27 | * | kaletaa joined #nim |
08:52:28 | * | ForumUpdaterBot joined #nim |
08:52:28 | * | letto joined #nim |
08:52:28 | * | Ekho joined #nim |
08:52:28 | * | zielmicha__ joined #nim |
08:52:28 | * | nikki93 joined #nim |
08:52:28 | * | saem joined #nim |
08:52:28 | * | npgm joined #nim |
08:52:28 | * | EastByte joined #nim |
08:52:28 | * | deepend joined #nim |
08:52:45 | * | vindaar[m] quit (Ping timeout: 244 seconds) |
08:52:45 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
08:52:55 | * | hyiltiz joined #nim |
08:52:55 | * | Jesin joined #nim |
08:52:55 | * | zedeus joined #nim |
08:52:55 | * | joast joined #nim |
08:52:55 | * | Amun_Ra joined #nim |
08:52:55 | * | blueberrypie joined #nim |
08:52:55 | * | Onionhammer joined #nim |
08:52:55 | * | sepples_ joined #nim |
08:53:10 | * | planetis[m] quit (Ping timeout: 265 seconds) |
08:53:11 | * | sekao[m] quit (Ping timeout: 244 seconds) |
08:53:11 | * | stisa quit (Ping timeout: 244 seconds) |
08:53:12 | * | Avahe[m] quit (Ping timeout: 244 seconds) |
08:53:12 | * | Avatarfighter[m] quit (Ping timeout: 244 seconds) |
08:53:13 | * | npgm quit (Ping timeout: 265 seconds) |
08:53:13 | * | headache quit (Ping timeout: 268 seconds) |
08:53:13 | * | liblq-dev quit (Ping timeout: 268 seconds) |
08:53:14 | * | MTRNord quit (Ping timeout: 268 seconds) |
08:53:15 | * | Yardanico[m] quit (Ping timeout: 258 seconds) |
08:53:16 | * | BauxnaMatrix[m] quit (Ping timeout: 258 seconds) |
08:53:16 | * | Clonkk[m] quit (Ping timeout: 258 seconds) |
08:53:17 | * | reversem3 quit (Ping timeout: 265 seconds) |
08:53:19 | * | Ekho quit (Max SendQ exceeded) |
08:53:21 | * | euantorano quit (Ping timeout: 264 seconds) |
08:53:26 | * | i_use_arch_btw[m quit (Ping timeout: 240 seconds) |
08:53:41 | * | BitPuffin quit (Ping timeout: 268 seconds) |
08:53:41 | * | unclechu quit (Ping timeout: 268 seconds) |
08:53:56 | * | alex[m]3 quit (Ping timeout: 240 seconds) |
08:53:56 | * | awici[m] quit (Ping timeout: 240 seconds) |
08:53:56 | * | FlammableDuck[m] quit (Ping timeout: 240 seconds) |
08:53:56 | * | silvernode[m] quit (Ping timeout: 240 seconds) |
08:54:00 | * | leorize[m] quit (Ping timeout: 244 seconds) |
08:54:18 | * | vycb[m] quit (Ping timeout: 268 seconds) |
08:54:19 | * | cadmium[m] quit (Ping timeout: 268 seconds) |
08:54:34 | * | jholland__ joined #nim |
08:54:39 | * | npgm joined #nim |
08:55:41 | * | antholop[m] quit (Ping timeout: 265 seconds) |
08:56:06 | * | euantorano joined #nim |
08:56:44 | * | mahlon joined #nim |
08:56:44 | * | crem joined #nim |
08:56:44 | * | sknebel joined #nim |
08:56:47 | * | npgm quit (Changing host) |
08:56:47 | * | npgm joined #nim |
08:56:47 | * | jholland__ quit (Changing host) |
08:56:47 | * | jholland__ joined #nim |
09:01:33 | * | jess joined #nim |
09:01:33 | * | Kaivo joined #nim |
09:01:33 | * | Northstrider[m] joined #nim |
09:08:45 | * | Ekho joined #nim |
09:24:03 | * | oswin[m] joined #nim |
09:25:20 | * | stisa joined #nim |
09:25:23 | * | sekao[m] joined #nim |
09:25:25 | * | Avatarfighter[m] joined #nim |
09:25:27 | * | planetis[m] joined #nim |
09:25:54 | * | alex[m]3 joined #nim |
09:25:56 | * | awici[m] joined #nim |
09:26:09 | * | headache joined #nim |
09:27:06 | * | liblq-dev joined #nim |
09:28:05 | * | matthias[m]5 joined #nim |
09:31:52 | * | vindaar[m] joined #nim |
09:32:36 | * | Yardanico[m] joined #nim |
09:32:36 | * | Clonkk[m] joined #nim |
09:32:39 | * | BauxnaMatrix[m] joined #nim |
09:34:50 | * | lnxw37d4 joined #nim |
09:36:13 | superbia | is it worth writing a CMS in NIM for my masters thesis? |
09:42:11 | * | headache quit (Ping timeout: 258 seconds) |
09:42:26 | * | matthias[m]5 quit (Ping timeout: 240 seconds) |
09:42:35 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
09:42:45 | * | sekao[m] quit (Ping timeout: 240 seconds) |
09:42:45 | * | stisa quit (Ping timeout: 240 seconds) |
09:42:56 | * | vindaar[m] quit (Ping timeout: 240 seconds) |
09:42:56 | * | liblq-dev quit (Ping timeout: 240 seconds) |
09:43:05 | * | planetis[m] quit (Ping timeout: 240 seconds) |
09:43:05 | * | Avatarfighter[m] quit (Ping timeout: 244 seconds) |
09:43:25 | * | alex[m]3 quit (Ping timeout: 240 seconds) |
09:43:26 | * | Yardanico[m] quit (Ping timeout: 240 seconds) |
09:43:30 | * | awici[m] quit (Ping timeout: 246 seconds) |
09:43:38 | * | oswin[m] quit (Ping timeout: 268 seconds) |
09:43:43 | * | BauxnaMatrix[m] quit (Ping timeout: 258 seconds) |
09:44:15 | * | Clonkk[m] quit (Ping timeout: 268 seconds) |
10:01:08 | * | a_chou quit (Remote host closed the connection) |
10:04:51 | FromGitter | <Araq> I would like to see a CMS in Nim |
10:05:56 | FromGitter | <Araq> btw where does "NIM" come form? A joke on Nim's case insensitivity? |
10:07:39 | FromDiscord | <Solitude> 3 letters = abbreviation |
10:07:42 | Oddmonger | it's like those guys who write « LUA » |
10:08:16 | FromGitter | <offbeat-stuff> How to get ref to a normal object |
10:09:00 | FromDiscord | <Recruit_main707> Normal object means stack allocated, ref object is a heap allocated object |
10:09:46 | FromDiscord | <Recruit_main707> You can use raw ptr s, in that case, addr myObj or unsafeAddr myObj |
10:11:53 | FromDiscord | <Recruit_main707> In reply to @Varriount "Also, processes have more": But multiprocessing is still the fastest option afaik |
10:12:03 | FromGitter | <offbeat-stuff> Okay, How can I have function declerations in one file that are implemented later in another file so that they could be shared between modules |
10:12:15 | superbia | I mean if you have a better / more fun project I am open for suggestions Araq |
10:13:36 | FromGitter | <offbeat-stuff> I am working on a basic cli renderer using vulkan so either recursive dependency or this option |
10:14:14 | FromDiscord | <Recruit_main707> I’m not sure you can do either one |
10:15:02 | FromDiscord | <Recruit_main707> There is a noDecl pragma, but i don’t think it will work for this |
10:16:18 | * | silvernode[m] joined #nim |
10:16:21 | * | FlammableDuck[m] joined #nim |
10:16:41 | * | cadmium[m] joined #nim |
10:16:44 | * | vycb[m] joined #nim |
10:16:50 | * | kaputse[m] joined #nim |
10:16:52 | * | Zoom[m] joined #nim |
10:16:52 | * | jk13579[m] joined #nim |
10:16:53 | * | j-james[m] joined #nim |
10:19:19 | * | wiltzutm[m] joined #nim |
10:19:19 | * | himup[m] joined #nim |
10:20:56 | * | ee7[m] joined #nim |
10:24:12 | * | leorize[m] joined #nim |
10:27:06 | * | antholop[m] joined #nim |
10:28:18 | * | BitPuffin joined #nim |
10:28:49 | * | reversem3 joined #nim |
10:30:54 | * | i_use_arch_btw[m joined #nim |
10:30:58 | * | Avahe[m] joined #nim |
10:32:32 | * | unclechu joined #nim |
10:32:34 | * | MTRNord joined #nim |
10:40:21 | * | headache joined #nim |
10:41:37 | * | lnxw37d4 joined #nim |
10:42:08 | * | Vladar joined #nim |
10:45:09 | * | matthias[m]5 joined #nim |
10:46:03 | * | dddddd quit (Ping timeout: 256 seconds) |
10:46:23 | * | dddddd joined #nim |
10:48:54 | * | stisa joined #nim |
10:48:54 | * | sekao[m] joined #nim |
10:49:19 | * | vindaar[m] joined #nim |
10:49:36 | * | liblq-dev joined #nim |
10:50:26 | * | Avatarfighter[m] joined #nim |
10:52:12 | * | planetis[m] joined #nim |
10:53:25 | * | dddddd quit (Ping timeout: 256 seconds) |
10:53:39 | * | oswin[m] joined #nim |
10:54:08 | * | awici[m] joined #nim |
10:54:28 | * | alex[m]3 joined #nim |
10:54:50 | * | BauxnaMatrix[m] joined #nim |
10:55:13 | * | Yardanico[m] joined #nim |
10:56:39 | * | Clonkk[m] joined #nim |
11:10:05 | * | tane joined #nim |
11:11:04 | Clonkk[m] | <superbia "is it worth writing a CMS in NIM"> Nim is worth learning if you're willing to put in some effort |
11:16:18 | * | dddddd joined #nim |
11:18:56 | * | nc-x joined #nim |
11:19:18 | * | dddddd quit (Excess Flood) |
11:19:25 | nc-x | anybody here who uses strictNotNil? |
11:19:37 | * | dddddd joined #nim |
11:20:46 | nc-x | or knows how it is supposed to work |
11:23:15 | nc-x | for e.g. i expected this to give a warning https://play.nim-lang.org/#ix=2Pgm |
11:23:32 | nc-x | does it only work with `not nil` or something |
11:23:38 | nc-x | or is this a bug |
11:26:17 | * | dddddd quit (Ping timeout: 256 seconds) |
11:27:05 | * | dddddd joined #nim |
11:31:57 | * | dddddd quit (Ping timeout: 256 seconds) |
11:32:45 | * | dddddd joined #nim |
11:36:00 | superbia | Clonkk[m]: but is there a more fun or realistic project to learn nim with ? |
11:36:45 | superbia | I highly doubt I'll manage to build a production grade cms |
11:38:21 | * | nc-x quit (Quit: Connection closed) |
11:41:49 | * | haxscramper joined #nim |
11:48:42 | * | krux02 quit (Ping timeout: 260 seconds) |
11:55:10 | FromDiscord | <haxscramper> https://xmonader.github.io/nimdays/ |
11:58:33 | FromGitter | <x.benjamin:matrix.org> @superbia If you're interested in decentralization, making a (web)app for the SAFE Network might be fun. Testnet is likely to launch this month. https://safenetwork.org/downloads/ ⏎ ⏎ But it would help to know what you're studying :) |
12:02:09 | * | krux02 joined #nim |
12:04:46 | * | PMunch joined #nim |
12:17:05 | * | wasted_youth2 joined #nim |
12:19:28 | superbia | interesting, I'll take a look to see how it works, but yeah, networking and decentralization is something I want to learn more about |
12:22:57 | * | dddddd quit (Ping timeout: 256 seconds) |
12:22:58 | Clonkk[m] | <superbia "Clonkk: but is there a more fun "> Cut your big project in multiple smaller project. Then do each project individually |
12:23:12 | * | vegai joined #nim |
12:23:57 | Clonkk[m] | You'll see how far you go |
12:30:09 | * | asdflkj_2 joined #nim |
12:30:11 | * | rockcavera joined #nim |
12:38:45 | FromGitter | <x.benjamin:matrix.org> @superbia feel free to DM me if you have any questions. I know of several similar projects, but SAFE is the most promising IMO. ⏎ ⏎ A good place to start is the primer: https://primer.safenetwork.org/ |
13:04:27 | superbia | thank you! |
13:09:36 | * | PMunch quit (Remote host closed the connection) |
13:10:49 | * | PMunch joined #nim |
13:10:50 | * | dddddd joined #nim |
13:27:48 | leorize[m] | @x.benjamin:matrix.org you should join the main IRC room instead of gitter |
13:28:05 | leorize[m] | +nim:asra.gr contains all rooms within the community |
13:33:18 | * | gollark[m]1 joined #nim |
13:34:10 | liblq-dev | i still wonder to this day how people get lost so far that they join the gitter room instead of the room that's listed on the website. |
13:37:25 | FromDiscord | <Rika> It’s much easier to join the gitter room accidentally I believe |
13:37:56 | FromGitter | <x.benjamin:matrix.org> I've never used gitter. I used Elements to join a Matrix room, though I don't remember how I found it. |
13:39:22 | leorize[m] | lqdev: the gitter room has more people than the irc room, so it ranks higher in element |
13:39:38 | liblq-dev | ah well, that makes a whole lot more sense now |
13:40:04 | liblq-dev | @x.benjamin:matrix.org try joining #freenode_#nim:matrix.org |
13:40:50 | liblq-dev | the gitter-matrix room annoys everyone because it goes through 3 bridge indirections instead of the usual 2 |
13:41:22 | * | Benjamin[m]2 joined #nim |
13:41:49 | Benjamin[m]2 | Looks like this room isn't searchable |
13:42:03 | liblq-dev | that's possible |
13:42:14 | Benjamin[m]2 | Or rather, it isn't discoverable through Elements |
13:42:23 | liblq-dev | you can find it if you go to the Freenode group in the room explorer but yeah |
13:42:26 | liblq-dev | it's quite obscure |
13:42:46 | liblq-dev | it appears as though they fixed the gitter bridge situation up a bit because now the message doesn't look like |
13:42:48 | liblq-dev | <FromGitter> <matrix-bot> `your-name` the message goes here |
13:43:24 | leorize[m] | yea, gitter is now a matrix server |
13:43:48 | leorize[m] | well, sort of. If it worked better and Matrix users can be admin, I would bridge directly from there |
13:51:38 | FromGitter | <krux02> gitter is also an IRC server |
13:51:51 | krux02 | I can use my IRC client for gitter |
13:53:02 | liblq-dev | that's how matrix works.™ |
13:53:18 | liblq-dev | or, so i think. that it's matrix doing these bridging shenanigans. |
13:57:06 | leorize[m] | nah, gitter has an official irc interface |
13:57:28 | leorize[m] | but it's incomplete and many things are not mapped to irc |
14:00:17 | Benjamin[m]2 | So everyone with the "freenode_" prefix is using an IRC client? Can I still DM them and vice versa? |
14:01:48 | leorize[m] | yes, you can |
14:06:38 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
14:06:53 | Benjamin[m]2 | Great, this room is much better than the old one :) |
14:07:41 | leorize[m] | yep, and only the irc rooms has portals to other subsets of the community |
14:07:59 | leorize[m] | +nim:asra.gr has a list of those rooms |
14:08:38 | liblq-dev | i love how half the rooms in +nim:asra.gr are Unnamed Room. |
14:08:46 | Benjamin[m]2 | "Not implemented yet in Element: Open group detail" |
14:09:15 | Benjamin[m]2 | I've actually been a member of the freenode Nim science room for a while |
14:10:09 | leorize[m] | lqdev: oh really? I guess communities are too buggy :( |
14:10:33 | liblq-dev | we shall wait for spaces, when they are implemented. |
14:10:35 | * | liblq-dev uploaded an image: image.png (38KiB) < https://matrix.org/_matrix/media/r0/download/gacko.pl/VXxyOwkwhKAHealYGMEUUlrj/image.png > |
14:10:40 | liblq-dev | this is how the community looks. |
14:10:56 | leorize[m] | migrating over will be a pain... |
14:23:56 | * | PMunch quit (Quit: Leaving) |
14:28:28 | * | cadmium[m] quit (Quit: Idle for 30+ days) |
14:29:53 | * | dddddd quit (Ping timeout: 256 seconds) |
14:37:35 | FromGitter | <deech> Is there any way to detect a recursive call in a functions call graph? I guess I could write a macro go down the AST but I figured I'd ask in case there was an easier ( and more robust ) way. |
14:38:27 | haxscramper | I don't think we have built-in facility to do that, so AST (typed) traversal is probably the best solution |
14:39:05 | FromGitter | <deech> Do you know if the compiler itself does it? |
14:39:21 | haxscramper | Recursive call detection? No, it doesn't |
14:39:43 | haxscramper | I haven't *specifically* dug into this part though, but from what I saw I doubt there is such analysis going on |
14:39:58 | leorize[m] | Nim doesn't to tail call optimization atm |
14:40:54 | * | NimBot joined #nim |
14:41:36 | leorize[m] | typed ast is the only way atm |
14:42:03 | * | cero joined #nim |
14:42:25 | haxscramper | deech: https://github.com/haxscramper/haxdoc/blob/master/src/haxdoc.nim#L480 to register calls I made custom pass. This one is for compiler API, but I think general outline is relatively similar |
14:42:45 | FromGitter | <deech> Nice, thanks! |
14:42:55 | * | cero quit (Client Quit) |
14:43:16 | * | dddddd joined #nim |
14:45:31 | krux02 | leorize[m], yes Nim doesn't do tail call optimization at all. But there is no reason that the backend compiler couldn't do it with the emitted code afaik |
14:47:23 | * | fredrikhr joined #nim |
14:48:58 | * | Gustavo6046 joined #nim |
14:52:45 | * | asdflkj_2 quit (Ping timeout: 264 seconds) |
14:53:07 | haxscramper | Copying callback function multiple times does not have any significant performance impact? I want to use `array[Kind: enum, cb: proc(...)]`, and copy default callback into all array elements |
14:53:22 | haxscramper | And then maybe override some of the callbacks with new values |
14:54:09 | haxscramper | IIRC closure is a pointer to function + pointer to environment: will environment be duplicated in this case? |
14:54:10 | krux02 | haxscramper, a callback is either just a pointer, or a pointer and an environment pointer |
14:54:21 | krux02 | so not more overhad than 16 bytes max |
14:54:25 | krux02 | per stored callback |
14:54:40 | haxscramper | And environment is not duplicated? |
14:56:06 | krux02 | Honestly I don't know right now, but I guess the environment is instantiated for every time you generate the callback |
14:56:49 | krux02 | but when you use functions from global scope and not lambda expressions, there is no environment to duplicate and therefore no overhead. |
14:58:32 | krux02 | except of coures the unused environment pointer |
15:00:17 | * | lritter joined #nim |
15:01:37 | * | asdflkj_2 joined #nim |
15:06:48 | FromDiscord | <konsumlamm> @haxscramper you should replace `any` with `auto`, since the former is deprecated now |
15:06:56 | FromDiscord | <konsumlamm> (in your pattern matching PR) |
15:07:41 | haxscramper | Which part specifically you are talking abuout? |
15:08:01 | haxscramper | Custom unpackers? |
15:08:58 | FromDiscord | <konsumlamm> the type `any` |
15:12:20 | FromDiscord | <gollark> Hi. I'm using some low-level bindings for a C library (cmark) which has `new_thing` and `free_thing` functions for parsers/AST nodes/etc. As of now I just have a function which allocates things, uses them, and deallocates them with a bunch of `defer`s, but now I need a function doing somewhat different operations on them. |
15:12:37 | FromDiscord | <gollark> Is there a nice way to abstract this? I was thinking a callback after all the stuff is initialized, but that seems inelegant. |
15:12:53 | FromDiscord | <gollark> My code is here if you need context of some sort: https://media.discordapp.net/attachments/371759389889003532/810166612194885652/md.nim |
15:18:03 | FromDiscord | <whisperdev> Nim is becoming popular https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/ |
15:19:53 | haxscramper | gollark: You might try `destroy=` hooks for your type, and use `free_thing` in it. Although I haven't specifically used it myself, so maybe this is not the best solution |
15:20:02 | haxscramper | But I suppose it should work |
15:20:12 | FromDiscord | <gollark> So define an `object` wrapper for it and do that? I see. |
15:20:21 | haxscramper | No, no need to define wrapper |
15:20:35 | haxscramper | I think `destroy=` worked for importc'd objects too |
15:20:57 | FromDiscord | <gollark> I think the importc-ing code defines them as `ptr`s of some sort. |
15:20:59 | FromDiscord | <Recruit_main707> @whisperdev how have they overcome this tho: https://media.discordapp.net/attachments/371759389889003532/810168649561538632/unknown.png |
15:21:24 | haxscramper | gollark: no it doesn't use `ptr`, just regular value object |
15:21:46 | Yardanico | @whisperdev this article was already shared, but yes :) |
15:22:03 | FromDiscord | <gollark> sent a code paste, see https://play.nim-lang.org/#ix=2PhN |
15:22:04 | FromDiscord | <gollark> (sorry if this looks bad on IRC) |
15:22:08 | Yardanico | it won't |
15:22:17 | Yardanico | it gets pasted to nim playground |
15:22:23 | Yardanico | @Recruit_main707 no one forbids you from 1) using --noMain and a custom main 2) modifying the C code after compilation |
15:22:50 | FromDiscord | <gollark> I'm not sure how it would be an issue. Antiviruses can't just block all code written in Nim. |
15:30:45 | * | asdflkj_2 quit (Ping timeout: 240 seconds) |
15:32:18 | haxscramper | https://play.nim-lang.org/#ix=2PhR actually I don't know anything - I though code like this would trigger `destroy=` correctly (originally tried with just `PtrNode`), but for does not call it |
15:32:43 | haxscramper | s/for does not/for some reason it does not/g |
15:33:01 | leorize[m] | it's simple, the hook is called `=destroy` :) |
15:33:06 | Yardanico | XD |
15:33:52 | leorize[m] | https://play.nim-lang.org/#ix=2PhT |
15:34:32 | haxscramper | Alright, at least it looks like I know *something* |
15:34:32 | FromDiscord | <gollark> One issue is that it needs to not free a node if it's just been attached to a tree, but the GC presumably doesn't know about that. |
15:34:45 | haxscramper | Typing things correctly does is not included in this list though |
15:35:53 | leorize[m] | @gollark the library you're using don't have a gc? |
15:36:25 | FromDiscord | <gollark> I don't see why it would, it's a markdown parser. |
15:36:54 | leorize[m] | at least a reference counter? |
15:37:01 | FromDiscord | <gollark> I don't think so? |
15:37:03 | * | abm joined #nim |
15:37:08 | FromDiscord | <gollark> Can I just `GC_unref` it when adding it to a tree, or something like that? Does that work for `--gc:orc`? |
15:37:38 | leorize[m] | if your wrapping object is a ref type |
15:37:48 | leorize[m] | but how are you gonna know what is safe to be unref? |
15:37:54 | leorize[m] | I thought you wanna get rid of your defers? |
15:39:56 | leorize[m] | cmark api looks like it keeps track of all children for you |
15:41:32 | FromDiscord | <gollark> A node is only going to need to be the root of a document tree somewhere (needs freeing once all operations on it are done), part of a tree owned somewhere else (will be freed when the root is), or something which is going to be appended to a tree soon™. |
15:42:31 | * | PMunch joined #nim |
15:42:47 | leorize[m] | sounds like a big pita for a simple wrapper with destructors |
15:43:39 | FromDiscord | <gollark> If I did that, wouldn't it incorrectly try and free a node if it had just been added to a tree? |
15:44:07 | FromDiscord | <gollark> And the function returned or something. |
15:44:15 | FromDiscord | <gollark> The Nim GC presumably doesn't know what references are present within cmark's structures. |
15:45:38 | leorize[m] | I'm afraid this problem is a bit too hard to model correctly via destructors |
15:47:34 | FromDiscord | <gollark> Oh dear. I might just have to go for the callback thing then, where I have a function which does the initialization, `defer`s the appropriate `free`s, and then calls the main logic. |
15:49:11 | haxscramper | You are working on cmark's AST structure, correct? |
15:50:21 | haxscramper | Maybe it is possible to formulate more idiomatic solution if we move couple layers up: e.g. you might write some templates to abstract boilerplate code |
15:51:14 | FromDiscord | <gollark> Maybe. I think that would be pretty much like the callback approach but with a slightly different interface, though. |
15:55:18 | leorize[m] | you might be able to model the problem in an another way |
15:56:13 | leorize[m] | use two types for this: `Node` and `LentNode` |
15:56:29 | leorize[m] | the only difference is that `LentNode` have a no-op destructor |
15:56:58 | leorize[m] | so first, make copying `Node` an error |
15:57:46 | FromDiscord | <gollark> How do you do that? |
15:58:19 | leorize[m] | https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-eqcopy-hook |
15:59:04 | leorize[m] | now you would want any traversal operations on `Node` to yield `LentNode`, since the memory is managed by the parent `Node` |
16:00:05 | leorize[m] | provide an `unlink(n: sink LentNode): Node` operation that consumes a `LentNode` and produce `Node`, signifying that the memory is now owned in whole by the `Node` |
16:00:13 | * | rockcavera quit (Remote host closed the connection) |
16:00:15 | leorize[m] | that's how I would try to model this :P |
16:01:33 | FromDiscord | <gollark> Seems reasonable, I could try that. |
16:04:12 | leorize[m] | your wrapper should probably map the Nim allocator to cmark |
16:06:33 | FromDiscord | <gollark> What's the benefit of that? |
16:06:55 | FromDiscord | <gollark> Is it something where it'll probably cause horrible memory bugs if I don't? |
16:08:05 | leorize[m] | it would enable memory reuse for the most part |
16:08:15 | leorize[m] | there are no ill effects otherwise |
16:11:29 | * | mmohammadi9812 joined #nim |
16:30:32 | PMunch | Hmm, is there a mod in Nim that does negative numbers? |
16:30:57 | FromDiscord | <Rika> that what? |
16:31:02 | FromDiscord | <Rika> OH |
16:31:10 | FromDiscord | <Rika> you mean modulo |
16:31:16 | PMunch | Yes |
16:31:20 | FromDiscord | <Rika> idiot here thought moderator |
16:31:28 | PMunch | Haha :P |
16:31:44 | PMunch | I want -1 mod 12 == 11 |
16:31:46 | FromDiscord | <Yardanico> i do negative numbers |
16:32:08 | FromDiscord | <Yardanico> @PMunch i think there should be something like that |
16:32:08 | PMunch | I mean I also do negative numbers, but I'm only an IRC mod |
16:32:19 | PMunch | Yeah I seem to remember there is |
16:33:48 | PMunch | Ah math.floorMod |
16:33:58 | PMunch | !eval import math; echo floorMod(-1, 12) |
16:34:01 | NimBot | 11 |
17:06:32 | FromDiscord | <exelotl> soooo if I'm wrapping a C api and it takes a pointer but doesn't modify the underlying value in any way... `lent` seems like it would be the best option, but I heard that `lent` is not guaranteed to use a hidden pointer in the future? |
17:07:01 | FromDiscord | <exelotl> is that true? What else could I use instead of `lent`? |
17:10:54 | planetis[m] | well plain object with the .byref pragma |
17:11:19 | planetis[m] | also lent can't be used in parameters |
17:11:27 | planetis[m] | only return |
17:11:52 | leorize[m] | or just use a pointer :p |
17:12:31 | planetis[m] | yeah most probably a pointer |
17:13:04 | leorize[m] | you can always provide an overload that uses unsafeaddr |
17:15:56 | * | FromGitter quit (Remote host closed the connection) |
17:15:57 | * | oprypin quit (Quit: Bye) |
17:15:57 | FromDiscord | <exelotl> yeahhh I guess overload with unsafeAddr is the way to go |
17:16:02 | FromDiscord | <exelotl> I tried this: https://play.nim-lang.org/#ix=2PiL |
17:16:17 | * | oprypin joined #nim |
17:16:27 | FromDiscord | <exelotl> it compiles fine but the 2nd arg doesn't become a pointer in the generated C code |
17:16:28 | * | FromGitter joined #nim |
17:18:11 | leorize[m] | `type A = B` is an alias |
17:18:57 | leorize[m] | control pragmas have no effect on those |
17:32:42 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2PiS |
17:32:43 | FromDiscord | <exelotl> because that's kind of a big deal for me :( |
17:38:13 | FromDiscord | <Rika> remove the size and check the sizeof(set[Foo]) |
17:38:33 | FromDiscord | <Rika> !eval type Foo = enum a, b, c; echo sizeof set[Foo] |
17:38:34 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';' |
17:38:40 | FromDiscord | <Rika> really |
17:38:46 | FromDiscord | <Rika> cant do it w/o a new line ig |
17:41:59 | FromDiscord | <Recruit_main707> !eval type Foo = enum a, b, c↵echo sizeof set[Foo] |
17:42:01 | NimBot | Compile failed: /usercode/in.nim(1, 42) Error: identifier expected, but got '[' |
17:42:49 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
17:42:56 | FromDiscord | <gollark> Thanks leorize, I seem to have stuff basically working now. |
17:43:13 | FromDiscord | <gollark> I was worried about performance but it seems basically fine. |
17:44:25 | leorize[m] | that's nice :) |
17:45:25 | FromDiscord | <saturnoZmarte> hello |
17:45:47 | leorize[m] | hi |
17:49:17 | * | wasted_youth2 joined #nim |
18:03:18 | * | PMunch quit (Remote host closed the connection) |
18:03:41 | FromDiscord | <exelotl> oh sizeof does work for set aliases: https://play.nim-lang.org/#ix=2Pj3 |
18:03:54 | FromDiscord | <exelotl> (edit) "sizeof" => "{.size:n.}" |
18:04:13 | FromDiscord | <gollark> I ran my program through `valgrind` to check if it was horribly leaking memory (it doesn't seem to be). It says `Uninitialised value was created by a stack allocation at 0x33DD0A: renderToHtmlrZvmxUK6kmA9c1R4XvQQuAw`, should I be worried? |
18:07:09 | * | Q-Master quit (Ping timeout: 264 seconds) |
18:14:41 | krux02 | @exelotl: for what do you need to specify the size of a set? |
18:16:37 | krux02 | ah, I see it, you just tested the compiler consistency on how it handles pragmas. |
18:16:39 | * | waleee-cl joined #nim |
18:17:38 | * | Q-Master joined #nim |
18:20:34 | FromDiscord | <exelotl> I want all my sets to use the machine's native word size, for performance reasons and interop with existing C code |
18:24:52 | FromDiscord | <gollark> How come the standard library's `re` doesn't have anything like `findAll` but returning the positions of each match? |
18:24:53 | haxscramper | > interop with existing C code |
18:24:53 | haxscramper | You want to pass nim set to a function expecting bitmasked enum? |
18:24:57 | FromDiscord | <gollark> (unless it does and I haven't noticed) |
18:26:56 | haxscramper | exelotl: If you get this working in the end could you then share sample code, because it seems like a very useful thing oveall |
18:28:45 | * | fredrikhr quit (Ping timeout: 264 seconds) |
18:28:45 | * | Q-Master quit (Ping timeout: 240 seconds) |
18:31:50 | * | Q-Master joined #nim |
18:33:40 | FromDiscord | <KSun> sent a long message, see http://ix.io/2Pjf |
18:41:27 | FromDiscord | <Rika> objects are structs |
18:42:32 | FromDiscord | <exelotl> yep, and Nim has pragmas that can be used to make packed structs, bitfield structs, structs with certain alignment, etc. |
18:42:50 | FromDiscord | <KSun> That's certainly interesting |
18:49:22 | FromDiscord | <treeform> In reply to @KSun "Hi guys, i have": I have done ton of performance things in Nim. It appears that I can make Nim code perform the same as C in almost all cases. Usually there is couple of bottlenecks in your program, after profiling and measuring what they are you can really focus on making those parts go fast. |
18:50:15 | FromDiscord | <treeform> Algorithmic improvements "Big-O" have the biggest payoffs. |
18:51:18 | FromDiscord | <treeform> Nim's seqs and objects are basically c structs and arrays so they are usually just as fast. |
18:54:51 | FromDiscord | <treeform> https://forum.nim-lang.org/t/5363 |
18:55:53 | * | PMunch joined #nim |
18:57:05 | * | fredrikhr joined #nim |
19:01:19 | ForumUpdaterBot | New question by Anthony: Is there amy way you can import local proc's from other files in the same directory?, see https://stackoverflow.com/questions/66188803/is-there-amy-way-you-can-import-local-procs-from-other-files-in-the-same-direct |
19:01:27 | FromDiscord | <Yardanico> @KSun Nim objects compile into C structs |
19:01:50 | FromDiscord | <Yardanico> ah, nvm |
19:01:53 | FromDiscord | <Yardanico> i'm late |
19:05:11 | FromDiscord | <KSun> @treeform If you have C experience, did you find Nim limiting in any way, in real world scenarios? Or beneficial alternatively? I heard one person say that Nim was a way of writing C, but with less typing. That also sounds interesting, but these types of claims don't always pan out in the real world. |
19:06:44 | * | mmohammadi_9812 joined #nim |
19:09:36 | * | mmohammadi9812 quit (Ping timeout: 240 seconds) |
19:15:49 | FromDiscord | <Yardanico> I think you misread that person's messages or something, Nim is Nim, but you can write Nim code C-style (doing memory management and a lot of other things by yourself), that is true |
19:16:44 | FromDiscord | <Avatarfighter> I assume KSun meant Nim compiles to C and therefore the amount of code you write in nim can be less than the functionality that is outputted |
19:16:51 | FromGitter | <deech> Dumb question: how do I print the address of a `pointer`? |
19:17:15 | FromDiscord | <treeform> In reply to @KSun "<@!107140179025735680> If you have": I don't have extensive experience with c. From the C i have written I would say Nim is much nicer. |
19:17:29 | FromDiscord | <dom96> In reply to @deech "Dumb question: how do": `repr` should work, or cast it to an int and use toHex() |
19:18:05 | saem | I was going to say try the cast based on this thread: https://forum.nim-lang.org/t/3806 |
19:18:40 | FromDiscord | <treeform> In reply to @Yardanico "I think you misread": A lot of times doing C-style pointers and manual management is not needed to reach C speeds. So you are not really writing C code in Nim. |
19:18:51 | FromDiscord | <Yardanico> nonono, maybe you misunderstood me |
19:18:52 | FromGitter | <deech> dom96, thanks! I keep forgetting about `repr`, I tried `addr` and `unsafeAddr`. |
19:19:03 | FromDiscord | <Yardanico> I mean that you can use Nim as a "syntax skin" for C, but there's no reason to |
19:19:10 | FromDiscord | <treeform> yeah |
19:19:32 | FromDiscord | <treeform> only in minor critical sections it can get wired |
19:20:00 | FromDiscord | <treeform> we drop to simd in many places we want to go fast, but then you would so same in C. Simd code is hard to read 😦 |
19:20:18 | FromDiscord | <treeform> its basically assembly |
19:20:46 | FromDiscord | <haxscramper> In reply to @KSun "<@!107140179025735680> If you have": sent a long message, see http://ix.io/2PjA |
19:20:47 | FromDiscord | <treeform> Its not really C or Nim code its just SIMD-assembly code. |
19:21:13 | FromDiscord | <haxscramper> Though idiomatic nim does not need this most of the time |
19:21:23 | FromDiscord | <Yardanico> yay, a cursor inference bug |
19:21:27 | FromDiscord | <Yardanico> with arc |
19:22:26 | FromDiscord | <Recruit_main707> @Yardanico may you tell the stackoverflow guy that you export the function with the `` symbol? i cant comment bc rep :( |
19:22:50 | FromDiscord | <Yardanico> dione |
19:22:51 | FromDiscord | <Yardanico> (edit) "dione" => "done" |
19:22:52 | saem | Is testament's --failing flag not working as expected for other folks as well? It seems to make no difference to the out, I'm still getting spammed with pass/skip messages and the fail output keeps scrolling on by? |
19:22:53 | FromDiscord | <Recruit_main707> ty |
19:23:24 | FromDiscord | <haxscramper> In reply to @haxscramper "> don't always pan": What really stands out wrt. to interop is how much added value you can create by wrapping C libraries in nim without sacrificing either performance or ergonomics. |
19:40:32 | ForumUpdaterBot | New thread by Mantielero: Importing a file in runtime, see https://forum.nim-lang.org/t/7503 |
19:40:45 | FromDiscord | <Yardanico> eh |
19:43:33 | * | xace quit (Ping timeout: 260 seconds) |
19:44:07 | FromDiscord | <Recruit_main707> 🥴 |
19:44:34 | FromDiscord | <Yardanico> 🥴 |
19:44:49 | FromDiscord | <Yardanico> 🥴 https://media.discordapp.net/attachments/371759389889003532/810235045334745098/unknown.png |
19:45:23 | * | xace joined #nim |
19:48:16 | * | mmohammadi9812 joined #nim |
19:48:58 | * | mmohammadi_9812 quit (Ping timeout: 256 seconds) |
19:51:26 | * | mmohammadi9812 quit (Max SendQ exceeded) |
19:51:45 | FromDiscord | <Clyybber> yay for arc bugs! |
19:51:54 | * | mmohammadi9812 joined #nim |
19:52:19 | FromDiscord | <Recruit_main707> orc too? |
19:52:28 | FromDiscord | <Yardanico> @Recruit_main707 it's a bug with cursor inference |
19:52:29 | FromDiscord | <Yardanico> so yes |
19:52:50 | FromDiscord | <Yardanico> -d:useMalloc for "best" results |
19:52:53 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2PjR |
19:53:04 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/810237122359066644/unknown.png |
19:56:21 | FromDiscord | <Yardanico> the bug's pretty obvious from the expandArc https://media.discordapp.net/attachments/371759389889003532/810237946723958824/unknown.png |
19:56:51 | FromDiscord | <Yardanico> lan_ip_cursor takes splitted[1] but splitted is destroyed at the end of the iteration, so on the next iteration lan_ip_cursor points to free'd memory |
20:00:39 | * | Kaivo quit (Quit: WeeChat 3.0) |
20:05:16 | PMunch | Hmm, do I need to do `buttonLeft = btnp(pcLeft)` in `gameUpdate`? |
20:05:25 | PMunch | Whoops, wrong channel |
20:18:04 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/issues/17033 posted |
20:33:12 | FromDiscord | <Clyybber> > "Best" results when compiled with -d:useMalloc :)↵😁 |
20:45:22 | * | kenran joined #nim |
20:45:24 | * | kenran quit (Client Quit) |
20:45:53 | * | kenran joined #nim |
20:49:01 | * | haxscramper quit (Remote host closed the connection) |
20:50:31 | FromDiscord | <~355/113 Man> can I create an object and initialize it at the same time from like an array? |
20:51:23 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pk9 |
21:00:50 | * | Kaivo joined #nim |
21:13:44 | FromDiscord | <exelotl> you can't omit the names of the fields though |
21:13:44 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Pkl |
21:14:06 | FromDiscord | <~355/113 Man> also i'm trying to define a conversion between array[16, float32] and Matrix4f, but it says redefining Matrix4f |
21:14:47 | FromDiscord | <Solitude> are you making Matrix4f proc for that? |
21:14:56 | FromDiscord | <~355/113 Man> func |
21:15:06 | FromDiscord | <Solitude> doesnt matter |
21:15:09 | FromDiscord | <Solitude> cant do that |
21:15:15 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pkm |
21:15:27 | liblq-dev | call it with a lowercase letter |
21:15:31 | liblq-dev | to distinguish it from the type |
21:15:38 | FromDiscord | <~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pkm" => "https://play.nim-lang.org/#ix=2Pkn" |
21:16:36 | * | mmohammadi9812 quit (Read error: Connection reset by peer) |
21:17:30 | FromDiscord | <~355/113 Man> I thought you could define your own conversions though |
21:17:49 | FromDiscord | <Solitude> nope |
21:17:52 | liblq-dev | well, that was an incorrect assumption |
21:18:09 | FromDiscord | <~355/113 Man> I swear I remembered reading that somewhere |
21:18:28 | liblq-dev | you can declare your own implicit conversions, but not explicit ones |
21:18:46 | liblq-dev | rather, you can't name explicit conversions the same as your type |
21:18:52 | FromDiscord | <~355/113 Man> oh, well then how do I do that? |
21:19:13 | liblq-dev | https://nim-lang.org/docs/manual.html#converters |
21:19:24 | FromDiscord | <Solitude> or you could do `func to(array: array[16, float32], t: typedesc[Matrix4f]): Matrix4f` and `arrayStuff.to(Matrix4f)` |
21:19:49 | liblq-dev | obligatory "using converters is not a very wise idea if your code is part of some library" statement |
21:19:57 | FromDiscord | <dk> tldr; converter names don't matter, just the types |
21:21:25 | FromDiscord | <exelotl> Yeah converters are best avoided unless you're trying to achieve some very unconventional semantics |
21:21:46 | FromDiscord | <exelotl> for example you can use converters to implement golang style interfaces |
21:22:14 | FromDiscord | <~355/113 Man> well I want to construct a matrix from an array as that imo is the easiest way, but OpenGL requires the array to be in a different format than what makes sense to initialize the matrix in |
21:22:33 | FromDiscord | <~355/113 Man> I suppose I could do a toOpenGL array |
21:22:43 | FromDiscord | <~355/113 Man> that probably makes the most sense now that I think of it |
21:23:13 | * | solitudesf joined #nim |
21:24:30 | * | solitudesf quit (Client Quit) |
21:34:08 | FromDiscord | <gollark> What would the least terrible way to get the (English) sentence surrounding a position in a string? |
21:34:30 | FromDiscord | <gollark> I can probably come up with some sort of regex, but there would be annoying edge cases and stuff, so has anyone already done this and made a library? |
21:36:46 | FromDiscord | <exelotl> I guess you search backward to the previous full stop (or start of the string) and forwards to the next full stop (or end of the string) |
21:36:55 | FromDiscord | <exelotl> (edit) "backward" => "backwards" |
21:37:19 | FromDiscord | <exelotl> it's probably more involved than that though lol |
21:38:04 | FromDiscord | <exelotl> like what if someone puts an email or domain in the sentence? What about ellipses? |
21:40:42 | FromDiscord | <gollark> I was thinking something like defining a sentence as having either an end-of-string or one of !?. at the end with a space after it. |
21:41:22 | FromDiscord | <gollark> I checked nimble directory, but there don't seem to be things for this, but I was hoping someone might know where there is code for it because having to work out the edge cases myself would be bad. |
21:43:12 | FromDiscord | <gollark> Especially since I just realized another really bad one, "i.e." and such. |
21:44:50 | FromDiscord | <gollark> This isn't for anything where I specifically need sentences, but just a reasonable bit of context around a link, so it could work to just look X words left/right instead. |
21:46:09 | * | xet7 quit (Ping timeout: 264 seconds) |
22:03:33 | * | xet7 joined #nim |
22:05:42 | FromDiscord | <~355/113 Man> does division by ints return a float? |
22:06:28 | liblq-dev | yes |
22:07:01 | FromDiscord | <~355/113 Man> hmmm strange |
22:10:22 | liblq-dev | well it makes sense |
22:10:32 | liblq-dev | you'd expect 1 / 2 to result in 0.5 |
22:10:43 | FromDiscord | <~355/113 Man> I'd expect 1 / 2 to result in 0 |
22:10:50 | liblq-dev | on what basis? |
22:10:56 | liblq-dev | mathematically that's incorrect |
22:10:59 | liblq-dev | if you want integer division, use 1 div 2 |
22:11:04 | FromDiscord | <~355/113 Man> on the basis on every other language |
22:11:10 | FromDiscord | <~355/113 Man> (that I know) |
22:11:28 | liblq-dev | just because "every other language" does it, doesn't mean that it's the best way to go about it :) |
22:11:47 | FromDiscord | <~355/113 Man> no, but standards are nice |
22:12:19 | liblq-dev | well there isn't any standard saying "the / operator used on integers should always return an integer" |
22:12:28 | liblq-dev | so we may as well do the more mathematically correct thing |
22:12:30 | FromDiscord | <~355/113 Man> no written standard |
22:13:02 | liblq-dev | and we have an alternate operator for integer division, in the cases where it is actually necessary |
22:14:22 | FromDiscord | <konsumlamm> python also returns a float there fwiw |
22:17:03 | FromDiscord | <Hi02Hi> @~355/113 Man ah so the ~3 man↵im playing |
22:18:41 | FromDiscord | <~355/113 Man> well in the context of code, yes |
22:20:09 | FromDiscord | <Hi02Hi> imagine how much code would change if pi was exactly 3 |
22:20:34 | * | Jesin quit (Quit: Leaving) |
22:22:23 | FromDiscord | <gollark> What would geometry look like then? |
22:22:41 | FromDiscord | <~355/113 Man> at PI == 3? idk, but I do know at PI == 4 |
22:23:06 | * | Jesin joined #nim |
22:23:38 | FromDiscord | <~355/113 Man> I wonder if you could get PI == 3 for triangles |
22:25:04 | Prestige | reminds me of https://xkcd.com/221/ |
22:27:11 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkP |
22:31:07 | FromDiscord | <~355/113 Man> btw is there an IDE for Nim? |
22:32:20 | FromDiscord | <ElegantBeef> Vscode is the most used editor, (n)vim is the second most used |
22:32:37 | FromDiscord | <ElegantBeef> Jetbrains does have a Nim extension |
22:32:49 | FromDiscord | <ElegantBeef> Though it's fairly early and lacking a bit the last i checked |
22:32:53 | krux02 | there is also emacs. |
22:33:12 | FromDiscord | <~355/113 Man> so no (true)IDEs yet |
22:33:18 | krux02 | but emacs mostly has syntax highlighting and *compile* integration |
22:33:30 | FromDiscord | <~355/113 Man> (other than maybe the Jetbrains) |
22:33:38 | krux02 | whatever you mean by "true IDE" |
22:33:44 | FromDiscord | <~355/113 Man> i'm using Notepad++ at the moment |
22:34:06 | FromDiscord | <~355/113 Man> In reply to @krux02 "whatever you mean by": an actual IDE rather than just a really good text editor |
22:34:06 | Prestige | what about uh |
22:34:17 | Prestige | anything other than notepad++ |
22:34:18 | krux02 | IDE literally "integrated development environment" and emacs is pretty much just that, a development environment that integrates almost everything. |
22:35:05 | FromDiscord | <~355/113 Man> In reply to @Prestige "anything other than notepad++": that's why i'm asking |
22:35:25 | FromDiscord | <ElegantBeef> Use vscode, sublime, nvim, or anything that's actually good |
22:35:27 | Prestige | vscode and neovim |
22:35:45 | FromDiscord | <~355/113 Man> i'll look into VSC |
22:35:50 | krux02 | I am pretty happy with emacs right now. |
22:36:00 | FromDiscord | <~355/113 Man> I don't know anything about emacs |
22:36:44 | krux02 | well, it is a lisp machine. |
22:36:51 | krux02 | that also has a text editor |
22:37:03 | krux02 | a virtual lisp machine |
22:37:08 | FromDiscord | <~355/113 Man> idk what that is |
22:37:54 | krux02 | an environment that allows you to execute lisp code and modify everything at runtime with lisp |
22:38:22 | krux02 | or better said a very programmable environment. |
22:40:51 | krux02 | but yea, if you just want something that gets you started easily, without learning something completely alien to you, vscode is the way to go. |
22:42:12 | Clonkk[m] | (Neo)Vim is easy enough to learn i feel |
22:47:21 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkX |
22:47:46 | FromDiscord | <arne> @~355/113 Man regarding the div operator and the / operator. I was against this weird Nim behavior as well in the beginning. It took me a while to like it, but it is actually a good idea. |
22:48:21 | FromDiscord | <arne> Separating integer devision and floating point division is a good thing. They are semantically something different and it is nice if they read differently. |
22:48:38 | FromDiscord | <arne> what is the errer? |
22:48:43 | FromDiscord | <arne> (edit) "errer?" => "error?" |
22:49:30 | FromDiscord | <~355/113 Man> type mismatch with `/` |
22:49:42 | FromDiscord | <~355/113 Man> float64 and int64 |
22:49:49 | FromDiscord | <arne> yea you need to have the same type on both sides. |
22:50:04 | FromDiscord | <arne> so either provide an integer on both sides or ar float64 on both sides |
22:50:26 | FromDiscord | <~355/113 Man> also I'm kind of surprised this needs a cast↵`sleep(inMilliseconds(duration).int)` |
22:50:42 | FromDiscord | <arne> I think the operator that divites integers and implicitly converts them to a float64 should not be used. |
22:51:14 | FromDiscord | <arne> and yes, I am also surprised that int is not just an alias to int64 |
22:51:27 | FromDiscord | <arne> I complained about it. I tried to fix it in the past. |
22:51:45 | FromDiscord | <arne> but there is someone who thinks it is just a waste of time to try to fix it. |
22:51:56 | FromDiscord | <~355/113 Man> also does `inTimelength` round or truncate? |
22:52:16 | FromDiscord | <arne> I don't know that procedure, so I don't know |
22:52:52 | FromDiscord | <arne> usually I would recommend you to use such a high precision that it doesn't matter if it truncates or rounds. |
22:53:17 | FromDiscord | <~355/113 Man> that would actually be worse |
22:53:19 | FromDiscord | <~355/113 Man> ish |
22:53:35 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkY |
22:54:34 | FromDiscord | <~355/113 Man> or rather I would have to add error tolerance then if I went higher precision |
23:01:50 | * | sagax quit (Quit: Konversation terminated!) |
23:14:24 | * | kenran quit (Remote host closed the connection) |
23:24:20 | FromDiscord | <arne> @~355/113 Man when you work in time ranges, you should check for both for upper and lower bounds. |
23:25:28 | FromDiscord | <arne> Nim supports slices |
23:26:00 | FromDiscord | <arne> check time in 1.5 .. 2.5 |
23:26:08 | FromDiscord | <~355/113 Man> oh interesting |
23:26:45 | saem | Any reason to not differentiate between a case expression vs case statement as is done in if expression vs if statement? |
23:27:41 | saem | Oh, maybe I'm failing at searching |
23:28:55 | FromDiscord | <Hi02Hi> wdym? |
23:30:57 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pl7 |
23:31:17 | saem | There is an nkIfExpr and nkIfStmt in the AST for node kinds but only one nkCaseStmt |
23:40:25 | * | vicfred quit (Quit: Leaving) |
23:41:43 | * | vicfred joined #nim |
23:43:36 | saem | for example you can see the differentiated vs non-differentiated ASTs here: https://play.nim-lang.org/#ix=2Pla |
23:55:33 | * | tane quit (Quit: Leaving) |
23:58:30 | * | abm quit (Read error: Connection reset by peer) |