<< 08-09-2022 >>

00:15:02*wallabra quit (Ping timeout: 255 seconds)
00:15:44*wallabra joined #nim
00:20:30*jmdaemon quit (Ping timeout: 244 seconds)
00:29:59FromDiscord<Yardanico> gonna patch nimeventer a bit so it ignores pinned forum threads, because with the way it currently works it always sees the pinned thread on top, Ideally later I should just change it to store all posts/threads that were posted in a small sqlite db, so it doesn't care about pinned vs non-pinned, but it'll do for now (although it won't send events for pinned threads for now)
00:32:21*NimEventer quit (Remote host closed the connection)
00:32:34*NimEventer joined #nim
00:38:07FromDiscord<halc> So, I reinstalled windows (but kept my files and program data) and now all the VSCode good stuff for nim like go to definition or hovering over to get the signature of a proc won't work
00:38:19FromDiscord<halc> I tried reinstalling the nim extension but no cigar
00:38:19FromDiscord<Yardanico> you need to add the nim bin dir to PATH
00:38:31FromDiscord<halc> In reply to @Yardanico "you need to add": oh, let me see
00:38:33FromDiscord<Yardanico> how did you install nim in the past? choosenim or downloaded the archive?
00:38:43FromDiscord<halc> just checked
00:38:50FromDiscord<halc> it's already in the path
00:39:01FromDiscord<Yardanico> so what happens if you execute `nimsuggest` in cmd?
00:39:07FromDiscord<halc> In reply to @Yardanico "how did you install": choosenim, but I already made sure before to add it back to my PATH
00:39:22FromDiscord<halc> In reply to @Yardanico "so what happens if": nothing
00:39:30FromDiscord<Yardanico> well, I mean is there an error or what?
00:39:37FromDiscord<Yardanico> it should show up the help
00:39:52FromDiscord<halc> hold on
00:40:44FromDiscord<halc> ok, in powershell nothing happens, like actually nothing, no error, but in cmd I'm getting some missing dll stuff
00:41:04FromDiscord<Yardanico> what dll?
00:41:08FromDiscord<halc> libwinpthread-1.dll
00:41:28FromDiscord<Yardanico> aha, it's the mingw one
00:41:35FromDiscord<Yardanico> you need to add the C compiler to PATH as well
00:42:06FromDiscord<halc> In reply to @Yardanico "you need to add": I did, but I must've missing some dirs
00:42:19FromDiscord<halc> (edit) "missing" => "missed"
00:42:55FromDiscord<halc> wait
00:44:00FromDiscord<halc> oh nevermind
00:44:07FromDiscord<halc> no I didn't add that
00:44:24FromDiscord<halc> thank you very much sir
00:44:55FromDiscord<Yardanico> also, if you want to distribute your windows binaries to other people it might be a good idea to use https://jmeubank.github.io/tdm-gcc/ instead as it statically links winpthread (although for other DLLs you'll still need to ship them)
00:45:10FromDiscord<Yardanico> but winpthreads is only needed with, well, threads enabled
00:48:24FromDiscord<halc> interesting, I'll bookmark that
00:49:13FromDiscord<Yardanico> or alternatively you can install visual studio build tools (you don't need the full VS, just the build tools), and use msvc as your C compiler to not get "weird" dependencies like winpthreads
00:49:46FromDiscord<halc> huh, didn't know you could compile with msvc
00:50:11FromDiscord<Yardanico> Nim compiles to C so generally you can use most C compilers out there, and of course MSVC is supported since it's the "main" native C compiler for Windows
00:58:59*jmdaemon joined #nim
01:14:38FromDiscord<sOkam!> In reply to @Elegantbeef "it's pretty much the": "pretty much the same" is a bit too simple for what i was expecting as simple example code or noob-beginner explanation
01:15:53FromDiscord<Elegantbeef> It's identical to C or any other language though, you use the `alloc` or `create` routines instead of `malloc` then you use `dealloc` instead of free
01:16:27FromDiscord<sOkam!> i understand it must be similar, i was asking if you know of any simple example or someone who has tried for fun and wrote some small thing on how to do it↵I have found those "dumb" code articles are always the most useful articles to read for any new coding topic, in my experience so far 🤷‍♂️
01:16:42FromDiscord<Elegantbeef> Instead of `&` you do `addr`, dereferencing is `[]`, pointer arithmetic is generally done using `ptr UncheckedArray[T]` instead of `ptr + int`
01:17:23FromDiscord<Elegantbeef> I'd say just look at C or similar examples and port it to Nim, but yea
01:17:59FromDiscord<sOkam!> how does the dereferencing look like in code?
01:18:11FromDiscord<sOkam!> before, after, separated, joined, etc
01:18:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49UT
01:18:41FromDiscord<Patitotective> !eval var a = 10; echo a.addr[]
01:18:46NimBot10
01:18:51FromDiscord<Elegantbeef> What do you mean before, after, separated, joined ?
01:19:12FromDiscord<sOkam!> k, so kinda like saying `the contents of the box at addr`. nim actually intuitive, never lets me down there ✍️
01:19:46FromDiscord<Elegantbeef> pointer types are `ptr T` instead of `` and pointers to arrays as i mentioned are `ptr UncheckedArray[T]` instead of `T`
01:20:00FromDiscord<Elegantbeef> and void pointers are `pointer` instead of `void`
01:20:05FromDiscord<sOkam!> In reply to @Elegantbeef "What do you mean": as in where it goes in the syntax. but you already explained with the exampl
01:20:17FromDiscord<Elegantbeef> Ah ok
01:20:31FromDiscord<Elegantbeef> Nim's actually so much better to do low level stuff than C 😄
01:20:43FromDiscord<sOkam!> i can imagine
01:20:50FromDiscord<Patitotective> In reply to @Elegantbeef "pointer types are `ptr": damn i hate C↵those `**` are hell
01:21:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49UU
01:21:19FromDiscord<sOkam!> In reply to @Patitotective "damn i hate C": yeah. learning that part of the language myself, and its being a "journey" for sure 😔
01:21:25FromDiscord<Elegantbeef> I think create is objectively better than malloc 😄
01:23:15FromDiscord<Elegantbeef> Anyway i'd suggest if you want to get comfortable with pointers in Nim make primitive types in it using unsafe methods
01:23:28FromDiscord<Elegantbeef> Strings, sequences, linked lists
01:23:43FromDiscord<sOkam!> wdym by unsafe methods?
01:23:54FromDiscord<Elegantbeef> Nim considers manual memory management unsafe
01:26:01FromDiscord<sOkam!> right, but how do i know when something is unsafe or when its not
01:26:20FromDiscord<sOkam!> is there like a list of unsafe things somewhere?
01:26:24FromDiscord<Elegantbeef> Anything that uses pointers or cast is generally unsafe
01:26:43FromDiscord<Elegantbeef> The list is literally `cast, ptr, pointer, addr, unsafeaddr`
01:26:47FromDiscord<Elegantbeef> I might be missing one
01:27:01FromDiscord<Yardanico> well, alloc/dealloc too I guess?
01:27:01FromDiscord<Patitotective> why is `end` a keyword?
01:27:11FromDiscord<Yardanico> In reply to @Patitotective "why is `end` a": because there once was an idea to have the begin/end syntax skin
01:27:18FromDiscord<Yardanico> like the braces skin but using begin/end instead
01:27:25FromDiscord<Yardanico> ah yeah, also it's used for SCF
01:27:29FromDiscord<Yardanico> always forget
01:27:44FromDiscord<Yardanico> https://nim-lang.org/docs/filters.html
01:27:55FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=49UV
01:28:06FromDiscord<Yardanico> I'm not 100% sure if that `end` keyword is applied here, but maybe
01:28:16FromDiscord<Patitotective> 🤔
01:29:12FromDiscord<sOkam!> how can i find all of the memory manament related procedures?
01:29:51FromDiscord<sOkam!> is there anything else, other than alloc/dealloc?
01:29:54FromDiscord<Yardanico> `alloc`, `dealloc`, `create`, `resize`
01:30:00FromDiscord<sOkam!> k
01:30:07FromDiscord<Yardanico> alloc/dealloc/createShared
01:30:10FromDiscord<Yardanico> (all 3 shared ones)
01:30:22FromDiscord<Yardanico> ah, also freeShared
01:30:41FromDiscord<Yardanico> generally you can just search for all system procs that have `ptr` in arguments or return types
01:31:06FromDiscord<sOkam!> kk
01:32:10*arkurious quit (Quit: Leaving)
01:45:27FromDiscord<sOkam!> In reply to @Elegantbeef "Anyway i'd suggest if": what would these be built from? what are the most basic non-gc types?
01:47:31FromDiscord<Yardanico> just from numbers and pointers?
01:47:38FromDiscord<Yardanico> you can then easily make your own container, your own string, etc
01:47:39FromDiscord<Rika> In reply to @Elegantbeef "pointer types are `ptr": It was already mentioned here
01:49:46FromDiscord<sOkam!> oh, so you alloc a number, move ptr to sizeof(number), alloc another, and so on?
01:50:22FromDiscord<Rika> No, when you make sequences you allocate the whole capacity at once
01:50:49FromDiscord<Rika> If you need to expand you allocate current+expansion capacity and you copy the old data to the new
01:51:20FromDiscord<Rika> Ideally you use the mentioned array type above to avoid pointer arithmetic
01:54:08FromDiscord<sOkam!> see? this is why i was asking for some simple example code that does the basic things
01:54:49FromDiscord<sOkam!> (edit) "see? this is why i was asking for some simple example code ... thatthings," added "or article" | "or articlethat does the basic ... things" added "things, to just get a basic grasp on the dumbest"
01:55:00FromDiscord<Patitotective> and they said that you could just translate c code that manages memory manually as you want
01:55:13FromDiscord<Rika> I can’t give code right now because I’m on mobile
01:55:31FromDiscord<Rika> In reply to @Patitotective "and they said that": But how to translate correctly is another thing
01:55:52FromDiscord<Rika> Maybe you can go read the Nim memory article
01:56:17FromDiscord<sOkam!> In reply to @Patitotective "and they said that": meaning, passing some C code through c2nim? would that give a good overview on how? 🤔
01:56:54FromDiscord<Patitotective> what i mean is that you don't need a nim example exactly but you can read about the concept themselves (or their implementation on another language) to implement them in nim↵sure, nim code would the best but this low-level stuff shouldnt be so different from c or so
01:59:34FromDiscord<sOkam!> In reply to @Patitotective "what i mean is": problem is that this topic is above my skill level. so its not easy to extrapolate on how to do things, specially since nim is gc mainly so these procs are not specially easy to find... as in "go to X module, and they are all there in a separate box with some explanations" like it happens in other modules
01:59:37FromDiscord<Elegantbeef> No meaning rewrite C code in Nim↵(@sOkam!)
02:00:17FromDiscord<sOkam!> (edit) "X" => "std/manualmem"
02:02:59FromDiscord<sOkam!> are the `allocShared` procs equivalent to their `alloc` counterparts, other than for threading stuff?
02:10:14*nyeaa4 quit (Quit: Ping timeout (120 seconds))
02:10:34*nyeaa4 joined #nim
02:13:40FromDiscord<sOkam!> How do you create a struct type with manual memory management? Are object types gc'ed?
02:16:20FromDiscord<Elegantbeef> `alloc(sizeof(MyType))` or `create(MyType)`
02:16:23FromDiscord<Elegantbeef> No `object` is not gc'd
02:16:33FromDiscord<Elegantbeef> Only seq, string, and `ref T` is Gc'd
02:25:22FromDiscord<Yardanico> https://www.youtube.com/watch?v=mNBhZ5VQ2y4 someone might want to make this for Nim
02:25:38FromDiscord<Yardanico> quite a good video, especially for ones who like videos over articles :)
02:30:07FromDiscord<Prestige> I've seen this in my recommended but assumed it was going to be some rust circle jerk
02:30:31FromDiscord<Tuatarian> rust/nim circlejerks are some of the worst I've seen
02:30:41FromDiscord<Tuatarian> the rust one has moderated itself to a good degree though which is nice
02:30:45FromDiscord<Yardanico> nah, it just seems to be a little video about rust optimizations options
02:31:52FromDiscord<Elegantbeef> Nim circle jerks?
02:32:01FromDiscord<Elegantbeef> Have i been missing out on circle jerks
02:32:02FromDiscord<Elegantbeef> Fuck
02:32:10FromDiscord<Prestige> I know many people think languages like V have some new fancy memory management options, and think nim just has a "normal gc" so it isn't as good etc
02:32:14FromDiscord<Tuatarian> it's mostly contained to the nim forum
02:32:19FromDiscord<Prestige> when they do similar things
02:32:25FromDiscord<Yardanico> In reply to @iWonderAboutTuatara "it's mostly contained to": can you give a few examples? i don't notice it that much
02:32:53FromDiscord<Tuatarian> any time anybody complains about anything in nim and isn't an already established person who's made some major software, they're usually not treated well
02:33:10FromDiscord<sOkam!> In reply to @Elegantbeef "Only seq, string, and": so, if i create any type that's not one of those three without alloc, it lives on the stack... and if I add alloc, it lives on the heap? just like C, right?↵might sound like a stupid question, but this type of simple stuff has bit me in the ass way to much to not ask for confirmation sry 😔
02:33:17FromDiscord<Prestige> In reply to @iWonderAboutTuatara "any time anybody complains": I've missed out on that
02:33:31FromDiscord<Tuatarian> I think it used to be a bigger thing than it is nowadays
02:34:00FromDiscord<Tuatarian> if you google for things you tend to get more of these kinds of threads ime
02:34:11FromDiscord<Prestige> I complain about editor support and related issues frequently
02:34:14FromDiscord<Prestige> hmm
02:34:58FromDiscord<Tuatarian> crap editor support is really hard to argue against
02:35:04FromDiscord<Tuatarian> also it's gotten a lot better I think
02:35:19FromDiscord<Prestige> Yeah
02:35:36FromDiscord<Prestige> I think my biggest issue currently is nimsuggest being abandoned
02:35:44FromDiscord<Tuatarian> it = toxicity, but also the editor support yeah
02:35:49FromDiscord<Yardanico> In reply to @Avahe "I think my biggest": actually it is receiving updates now
02:35:56FromDiscord<Tuatarian> I can't get linting working in emacs, which is kind of awful
02:36:01FromDiscord<Yardanico> yyoncho was hired by status to improve nimsuggest/LSP
02:36:03FromDiscord<Generic> it's in the limbo of "it's going to be better when IC arrives"
02:36:23FromDiscord<Tuatarian> even using something like nimlangserver + lsp-mode doesn't work for some weird and hard to diagnose reason
02:36:31FromDiscord<Tuatarian> I think other emacs users basically have the same experience in this regard
02:36:58FromDiscord<Prestige> At this point I just compile my program in order to find any compilation issues
02:37:16FromDiscord<Prestige> my editor is commonly flooded with fake errors via linting
02:37:23FromDiscord<Prestige> but compiles fine
02:37:37FromDiscord<Generic> nim check has it's benefits
02:38:17FromDiscord<Tuatarian> yeah same, I just use nim c -r whatever and hope it works
02:38:19FromDiscord<Generic> ~~why can't it output errors and warnings in a machine readable format, parsing the ones made for humans is such a pain~~
02:38:51FromDiscord<Tuatarian> nim check is fine, but it still requires a bunch of iterations before your code runs which is also annoying
02:39:35FromDiscord<Generic> if nim check doesn't flag any error it should compile
02:39:40FromDiscord<Prestige> I love a lot of things about this language but the editing experience is painful. A lot of people I know don't use Nim for that reason actually
02:40:09FromDiscord<Prestige> I tried to offer to pay to fix one of these nimsuggest bugs but got no response lol
02:40:20FromDiscord<Generic> only if your program doesn't compile nim check can sometimes have issues with cascading errors
02:40:44FromDiscord<Generic> but if you really don't like that you can use errorMax:1 and you get 100% the same output as the compiler gives
02:40:50FromDiscord<Generic> ~~except for cgen errors~~
02:41:23FromDiscord<Prestige> In reply to @Yardanico "https://www.youtube.com/watch?v=mNBhZ5VQ2y4 someone": I should make a 1:1 remake of this video with nim, would be funny
02:41:34FromDiscord<Yardanico> https://www.reddit.com/r/nim/comments/vr0aql/nimlangserver_announcement/ is about yyoncho
02:41:59FromDiscord<Yardanico> nimlangserver still seems to be in development, but he already made some fixes to nimsuggest
02:42:45FromDiscord<Prestige> That's great
02:44:55FromDiscord<Prestige> Is IC still the main focus right now, in order to enable better editor support? Last I heard about this was like... 6-12 months ago, maybe
02:45:13FromDiscord<Yardanico> I don't think anything that's related to IC has been touched in the last months
02:45:23FromDiscord<Prestige> Oh, wow
02:45:34FromDiscord<Yardanico> Araq was busy with his book I guess, and flywind is doing the work to make the ORC default (testing packages and fixing some bugs), Araq is fixing some bugs too
02:45:58FromDiscord<Yardanico> but I didn't follow the nim repo very closely for the last half a year
02:46:54FromDiscord<Prestige> I've been thinking of putting out a few videos related to Nim, but I haven't decided on the topic. Maybe some basic SDL stuff, or like leetcode question solving
02:47:08FromDiscord<Prestige> Something people could start off with that's small or easy to grasp
02:55:52FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=49V5
02:56:04FromDiscord<Yardanico> In reply to @sOkam! "Why does this print": because that's what the values are?
02:56:09FromDiscord<Yardanico> what do you expect it to print?
02:56:18FromDiscord<Prestige> Everything in Nim defaults to 0 values
02:56:20FromDiscord<sOkam!> 1 to 9?
02:56:25FromDiscord<Yardanico> In reply to @sOkam! "1 to 9?": how so?
02:56:37FromDiscord<Yardanico> you did `create(int, 10)` which creates a memory block of the size of 10 ints
02:56:39FromDiscord<Yardanico> and zeroes it
02:56:40FromDiscord<sOkam!> 🤷‍♂️ i thought create did that, but i guess it doesnt
02:56:49FromDiscord<Yardanico> `create` is just memory allocation with a big of sugar
02:56:58FromDiscord<Yardanico> 10 means amount of the type to create
02:56:59FromDiscord<sOkam!> simple stuff gets me, so didn't notice i guess
02:57:23FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1017267375327952966/unknown.png
02:58:39FromDiscord<sOkam!> why is casting needed in that statement? can't the array be created directly?
02:59:15FromDiscord<Yardanico> In reply to @sOkam! "why is casting needed": casting is needed because `alloc0` gives you a `pointer`
03:00:04FromDiscord<sOkam!> and you cannot assign a pointer to a typed ptr?
03:00:10FromDiscord<Patitotective> hMmM i've been working on the KDL parser and to generate the nodes objects themselves i first need to validate that the tokens are valid (lexer's result) and store the temporary node somewhere, to use it or discard it depending if it's valid or not (i.e.: you started a node but then started another without finishing the first)↵and was wondering if the best way was to do it through fields in the parser (`tempNode: Node, tempVal: Va
03:00:48FromDiscord<Patitotective> (edit) "seq[node]`)" => "seq[Node]`)"
03:00:49FromDiscord<Yardanico> In reply to @sOkam! "and you cannot assign": no, because Nim is strongly typed
03:01:07FromDiscord<Yardanico> well, it's not really only because of that
03:01:11FromDiscord<Yardanico> but because `ptr T` gives more information
03:01:21FromDiscord<Yardanico> "Traced references are declared with the ref keyword, untraced references are declared with the ptr keyword. In general, a ptr T is implicitly convertible to the pointer type."
03:01:24FromDiscord<Yardanico> but not the other way
03:02:56FromDiscord<sOkam!> wdym the other way? ref to ptr, ref to pointer, or pointer to ptr?
03:06:42*derpydoo quit (Quit: derpydoo)
03:07:40FromDiscord<sOkam!> also, is there a way to specify the exact binary output path+file during compiling?↵i keep getting that i cannot pass parameters when adding `-o:folder/bin.ext` or `--out:folder/bin.ext`
03:08:23FromDiscord<Yardanico> tried quotes?
03:08:39FromDiscord<sOkam!> oh didn't, might be helpful 🤦‍♂️
03:10:19FromDiscord<sOkam!> oh, actually doesn't work 🤔
03:11:12FromDiscord<Patitotective> In reply to @sOkam! "also, is there a": you should use `--outdir:folder --out:bin.ext` probably
03:11:16FromDiscord<Elegantbeef> Isnt `out` just the file name and you set `outdir` for the dir
03:11:22FromDiscord<Elegantbeef> Yea what that nerd said
03:11:38FromDiscord<Patitotective> i though you had 90 wpm
03:11:43FromDiscord<Patitotective> (edit) "though" => "thought"
03:11:48FromDiscord<Elegantbeef> Yea when i'm not playing agame
03:11:48FromDiscord<Patitotective> (edit) "90 wpm" => "90wpm"
03:11:59FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=49V7
03:12:09FromDiscord<Patitotective> put the flags before the file
03:12:24FromDiscord<Patitotective> `nim c --gc:none memtest.nim`
03:12:34FromDiscord<sOkam!> ah that was it, ty
03:12:37FromDiscord<Patitotective> otherwise nim will pass those as arguments to `memtest.nim`
03:12:57FromDiscord<sOkam!> oh! that's what it meant. i thought it was trying to pass the parameters to the compiler
03:15:07FromDiscord<Patitotective> 🌃
03:37:41*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
03:55:41NimEventerNew post on r/nim by Wysardry: How to get clean simple C output?, see https://reddit.com/r/nim/comments/x8prqq/how_to_get_clean_simple_c_output/
04:01:36FromDiscord<Prestige> Maybe I should ask the forum what type of videos people would like to see related to Nim
04:08:42FromDiscord<sOkam!> is there a way to check for incorrect allocations with alloc, like in C?↵what does alloc return if it failed?
04:09:01FromDiscord<Rika> nil i assume
04:13:33*jmdaemon joined #nim
04:14:42FromDiscord<sOkam!> kk ty
04:15:27FromDiscord<Rika> if alloc fails then theres a big problem that you most likely cant recover from (in the program) anyway
04:15:44FromDiscord<sOkam!> im trying to implement a simple gc example i found online, that i already followed in C↵but it's using `sbrk()`, since its also implementing a basic alloc function↵is it possible to use such a function in Nim too?
04:16:13FromDiscord<Rika> probably but you will have to manually import it
04:16:15FromDiscord<Yardanico> Nim compiles to C so you can just importc it
04:16:17FromDiscord<Rika> (edit) "probably but you will have to manually import it ... " added "from c"
04:22:49FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=49Vb
04:23:02FromDiscord<Yardanico> you should use the special C types of you're importcing a C function
04:23:23FromDiscord<sOkam!> k
04:23:24FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=49Vb" => "https://play.nim-lang.org/#ix=49Vc"
04:23:29FromDiscord<Elegantbeef> `int` is fine for `intptr_t` though afaik
04:24:09FromDiscord<Yardanico> In reply to @sOkam! "does this look fine?": also your import is wrong
04:24:14FromDiscord<Yardanico> sbrk returns a `cint` as well
04:24:16FromDiscord<Yardanico> https://linux.die.net/man/2/sbrk
04:24:55FromDiscord<sOkam!> doesnt it return a void?
04:25:14FromDiscord<Yardanico> which is a pointer
04:25:17FromDiscord<Rika> cint is brk not sbrk
04:25:19FromDiscord<Yardanico> ah yeah
04:25:27FromDiscord<Yardanico> In reply to @sOkam! "doesnt it return a": and even void is a pointer and not "nothing" :)
04:25:30FromDiscord<Yardanico> in C
04:25:52FromDiscord<sOkam!> yeah, was changing it. i copypasted from printf example... so was missing the return type
04:26:07FromDiscord<sOkam!> do pragmas go before or after the return type?
04:26:12FromDiscord<Rika> after
04:26:14FromDiscord<sOkam!> k
04:26:40FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=49Ve
04:26:40FromDiscord<Rika> should be right
04:26:49FromDiscord<sOkam!> k ty
04:38:49FromDiscord<markanthony22> Thank me letter https://t.me/+FE01vMtarjEwOWM0
04:39:21FromDiscord<Rika> <@&371760044473319454> literally in the main channel huh
04:39:31FromDiscord<Elegantbeef> Looks like the spammers got me to spell for them
04:40:54FromDiscord<Rika> i cant believe you work for the spammers, beef
04:41:23FromDiscord<Elegantbeef> You know what they say if you cant 'beet them join them'
04:41:32FromDiscord<Rika> beaf
04:42:30FromDiscord<Elegantbeef> reeka
04:45:45FromDiscord<Lucybtc> sent a long message, see http://ix.io/49Vf
04:46:46FromDiscord<Tuatarian> wow thanks
04:47:03FromDiscord<Rika> holy fuck
04:47:13FromDiscord<halc> oh my god $4000 wow I can't believe it
04:47:20FromDiscord<Elegantbeef> 4 \ 5 = 10?
04:47:46FromDiscord<Rika> no, you only work for 2.5 days
04:58:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=49Vh
05:01:52*tk quit (Ping timeout: 260 seconds)
05:05:56FromDiscord<Rika> no
05:05:57FromDiscord<Rika> it should work
05:06:03FromDiscord<Rika> try quoting the dir
05:06:28FromDiscord<sOkam!> it works for --nimchache:folder/subfolder
05:06:40FromDiscord<Rika> also delete the ./hello file first, you might be mistaking it
05:06:42FromDiscord<sOkam!> but outdir is being ignored
05:06:49FromDiscord<sOkam!> i removed everything yeah
05:06:49FromDiscord<sOkam!> a few times
05:06:55FromDiscord<Rika> then thats strange
05:09:26FromDiscord<sOkam!> quotes didn't help
05:14:15FromDiscord<Rika> im not sure what the issue is then
05:14:21FromDiscord<Rika> maybe swap the order of out and outdir
05:26:11*tk joined #nim
05:33:48FromDiscord<ravinder387> template/generic instantiation of `draw` from here↵C:\Users\ravin\Documents\Nim-Lang\Plotly\interactive\linechart\app.nim(15, 39) Warning: implicit conversion to 'cstring' from a non-const location: parseTraces(p.traces); this will become a compile time error in the future [CStringConv]
05:33:53FromDiscord<ravinder387> kindly explain me
05:34:00FromDiscord<ravinder387> `template/generic instantiation of `draw` from here↵C:\Users\ravin\Documents\Nim-Lang\Plotly\interactive\linechart\app.nim(15, 39) Warning: implicit conversion to 'cstring' from a non-const location: parseTraces(p.traces); this will become a compile time error in the future [CStringConv]`
05:34:12FromDiscord<Yardanico> In reply to @ravinder387 "template/generic instantiation of `draw`": it is exactly what the compiler tells you
05:34:31FromDiscord<Yardanico> implicit string -> cstring conversions in the future will become invalid, so you need to explicitly convert the string to a cstring
05:36:48FromDiscord<ravinder387> if i have string e.g x = "hello" how to cast into ctring
05:36:59FromDiscord<Yardanico> cstring(x)
05:37:18FromDiscord<Yardanico> and this is not a "cast", casts are done with `cast`, type conversions are safe and are done like `newtype(variable)`
05:50:58FromDiscord<sOkam!> In reply to @Rika "maybe swap the order": that actually worked 🧩
05:51:54FromDiscord<Rika> wtf
06:08:10FromDiscord<ravinder387> `app.nim(15, 39)` in which line nim say error
06:08:15FromDiscord<ravinder387> 15 or 39
06:08:49FromDiscord<ravinder387> sorry I never write unittest, debug, anything like that... I'm non-programmer
06:09:01FromDiscord<ravinder387> I'm python user
06:11:06FromDiscord<Rika> line 15 character 39
06:25:51FromDiscord<aruZeta> so python users are non programmers?
06:41:10*PMunch joined #nim
07:11:23FromDiscord<Girvo> @aruZeta I would like to invoke the fifth amendment
07:11:47FromDiscord<Elegantbeef> What's the australian 5th amendment?!
07:11:58FromDiscord<Elegantbeef> I know the Canadian one is about two provinces joining confederacy
07:15:23FromDiscord<@chronomatopoeia:matrix.org> The right to refrain from posting a meme.
07:16:03PMunchIt appears to be an amendment removing special notices of the Aboriginals in their constitution
07:17:07FromDiscord<@chronomatopoeia:matrix.org> privilege not to self-incriminate
07:17:24PMunchThat's the american one
07:18:18FromDiscord<clararussel> sent a long message, see http://ix.io/49VB
07:18:21PMunchThey removed this bit (in bold): The Parliament shall, subject to this Constitution, have power to make laws for the peace, order, and good government of the Commonwealth with respect to: The people of any race, other than the aboriginal race in any State, for whom it is deemed necessary to make special laws;
07:18:37PMunchAnd a section titled "Aborigines not to be counted in reckoning population"
07:19:34FromDiscord<@chronomatopoeia:matrix.org> my bad, I saw an Australian article on US law↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
07:20:03FromDiscord<Elegantbeef> You guys are looking too deep into a joke
07:20:16FromDiscord<@chronomatopoeia:matrix.org> never
07:20:53FromDiscord<@chronomatopoeia:matrix.org> at least I learned something \:)
07:23:00PMunch@Elegantbeef, pfft, no such thing
07:23:21PMunchEveryone knows that jokes get funnier the more you explain them
07:24:07FromDiscord<Elegantbeef> As funny as a hired clown at a funeral
07:41:15*rockcavera quit (Remote host closed the connection)
08:02:30*m5zs7k quit (Ping timeout: 264 seconds)
08:03:04FromDiscord<ezquerra> Is there a way to get the list or variables that are in scope at a given point (and wether they are local or global) at compile time? I’d like to make a macro that prints all the variables and their values during runtime (to help when debugging, since gdb is… not that great for that)
08:03:51FromDiscord<Elegantbeef> `locals` exists
08:04:37FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49VL
08:05:26*m5zs7k joined #nim
08:07:23PMunch@ezquerra, there is also a Nim plugin to gdb which will pretty-print Nim variables
08:07:40FromDiscord<Elegantbeef> Though it fails on a few nim things
08:07:44FromDiscord<Elegantbeef> Like sets for instance
08:07:53PMunchYeah it's not perfect..
08:09:43FromDiscord<Elegantbeef> Also tagged unions dont work
08:09:52FromDiscord<Elegantbeef> I know saem looked at that and couldnt get it to work
08:11:58FromDiscord<Elegantbeef> I do wonder how hard it'd be to make that python script more usable
08:50:33*jmdaemon quit (Ping timeout: 252 seconds)
10:04:23FromDiscord<soda> Do nim compile time constants only exist at compilation?
10:04:52PMunch@soda, depends
10:05:01PMunchA normal `const` is available on runtime
10:05:22FromDiscord<soda> When is it not?
10:06:13FromDiscord<soda> Basically, i encountered this situation in another language where a compile-time constant 2D array was only available at compile-time. Every function call that would require it would instantiate the array again. How does it work in nim?
10:06:42PMunchIn cases like this: https://play.nim-lang.org/#ix=49We
10:07:09PMunchWell a const is basically just inserting the value every time you use it
10:07:29PMunchIt does a little check to see if it is very large and then uses a variable instead I believe
10:07:57PMunchBut for e.g. the number 5 it would just compile down to writing out the number 5 in the source code
10:08:01FromDiscord<soda> sent a code paste, see https://play.nim-lang.org/#ix=49Wg
10:08:01FromDiscord<soda> Consider this 2d array of 2 enums
10:08:20FromDiscord<soda> Is this re-instantiated every time a proc indexes it?
10:08:24FromDiscord<soda> or is it a real constexpr?
10:08:45FromDiscord<dom96> `const` is always a constexpr
10:08:50*neceve quit (Quit: ZNC - https://znc.in)
10:08:59FromDiscord<dom96> if the compiler can't make it that way then it will give you an error
10:09:03FromDiscord<soda> Nice, as it should be
10:09:08FromDiscord<soda> unlike a certain other language
10:09:15PMunchAs a const I believe it would be expanded to that array and then the index.
10:09:23FromDiscord<dom96> oh, which one?
10:12:32FromDiscord<planetis> math.factorial has a local compile time constant that is filled once the function is called. This way it doesn't pollute the library scope. It just looks like `const table = makeFactorialTable`
10:12:53FromDiscord<planetis> (edit) "math.factorial" => "math.fac" | "math.fachas a local compile time constant that is filled once the function is called. This way it doesn't pollute the library scope. It just looks like ... `constmakeFactorialTable()`" added "this" | "makeFactorialTable`" => "makeFactorialTable()`"
10:13:15FromDiscord<soda> So it's not a compile time constant?
10:13:26FromDiscord<soda> or is the function called at compile time?
10:13:38FromDiscord<planetis> the second one
10:14:13*neceve joined #nim
10:14:57FromDiscord<soda> So let's say a function only does a constexpr operation, is it automatically inlined?
10:15:09FromDiscord<soda> (like indexing as above)
10:15:16FromDiscord<planetis> It's also explained in the mastering nim book page 112! I wrote it but didn't get any credit...
10:16:17FromDiscord<dom96> In reply to @planetis "It's also explained in": wait, you wrote a part of the book and didn't get credit?
10:17:02FromDiscord<planetis> no the example that's explained in the book
10:17:09FromDiscord<planetis> (edit) "no the ... example" added "code"
10:17:22FromDiscord<dom96> oh, that's still a shame
10:18:07FromDiscord<planetis> That's ok. I loved the book.
10:19:55FromDiscord<planetis> In reply to @soda "So let's say a": For that to work you need to annotate the function with .compileTime. But const variables are inlined.
10:20:31FromDiscord<soda> Can you please provide a syntax example for doing that?
10:20:48FromDiscord<soda> proc foo()
10:22:18FromDiscord<soda> nvm i found it
10:24:07FromDiscord<planetis> it's like an example posted recently in the forum: https://forum.nim-lang.org/t/9433#61960
10:24:09FromDiscord<soda> sent a code paste, see https://play.nim-lang.org/#ix=49Wn
10:24:30FromDiscord<soda> Are the first and the third equivalent?
10:24:48FromDiscord<soda> So there is one less function call cost at runtime?
10:25:56FromDiscord<planetis> That won't work at compile time, it would still be runtime right? You don't run the FSM at compile time
10:26:09FromDiscord<soda> FSM is a constexpr
10:26:35FromDiscord<soda> hmm
10:26:43FromDiscord<planetis> No just use a template if you want to avoid a function call
10:26:48FromDiscord<soda> well i guess it's true
10:28:19FromDiscord<soda> alright makes sense
10:57:49FromDiscord<mratsim> In reply to @soda "So let's say a": Tag it {.compileTime.} or use `static T` as a result is you want insurance
10:57:59FromDiscord<mratsim> (edit) "{.compileTime.}" => "`{.compileTime.}`"
10:59:10FromDiscord<mratsim> In reply to @soda "FSM is a constexpr": If your FSM states are known at compile-time and you want to avoid function calls, I can sell you dark magic for your soul.
11:00:15FromDiscord<mratsim> https://forum.nim-lang.org/t/8963#58594
11:06:47FromDiscord<planetis> nice
11:14:00FromDiscord<planetis> I can't have a pointer to static[array[n, byte]] that's a bummer.
11:15:03FromDiscord<planetis> (edit) "" => "("Error: expression has no address")"
11:18:15FromDiscord<soda> In reply to @mratsim "If your FSM states": That's what i was wondering
11:18:48FromDiscord<soda> Considering that the entirety of FSM is compile time, does the compiler turn FMS[idx] to it's value at compile time?
11:19:03FromDiscord<soda> and, do procs that only do constexpr operations achieve the same effect automatically?
11:19:15FromDiscord<soda> In reply to @mratsim "If your FSM states": Good stuff
11:20:11FromDiscord<soda> (edit) "Considering that the entirety of FSM is ... compile" added "known at"
11:21:59FromDiscord<mratsim> sent a long message, see http://ix.io/49WA
11:22:19FromDiscord<mratsim> In reply to @soda "Considering that the entirety": Yes, the compiler does constant-folding on indexing
11:23:00FromDiscord<planetis> I just wanted the EmbeddedImage I was working on to hold a pointer that's verifiable can't be freed at runtime.
11:23:30FromDiscord<mratsim> In reply to @soda "and, do procs that": It depends. If they are tagged {.compileTime.} or static T for result yes, in Nim.↵If they are inlined, or called in the same module, the C compiler might do constant propagation.↵If none are true, you would need LTO.
11:24:05FromDiscord<soda> What if they are called .compileTime, but whether or not the proc gets executed depends on control flow?
11:24:14FromDiscord<soda> (edit) "called" => "tagged"
11:31:38*NimEventer quit (Remote host closed the connection)
11:32:41*NimEventer joined #nim
11:32:41NimEventerNew thread by srozb: Libpe & peni - Portable Executable parsing lib & tool released, see https://forum.nim-lang.org/t/9446
11:55:21FromDiscord<mratsim> In reply to @soda "What if they are": still constant folded
11:55:44FromDiscord<mratsim> compile with --nimcache:cache_folder and look at the generated C code
12:21:09*arkurious joined #nim
12:31:58*vicecea quit (Remote host closed the connection)
12:32:27*vicecea joined #nim
12:47:24*neceve quit (Changing host)
12:47:24*neceve joined #nim
13:02:44NimEventerNew Nimble package! peni - PE tool based on libpe (with no S), see https://github.com/srozb/peni
13:03:28FromDiscord<Rika> With no S LMAO
13:03:55FromDiscord<aruZeta> HAHAHA
13:11:13FromDiscord<Tetralux> COWARD 🤣
13:13:46FromDiscord<Prestige> Lol
13:44:47NimEventerNew Nimble package! QRgen - A QR code generation library., see https://github.com/aruZeta/QRgen
13:44:47NimEventerNew Nimble package! bitseqs - Utility for a bit manipulation, see https://github.com/adokitkat/bitfields
13:45:02FromDiscord<Rika> In reply to @NimEventer "New Nimble package! QRgen": Cool
13:45:10FromDiscord<aruZeta> In reply to @NimEventer "New Nimble package! QRgen": 🥳
13:47:22FromDiscord<aruZeta> only took 1.7k lines
14:07:33FromDiscord<Dumb Dragon> every day I find out more and more cool things you can do https://media.discordapp.net/attachments/371759389889003532/1017436030300848198/unknown.png
14:08:31FromDiscord<Dumb Dragon> default arguments using another argument is pretty useful
14:12:20FromDiscord<Dumb Dragon> might be something in other languages too idk
14:12:27*PMunch quit (Quit: Leaving)
14:12:59FromDiscord<Dumb Dragon> I mainly just use nim and I didn't bother to see if this works in like, rust or c++
14:14:21FromDiscord<Tetralux> In reply to @Dumb Dragon "every day I find": Hmm. I wonder what C it generates. 🤔
14:14:52FromDiscord<Dumb Dragon> probably 3 separate functions depending on the parameters used
14:16:47FromDiscord<Dumb Dragon> sent a code paste, see https://play.nim-lang.org/#ix=49Xe
14:17:14FromDiscord<Dumb Dragon> Idk I don't really look at the C code that nim generates all that often
14:19:59FromDiscord<Dumb Dragon> doesn't work in c++ https://media.discordapp.net/attachments/371759389889003532/1017439159184535553/unknown.png
14:21:12*derpydoo joined #nim
14:21:41FromDiscord<Rika> In reply to @aruZeta "🥳": congrats
14:22:17FromDiscord<Rika> In reply to @Dumb Dragon "default arguments using another": it certainly is funky though
14:22:38FromDiscord<Dumb Dragon> yeah
14:24:14FromDiscord<Dumb Dragon> In reply to @Dumb Dragon "I mainly just use": also turns out rust doesn't even support default arguments, which is something I should've known considering the stackoverflow question I clicked on was grey
14:24:23*rockcavera joined #nim
14:24:24*rockcavera quit (Changing host)
14:24:24*rockcavera joined #nim
14:24:27FromDiscord<Dumb Dragon> (edit) "question" => "link"
14:28:10FromDiscord<aruZeta> it's also a thing in lisp
14:28:15FromDiscord<aruZeta> or at least in common lisp
14:28:28FromDiscord<Dumb Dragon> huh, neat
14:28:37FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49Xg
14:30:14FromDiscord<aruZeta> and also something great is lisp supports knowing if an optional parameter with a default value was specified or not
14:31:01FromDiscord<aruZeta> let's say `foo`'s default value is `0`, in most programming languages you don't know if the user was the one to enter `0` or not
14:31:52FromDiscord<Dumb Dragon> neat
14:34:54FromDiscord<Prestige> In reply to @Dumb Dragon "every day I find": Dang that's cool
15:00:13*kenran joined #nim
15:15:46FromDiscord<Tetralux> sent a code paste, see https://play.nim-lang.org/#ix=49XG
15:16:05FromDiscord<Tetralux> (edit) "https://play.nim-lang.org/#ix=49XG" => "https://paste.rs/y6V"
15:16:09FromDiscord<Dumb Dragon> oh yeah that's actually much simpler
15:16:28FromDiscord<Tetralux> Right, exactly.
15:23:26*krux02 joined #nim
15:30:10FromDiscord<@thatrandomperson5-6310e3b26da03> Does anyone know where that list of useful packages is? By category
15:31:45FromDiscord<Dumb Dragon> https://github.com/ringabout/awesome-nim
15:31:47FromDiscord<Dumb Dragon> this one?
15:44:30FromDiscord<@thatrandomperson5-6310e3b26da03> Sure
15:49:15*jmdaemon joined #nim
15:49:34FromDiscord<@thatrandomperson5-6310e3b26da03> How do i list all my packages in my nim project? Is there a special file type?
15:52:35FromDiscord<aruZeta> to add packages to your nimble project you should add them to your `.nimble` file
15:55:01FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49XV
15:56:16FromDiscord<@thatrandomperson5-6310e3b26da03> But it says im missing version
15:57:52FromDiscord<Rika> what are you writing
15:58:12FromDiscord<@thatrandomperson5-6310e3b26da03> requires "nimquery"
15:58:51FromDiscord<soda> What's the best way to pass an array to a procedure?
15:59:02FromDiscord<soda> and
15:59:20FromDiscord<soda> what's the equivalent of passing an array by non-const pointer to a procedure?
15:59:32FromDiscord<soda> (edit) "an" => "a dynamic"
16:00:04FromDiscord<aruZeta> In reply to @@thatrandomperson5-6310e3b26da03 "requires "nimquery"": you need to specify a minimum version
16:00:19FromDiscord<aruZeta> just write `"nimquery >= 0.0.1"`
16:00:45FromDiscord<Rika> In reply to @aruZeta "you need to specify": you actually dont iirc
16:00:51FromDiscord<@thatrandomperson5-6310e3b26da03> \:thumbsup\:↵(@Rika)
16:01:11FromDiscord<Rika> In reply to @soda "What's the best way": dynamic array -> seq?
16:01:14FromDiscord<Rika> just pass it as is
16:01:24FromDiscord<Rika> In reply to @soda "what's the equivalent of": var seq?
16:01:50FromDiscord<soda> in all instances i meant seq
16:01:53FromDiscord<Rika> proc ...(a: var seq[...]) ...
16:02:01FromDiscord<Rika> for a mutable sequence
16:02:02FromDiscord<soda> ooh okay
16:02:24FromDiscord<Rika> the best way to pass a sequence given no mutability requirement is just to pass it as is
16:02:30FromDiscord<Rika> so same as i said without the var
16:02:38FromDiscord<soda> What is the underlying mechanism here?
16:02:44FromDiscord<soda> Is the array being passed by ref?
16:02:49FromDiscord<soda> also what about slices?
16:02:54FromDiscord<soda> how can i pass a slice?
16:03:29FromDiscord<Rika> In reply to @soda "Is the array being": by copy in this case
16:03:39FromDiscord<Rika> copy of the length, capacity, and data pointer
16:03:42FromDiscord<Rika> so nothing large
16:04:00FromDiscord<Rika> well, i think the data pointer contents are also copied, but i dont know for sure
16:04:06FromDiscord<soda> that is already kinda like a slice
16:04:27FromDiscord<soda> but i still can't seem to assign to the seq inside the procedure 🤔
16:04:32FromDiscord<Rika> example
16:04:45FromDiscord<soda> no sorry my bad
16:04:54FromDiscord<soda> i was using an iterator wrong
16:04:57FromDiscord<Rika> oh ok
16:08:11NimEventerNew post on r/nim by pusewicz: vim-test now supports Nim, see https://reddit.com/r/nim/comments/x94egk/vimtest_now_supports_nim/
16:10:21*kenran quit (Ping timeout: 260 seconds)
16:16:03*kenran joined #nim
16:36:23*kenran quit (Quit: WeeChat info:version)
17:06:25*LuxuryMode quit (Quit: Connection closed for inactivity)
17:30:14*rez joined #nim
17:32:51*kenran joined #nim
17:34:31*kenran quit (Client Quit)
17:43:18*monkeybusiness joined #nim
17:45:31*rez quit (Ping timeout: 252 seconds)
17:45:47*rez joined #nim
17:46:30*LuxuryMode joined #nim
17:46:44*rez quit (Remote host closed the connection)
17:56:23*rez joined #nim
18:46:16NimEventerNew thread by luntik2012: How can I buy "Mastering Nim" without using amazon services?, see https://forum.nim-lang.org/t/9449
18:50:49*rez quit (Quit: much snoozes...)
18:57:24FromDiscord<halc> isn't nimpretty supposed to limit line length to 80 characters? It seems to arbitrarily ignore some of my +80 character type declarations
18:59:22*neceve_ joined #nim
19:00:02*neceve_ quit (Client Quit)
19:00:24FromDiscord<Phil> You manage to have type declarations beyond 80 characters?
19:00:32FromDiscord<Phil> I am fascinated, how?
19:03:24FromDiscord<Rainbow Asteroids> generics
19:03:42FromDiscord<halc> object variant containing proc pointers
19:04:06FromDiscord<Rainbow Asteroids> have you tried using std/sugar?
19:05:31FromDiscord<aruZeta> In reply to @Isofruit "You manage to have": oh boy
19:05:48FromDiscord<aruZeta> some of my procs do, but types?
19:06:54FromDiscord<aruZeta> In reply to @Rainbow Asteroids "have you tried using": now that you mention sugar, I have never actually used it and maybe it could be useful to refactor some of my lib's code, what does sugar provide?
19:07:00FromDiscord<halc> In reply to @Rainbow Asteroids "have you tried using": I'm not trying to shorten signatures, they are pretty long already, not much I can do about it since they come from another library
19:07:51FromDiscord<Phil> In reply to @aruZeta "now that you mention": 95% of the time I use sugar for "=>" for my anonymous procs
19:07:57FromDiscord<Rainbow Asteroids> In reply to @aruZeta "now that you mention": rtfm↵https://nim-lang.org/docs/sugar.html
19:08:04FromDiscord<aruZeta> In reply to @Rainbow Asteroids "rtfm https://nim-lang.org/docs/sugar.html": ik
19:08:16FromDiscord<aruZeta> I just wanted a general view of your usage
19:08:29FromDiscord<Rainbow Asteroids> I just use `collect`
19:10:17FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=49Yw
19:10:28FromDiscord<halc> (edit) "https://play.nim-lang.org/#ix=49Yw" => "https://play.nim-lang.org/#ix=49Yx"
19:10:35FromDiscord<Phil> Oooof yeah I feel for you on that
19:11:12FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49Yy
19:11:23FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=49Yy" => "https://play.nim-lang.org/#ix=49Yz"
19:11:45FromDiscord<Phil> In reply to @aruZeta "i do so manually": This means format war
19:11:52FromDiscord<aruZeta> haven't used a prettyfier in a long time lol
19:11:54FromDiscord<halc> In reply to @aruZeta "i do so manually": yeah, that's what I'd normally do, I was just hoping nimpretty would do it for me since I gotta do this for A LOT of signatures
19:12:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=49YA
19:12:12FromDiscord<aruZeta> In reply to @Isofruit "This means format war": i struggled for a while on how should I format them
19:12:43FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49YB
19:12:50FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=49YB" => "https://play.nim-lang.org/#ix=49YC"
19:12:53FromDiscord<aruZeta> lemme see it in my code
19:12:58FromDiscord<Phil> It's what I settled on in python and since also started applying in java and co
19:13:59FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=49YE
19:14:02FromDiscord<aruZeta> yh that looks way better
19:14:10FromDiscord<aruZeta> and even more with the doc comments
19:15:32FromDiscord<Phil> ~~I kinda wish I was in the mental headspace to look at compiler stuff right now but tuesday to thursday is always such a rough time for mental work in my spare time~~
19:16:00FromDiscord<aruZeta> even imports look better now
19:16:15FromDiscord<aruZeta> how did I not think of this lol
19:20:29FromDiscord<Phil> It's one of those things nobody ever actually looks for. I didn't either, I got it shown to me and over time agreed that it was good
19:35:56FromDiscord<geekrelief> @Yardanico beef, with the Unreal Engine "Engine" module bindings included. it takes 20 seconds to compile. We might be able to break it apart into smaller nim modules, but at some point in a big enough game, enough of it will be reimported slowing down compilation again. It looks like we'll need IC for the nimforue bindings to be viable because Unreal already has Live Coding which takes less than 10 seconds to recompile C++.
19:46:07FromDiscord<geekrelief> The compile times are a showstopper for nimforue.
19:46:40FromDiscord<planetis> Just ask Araq, IC when?
19:48:03FromDiscord<dom96> isn't Epic building some new scripting language for UE?
19:48:15FromDiscord<geekrelief> In reply to @dom96 "isn't Epic building some": yeah Verse
19:48:36FromDiscord<geekrelief> Simon Peyton Jones was hired to work on it.
19:49:00FromDiscord<dom96> oh cool
19:50:06FromDiscord<geekrelief> https://haskell.foundation/podcast/11/
19:50:32FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=49YQ
19:56:57FromDiscord<planetis> looks nice
19:57:03FromDiscord<planetis> (edit)
19:57:54FromDiscord<geekrelief> In reply to @planetis "Verse looks nice": Were you able to find some example code of it?
19:58:23FromDiscord<geekrelief> oh I found this https://benui.ca/unreal/scripting-languages/#verse
19:58:24FromDiscord<planetis> https://nitter.kavin.rocks/pic/orig/media%2FEpeZMhDUwAAYBWJ.jpg
19:58:25FromDiscord<planetis> https://nitter.kavin.rocks/saji8k/status/1339709691564179464?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1339709691564179464%7Ctwgr%5E7c5250e66c83a60ea9780bccaac4d6229b637a63%7Ctwcon%5Es1_&ref_url=https%3A%2F%2Fwww.redditmedia.com%2Fmediaembed%2Fkf8z27%3Fresponsive%3Dtrueis_nightmode%3Dtrue
20:06:17*rez joined #nim
20:47:04FromDiscord<ag> Is there a guide on generating DLLs from Nim? For example how to export, what sort of types we can export, how to use it from C etc.
20:47:30FromDiscord<Elegantbeef> https://github.com/treeform/genny is probably the easiest way about this
20:49:41FromDiscord<ag> In reply to @Elegantbeef "https://github.com/treeform/genny is probably the": Oh wow, it supports `ref object`s too! I wasn't expecting that. Thanks!
20:50:29FromDiscord<EyeCon> There's also https://github.com/byt3bl33d3r/OffensiveNim#creating-windows-dlls-with-an-exported-dllmain
21:19:00*derpydoo quit (Quit: derpydoo)
21:23:13*rez quit (Quit: much snoozes...)
21:28:49*monkeybusiness quit (Ping timeout: 252 seconds)
21:34:12*monkeybusiness joined #nim
21:34:38*monkeybusiness quit (Changing host)
21:34:38*monkeybusiness joined #nim
21:50:26FromDiscord<Patitotective> again, why std/json does `JsonNode = ref JsonNodeObj`? why a ref type?
21:52:32FromDiscord<dom96> because JsonNode can contain multiple JsonNodes
21:52:45FromDiscord<Patitotective> 🧠
21:53:35FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49Zd
21:59:20FromDiscord<ezquerra> In reply to @PMunch "<@974046326088163438>, there is also": Is this the one that is bundled with nim or something else? I tried using gdb with nim and the experience was not great...
22:00:02FromDiscord<Patitotective> why? gdb works nice for me
22:00:49FromDiscord<ezquerra> For starters the gdb that is shipped with nim on windows is not "python enabled"
22:01:55FromDiscord<ezquerra> I tried it on Linux and while I was able to step through when I tried to view the variables I only saw a few mangled variables or variables that were not in the nim code
22:02:05FromDiscord<ezquerra> Maybe I did not properly call gdb with the right library?
22:02:22FromDiscord<ezquerra> (edit) "library?" => "script?"
22:03:15FromDiscord<Patitotective> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#using-gdb-lldb
22:03:59FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49Zf
22:04:36FromDiscord<Patitotective> slicing is the option then 💀
22:04:42FromDiscord<ezquerra> Also, I had issues trying to use --debugger:native with --mm:orc
22:06:13FromDiscord<ezquerra> In reply to @Patitotective "https://nim-lang.org/blog/2017/10/02/documenting-pr": Those instructions do not work for me, at least on windows. I get a message saying that gdb does not support python
22:06:20FromDiscord<Elegantbeef> parseutils should just use slices instead of start↵(@!Patitotective)
22:06:41FromDiscord<ezquerra> And on Linux, I could not list the variables properly
22:06:46FromDiscord<Elegantbeef> it's like a poor implementation of an openarray imo
22:07:17FromDiscord<Elegantbeef> What do you mean?↵(@!Patitotective)
22:09:45FromDiscord<Patitotective> In reply to @Elegantbeef "What do you mean?": dom said that `JsonNode` is a reference because it can contain it self (i think), but `KdlNode` is being recursive without being a ref :/
22:09:55FromDiscord<Elegantbeef> It's not recursive directly
22:09:58FromDiscord<Elegantbeef> It has pointer indirection
22:10:09FromDiscord<Elegantbeef> `seq[T]` is pointer indirection
22:10:38FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=49Zg
22:10:41FromDiscord<ezquerra> (edit) "https://play.nim-lang.org/#ix=49Zg" => "https://paste.rs/Tfg"
22:10:58FromDiscord<ezquerra> Also fails with arc but does work fine with refc
22:11:21FromDiscord<Elegantbeef> You can usue a macro to unpack it before it generates the code
22:13:34FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=49Zi
22:14:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49Zj
22:16:21FromDiscord<Patitotective> alsoo why is `range` a keyword?
22:16:30FromDiscord<Elegantbeef> Cause subrange types
22:16:44FromDiscord<Patitotective> right
22:27:27FromDiscord<ezquerra> In reply to @Elegantbeef "Probably need to make": Thanks!
22:28:30FromDiscord<Elegantbeef> I will note you can change the internals of `bodgeLocals` to format the locals how ever you want
22:56:59FromDiscord<! Nilts> How would i make a blank seq?
22:57:08FromDiscord<Elegantbeef> `@[]`
22:59:31FromDiscord<! Nilts> ok
23:00:34FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=49Zq
23:00:57FromDiscord<Elegantbeef> What's' your unary `/` do?
23:01:10NimEventerNew thread by jmgomez: Slow compilation time in a big project. What branch contains Incremental Compilation?, see https://forum.nim-lang.org/t/9450
23:01:46FromDiscord<! Nilts> In reply to @Elegantbeef "What's' your unary `/`": it is a template
23:01:56FromDiscord<Elegantbeef> Cool but that doesnt say what it does
23:02:04FromDiscord<Elegantbeef> It's obviously a template since it's returning
23:02:43FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=49Zr
23:02:46FromDiscord<Elegantbeef> You're returning
23:02:54FromDiscord<! Nilts> and?
23:02:56FromDiscord<Elegantbeef> Remove return
23:03:00FromDiscord<Elegantbeef> Templates are not procedures
23:03:10FromDiscord<Elegantbeef> The code is pasted verbatim
23:03:21FromDiscord<Elegantbeef> return exists a procedure
23:03:29FromDiscord<Elegantbeef> You're at top level code there is nothing to return from
23:03:31FromDiscord<! Nilts> so the last value becomes the output?
23:03:40FromDiscord<Elegantbeef> Nim has expressions so yes
23:03:46*Onionhammer quit (Quit: Ping timeout (120 seconds))
23:04:02FromDiscord<! Nilts> ok
23:04:02*Onionhammer joined #nim
23:04:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49Zs
23:04:52FromDiscord<Elegantbeef> Whoops
23:05:04FromDiscord<Elegantbeef> last line should be `PathFromString("\\" & path)`
23:05:24FromDiscord<Elegantbeef> and it needs an else branch that is just `PathFromString(path)`
23:09:40*Jjp137 quit (Ping timeout: 244 seconds)
23:09:59*Jjp137 joined #nim
23:13:04*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)