<< 11-03-2021 >>

00:35:05*lritter joined #nim
00:44:34*Tlangir joined #nim
01:00:00*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:01:00*njoseph joined #nim
01:17:56*Amun_Ra quit (Ping timeout: 240 seconds)
01:18:10*gpanders_ joined #nim
01:18:25*gpanders quit (Ping timeout: 268 seconds)
01:20:06*Amun_Ra joined #nim
01:38:05FromDiscord<geekrelief> Is there a way to see the nim source after all macros have been expanded?
01:39:44*alba joined #nim
01:41:22FromDiscord<geekrelief> My code compiles fine, but when I use expandMacros on it I get an error about a reintroduced symbol
01:43:05FromDiscord<ElegantBeef> I'm uncertain if there is, you can do `echo result.repr` to dump the nim code the macro emits, or use `--expandMacro:name` in the cli
01:43:23FromDiscord<ElegantBeef> the former should be the safer option
01:43:37FromDiscord<ElegantBeef> As in it should work since the compiler doesnt stop until after it
01:44:43FromDiscord<geekrelief> I'll give those a shot, but if I recall correctly `echo result.repr` might not take me far enough
01:46:06*vsantana quit (Ping timeout: 246 seconds)
01:48:55*rockcavera quit (Remote host closed the connection)
01:51:46FromDiscord<geekrelief> Yeah, this is kinda rough. I'm trying to debug why there's a crash going on with the godot-nim bindings when creating tool scripts and orc. But I can't even see the final nim code generated because there are so many templates and macros involved.
02:12:09*lritter quit (Ping timeout: 245 seconds)
02:13:05*lritter joined #nim
02:31:00*Q-Master joined #nim
02:32:09giaco_I was refactoring my nim project into a proper nimble structure, but now compiler won't pick my declared converters (https://nim-lang.org/docs/manual.html#converters) implicitly, but if I explicit the conversion it works
02:32:42*def-- joined #nim
02:32:45giaco_ha haven't changed the module structure, the converter is in module A, the caller is in module B, B imports A
02:32:59FromDiscord<ElegantBeef> Did you not export the converter?
02:33:22giaco_yes it is exported like befe
02:33:26giaco_*before
02:33:39giaco_converter toByte*(s: string): seq[byte] = cast[seq[byte]](s)
02:33:40*idxu_ joined #nim
02:33:52giaco_(I know, it is bad, unsafe)
02:33:52FromDiscord<ElegantBeef> Can i see the repo?
02:34:34giaco_not published, using nimble as project manager for a binary project, not to develop package
02:34:47FromDiscord<ElegantBeef> ok
02:35:10FromDiscord<ElegantBeef> Well i can only say make sure you export it when you import the sub module
02:35:37FromDiscord<ElegantBeef> An exported symbol isnt exported on import into another module unless you `export symbol`
02:36:30*def- quit (Quit: -)
02:36:30*^Q-Master^ quit (Read error: Connection reset by peer)
02:36:30*idxu quit (Quit: ZNC - https://znc.in)
02:36:30*def-- is now known as def-
02:36:30*idxu_ is now known as idxu
02:37:01FromDiscord<ElegantBeef> Like if you have `c.nim` with `converter toFloat(i: int): float = i.float`, which is imported in `b.nim` and you import `b.nim` in `a.nim` you do not get `toFloat`
02:37:19FromDiscord<ElegantBeef> unless you do `export toFloat` or `export c` inside `b.nim`
02:39:46FromDiscord<ElegantBeef> Hopefully that makes sense and isnt repeating already known information
02:41:21albaWow, so interesting to listen in! :-)
02:41:35*alba quit (Quit: rcirc on GNU Emacs 27.1)
02:43:04*halloleo joined #nim
02:43:17giaco_I have main.nim that imports lib.nim that imports sublib.nim. Converter is declared in sublib.nim, main.nim calls function in lib.nim that implicitly calls conversion. If I don't write "export toByte" in lib.nim it won't compile, even if lib.nim is the only module including sublib.nim
02:43:30halloleoSorry, had the wrong nick. Now I'm me. ;-)
02:44:36FromDiscord<ElegantBeef> Can we get an example of the procedure you're calling from main?
02:44:55FromDiscord<ElegantBeef> Wait your name dictates who you are, wild?!
02:47:25giaco_sure, main.lib runs "asyncCheck asyncUdpConsumer()" that is declared in main.nim itself, that proc runs "proc parsePacket*(data: string): tuple" that is declared in lib.nim, this proc calls the implicit conversion
02:48:31FromDiscord<ElegantBeef> Are you currently implicitly using the converter or explicitly using it?
02:49:40giaco_implicitly. If I explicit it, it works
02:50:15giaco_it also works if I add "export toByte" at the bottom of lib.nim
02:50:24giaco_(not sure why)
02:51:41FromDiscord<ElegantBeef> I'd wager it's just how converters are looked up, if they arent bound in the calling scope they arent accessible inside the called procedures
02:53:08FromDiscord<ElegantBeef> Actually i just tested similar and it worked
02:54:31FromDiscord<ElegantBeef> It's a screenshot so shit i know, but main, sub, subsub https://media.discordapp.net/attachments/371759389889003532/819402877444554752/unknown.png
02:54:50FromDiscord<ElegantBeef> That compiles and runs
02:55:51giaco_that's for the test. Not really sure what's different in my project, I have to play around a bit to find out
02:56:30giaco_not I'm now using nimble anymore but straight nim c, but it shouldn't change anything
02:57:38giaco_if I move converter from sublib to lib it works
02:58:08FromDiscord<ElegantBeef> Sadly without the code i cannot do much aside from say "Yep it should work" πŸ˜›
03:01:46*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:02:07*njoseph joined #nim
03:07:05*deepend quit (Remote host closed the connection)
03:07:14giaco_yeah I know, I just wrote a minimal example like yours and it works for me too. I suspect the compiler is giving me an error that really lives somewhere else
03:07:51*arecaceae quit (Remote host closed the connection)
03:08:09*arecaceae joined #nim
03:21:36*deepend joined #nim
03:22:27*Tuatarian joined #nim
03:34:59*wasted_youth2 quit (Quit: Leaving)
03:37:19giaco_ElegantBeef, I've found the culprit
03:37:39FromDiscord<ElegantBeef> Congrats what was it?
03:37:49giaco_if the function implicitly calling the conversion has return type "tuple", it raises error
03:41:40*shmorgle joined #nim
03:49:35giaco_ElegantBeef, here's an example https://play.nim-lang.org/#ix=2SpD
03:49:55giaco_I'm probably using tuple wrongs, but this also means that the error is misleading
03:50:54FromDiscord<ElegantBeef> What happens when you give a concrete tuple?
03:52:44FromDiscord<ElegantBeef> Like i dont even see why you're using just `tuple` that scares me
03:53:25giaco_Because that's the type of a proc generated by a macro and it would be a tuple with 44 fields
03:53:40FromDiscord<ElegantBeef> Jeez
03:55:57giaco_if I give concrete tuple type, it works
03:56:06giaco_it is a quite subtle error
03:57:18FromDiscord<ElegantBeef> I dont even why you're using a tuple, with 44 fields it just seems like a concrete type def is vastly more helpful
03:58:24giaco_ElegantBeef, it is the output of this https://github.com/sealmove/binarylang
03:59:14giaco_not sure which way to go. Stop using binarylang and go with manual parsing + objects, or somehow get the best of the two worlds
04:01:17FromDiscord<ElegantBeef> What format are you parsing?
04:01:51FromDiscord<ElegantBeef> I'm just a little scared of a tuple with 44 fields πŸ˜„
04:02:55giaco_is is a string based protocol, not my invention. I need to parse udp packets and yeah each packet contains at least 44 fields
04:03:50giaco_maybe the macro contained into binaryLang exports the generated tuple type? How can I tell?
04:04:41FromDiscord<ElegantBeef> compiling with `--expandMacro:createParser`
04:06:38*D_ quit (Ping timeout: 264 seconds)
04:08:03giaco_thanks, yeah I have a tuple type that I can copypaste now. Sadly not an automatic type definition (apparently)
04:08:24FromDiscord<ElegantBeef> Time to fork the repo and emit it πŸ˜›
04:08:30giaco_isn't it possible to use a proc return type a type? :D
04:09:13*D_ joined #nim
04:09:18FromDiscord<ElegantBeef> You could but, it'd be smarter to just have a `emitTypeName`
04:11:24FromDiscord<ElegantBeef> like it'd be `createParser(udpPacket, true):`
04:11:45giaco_sadly I'm not yet confident enough writing/editing macro, and this is not an easy one
04:12:00*leorize quit (Remote host closed the connection)
04:12:34*leorize joined #nim
04:12:38FromDiscord<ElegantBeef> Well create parser is relatively simple, so i dont think it'd be too hard, all you have to do is add a new typedef before the parser is emited and use that type instead of that silly tuple
04:13:46FromDiscord<ElegantBeef> Like if you go here you can see where you'd do `type Name = tupleMeat` https://github.com/sealmove/binarylang/blob/main/binarylang.nim#L1047-L1052
04:16:21FromDiscord<ElegantBeef> But yea alternatively you can do the silly thing of this https://play.nim-lang.org/#ix=2SpI
04:16:27FromDiscord<ElegantBeef> It doesnt look nice one bit but works πŸ˜›
04:18:07*spiderstew joined #nim
04:19:03*spiderstew_ quit (Ping timeout: 260 seconds)
04:21:53giaco_yeah trying the silly thing but it wants me to execute the parser to extract the type (the "test.type()" thing)
04:27:09giaco_trying to edit macro
04:29:39FromDiscord<ElegantBeef> Oh also you can use the very non concrete `auto` return type
04:32:59giaco_I've added just for testing "type asdasd = `tupleMeat`" before line 1048 here https://github.com/sealmove/binarylang/blob/main/binarylang.nim but with expandMacro I see "type asdasd`gensym827 = tuple[....]"
04:33:44giaco_and in code "echo asdasd.typeof" results in undeclared identifier
04:35:54giaco_not sure how to deal with something named "asdasd`gensym827"
04:35:54FromDiscord<ElegantBeef> inside quote any identifiers are gensym'd
04:36:03FromDiscord<ElegantBeef> You arent supposed to be able to
04:37:15FromDiscord<ElegantBeef> if you did `let tName = ident("asdasd")` then put backticks around `tName` in the quote do it'd output an accessible asdasd
04:39:27giaco_this let expression has to be outside quote, right?
04:39:31FromDiscord<ElegantBeef> yea
04:45:55giaco_trying to create the ident like this let tName = ident("t" & name) but doesn't like the expression. I just need it to generate different idents for different createParser
04:46:54FromDiscord<ElegantBeef> well name is a `nimNode` of kind `nnkIdent` which means to extract the value you need to do `$name`
04:48:10FromDiscord<ElegantBeef> Also worth noting conventions say you could just do `ident(($name).capitalizeAscii)` assuming you pass a lowecase identifier to the macro
04:49:02FromDiscord<gogolxdong> nimble install errors `Could not download: No SSL/TLS CA certificates found.`
04:49:14FromDiscord<ElegantBeef> Windows?
04:49:26FromDiscord<gogolxdong> yes
04:49:39FromDiscord<ElegantBeef> https://forum.nim-lang.org/t/7551#47995
04:49:57FromDiscord<ElegantBeef> (edit) "https://forum.nim-lang.org/t/7551#47995" => "https://forum.nim-lang.org/t/7551"
04:49:59FromDiscord<ElegantBeef> Whoops πŸ˜„
04:51:42*wasted_youth2 joined #nim
04:51:59giaco_I'm almost there, just last lateral question: how can I print type description to stdout? Echo/dump MyType just prints the type name
04:52:44FromDiscord<ElegantBeef> `echo T()` is the easy way
04:53:19FromDiscord<ElegantBeef> you can also use `for name, field in T().fieldPairs`
04:54:13giaco_echo T() goes Error: object constructor needs an object type
04:54:46FromDiscord<ElegantBeef> Oh right it's a tuple πŸ˜„
04:55:34giaco_btw it is working! I just wanted to print it
04:55:51FromDiscord<ElegantBeef> Nice
04:57:04giaco_well, thanks a lot. Not only solved a problem, but typed my first macro edit
05:01:04FromDiscord<ElegantBeef> well here is my silly solution https://play.nim-lang.org/#ix=2SpQ
05:01:04FromDiscord<gogolxdong> Is this a recent issue?
05:01:21FromDiscord<ElegantBeef> Yes it's due to 1.4.4 it properly uses the ssl certificates
05:04:06giaco_yeah, it works!
05:04:43giaco_well, I've submitted a issue that really should be a pull request if I were confident enough writing proper macro. Thanks again!
05:06:16FromDiscord<ElegantBeef> Oh btw you can replace `tupleMeat` on the proc signatures with `tName` πŸ˜„
05:15:09FromDiscord<Seedofarson> bruh
05:28:15*narimiran joined #nim
05:39:43halloleoHey, simple question about HttpClient:
05:40:11halloleoI want to do 1000 or so getContent requests. Should I do newHttpClient for each getContent or rather have a global HttpClient object which I intialise on the first call and then reuse?
05:40:49FromDiscord<ElegantBeef> I imagine the proper way is to only close the client when you need to, reusing as much as possible
05:41:35FromDiscord<ElegantBeef> Though you might want to use an async client with X number of clients requesting at once
05:42:35*haxscramper joined #nim
05:48:54halloleo@ElegantBeef Makes sense.
05:52:42haxscramperI put the pattern matching article on HN now (I think someone asked about that yesterday).
06:01:03FromDiscord<flywind> the link?
06:03:12haxscramperhttps://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html
06:03:24FromDiscord<haxscramper> ah ok
06:03:41FromDiscord<haxscramper> https://news.ycombinator.com/item?id=26420716
06:03:48FromDiscord<haxscramper> high iq moves here
06:30:08FromDiscord<Yardanico> It's better to not share the HN link directly btw :)
06:34:30*waleee-cl quit (Quit: Connection closed for inactivity)
06:34:32FromDiscord<haxscramper> why?
06:35:31leorize[m]it's to avoid their anti bump algo
06:35:54FromDiscord<Yardanico> Because upvotes from the direct link won't really count
06:36:10FromDiscord<Yardanico> They count if people got to the post from HN top/new
06:36:22FromDiscord<Yardanico> See e.g. https://wiredcraft.com/blog/how-to-post-on-hacker-news/
06:36:24FromDiscord<haxscramper> will keep this in nimd
06:36:35FromDiscord<Yardanico> "Direct links to the post don’t allow people to vote. The link we have at the bottom of the post for example (http://news.ycombinator.com/item?id=5200847) won’t work for upvoting. We need upvotes to be made from theΒ newest pageΒ or theΒ front page."
06:37:37FromDiscord<Yardanico> Also HN protects against "voting rings"
06:40:00FromDiscord<geekrelief> @ElegantBeef turns out the expandMacros and --expandMacro flag output the same thing, except expandMacros also has an error, I guess I can ignore.
06:40:25FromDiscord<ElegantBeef> Yea that's what i figured
06:45:01*johannes joined #nim
06:49:05*johannes quit (Client Quit)
06:49:31ForumUpdaterBotNew Nimble package! intervalsets - Set implementation of disjoint intervals, see https://github.com/autumngray/intervalsets
06:57:29ForumUpdaterBotNew thread by Halloleo: Strange "lock levels differ" error with HttpClient, see https://forum.nim-lang.org/t/7607
06:57:59*halloleo quit (Quit: rcirc on GNU Emacs 27.1)
07:17:31ForumUpdaterBotNew thread by Pietroppeter: New blogpost: pattern matching (and fusion), see https://forum.nim-lang.org/t/7608
08:15:53*PMunch joined #nim
08:16:59*vegai left #nim (#nim)
08:40:58FromDiscord<Varriount> @flywind What's going on with the smart pointer module? I tried searching discord for discussion on it, but couldn't find any.
08:41:37FromDiscord<flywind> in the private channel
08:43:35Clonkk[m]I saw a PR saying it was being moved to std/ I think
08:44:08FromDiscord<ElegantBeef> Yea you did, though i assume their fancy pants private chat will say the same
08:44:29FromDiscord<Varriount> In reply to @flywind "in the private channel": Ah, I guess I don't have access to that channel.
08:44:49FromDiscord<ElegantBeef> Varriount is a good common folk i see πŸ˜„
08:45:20FromDiscord<KnorrFG> i want to write a test for a macro, can I get the NimNode that the macro returns in a test somehow?
08:45:21Clonkk[m]Plebians unite
08:46:00FromDiscord<flywind> In reply to @Varriount "Ah, I guess I": Not really, I chat with him directly.
08:46:00FromDiscord<haxscramper> In reply to @KnorrFG "i want to write": For simple implementation put macro logic in a function, and test resulting ast using `assertMatches`
08:46:28FromDiscord<haxscramper> For complex AST it is pointless and you should test generated code functions, not the structure
08:46:36FromDiscord<KnorrFG> πŸ˜„ ok
08:46:48FromDiscord<flywind> In reply to @flywind "Not really, I chat": there is no private channel I think
08:48:45FromDiscord<Varriount> In reply to @flywind "there is no private": So, what was the general motivation for moving the module to the standard library?
08:50:09FromDiscord<gogolxdong> Is there any candidate memory mapping database?
08:50:28FromDiscord<Varriount> In reply to @gogolxdong "Is there any candidate": Sqlite
08:50:46FromDiscord<gogolxdong> for windows
08:51:40FromDiscord<gogolxdong> Doesn't rocksdb or libmdbx work on windows?
08:52:11FromDiscord<Varriount> In reply to @gogolxdong "for windows": SQLite works on Windows.
08:52:31FromDiscord<Varriount> And has an in-memory mode.
08:52:41FromDiscord<flywind> In reply to @Varriount "So, what was the": I guess that's because fusion is already unbundled from compiler and new channels implementation maybe depend on smartptrs or other reasons. You could ask 4raq.
08:53:27FromDiscord<mratsim> rocksdb works on Windows but AFAIK it was a pain to build.
09:00:32FromDiscord<KnorrFG> is there somethind like dumpTree, that instead of printing the ast returns it?
09:00:52FromDiscord<KnorrFG> i struggle to go from code to ast to test the function that does the macro work
09:03:12FromDiscord<flywind> you can upvote this PR https://github.com/nim-lang/Nim/pull/17209/files
09:04:53*ubert joined #nim
09:09:33FromDiscord<gogolxdong> https://rocksdb.org.cn/doc/Building-on-Windows.html
09:11:46FromDiscord<gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=2SqA
09:12:06FromDiscord<mratsim> In reply to @KnorrFG "is there somethind like": dumpASTgen
09:14:08FromDiscord<KnorrFG> thanks πŸ™‚
09:29:10FromDiscord<gogolxdong> nimdbx is promising but with building issue on Windows
09:29:39FromDiscord<gogolxdong> key-value memory mapping database on Windows
09:52:41*kinkinkijkin quit ()
09:52:58*kinkinkijkin joined #nim
10:03:21Clonkk[m]Does nimble supports dynamic linking in multiple files in a nimble package ? Cause whenever I use an import that dynamically link to a library in more than one file the gcc complains about symbol not declared or undefined reference (depending on how exactly I do it); while the linking works perfectly fine If I only use the import in one file
10:11:43*lritter quit (Ping timeout: 245 seconds)
10:19:51*sz0 joined #nim
10:22:32*sz0 quit (Max SendQ exceeded)
10:23:31*sz0 joined #nim
10:26:13*sz0 quit (Max SendQ exceeded)
10:27:12*sz0 joined #nim
10:29:54*sz0 quit (Max SendQ exceeded)
10:30:54*sz0 joined #nim
10:33:36*sz0 quit (Max SendQ exceeded)
10:34:34*sz0 joined #nim
11:03:29*krux02 joined #nim
11:12:23FromDiscord<Clyybber> @flywind for https://github.com/nim-lang/Nim/pull/17334 I think it's better/less confusing to extract the procs that should be shared between bitops and sets into a new file
11:15:49FromDiscord<flywind> ok
11:17:21*Tuatarian quit (Ping timeout: 264 seconds)
11:17:31*Tuatarian joined #nim
11:20:41*Tuatarian quit (Read error: Connection reset by peer)
11:21:03*Tuatarian joined #nim
11:39:35*Vladar joined #nim
11:50:18FromDiscord<Clyybber> @Araq https://github.com/nim-lang/Nim/pull/17308 is ready
11:56:41*synthmeat left #nim ("WeeChat 3.0.1")
12:09:32*SebastianM joined #nim
12:13:09SebastianMhey guys is there any equivalent of python's json.dump and json.load? After reading docs I think that maybe % and parsejson but I'm not sure.
12:17:51FromDiscord<Rika> $ for dump if youre looking for a string
12:17:57FromDiscord<Rika> parsejson for load
12:22:31SebastianM@Rika Great thank you for your answer.
12:28:30FromDiscord<Rika> does `var_string.add(string)` compile to the same code as `var_string &= string`?
12:28:55FromDiscord<Rika> ah nvm, misread the code
12:36:41FromDiscord<Firefell> Nim is also used to create malware πŸ™‚ https://threatpost.com/nim-based-malware-loader-spreads-via-spear-phishing-emails/164643/
12:37:18FromDiscord<Firefell> When a new channel "Virus" ? πŸ˜‰
12:37:33FromDiscord<Rika> #malware
12:37:43FromDiscord<Firefell> Yes
12:37:58PMunchI can see why though, Nim is a good fit for malware
12:38:22PMunchSmall stand-alone binaries, good performance, and low-level access to hardware
12:39:06FromDiscord<Firefell> Another victory for Nim lang
12:39:15PMunchOf course this is never highlighted in the articles, they only mention that "it's probably to avoid detection because people are unfamiliar with the language"...
12:39:53PMunchI wonder how true that is, or if the malware authors simply chose Nim because it's a good language to write malware in
12:40:07PMunchMaybe that should be my next Nim project :P
12:40:08FromDiscord<Firefell> https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/
12:40:30FromDiscord<Rika> In reply to @PMunch "I wonder how true": it really is likely because of people being unfamiliar
12:41:46PMunchI just don't see how it would be considerably different from C..
12:42:03FromDiscord<Araq> different stdlib, different detection
12:42:04FromDiscord<Rika> pmunch because the c output is "noisier" probably
12:42:14PMunchHmm, maybe
12:42:29FromDiscord<Firefell> In reply to @Rika "pmunch because the c": yes because not write directly in C
12:42:34FromDiscord<Rika> are runes in the unicode module mapping to graphemes or code points?
12:43:23PMunchI guess I'm not familiar enough with malware fingerprinting..
12:44:17federico3also https://www.technadu.com/ta800-group-using-new-initial-access-tool-nimzaloader/253752/ https://threatpost.com/nim-based-malware-loader-spreads-via-spear-phishing-emails/164643/
12:46:12PMunch"Makes use of JSON in C&C communications", very likely because using Json in Nim is super easy
12:47:25FromDiscord<Rika> In reply to @Rika "are runes in the": asked this at an unfortunate time so ill just bump it now since discussion has stopped
12:48:44FromDiscord<Rika> ah its in the docs i didnt see
12:48:47FromDiscord<Rika> xd
12:49:24FromDiscord<Clyybber> In reply to @Clyybber "<@!413679055897100289> https://github.com/nim-lang/": @Araq in case you missed my previous ping
12:49:27FromDiscord<Clyybber> (edit) "In reply to @Clyybber "<@!413679055897100289> https://github.com/nim-lang/": @Araq in case you missed my previous ping ... " added ":)"
12:50:54*rockcavera joined #nim
12:55:53*SebastianM quit (Quit: -a- Bye Bye)
13:02:59FromDiscord<Araq> indeed I did
13:06:23*madnight joined #nim
13:07:08PMunchNew keyboard firmware stream today at 5 UTC. This time I'll send keystrokes over USB, and get the matrix of the actual keyboard working
13:07:13*sknebel_ joined #nim
13:07:35*Cthalupa- quit (Ping timeout: 256 seconds)
13:07:35*madnight_ quit (Ping timeout: 256 seconds)
13:07:36*Ekho quit (Ping timeout: 256 seconds)
13:07:36*sagax quit (Ping timeout: 256 seconds)
13:07:37*sknebel quit (Ping timeout: 256 seconds)
13:07:39*Cthalupa joined #nim
13:12:31*kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in)
13:12:58*kitech1 joined #nim
13:15:21*Ekho joined #nim
13:22:27*sknebel_ is now known as sknebel
13:23:10FromDiscord<Araq> you should use fewer `.emit`s
13:25:10*tane joined #nim
13:25:55PMunchThey're just so easy to use :P
13:26:13PMunchBut I'll try to avoid it
13:27:03*sknebel quit (Max SendQ exceeded)
13:27:19*sknebel joined #nim
13:30:03FromDiscord<Araq> think about Nim's future, we won't compile to C forever, eventually we'll move to LLVM or Rust's Cranelift
13:30:54FromDiscord<mratsim> we will compile and bow down to our JS overloads.
13:30:59FromDiscord<mratsim> (edit) "overloads." => "overlords."
13:33:18Clonkk[m]<FromDiscord "<Araq> think about Nim's future,"> Wouldn't that big an issue to support both C and C++ interop ?
13:33:25Clonkk[m]> <@freenode_FromDiscord:matrix.org> <Araq> think about Nim's future, we won't compile to C forever, eventually we'll move to LLVM or Rust's Cranelift
13:33:25Clonkk[m] * Wouldn't that be an issue to support both C and C++ interop ?
13:36:08PMunchI'm pretty sure that was a joke
13:36:33FromDiscord<Rika> ngl i actually kinda got a cold sweat from that
13:36:44Clonkk[m]That Nim will eventually compile to LLVM directly ?
13:37:02PMunchBut emits are bad for the same reason, it mixes weird things into the code that might break in unexpected ways. And it just looks super hacky.
13:38:07ForumUpdaterBotNew Nimble package! nimkalc - An advanced parsing library for mathematical expressions and equations, see https://github.com/nocturn9x/nimkalc
13:41:25FromDiscord<Araq> I wasn't joking... πŸ˜•
13:41:38FromDiscord<Araq> @Clonkk nlvm already does that
13:42:55Clonkk[m]I've looked at the readme of nlvm but never used it. I'm just wondering if LLVM IR as a target still allows for C++ interop ? Cause losing C++ interop would be a big loss
13:46:15FromDiscord<Araq> C++ interop is nice but can be done differently, for example, by having a tool that produces bridging code, like Swig tries to
13:47:13PMunchKeyword "tries to"
13:47:51FromDiscord<Araq> the idea can work out, Swig is just a bad implementation
13:49:01Clonkk[m]Wouldn't you lose compile-time C++ feature then ?
13:49:28Clonkk[m](To be fair, I'm not sure it's used much in Nim / C++ interop)
13:49:41FromDiscord<Araq> what is compile-time C++?
13:50:15Clonkk[m]Recursive template was what I had in mind
13:51:26FromDiscord<Araq> well ... bet there are more people out there who care about precise debugger support for Nim than there are who care about C++ recursive template interfacing
13:51:49FromDiscord<KnorrFG> why does the last line not work? https://play.nim-lang.org/#ix=2SrS
13:52:45Clonkk[m]<FromDiscord "<Araq> well ... bet there are mo"> This is probably true. I was just curious about the limit of LLVM as a backend
13:55:14FromDiscord<Goel> Which is the best way to ask for adding a specific binding for a library for Nim? Open a Topic in the Forum of Nim or an Issue on Github page of Nim or where?
13:55:33Clonkk[m]I remember reading a "needed library" issue on github
13:56:10federico3https://github.com/nim-lang/needed-libraries
14:01:32FromDiscord<Araq> er, @Clyybber why don't we mangle like foo34_33 ?
14:01:42FromDiscord<Araq> (symId_moduleId)
14:02:14FromDiscord<Araq> why do we need the signature hash, it's outdated junk
14:10:00ForumUpdaterBotNew post on r/nim by sigzero: Pattern matching in Nim, see https://reddit.com/r/nim/comments/m2qtt7/pattern_matching_in_nim/
14:17:14*ubert quit (Remote host closed the connection)
14:17:30*Vladar quit (Remote host closed the connection)
14:18:08ForumUpdaterBotNew question by user2417619: Nim lang GLM and OpenGL matrix pointer uniform issues, see https://stackoverflow.com/questions/66584318/nim-lang-glm-and-opengl-matrix-pointer-uniform-issues
14:18:14*ubert joined #nim
14:23:47*Vladar joined #nim
14:28:50FromDiscord<Clyybber> In reply to @Araq "er, <@!107882072974065664> why don't": I think disrupteks mangling did that
14:29:57FromDiscord<Araq> yeah but there are dragons to watch out for
14:30:02FromDiscord<Clyybber> yeah
14:34:01FromDiscord<Araq> happen to remember these dragons?
14:36:28FromDiscord<KnorrFG> @Araq this might be a bug, and it will cost you probably two seconds to figure it out. It would be nice if you took a quick glance https://play.nim-lang.org/#ix=2SrS
14:40:05FromDiscord<Araq> aMacro(a: int) is not a valid call syntax
14:40:31FromDiscord<Araq> `aMacro (a: int)` works
14:41:14FromDiscord<Araq> the secret to understanding Nim is to realize that syntax and semantics are distinct, macros cannot change the syntax
14:41:46FromDiscord<KnorrFG> but in a function definition, that syntax is valid, isnt it?
14:41:52FromDiscord<Araq> the benefit is that we can always build a parse tree without having to perform symbol lookups or macro expansions
14:42:05FromDiscord<Araq> a function def starts with proc/func/iterator/etc
14:42:14FromDiscord<KnorrFG> ah
14:42:30FromDiscord<Araq> the usual design is
14:42:42FromDiscord<Araq> `proc foobar(a: int) {.myMacro.}`
14:43:18FromDiscord<KnorrFG> i just want my macro to define a function and pass (among other things) the functions signature
14:43:39FromDiscord<KnorrFG> i want it to define a type and a function to be precise
14:46:04FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Ssi
14:46:09FromDiscord<KnorrFG> because he doesnt like the = sign
14:46:19FromDiscord<KnorrFG> (edit) "he" => "nim"
14:46:37FromDiscord<Araq> your DSL is not idiomatic either way
14:46:47FromDiscord<KnorrFG> why?
14:46:59FromDiscord<mratsim> why dash?
14:47:04FromDiscord<mratsim> remove it
14:47:06FromDiscord<Araq> because Nim code doesn't use `-` for enumerations
14:47:39FromDiscord<KnorrFG> because there are multiple attributes per element, so u write that more often, and i wanted to reserve the shortest syntax for the most commonly used part
14:48:03FromDiscord<KnorrFG> if i remove it, i cant distinguish new elements from theyr configuration
14:48:18FromDiscord<KnorrFG> (edit) "theyr" => "their"
14:48:25FromDiscord<Rika> indent level?
14:48:36FromDiscord<KnorrFG> could have sub elements
14:49:07FromDiscord<KnorrFG> ill try to reproduce something like qml
14:49:15FromDiscord<Araq> to describe UIs declarative, check out how Karax does it
14:50:46FromDiscord<Araq> it you want to departure more than that from Nim syntax, you should use `mkui """ <stuff here> """` and parse it yourself.
14:57:20*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
14:57:39*kitech1 joined #nim
15:00:38FromDiscord<Clyybber> In reply to @Araq "happen to remember these": one thing for example was that local still need the sighash most of the time afair
15:01:04FromDiscord<Clyybber> but actually maybe they don't with the idmoduleId sceme
15:01:08FromDiscord<Clyybber> (edit) "idmoduleId" => "_\_id\moduleId"
15:01:18FromDiscord<Clyybber> (edit) "sceme" => "scheme"
15:10:45*PMunch quit (Quit: leaving)
15:13:18FromDiscord<Araq> just tried it
15:13:24FromDiscord<Araq> nothing breaks so far
15:30:53*fredrikhr joined #nim
15:42:39ForumUpdaterBotNew thread by Drkameleon: Compile Nim to JavaScript from inside Nim?, see https://forum.nim-lang.org/t/7609
15:44:40ForumUpdaterBotNew thread by SebastianM: Exception handling without doing rest of the program, see https://forum.nim-lang.org/t/7610
15:57:59*Vladar quit (Quit: Leaving)
16:00:41ForumUpdaterBotNew thread by Miran: Nim online meetup, Friday 12th at 4pm UTC, see https://forum.nim-lang.org/t/7611
16:06:16*narimiran_ joined #nim
16:06:16*narimiran quit (Ping timeout: 276 seconds)
16:12:40*waleee-cl joined #nim
16:14:43ForumUpdaterBotNew thread by Marcomq: Running Nim on android, see https://forum.nim-lang.org/t/7612
16:16:37*asdflkj joined #nim
16:38:48reversem3using nimscript proc listFiles , does not `let x = listFiles("./")` correct ?
16:38:58reversem3https://nim-lang.org/docs/nimscript.html#listFiles%2Cstring
16:39:16*rockcavera quit (Remote host closed the connection)
16:40:34*haxscramper quit (Remote host closed the connection)
16:41:00*haxscramper joined #nim
16:47:14*rockcavera joined #nim
16:49:47*PMunch joined #nim
16:51:03PMunchTodays stream is going to be a bit late. On my way home I had to do a little bit of vehicle rescue for a neighbour who was stuck :P
16:51:15*salvipeter[m] joined #nim
16:51:20FromDiscord<mratsim> Crystal reaching 1.0 https://github.com/crystal-lang/crystal/pull/10500
16:53:25FromDiscord<Araq> "Error: unhandled exception: Text file busy"
16:53:35FromDiscord<Araq> Text file busy?
16:54:13FromDiscord<mratsim> This reeks of windows
16:54:31FromDiscord<Araq> https://builds.sr.ht/~araq/job/456190 it's BSD
16:55:02FromDiscord<haxscramper> IIRC it tries to write in binary file in parallel or something like that
16:57:41reversem3the mkDir proc should be mkDir("dir_name") correct
16:57:44reversem3https://nim-lang.org/docs/nimscript.html#listFiles%2Cstring
16:58:42reversem3Getting error Error: expression 'mkDir("garbage/")' has no type ?
16:59:17FromDiscord<haxscramper> mkdir does not have any return type
16:59:23FromDiscord<haxscramper> So expression does not have a type
17:00:22*salvipeter[m] quit (Quit: authenticating)
17:00:55reversem3so what am I doing wrong then ?
17:00:59*salvipeter[m] joined #nim
17:01:09*fredrikhr quit (Ping timeout: 264 seconds)
17:01:32FromDiscord<haxscramper> can you show the code?
17:02:04reversem3ok I get it now you can only call mkDir("dir") you can assign it to a variable
17:02:10reversem3 * ok I get it now you can only call mkDir("dir") you can't assign it to a variable
17:03:10FromDiscord<haxscramper> yes; you probably want something like `proc getCreateDir(dir: string): string = mkDir(dir); return cwd() / dir`
17:03:17FromDiscord<haxscramper> If I understand you correctly
17:08:19*salvipeter[m] is now known as sunwukong
17:12:11FromDiscord<zajrik> hax I love you. Pattern matching is so nice
17:12:43reversem3Yes thank you
17:14:47FromDiscord<zajrik> It didn't make too much of a difference in this specific code block but I feel that the pattern matching variant is a lot cooler to look at lol↡https://i.imgur.com/x3DyPy3.png↡https://i.imgur.com/ZJtWBjb.png
17:16:24FromDiscord<zajrik> actually, I can just return that employee directly rather than declaring the employee var. Further optimizations :blobsunglasses:
17:19:50FromDiscord<zetashift> Yes I was also very happy to see pattern matching included in fusion!
17:20:30FromDiscord<zajrik> @Solitude don't hate :ablobsobbbbbb:
17:21:47FromDiscord<zajrik> I've been using 4-char-width tabs my entire programming career. It was hard enough to adapt to spaces over tabs. I just can't bring myself to do 2 spaces
17:23:12FromDiscord<zajrik> https://i.imgur.com/SkqxI0a.png
17:23:17FromDiscord<zajrik> :blobnauseated:
17:30:09*letto quit (Quit: Konversation terminated!)
17:31:50FromDiscord<zajrik> I mean, I guess it doesn't look too bad. I just struggle to grok blocks at a glance without larger indentation. It's hard enough for me without braces since I don't come from another significant-whitespace lang really, lol
17:32:07*letto joined #nim
17:34:08FromDiscord<haxscramper> Well, yeah, two spaces is kind of
17:34:27FromDiscord<haxscramper> A bit too little sometimes
17:34:53ForumUpdaterBotNew thread by Geekrelief: Bad destructor causing crash in arc/orc?, see https://forum.nim-lang.org/t/7613
17:36:43FromDiscord<zajrik> In reply to @haxscramper "A bit too little": Exactly
17:40:27FromDiscord<haxscramper> In reply to @zajrik "https://i.imgur.com/SkqxI0a.png": Though I think `?=` was not that good of an idea. and instead I would advise to use `body.matches({ "worAddress": "emailAddress" : (getStr: @email) }})`
17:40:49FromDiscord<haxscramper> slightly more verbose, but has this nice left-to-right logic order
17:41:21FromDiscord<zajrik> I don't mind the reversed logical order as it's similar to assignment matching in rust so I'm used to it
17:42:11FromDiscord<haxscramper> Yes, I was thinking of `if let Some(capture) = expr` when adding `?=` (in nim it would be `if Some(@capture) ?= expr`)
17:42:20FromDiscord<zajrik> Exactly
17:43:22FromDiscord<zajrik> It's a good parallel for Rust devs (not that I consider myself one, just dabbled) and I think keeping it succinct in conditionals is generally nice
17:48:25FromDiscord<zajrik> as long as I know I'm looking at patterns being matched, `value matches pattern` and `pattern matches value` are no different in my head. I can see how it might be confusing at a glance to someone new to it though. I definitely wouldn't consider `?=` to be "not that good of an idea", especially in the Nim landscape where introducing operators for common operations is the norm
17:49:51FromDiscord<haxscramper> It is going to stay in anyway, because `Some(@capture) ?= expr` is just too good to give away
17:50:03reversem3I know the example is taking and html file and parsing out xml but can I use the parsexml to actually read in an xml file and extract elements , tags, attributes?
17:50:05reversem3https://nim-lang.org/docs/parsexml.html
17:50:07FromDiscord<zajrik> Absolutely. That's the pinnacle of matching lol
17:50:23reversem3 * I know the example is taking an html file and parsing out xml but can I use the parsexml to actually read in an xml file and extract elements , tags, attributes?
17:50:24FromDiscord<haxscramper> it took me
17:50:39FromDiscord<haxscramper> four `if let` implementations I think, before I got to this one
17:51:17reversem3basically looking for an alternative to lxml and Etree for python
17:51:35FromDiscord<zajrik> Being able to capture Option values with pattern matching is 90% of what I wanted pattern matching for in the first place. I have an open issue on the Gara repo for well over a year now because their matching for Options was broken https://github.com/alehander92/gara/issues/24
17:51:46FromDiscord<zajrik> :drakeLUL:
17:52:12FromDiscord<zajrik> Speaking of, I suppose I can close that now that fusion is available
17:55:30FromDiscord<Solitude> reversem3, are you asking if you can parse xml with parsexml?
17:55:39FromDiscord<zajrik> In reply to @haxscramper "four `if let` implementations": I'm interested in seeing what your other ideas for it were. Not because I don't care for `?=`, because I think it's honestly perfect, but just out of curiosity
17:56:01reversem3<FromDiscord "<Solitude> nixfreak, are you ask"> Yes I am
17:56:31reversem3Not finding very good examples how to do it unlike lxml
17:57:08PMunchStream is live, ready for some more keyboard firmware programming! https://www.twitch.tv/pmunche
17:57:14FromDiscord<Solitude> https://nim-lang.org/docs/xmlparser.html
17:57:17FromDiscord<Solitude> use this
17:57:19reversem3I see loadXml loads an xml then returns a xmlnode type
17:58:05reversem3but how can I extract a tag or attribute in the xml file itself
17:58:17FromDiscord<haxscramper> In reply to @zajrik "I'm interested in seeing": Most of the earlier ideas revolved around actually writing `if let` statement, in different variations, and I tried to implement https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md (interesting parts from it at least)
17:58:55FromDiscord<haxscramper> Until I realized it would be much simpler to just concentrate on expression itself
17:59:22FromDiscord<haxscramper> And it was the right choice I think, because it is now possible to do chains/alternatives and so on
17:59:23FromDiscord<haxscramper> Tuples
17:59:32FromDiscord<zajrik> oh that's a good thing to have. Does that work with `?=`? like `if Some(@foo) ?= expr1 and Some(@bar) ?= expr2`?
18:01:34FromDiscord<haxscramper> !eval import fusion/matching, options; echo (Some(@foo) ?= some(12)) and (Some(@bar) ?= some(2))
18:01:37NimBottrue
18:02:00FromDiscord<haxscramper> A little more parenthesis is needed because `?=` is treated like an assignment operator, but otherwise it works fine
18:02:14FromDiscord<zajrik> Okay, I thought that might be the case
18:02:55FromDiscord<haxscramper> Though you can just ``template `??????`(a, b: untyped): untyped = matches(a, b)``
18:03:08FromDiscord<haxscramper> And `Some(@a) ?????? some(12)`
18:03:12*rockcavera quit (Remote host closed the connection)
18:03:18FromDiscord<zajrik> lol
18:04:16FromDiscord<haxscramper> `template `πŸ€”`(a, b: untyped): untyped = matches(a, b)`
18:04:56FromDiscord<zajrik> does Nim have unicode support in idents? I didn't realize
18:05:19FromDiscord<haxscramper> yes it does, you don't even need stropping
18:05:35FromDiscord<haxscramper> !eval let Π–Π–Π– = 12; echo Π–Π–Π–
18:05:37NimBot12
18:05:43FromDiscord<zajrik> stropping meaning backticks?
18:05:49FromDiscord<haxscramper> yes
18:05:59FromDiscord<zajrik> Had to make sure
18:07:01FromDiscord<zajrik> I can't wait for the day that editor support is on par with like
18:07:05FromDiscord<zajrik> TypeScript
18:08:33FromDiscord<haxscramper> I think I need to use vscode for some time, because I'm clearly missing out on this experience
18:09:06FromDiscord<zajrik> Yeah? I use VSCode myself since I primarily work with TypeScript and the Nim support is ehhhhh
18:09:48FromDiscord<zajrik> It's good enough but the plugin doesn't have LSP integrated yet so it's just build-on-save which means waiting sometimes multiple seconds after saving to see compiler warnings/errors
18:13:54FromDiscord<zajrik> Sadly it's at about the same point it was when I last did a project in Nim which was probably around the time of that issue I had on the Gara repo. I don't feel I have the capability to do something about it myself though so I'm just stuck waiting
18:13:57FromDiscord<zajrik> :ablobsweats:
18:33:54*blackpawn quit (Ping timeout: 260 seconds)
19:02:57*abm joined #nim
19:03:06ForumUpdaterBotNew thread by HJarausch: AtomicMax how to implement it? , see https://forum.nim-lang.org/t/7614
19:03:52*birdspider joined #nim
19:06:41*zedeus_ is now known as zedeus
19:12:22*sagax joined #nim
19:17:12PMunchAnyone good at linking headers in Nim?
19:17:23PMunchI'm getting undefined reference to X issues..
19:37:44*wasted_youth2 quit (Quit: Leaving)
19:51:14*wasted_youth2 joined #nim
20:00:02*D_ quit (Ping timeout: 264 seconds)
20:04:31*birdspider quit (Quit: Leaving)
20:12:06*D_ joined #nim
20:13:28*asdflkj quit (Max SendQ exceeded)
20:13:41FromDiscord<Seedofarson> haha
20:19:28*asdflkj joined #nim
20:34:45leorizePMunch: I can help
20:34:54PMunchA bit too late :P
20:35:05PMunchUnless you're watching the stream and know what's going on right now
20:35:46leorizeah, ok :P
20:37:39*narimiran_ quit (Ping timeout: 246 seconds)
20:56:42*haxscramper quit (Remote host closed the connection)
20:57:06*haxscramper joined #nim
20:57:12*haxscramper quit (Remote host closed the connection)
20:58:47*haxscramper joined #nim
20:59:40*haxscramper quit (Remote host closed the connection)
21:00:58FromDiscord<Seedofarson> https://github.com/juancarlospaco/faster-than-requests
21:01:00FromDiscord<Seedofarson> just found this gem
21:01:10FromDiscord<Seedofarson> its a python wrapper for nim HTTP client
21:14:37*NimBot joined #nim
21:15:16FromDiscord<ο½Œο½‰ο½Œο½ο½ˆ β–Έ πŸŽ€> sent a code paste, see https://play.nim-lang.org/#ix=2SuU
21:18:22FromDiscord<ο½Œο½‰ο½Œο½ο½ˆ β–Έ πŸŽ€> (assuming that the application importing those dlls is not written in nim and/or does not init the GC/etc. itself)
21:22:27*sz0 quit (Quit: Connection closed for inactivity)
21:24:41PMunch@Seedofarson, nice way to show Python users that Nim exists :)
21:24:47PMunchAnd how it can benefit them
21:25:09FromDiscord<Seedofarson> Yeah
21:25:15FromDiscord<Seedofarson> Nim speed go brrrrrrrrr
21:25:38FromDiscord<ElegantBeef> More like "Nim is not reliant on programmer contracts"
21:25:41FromDiscord<Seedofarson> I wonder how pyinstaller and Nimpy get along
21:25:58PMunch@ElegantBeef, what do you mean?
21:26:16FromDiscord<Seedofarson> In reply to @ElegantBeef "More like "Nim is": Huh
21:26:18FromDiscord<ElegantBeef> Python is loaded full of "The interpreter doesnt enforce this but it's a convention to tell others dont touch it"
21:26:29FromDiscord<mratsim> ah the starting underscore
21:26:34FromDiscord<ElegantBeef> `_Name` for instance of `_` identifiers
21:26:38FromDiscord<ElegantBeef> (edit) "of" => "or"
21:26:46PMunchAaah right
21:27:03PMunchYeah I mention that quite a bit when streaming I've noticed
21:27:23PMunch"Oh by the way, the reason we have to wrap it like this in Nim is because Nim is actually strict about stuff"
21:27:43FromDiscord<ElegantBeef> Also no first class enums
21:28:02FromDiscord<ElegantBeef> import the enums module so you can get a primitive!
21:38:10FromDiscord<treeform> about `enum`s, I wish nim would forward propagate `enum` types, so that we could have enum named `Left` and nim would figure out that which `Left` ... css `Left` or typography `Left` I mean. Non of this ↡Hungarian notation `cssLeft` and `tyLeft` only for `enum`s crap...
21:38:41FromDiscord<ElegantBeef> I mean it can do inference
21:38:53FromDiscord<treeform> It cannot
21:40:47FromDiscord<ElegantBeef> Yea i thought it could when using pure enums but i'm wrong
21:41:16FromDiscord<treeform> The rest of the language does not use Hungarian notation, but it's required for enums.
21:43:59FromDiscord<ElegantBeef> Hmm with the `caseStmtMacros` we can actually do part of that
21:44:14FromDiscord<ElegantBeef> But obviously that doesnt save all the cases
21:44:38*fputs quit (Quit: WeeChat 3.0.1)
21:45:59FromDiscord<ElegantBeef> Ah i guess nevermind since we cannot override the default case stmt
21:55:26FromDiscord<dom96> "However right now, it is recommended that all new code is written with the `--gc:orc` switch. " (from https://news.ycombinator.com/item?id=26428774)
21:55:29FromDiscord<dom96> Are we recommending this?
21:56:15PrestigeNim v2? As in 2.0?
21:56:33PrestigeI thought we were quite a ways from that
22:03:48FromDiscord<zidsal> how do people structure test that are testing model generation? I was hoping to make a test suit with my inputs and check that the model is generated correctly. The problem with this is that, if you don't call the macro before the suit you'll get errors as `'export' is only allowed at top level` as the macro defines types! am I going to have to make a test file each variation of test?
22:03:57FromDiscord<zidsal> (edit) "generation?" => "generation with macros?"
22:05:57*ubert quit (Ping timeout: 260 seconds)
22:06:17FromDiscord<Clyybber> @Araq I made the compiler fully bootstraps with --gc:arc
22:07:42*PMunch quit (Quit: leaving)
22:15:14FromDiscord<zidsal> infact is my issue caused by weirdness in the unit test module? https://play.nim-lang.org/#ix=2Sv3 I can get it to fail with a small example, but if I convert that a regular nim program and do some logic with the macro later it works
22:15:26FromDiscord<zidsal> (edit) "infact is my issue caused by weirdness in the unit test module? https://play.nim-lang.org/#ix=2Sv3 I can get it to fail with a small example, but if I convert that ... a" added "to"
22:19:06FromDiscord<zetashift> In reply to @Clyybber "<@!413679055897100289> compiler fully bootstraps": That's pretty big no?
22:19:23FromDiscord<Clyybber> yeah :D
22:21:06FromDiscord<dom96> @zidsal the unit test module uses macros pretty heavily so I wouldn't be surprised if you ran into a buggy interaction
22:21:38FromDiscord<dom96> might need to write your tests in the boring old `block: ...; doAssert ...` style πŸ™‚
22:28:46FromDiscord<dom96> https://github.com/nim-lang/Nim/pull/17342
22:28:56FromDiscord<dom96> `when defined(gcArc)` hehe
22:29:26*rockcavera joined #nim
22:29:31FromDiscord<dom96> nice job πŸ™‚
22:30:07FromDiscord<Clyybber> thanks : )
22:32:31FromDiscord<zidsal> @dom96 boo, I suspected as much maybe its time I write a testing library
22:32:59FromGitter<deech> Wow has that had any effect on perf?
22:34:29FromDiscord<Clyybber> deech: Probably, but only when compiled with arc, which you won't be able to compare since it didn't use to compile with arc :P
22:34:36ForumUpdaterBotNew post on r/nim by nuL808: Is this the correct way to read into a file?, see https://reddit.com/r/nim/comments/m32nka/is_this_the_correct_way_to_read_into_a_file/
22:46:19FromDiscord<ajusa> Are there any bindings for maxmind geoip? I saw https://github.com/FedericoCeratto/nim-mmgeoip but that is for the old version, which is no longer supported
22:49:10federico3I can refresh it
22:50:23FromDiscord<ajusa> federico3: Oh wait are you the author?
22:50:46federico3yep
22:51:26FromDiscord<geekrelief> In reply to @ITR "Does anything like this": There are two things that allow live coding with nim and godot. https://github.com/dsrw/enu and https://github.com/geekrelief/gdnim
22:51:37FromDiscord<ajusa> Hm, the issue is that it needs to be updated to wrap https://github.com/maxmind/libmaxminddb instead, since they updated the entire format. I would really appreciate it if you could update it to support that though!
22:52:31FromDiscord<ElegantBeef> Thirdly you could use nimscript interop for that live editing but have fun wrapping the calls πŸ˜„
22:52:31federico3I'll do it
22:54:20FromDiscord<geekrelief> In reply to @haxscramper "If you want to": Yes I'm doing this with gdnim
22:55:37FromDiscord<geekrelief> In reply to @ElegantBeef "Thirdly you could use": Yeah I think I'm going to try nimscripter again!
22:56:22FromDiscord<ElegantBeef> Cool
22:56:43FromDiscord<ITR> In reply to @geekrelief "There are two things": oo that's cool
22:56:51FromDiscord<ElegantBeef> It clearly needs some tweaking but it's a good proof of concept impl
22:56:56FromDiscord<geekrelief> I have a better understanding of how Godot deals with data now
22:57:14FromDiscord<geekrelief> using Nodepaths we can access any node, function, parameter
22:57:19FromDiscord<ElegantBeef> Like the conversation earlier someone needs to make the VM go vrooom
22:57:35FromDiscord<ElegantBeef> (edit) "Like the conversation earlier ... someone" added "mentioned"
22:58:16FromDiscord<geekrelief> I haven't worked my way through the entire conversation. but enu is pretty fast to update. not as fast as Javascript updating though
22:58:44FromDiscord<geekrelief> Still it's much faster than tcc compiling
22:59:04FromDiscord<ElegantBeef> Yea remaking the interpreter is very quick
22:59:21FromDiscord<ElegantBeef> Atleast the way i do it requires remaking the interpreter since my goal was just "Glue these two things together"
22:59:26*tane quit (Quit: Leaving)
23:00:30FromDiscord<ElegantBeef> Sorta related i'm still surprised no one noted the forced matching on the godot pragmas πŸ˜„
23:00:34FromDiscord<nikki> In reply to @treeform "The rest of the": definitely a thing i've been meh about too re: nim
23:05:31FromDiscord<ElegantBeef> Hey if this reversed type inference was implemented it'd work for literals of all kinds! πŸ˜›
23:06:18FromDiscord<geekrelief> In reply to @ElegantBeef "Sorta related i'm still": yeah I did, but i didn't care to fix it haha My PRs were for most useful things :p
23:06:24FromDiscord<geekrelief> (edit) ":p" => "πŸ˜‹"
23:06:36FromDiscord<ElegantBeef> Lol two lines! πŸ˜›
23:06:53FromDiscord<geekrelief> actually it's kind of all over the codebase
23:06:56FromDiscord<ElegantBeef> honestly though i didnt realize macros had a eqIdent, i always use `nimNormalizeIdent` or whatever
23:07:06FromDiscord<geekrelief> I didn't either until your pr!
23:07:15FromDiscord<geekrelief> I usually converted the strings to with ident before comparison
23:07:23FromDiscord<geekrelief> but I was trying to stay in line with the existing code base
23:07:39FromDiscord<ElegantBeef> Yea i also want to add varblock support
23:07:44FromDiscord<ElegantBeef> Cause fuck that current impl πŸ˜›
23:08:16FromDiscord<geekrelief> yeah godot-nim is kind of frozen in time since I think the maintainer still uses nim v.20
23:08:31FromDiscord<ElegantBeef> Yea they also seem slow to react to issues/PRs
23:09:09FromDiscord<geekrelief> I'm all for modernizing godot-nim, that's why I created gdnim, but I'm no nim / godot guru
23:09:37FromDiscord<geekrelief> For the past couple of days I was trying to figure out why tool scripts crash with orc
23:09:53FromDiscord<ElegantBeef> Yea my friend tried the godot bindings the otherday and he had issues with the tedium that exact macro issue
23:10:05FromDiscord<geekrelief> and then the godot-rust maintainer, toasteater, tells me just don't reload your script
23:10:53FromDiscord<geekrelief> yeah gdnim helps with a lot of the tedium, but I've geared it for my experiments with hot reloading
23:11:06FromDiscord<geekrelief> it should be pretty easy to use it like godot-nim though
23:11:27FromDiscord<geekrelief> just import your components into a stub and then create one gdnlib that all gdns files reference
23:11:35*krux02 quit (Remote host closed the connection)
23:11:43FromDiscord<geekrelief> by "components" I mean script modules
23:12:46*lritter joined #nim
23:13:03FromDiscord<ElegantBeef> Yea i think godot-nim isnt overly bad just needs the nake file expanded, also maybe a gui hook if possible to add a `make nim module` from the script creation
23:13:41FromDiscord<ElegantBeef> I guess also some work on the object macro
23:13:57FromDiscord<geekrelief> yeah and better docs πŸ™‚
23:14:47FromDiscord<geekrelief> I'm going to add those eqIdents into gdnim so it's one less thing to complain about πŸ™‚
23:15:06FromDiscord<ElegantBeef> I have to note i was just joking around when i pinged you
23:15:31FromDiscord<geekrelief> huh what joke?
23:15:32FromDiscord<ElegantBeef> It wasnt an overly large issue just that the .so's were being annoying with the HCR stuff
23:15:44FromDiscord<geekrelief> oh about hcr?
23:15:57FromDiscord<ElegantBeef> Yea
23:16:15FromDiscord<geekrelief> so the way I got HCR to work with Godot is kind of annoying
23:16:37FromDiscord<geekrelief> it's a unit of a gdns attached to a node in a scene
23:17:19FromDiscord<geekrelief> Godot treats everything as a resource, so when your nim is updated, I have a Watcher, tell your node to unload and reload via its scene
23:17:36FromDiscord<geekrelief> so there are caveats to how this works
23:18:19FromDiscord<ElegantBeef> I'm curious if it'd be possible to add another option to "Create script" that wouldnt require rebuilding the engine
23:19:13FromDiscord<geekrelief> i don't follow what do you mean by rebuilding the engine?
23:19:31FromDiscord<ElegantBeef> Well compiling it from source
23:19:36FromDiscord<geekrelief> my gdnative unload patch was integrated into the 3.2 branch, so you only need to rebuild the engine once
23:19:44FromDiscord<geekrelief> it should make it into stable eventually
23:20:02FromDiscord<ElegantBeef> I mean adding another dropdown to make script window
23:20:32FromDiscord<ElegantBeef> Here https://media.discordapp.net/attachments/371759389889003532/819711419758936114/unknown.png
23:21:08FromDiscord<geekrelief> I still don't follow
23:21:25FromDiscord<geekrelief> You want to be able to create your script inside the editor?
23:21:46FromDiscord<ElegantBeef> Yea basically adding a way to call your `buildcomp` from inside the editor
23:22:03FromDiscord<geekrelief> yeah that'd be cool
23:22:22FromDiscord<ElegantBeef> Ideally it'd not require building the engine cause that's adding a usage curve
23:22:24FromDiscord<geekrelief> I think gdnative 4.0 might be cooking up something related to that
23:23:35FromDiscord<geekrelief> godot 4.0 should improve the usability of gdnative. There's a plan so that if you import an asset that uses another language, it'll setup everything for you.
23:23:53FromDiscord<ElegantBeef> In my view the ideal usage of Nim's bindings(especially since web builds now support native scripts) is get the compiler, get the engine, get an extension module, go to town
23:24:46FromDiscord<geekrelief> yeah I think gdnative 4.0 has something like that on the roadmap
23:25:38*fredrikhr joined #nim
23:27:41FromDiscord<ElegantBeef> Also if you can hook into the "play scene" event you could unload the nim library, compile the code and reload it(assuming any changes in the file and with a compiler built with danger be pretty fast)
23:29:05FromDiscord<geekrelief> The godot source is there for you to hack that in hehe
23:29:17FromDiscord<geekrelief> yeah it would be nice to have those hooks
23:29:19FromDiscord<ElegantBeef> That requires me to use C++ and requires users to build my fork
23:29:36FromDiscord<geekrelief> I just create a PR and hope for the best
23:29:55FromDiscord<geekrelief> and I've gotten a couple of my PRs merged alreasdy
23:29:57FromDiscord<geekrelief> (edit) "alreasdy" => "already"
23:31:18FromDiscord<geekrelief> for example: https://github.com/godotengine/godot/pull/41266 just needs a couple more reviewers to sign off
23:41:29*couven92 joined #nim
23:43:59FromDiscord<nikki> i haven't used godot much but i'm quite interested in trying it
23:44:07FromDiscord<nikki> @ElegantBeef have u used it much / what are your thoughts?
23:44:20FromDiscord<nikki> like also about the editor UX and the scene graph world model
23:44:21FromDiscord<ElegantBeef> I've used it briefly, it's seems fine
23:44:38*fredrikhr quit (Ping timeout: 245 seconds)
23:45:04FromDiscord<ElegantBeef> The most i've used it was to make a silly 3D flight controller πŸ˜„
23:46:33FromDiscord<ElegantBeef> Coming from CG i dislike the shader language but i that's just cause i prefer `float4 a = 1;` instead of `vec4 a = vec4(1)` πŸ˜›
23:50:45FromDiscord<Varriount> Just to check, this is readable, right? I'm not suddenly writing in tongues without realizing? https://github.com/nim-lang/RFCs/issues/343#issuecomment-797126299
23:51:40FromDiscord<nikki> In reply to @ElegantBeef "Coming from CG i": haha cool cg was my first shader lang too
23:51:51FromDiscord<nikki> is their lang just glsl? what you wrote looks like glsl
23:54:36FromDiscord<ElegantBeef> It's gles iirc
23:56:29FromDiscord<ElegantBeef> So `1 float` is undefined and you need to do `1.0 float` aswell, tends to be annoying to me