<< 04-10-2020 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:00:43*junland joined #nim
00:02:05*a_chou quit (Ping timeout: 240 seconds)
00:27:51*Mortir quit (Quit: leaving)
00:38:12*NimBot joined #nim
00:47:16FromDiscord<iWonderAboutTuatara> pretty sure $ can cast a char to a str
00:47:30FromDiscord<iWonderAboutTuatara> oh wait nevermind, I misread
01:04:22PrestigeWhat's the point of initDoublyLinkedList when you can just use DoublyLinkedList[T]()? The proc is empty
01:04:28Prestigehttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/lists.nim#L145
01:04:38disruptekit might have a role in the future.
01:04:45Prestigeah good point
01:07:56PrestigeReason I'm asking is because of this example: https://play.nim-lang.org/#ix=2zEv
01:08:28PrestigeI was attempting to create the list as a var and assign result.bar = ref myList, but it is incorrect
01:10:12PrestigeSomething like this: https://play.nim-lang.org/#ix=2zEx not sure what I'm missing
01:10:16*a_chou joined #nim
01:14:19*vicfred joined #nim
01:45:25*apahl quit (Ping timeout: 240 seconds)
01:46:27*apahl joined #nim
01:46:38FromDiscord<exelotl> when I make a set[range[0..2047]], it produces an array of 256 u8 under the hood
01:46:59FromDiscord<exelotl> is there a way to make it produce an array of 128 u16s instead ?
01:50:18FromDiscord<exelotl> I tried applying {.size:2.} to the set itself, this results in the set becoming a single u16 which is no good x)
01:56:11FromDiscord<Rika> I do not think so, and I do not see the benefit to doing so
02:05:08*lritter joined #nim
02:06:15FromDiscord<exelotl> admittedly I haven't looked at the asm so it might make no difference, but basically I'm working with a region of memory that prefers 16-bit access (8 bit access is no faster or slower, but I guess more likely to require extra shifts/masking)
02:08:00FromDiscord<exelotl> Probably the more important one would be when working with memory that prefers 32 bit access. Since the GBA has a 32 bit CPU, if I could have a set backed by an array of u32s, that would be way preferable because the values wouldn't require any shifting/masking at all.
02:42:11*user0 joined #nim
02:44:32*user0 quit (Client Quit)
02:53:25*muffindrake quit (Ping timeout: 240 seconds)
02:55:50*muffindrake joined #nim
03:18:42FromDiscord<shashlick> does travis-ci allow testing on alpine? without docker?
03:24:39FromDiscord<Avatarfighter> Whats the best way of turning a seq of bytes to a string?
03:25:41FromDiscord<Elegant Beef> Should be able to cast to string
03:26:16FromDiscord<Avatarfighter> ok that's what I thought lmao
03:26:38FromDiscord<Avatarfighter> i definitely didn't iterate through the string and do `result = result & chr(b)`
03:26:54FromDiscord<Avatarfighter> through the seq of bytes I mean
03:28:36FromDiscord<Avatarfighter> goddamn sometimes i write the ugliest looking code
03:31:16FromDiscord<shashlick> why not just cast to cstring and use $
03:32:53FromDiscord<Avatarfighter> well one reason is because I didn't think of that
03:33:44FromDiscord<Elegant Beef> !eval let a = @['h'.byte,'e'.byte, 'l'.byte, 'l'.byte, 'o'.byte]; echo cast[string](a)
03:33:48NimBothello
03:34:03FromDiscord<Avatarfighter> well uhm
03:34:14FromDiscord<Avatarfighter> i guess i can push my homemade crypto to github now 🙂
03:34:22FromDiscord<PizzaFox> isnt the `.byte` for the 1-4th items unnecessary @Elegant Beef
03:34:32FromDiscord<Elegant Beef> Nope no implict conversion from char to byte
03:34:40FromDiscord<PizzaFox> sad
03:34:52FromDiscord<Elegant Beef> I mean it takes 2 seconds to implement but i didnt want to
03:35:25FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2zES
03:35:26FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2zER
03:35:29FromDiscord<Elegant Beef> Implementation 😛
03:35:59FromDiscord<PizzaFox> (edit) 'https://play.nim-lang.org/#ix=2zES' => 'https://play.nim-lang.org/#ix=2zET'
03:36:15FromDiscord<Elegant Beef> I dont know anything about Peg, but i think NPeg is pretty nice from my ears listening here 😄
03:36:27FromDiscord<PizzaFox> (edit) 'https://play.nim-lang.org/#ix=2zET' => 'https://play.nim-lang.org/#ix=2zEU'
03:36:39FromDiscord<PizzaFox> its nicer than figuring out the nim regex implementations lol
03:36:55FromDiscord<Elegant Beef> Nim's regex is just PCRE
03:36:55FromDiscord<PizzaFox> although my peg code doesnt work and the regex code kinda worked so
03:37:05FromDiscord<PizzaFox> yeah but nre vs re
03:37:24FromDiscord<PizzaFox> if i were a nim developer i would simply create a single regex lib
03:37:25FromDiscord<Elegant Beef> I briefly looked at npeg, and went "yep i understand some things"
03:38:27leorize@PizzaFox have you heard of nim-regex? :P
03:38:27*muffindrake quit (Ping timeout: 240 seconds)
03:38:30leorize!repo regex
03:38:31disbothttps://github.com/nitely/nim-regex -- 9nim-regex: 11Pure Nim regex engine. Guarantees linear time matching 15 96⭐ 13🍴 7& 9 more...
03:38:45FromDiscord<PizzaFox> listen dude
03:38:51FromDiscord<PizzaFox> i just want to make my peg snippet work
03:39:53leorizeso you wanna match everything but whitespace?
03:40:07leorizeactually I'm not that well versed in regex lol
03:40:23FromDiscord<PizzaFox> `\w` in both nim builtin PEGs and regex is `[0-9A-Z_a-z]`
03:40:33leorizeis this dash (-) or whitespace?
03:40:34FromDiscord<PizzaFox> i want to match that + the hypen `-`
03:40:38leorizeah ok
03:40:51FromDiscord<PizzaFox> peg is mad because i cant put a `\w` in the `[]`
03:41:17FromDiscord<PizzaFox> surely there is a solution
03:41:34leorizejust use an ordered choice?
03:41:41FromDiscord<PizzaFox> wat
03:41:49leorizeso `'-' / \w`?
03:41:58FromDiscord<PizzaFox> > Apply expressions A, ..., Z, in this order, to the text ahead, until one of them succeeds and possibly consumes some text.
03:42:08FromDiscord<PizzaFox> this would work i think??
03:42:39FromDiscord<PizzaFox> ```nim↵peg"(\w / \-)"↵[\-0-9A-Z_a-z] == type Peg↵```
03:42:49FromDiscord<PizzaFox> seems legit
03:43:33FromDiscord<PizzaFox> it is in fact legit
03:43:42FromDiscord<PizzaFox> thanks
03:44:03FromDiscord<Avatarfighter> leorize: remember that cryptography you helped me convert a month or 6 back ?
03:44:12leorizeyes?
03:44:44FromDiscord<Avatarfighter> Do you know if its wise to put it on gitub?
03:44:48FromDiscord<Avatarfighter> github*
03:45:01FromDiscord<Elegant Beef> Why wouldnt it be? 😄
03:45:03leorizewhy not? lol
03:45:10FromDiscord<Avatarfighter> ok
03:45:35FromDiscord<Avatarfighter> oo this is going to be fun i get to write disclaimers in the readme lmao
03:45:54FromDiscord<Avatarfighter> "written by a high schooler that barely passed algebra" "not for production"
03:46:58FromDiscord<Elegant Beef> I mean if you're using a cryptography library, i'd wager you'd want to audit it 😄
03:47:04FromDiscord<Avatarfighter> pshhh
03:47:05FromDiscord<Avatarfighter> auditing
03:47:17FromDiscord<Elegant Beef> MIT removes liabaility
03:47:26FromDiscord<Avatarfighter> smart
03:47:30FromDiscord<Avatarfighter> MIT license it is
03:50:11leorizeevery oss license does that tbh
03:50:32FromDiscord<Avatarfighter> honestly ill just live on the edge and not put a license
03:51:12leorizeremember to keep the copyright of the people who wrote the original
03:51:31FromDiscord<Avatarfighter> oh god
03:51:43FromDiscord<Avatarfighter> do i do the copyright of the js library or the library the js library was based off of?
03:51:57leorizeof the part you translated
03:52:10FromDiscord<Avatarfighter> ok
03:52:10FromDiscord<Avatarfighter> hm
03:52:28FromDiscord<Avatarfighter> well i kind of started with the js library and then you helped me fix the c library i continuedd with
03:52:50leorizethe js is made from the c
03:52:58FromDiscord<Avatarfighter> oh
03:52:59FromDiscord<Avatarfighter> ok
03:53:01leorizeso the js should have all the copyrights you need
03:53:02FromDiscord<Avatarfighter> C lib it is lmao
03:53:09FromDiscord<Avatarfighter> honestly I'll cross that bridge when I get there
03:54:54FromDiscord<Avatarfighter> gn everyone enjoy
03:57:48*a_chou quit (Quit: a_chou)
03:58:37FromDiscord<shashlick> do people usually stick with busybox on alpine or install tools like findutils
04:03:22*Jesin quit (Ping timeout: 258 seconds)
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:37*supakeen joined #nim
04:07:08*waleee-cl quit (Quit: Connection closed for inactivity)
04:29:42*stever quit (Read error: Connection reset by peer)
04:29:52*stever joined #nim
04:30:15*ormiret quit (Read error: Connection reset by peer)
04:30:26*ormiret joined #nim
04:30:55*thomasross quit (Ping timeout: 240 seconds)
04:45:48*hoek quit (Ping timeout: 256 seconds)
04:48:00*hoek joined #nim
04:51:41FromDiscord<PizzaFox> npeg making my brain turn into soup
04:52:36FromDiscord<PizzaFox> i have the regex↵```↵\/(.+)\/?$↵```
04:52:50FromDiscord<PizzaFox> for matching urls (ex. `/path/`)
04:52:55FromDiscord<PizzaFox> (edit) 'urls' => 'url segments'
04:53:32FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2zFh
04:54:44FromDiscord<PizzaFox> however, npeg is being annoying and so i need to specify the `+1` (1 or more of any char) as being 1 or more of not `/`
05:23:51*solitudesf joined #nim
05:24:31FromDiscord<PizzaFox> it turns out i dont even need to use regex for any of this i can just split on `/` i am an idiot
05:24:41FromDiscord<PizzaFox> i have spent easily 4+ hours writing this parsing code
05:33:55*wowi42 quit (Quit: Kowa Bunga!!!)
05:36:01*wowi42 joined #nim
05:40:25*leorize quit (Quit: WeeChat 2.9)
05:51:59*narimiran joined #nim
06:02:00*Jesin joined #nim
06:06:55*vqrs quit (Ping timeout: 272 seconds)
06:08:12*vqrs joined #nim
06:31:16FromDiscord<iWonderAboutTuatara> Hey, is there any way to compile to C and view the C code in a .c file?
06:31:21FromDiscord<iWonderAboutTuatara> or cpp, doesn't matter
06:31:26FromDiscord<iWonderAboutTuatara> stdin breaks when I compile to js
06:31:31FromDiscord<iWonderAboutTuatara> and I need to submit to codeforces
06:36:09FromDiscord<iWonderAboutTuatara> nothing on the internet is giving me a good cout
06:46:11*apahl quit (Ping timeout: 272 seconds)
06:46:40*apahl joined #nim
06:51:22FromDiscord<Elegant Beef> Nim does output the C into a temp directory located in `~/.cache/nim` but i believe can also tell the compiler to export C to a specific path iirc
06:53:33FromDiscord<iWonderAboutTuatara> how?
06:54:39FromDiscord<Elegant Beef> `--nimcache:` although it creates a lot of mess so be cautious 😄
06:54:45FromDiscord<Elegant Beef> Put it in a folder 😄
06:56:26*Vladar joined #nim
07:00:11FromDiscord<iWonderAboutTuatara> I found it in ~.cache/nim!
07:00:19FromDiscord<iWonderAboutTuatara> Completely unreadable, but nbd
07:02:16FromDiscord<iWonderAboutTuatara> wow this is not readable
07:02:18FromDiscord<iWonderAboutTuatara> like at all
07:02:27FromDiscord<iWonderAboutTuatara> not a huge deal, but like
07:02:39FromDiscord<iWonderAboutTuatara> Is this size more size efficient than "normal" c?
07:03:00FromDiscord<iWonderAboutTuatara> like haxe output is not readable, but this is another level
07:03:06*opal quit (Remote host closed the connection)
07:03:41PrestigeI don't think that's the intent :P
07:05:17FromDiscord<iWonderAboutTuatara> true
07:05:26FromDiscord<iWonderAboutTuatara> ah codeforces says compile error
07:05:36FromDiscord<iWonderAboutTuatara> no idea what to do about that
07:05:42FromDiscord<iWonderAboutTuatara> seems like some deps are missing? not sure
07:05:55FromDiscord<iWonderAboutTuatara> ```Can't compile file:↵program.c:11:21: fatal error: nimbase.h: No such file or directory↵compilation terminated.```
07:09:19FromDiscord<iWonderAboutTuatara> wait what is this?
07:09:34FromDiscord<iWonderAboutTuatara> ```nim↵var↵ x : int```
07:09:42FromDiscord<iWonderAboutTuatara> throws me an error saying tabs are not allowed?
07:11:57FromDiscord<iWonderAboutTuatara> yet if i copy paste from another file it works...
07:15:28supakeenSet your editor to visually show you tabs/spaces, it'd be easier to see.
07:15:30FromDiscord<iWonderAboutTuatara> ok, i rmed it and cped to make it again, and it works completely fine now
07:15:37FromDiscord<iWonderAboutTuatara> how do I set this?
07:15:44FromDiscord<iWonderAboutTuatara> It was defaulting to that after entering var
07:21:28*nature joined #nim
07:21:45supakeenI don't know every editor.
07:21:56supakeenBut most can do so, in vim it's `:set list`.
07:23:45FromDiscord<Elegant Beef> @iWonderAboutTuatara what editor?
07:33:07ZevvPizzaFox: zup, npeg troubles?
07:33:35Zevvit turned my brain into soup
07:34:09FromDiscord<Elegant Beef> Glad it's not abnormal
07:41:42FromDiscord<iWonderAboutTuatara> vsc
07:41:57FromDiscord<iWonderAboutTuatara> it was a one off bug, never had an issue with this before
07:42:18FromDiscord<Elegant Beef> Yea you can force it to use spaces if so needed
07:46:10FromDiscord<iWonderAboutTuatara> I prefer tabs
07:46:28FromDiscord<iWonderAboutTuatara> I've always used tabs
07:48:49FromDiscord<Elegant Beef> I also prefer tabs, but to support lack of unanimous editor support for customizing the size of tabs we get spaces 😄
07:49:21FromDiscord<Elegant Beef> you *can* use source code filters to replace tabs with spaces though
07:53:05*vicfred quit (Quit: Leaving)
08:01:58supakeenCan I mark a testcase as expected to fail?
08:06:00*letto quit (Read error: Connection reset by peer)
08:06:44*letto joined #nim
08:11:30*opal joined #nim
08:20:24ForumUpdaterBotNew thread by Mantielero: Nimqml's abstractitemmodel example is unclear to me, see https://forum.nim-lang.org/t/6888
09:08:39*ldlework quit (Read error: Connection reset by peer)
09:09:48*ldlework joined #nim
09:13:01*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:20:05*rusua_ joined #nim
09:21:31*rusua_ is now known as rusua
09:27:37*arecacea1 quit (Ping timeout: 240 seconds)
09:28:27*narimiran quit (Ping timeout: 240 seconds)
09:28:53*natrys joined #nim
09:28:59*narimiran joined #nim
09:30:39*arecacea1 joined #nim
09:33:00FromDiscord<whisperdev> ughh i found out my nim code is 5 - 6 times slower than a powershell commandlet
09:33:00*d10n-work quit (Ping timeout: 240 seconds)
09:34:12*d10n-work joined #nim
09:34:59*ForumUpdaterBot quit (Remote host closed the connection)
09:35:06*ForumUpdaterBot joined #nim
09:37:45FromDiscord<Vindaar> then you're probably doing something really inefficient (and compile in debug mode I assume?)
09:41:03FromDiscord<whisperdev> or microsoft can write optimized commandlets 😄
09:42:04FromDiscord<Vindaar> what are you using it for?
09:43:01*lritter quit (Quit: Leaving)
09:44:20FromDiscord<whisperdev> Vindaar: This http://www.codersource.net/2010/02/16/enumservicesstatus-enumerate-nt-services/
09:44:27FromDiscord<whisperdev> And the Nim code looks pretty much the same
09:49:41FromDiscord<Vindaar> wow, perfect example why braces are inferior. What's so hard about indenting stuff, so that it's actually readable? ↵Can you share your Nim code? Not that I'd be any help though, given that Windows and it's API for this sort of stuff is completely out of my area of expertise. I wouldn't be surprised if the bottleneck here is just Windows providing the results here. But again, I'm clueless in this
09:54:47*apahl quit (Ping timeout: 240 seconds)
09:55:23*narimiran quit (Ping timeout: 265 seconds)
09:55:55*apahl joined #nim
10:04:54*gangstacat_ joined #nim
10:08:15*gangstacat quit (Ping timeout: 240 seconds)
10:08:15*letto quit (Ping timeout: 240 seconds)
10:08:15*letto joined #nim
10:11:35*muffindrake joined #nim
10:33:16*JustASlacker joined #nim
10:39:18FromDiscord<iWonderAboutTuatara> I cannot look at that code holy crap
10:39:27FromDiscord<iWonderAboutTuatara> Worse than latex
10:39:44FromDiscord<iWonderAboutTuatara> This is why curly braces bad
10:40:13FromDiscord<iWonderAboutTuatara> Like sure, you might be more used to it, but this is too much
10:57:44*JustASlacker quit (Ping timeout: 272 seconds)
10:59:33FromDiscord<lqdev> hm, i wonder if box2d can be wrapped trivially using c2nim
11:03:37*sagax joined #nim
11:07:21supakeendom96: If we're going to debate names it's probably better to do it here? I suggest 'parseHeaderField' since it returns both field-name and field-value :)
11:11:18Zevvping leorize[m]1
11:13:19federico3can somebody clean up issues phrased like https://github.com/nim-lang/needed-libraries/issues/91 please?
11:13:19disbotAre we Rested?
11:17:09FromDiscord<Yardanico> lol
11:17:24FromDiscord<Yardanico> are we oxidised yet?
11:17:35FromDiscord<Yardanico> are we biblified yet?
11:17:37Zevvhow does this make sense? http://ix.io/2zGz
11:17:44ZevvWhy does my `==` get passed 3 arguments?
11:18:15Zevvooh wait daang
11:19:12Zevvignore zevv plz
11:19:53FromDiscord<Rika> ok
11:20:16supakeenok
11:21:26*waleee-cl joined #nim
11:22:28FromDiscord<Yardanico> okno
11:22:34FromDiscord<Rika> ok go
11:22:38FromDiscord<Yardanico> Means window in Russian
11:22:40FromDiscord<Yardanico> окно
11:22:45FromDiscord<ache of head> in polish too
11:23:01FromDiscord<Yardanico> dobre
11:23:04FromDiscord<ache of head> haha
11:25:22supakeenэто не проблема
11:25:31FromDiscord<Yardanico> mundainai
11:25:40FromDiscord<Yardanico> Means what you said in Russian, but in Japanese
11:25:52FromDiscord<Yardanico> Sorry mondai nai*
11:26:01supakeenI don't know, the letters don't look very Japanese to me.
11:26:07FromDiscord<Yardanico> romanji
11:26:42FromDiscord<Yardanico> everyone is relaxing on this fine sunday?
11:26:46FromDiscord<Yardanico> almost no activity :)
11:26:57supakeenWorking on some PRs but otherwise a nice rainy day in.
11:27:22supakeenHow's stuff there?
11:27:37FromDiscord<Yardanico> it's sunny outside, but 11 celcius
11:27:58FromDiscord<Yardanico> normal temperature for this time of the year in my region
11:28:18supakeenAt least something is normal in 2020.
11:28:31FromDiscord<Yardanico> haha
11:29:02supakeenWe've got a storm picking up: https://i.imgur.com/JoKEBJI.png
11:47:49FromDiscord<Yardanico> Randomly (I swear) stumbled upon this
11:47:51FromDiscord<Yardanico> https://forum.dlang.org/post/[email protected]
12:02:35FromDiscord<Recruit_main707> i dont get Araq's latest rfc, whats the difference between `cast(noSideEffect)` and `noSideEffect`?
12:03:45Yardaniconewer syntax is easier to search for in files
12:03:47Yardanicoand easier to understand
12:04:04Yardanicoyou see, right now {.noSideEffect.} can be used both as an annotation for the proc and as an annotation for a code block
12:04:38Yardanicoand if in the first case it means "proc has no side effects", in the second one it means "compiler, I say to you that this code block has NO side effects, and you must obey!"
12:04:49supakeenPoor compiler.
12:05:01Yardanicoso there are two exactly opposite meanings depending on the location of the pragma
12:05:08Yardanicosame goes for others like gcsafe
12:05:16FromDiscord<Recruit_main707> i see
12:05:21FromDiscord<Recruit_main707> makes sense now
12:05:24FromDiscord<Recruit_main707> thank you
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:34*supakeen joined #nim
12:06:36FromDiscord<lqdev> how can i wrap virtual procs from c++?
12:07:14FromDiscord<lqdev> iirc there was an article about this somewhere
12:08:06Yardanicoyes
12:08:13Yardanico10 secs
12:08:45Yardanicoor a bit more
12:08:58Yardanicohttps://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim
12:09:18Yardanicobasically you just make an array of proc pointers in Nim
12:10:07FromDiscord<Recruit_main707> this could be worth it when we get default values
12:15:40supakeenMrm, is there a way to make a type generic?
12:15:44Yardanicoyes
12:15:47*jjido joined #nim
12:15:52Yardanicotype MyType[T] = object myfield: T
12:15:59supakeenPerfect.
12:16:20Yardanicoyou don't even have to use T in your object fields, but then you'll have to specify T explicitly any time you instantiate the type
12:17:31supakeenNo this is perfect, I'm implementing a bunch of LCGs and some are uint64 others are int32, etc.
12:22:36supakeenhttps://github.com/supakeen/simba/blob/master/src/simba/lcg.nim seems to work fine :)
12:24:31FromDiscord<Recruit_main707> do you need to add all the 'u32 even when specifying the type before?
12:25:22FromDiscord<Recruit_main707> yep, apparently you need to
12:51:31Yardanicowhere exactly?
13:00:23FromDiscord<flywind> ```nim↵const useWinVersion = defined(Windows) or defined(nimdoc)↵```
13:00:33Yardanicodefined(windows) :)
13:00:44FromDiscord<flywind> This line makes it hard to build docs in `linux`.
13:00:46*natrys quit (Quit: natrys)
13:00:50Yardanicodoes it?
13:01:20Yardanicoit's here because docs should look the same for linux and windows and other platforms
13:01:22FromDiscord<Rika> i dont see why the nimdoc portion should be there
13:01:29Yardanicobecause docs are the same anyway
13:01:36Yardanicoso you don't have to replicate docs for each proc for different OS
13:01:39FromDiscord<flywind> For external library, it exports windows version SocketHandle
13:01:49Yardanicoso usually the windows proc has documentation, and for linux or others it doesn't
13:02:23FromDiscord<flywind> sent a code paste, see https://paste.rs/V9J
13:02:23FromDiscord<flywind> So I got
13:03:09FromDiscord<flywind> wrong msg
13:03:16FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2zH3
13:03:38Yardanicowell, this means that you import both winlean and posix
13:03:45Yardanicoand need to specify explicitly
13:03:59FromDiscord<flywind> This is causes by `defined(nimdoc)` in stdlib.
13:04:05Yardanicobut it's for documentation
13:04:36FromDiscord<flywind> Yea, users may want to build docs in linux
13:04:43FromDiscord<flywind> Yea, I mean docs
13:05:25FromDiscord<flywind> stdlib use `export SocketHandle` to export wrong SocketHandle in nimdoc
13:05:39Yardanicoyes, and your module should be cross-platform :P
13:05:40Yardanicohttps://github.com/nim-lang/Nim/issues/8989
13:05:42disbot`defined(nimdoc)` special case causes `nim doc` failures, eg with jester: Error: undeclared identifier: 'EWOULDBLOCK' ; snippet at 12https://play.nim-lang.org/#ix=2zH4
13:08:00FromDiscord<flywind> I can avoid this by hand, namely `import nativesockets except SocketHandle`. Are there better ways?
13:11:32FromDiscord<flywind> Or `runnableExamples` should not be advised to use with `stdlib`.
13:12:31Yardanicowell, if you have runnableExamples, the code should then run on any platform you want to build docs on
13:27:28FromDiscord<flywind> Ok, I find a work around. The docs servers should download docs files from latest release zip files in github.
13:39:40*narimiran joined #nim
13:53:37*federico3_ joined #nim
13:54:52*federico3_ quit (Client Quit)
13:55:11*federico3_ joined #nim
13:57:11*federico3_ quit (Client Quit)
14:04:09*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:04:58*jjido joined #nim
14:12:30*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:18:43*jjido joined #nim
14:22:13*arecacea1 quit (Remote host closed the connection)
14:22:37*arecacea1 joined #nim
15:12:35*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:14:39*jjido joined #nim
15:32:51disruptekyer killin' me jc
15:34:52supakeenпривет комраде руптеком
15:46:20leorize[m]1Zevv: o/
15:48:13*Trustable joined #nim
16:04:39Zevvoi!
16:04:54ZevvMy NimStart sometimes says "Press enter to continue"
16:05:15Zevvis that me or is that you
16:07:08FromDiscord<Rika> just you
16:07:59disruptekrika: how many chickens do you own?
16:08:19FromDiscord<Rika> a few
16:08:20FromDiscord<Rika> why
16:08:30disruptekHOW MANY
16:08:37disruptekdon't lie.
16:08:56FromDiscord<Rika> uh
16:08:58FromDiscord<Rika> a few
16:09:41FromDiscord<juan_carlos> https://esolangs.org/wiki/Chicken#Hello.2C_world.21
16:10:06FromDiscord<shashlick> Anyone has a Nim file search tool that's cross platform
16:10:12FromDiscord<Rika> wdym
16:10:27FromDiscord<shashlick> find -regex etc
16:10:33ForumUpdaterBotNew thread by Mrhdias: Wrapping synchronous code into asynchronous call, see https://forum.nim-lang.org/t/6889
16:10:37FromDiscord<Rika> ah you mean filenames?
16:10:39FromDiscord<Rika> not grep?
16:10:42FromDiscord<shashlick> Yes
16:11:12FromDiscord<shashlick> I'd use nimgrep but 1.0.x doesn't support the --follow flag
16:11:45FromDiscord<shashlick> Busybox find doesn't support egrep regex
16:12:09disruptekisn't this like 10 lines of nim?
16:12:26FromDiscord<shashlick> I have to search at compile time so using walkDir + nim-regex is too slow
16:12:46disruptekso compile the tool first.
16:13:02FromDiscord<shashlick> Can't you tell I'm trying to be lazy?
16:13:04disruptekisn't that how nimgrep and find work?
16:13:17disrupteki think it'd be easier to write your own, honestly.
16:13:35FromDiscord<shashlick> Plus getting this working across all os is a pain
16:13:48disruptekshould be easy under nim.
16:14:27disrupteki would look at fzf first, if you really, really hate writing nim.
16:17:19FromDiscord<shashlick> I'd rather ask busybox users to install a proper wget and find
16:17:32disruptekyeah, fuck those kids.
16:34:40*vicfred joined #nim
16:37:55leorize[m]1Zevv: pretty sure that's just your setup
16:38:23Zevvok, thanks!
16:42:10*a_chou joined #nim
16:42:50FromDiscord<haxscramper> Is it possible to force expansion of the `match` macro in last proc without using `expandMacros:` explicitly? https://play.nim-lang.org/#ix=2zI9
16:44:21*a_chou quit (Remote host closed the connection)
16:45:34FromDiscord<juan_carlos> `--expandmacros:FOO` from terminal.
16:46:20FromDiscord<whisperdev> @Vindaar https://play.nim-lang.org/#ix=2zIc
16:46:51FromDiscord<whisperdev> I think it's because of the additional call to EnumServiceStatus. I guess the "Get-Service" commandlet is much smarter and needs just a single call
16:48:11FromDiscord<haxscramper> Bad wording. I want to get rid of error, not expand macro. `expandMacros` is just one possible workaround, but I'm interested if there is anything for actually fixing the issue itself. `macro expand*(body: typed): untyped = body` works too, but then I need to write `expand case ():`
16:48:38ForumUpdaterBotNew thread by Blmvxer: Nim Honeypot Project, see https://forum.nim-lang.org/t/6890
16:58:48*m4r35n357 joined #nim
16:59:21FromDiscord<lqdev> the more modules from box2d i wrap the more i feel like my compilation speeds are going to plummet
17:03:32FromDiscord<lqdev> anyone knows of any pure C 2D physics libraries?
17:03:50FromDiscord<enthus1ast> chipmunks maybe
17:04:07FromDiscord<enthus1ast> cannot remember if box2d or chipmunks was c only
17:04:37FromDiscord<enthus1ast> ^ @lqdev
17:04:45FromDiscord<lqdev> box2d is C++
17:04:51FromDiscord<lqdev> and it's a pita to wrap because of that
17:05:02FromDiscord<lqdev> because c2nim can't handle C++ very well
17:05:34FromDiscord<lqdev> chipmunk seems promising, lemme see
17:05:39FromDiscord<enthus1ast> https://github.com/slembcke/Chipmunk2D
17:05:43FromDiscord<enthus1ast> C99
17:06:59FromDiscord<lqdev> yeah found it already
17:07:53FromDiscord<lqdev> nice, MIT licensed
17:08:01FromDiscord<enthus1ast> are you building an engine lqdev?
17:11:38*sschwarzer joined #nim
17:13:08sschwarzerI'm trying to use a generic proc type declaration as in https://play.nim-lang.org/#ix=2zIn , but the compiler gives me "/usercode/in.nim(5, 23) Error: invalid indentation". The declaration works without the type parameter `S` and the `state` parameter.
17:13:50sschwarzerAny idea what I need to modify to use the generic type `S` here?
17:14:38*m4r35n357 quit (Quit: Ex-Chat)
17:15:43FromDiscord<lqdev> you can't create generic procs like that
17:15:58FromDiscord<lqdev> you have to move the [S] param to the type definition
17:16:11FromDiscord<lqdev> https://play.nim-lang.org/#ix=2zIq
17:16:42sschwarzerlqdev: ah, that looks better, thanks! :-)
17:17:19FromDiscord<lqdev> np
17:17:50sschwarzerThe error message previously is a bit confusing though.
17:18:05sschwarzeri. e. for my original code
17:20:29FromDiscord<Avatarfighter> What is upppp everyone
17:21:05*def- quit (Quit: -)
17:22:05FromDiscord<Zachary Carter> drinking coffee and working on terrain painting
17:22:20FromDiscord<Avatarfighter> That's exciting
17:22:24FromDiscord<Zachary Carter> trying to get this example working on d3d11 and metal, but not sure where the problem is
17:22:39FromDiscord<Avatarfighter> what type of coffee?
17:22:47FromDiscord<Zachary Carter> Petes I think
17:22:49FromDiscord<Avatarfighter> also got an example of what you mean by terrain painting 😛
17:23:09FromDiscord<Zachary Carter> https://imgur.com/bbj0fts
17:23:17*def- joined #nim
17:23:32FromDiscord<Avatarfighter> wow that is not what i thought you meant
17:23:42FromDiscord<Zachary Carter> You thought I meant like I was bob rossing it up?
17:23:46FromDiscord<Avatarfighter> I was expecting you to go full on bob ross
17:23:47FromDiscord<Avatarfighter> yeah
17:23:55FromDiscord<Zachary Carter> nah I'm not that talented
17:24:09FromDiscord<Avatarfighter> that is super cool though
17:24:44FromDiscord<Zachary Carter> the coolest part is the vertices and indices for the mesh are all calculated on the GPU
17:24:54FromDiscord<Zachary Carter> using tessellation in a compute shader
17:25:08FromDiscord<Avatarfighter> THATS SO COOL
17:25:18FromDiscord<Zachary Carter> via this algo -0 https://onrendering.com/data/papers/cbt/ConcurrentBinaryTrees.pdf
17:25:24FromDiscord<Zachary Carter> (edit) '-0' => '-'
17:25:49FromDiscord<Zachary Carter> so now the RTS game will have a map editor
17:25:57FromDiscord<Zachary Carter> the RTS game I've been promising 4raq for years now
17:26:00FromDiscord<Avatarfighter> ahah
17:26:07FromDiscord<Avatarfighter> What is the idea behind your game?
17:29:03FromDiscord<Zachary Carter> I don't really have much yet - my goal is to create a sandbox where I can play around with different ideas easily
17:29:15FromDiscord<Zachary Carter> but at the moment I know it's going to be a RTS and it's going to be science fiction themed
17:29:41FromDiscord<Avatarfighter> I'm excited for you this seems like it would be a lot of fun to play around with and make
17:30:14FromDiscord<Zachary Carter> I think the map editor is going to be the most enjoyable part haha
17:34:07FromDiscord<Zachary Carter> the cool thing is now I can deform the terrain at runtime if I want - so making craters etc from explosions should be possible
17:34:27FromDiscord<Avatarfighter> you don't even know how cool this is to me
17:34:43FromDiscord<Avatarfighter> im really excited for you
17:35:01FromDiscord<Zachary Carter> well it will be cooler when it's not just a stupid example and is actually playable - but that's a ways off
17:35:21FromDiscord<Zachary Carter> I was almost at this point last year - but couldn't quite get the terrain painting working
17:35:58FromDiscord<Zachary Carter> now that I have that I've kind of unblocked myself from progressing further than I was last year - so next up is to getting some animated units moving around the map
17:36:12*supakeen suggests: a tank
17:36:55FromDiscord<Zachary Carter> not a bad idea
17:37:01FromDiscord<Avatarfighter> a plane could be fun
17:37:22FromDiscord<Avatarfighter> mattering on if you have a fog of war feature for your RTS you could have little planes flying around lol
17:37:24FromDiscord<Zachary Carter> I need a 3d artist
17:38:58*hnOsmium0001 joined #nim
17:41:06FromDiscord<Avatarfighter> i mean
17:41:16FromDiscord<Avatarfighter> a rectangle looks like a vehicle
17:41:22FromDiscord<Avatarfighter> or a triangle
17:41:43FromDiscord<Zachary Carter> yeah - I just mean long term
17:41:52FromDiscord<Zachary Carter> I can prototype with primitives for sure
17:42:21FromDiscord<Avatarfighter> psh
17:42:26FromDiscord<Avatarfighter> make the game a geometry rts
17:42:42FromDiscord<Avatarfighter> no need for fancy animations when the rectangles shoot smaller rectangles at each other 😛
17:42:53FromDiscord<Avatarfighter> ahah
17:43:03supakeenA tank is just 3 rectangles
17:48:44*oculux joined #nim
17:49:00*oculuxe quit (Ping timeout: 256 seconds)
17:56:51*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:57:31Oddmongercould be the beginning of a folk song
17:59:59FromDiscord<ache of head> "A tank is just 3 rectangles"?
18:01:21FromDiscord<Vindaar> yeah, didn't you know? an aircraft carrier is about ~100 rectangles and a couple of cylinders though. Please keep that in mind, gonna be on the test
18:01:22FromDiscord<Rika> you can represent a tank with 3 rectangles
18:01:52FromDiscord<Rika> (i assume they actually mean boxes though)
18:02:13FromDiscord<vmcrash> I'm new to Nim. It looks very promising, but the most thing which restrains me from becoming productive is a good IDE with code completion, debugger and refactoring. Did I miss an essential tool? After >17 years of experience with IntelliJ IDEA I don't want to go back into stone age of development without (graphic) debugger or refactoring.
18:02:14FromDiscord<iWonderAboutTuatara> is there a way to import the entire stdlib?
18:02:31FromDiscord<iWonderAboutTuatara> the whole thing
18:03:06FromDiscord<Rika> code completion is here, nimsuggest + plugin
18:03:17FromDiscord<Rika> debugger, you can prolly just use gdb
18:03:25FromDiscord<Rika> (other than that i do not know)
18:03:32FromDiscord<Vindaar> @iWonderAboutTuatara why would you ever want that?
18:03:33FromDiscord<Rika> refactoring is nonexistent from what i know
18:04:20FromDiscord<Rika> refactoring is really complex, most new languages do not have good refactoring support, please keep that in mind
18:04:49FromDiscord<Rika> afaik yardanico made something with regards to graphic debugging
18:05:13FromDiscord<NickSeagull> Is there a way to compile a Nim library to a DLL and then dynamic link from a Nim executable?
18:05:30disrupteksure.
18:05:33FromDiscord<haxscramper> @vmcrash this one is kind of new, but you might want to try this out - https://plugins.jetbrains.com/plugin/15128-nim , also support in vscode is really good. Or you can try qt creator - it comes with nim plugin built-in.
18:05:53disruptek!repo nim.nvim
18:05:54disbothttps://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 100⭐ 13🍴 7& 3 more...
18:06:32FromDiscord<NickSeagull> disruptek: Not sure if that 'sure' was for me, in that case, can I get a link or something?
18:06:40FromDiscord<NickSeagull> (Please 🙂 )
18:06:59disrupteknim --fullhelp and note --app:lib
18:07:26FromDiscord<haxscramper> https://nim-lang.org/docs/nimc.html#dll-generation
18:07:41disruptek~dll is https://nim-lang.org/docs/nimc.html#dll-generation
18:07:42disbotdll: 11https://nim-lang.org/docs/nimc.html#dll-generation
18:07:58disruptekhaxscramper: ty
18:08:03FromDiscord<Recruit_main707> only disruptek knows the commands :P
18:08:10FromDiscord<Recruit_main707> ~help ?
18:08:26disruptekthere's no way for the bot to send you help on discord because yard is too lazy.
18:09:23disruptek~help
18:13:13FromDiscord<NickSeagull> Thanks a lot disruptek, those pointers are indeed very useful 🙂
18:13:19FromDiscord<NickSeagull> And @haxscramper
18:14:01FromDiscord<haxscramper> Also if you need to load nim dll in nim you might want to look at https://github.com/genotrance/plugins o
18:14:14FromDiscord<haxscramper> Or HCR
18:14:31disruptekstay away from hcr, imo; it's ripe for reimpl or breakage.
18:14:55FromDiscord<haxscramper> Okay, no for HCR
18:16:15FromDiscord<Avatarfighter> the plugin lib is a bit iffy with arc
18:16:58Zevvmy daily shit: http://zevv.nl/div/2020-10-04%2020-13-55.mp4
18:17:01Zevvboy did I miss nim
18:17:23FromDiscord<Avatarfighter> i thought that was a video of you shitting
18:17:30FromDiscord<Avatarfighter> i wasn't happy for a second there
18:18:32Zevvnot on #nim, not on #nim!
18:18:58ZevvI can now do >1M events and still responsive at 30fps
18:19:38disruptekstarting to look like a good base for flamegraph.
18:19:56Zevvit's similar. Flamegraphs just consolidate the X axis
18:19:58FromGitter<deech> Is there a way of overriding C++ methods using multimethods with the cpp backend? They seem pretty close in concept.
18:20:03FromDiscord<haxscramper> To compile some code only on after some nim version I should do `NimMajor > 1 and NimMinor > 2 and NimMinor > 6` or there is a more elegant way for this chec?
18:20:29disruptek(NimMajor, NimMinor) > (1, 2)
18:20:49FromDiscord<haxscramper> deech: no, there isn't any. TO override C++ method you need to create derived class, which nim doesn't do for C++ backend AFAIK
18:21:15FromDiscord<iWonderAboutTuatara> @Vindaar Want to try doing competitive programming
18:21:22FromDiscord<iWonderAboutTuatara> importing is kind of a pain
18:21:52FromDiscord<iWonderAboutTuatara> also, another weird issue with a macro
18:22:05FromDiscord<iWonderAboutTuatara> I'm trying to take values from a seq and assign them to a bunch of vars
18:22:34FromDiscord<iWonderAboutTuatara> end syntax should be `(x, z) ..= @[1, 2]`
18:22:45FromDiscord<iWonderAboutTuatara> and it should work for seqs declared as vars/not explicitly written out
18:22:53FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2zJj
18:23:05FromDiscord<iWonderAboutTuatara> is what I currently have, but it doesn't seem to be interpreting the s properly
18:23:23FromDiscord<iWonderAboutTuatara> getting an error about not being able to get a child of a sym node
18:24:41FromDiscord<Rika> you're iterating LHS, so 2 elements
18:24:45FromDiscord<Rika> RHS (a) only has 1
18:24:50FromDiscord<haxscramper> `a` is `(Ident "s")`
18:24:55FromDiscord<Rika> aka what does a[1] mean?
18:26:10FromDiscord<haxscramper> you ned `nnkBracketExpr.newTree(a, newLit(i))` to get element at index from `a`
18:26:47FromDiscord<iWonderAboutTuatara> wait if a is an ident
18:26:53FromDiscord<iWonderAboutTuatara> sorry if s is an ident
18:27:05FromDiscord<iWonderAboutTuatara> how do I make it pick a seq
18:29:04FromDiscord<Zachary Carter> The reason IntelliJ has all these nice tools is because of the JVM - not IntelliJ
18:29:18FromDiscord<Zachary Carter> and if you want to keep using InteliJ - then just keep using the JVM
18:29:24FromDiscord<Zachary Carter> (edit) 'InteliJ' => 'IntelliJ'
18:29:50FromDiscord<Zachary Carter> it's like going to a C/C++ community and complaining about C/C++ debugging
18:30:00*nixfreak joined #nim
18:30:31nixfreakfor some reason I can't remember how to put a space in a concatenation with two strings
18:30:34FromDiscord<haxscramper> > how do I make it pick a seq↵@iWonderAboutTuatara There is no "sequence" in macro - e.g. when `s` is passed it is just `(Ident "s")` that is /assumed/ to be related to sequence.
18:30:53FromDiscord<iWonderAboutTuatara> how do I work with it as a seq?
18:30:57FromDiscord<haxscramper> The best you can do is `s: seq`, but you will still get `NimNode`.
18:31:10FromDiscord<iWonderAboutTuatara> how would I get the items as an seq?
18:31:14FromDiscord<haxscramper> Generate code like `s[0]`, `s[1]` etc.
18:31:19FromDiscord<haxscramper> Using `nnkBracketExpr.newTree(a, newLit(i))`
18:31:27Prestigenixfreak: let foo = a & " " & b ?
18:31:31FromDiscord<iWonderAboutTuatara> what is a in this situation?
18:32:11nixfreakduh , thans
18:32:14nixfreakduh , thanks
18:32:35FromDiscord<Rika> the ident (`s`)
18:32:41FromDiscord<haxscramper> > what is a in this situation?↵@iWonderAboutTuatara Parameter in the macro. You have `(Ident "s")` in code and `a` variable in the macro parameters
18:32:59Prestige@iWonderAboutTuatara check out https://dev.to/beef331/demystification-of-macros-in-nim-13n8
18:33:05FromDiscord<iWonderAboutTuatara> oh I see
18:33:06FromDiscord<haxscramper> And variable represents NimNode that you have in code (identifier `s`)
18:33:17FromDiscord<iWonderAboutTuatara> PRestige: I've already read most of that
18:33:19FromDiscord<Recruit_main707> someone reminds me the difference between idents and syms?
18:33:29FromDiscord<haxscramper> Sym is a type-resolved identifier?
18:34:09FromDiscord<iWonderAboutTuatara> wait how would I go about generating code like that?
18:34:24FromDiscord<iWonderAboutTuatara> I'd need the input to be the induvidual values and not the seq?
18:34:52FromDiscord<Recruit_main707> @iWonderAboutTuatara can you show me an example of what your macro should do?
18:35:08FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2zJr
18:35:55sschwarzerZachary: I think it's fine to ask for better tool support with Nim. Your answer re C/C++ sounds like, "Nim doesn't have better/more IDE support; it's an axiom and don't ask!" ;-)
18:35:58FromDiscord<haxscramper> difference between untyped `echo 1,2,3` and typed one
18:36:11FromDiscord<iWonderAboutTuatara> @Recruit_main707 `(n, e) ..= s`
18:36:17FromDiscord<iWonderAboutTuatara> thanks hax! will look at that
18:36:30FromDiscord<iWonderAboutTuatara> wait nevermind
18:36:35*Vladar quit (Quit: Leaving)
18:36:41FromDiscord<iWonderAboutTuatara> n & e are declared variables
18:36:46FromDiscord<iWonderAboutTuatara> s is a seq
18:37:00FromDiscord<Recruit_main707> and what gets assigned to what?
18:37:14FromDiscord<iWonderAboutTuatara> n = s[0], e = s[1], etc
18:37:21FromDiscord<Recruit_main707> i see
18:38:24FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2zJs
18:38:28FromDiscord<haxscramper> @iWonderAboutTuatara ^
18:39:11FromDiscord<haxscramper> When in doubt always do `dumpTree` on code you /want to generate/ and then write macro that transforms input into this
18:39:53FromDiscord<iWonderAboutTuatara> I did that, but I'm still confused on getting values from the seq
18:40:24FromDiscord<Recruit_main707> you dont really, you create code that accesses the desired indexes
18:40:26FromDiscord<Zachary Carter> sschwarzer: it's fine to ask, but again there's a reason why the only runtime with the refactoring tools that the JVM has, is the JVM
18:40:34FromDiscord<Zachary Carter> and I guess the CLR is catching up via resharper
18:40:47FromDiscord<Avatarfighter> i love jetbrains
18:40:51FromDiscord<Zachary Carter> if you don't want to debug C/C++ - maybe Nim isn't the right language for you
18:40:56FromDiscord<Vindaar> @iWonderAboutTuatara sorry was afk
18:41:06FromDiscord<Vindaar> this is what you want I assume: https://play.nim-lang.org/#ix=2zJt
18:41:24FromDiscord<Vindaar> doesn't perform any safety checks though 😛
18:41:26FromDiscord<Recruit_main707> they already gave him an example
18:41:28FromDiscord<Rika> @Zachary Carter rather if you're not willing to accept that the ecosystem is still pretty young to have good tools or so
18:41:44FromDiscord<haxscramper> `` s/ s[`i`]/`s`[`i`] ``
18:41:45FromDiscord<iWonderAboutTuatara> oh you can do it with quote do?
18:41:46FromDiscord<Zachary Carter> we basically have what C/C++ devs have at their disposal
18:42:00disruptekjvm is a fundamentally different technology that affords different guarantees.
18:42:06FromDiscord<Zachary Carter> exactly
18:42:09FromDiscord<Vindaar> also regarding importing stuff: especially for competitive programming you wouldn't want to import the whole stdlib, that'd just slow down compilation
18:42:10FromDiscord<iWonderAboutTuatara> `quote do: s['i']`
18:42:12FromDiscord<iWonderAboutTuatara> except w/ backticks
18:42:14FromDiscord<Zachary Carter> we're dealing with C/C++ not Java
18:42:30FromDiscord<iWonderAboutTuatara> We do it in cpp, compile time is not a big worry
18:42:37FromDiscord<Vindaar> just define a helper module which imports the stdlib modules you might need and include that in your files
18:42:38sschwarzerZachary: true, but because the situation is better for the JVM doesn't mean that it's unthinkable that Nim could have better tooling in future. :-)
18:42:54FromDiscord<Rika> keywords are "in the future"
18:42:56FromDiscord<iWonderAboutTuatara> I have a base file where I'm doing that
18:42:59FromDiscord<Zachary Carter> it's not unthinkable no - but my if C/C++ don't have them after n number of years of these languages existing
18:43:12FromDiscord<iWonderAboutTuatara> Oh it's not anything you'd use for normal code
18:43:13FromDiscord<iWonderAboutTuatara> like ever
18:43:18FromDiscord<Recruit_main707> its like syntactic sugar in this case, you are not getting the sequence values at compile time, you assign n and e to some information stored at some specific indexes of s (0 and 1 in this case)
18:43:24sschwarzerRika: But for someone new to Nim and its ecosystem, the "future" may be now already ;-)
18:43:40FromDiscord<Rika> what do you mean
18:43:51FromDiscord<iWonderAboutTuatara> @Recruit_main707 so basically macro doesn't know or care what s is, it's just grabbing whatever is it index whenever it's called?
18:45:07FromDiscord<Recruit_main707> yesnt, you are the one that should care about that
18:45:43FromDiscord<Recruit_main707> it will error at compile time if the compiler sees something isnt right though
18:45:43sschwarzerZachary: I like that Nim (to me) feels more high-level than C++, so IMHO it would totally make sense to have tooling "on the Nim level". "C-level" would only be needed when you're interfacing with C/C++ or are developing on the compiler and there's a problem with the code generation/execution.
18:46:05FromDiscord<haxscramper> You can do `` macro `..=`(lft : untyped, a : untyped) : untyped = `` to get type checking
18:46:10FromDiscord<Recruit_main707> but essentially, its what you said
18:46:20FromDiscord<haxscramper> `` macro `..=`(lft : untyped, a : seq) : untyped = ``
18:46:25FromDiscord<Zachary Carter> but we're compiling to C and C++ - so we're debugging C/C++ too at the end of the day
18:46:50FromDiscord<iWonderAboutTuatara> I see
18:46:51FromDiscord<iWonderAboutTuatara> thanks!
18:46:53Araqthat's a problem, not a feature
18:46:59FromDiscord<haxscramper> Or to be more accurate `seq | tuple | object | ref object` if you want to unpack `(12, 3)` and objects with `` proc`[]` `` too
18:47:05Araqbut at least we produce #line directives
18:47:09sschwarzerRika: Someone new to the ecosytem can't necessarily know whether better tooling is in the future or if it already exists.
18:47:14FromDiscord<iWonderAboutTuatara> never heard of `[]`
18:47:17disrupteki don't see any reason why we cannot surpass c debugging.
18:47:18FromDiscord<iWonderAboutTuatara> as a proc
18:47:28FromDiscord<Rika> i dont either
18:47:40FromDiscord<haxscramper> > as a proc↵@iWonderAboutTuatara https://nim-lang.org/docs/macros.html#%5B%5D%2CNimNode%2Cint
18:47:51FromDiscord<Zachary Carter> someone just needs to write a debugger 🙂
18:47:52FromDiscord<Rika> im just saying that expecting good refactoring for a language at this size/popularity is somewhat unreasonable
18:47:58sschwarzerZachary: That's like saying the CPython VM is written in C, so debugging Python with gdb (including the VM) would be reasonable.
18:47:58AraqI use 'getStackTrace' extensively and it's not available in C
18:48:02FromDiscord<iWonderAboutTuatara> oh index access is a macro?
18:48:02FromDiscord<Rika> but thats my opinion
18:48:08FromDiscord<Recruit_main707> yeah, if someone eiteher write exportc everywhere or create a debugger that uses a c debbugger but can read nim stacktraces
18:48:19FromDiscord<Zachary Carter> there's a difference
18:48:22FromDiscord<Recruit_main707> i kinda had a stroke there
18:48:47FromDiscord<Zachary Carter> you're forgetting about the python interpreter
18:48:56FromDiscord<Zachary Carter> that's what's written in C
18:49:06FromDiscord<Recruit_main707> > oh index access is a macro?↵@iWonderAboutTuatara its a proc
18:49:10FromDiscord<haxscramper> > oh index access is a macro?↵@iWonderAboutTuatara No, just a aregular proc. You can overload operators https://nim-lang.org/docs/tut1.html#procedures-operators
18:49:30FromDiscord<Recruit_main707> when you do `echo(s[1])`
18:49:38FromDiscord<Recruit_main707> you are calling `[]`
18:49:52Araqjust a minute ago I embedded getStackTrace in the produced C code as a comment to see where the produced C code comes from
18:50:10FromDiscord<iWonderAboutTuatara> @Recruit_main707 in your macro, what is `s`?
18:50:13Araqso in some cases we do surpass C++ already
18:50:19FromDiscord<iWonderAboutTuatara> side effect?
18:50:30disruptekyou can run a lot of nim code in the vm if you simply rename the file from nim to nims.
18:50:48Araqbtw, new record, 1:53
18:50:48disruptekbecause araq likes to make us rename files.
18:50:54sschwarzerZachary: I'm not sure I understand what you mean. What I meant is that Python programs (if executed with CPython) are processed by a C program, so you could (but IMHO shouldn't) debug your Python code by debugging the CPython interpreter and check what it's doing with your program. But of course you don't want to.
18:50:55FromDiscord<Recruit_main707> @iWonderAboutTuatara i didnt write any macro, i am talking about nim in general
18:51:12FromDiscord<iWonderAboutTuatara> no from earlier
18:51:12sschwarzersorry, should go to Rika
18:51:19FromDiscord<iWonderAboutTuatara> https://play.nim-lang.org/#ix=2zJt
18:51:20FromDiscord<Vindaar> oh, did you mean me @iWonderAboutTuatara? That was a typo on my end haha
18:51:24FromDiscord<Zachary Carter> Nim is compiled to C though - Python programs aren't
18:51:27FromDiscord<Zachary Carter> they're compiled to bytecode
18:51:28FromDiscord<Vindaar> just turned out to work in this case
18:51:29FromDiscord<iWonderAboutTuatara> oh might have been you
18:51:34sschwarzersorry, should indeed go to Zachary :-D
18:51:39FromDiscord<Vindaar> give me a sec
18:51:41FromDiscord<iWonderAboutTuatara> using a[`i`] gives illformed ast error
18:51:41FromDiscord<Rika> sschwarzer i think you misdirected
18:51:44FromDiscord<Recruit_main707> yep, it was him
18:51:46FromDiscord<Rika> yeah lol
18:51:46AraqZachary Carter: true but not very interesting
18:52:09FromDiscord<Vindaar> @iWonderAboutTuatara https://play.nim-lang.org/#ix=2zJw
18:52:10Araqwe used to have ENDB which added VM-like stuff to the produced C code
18:52:14FromDiscord<Recruit_main707> try with \`a`
18:52:19FromDiscord<Zachary Carter> I wasn't trying to be interesting - I was trying to explain why it's a different scenario
18:52:27Araqbut I couldn't maintain it
18:52:35Araqand it was really slow too
18:52:47FromDiscord<Zachary Carter> you can already have visual debugging with nim and gdb / lldb using VSCode
18:52:53FromDiscord<Vindaar> ahh
18:52:57FromDiscord<Zachary Carter> or Qt's code editor
18:53:15FromDiscord<Vindaar> I keep messing up, because I'm too hasty. Ok, 1 min and I actually run the code I write. Sorry for the confusion
18:53:33sschwarzerZachary: I know, but still I don't think it's unreasonable to think that somehow we could have debugging on the Nim level in the future. Nim has a certain semantics, so a debugger that looks at Nim on that level (independent of how the "semantics is executed") would make sense.
18:53:57Araqyes as I said, we had it, it was named ENDB
18:54:09FromDiscord<Vindaar> @iWonderAboutTuatara ok, here: https://play.nim-lang.org/#ix=2zJx
18:54:11FromDiscord<Recruit_main707> @iWonderAboutTuatara the \`XX` thing in macros and templates mean, dont write XX, but whatever XX is in your macro/template
18:54:22sschwarzerAraq: Sorry, I missed that.
18:54:22Araqam I muted to what...
18:59:52sschwarzerAraq: You said it was slow. What was the factor between "normal" Nim speed and execution under ENDB?
19:03:43nixfreakhow do you just get yyyy-mm-dd for getTime()?
19:06:04sschwarzernixfreak: Might make sense to use `now`, which you can format with `DateTime.format`.
19:06:24sschwarzerhttps://nim-lang.org/docs/times.html#parsing-and-formatting-dates
19:06:31Araqsschwarzer, factor of 10 but you pay roughly the same price with --stackTrace:on
19:06:52AraqENDB extended our stack traces with info about local variables etc
19:07:15sschwarzerAraq: For me a factor 10 wouldn't be bad if it's for debugging only.
19:07:41sschwarzerOf course there _could_ be situations where it's too slow.
19:07:42Araqtrue it was acceptable
19:07:46Araqhowever
19:08:38Araqit wasn't clear how to make it support multi-threading and it's changes the stack contents so much that you likely cannot debug a random crash with it
19:09:10Araq"my program crashes, let me fire up ENDB, great now it crashes somewhere else or not at all"
19:09:22sschwarzernixfreak: It looks like there's also `format` for `Time` objects
19:09:41sschwarzerAraq: I see
19:10:41Araqbetter patch the .elf debug sections for GDB
19:11:02Araqa much more fruitful approach
19:11:08sschwarzerWhat are the plans for the next Nim versions? I guess 1.4 will focus on arc/orc robustness?
19:12:00Araqyes, we also have "strict funcs" and view types though
19:13:46sschwarzerAraq: right, strict funcs are nice! :-) I've used them for a while, but had forgotten they're there. Probably because I had some time where I wasn't working with Nim. Also I had some problems, but if I remember correctly, these are all fixed now.
19:14:00Araqugh, why am I so bad? 11th out 11
19:14:04Araq*out of
19:14:21sschwarzer"11 out of 11"? What do you mean?
19:14:34Araqhttps://my.raceresult.com/144393/results?lang=de#4_D5BA5B
19:15:51Prestigelol I changed the language to English, but it's still in German
19:16:09Araqlook at the section M35
19:17:06sschwarzerPrestige: You can search for "Rumpf, Andreas"
19:17:26PrestigeI found his name, I just don't know that the site is about
19:17:35Araqalternatively I'm 83th out of 108
19:17:42sschwarzerPrestige: running
19:17:49sschwarzer(physically :) )
19:17:53Prestigeah :P
19:18:18FromDiscord<Rika> as in marathon?
19:18:20FromDiscord<Rika> thats fine
19:18:35Araqhalf-marathon...
19:18:54FromDiscord<Rika> god damn half marathon??? i dont think i can do that
19:18:55sschwarzerWhat are you thinking about for Nim 1.6?
19:19:05AraqIC
19:19:15sschwarzerRika: I never tried, and wouldn't. ;-)
19:20:22nixfreakDateTime.format.now()?
19:20:43*abm joined #nim
19:20:46sschwarzerAraq: What's "IC"?
19:20:58Araqincremental compilation
19:21:25sschwarzernixfreak: `import times`, then `now().format("<your_format_string>")`
19:22:01sschwarzerAraq: ic (I see) :)
19:22:12nixfreakok thanks
19:22:55sschwarzerIt's in the `times` module documentation, https://nim-lang.org/docs/times.html
19:28:55sschwarzer@all: What other programming languages do you like developing with, and why?
19:30:03*NimBot joined #nim
19:34:15Araqhow is that gonna produce an interesting result in #nim ?
19:34:37Araqand what does it matter, should we make Nim more like JS when many JS devs raise their hand?
19:34:49Araqanyhow, good night
19:35:02FromDiscord<Rika> i think theyre just asking a question
19:37:36sschwarzerRika: exactly, I'm just curious
19:37:58voidpisschwarzer: just nim & python for me
19:38:38sschwarzerAraq: I don't see why it should _not_ produce an interesting result. I guess most Nim devs are experienced devs and use more than one programming language.
19:39:01*thomasross joined #nim
19:39:21sschwarzerAraq: And for me, it's not about making Nim more similar to other languages (actually, I didn't even think of that). :)
19:40:15nixfreakif I'm subtracting dates I have to convert from string to int right
19:40:58sschwarzervoidpi: I'm using Python a lot (my "main" language since many years). I found Nim about a year ago and really like it. At the same time, I'm curious about other languages, especially for functional programming. But I'm kind of overwhelmed because there are so many options. *sigh*
19:41:29sschwarzernixfreak: Did you look at the module documentation I mentioned? :)
19:44:25sschwarzernxifreak: There doesn't seem to be a `Date` type, so I guess, you'd create two `DateTime` objects (maybe with the time set to 00:00 for clarity) and subtract them.
19:45:50nixfreakok , yeah I looked over them , There is a lot to unpack in the documentation
19:46:18sschwarzernixfreak: true, it has always happened to me that I just missed something which was actually there :)
19:46:32sschwarzersorry, not "always", but "sometimes" :)
19:47:14sschwarzer(maybe I wanted to write "actually", idk)
19:50:43sschwarzernixfreak: https://play.nim-lang.org/#ix=2zJO (don't try to execute this directly as Nim code though :-) )
19:51:07sschwarzerSo `parse` does the conversion (to `DateTime`) for you
19:54:55*sschwarzer quit (Quit: leaving)
19:57:19nixfreakoh ok , so you have to turn it into a DateTime object first then parse it
19:57:52nixfreakI tried doing this let bdate = initDateTime(04, mApr, 1980, 0, 0, 0)
19:57:52nixfreaklet dateNow = getTime()
19:57:52nixfreakecho(dateNow)
19:57:52nixfreakecho(bdate)
19:57:52nixfreakecho("Your age in days is ", bdate - dateNow)
20:16:48*jjido joined #nim
20:30:34*aenesidemus joined #nim
20:41:37*narimiran quit (Ping timeout: 264 seconds)
20:41:56nixfreakcan you just put any amount of years in a DateTime object
20:42:00nixfreaksay 40 years
20:49:03*abm quit (Quit: Leaving)
20:52:33FromDiscord<ache of head> what's the check for macos in `defined()`? just `defined(macOS)`?
20:52:39FromDiscord<ache of head> or is the identifier different?
20:53:00disruptekmacosx
20:53:09FromDiscord<ache of head> thanks!
20:54:10disrupteki guess there's a macos define, too, but most likely you're looking for macosx.
21:03:50FromDiscord<Rossiya> what the
21:11:44FromDiscord<Vindaar> ok, this might make me look a bit uninformed, but I always thought it was my fault I couldn't figure out a non hacky way to turn something synchronous into something async: https://forum.nim-lang.org/t/6889 ↵TIL I guess
21:12:26*solitudesf quit (Ping timeout: 256 seconds)
21:12:55disruptekyou need something like cps.
21:13:01FromDiscord<Vindaar> I was always like "duh, if I have something that is implemened returning futures and stuff of course I can handle using async etc. But what to do when I _don't_". I guess then I don't do anything and keep using threads 🤣
21:13:21FromDiscord<Vindaar> disruptek so _that's_ what cps would actually solve?
21:13:30disruptekthat's one example, yes.
21:13:40disruptekcps gives you two ways to solve it:
21:13:51disruptekmove the continuation to a thread and run blocking code in that thread, or
21:13:52FromDiscord<Vindaar> ok, now suddenly I can understand your cps hype, haha
21:14:17disruptekput the continuation into an event queue and use select() or similar to poll for completion.
21:14:39FromDiscord<Vindaar> that's pretty neat. I always did the former manually when required
21:14:54*abm joined #nim
21:15:14FromDiscord<Vindaar> guess with that knowledge I'm gonna take a look at that repo again. Thanks!
21:15:25disruptekyeah, what it does isn't all that exotic.
21:16:00disruptekit's just, y'know, it rewrites your simple procedural code to this slightly more sophisticated abstraction.
21:17:45FromDiscord<Vindaar> I love it when things all of a sudden click into place, heh
21:17:59disruptekyou get it. 😉
21:18:09disruptekit's a big fucking deal if we can make it smooth.
21:19:22FromDiscord<Elegant Beef> Then there is me using Async code so little, i just have the monkey with symbols in my head
21:19:39disruptekbtw, i think 0.0.13 works but isn't all that slick. the typed branch doesn't work yet but gives a preview of how it could...
21:20:06disruptekmonkey with symbols?
21:20:14FromDiscord<Vindaar> thanks, will keep that in mind!
21:20:28FromDiscord<Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/762423914386292736/iu.png
21:20:43FromDiscord<Elegant Beef> Shit that's just the still frame https://media2.giphy.com/media/9jCK8MGZRBOSs/giphy.gif
21:20:45*Trustable quit (Remote host closed the connection)
21:21:10FromDiscord<Elegant Beef> Guess it's cymbal and i'm daft
21:21:40disruptekah, cymbals.
21:21:57disruptekthat makes way more sense.
21:22:17FromDiscord<Elegant Beef> Hey i'm not the dumbass that made homophones
21:22:32FromDiscord<Vindaar> ok, gonna be back later!
21:22:49disruptek#proudboy
21:47:55FromDiscord<iWonderAboutTuatara> is it idiom to use `s.map(x => parseInt x)` or to use `s.mapIt(parseInt it)`?
21:50:05*rockcavera joined #nim
21:54:13*nature quit (Ping timeout: 264 seconds)
22:05:13*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:05:43*Ikuyu joined #nim
22:06:45FromDiscord<Elegant Beef> I dont think either are wise since that assumes all strings are parsable
22:08:02FromDiscord<Elegant Beef> Good ol' runtime error https://play.nim-lang.org/#ix=2zKu
22:09:09FromDiscord<juan_carlos> parseSaturatedNatural
22:10:06*Ikuyu quit (Quit: Textual IRC Client: www.textualapp.com)
22:16:02FromDiscord<Elegant Beef> Would be nice if there was a `tryParse` which returned an optional of the type attempting to parse
22:16:24disruptekuse a template.
22:17:41FromDiscord<Elegant Beef> no its "rtfm div operator"
22:19:22*casaca quit (Remote host closed the connection)
22:25:18FromDiscord<Elegant Beef> Wonders if i could squeeze this into the strutils stdlib 😄 https://play.nim-lang.org/#ix=2zKy
22:26:14disruptekobviously, it should be two procs.
22:26:17disruptekone overload.
22:31:06FromDiscord<Elegant Beef> You're saying it should be `tryParse[T: SomeInteger]` and `tryParse[T: SomeFloat]`, cause that apparently "leads to ambiguous calls" ? 😄
22:31:10*aenesidemus quit (Quit: Leaving)
22:31:11*aenesidemus_ quit (Quit: Leaving)
22:31:33disruptekit's not ambiguous if you provide the type.
22:32:33disrupteki say that because it's cleaner.
22:32:45FromDiscord<Elegant Beef> I'm uncertain what you mea
22:32:49FromDiscord<Elegant Beef> (edit) 'mea' => 'mean'
22:33:19disruptekas you say, T: SomeInteger, T: SomeFloat, T: enum, T: bool, etc.
22:33:33disruptekmultiple procs.
22:33:58disruptekthis is another way to do it:
22:34:01disruptek!repo jsonconvert
22:34:01disbothttps://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 2⭐ 0🍴
22:45:38*casaca joined #nim
22:52:19FromDiscord<Elegant Beef> I've looked at what you showed, and all i've grasped is i can do it better, final offer https://play.nim-lang.org/#ix=2zKE
22:54:40*arecacea1 quit (Remote host closed the connection)
22:54:57disruptekeh.. it's too hard to override with a typedesc.
22:55:01disruptekthe generics method is easier.
22:55:08*arecacea1 joined #nim
22:55:22disruptekbut, jsonconvert is bad style. that's why it says "don't use this"
22:55:40FromDiscord<Elegant Beef> Doesnt a generic remove the abillity to use ufcs?
22:55:45disrupteki still think it's best suited to a template.
22:55:58disruptekwho cares about ufcs?
22:56:06FromDiscord<Elegant Beef> Moi
22:56:06disrupteksyntax isn't as important as semantics.
22:56:34disruptekwhen some knucklehead comes along and wants to extend this, it's harder than it should be.
22:58:13disrupteki think you have 1-2 templates of 2-3 lines each and then the user can add new types with one line.
23:02:57disrupteki think if my name was flegma, i'd change it.
23:08:50*Jesin quit (Quit: Leaving)
23:09:31*^Q-Master^ quit (Ping timeout: 246 seconds)
23:21:41disruptekno offense.
23:22:14*Jesin joined #nim
23:38:35*abm quit (Read error: Connection reset by peer)