<< 13-02-2021 >>

00:00:00FromDiscord<ElegantBeef> You mean starting multiple processes at once?
00:00:36FromDiscord<Recruit_main707> Multiprocessing, pipes, all that stuff
00:00:53FromDiscord<Recruit_main707> It doesn’t seem to be supported in the stdlib either
00:01:00FromDiscord<ElegantBeef> https://nim-lang.org/docs/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29
00:01:02FromDiscord<ElegantBeef> Well you got that
00:01:10FromDiscord<ElegantBeef> But that blocks until all are done
00:02:25FromDiscord<ElegantBeef> Might be the best to run all your commands manually using startprocess, though no clue how the piping works with that
00:03:47FromDiscord<ElegantBeef> Could've sworn i seen a library for what you wanted somewhere 😄
00:04:15*Vladar quit (Quit: Leaving)
00:04:46FromDiscord<~355/113 Man> hmm are these supposed to be absolute paths?↵`Error: unhandled exception: Access is denied.↵Additional info: "(\"assets\", \"bin\")" [OSError]`
00:05:36FromDiscord<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:39FromDiscord<ElegantBeef> What's the line of code you tested
00:06:04FromDiscord<~355/113 Man> oh it should be cpDir not mvDir
00:07:12FromDiscord<~355/113 Man> yay, now both `nimble run` and double clicking the exe both work
00:07:59FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PdR
00:08:33FromDiscord<~355/113 Man> ehhh, run.bat (which contains just `nimble run`) doesn't work though...
00:08:48FromDiscord<~355/113 Man> (and run.bat is in the same folder as `.nimble`)
00:08:59FromDiscord<ElegantBeef> Why are you using a bat file to automate a two words? 😄
00:09:05FromDiscord<ElegantBeef> Just make a build task in your ide
00:09:21FromDiscord<ElegantBeef> Assuming you're using an IDE i gues
00:09:21FromDiscord<ElegantBeef> (edit) "gues" => "guess"
00:09:23FromDiscord<~355/113 Man> so that I can do `fn+F5, enter` to run from notepad++
00:09:36FromDiscord<ElegantBeef> Can notepad++ not run a command then?
00:09:44FromDiscord<~355/113 Man> that is it running the command
00:09:54FromDiscord<ElegantBeef> So why not just run `nimble run`
00:09:55FromDiscord<~355/113 Man> or rather it runs the bat
00:10:06FromDiscord<~355/113 Man> it can't run the command as far as I can tell
00:10:09FromDiscord<~355/113 Man> just a file
00:10:57FromDiscord<~355/113 Man> actually the bat does work, I guess it's just notepad++ not wanting to run it
00:11:19FromDiscord<~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:24FromDiscord<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:35FromDiscord<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:38GreaseMonkeyalright, 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:55GreaseMonkeywhat goes into the arguments of texture.lockTexture(...) here is a pointer to a pointer to raw pixel data i can write to
01:24:05GreaseMonkeythis is defined as "pixels: ptr pointer"
01:24:18GreaseMonkeyi can extract the *pitch* just fine, defined as "pitch: ptr cint"
01:35:53FromDiscord<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:19FromDiscord<exelotl> you can however do `cast[ptr UncheckedArray[uint32]](surface.pixels)`
01:40:58FromDiscord<exelotl> oh wait, ptr pointer...
01:43:02FromDiscord<exelotl> seems pretty dodgy, I'm sure it should just be a straight pointer
01:45:13FromDiscord<exelotl> ah nvm I should've read more carefully, didn't realise it was for lockTexture
01:57:18Prestigewhen 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:42GreaseMonkeyUncheckedArray[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:11FromDiscord<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:23Prestigeoh neat
02:06:38Prestigealso 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:45Prestige(on nim stable)
02:07:06PrestigeWhich makes me wonder if this is incorrect or outdated: https://nim-lang.github.io/Nim/testament.html
02:12:04Prestigeuh so my tests HAVE to be in ./tests even if I give testament a full path to the test file? How strange
02:12:51Prestigeand I think the test file name has to start with a t... also not mentioned in the docs
02:20:19ForumUpdaterBotNew post on r/nim by abakune: Tagfiles in Nim?, see https://reddit.com/r/nim/comments/liqzkp/tagfiles_in_nim/
02:29:06FromDiscord<~355/113 Man> `nimble init` sets up a test environment for you
02:29:22FromDiscord<ElegantBeef> He's using testament not `unittest`
02:31:45*asdflkj_2 quit (Ping timeout: 246 seconds)
02:31:57FromDiscord<~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:40FromDiscord<ElegantBeef> Yea it's similar to testament
02:41:47PrestigeIt's strange there are so many unwritten requirements
02:47:16FromDiscord<flywind> I also USE testament in MY project.
02:47:38FromDiscord<ElegantBeef> What's with the emphasis?
02:48:02PrestigeChandler?
02:48:51FromDiscord<flywind> MY phone input has some issues
02:48:54PrestigeI hope I can tune testament to not require the t prefix
02:50:22FromDiscord<flywind> it automatically capitalizes english characters
02:51:04FromDiscord<flywind> testament r should support no t prefix
02:52:12PrestigeHmm 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:04Prestigeoh it does, it was just an issue of my filename in general... I wonder why there are restrictions on filenames
03:23:09Prestigelike you can't use . or -
03:24:54FromDiscord<ElegantBeef> They have to be valid nim module names
03:25:01PrestigeYeah that's what I mean though
03:25:23FromDiscord<ElegantBeef> well how do you import `sillymodule.two`
03:26:03FromDiscord<~355/113 Man> by searching for the last `.` not the first `.`?
03:26:05PrestigeWhat do you mean?
03:26:19FromDiscord<~355/113 Man> like `sillymodule.two.nim`
03:26:25Prestige^
03:26:30PrestigeI meant @beef
03:26:31FromDiscord<ElegantBeef> `.` and `-` are operators in nim
03:26:43FromDiscord<~355/113 Man> oh for the actual import code
03:26:44Prestigebut if it's in a string?
03:26:54Prestigeimport "foo.bar"
03:27:00FromDiscord<ElegantBeef> Get out
03:27:16PrestigeI have to use quotes anyway
03:27:21Prestigeimport "../../../foo"
03:27:29FromDiscord<ElegantBeef> you dont need the quotes
03:27:36FromDiscord<ElegantBeef> `import ../../../foo` is valid
03:28:03FromDiscord<exelotl> ahhh shit, I thought if I exported a module I could refer to that module by name
03:28:07Prestigereally? I thought I had compilation errors without them
03:28:14FromDiscord<ElegantBeef> Hell no
03:28:18FromDiscord<ElegantBeef> No issues
03:28:43FromDiscord<~355/113 Man> I don't have issues
03:28:54FromDiscord<ElegantBeef> I mean you're in the Nim discord, you clearly do
03:29:09*lritter quit (Ping timeout: 246 seconds)
03:29:47Prestigehuh weird
03:31:06Prestigebut anyway, still annoying that I can't use . or - in my file names
03:31:28FromDiscord<ElegantBeef> They arent valid nim identifiers
03:31:40PrestigeCorrect
03:31:52Prestigebut it still sucks that I can't use them
03:31:59FromDiscord<ElegantBeef> Eh, i think it's fine
03:32:41FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Peu
03:32:48FromDiscord<~355/113 Man> I figured it out
03:33:00FromDiscord<ElegantBeef> What?
03:33:44FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Pev
03:34:11Prestigecould just be "foo" in nim
03:34:16FromDiscord<~355/113 Man> yea, that's what I mean, at first I thought you meant the import
03:34:24PrestigeI mostly want it for tests, so I can to foo.test.nim
03:34:28FromDiscord<~355/113 Man> In reply to @Prestige "could just be "foo"": but now your module doesn't match your file name
03:34:44FromDiscord<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:51Prestigethat's fine, could still just be the name up until the first . or -
03:35:31FromDiscord<exelotl> I wanted to be able to do `import a` followed by `b.bar()` (b is exported after all)
03:35:32FromDiscord<~355/113 Man> wait, there's an export?
03:36:40FromDiscord<exelotl> yes, it's for forwarding symbols from other modules
03:37:53FromDiscord<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:55Prestigeor you could import "foo.thingy" as thingy
03:39:07FromDiscord<ElegantBeef> Get your strings out of here
03:39:31Prestigenever!
03:40:12PrestigeAlso for testament - testing for errors are handled by comments?
03:41:02Prestigeor strings rather
03:41:08FromDiscord<ElegantBeef> No
03:41:31FromDiscord<ElegantBeef> It seems the `discard """Your message""` is sent if the next assert fails
03:42:07FromDiscord<ElegantBeef> I dont really get it, havent used it myself
03:42:17FromDiscord<ElegantBeef> Maybe flywind or someone that has will speak up now 😄
03:42:20PrestigeHm this is confusing. I'm wanting to assert that foo() will throw a specific error
03:43:36FromDiscord<flywind> doAssertRaises I guess
03:45:26Prestigeoh neat, thanks
03:45:33FromDiscord<flywind> np
03:45:38*muffindrake quit (Ping timeout: 264 seconds)
03:45:50FromDiscord<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:18FromDiscord<exelotl> I really wanted them to be able to do `import natu` and get all the modules
03:47:06FromDiscord<exelotl> I mean... I could have them do `include natu/prelude` but that sucks
03:47:12*muffindrake joined #nim
03:50:20FromDiscord<ElegantBeef> The dumb thing would be `import natu` `importNatuDeps()`
03:52:10FromDiscord<exelotl> hmmmm
03:55:06FromDiscord<ElegantBeef> Wait the qualified proc works for me
03:56:05FromDiscord<ElegantBeef> Ah nvm, false positive
04:02:55FromDiscord<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:36FromDiscord<exelotl> hard to maintain, will break go-to-definition, docgen etc.
04:09:10FromDiscord<ElegantBeef> God that's terrible 😄
04:11:13FromDiscord<exelotl> thank you >:)
04:11:30FromDiscord<ElegantBeef> This isnt much better https://media.discordapp.net/attachments/371759389889003532/810000166579863582/unknown.png
04:12:09FromDiscord<ElegantBeef> Whoops didnt scroll all the way up
04:12:17FromDiscord<ElegantBeef> There is an `import mod1` in the last one
04:12:28FromDiscord<exelotl> ah makes sense
04:14:11FromDiscord<exelotl> ah well, I guess I just gotta accept that users will have to deal with granular imports
04:14:54FromDiscord<exelotl> the upside to it is that they won't need extra lines for modules that aren't included by default
04:15:37FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2PeE
04:16:42FromDiscord<exelotl> it will just become `import natu/[core, types, registers, input, bios, irq, tte, maxmod]`
04:16:57FromDiscord<exelotl> 😭
04:18:05FromDiscord<exelotl> types and registers can probably all go into core I guess, since the lib is useless without those
04:18:23FromDiscord<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:10FromDiscord<Rika> inb4 circular dependency after you put types in core
04:51:48*muffindrake quit (Quit: muffindrake)
05:08:14FromDiscord<exelotl> xD
05:43:27FromDiscord<~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:42FromDiscord<~355/113 Man> sent a code paste, see https://paste.rs/0e2
05:43:47FromDiscord<ElegantBeef> using `=` not `:`
05:43:57FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PeS
05:43:58FromDiscord<ElegantBeef> = is for assignment `:` is for tyoe desc
05:43:59FromDiscord<~355/113 Man> oh derp
05:44:01FromDiscord<ElegantBeef> (edit) "tyoe" => "type"
05:44:30FromDiscord<~355/113 Man> man I love this language but it takes a lot to get used to
05:45:50FromDiscord<~355/113 Man> does `seq` have an `addAll(array[N, Foo])`
05:46:56FromDiscord<ElegantBeef> does add not work?
05:47:33FromDiscord<~355/113 Man> wouldn't that try to add the array itself?
05:47:42FromDiscord<ElegantBeef> you want to add all the values right?
05:47:55FromDiscord<~355/113 Man> yea
05:48:05FromDiscord<~355/113 Man> does `&` work from sequtils?
05:48:14FromDiscord<ElegantBeef> I mean
05:48:35FromDiscord<ElegantBeef> !eval var a: seq[int]; a.add([10,2]); echo a
05:48:38NimBot@[10, 2]
05:48:50FromDiscord<~355/113 Man> hmm
05:49:08PrestigeBeef: 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:38Prestigemaybe I just need to make a cuchar and pass addr foo
05:50:08FromDiscord<ElegantBeef> Yea out of my paygrade 😄
05:50:12FromDiscord<ElegantBeef> I cannot even guess
05:50:49PrestigeProbably doesn't help that my knowledge of C is almost nil :P haha
05:51:10FromDiscord<~355/113 Man> i'm pretty good at C if you want help there
05:51:30FromDiscord<~355/113 Man> but i'm still a big noob at nim
05:51:39PrestigeIf you take a look at the struct I linked, I'm trying to replicate it in Nim
05:51:54PrestigeI think my guess was correct though
05:52:30FromDiscord<~355/113 Man> what is type Pcuchar?
05:52:55ForumUpdaterBotNew 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:57Prestigepointer to a unsigned char
05:53:05Prestigeunsigned (c) char
05:53:11FromDiscord<~355/113 Man> not `ptr int8`?
05:53:29Prestigelike ptr uint8 I guess?
05:53:39FromDiscord<~355/113 Man> yea forgot the u
05:54:21Prestigeit looks like I was correct
05:55:32FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PeX
05:58:15PrestigeI had to create `var value: cuchar` then pass in `addr value` to the function
06:00:30FromDiscord<~355/113 Man> that sounds wrong to me
06:01:24FromDiscord<ElegantBeef> That's write afaik
06:01:27FromDiscord<ElegantBeef> (edit) "write" => "right"
06:02:05FromDiscord<~355/113 Man> sigh i'm getting kind of tired of operators not returning objects with addresses
06:02:16FromDiscord<ElegantBeef> Wait is that stack overflow page dead for anyone else?
06:02:39FromDiscord<~355/113 Man> yep
06:02:50FromDiscord<ElegantBeef> Lol deletes a SO page
06:02:54FromDiscord<Rika> In reply to @~355/113 Man "*sigh* i'm getting kind": wdym
06:02:58FromDiscord<ElegantBeef> Yea ^
06:03:59ForumUpdaterBotNew thread by Alexeypetrushin: Why `sortedByIt(it.field)` and not `sortedBy(field)`?, see https://forum.nim-lang.org/t/7500
06:04:05FromDiscord<~355/113 Man> `addr (mat objmats[i])` has no address
06:04:12FromDiscord<~355/113 Man> (not even with unsafeAddr)
06:04:30FromDiscord<~355/113 Man> conversion does the same thing as I found out earlier
06:06:00FromDiscord<Rika> why would it?
06:06:15FromDiscord<Rika> its not assigned to anything yet
06:07:25FromDiscord<~355/113 Man> well it has to live somewhere doesn't it?
06:07:56FromDiscord<ElegantBeef> Well it's temporary unless assigned
06:07:58FromDiscord<Rika> not somewhere you should be using
06:08:25FromDiscord<Rika> its not guaranteed to live after the operation
06:08:28FromDiscord<~355/113 Man> In reply to @ElegantBeef "Well it's temporary unless": and in this case this temporaryness is just long enough
06:08:45FromDiscord<Rika> immediate is long enough?
06:09:15FromDiscord<~355/113 Man> pretty much as far as this scope is concerned
06:09:40FromDiscord<~355/113 Man> unless it can be deleted while inside the next scope it lives long enough
06:09:55FromDiscord<~355/113 Man> the address is imediatly passed into a proc
06:09:55*rockcavera quit (Remote host closed the connection)
06:10:02FromDiscord<~355/113 Man> (edit) "imediatly" => "immediately"
06:10:13FromDiscord<Rika> and is also immediately unusable because the value in the address is gone?
06:10:54FromDiscord<~355/113 Man> it can't even survive into the next scope?
06:11:04FromDiscord<Rika> its not guaranteed to
06:11:06FromDiscord<Rika> is it?
06:11:13FromDiscord<~355/113 Man> I would think so
06:11:14FromDiscord<Rika> it only needs to live until its assigned
06:12:50FromDiscord<ElegantBeef> If it's unassigned it might not even get compiled
06:12:59FromDiscord<Rika> its not just operators btw
06:13:15FromDiscord<Rika> even `addr " ".repeat(20)` wouldnt work
06:14:18FromDiscord<Rika> if you want you can make a template that assigns a temp.var and returns the address of that
06:14:25FromDiscord<~355/113 Man> actually you may be right
06:14:57*waleee-cl quit (Quit: Connection closed for inactivity)
06:15:45FromDiscord<~355/113 Man> yea, idk, something about words keeps making me think things that aren't true
06:16:00FromDiscord<~355/113 Man> like words instead of symbols
06:16:14FromDiscord<~355/113 Man> ex: `not` vs `!`, `addr` vs `&`
06:17:31FromDiscord<Rika> hey its part of getting used to a new language
06:18:09FromDiscord<ElegantBeef> I much prefer the more descriptive versions `&` and `` are scary
06:18:29FromDiscord<~355/113 Man> what is `` in Nim?
06:18:29FromDiscord<Rika> for a type being different to a for a variable is scary
06:18:37FromDiscord<Rika> for which
06:18:40FromDiscord<Rika> type or variable
06:18:44FromDiscord<~355/113 Man> variable
06:18:47FromDiscord<Rika> []
06:18:53FromDiscord<~355/113 Man> oh that's weird
06:19:00FromDiscord<Rika> var a: ptr int↵a[] # int
06:19:22FromDiscord<Rika> would you have rathered .deref 😛
06:19:25FromDiscord<Rika> a.deref
06:19:26FromDiscord<Rika> xddd
06:19:32FromDiscord<~355/113 Man> actually maybe
06:19:33FromDiscord<ElegantBeef> I was talking about C/C++'s ``, `addr` and `char` vs `ptr UncheckedArray[char]`
06:19:37FromDiscord<Rika> ngl it doesnt look as cursed as i though
06:19:41FromDiscord<Rika> t
06:19:42FromDiscord<Rika> thought
06:19:47FromDiscord<ElegantBeef> We have autoderef
06:19:58FromDiscord<Rika> i mean deref as a word instead of []
06:20:04FromDiscord<ElegantBeef> Yea i know
06:20:45FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pf7
06:21:29FromDiscord<Rika> it really looks less weird than i thought it would have been
06:22:20FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pf8
06:22:35FromDiscord<~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pf8" => "https://play.nim-lang.org/#ix=2Pf9"
06:22:43FromDiscord<InventorMatt> it may be better as a template
06:22:49FromDiscord<Rika> yeah lol
06:23:01FromDiscord<~355/113 Man> right, forgot about template
06:23:25FromDiscord<~355/113 Man> template is kind of alike a function macro right?
06:23:28FromDiscord<~355/113 Man> (edit) "alike" => "like"
06:23:45FromDiscord<Rika> its code substitution on compile time
06:24:00FromDiscord<Rika> like a C macro
06:24:10FromDiscord<~355/113 Man> so yea, like a function macro
06:24:39FromDiscord<Rika> oh thats what you mean
06:24:39FromDiscord<~355/113 Man> can templates have no args?
06:24:43FromDiscord<ElegantBeef> Yep
06:24:44FromDiscord<Rika> yes
06:24:49FromDiscord<Rika> fuck you beef wtf how dare you
06:24:54FromDiscord<~355/113 Man> so I guess just like macros in general then
06:24:59FromDiscord<ElegantBeef> Sorry rika, you dont find me funny so fuck you
06:25:01FromDiscord<~355/113 Man> so what are macros in Nim then?
06:25:03FromDiscord<Rika> lmao
06:25:10FromDiscord<Rika> they work on the ast
06:25:17FromDiscord<Rika> much stronger than C macros
06:25:20FromDiscord<~355/113 Man> ast?
06:25:23FromDiscord<Rika> you can create DSLs
06:25:30FromDiscord<Rika> abstract syntax tree or something i forget
06:25:31FromDiscord<ElegantBeef> They're Lisp inspired macros that work directly with the AST as rika said
06:25:32FromDiscord<~355/113 Man> words :blobnotlikethis:
06:25:44FromDiscord<Rika> smh i thought you were good at C
06:25:51FromDiscord<ElegantBeef> So you just directly make the same AST as your written code does
06:26:07FromDiscord<~355/113 Man> what is DSL?
06:26:14FromDiscord<Rika> domain specific language
06:26:23FromDiscord<Rika> something like a custom language
06:26:41FromDiscord<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:44FromDiscord<ElegantBeef> My whored one! https://github.com/beef331/constructor#constructor
06:26:51FromDiscord<Rika> shill.
06:27:18FromDiscord<ElegantBeef> You can also pass static strings and make your own compiler to Nim 😄
06:27:40*mmohammadi9812 joined #nim
06:27:54FromDiscord<Rika> inb4 "compiling nim with the nim vm"
06:28:01FromDiscord<Rika> aka max cursed
06:28:03FromDiscord<~355/113 Man> I actually was helping on a for fun compiler by someone else written in C# right before trying Nim
06:28:45FromDiscord<Rika> yeah what we mean is that you can make nim compile other code with macros without leaving the nim file
06:29:13FromDiscord<~355/113 Man> yea, that's interesting
06:29:37FromDiscord<~355/113 Man> anyways, I got my code working but now my triangles are gone :BlobSadde:
06:30:12FromDiscord<Rika> do you have an inference as to why
06:30:25FromDiscord<~355/113 Man> nope
06:31:37FromDiscord<~355/113 Man> oh wait, I forgot to build the VAOs :Facepalm:
06:32:37FromDiscord<~355/113 Man> still no triangles
06:34:02ForumUpdaterBotNew thread by Tbutton: Echo doesn't work correctly, see https://forum.nim-lang.org/t/7501
06:36:09FromDiscord<Rika> sorry dude ive no damn clue what to do when it comes to graphics so
07:01:44FromDiscord<~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:58FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfp
07:04:06FromDiscord<~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pfp" => "https://play.nim-lang.org/#ix=2Pfq"
07:11:17FromDiscord<Rika> whatever variable you pass as vao is a let and not a var
07:12:12FromDiscord<~355/113 Man> it's from an array that's var
07:12:28FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pft
07:12:51FromDiscord<~355/113 Man> (edit) "https://play.nim-lang.org/#ix=2Pft" => "https://play.nim-lang.org/#ix=2Pfu"
07:13:05FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfv
07:13:34FromDiscord<Yardanico> You need to use mitems
07:13:49FromDiscord<~355/113 Man> do what now?
07:13:49FromDiscord<Yardanico> for i, VAO in VAOs.mitems:
07:14:01FromDiscord<~355/113 Man> mitems for mutable items?
07:14:04FromDiscord<Yardanico> yes
07:14:07FromDiscord<~355/113 Man> ah
07:14:17FromDiscord<~355/113 Man> I tried var VAO
07:15:49FromDiscord<~355/113 Man> ` Error: wrong number of variables`
07:16:04FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pfx
07:16:58FromDiscord<InventorMatt> try mpairs instead of mitems
07:17:38FromDiscord<~355/113 Man> yeeet, it's working
07:18:38FromDiscord<~355/113 Man> .... or not
07:19:13FromDiscord<~355/113 Man> no it's still not working, it's compiling, but still not rendering
07:20:48FromDiscord<~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:38FromDiscord<~355/113 Man> https://paste.myst.rs/lw43zp4x
07:29:27FromDiscord<hamidb80> Can anyone give me a link that can explain usage of "distinct types" ?
07:30:14FromDiscord<~355/113 Man> it just means that there is no implicit conversion between the types I think
07:33:56FromDiscord<Rika> @~355/113 Man you never change vaoID on the copy paste version?
07:34:19FromDiscord<~355/113 Man> no
07:35:02FromDiscord<Rika> and its the same effect when you use VAO.vaoID?
07:35:23*superbia joined #nim
07:35:28FromDiscord<~355/113 Man> i'm trying to test that right now, but getting another compile error
07:35:44FromDiscord<Rika> OH
07:35:56FromDiscord<~355/113 Man> ah, bufferID and elementID didn't get exported
07:36:03FromDiscord<Rika> VertexArrayObject.nim line 18 `unsafeAddr VAO.vertices` -> `unsafeAddr VAO.vertices[0]`
07:36:15FromDiscord<Rika> same for indices
07:37:04FromDiscord<~355/113 Man> oooh, yea
07:38:35FromDiscord<~355/113 Man> yep, that worked
07:39:36FromDiscord<Rika> seqs are laid out differently from arrays
07:39:53FromDiscord<Rika> have to get address of first element rather than of the whole seq
07:40:09FromDiscord<~355/113 Man> yea, I didn't catch that
07:40:17FromDiscord<Rika> theyre equivalent (i'd say coincidentally but its not) for arrays
07:42:13FromDiscord<~355/113 Man> it works, thanks https://media.discordapp.net/attachments/371759389889003532/810053195841404938/NimblePiE_2021-02-13_00-41-33.mp4
07:43:03FromDiscord<Rika> stuttery rotation lol
07:44:46FromDiscord<~355/113 Man> yea, it's an untimed loop
07:44:56FromDiscord<~355/113 Man> so it's just running as fast as it can
07:58:34FromDiscord<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:17ForumUpdaterBotNew 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:13superbiais 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:51FromGitter<Araq> I would like to see a CMS in Nim
10:05:56FromGitter<Araq> btw where does "NIM" come form? A joke on Nim's case insensitivity?
10:07:39FromDiscord<Solitude> 3 letters = abbreviation
10:07:42Oddmongerit's like those guys who write « LUA »
10:08:16FromGitter<offbeat-stuff> How to get ref to a normal object
10:09:00FromDiscord<Recruit_main707> Normal object means stack allocated, ref object is a heap allocated object
10:09:46FromDiscord<Recruit_main707> You can use raw ptr s, in that case, addr myObj or unsafeAddr myObj
10:11:53FromDiscord<Recruit_main707> In reply to @Varriount "Also, processes have more": But multiprocessing is still the fastest option afaik
10:12:03FromGitter<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:15superbiaI mean if you have a better / more fun project I am open for suggestions Araq
10:13:36FromGitter<offbeat-stuff> I am working on a basic cli renderer using vulkan so either recursive dependency or this option
10:14:14FromDiscord<Recruit_main707> I’m not sure you can do either one
10:15:02FromDiscord<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:04Clonkk[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:25nc-xanybody here who uses strictNotNil?
11:19:37*dddddd joined #nim
11:20:46nc-xor knows how it is supposed to work
11:23:15nc-xfor e.g. i expected this to give a warning https://play.nim-lang.org/#ix=2Pgm
11:23:32nc-xdoes it only work with `not nil` or something
11:23:38nc-xor 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:00superbiaClonkk[m]: but is there a more fun or realistic project to learn nim with ?
11:36:45superbiaI 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:10FromDiscord<haxscramper> https://xmonader.github.io/nimdays/
11:58:33FromGitter<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:28superbiainteresting, 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:58Clonkk[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:57Clonkk[m]You'll see how far you go
12:30:09*asdflkj_2 joined #nim
12:30:11*rockcavera joined #nim
12:38:45FromGitter<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:27superbiathank 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:48leorize[m]@x.benjamin:matrix.org you should join the main IRC room instead of gitter
13:28:05leorize[m]+nim:asra.gr contains all rooms within the community
13:33:18*gollark[m]1 joined #nim
13:34:10liblq-devi 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:25FromDiscord<Rika> It’s much easier to join the gitter room accidentally I believe
13:37:56FromGitter<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:22leorize[m]lqdev: the gitter room has more people than the irc room, so it ranks higher in element
13:39:38liblq-devah well, that makes a whole lot more sense now
13:40:04liblq-dev@x.benjamin:matrix.org try joining #freenode_#nim:matrix.org
13:40:50liblq-devthe 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:49Benjamin[m]2Looks like this room isn't searchable
13:42:03liblq-devthat's possible
13:42:14Benjamin[m]2Or rather, it isn't discoverable through Elements
13:42:23liblq-devyou can find it if you go to the Freenode group in the room explorer but yeah
13:42:26liblq-devit's quite obscure
13:42:46liblq-devit appears as though they fixed the gitter bridge situation up a bit because now the message doesn't look like
13:42:48liblq-dev<FromGitter> <matrix-bot> `your-name` the message goes here
13:43:24leorize[m]yea, gitter is now a matrix server
13:43:48leorize[m]well, sort of. If it worked better and Matrix users can be admin, I would bridge directly from there
13:51:38FromGitter<krux02> gitter is also an IRC server
13:51:51krux02I can use my IRC client for gitter
13:53:02liblq-devthat's how matrix works.™
13:53:18liblq-devor, so i think. that it's matrix doing these bridging shenanigans.
13:57:06leorize[m]nah, gitter has an official irc interface
13:57:28leorize[m]but it's incomplete and many things are not mapped to irc
14:00:17Benjamin[m]2So everyone with the "freenode_" prefix is using an IRC client? Can I still DM them and vice versa?
14:01:48leorize[m]yes, you can
14:06:38*Gustavo6046 quit (Ping timeout: 264 seconds)
14:06:53Benjamin[m]2Great, this room is much better than the old one :)
14:07:41leorize[m]yep, and only the irc rooms has portals to other subsets of the community
14:07:59leorize[m]+nim:asra.gr has a list of those rooms
14:08:38liblq-devi love how half the rooms in +nim:asra.gr are Unnamed Room.
14:08:46Benjamin[m]2"Not implemented yet in Element: Open group detail"
14:09:15Benjamin[m]2I've actually been a member of the freenode Nim science room for a while
14:10:09leorize[m]lqdev: oh really? I guess communities are too buggy :(
14:10:33liblq-devwe 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:40liblq-devthis is how the community looks.
14:10:56leorize[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:35FromGitter<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:27haxscramperI don't think we have built-in facility to do that, so AST (typed) traversal is probably the best solution
14:39:05FromGitter<deech> Do you know if the compiler itself does it?
14:39:21haxscramperRecursive call detection? No, it doesn't
14:39:43haxscramperI haven't *specifically* dug into this part though, but from what I saw I doubt there is such analysis going on
14:39:58leorize[m]Nim doesn't to tail call optimization atm
14:40:54*NimBot joined #nim
14:41:36leorize[m]typed ast is the only way atm
14:42:03*cero joined #nim
14:42:25haxscramperdeech: 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:45FromGitter<deech> Nice, thanks!
14:42:55*cero quit (Client Quit)
14:43:16*dddddd joined #nim
14:45:31krux02leorize[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:07haxscramperCopying 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:22haxscramperAnd then maybe override some of the callbacks with new values
14:54:09haxscramperIIRC closure is a pointer to function + pointer to environment: will environment be duplicated in this case?
14:54:10krux02haxscramper, a callback is either just a pointer, or a pointer and an environment pointer
14:54:21krux02so not more overhad than 16 bytes max
14:54:25krux02per stored callback
14:54:40haxscramperAnd environment is not duplicated?
14:56:06krux02Honestly I don't know right now, but I guess the environment is instantiated for every time you generate the callback
14:56:49krux02but when you use functions from global scope and not lambda expressions, there is no environment to duplicate and therefore no overhead.
14:58:32krux02except of coures the unused environment pointer
15:00:17*lritter joined #nim
15:01:37*asdflkj_2 joined #nim
15:06:48FromDiscord<konsumlamm> @haxscramper you should replace `any` with `auto`, since the former is deprecated now
15:06:56FromDiscord<konsumlamm> (in your pattern matching PR)
15:07:41haxscramperWhich part specifically you are talking abuout?
15:08:01haxscramperCustom unpackers?
15:08:58FromDiscord<konsumlamm> the type `any`
15:12:20FromDiscord<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:37FromDiscord<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:53FromDiscord<gollark> My code is here if you need context of some sort: https://media.discordapp.net/attachments/371759389889003532/810166612194885652/md.nim
15:18:03FromDiscord<whisperdev> Nim is becoming popular https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/
15:19:53haxscrampergollark: 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:02haxscramperBut I suppose it should work
15:20:12FromDiscord<gollark> So define an `object` wrapper for it and do that? I see.
15:20:21haxscramperNo, no need to define wrapper
15:20:35haxscramperI think `destroy=` worked for importc'd objects too
15:20:57FromDiscord<gollark> I think the importc-ing code defines them as `ptr`s of some sort.
15:20:59FromDiscord<Recruit_main707> @whisperdev how have they overcome this tho: https://media.discordapp.net/attachments/371759389889003532/810168649561538632/unknown.png
15:21:24haxscrampergollark: no it doesn't use `ptr`, just regular value object
15:21:46Yardanico@whisperdev this article was already shared, but yes :)
15:22:03FromDiscord<gollark> sent a code paste, see https://play.nim-lang.org/#ix=2PhN
15:22:04FromDiscord<gollark> (sorry if this looks bad on IRC)
15:22:08Yardanicoit won't
15:22:17Yardanicoit gets pasted to nim playground
15:22:23Yardanico@Recruit_main707 no one forbids you from 1) using --noMain and a custom main 2) modifying the C code after compilation
15:22:50FromDiscord<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:18haxscramperhttps://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:43haxscrampers/for does not/for some reason it does not/g
15:33:01leorize[m]it's simple, the hook is called `=destroy` :)
15:33:06YardanicoXD
15:33:52leorize[m]https://play.nim-lang.org/#ix=2PhT
15:34:32haxscramperAlright, at least it looks like I know *something*
15:34:32FromDiscord<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:45haxscramperTyping things correctly does is not included in this list though
15:35:53leorize[m]@gollark the library you're using don't have a gc?
15:36:25FromDiscord<gollark> I don't see why it would, it's a markdown parser.
15:36:54leorize[m]at least a reference counter?
15:37:01FromDiscord<gollark> I don't think so?
15:37:03*abm joined #nim
15:37:08FromDiscord<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:38leorize[m]if your wrapping object is a ref type
15:37:48leorize[m]but how are you gonna know what is safe to be unref?
15:37:54leorize[m]I thought you wanna get rid of your defers?
15:39:56leorize[m]cmark api looks like it keeps track of all children for you
15:41:32FromDiscord<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:47leorize[m]sounds like a big pita for a simple wrapper with destructors
15:43:39FromDiscord<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:07FromDiscord<gollark> And the function returned or something.
15:44:15FromDiscord<gollark> The Nim GC presumably doesn't know what references are present within cmark's structures.
15:45:38leorize[m]I'm afraid this problem is a bit too hard to model correctly via destructors
15:47:34FromDiscord<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:11haxscramperYou are working on cmark's AST structure, correct?
15:50:21haxscramperMaybe 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:14FromDiscord<gollark> Maybe. I think that would be pretty much like the callback approach but with a slightly different interface, though.
15:55:18leorize[m]you might be able to model the problem in an another way
15:56:13leorize[m]use two types for this: `Node` and `LentNode`
15:56:29leorize[m]the only difference is that `LentNode` have a no-op destructor
15:56:58leorize[m]so first, make copying `Node` an error
15:57:46FromDiscord<gollark> How do you do that?
15:58:19leorize[m]https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks-eqcopy-hook
15:59:04leorize[m]now you would want any traversal operations on `Node` to yield `LentNode`, since the memory is managed by the parent `Node`
16:00:05leorize[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:15leorize[m]that's how I would try to model this :P
16:01:33FromDiscord<gollark> Seems reasonable, I could try that.
16:04:12leorize[m]your wrapper should probably map the Nim allocator to cmark
16:06:33FromDiscord<gollark> What's the benefit of that?
16:06:55FromDiscord<gollark> Is it something where it'll probably cause horrible memory bugs if I don't?
16:08:05leorize[m]it would enable memory reuse for the most part
16:08:15leorize[m]there are no ill effects otherwise
16:11:29*mmohammadi9812 joined #nim
16:30:32PMunchHmm, is there a mod in Nim that does negative numbers?
16:30:57FromDiscord<Rika> that what?
16:31:02FromDiscord<Rika> OH
16:31:10FromDiscord<Rika> you mean modulo
16:31:16PMunchYes
16:31:20FromDiscord<Rika> idiot here thought moderator
16:31:28PMunchHaha :P
16:31:44PMunchI want -1 mod 12 == 11
16:31:46FromDiscord<Yardanico> i do negative numbers
16:32:08FromDiscord<Yardanico> @PMunch i think there should be something like that
16:32:08PMunchI mean I also do negative numbers, but I'm only an IRC mod
16:32:19PMunchYeah I seem to remember there is
16:33:48PMunchAh math.floorMod
16:33:58PMunch!eval import math; echo floorMod(-1, 12)
16:34:01NimBot11
17:06:32FromDiscord<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:01FromDiscord<exelotl> is that true? What else could I use instead of `lent`?
17:10:54planetis[m]well plain object with the .byref pragma
17:11:19planetis[m]also lent can't be used in parameters
17:11:27planetis[m]only return
17:11:52leorize[m]or just use a pointer :p
17:12:31planetis[m]yeah most probably a pointer
17:13:04leorize[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:57FromDiscord<exelotl> yeahhh I guess overload with unsafeAddr is the way to go
17:16:02FromDiscord<exelotl> I tried this: https://play.nim-lang.org/#ix=2PiL
17:16:17*oprypin joined #nim
17:16:27FromDiscord<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:11leorize[m]`type A = B` is an alias
17:18:57leorize[m]control pragmas have no effect on those
17:32:42FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2PiS
17:32:43FromDiscord<exelotl> because that's kind of a big deal for me :(
17:38:13FromDiscord<Rika> remove the size and check the sizeof(set[Foo])
17:38:33FromDiscord<Rika> !eval type Foo = enum a, b, c; echo sizeof set[Foo]
17:38:34NimBotCompile failed: /usercode/in.nim(1, 24) Error: identifier expected, but got ';'
17:38:40FromDiscord<Rika> really
17:38:46FromDiscord<Rika> cant do it w/o a new line ig
17:41:59FromDiscord<Recruit_main707> !eval type Foo = enum a, b, c↵echo sizeof set[Foo]
17:42:01NimBotCompile 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:56FromDiscord<gollark> Thanks leorize, I seem to have stuff basically working now.
17:43:13FromDiscord<gollark> I was worried about performance but it seems basically fine.
17:44:25leorize[m]that's nice :)
17:45:25FromDiscord<saturnoZmarte> hello
17:45:47leorize[m]hi
17:49:17*wasted_youth2 joined #nim
18:03:18*PMunch quit (Remote host closed the connection)
18:03:41FromDiscord<exelotl> oh sizeof does work for set aliases: https://play.nim-lang.org/#ix=2Pj3
18:03:54FromDiscord<exelotl> (edit) "sizeof" => "{.size:n.}"
18:04:13FromDiscord<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:41krux02@exelotl: for what do you need to specify the size of a set?
18:16:37krux02ah, 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:34FromDiscord<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:52FromDiscord<gollark> How come the standard library's `re` doesn't have anything like `findAll` but returning the positions of each match?
18:24:53haxscramper> interop with existing C code
18:24:53haxscramperYou want to pass nim set to a function expecting bitmasked enum?
18:24:57FromDiscord<gollark> (unless it does and I haven't noticed)
18:26:56haxscramperexelotl: 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:40FromDiscord<KSun> sent a long message, see http://ix.io/2Pjf
18:41:27FromDiscord<Rika> objects are structs
18:42:32FromDiscord<exelotl> yep, and Nim has pragmas that can be used to make packed structs, bitfield structs, structs with certain alignment, etc.
18:42:50FromDiscord<KSun> That's certainly interesting
18:49:22FromDiscord<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:15FromDiscord<treeform> Algorithmic improvements "Big-O" have the biggest payoffs.
18:51:18FromDiscord<treeform> Nim's seqs and objects are basically c structs and arrays so they are usually just as fast.
18:54:51FromDiscord<treeform> https://forum.nim-lang.org/t/5363
18:55:53*PMunch joined #nim
18:57:05*fredrikhr joined #nim
19:01:19ForumUpdaterBotNew question by Anthony: Is there amy way you can import local proc&#39;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:27FromDiscord<Yardanico> @KSun Nim objects compile into C structs
19:01:50FromDiscord<Yardanico> ah, nvm
19:01:53FromDiscord<Yardanico> i'm late
19:05:11FromDiscord<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:49FromDiscord<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:44FromDiscord<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:51FromGitter<deech> Dumb question: how do I print the address of a `pointer`?
19:17:15FromDiscord<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:29FromDiscord<dom96> In reply to @deech "Dumb question: how do": `repr` should work, or cast it to an int and use toHex()
19:18:05saemI was going to say try the cast based on this thread: https://forum.nim-lang.org/t/3806
19:18:40FromDiscord<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:51FromDiscord<Yardanico> nonono, maybe you misunderstood me
19:18:52FromGitter<deech> dom96, thanks! I keep forgetting about `repr`, I tried `addr` and `unsafeAddr`.
19:19:03FromDiscord<Yardanico> I mean that you can use Nim as a "syntax skin" for C, but there's no reason to
19:19:10FromDiscord<treeform> yeah
19:19:32FromDiscord<treeform> only in minor critical sections it can get wired
19:20:00FromDiscord<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:18FromDiscord<treeform> its basically assembly
19:20:46FromDiscord<haxscramper> In reply to @KSun "<@!107140179025735680> If you have": sent a long message, see http://ix.io/2PjA
19:20:47FromDiscord<treeform> Its not really C or Nim code its just SIMD-assembly code.
19:21:13FromDiscord<haxscramper> Though idiomatic nim does not need this most of the time
19:21:23FromDiscord<Yardanico> yay, a cursor inference bug
19:21:27FromDiscord<Yardanico> with arc
19:22:26FromDiscord<Recruit_main707> @Yardanico may you tell the stackoverflow guy that you export the function with the `` symbol? i cant comment bc rep :(
19:22:50FromDiscord<Yardanico> dione
19:22:51FromDiscord<Yardanico> (edit) "dione" => "done"
19:22:52saemIs 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:53FromDiscord<Recruit_main707> ty
19:23:24FromDiscord<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:32ForumUpdaterBotNew thread by Mantielero: Importing a file in runtime, see https://forum.nim-lang.org/t/7503
19:40:45FromDiscord<Yardanico> eh
19:43:33*xace quit (Ping timeout: 260 seconds)
19:44:07FromDiscord<Recruit_main707> 🥴
19:44:34FromDiscord<Yardanico> 🥴
19:44:49FromDiscord<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:45FromDiscord<Clyybber> yay for arc bugs!
19:51:54*mmohammadi9812 joined #nim
19:52:19FromDiscord<Recruit_main707> orc too?
19:52:28FromDiscord<Yardanico> @Recruit_main707 it's a bug with cursor inference
19:52:29FromDiscord<Yardanico> so yes
19:52:50FromDiscord<Yardanico> -d:useMalloc for "best" results
19:52:53FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2PjR
19:53:04FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/810237122359066644/unknown.png
19:56:21FromDiscord<Yardanico> the bug's pretty obvious from the expandArc https://media.discordapp.net/attachments/371759389889003532/810237946723958824/unknown.png
19:56:51FromDiscord<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:16PMunchHmm, do I need to do `buttonLeft = btnp(pcLeft)` in `gameUpdate`?
20:05:25PMunchWhoops, wrong channel
20:18:04FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/17033 posted
20:33:12FromDiscord<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:31FromDiscord<~355/113 Man> can I create an object and initialize it at the same time from like an array?
20:51:23FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pk9
21:00:50*Kaivo joined #nim
21:13:44FromDiscord<exelotl> you can't omit the names of the fields though
21:13:44FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Pkl
21:14:06FromDiscord<~355/113 Man> also i'm trying to define a conversion between array[16, float32] and Matrix4f, but it says redefining Matrix4f
21:14:47FromDiscord<Solitude> are you making Matrix4f proc for that?
21:14:56FromDiscord<~355/113 Man> func
21:15:06FromDiscord<Solitude> doesnt matter
21:15:09FromDiscord<Solitude> cant do that
21:15:15FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pkm
21:15:27liblq-devcall it with a lowercase letter
21:15:31liblq-devto distinguish it from the type
21:15:38FromDiscord<~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:30FromDiscord<~355/113 Man> I thought you could define your own conversions though
21:17:49FromDiscord<Solitude> nope
21:17:52liblq-devwell, that was an incorrect assumption
21:18:09FromDiscord<~355/113 Man> I swear I remembered reading that somewhere
21:18:28liblq-devyou can declare your own implicit conversions, but not explicit ones
21:18:46liblq-devrather, you can't name explicit conversions the same as your type
21:18:52FromDiscord<~355/113 Man> oh, well then how do I do that?
21:19:13liblq-devhttps://nim-lang.org/docs/manual.html#converters
21:19:24FromDiscord<Solitude> or you could do `func to(array: array[16, float32], t: typedesc[Matrix4f]): Matrix4f` and `arrayStuff.to(Matrix4f)`
21:19:49liblq-devobligatory "using converters is not a very wise idea if your code is part of some library" statement
21:19:57FromDiscord<dk> tldr; converter names don't matter, just the types
21:21:25FromDiscord<exelotl> Yeah converters are best avoided unless you're trying to achieve some very unconventional semantics
21:21:46FromDiscord<exelotl> for example you can use converters to implement golang style interfaces
21:22:14FromDiscord<~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:33FromDiscord<~355/113 Man> I suppose I could do a toOpenGL array
21:22:43FromDiscord<~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:08FromDiscord<gollark> What would the least terrible way to get the (English) sentence surrounding a position in a string?
21:34:30FromDiscord<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:46FromDiscord<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:55FromDiscord<exelotl> (edit) "backward" => "backwards"
21:37:19FromDiscord<exelotl> it's probably more involved than that though lol
21:38:04FromDiscord<exelotl> like what if someone puts an email or domain in the sentence? What about ellipses?
21:40:42FromDiscord<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:22FromDiscord<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:12FromDiscord<gollark> Especially since I just realized another really bad one, "i.e." and such.
21:44:50FromDiscord<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:42FromDiscord<~355/113 Man> does division by ints return a float?
22:06:28liblq-devyes
22:07:01FromDiscord<~355/113 Man> hmmm strange
22:10:22liblq-devwell it makes sense
22:10:32liblq-devyou'd expect 1 / 2 to result in 0.5
22:10:43FromDiscord<~355/113 Man> I'd expect 1 / 2 to result in 0
22:10:50liblq-devon what basis?
22:10:56liblq-devmathematically that's incorrect
22:10:59liblq-devif you want integer division, use 1 div 2
22:11:04FromDiscord<~355/113 Man> on the basis on every other language
22:11:10FromDiscord<~355/113 Man> (that I know)
22:11:28liblq-devjust because "every other language" does it, doesn't mean that it's the best way to go about it :)
22:11:47FromDiscord<~355/113 Man> no, but standards are nice
22:12:19liblq-devwell there isn't any standard saying "the / operator used on integers should always return an integer"
22:12:28liblq-devso we may as well do the more mathematically correct thing
22:12:30FromDiscord<~355/113 Man> no written standard
22:13:02liblq-devand we have an alternate operator for integer division, in the cases where it is actually necessary
22:14:22FromDiscord<konsumlamm> python also returns a float there fwiw
22:17:03FromDiscord<Hi02Hi> @~355/113 Man ah so the ~3 man↵im playing
22:18:41FromDiscord<~355/113 Man> well in the context of code, yes
22:20:09FromDiscord<Hi02Hi> imagine how much code would change if pi was exactly 3
22:20:34*Jesin quit (Quit: Leaving)
22:22:23FromDiscord<gollark> What would geometry look like then?
22:22:41FromDiscord<~355/113 Man> at PI == 3? idk, but I do know at PI == 4
22:23:06*Jesin joined #nim
22:23:38FromDiscord<~355/113 Man> I wonder if you could get PI == 3 for triangles
22:25:04Prestigereminds me of https://xkcd.com/221/
22:27:11FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkP
22:31:07FromDiscord<~355/113 Man> btw is there an IDE for Nim?
22:32:20FromDiscord<ElegantBeef> Vscode is the most used editor, (n)vim is the second most used
22:32:37FromDiscord<ElegantBeef> Jetbrains does have a Nim extension
22:32:49FromDiscord<ElegantBeef> Though it's fairly early and lacking a bit the last i checked
22:32:53krux02there is also emacs.
22:33:12FromDiscord<~355/113 Man> so no (true)IDEs yet
22:33:18krux02but emacs mostly has syntax highlighting and *compile* integration
22:33:30FromDiscord<~355/113 Man> (other than maybe the Jetbrains)
22:33:38krux02whatever you mean by "true IDE"
22:33:44FromDiscord<~355/113 Man> i'm using Notepad++ at the moment
22:34:06FromDiscord<~355/113 Man> In reply to @krux02 "whatever you mean by": an actual IDE rather than just a really good text editor
22:34:06Prestigewhat about uh
22:34:17Prestigeanything other than notepad++
22:34:18krux02IDE literally "integrated development environment" and emacs is pretty much just that, a development environment that integrates almost everything.
22:35:05FromDiscord<~355/113 Man> In reply to @Prestige "anything other than notepad++": that's why i'm asking
22:35:25FromDiscord<ElegantBeef> Use vscode, sublime, nvim, or anything that's actually good
22:35:27Prestigevscode and neovim
22:35:45FromDiscord<~355/113 Man> i'll look into VSC
22:35:50krux02I am pretty happy with emacs right now.
22:36:00FromDiscord<~355/113 Man> I don't know anything about emacs
22:36:44krux02well, it is a lisp machine.
22:36:51krux02that also has a text editor
22:37:03krux02a virtual lisp machine
22:37:08FromDiscord<~355/113 Man> idk what that is
22:37:54krux02an environment that allows you to execute lisp code and modify everything at runtime with lisp
22:38:22krux02or better said a very programmable environment.
22:40:51krux02but 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:12Clonkk[m](Neo)Vim is easy enough to learn i feel
22:47:21FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkX
22:47:46FromDiscord<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:21FromDiscord<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:38FromDiscord<arne> what is the errer?
22:48:43FromDiscord<arne> (edit) "errer?" => "error?"
22:49:30FromDiscord<~355/113 Man> type mismatch with `/`
22:49:42FromDiscord<~355/113 Man> float64 and int64
22:49:49FromDiscord<arne> yea you need to have the same type on both sides.
22:50:04FromDiscord<arne> so either provide an integer on both sides or ar float64 on both sides
22:50:26FromDiscord<~355/113 Man> also I'm kind of surprised this needs a cast↵`sleep(inMilliseconds(duration).int)`
22:50:42FromDiscord<arne> I think the operator that divites integers and implicitly converts them to a float64 should not be used.
22:51:14FromDiscord<arne> and yes, I am also surprised that int is not just an alias to int64
22:51:27FromDiscord<arne> I complained about it. I tried to fix it in the past.
22:51:45FromDiscord<arne> but there is someone who thinks it is just a waste of time to try to fix it.
22:51:56FromDiscord<~355/113 Man> also does `inTimelength` round or truncate?
22:52:16FromDiscord<arne> I don't know that procedure, so I don't know
22:52:52FromDiscord<arne> usually I would recommend you to use such a high precision that it doesn't matter if it truncates or rounds.
22:53:17FromDiscord<~355/113 Man> that would actually be worse
22:53:19FromDiscord<~355/113 Man> ish
22:53:35FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2PkY
22:54:34FromDiscord<~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:20FromDiscord<arne> @~355/113 Man when you work in time ranges, you should check for both for upper and lower bounds.
23:25:28FromDiscord<arne> Nim supports slices
23:26:00FromDiscord<arne> check time in 1.5 .. 2.5
23:26:08FromDiscord<~355/113 Man> oh interesting
23:26:45saemAny reason to not differentiate between a case expression vs case statement as is done in if expression vs if statement?
23:27:41saemOh, maybe I'm failing at searching
23:28:55FromDiscord<Hi02Hi> wdym?
23:30:57FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2Pl7
23:31:17saemThere 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:36saemfor 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)