<< 12-06-2022 >>

00:03:36FromDiscord<j-james> i ran into a procedure that seems to be modifying its `JsonNode` parameter without it being marked as `var` anywhere
00:03:47FromDiscord<j-james> how is it doing this? i thought parameters were immutable by default
00:04:26FromDiscord<Elegantbeef> Reference types
00:04:51FromDiscord<Elegantbeef> The parameter is immutable in that it cannot be changed where it points, but the data it points at is not immutable
00:05:03FromDiscord<Elegantbeef> `strictFuncs` is an experimental feature that forces this
00:05:28FromDiscord<Elegantbeef> So even to mutate a immutable reference's fields is not valid code
00:05:57FromDiscord<abdu> what C #include equivalent in nim
00:05:57FromDiscord<j-james> ah, i see
00:06:04FromDiscord<j-james> (gross)
00:06:19FromDiscord<Elegantbeef> You import modules in nim and use `include` for modules if you must
00:06:31FromDiscord<Elegantbeef> Abdu i damn well better not see a forum post or stack overflow with that same question
00:06:48FromDiscord<Elegantbeef> If i do i'm going to get a plane ticket
00:07:29FromDiscord<abdu> Simplest example ?
00:08:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ZWh
00:08:53FromDiscord<geekrelief> ehmry there's this for SuperCollider https://github.com/capocasa/scnim and https://vitreo12.github.io/omni/
00:09:36FromDiscord<j-james> In reply to @Elegantbeef "`strictFuncs` is an experimental": interesting that's tied to view types
00:09:44FromDiscord<j-james> i wouldn't have expected that
00:09:54FromDiscord<Elegantbeef> It's not tied to
00:10:04FromDiscord<geekrelief> https://github.com/vitreo12/omnicollider I could have sworn there was a video from someone doing audio synthesis with Nim
00:10:19FromDiscord<Elegantbeef> Strict funcs makes view types better
00:10:58FromDiscord<abdu> sent a code paste, see https://play.nim-lang.org/#ix=3ZWi
00:11:08FromDiscord<Elegantbeef> Do i get a gold star?!
00:11:30FromDiscord<Yardanico> MAYBE !
00:11:42ehmrygeekrelief: I remembering seeing that video, it was nimcon or fosdem
00:11:47FromDiscord<Elegantbeef> YAY !
00:12:10ehmrythese looks like plugin generators, I was hoping to find a synth that I could drive from nim
00:12:39ehmryI've played with chuck, I could wrap that if I really wanted
00:13:09FromDiscord<geekrelief> must have been omni https://www.youtube.com/watch?v=ruT7sbs5O-Q
00:15:20*ltriant quit (Ping timeout: 248 seconds)
00:44:50*ltriant joined #nim
00:49:28*ltriant quit (Ping timeout: 248 seconds)
01:21:14FromDiscord<Yardanico> is there any reason why adding `lent2` would be bad to array iterators? regarding https://github.com/nim-lang/Nim/pull/14447
01:21:54FromDiscord<Yardanico> right now as a funny consequence of copying stuff around with `items` `filterIt` is slower (!) than `filter` for arrays (even with ARC) which is kinda counter-intuitive (since `filter` has to do a proc call while filterIt is always easily inlined)
01:27:35FromDiscord<Elegantbeef> I cant think of a reason why it'd be bad, might be a technical issue with Nim
01:28:55FromDiscord<Yardanico> @beef but it's already done for seqs
01:30:34*ltriant joined #nim
01:38:44*ltriant quit (Ping timeout: 255 seconds)
01:39:53*ltriant joined #nim
02:49:39*arkurious quit (Quit: Leaving)
03:31:11*vicfred joined #nim
03:42:03*Guest71 joined #nim
03:42:10Guest71yo
03:42:21*Guest71 quit (Client Quit)
03:46:01FromDiscord<huantian> yo mama
03:48:58FromDiscord<Elegantbeef> No u
03:49:39FromDiscord<Elegantbeef> Looking at the irc logs they joined then instantly left 😄
03:55:27FromDiscord<Zectbumo> given the nim canon with overloading and uniform function call syntax, what is the history behind naming `flushFile` and why not `flush`?
03:56:51FromDiscord<Zectbumo> and follow up question, where is the new std/ library set for nim2? I want to be a part of feedback
03:56:52FromDiscord<Elegantbeef> People sometimes dont name procedures well 😄
03:57:13FromDiscord<Elegantbeef> Nim2 is `devel` on github
03:58:30FromDiscord<Zectbumo> has the std/lib already been started in the overhaul there or not started yet? where are we in this journey?
03:58:44FromDiscord<Elegantbeef> Some parts have
03:59:59FromDiscord<Zectbumo> I considered devel closer to v1.6.7. is this not the case and it's closer to 2.0? if so, where is v1.6.7 being developed?
04:00:13FromDiscord<Elegantbeef> 1.6.x is backported from devel
04:00:35FromDiscord<Elegantbeef> 1.6.x will be here https://github.com/nim-lang/Nim/tree/version-1-6
04:02:55FromDiscord<Zectbumo> got it, thx 👍
05:05:36*vicfred quit (Quit: Leaving)
05:51:06*kenran joined #nim
07:16:31FromDiscord<treeform> In reply to @PMunch "I guess it would": Sorry I went to bed. Maybe create new temperature file, export it from main file?
07:54:58*kenran quit (Quit: WeeChat info:version)
08:16:05*mal`` quit (Quit: Leaving)
08:35:46*krux02 joined #nim
08:36:59*mal`` joined #nim
08:37:34*jjido joined #nim
08:39:03FromDiscord<Prestige> Is there a recommended way to do ipc that would work on all platforms? I found https://github.com/cheatfate/asynctools but looks unmaintained
08:39:32FromDiscord<Elegantbeef> Sockets and binary formatters exist
08:40:38FromDiscord<Prestige> I just don't know anything about Windows, basically
08:40:56FromDiscord<Elegantbeef> Yea me either
08:41:14FromDiscord<Elegantbeef> I'm simple and would just bank on sockets
08:42:00FromDiscord<Elegantbeef> Your favourite binary format designed for IPC and sockets seems fine to my small brain
08:44:35FromDiscord<Elegantbeef> For reference i'm talking about protobuf or similar 😄
08:45:28FromDiscord<demotomohiro> ipc means inter process communication?
08:45:35FromDiscord<Elegantbeef> Yes
08:46:21FromDiscord<demotomohiro> You can use pipe or sockets for ipc on both windows and linux.
08:46:30FromDiscord<Prestige> Neat
09:23:06FromDiscord<jmgomez> In reply to @Elegantbeef "That's what i figured": hey in case you are interested we dramatically reduced the compilation times by using PCH. It was a pain to setup though. But in case anyone runs into a similar issue
09:23:28FromDiscord<Elegantbeef> PCH?
09:23:41FromDiscord<jmgomez> Precompiled Headers
09:28:05*h00k_ joined #nim
09:31:21FromDiscord<Xzayler> What are the main use cases for enums? I'm trying to understand where using enums would be easier than using just a standard variable.↵Like if I had a value `currentMonth`, which I only want to be a string of the name of the current months
09:31:45FromDiscord<Elegantbeef> Enums are really just a fixed set of named integers
09:31:46FromDiscord<Xzayler> what would be the advantage of using an enum to assign the current month, over just assigning the value
09:32:12FromDiscord<Elegantbeef> The benefit is that it's very data/cpu efficient to use enums
09:32:19FromDiscord<Rika> And if you assign an arbitrary string value like Marchuary or something?
09:32:19FromDiscord<Elegantbeef> And it's 10000% less error prone
09:32:31FromDiscord<jmgomez> besides the size the most important part for me is that it's a closed set
09:33:54FromDiscord<Xzayler> In reply to @Rika "And if you assign": Ah so that would give an error at compile time, right?
09:34:24FromDiscord<Elegantbeef> Compile time if you do it with literals and at runtime you'd get a parsing error
09:35:35FromDiscord<Xzayler> I don't really understand how enums are more resource efficient but I'll trust you guys on it :D.↵I do see now how it would be safer and more practical though. Thank you
09:35:47FromDiscord<Elegantbeef> They're integers
09:36:49FromDiscord<Rika> In reply to @Xzayler "I don't really understand": They don’t store the string value for every enum value, only once for conversions
09:36:49FromDiscord<Elegantbeef> Copying them or mutating them just changes an integer whereas with a string a copy/growth will be done
09:36:56FromDiscord<Rika> Internally represented as integers
09:39:02FromDiscord<Xzayler> Ah ok that makes sense
09:54:52FromDiscord<Phil> In reply to @Xzayler "I don't really understand": For example "Quest State" is a really good enum. A quest can either be started, finished or on hold.↵You can represent this with a string, but that string or an integer and say "1 means finished, 2 means started, 3 means on hold" or something like that, but that gives the possibility of there being a wrong value, like somebody could throw in a 4 or the string could have the value "potat
09:55:25FromDiscord<Phil> In that sense, enums forbid "wrong" values when you have a defined amount of values a variable can have
09:55:59FromDiscord<Phil> (edit) removed "string, but that"
09:58:16FromDiscord<Xzayler> Yeah, my thinking was that if a wrong value is provided, I messed up and it would have to be fixed anyways.
09:58:32FromDiscord<Phil> Yeh, but this way you notice it at compile time and not at runtime
09:58:37FromDiscord<Xzayler> But it's better to find out earlier
09:58:39FromDiscord<Xzayler> yeah exactly
09:58:40FromDiscord<Phil> and in the future other people might have to read your code
09:59:02FromDiscord<Phil> and with an enum you make it very explicit which values you expect to be possible, making it harder to overlook one
09:59:04FromDiscord<Xzayler> In reply to @Isofruit "*and* in the future": God have mercy on their souls..
09:59:22FromDiscord<Xzayler> In reply to @Isofruit "*and* with an enum": yeah I started implementing them and they even help me
09:59:25FromDiscord<Phil> In reply to @Xzayler "God have mercy on": I've written a decent amount of bioinformatics code, I know that pain
09:59:50FromDiscord<Xzayler> I'm not making anything complicated, I'm just a newbie and messy
10:00:22FromDiscord<Phil> In terms of coding: Believe me, so are most bioinformaticians
10:01:19FromDiscord<Phil> I've had to read code of people that intentionally used variables like "a" "b" "c" "d" etc. everywhere simply because it was shorter, no need for long variable names that would tell you what "a" even is
10:02:55FromDiscord<Phil> I wonder, can you enforce that a case statement has to cover all possibilities of an enum?
10:03:13FromDiscord<Phil> (edit) "I wonder, can you enforce that a case statement has to cover all possibilities of an enum? ... " added "(Instead of just having else)"
10:04:25FromDiscord<Phil> Because I'd actually like it if I expand an enum that all my case statements start complaining that I need to cover another possibility
10:04:35FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3ZXK
10:05:38FromDiscord<jmgomez> Notice how the last From has the To value also
10:06:11FromDiscord<Phil> So you have no value within "varToTo" ever?
10:06:47FromDiscord<jmgomez> It seems like it gets removed after the assignment
10:07:28FromDiscord<Phil> Cstrings are value types, right? I keep forgetting that one.
10:07:48FromDiscord<Phil> Wait, yes of course they are
10:08:00FromDiscord<Phil> Ugh I need lunch
10:08:23FromDiscord<jmgomez> so are they supposed to be copied? or is the first char only copied?
10:09:43FromDiscord<Rika> In reply to @Isofruit "Because I'd actually like": Just don’t have an else
10:10:14FromDiscord<Phil> Nice!
10:10:16FromDiscord<Rika> You can’t have an else anyway if you cover all possibilities I think
10:11:08FromDiscord<Phil> In reply to @Xzayler "I'm not making anything": So there you have it, another benefit is that when you use case statements on a variable that contains an enum, you can make sure you cover what needs to happen for all possible values. You'll get a compile-time error if you forget to cover what should happen for any of the possible enum values
10:11:35FromDiscord<Phil> In reply to @jmgomez "so are they supposed": I'll try to find some docs on cstrings just to make double sure, but in my head they should be copied
10:11:42FromDiscord<Phil> (edit) "In reply to @jmgomez "so are they supposed": I'll try to find some docs on cstrings just to make double sure, but in my head they should be copied ... " added "fully"
10:12:10FromDiscord<dom96> `cstring` is `ptr char`
10:12:24*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:12:50FromDiscord<Phil> Shit, so its a ref type
10:13:25FromDiscord<dom96> An unsafe ref type. You're better off not using it, or using it very carefully if you must do so for C FFI
10:14:24FromDiscord<dom96> And yeah, it looks like in that example you are returning a pointer to a string which gets deallocated once `dateTimeToCstring` exits
10:14:54FromDiscord<Phil> Doesn't the compiler notice there's a pointer to that string in existance and thus avoid deallocating?
10:15:13FromDiscord<dom96> nope
10:15:26FromDiscord<Phil> Hmmm would that issue be solved by dereferencing the cstring?
10:15:49FromDiscord<Phil> Wait, I have a playground project, might as well play around
10:15:55FromDiscord<dom96> You need to tell the GC explicitly not to dealloc it: https://nim-lang.org/docs/system.html#GC_ref%2Cstring
10:16:32FromDiscord<Phil> Ohhh wait that example doesn't compile locally, nevermind
10:16:42FromDiscord<jmgomez> In reply to @dom96 "You need to tell": ohh I see. Thanks. So then I have to manually deallocate the cstring?
10:17:13FromDiscord<jmgomez> maybe in a destructor on TokenFFI?
10:17:17FromDiscord<dom96> well, first, why are you returning a cstring at all?
10:17:27FromDiscord<dom96> why not a string?
10:17:38FromDiscord<jmgomez> because I have to use it outside of Nim
10:17:45FromDiscord<dom96> okay, good
10:17:54FromDiscord<Phil> Can you do the conversion just before you move that variable outside?
10:18:21FromDiscord<dom96> You can either `GC_ref` the string then return a pointer to it
10:18:38FromDiscord<dom96> or alloc some memory and copy the string in there, then return a pointer to that
10:18:48FromDiscord<jmgomez> In reply to @Isofruit "Can you do the": Im doing that already, this is just a repro of a bug. On the other side I fix it by copying the string
10:19:00FromDiscord<Phil> Ah, check
10:19:01FromDiscord<Phil> hm
10:19:17FromDiscord<jmgomez> In reply to @dom96 "or alloc some memory": Ok, that sound good
10:29:06FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3ZXR
10:29:24*PMunch joined #nim
10:30:25FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=3ZXR" => "https://play.nim-lang.org/#ix=3ZXS"
10:31:14FromDiscord<Phil> sent a code paste, see https://paste.rs/t5I
10:31:33FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3ZXU" => "https://play.nim-lang.org/#ix=3ZXT"
10:32:03FromDiscord<Rika> Size of a c string is pointer size
10:32:05FromDiscord<jmgomez> I changed the last line, to deref the cstring
10:32:10FromDiscord<Rika> Did you mean size of character
10:32:17FromDiscord<jmgomez> 8, right?
10:32:31FromDiscord<Rika> 8 bytes? Size of returns byte count
10:32:52FromDiscord<Rika> I don’t know what you’re intending to do with the code
10:33:22FromDiscord<Rika> Alloc does not zero memory I believe
10:33:56FromDiscord<Rika> So in essence:↵You allocate 8 times the memory you need to store the data↵You don’t allocate zeroed memory
10:34:49FromDiscord<Phil> Reducing size by 216 bytes does seem to get rid of the strange characters
10:35:25FromDiscord<Rika> Then again actually, strings have an implicit last byte zero
10:35:44FromDiscord<Rika> But I think the code is shoddy in some way anyway
10:36:22FromDiscord<jmgomez> Well, first make it work then make it better, right?
10:39:06FromDiscord<Rika> Shoddy in the way that it doesn’t work
10:39:20FromDiscord<Rika> Sometimes to make something work you must make it better
10:39:31FromDiscord<jmgomez> ohh that I can tell, that's why Im asking 🙂
10:40:06FromDiscord<Rika> Yeah so change the size of part to get the size of a character instead then use alloc0 I think is what it’s called
10:41:26FromDiscord<Rika> Also the cast inside the copy should not have the addr in it I think, since the c string is already a pointer
10:41:30FromDiscord<Rika> And you want the data
10:41:41FromDiscord<Rika> Wait what
10:41:48FromDiscord<Rika> I’m confused
10:42:32FromDiscord<Rika> The last cast should cast into a cstring only, no pointer
10:42:44FromDiscord<Rika> Yeah this is very confusing wrt. Intent
10:43:33FromDiscord<jmgomez> yeah, that worked!!
10:45:15FromDiscord<jmgomez> To delete the memory only thing needed is to unalloc?
10:46:32FromDiscord<jmgomez> (edit) "unalloc?" => "dealloc?"
10:49:34FromDiscord<Xzayler> sent a code paste, see https://play.nim-lang.org/#ix=3ZXY
10:49:42FromDiscord<Xzayler> (edit) "https://play.nim-lang.org/#ix=3ZXY" => "https://play.nim-lang.org/#ix=3ZXZ"
10:49:57FromDiscord<Rika> In reply to @jmgomez "To delete the memory": I don’t know the name of the proc by memory but probably
10:50:18FromDiscord<Rika> In reply to @Xzayler "just jumping back to": $mon
10:50:37FromDiscord<Rika> Dollar sign to string-fit thing
10:50:44FromDiscord<Rika> I mean string-ify
10:51:38FromDiscord<Xzayler> perfect! thank you
10:53:37FromDiscord<jmgomez> In reply to @Rika "I don’t know the": cool, thank you for your help!
10:59:32NimEventerNew thread by Nimmy: Questions regarding async - How to display text while downloadFile(), see https://forum.nim-lang.org/t/9226
11:08:53*TakinOver quit (Ping timeout: 255 seconds)
11:09:44*jjido joined #nim
11:23:40*TakinOver joined #nim
11:24:57PMunch@jmgomez, I'd go with something like this: https://play.nim-lang.org/#ix=3ZYf
11:26:42PMunchHmm, well make that `size` a `str.len + 1`. I forgot that while refactoring
11:29:34FromDiscord<jmgomez> Nice! 👌🙏
11:39:40*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:52:33*jjido joined #nim
11:55:03*jjido quit (Client Quit)
13:07:09*pro joined #nim
14:02:11FromDiscord<abdu> sent a long message, see https://paste.rs/KF8
14:04:27FromDiscord<demotomohiro> Nim optimize code when `-d:release` option was used.
14:06:35FromDiscord<demotomohiro> Nim doesnt optimize your code when `-d:release` or `-d:danger` was not specified. But it compiles code faster.
14:08:50PMunchSo compile without the option while debugging to get better error messages and faster compilation speed. But once you're done and want to build a faster version with less debug stuff in it use -d:release or -d:danger
14:23:47*pro quit (Quit: pro)
14:26:10NimEventerNew thread by Mardiyah: Apologize on not Nim but is to knowing C directive, see https://forum.nim-lang.org/t/9227
14:33:38FromDiscord<abdu> ok
14:36:55FromDiscord<Phil> In reply to @abdu "What differences `$ nim": Arbitrary sidenote, if you work on a larger project with multiple module files that you import, you might want to also use `-d:lto` (if you use gcc) or `--passL:-flto` (if you use clang). Makes it take significantly longer to compile, but the binary the comes out is slightly faster
14:52:38*jjido joined #nim
15:15:00FromDiscord<Not Saucx> Anyone know good IDE for Nim?
15:15:18FromDiscord<Not Saucx> I like IntelliJ products however I’m not sure if it has good nim support
15:16:04FromDiscord<jmgomez> It isnt because it doesnt use NimSuggest. It works "well" for debugging though
15:16:21FromDiscord<jmgomez> I recommend VSCode
15:16:28FromDiscord<Not Saucx> Oh alr
15:16:56FromDiscord<Not Saucx> Speaking of, is there a library to interact with Minecraft? Java/Bedrock edition?
15:17:38FromDiscord<Not Saucx> Usually I test out new languages with mc
15:20:20FromDiscord<Phil> Huh...err, not sure, quite a specific usecase
15:21:09FromDiscord<demotomohiro> You can search for nim libraries here: https://nimble.directory/
15:21:23FromDiscord<Phil> Yeah, just did a check of what demo suggested, found https://nimble.directory/pkg/minecraftserverstatus
15:21:25FromDiscord<demotomohiro> https://github.com/xflywind/awesome-nim
15:21:52FromDiscord<Phil> And hypixel? Not sure what that is, is that an API minecraft uses?
15:29:08FromDiscord<uncle jim> i am finally back 🙂
15:42:06*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:57:47FromDiscord<Luckayla> Hypixel is a very large and popular server
15:57:56FromDiscord<Luckayla> Basically pushes the limits of what you can do without mods
16:04:20FromDiscord<huantian> Well it pushes the limits in some ways
16:04:43FromDiscord<huantian> You could easily argue that say wynncraft pushes the limits in other ways
16:21:09FromDiscord<jmgomez> Is there an option to tell nim to dont use any optimization at all?
16:23:50FromDiscord<jmgomez> Just found about opt
16:26:32FromDiscord<demotomohiro> Just run nim without `-d:release` or `-d:danger
16:29:34FromDiscord<jmgomez> It still do opts
16:29:38FromDiscord<jmgomez> That's why I asked
16:30:22FromDiscord<blashyrk> I've created a preliminary pull request for NLVM support on Mac 🙂 If anyone has a Mac and some spare time and would like to try it out or help with some testing: https://github.com/arnetheduck/nlvm/pull/35
16:33:15FromDiscord<jmgomez> In reply to @blashyrk "I've created a preliminary": I will, not Today but I will and will let you know
16:33:51FromDiscord<demotomohiro> What optimization nim does when `-d:release` or `-d:danger` is not set?
16:34:08Amun-Radanger turns all range checks off
16:34:29FromDiscord<jmgomez> Dont know, but at least in clang (I think g++ too) there is a predefined definition, OPTIMIZATIONS that's enabled if you dont do opt:none
16:34:45FromDiscord<jmgomez> sorry, OPTIMIZATION
16:35:01FromDiscord<jmgomez> aghh it has as prefix and suffix double underscore
16:39:03FromDiscord<Rika> `OPTIMIZATION`
16:39:10FromDiscord<Rika> use backticks
16:40:10FromDiscord<demotomohiro> I tested nim with/without `--opt:none` but clang (on termux on android) is called with same option.
16:41:00FromDiscord<jmgomez> check with a pragma if it's present
16:41:32FromDiscord<jmgomez> Im telling you because for PCHs to work you need to compile with (almost the same options) and that was one of the errors I had (at least in cpp is like that)
16:48:38FromDiscord<demotomohiro> I checked clang options with `--listcmd`. Maybe how Nim call clang is different on OS.
16:49:49Amun-Rayou can transpile to C code in both examples and compare results
16:49:59Amun-Ras/examples/cases/
16:50:16FromDiscord<demotomohiro> Do you see any optimization flags passed to clang when you use nim without `--opt:none`?
16:51:56FromDiscord<jmgomez> sent a code paste, see https://paste.rs/j2O
16:58:19FromDiscord<demotomohiro> nim prints backend c/cpp compiler options with `--listcmd` option.
17:05:06FromDiscord<jmgomez> https://media.discordapp.net/attachments/371759389889003532/985590580925059082/message.txt
17:07:34FromDiscord<jmgomez> (I also pass a bunch of compiler opts myself)
17:18:13FromDiscord<demotomohiro> Thank you.↵There is -O3 in "No Opt (it doesnt end the compilation)". It is a flag to enable optimization and it should be used only when `-d:release` or `-d:danger` is used.
17:19:51FromDiscord<demotomohiro> You set that option manually or change --opt option in nim.cfg/config.nims?
17:22:53FromDiscord<demotomohiro> If you set `-d:release` or `--opt` or in nim's config file, nim without options can do optimization and `--opt:none` disable optimization.
17:23:40FromDiscord<jmgomez> I did use it in the past, but when running that test was commented as it is now. Do you think it was somehow cached and opt:none forces no --Ox
17:23:40FromDiscord<jmgomez> ?
17:26:13FromDiscord<demotomohiro> `-f` option force rebuilding of all modules and nim doesn't use cache.
17:29:02FromDiscord<demotomohiro> When you run nim, it show paths of config files nim reads.↵So you can check all config files you wrote before.
17:31:39FromDiscord<demotomohiro> As far as I know, nim caches only generated .c/.cpp files and object files.
17:33:35*h00k_ quit (Quit: Konversation terminated!)
17:36:19*pro joined #nim
18:23:55FromDiscord<ambient> -d:danger makes my program twice as fast, -d:lto makes my program 10x as fast, cumulative compared to just -d:release is 20x 😅
18:24:27FromDiscord<Yardanico> :)
18:24:29FromDiscord<Yardanico> although that's rare
18:24:40FromDiscord<Yardanico> you can probably annotate some procs with inline to get it to be faster with -d:release even without lto
18:24:43FromDiscord<ambient> i wouldn't call complex inner loops that rare
18:24:57FromDiscord<ambient> I'll try that
18:25:06FromDiscord<ambient> although it's just a single function
18:25:52FromDiscord<ambient> @Yardanico i would say even a very simple function https://github.com/amb/nim_audiobook/blob/main/fft.nim#L27=
18:30:29FromDiscord<geekrelief> I'm using precompiled headers for vcc, I need to include a header file before nimbase.h in the stdlib.cpp files. Is there an option to emit code in those?
18:31:04*oprypin quit (Remote host closed the connection)
18:32:14*oprypin joined #nim
19:02:02FromDiscord<!Patitotective> is that the bug it warns of= https://media.discordapp.net/attachments/371759389889003532/985620006010237009/unknown.png
19:02:02FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4006
19:02:03FromDiscord<!Patitotective> (edit) "of=" => "of?"
19:03:25FromDiscord<ynfle> Probably
19:03:44FromDiscord<ynfle> For this example you can `echo name, ": ", field`
19:03:49FromDiscord<ynfle> But I assume you know that
19:03:56FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/ieU
19:04:18FromDiscord<!Patitotective> In reply to @ynfle "But I assume you": yea :[
19:04:19FromDiscord<ynfle> It's mostly because it doesn't know the type because it will be urolled
19:04:21FromDiscord<ynfle> (edit) "urolled" => "unrolled"
19:04:40FromDiscord<!Patitotective> In reply to @ynfle "It's mostly because it": name is not always string?
19:04:46FromDiscord<!Patitotective> (edit) "In reply to @ynfle "It's mostly because it": name is not always ... string?" added "a"
19:06:27FromDiscord<ynfle> sent a code paste, see https://paste.rs/try
19:08:05FromDiscord<!Patitotective> In reply to @ynfle "I get a different": it might be because `name` exists in `std/macros` https://nim-lang.org/docs/macros.html#name%2CNimNode
19:08:15FromDiscord<!Patitotective> (edit) "In reply to @ynfle "I get a different": it might be because `name` ... exists" added "already"
19:16:22FromDiscord<Prestige> Is there a way to spawn another instance of the current process at runtime?
19:17:24FromDiscord<!Patitotective> is there a way to echo an object without the field names?↵instead of `(x: 0, y: 0, z: 0)` echo `(0, 0, 0)`
19:18:05FromDiscord<Prestige> Maybe just write you own `$` proc for the object, then `echo $foo`
19:19:51FromDiscord<Prestige> or is there a way to invoke a function as another process? (not as a thread)
19:23:30Amun-Rafork?
19:28:12FromDiscord<!Patitotective> is there something like `when obj.isEnum`?
19:28:21FromDiscord<!Patitotective> maybe `when obj is enum`?
19:29:01FromDiscord<huantian> Does the latter not work?
19:29:09FromDiscord<!Patitotective> it does LOL
19:33:36*noeontheend joined #nim
19:37:20FromDiscord<eyecon> @mratsim once we had a discussion about the bigint solutions, of which you listed nim-stint (alloc-free, up to uint8192), arithmetic (alloc-free, fastest) and megalo (dynamic allocation). The first two being alloc-free also limits them to a specific size, right? So if I don't know the magnitude in advance, I cannot use them or would risk an overflow at runtime (even if the limit is sky-high). Anything wrong with my thoughts?
19:41:04FromDiscord<Hamid_Bluri> hey, seems like `nnkOpenSymChoice` doesn't have strval field
19:42:27*jjido joined #nim
19:55:18FromDiscord<Rika> a 1 kilobyte integer sounds pretty large to me
19:55:29FromDiscord<Rika> but yes
19:55:53FromDiscord<Rika> there is the risk; BUT it is also there for dynamic allocation
19:56:06FromDiscord<Rika> memory exhaustion is still a thing, depending on your use case
19:58:12FromDiscord<ynfle> In reply to @hamidb80 "hey, seems like `nnkOpenSymChoice`": You can use repr or `$`
20:18:07*wallabra quit (Ping timeout: 240 seconds)
20:19:20*wallabra joined #nim
20:21:16FromDiscord<Prestige> I'm attempting to use `process.atEnd` to see if there's any data to read, but it just hangs at this function call. Is there a better way to see if there's data available to read, that won't block?
20:51:58PMunchGet the file handle and use selectors?
20:55:18FromDiscord<Prestige> Like just use sockets?
20:58:01FromDiscord<Prestige> I'm currently spawning a child process, and just want to read lines output from the child process
20:58:30FromDiscord<Prestige> but I need to keep a loop going if there's no data output from the child process
21:26:18*PMunch quit (Quit: leaving)
21:48:54*pro quit (Quit: pro)
22:02:41*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:10:20*lumidify_ joined #nim
22:14:40*lumidify quit (*.net *.split)
22:38:23FromDiscord<ynfle> NO not sockets
22:38:30FromDiscord<ynfle> no
22:44:14*noeontheend quit (Ping timeout: 244 seconds)
22:45:51*noeontheend joined #nim
22:45:53FromDiscord<!Patitotective> how do i format a float to remove the numbers after the point?↵`&"{123.32:.0f} == "123."` i want `"123"`
22:46:36FromDiscord<Elegantbeef> If you just want the whole value do `$int(myFloat)`
22:46:42FromDiscord<Yardanico> In reply to @Patitotective "how do i format": the simplest is actually https://nim-lang.org/docs/strutils.html#trimZeros%2Cstring%2Cchar if you have the string already
22:47:20FromDiscord<!Patitotective> thanks :]
22:57:27NimEventerNew thread by Cmc: Announce: at, a tool to run code later, see https://forum.nim-lang.org/t/9228
22:58:59*noeontheend quit (Ping timeout: 255 seconds)
23:02:55*krux02 quit (Remote host closed the connection)
23:05:17*vicecea quit (Remote host closed the connection)
23:05:48*vicecea joined #nim
23:09:55*krux02 joined #nim
23:11:13*gsalazar quit (Ping timeout: 256 seconds)
23:11:16FromDiscord<dom96> In reply to @ynfle "NO not sockets": sockets are wonderful
23:17:19FromDiscord<exelotl> Hey, I found a forum post of mine which doesn't render because I wrote `-` when I should have written `--------------`. But I don't have permission to edit it because it's too old :(
23:17:26FromDiscord<exelotl> https://forum.nim-lang.org/t/5192#32574
23:24:35FromDiscord<exelotl> And another one here which needs blank lines between "Result" and \`\`\` (two occurrences): https://forum.nim-lang.org/t/7827#49696
23:24:58FromDiscord<Elegantbeef> I think you can ping moderators and they can edit it
23:25:06FromDiscord<Yardanico> nope, moderators can't edit, only admins
23:25:13FromDiscord<Elegantbeef> lol
23:25:13FromDiscord<Yardanico> = dom and araq
23:27:45FromDiscord<abdu> sent a long message, see https://paste.rs/YyZ
23:28:09FromDiscord<Elegantbeef> You import them using the `dynlib` pragma and call the procedures
23:29:13FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/wrappers/pcre.nim
23:29:26FromDiscord<demotomohiro> It seems there is breaking change in rst module and some text that was valid become invalid now. So some old forum post cannot be rendered. How about to render raw text instead of error message if parsing old post failed?
23:31:56FromDiscord<exelotl> yeah, that would be good
23:40:47FromDiscord<dom96> yeah, this sucks. Fixed those for you
23:43:50FromDiscord<abdu> ok
23:48:57*djanatyn1 is now known as djanatyn