<< 02-12-2021 >>

00:00:09FromDiscord<Elegantbeef> Probably a bug
00:01:11anddamYardanico: I have to drop it, I tried to patch the mismatches in imgui.cpp as well since the declaration and definitions where different
00:01:14anddambut I get a bunch of
00:01:27FromDiscord<Yardanico> i didn't have to patch imgui.cpp at all
00:01:28FromDiscord<Yardanico> only cimgui.h
00:01:42anddamhttps://termbin.com/d1ih
00:02:07FromDiscord<Yardanico> you seem to be compiling with the cpp backend now?
00:02:17FromDiscord<Yardanico> so the way I did it
00:02:19anddamI am just doing make in cimgui
00:02:32FromDiscord<Yardanico> 1) build cimgui with default header↵2) modify cimgui.h header↵3) build the example with imgui
00:03:38anddamwait the build is done with default header?
00:03:49FromDiscord<Yardanico> yes, sorry, forgot to tell about that
00:04:03FromDiscord<Yardanico> i figured it all out on-the-go so forgot I used the default header for cimgui.h
00:04:25anddamI am unsure how editing the header file then affects the nimgl/imgui example building
00:04:44FromDiscord<Yardanico> it uses the header directly
00:04:49FromDiscord<Yardanico> for some type definitions and stuff
00:05:01anddamshouldn't that header be in ~/.nimble/pkg/imgui/someplace/here ?
00:05:09FromDiscord<Yardanico> well yes if you have that installed here
00:06:11anddamI have the static lib and the patched header
00:08:05anddamI see both imgui and nimgl are installed in ~/.nimble
00:08:12anddamboth have a copy of cimgui.h
00:10:31anddamok, now nim c --dynlibOverride:cimgui --passL:-lcimgui test.nim errors with /bin/ld: cannot find -lcimgui
00:10:36anddammaybe a -L. ?
00:11:00anddamI honestly thought a static archive would just be passed as object to the compiler, not via the linker
00:11:36anddamworking
00:11:48anddamwith -d:release 1.8 MB
00:12:09anddamcan I cross compile for windows target using linux host with nim?
00:13:19anddamYardanico: thanks so much again
00:13:22anddamI have to call it a night
00:13:29FromDiscord<Yardanico> good night :)
00:13:34anddamtoo bad it's not a weekend
00:13:38FromDiscord<Yardanico> :(
00:13:41FromDiscord<Yardanico> :()
00:14:11anddambtw is that Xlib thing viable? can I build a very small executable with nim linking per each platform a native graphical API?
00:19:18nrds<Prestige99> Xlib wouldn't work for Windows if that's what you're asking? Well maybe with WSL, idk about that
00:29:32*pch quit (Ping timeout: 240 seconds)
01:00:20*Zevv quit (Ping timeout: 260 seconds)
01:06:47*Zevv joined #nim
01:06:53*lumo_e joined #nim
01:13:05NimEventerNew Nimble package! cliche - AutoMagic CLI argument parsing is Cliche, see https://github.com/juancarlospaco/cliche
01:13:07nrds<R2D299> itHub: 7"AutoMagic CLI argument parsing is cliche"
01:40:39FromDiscord<huantian> is there a way to get the vscode plugin do suggestions and such with -d:ssl?
01:41:19FromDiscord<Elegantbeef> make a `config.nims` and add `--d:ssl` or `switch("define", "ssl")` then it should work fine
01:44:01FromDiscord<huantian> cool thx
01:47:16FromDiscord<huantian> I should put this in my root directory right
01:47:25FromDiscord<huantian> (edit) "I should put this in my ... root" added "project"
01:47:34FromDiscord<Elegantbeef> Yep
01:49:53nrds<Prestige99> Can't we initialize a const array? I can't seem to find the right syntax to init an array with default values (e.g. const foo: array[0..3, int])
01:50:26FromDiscord<Elegantbeef> `const foo = [0, 3, 4, 5]`
01:51:08nrds<Prestige99> is there an array fill to make it all the default int value?
01:51:16FromDiscord<Yardanico> In reply to @nrds "<Prestige> Can't we initialize": you can probably use `static` block with fill from algorithm
01:51:23FromDiscord<Yardanico> but that'll look ugly
01:51:31nrds<Prestige99> hm
01:51:46FromDiscord<Elegantbeef> Yea a block is the way
01:51:54nrds<Prestige99> Cool, thanks
01:52:10*noeontheend joined #nim
01:52:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GJd
02:11:32*lumo_e quit (Remote host closed the connection)
02:13:08nrds<Prestige99> Anyone else doing AoC btw? I just finished
02:13:28FromDiscord<Elegantbeef> I'm
02:13:41FromDiscord<Yardanico> In reply to @nrds "<Prestige> Anyone else doing": check the private nim leaderboard
02:13:47FromDiscord<Yardanico> you can join it, it's not yet full
02:13:48FromDiscord<Yardanico> iirc
02:18:55nrds<Prestige99> Thanks, just joined
02:19:35FromDiscord<Yardanico> also we have #nim-aoc on irc
02:20:13*nrds quit (Remote host closed the connection)
02:20:44*nrds joined #nim
02:48:23FromDiscord<gogolxdong (liuxiaodong)> Does async leaks with --gc\:arc?
03:00:04FromDiscord<Rika> Yes
03:18:34FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3GJT
03:20:46FromDiscord<Yardanico> try with seq[proc(value: string): string {.closure.}]
03:21:15FromDiscord<Yardanico> nim assumed that you want to keep normal nim procs (nimcall) in your sequence - closure procedures are different from that because they can capture their environment
03:21:38FromDiscord<Yardanico> usually nim infers anonymous procedures to be closures unless you explicitly say that they're normal nim procs
03:29:04FromDiscord<ajusa> In reply to @Yardanico "try with seq[proc(value: string):": That worked, thanks! Explanation makes sense as well, in my case I do want closures
03:37:23FromDiscord<messiahbooks> Secret Knowledge Wisdom That Will Help You Become God Again, Active Super Power, Live Forever https://eternalsacredbooks.wordpress.com/2021/12/01/secret-knowledge-wisdom-that-will-help-you-become-god-again-active-super-power-live-forever/
03:38:53FromDiscord<Alea> might be missing some basic math here, but how do I calculate inverse tangent?
03:39:10FromDiscord<Alea> math module doesn't seem to have a func
03:40:05FromDiscord<Yardanico> aaa what's with those matrix spammers
03:40:13FromDiscord<Yardanico> discord spammers are at least simple, they just spam cryptospam
04:03:47*rockcavera quit (Remote host closed the connection)
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:30*supakeen joined #nim
04:33:03*arkurious quit (Quit: Leaving)
04:35:30arkanoidI need more articles like https://arhamjain.com/2021/11/22/nim-webdev.html
04:39:51FromDiscord<ajusa> https://arhamjain.com/2021/11/22/nim-simple-chat.html
04:41:34FromDiscord<ajusa> But yes, Nim has a bit of a knowledge/domain issue where a few people know all the stuff (frameworks, language features, std library) but it isn't as visible. That's where articles and external writeups come in. Glad you liked it though, I'll be doing my best to write a bit more in the near future!
04:41:52FromDiscord<ajusa> (edit) removed "bit"
04:42:51arkanoidYou described very well the problem. Reading articles that compares libs and their history/direction is very refreshing
04:44:26arkanoidAlso loving the "explain the code" rather than tutorial approach.
05:25:59*noeontheend quit (Ping timeout: 252 seconds)
06:49:27FromDiscord<apahl> In reply to @Elegantbeef "<@732968123745042443>\: did i say": At least that was my understanding of the ongoing discussion, but we cleared it all up, all good. Thanks a lot for being so friendly, active and helpful here!
07:12:21*neurocyte0132889 joined #nim
07:12:21*neurocyte0132889 quit (Changing host)
07:12:22*neurocyte0132889 joined #nim
08:01:47*pch joined #nim
08:02:12*PMunch joined #nim
08:21:15*neurocyte0132889 quit (Ping timeout: 252 seconds)
08:41:34FromDiscord<Michal58> When does a call with omitted argument that is not last work?
08:42:57FromDiscord<Rika> That is not last work?
08:43:11FromDiscord<Rika> I don’t know of any case where that would work
08:43:37FromDiscord<Rika> Arguments are filled in from left to right afaik no matter type or if it has a default
08:45:57FromDiscord<Michal58> sent a code paste, see https://play.nim-lang.org/#ix=3GKU
08:48:09*neurocyte0132889 joined #nim
08:48:09*neurocyte0132889 quit (Changing host)
08:48:09*neurocyte0132889 joined #nim
09:02:38FromDiscord<apahl> In reply to @PMunch "Have you seen my": Hi @PMunch , could you post the link to the article, again? Thanks a lot.
09:04:08PMunchSorry, when you reply to stuff I only see the first part of the message on IRC. Which article is it that you want me to link?
09:11:59PMunch@apahl ^
09:13:53FromDiscord<apahl> You mentioned an article from you about async.
09:17:46PMunchOh right, this one: https://peterme.net/asynchronous-programming-in-nim.html
09:18:18FromDiscord<apahl> Thanks a lot.
09:53:27FromDiscord<Michal58> sent a code paste, see https://play.nim-lang.org/#ix=3GL9
09:53:49FromDiscord<Michal58> (edit) "https://play.nim-lang.org/#ix=3GL9" => "https://play.nim-lang.org/#ix=3GLa"
09:56:59FromDiscord<Rika> Ah that has different semantics, I forgot about that
09:57:12FromDiscord<Rika> Anything passed with : or do is right to left
09:57:41FromDiscord<Rika> Well I guess “semi” right to left
10:29:04FromDiscord<Michal58> How exactly is it parsed then?
10:32:01FromDiscord<Elegantbeef> It's left to right and moves optional params after non optional
10:57:33FromDiscord<Michal58> Why is it doing that? Is to enable templates that take the last argument an untyped block to take optional arguments before the block?
11:03:22FromDiscord<Rika> Yes
11:04:46FromDiscord<Michal58> Cool. I'm glad I accidentally discovered that. 🙂
11:25:07PMunchI'm going to chalk that up as another piece of cursed syntax :P
11:52:17FromDiscord<gogolxdong (liuxiaodong)> what is the default path of metadata file of nimble packages?
11:57:51*pch quit (Remote host closed the connection)
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:21:49*pch joined #nim
12:22:16*pch quit (Remote host closed the connection)
12:23:43*pch joined #nim
12:24:51NimEventerNew thread by Freeflow: Order of execution: where to find understanding, see https://forum.nim-lang.org/t/8672
12:24:58PMunch@apahl, did the article help at all?
12:31:03*pch quit (Remote host closed the connection)
12:32:33*pch joined #nim
12:59:58*pch quit (Remote host closed the connection)
13:01:00*pch joined #nim
13:05:09*src joined #nim
13:12:06*pch quit (Remote host closed the connection)
13:13:09*pch joined #nim
13:16:11*xet7 quit (Ping timeout: 245 seconds)
13:31:24FromDiscord<tbrekalo> Is there something as GNU readline or libedit for nim?
13:37:58FromDiscord<enthus1ast> @treeform\: what could it be that suddenly netty does not let clients connect?↵Or any tip i could debug this?
13:38:53FromDiscord<enthus1ast> (i know broad question)
13:40:26FromDiscord<enthus1ast> could this be when there are messages in transit?
13:40:40FromDiscord<enthus1ast> but the clients are not there any more?
13:41:04FromDiscord<enthus1ast> to me it does seem to happen randomly
13:41:17FromDiscord<enthus1ast> restarting the server (not the client) helps
13:50:07*noeontheend joined #nim
14:16:21*dtomato quit (Quit: The Lounge - https://thelounge.chat)
14:17:03*dtomato joined #nim
14:22:05*noeontheend quit (Ping timeout: 256 seconds)
14:28:03*arkurious joined #nim
14:34:13FromDiscord<apahl> @PMunch Sorry, will read it later, am at work rn.
14:35:14PMunchOh no worries, just wanted to help you out if you had come across anything that confused you
14:38:41FromDiscord<apahl> Thanks a lot, much appreciated.
14:45:04*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
14:47:40*rockcavera joined #nim
14:47:40*rockcavera quit (Changing host)
14:47:40*rockcavera joined #nim
15:10:09*xet7 joined #nim
15:49:40arkanoidI'm developing a python project due to scientific stuff, but I'm considering using nim to replace slow functions. So far, the slowest guy in the room is a function that does reading and parsing and is similar to: https://play.nim-lang.org/#ix=3FZM , do you think nim would be faster than python here?
15:57:04*pch quit (Remote host closed the connection)
15:57:40*pch joined #nim
16:00:56perrointeresting quesiton, that's definitelty a place that python optimizes for
16:01:24FromDiscord<Rika> https://play.nim-lang.org/#ix=3GN2
16:01:24FromDiscord<Rika> ?
16:01:33FromDiscord<Rika> now you can test it 😛
16:02:16FromDiscord<Rika> (of course, i use stdlib sequtils which most likely is slower, maybe would be better to use zerofunc or similar)
16:02:47FromDiscord<Rika> also lines on python `for line in [ll for ll in data.splitlines() if ll and ll.strip()]:` would prolly work better as generators `for line in (ll for ll in data.splitlines() if ll and ll.strip()):`
16:03:54FromDiscord<Rika> i apologise but i will have to go now
16:04:08FromDiscord<Rika> hopefully someone else can help if you have further issues or questions
16:05:00perroI'm interested if you ever get results
16:06:34FromDiscord<Rika> https://github.com/zero-functional/zero-functional/ (if you need a link to what zerofunc is)
16:06:48FromDiscord<Rika> i shall go now
16:25:55*xet7 quit (Remote host closed the connection)
16:29:11FromDiscord<ajusa> What's the best "wrapperless" Nim interop program? Futhark, c2nim, nimline, nimterop, cinterop...↵Which one would I probably be able to use to make bindings for C libraries that use macros? Which one have folks found easy to use?
16:31:44arkanoidRika: thanks! I've been cought in a phone call in the meanwhile. I'll test this out. Also thanks for the list -> generator hint
16:36:04arkanoidajusa, I've experience with just c2nim and nimterop. They both works but at the end I had to deal with edge cases (nested string rewriting macros on C side) and c2nim ended up being more flexible to fix the 90%. Still had to complete the last 10% manually
16:37:32arkanoidRika: I went 28s to 26.5s thanks to that generator. Thanks!
16:38:59*Pyautogui joined #nim
16:45:54FromDiscord<haxscramper> Probably furthark
16:46:08FromDiscord<haxscramper> At least this one is maintained and has proper parser
16:47:48FromDiscord<ajusa> In reply to @haxscramper "Probably furthark": Got it, it seems like less wrapping is required with it. I'll try it out I guess
16:48:30arkanoidhaxscramper how is you C++ impressive project going?
16:50:08FromDiscord<haxscramper> Spent a week figuring out how to do proper reproducible CI for it and use Conan with nim
16:50:48FromDiscord<haxscramper> There is a progress, but it is slow, if you want to see an example wrapper generated there is a hlibgit2 now
16:50:53arkanoidyou mean conan.io? never used it, just head about it
16:51:14FromDiscord<haxscramper> And libssh2 wrapper, we needed them to migrate from nimterop in some nimskull tooling
16:51:26FromDiscord<haxscramper> Yes, Conan the c++ package manager
16:52:06FromDiscord<haxscramper> My experience with it was surprisingly good, especially considering it is a c++ thing
16:52:16FromDiscord<treeform> In reply to @enthus1ast "<@107140179025735680>\: what could it": Could your server be getting stuck some place else? Do clients that connect before work?
16:54:31FromDiscord<haxscramper> But there is a reason I usually tend to recommend PMunch's futhark now, mainly because there is a lot of stuff I would need to fix and polish before it is ready in a way I want it
16:54:40FromDiscord<haxscramper> The issue tracker is full of unanswered questions
16:56:47PMunchThe Futhark issue tracker?
16:57:12PMunch@ajusa, I obviously also recommends Futhark. Although I might be slightly biased
16:57:15arkanoidit is a project that requires a lot of knowledge and attention to details. Not really yet sure how can a single person tackle it. Lot's of gratitute from the guy who wants to escape the python bubble
16:58:14FromDiscord<haxscramper> No, mine issue tracker↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
16:58:57PMunchAh right, cause there isn't a single issue in the Futhark tracker
16:59:05PMunchWho's up for some AoC? https://www.twitch.tv/pmunche
16:59:31FromDiscord<haxscramper> Probably the only paradigm shift that I had in recent memory is understanding how I can properly infer API provided by a specific header files
16:59:59arkanoid"nimble install --passl:-L<path to libclang.lib> futhark" it's the first time I see --passL in nimble install
17:00:02FromDiscord<haxscramper> Because you can't include string for example, you will also get iterators API
17:00:03FromDiscord<haxscramper> Because that's how headers work
17:00:35FromDiscord<haxscramper> Ah, and also I've come to hate dynlib
17:00:45FromDiscord<haxscramper> So annoying
17:00:59FromDiscord<haxscramper> And not integrated with anything at that
17:01:42FromDiscord<haxscramper> Like the conan integration - how do you use conan libs from nim?
17:01:54FromDiscord<haxscramper> `--passL:"@$(pwd)/conanbuildinfo.gcc" --passC:"@$(pwd)/conanbuildinfo.gcc"`
17:02:07FromDiscord<haxscramper> don't forget to run `conan install . --build=missing` and here you go
17:02:39FromDiscord<haxscramper> how do you use conan libs if you wrapped via dynlib?
17:03:05FromDiscord<haxscramper> the library has to support user-override for `dynlib`, or you have to use this weird `--dynlibOverride` or `--dynlibOverrideAll` and pass flags
17:05:35FromDiscord<haxscramper> Talking about hcparse still feels really depressing
17:06:14arkanoidthe complex disorder of the C++ world is depressing, not hcparse
17:13:20*Pyautogui quit (Quit: Connection closed)
17:16:40*Vladar joined #nim
17:38:38*kayabaNerve quit (Remote host closed the connection)
17:39:01*kayabaNerve joined #nim
17:42:00*kayabaNerve_ joined #nim
17:42:21FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GNC
17:42:57FromDiscord<TryAngle> (edit) "https://play.nim-lang.org/#ix=3GNC" => "https://play.nim-lang.org/#ix=3GND"
17:43:21*kayabaNerve quit (Ping timeout: 252 seconds)
17:44:28*pch quit (Remote host closed the connection)
17:46:14*pch joined #nim
17:49:54*noeontheend joined #nim
18:02:54Amun-Rahow can I pass tagged union's kind in "new result"?
18:03:01*neurocyte0132889 quit (Ping timeout: 256 seconds)
18:03:49FromDiscord<leorize> you can't
18:04:34FromDiscord<leorize> construct it with the `Type(field: value)` syntax instead
18:05:29*neurocyte0132889 joined #nim
18:05:29*neurocyte0132889 quit (Changing host)
18:05:29*neurocyte0132889 joined #nim
18:07:31Amun-Raah, right, thanks
18:10:38*tiorock joined #nim
18:10:38*tiorock quit (Changing host)
18:10:38*tiorock joined #nim
18:10:38*rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
18:10:38*tiorock is now known as rockcavera
18:11:13*neurocyte0132889 quit (Ping timeout: 252 seconds)
18:11:26*neurocyte0132889 joined #nim
18:11:26*neurocyte0132889 quit (Changing host)
18:11:26*neurocyte0132889 joined #nim
18:30:48FromDiscord<enthus1ast> @treeform\: the issue is not easily reproducable, i thought at first it happens when the server runs longer (and it indeed can cause the issue), but after several connection attempts it works again...
18:32:10FromDiscord<enthus1ast> but sure, can be cause in my code, ill play with it and try a few things
18:48:03*neurocyte0132889 quit (Read error: Connection reset by peer)
18:48:31*neurocyte0132889 joined #nim
18:48:31*neurocyte0132889 quit (Changing host)
18:48:31*neurocyte0132889 joined #nim
18:52:16FromDiscord<5271> how do i get a single char from user?
18:52:25FromDiscord<5271> so i just click a key and it continues
18:54:37FromDiscord<5271> does anyone know?
19:04:26FromDiscord<hmmm> import terminal -> getch()
19:05:43FromDiscord<TryAngle> when compiling is there a way to remove the produced binary right after automatically?
19:11:03FromDiscord<leorize> use `nim r`
19:12:16FromDiscord<TryAngle> works, thanks!
19:19:28*xet7 joined #nim
19:22:25*noeontheend quit (Ping timeout: 256 seconds)
19:22:31FromDiscord<5271> In reply to @hmmm "import terminal -> getch()": thanks
19:26:49FromDiscord<fumamatar> hey, im having a bit trouble with async sockets in nim. i am trying to write a basic port scanner with banner grabing. problem is that if a port is open and does not send any bytes, my socket waits forever until a line is received. what would be the best way to implement this ? a timeout on `await s.recvLine()`? Code snippet following in a second
19:27:24FromDiscord<fumamatar> sent a code paste, see https://play.nim-lang.org/#ix=3GO8
19:28:09FromDiscord<fumamatar> sent a code paste, see https://play.nim-lang.org/#ix=3GO9
19:28:51FromDiscord<Yardanico> In reply to @fumamatar "hey, im having a": a timeout would be good, yes, check out withTimeout proc
19:29:50FromDiscord<fumamatar> Thanks. I thought maybe there would be a more elegant version though, I am not sure which value I should set the timeout to :/ 1 second might be too short and I could miss ports, too many seconds would slow down the scan
19:46:50FromDiscord<treeform> In reply to @enthus1ast "<@107140179025735680>\: the issue is": If you can make a small test case that can show the bug that would be great. I need some thing that I can put into tests.
19:47:39FromDiscord<treeform> Here is test case that tests many clients connecting: https://github.com/treeform/netty/blob/master/tests/test.nim#L149
19:49:08FromDiscord<treeform> Try modifying that case to make it be more like your case and see if it breaks.
19:52:59NimEventerNew thread by Cobbycobby: Dynamic usage of arithmetic operators in nim, see https://forum.nim-lang.org/t/8673
19:57:32*kayabaNerve_ is now known as kayabaNerve
20:10:46*terminalpusher joined #nim
20:15:35FromDiscord<lantos> In reply to @PMunch "Who's up for some": missed it but looking real comfy with that fire
20:19:14FromDiscord<dom96> In reply to @fumamatar "Thanks. I thought maybe": timeouts won't slow down the scan, you're running the other scans concurrently so they'll continue to run
20:19:46FromDiscord<fumamatar> In reply to @dom96 "timeouts won't slow down": Yea I meant that a 10s timeout means a runtime of at least 10 seconds in the case that a port sends no bytes on connecting
20:20:20FromDiscord<fumamatar> still fast enough though
20:22:47FromDiscord<zidsal> Easy solution on timeout value is make it configuration
20:44:38*terminalpusher quit (Remote host closed the connection)
20:47:00*krux02 joined #nim
21:11:43*src quit (Ping timeout: 256 seconds)
21:13:44*src joined #nim
21:18:46*src quit (Quit: Leaving)
21:18:56*src joined #nim
21:32:47FromDiscord<enthus1ast> if i can i will @treeform
21:33:05*pch quit (Remote host closed the connection)
21:34:09*pch joined #nim
21:36:11*src quit (Ping timeout: 252 seconds)
21:37:03*pch_ joined #nim
21:37:12*pch quit (Read error: Connection reset by peer)
21:37:14*pch_ quit (Remote host closed the connection)
21:38:50*pch joined #nim
21:41:07*pch quit (Remote host closed the connection)
21:42:11*pch joined #nim
21:43:51*pch_ joined #nim
21:43:51*pch quit (Read error: Connection reset by peer)
21:45:14*pch_ quit (Remote host closed the connection)
21:46:20*pch joined #nim
21:55:24FromDiscord<TryAngle> how do I get the count of characters in a string?
21:58:27FromDiscord<Yardanico> you want to count how many times a single characters occurs in a string?
21:58:46FromDiscord<TryAngle> now how many characters it contains
21:58:56FromDiscord<Yardanico> `str.len`
21:59:00FromDiscord<TryAngle> the `len()` proc doesn't return the character when using other UTF8 range sometimes↵for example: using `len()` on `안녕! 你好!` returns `16`
21:59:14FromDiscord<Yardanico> yeah, you need to use unicode module for utf8
21:59:25FromDiscord<Yardanico> https://nim-lang.org/docs/unicode.html#runeLen%2Cstring
21:59:33FromDiscord<TryAngle> just import unicode and it works?
21:59:50FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3GOO
21:59:54FromDiscord<TryAngle> thanks!
22:04:50FromDiscord<treeform> In reply to @enthus1ast "if i can i": thanks!
22:10:20*Vladar quit (Quit: Leaving)
22:17:30FromDiscord<TryAngle> hmm it seems when a proc marked as {.discardable.} is the single thing in an of (case -> of) the pragma has no effect
22:17:46FromDiscord<TryAngle> (edit) "is" => "and gets called as"
22:18:05FromDiscord<Elegantbeef> Well yea how is it supposed to know it should be discarded
22:18:40FromDiscord<Elegantbeef> Each branch is resolved after the first, so i suppose if it's not in the first branch it can be reasoned
22:18:56FromDiscord<Elegantbeef> But if it's in the first branch there is 0 information that "this should be discarded"
22:19:34FromDiscord<TryAngle> oh I see
22:19:46FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3GOR
22:20:05FromDiscord<Elegantbeef> you know you can just do `discard parseText(h, node)`?
22:20:19FromDiscord<TryAngle> oh no I didn't 😂
22:20:21FromDiscord<TryAngle> thanks
22:21:07FromDiscord<Elegantbeef> Yea in that case without discarding it gets that the proc returns and says "all branches need to be of type `parsetext()`
22:21:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GOS
22:21:53FromDiscord<Elegantbeef> Though with that return it shouldnt matter
22:22:18FromDiscord<TryAngle> ah that makes sense, it's the first time I had this case
22:29:43*sagax quit (Ping timeout: 252 seconds)
22:30:16*src joined #nim
22:38:32*PMunch quit (Quit: leaving)
22:42:54*src quit (Quit: Leaving)
22:43:04*src joined #nim
22:45:31FromDiscord<evoalg> @ElegantBeef you created scanTuple ?
22:47:19FromDiscord<evoalg> Thank you for creating it!
23:00:40FromDiscord<Elegantbeef> I did, it's mostly the same implementation as scanf so i hardly did anything
23:09:15FromDiscord<evoalg> All the same, from someone new like me it helps a lot. I've found with learning Nim, often the thing that takes the longest for me (and most frustrating compared to python) is getting the data into variables / containers. So, thank you 🙂
23:13:00FromDiscord<evoalg> Also @ElegantBeef did you see that "include" trick in the aoc channel for day02? ... my mind is blown
23:14:05FromDiscord<ynfle (ynfle)> +1!
23:14:18FromDiscord<Elegantbeef> It's interesting not overly mind blowing to me though 😀
23:14:20FromDiscord<ynfle (ynfle)> It's truly mind blown
23:14:41FromDiscord<ynfle (ynfle)> Turning data into code! It's like lisp almost
23:14:58FromDiscord<Elegantbeef> Comically last year I used the nimVM for solving that operator precedence problem instead of making a lexer/evaluator
23:15:54FromDiscord<sharpcdf> what function returns the absolute path of my current nim file?
23:16:05FromDiscord<sharpcdf> ive tried `getProjectPath` but it returns an error
23:16:32FromDiscord<Elegantbeef> `getAppDir`?
23:16:51FromDiscord<Yardanico> In reply to @sharpcdf "what function returns the": you mean source file?
23:16:55FromDiscord<Yardanico> or the resulting binary?
23:17:11FromDiscord<sharpcdf> In reply to @Yardanico "you mean source file?": source file
23:17:20FromDiscord<sharpcdf> In reply to @Elegantbeef "`getAppDir`?": that returns the binary directory
23:17:25FromDiscord<sharpcdf> oh wait found it
23:17:28FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#currentSourcePath.t
23:17:32FromDiscord<sharpcdf> https://nim-lang.org/docs/system.html#currentSourcePath.t
23:17:33FromDiscord<sharpcdf> yea
23:17:34FromDiscord<sharpcdf> thanks
23:26:56*noeontheend joined #nim
23:40:34*krux02 quit (Remote host closed the connection)
23:50:45*noeontheend quit (Ping timeout: 252 seconds)
23:57:25FromDiscord<TryAngle> does this have the same effect of using `type X = object` vs `type X = ref object`? https://media.discordapp.net/attachments/371759389889003532/916115869040525332/unknown.png
23:57:40FromDiscord<Yardanico> no
23:58:00FromDiscord<Yardanico> even with type X = object nim will pass the objects into by reference if the object is large enough
23:58:11FromDiscord<Yardanico> and with bycopy the object will be _always_ passed by copy
23:58:17FromDiscord<Yardanico> you really only should use it for C FFI
23:58:36FromDiscord<Yardanico> (edit) "even with type X = object nim will pass the objects into ... by" added "procedures"
23:58:41FromDiscord<TryAngle> ah ok, I see↵thanks