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:05 | FromDiscord | <geekrelief> Is there a way to see the nim source after all macros have been expanded? |
01:39:44 | * | alba joined #nim |
01:41:22 | FromDiscord | <geekrelief> My code compiles fine, but when I use expandMacros on it I get an error about a reintroduced symbol |
01:43:05 | FromDiscord | <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:23 | FromDiscord | <ElegantBeef> the former should be the safer option |
01:43:37 | FromDiscord | <ElegantBeef> As in it should work since the compiler doesnt stop until after it |
01:44:43 | FromDiscord | <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:46 | FromDiscord | <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:09 | giaco_ | 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:45 | giaco_ | ha haven't changed the module structure, the converter is in module A, the caller is in module B, B imports A |
02:32:59 | FromDiscord | <ElegantBeef> Did you not export the converter? |
02:33:22 | giaco_ | yes it is exported like befe |
02:33:26 | giaco_ | *before |
02:33:39 | giaco_ | converter toByte*(s: string): seq[byte] = cast[seq[byte]](s) |
02:33:40 | * | idxu_ joined #nim |
02:33:52 | giaco_ | (I know, it is bad, unsafe) |
02:33:52 | FromDiscord | <ElegantBeef> Can i see the repo? |
02:34:34 | giaco_ | not published, using nimble as project manager for a binary project, not to develop package |
02:34:47 | FromDiscord | <ElegantBeef> ok |
02:35:10 | FromDiscord | <ElegantBeef> Well i can only say make sure you export it when you import the sub module |
02:35:37 | FromDiscord | <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:01 | FromDiscord | <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:19 | FromDiscord | <ElegantBeef> unless you do `export toFloat` or `export c` inside `b.nim` |
02:39:46 | FromDiscord | <ElegantBeef> Hopefully that makes sense and isnt repeating already known information |
02:41:21 | alba | Wow, 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:17 | giaco_ | 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:30 | halloleo | Sorry, had the wrong nick. Now I'm me. ;-) |
02:44:36 | FromDiscord | <ElegantBeef> Can we get an example of the procedure you're calling from main? |
02:44:55 | FromDiscord | <ElegantBeef> Wait your name dictates who you are, wild?! |
02:47:25 | giaco_ | 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:31 | FromDiscord | <ElegantBeef> Are you currently implicitly using the converter or explicitly using it? |
02:49:40 | giaco_ | implicitly. If I explicit it, it works |
02:50:15 | giaco_ | it also works if I add "export toByte" at the bottom of lib.nim |
02:50:24 | giaco_ | (not sure why) |
02:51:41 | FromDiscord | <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:08 | FromDiscord | <ElegantBeef> Actually i just tested similar and it worked |
02:54:31 | FromDiscord | <ElegantBeef> It's a screenshot so shit i know, but main, sub, subsub https://media.discordapp.net/attachments/371759389889003532/819402877444554752/unknown.png |
02:54:50 | FromDiscord | <ElegantBeef> That compiles and runs |
02:55:51 | giaco_ | 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:30 | giaco_ | not I'm now using nimble anymore but straight nim c, but it shouldn't change anything |
02:57:38 | giaco_ | if I move converter from sublib to lib it works |
02:58:08 | FromDiscord | <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:14 | giaco_ | 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:19 | giaco_ | ElegantBeef, I've found the culprit |
03:37:39 | FromDiscord | <ElegantBeef> Congrats what was it? |
03:37:49 | giaco_ | if the function implicitly calling the conversion has return type "tuple", it raises error |
03:41:40 | * | shmorgle joined #nim |
03:49:35 | giaco_ | ElegantBeef, here's an example https://play.nim-lang.org/#ix=2SpD |
03:49:55 | giaco_ | I'm probably using tuple wrongs, but this also means that the error is misleading |
03:50:54 | FromDiscord | <ElegantBeef> What happens when you give a concrete tuple? |
03:52:44 | FromDiscord | <ElegantBeef> Like i dont even see why you're using just `tuple` that scares me |
03:53:25 | giaco_ | Because that's the type of a proc generated by a macro and it would be a tuple with 44 fields |
03:53:40 | FromDiscord | <ElegantBeef> Jeez |
03:55:57 | giaco_ | if I give concrete tuple type, it works |
03:56:06 | giaco_ | it is a quite subtle error |
03:57:18 | FromDiscord | <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:24 | giaco_ | ElegantBeef, it is the output of this https://github.com/sealmove/binarylang |
03:59:14 | giaco_ | 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:17 | FromDiscord | <ElegantBeef> What format are you parsing? |
04:01:51 | FromDiscord | <ElegantBeef> I'm just a little scared of a tuple with 44 fields π |
04:02:55 | giaco_ | 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:50 | giaco_ | maybe the macro contained into binaryLang exports the generated tuple type? How can I tell? |
04:04:41 | FromDiscord | <ElegantBeef> compiling with `--expandMacro:createParser` |
04:06:38 | * | D_ quit (Ping timeout: 264 seconds) |
04:08:03 | giaco_ | thanks, yeah I have a tuple type that I can copypaste now. Sadly not an automatic type definition (apparently) |
04:08:24 | FromDiscord | <ElegantBeef> Time to fork the repo and emit it π |
04:08:30 | giaco_ | isn't it possible to use a proc return type a type? :D |
04:09:13 | * | D_ joined #nim |
04:09:18 | FromDiscord | <ElegantBeef> You could but, it'd be smarter to just have a `emitTypeName` |
04:11:24 | FromDiscord | <ElegantBeef> like it'd be `createParser(udpPacket, true):` |
04:11:45 | giaco_ | 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:38 | FromDiscord | <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:46 | FromDiscord | <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:21 | FromDiscord | <ElegantBeef> But yea alternatively you can do the silly thing of this https://play.nim-lang.org/#ix=2SpI |
04:16:27 | FromDiscord | <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:53 | giaco_ | yeah trying the silly thing but it wants me to execute the parser to extract the type (the "test.type()" thing) |
04:27:09 | giaco_ | trying to edit macro |
04:29:39 | FromDiscord | <ElegantBeef> Oh also you can use the very non concrete `auto` return type |
04:32:59 | giaco_ | 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:44 | giaco_ | and in code "echo asdasd.typeof" results in undeclared identifier |
04:35:54 | giaco_ | not sure how to deal with something named "asdasd`gensym827" |
04:35:54 | FromDiscord | <ElegantBeef> inside quote any identifiers are gensym'd |
04:36:03 | FromDiscord | <ElegantBeef> You arent supposed to be able to |
04:37:15 | FromDiscord | <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:27 | giaco_ | this let expression has to be outside quote, right? |
04:39:31 | FromDiscord | <ElegantBeef> yea |
04:45:55 | giaco_ | 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:54 | FromDiscord | <ElegantBeef> well name is a `nimNode` of kind `nnkIdent` which means to extract the value you need to do `$name` |
04:48:10 | FromDiscord | <ElegantBeef> Also worth noting conventions say you could just do `ident(($name).capitalizeAscii)` assuming you pass a lowecase identifier to the macro |
04:49:02 | FromDiscord | <gogolxdong> nimble install errors `Could not download: No SSL/TLS CA certificates found.` |
04:49:14 | FromDiscord | <ElegantBeef> Windows? |
04:49:26 | FromDiscord | <gogolxdong> yes |
04:49:39 | FromDiscord | <ElegantBeef> https://forum.nim-lang.org/t/7551#47995 |
04:49:57 | FromDiscord | <ElegantBeef> (edit) "https://forum.nim-lang.org/t/7551#47995" => "https://forum.nim-lang.org/t/7551" |
04:49:59 | FromDiscord | <ElegantBeef> Whoops π |
04:51:42 | * | wasted_youth2 joined #nim |
04:51:59 | giaco_ | 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:44 | FromDiscord | <ElegantBeef> `echo T()` is the easy way |
04:53:19 | FromDiscord | <ElegantBeef> you can also use `for name, field in T().fieldPairs` |
04:54:13 | giaco_ | echo T() goes Error: object constructor needs an object type |
04:54:46 | FromDiscord | <ElegantBeef> Oh right it's a tuple π |
04:55:34 | giaco_ | btw it is working! I just wanted to print it |
04:55:51 | FromDiscord | <ElegantBeef> Nice |
04:57:04 | giaco_ | well, thanks a lot. Not only solved a problem, but typed my first macro edit |
05:01:04 | FromDiscord | <ElegantBeef> well here is my silly solution https://play.nim-lang.org/#ix=2SpQ |
05:01:04 | FromDiscord | <gogolxdong> Is this a recent issue? |
05:01:21 | FromDiscord | <ElegantBeef> Yes it's due to 1.4.4 it properly uses the ssl certificates |
05:04:06 | giaco_ | yeah, it works! |
05:04:43 | giaco_ | 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:16 | FromDiscord | <ElegantBeef> Oh btw you can replace `tupleMeat` on the proc signatures with `tName` π |
05:15:09 | FromDiscord | <Seedofarson> bruh |
05:28:15 | * | narimiran joined #nim |
05:39:43 | halloleo | Hey, simple question about HttpClient: |
05:40:11 | halloleo | I 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:49 | FromDiscord | <ElegantBeef> I imagine the proper way is to only close the client when you need to, reusing as much as possible |
05:41:35 | FromDiscord | <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:54 | halloleo | @ElegantBeef Makes sense. |
05:52:42 | haxscramper | I put the pattern matching article on HN now (I think someone asked about that yesterday). |
06:01:03 | FromDiscord | <flywind> the link? |
06:03:12 | haxscramper | https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html |
06:03:24 | FromDiscord | <haxscramper> ah ok |
06:03:41 | FromDiscord | <haxscramper> https://news.ycombinator.com/item?id=26420716 |
06:03:48 | FromDiscord | <haxscramper> high iq moves here |
06:30:08 | FromDiscord | <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:32 | FromDiscord | <haxscramper> why? |
06:35:31 | leorize[m] | it's to avoid their anti bump algo |
06:35:54 | FromDiscord | <Yardanico> Because upvotes from the direct link won't really count |
06:36:10 | FromDiscord | <Yardanico> They count if people got to the post from HN top/new |
06:36:22 | FromDiscord | <Yardanico> See e.g. https://wiredcraft.com/blog/how-to-post-on-hacker-news/ |
06:36:24 | FromDiscord | <haxscramper> will keep this in nimd |
06:36:35 | FromDiscord | <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:37 | FromDiscord | <Yardanico> Also HN protects against "voting rings" |
06:40:00 | FromDiscord | <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:25 | FromDiscord | <ElegantBeef> Yea that's what i figured |
06:45:01 | * | johannes joined #nim |
06:49:05 | * | johannes quit (Client Quit) |
06:49:31 | ForumUpdaterBot | New Nimble package! intervalsets - Set implementation of disjoint intervals, see https://github.com/autumngray/intervalsets |
06:57:29 | ForumUpdaterBot | New 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:31 | ForumUpdaterBot | New 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:58 | FromDiscord | <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:37 | FromDiscord | <flywind> in the private channel |
08:43:35 | Clonkk[m] | I saw a PR saying it was being moved to std/ I think |
08:44:08 | FromDiscord | <ElegantBeef> Yea you did, though i assume their fancy pants private chat will say the same |
08:44:29 | FromDiscord | <Varriount> In reply to @flywind "in the private channel": Ah, I guess I don't have access to that channel. |
08:44:49 | FromDiscord | <ElegantBeef> Varriount is a good common folk i see π |
08:45:20 | FromDiscord | <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:21 | Clonkk[m] | Plebians unite |
08:46:00 | FromDiscord | <flywind> In reply to @Varriount "Ah, I guess I": Not really, I chat with him directly. |
08:46:00 | FromDiscord | <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:28 | FromDiscord | <haxscramper> For complex AST it is pointless and you should test generated code functions, not the structure |
08:46:36 | FromDiscord | <KnorrFG> π ok |
08:46:48 | FromDiscord | <flywind> In reply to @flywind "Not really, I chat": there is no private channel I think |
08:48:45 | FromDiscord | <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:09 | FromDiscord | <gogolxdong> Is there any candidate memory mapping database? |
08:50:28 | FromDiscord | <Varriount> In reply to @gogolxdong "Is there any candidate": Sqlite |
08:50:46 | FromDiscord | <gogolxdong> for windows |
08:51:40 | FromDiscord | <gogolxdong> Doesn't rocksdb or libmdbx work on windows? |
08:52:11 | FromDiscord | <Varriount> In reply to @gogolxdong "for windows": SQLite works on Windows. |
08:52:31 | FromDiscord | <Varriount> And has an in-memory mode. |
08:52:41 | FromDiscord | <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:27 | FromDiscord | <mratsim> rocksdb works on Windows but AFAIK it was a pain to build. |
09:00:32 | FromDiscord | <KnorrFG> is there somethind like dumpTree, that instead of printing the ast returns it? |
09:00:52 | FromDiscord | <KnorrFG> i struggle to go from code to ast to test the function that does the macro work |
09:03:12 | FromDiscord | <flywind> you can upvote this PR https://github.com/nim-lang/Nim/pull/17209/files |
09:04:53 | * | ubert joined #nim |
09:09:33 | FromDiscord | <gogolxdong> https://rocksdb.org.cn/doc/Building-on-Windows.html |
09:11:46 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=2SqA |
09:12:06 | FromDiscord | <mratsim> In reply to @KnorrFG "is there somethind like": dumpASTgen |
09:14:08 | FromDiscord | <KnorrFG> thanks π |
09:29:10 | FromDiscord | <gogolxdong> nimdbx is promising but with building issue on Windows |
09:29:39 | FromDiscord | <gogolxdong> key-value memory mapping database on Windows |
09:52:41 | * | kinkinkijkin quit () |
09:52:58 | * | kinkinkijkin joined #nim |
10:03:21 | Clonkk[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:23 | FromDiscord | <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:49 | FromDiscord | <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:18 | FromDiscord | <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:09 | SebastianM | hey 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:51 | FromDiscord | <Rika> $ for dump if youre looking for a string |
12:17:57 | FromDiscord | <Rika> parsejson for load |
12:22:31 | SebastianM | @Rika Great thank you for your answer. |
12:28:30 | FromDiscord | <Rika> does `var_string.add(string)` compile to the same code as `var_string &= string`? |
12:28:55 | FromDiscord | <Rika> ah nvm, misread the code |
12:36:41 | FromDiscord | <Firefell> Nim is also used to create malware π https://threatpost.com/nim-based-malware-loader-spreads-via-spear-phishing-emails/164643/ |
12:37:18 | FromDiscord | <Firefell> When a new channel "Virus" ? π |
12:37:33 | FromDiscord | <Rika> #malware |
12:37:43 | FromDiscord | <Firefell> Yes |
12:37:58 | PMunch | I can see why though, Nim is a good fit for malware |
12:38:22 | PMunch | Small stand-alone binaries, good performance, and low-level access to hardware |
12:39:06 | FromDiscord | <Firefell> Another victory for Nim lang |
12:39:15 | PMunch | Of 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:53 | PMunch | I 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:07 | PMunch | Maybe that should be my next Nim project :P |
12:40:08 | FromDiscord | <Firefell> https://www.bleepingcomputer.com/news/security/trickbots-bazarbackdoor-malware-is-now-coded-in-nim-to-evade-antivirus/ |
12:40:30 | FromDiscord | <Rika> In reply to @PMunch "I wonder how true": it really is likely because of people being unfamiliar |
12:41:46 | PMunch | I just don't see how it would be considerably different from C.. |
12:42:03 | FromDiscord | <Araq> different stdlib, different detection |
12:42:04 | FromDiscord | <Rika> pmunch because the c output is "noisier" probably |
12:42:14 | PMunch | Hmm, maybe |
12:42:29 | FromDiscord | <Firefell> In reply to @Rika "pmunch because the c": yes because not write directly in C |
12:42:34 | FromDiscord | <Rika> are runes in the unicode module mapping to graphemes or code points? |
12:43:23 | PMunch | I guess I'm not familiar enough with malware fingerprinting.. |
12:44:17 | federico3 | also 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:12 | PMunch | "Makes use of JSON in C&C communications", very likely because using Json in Nim is super easy |
12:47:25 | FromDiscord | <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:44 | FromDiscord | <Rika> ah its in the docs i didnt see |
12:48:47 | FromDiscord | <Rika> xd |
12:49:24 | FromDiscord | <Clyybber> In reply to @Clyybber "<@!413679055897100289> https://github.com/nim-lang/": @Araq in case you missed my previous ping |
12:49:27 | FromDiscord | <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:59 | FromDiscord | <Araq> indeed I did |
13:06:23 | * | madnight joined #nim |
13:07:08 | PMunch | New 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:10 | FromDiscord | <Araq> you should use fewer `.emit`s |
13:25:10 | * | tane joined #nim |
13:25:55 | PMunch | They're just so easy to use :P |
13:26:13 | PMunch | But I'll try to avoid it |
13:27:03 | * | sknebel quit (Max SendQ exceeded) |
13:27:19 | * | sknebel joined #nim |
13:30:03 | FromDiscord | <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:54 | FromDiscord | <mratsim> we will compile and bow down to our JS overloads. |
13:30:59 | FromDiscord | <mratsim> (edit) "overloads." => "overlords." |
13:33:18 | Clonkk[m] | <FromDiscord "<Araq> think about Nim's future,"> Wouldn't that big an issue to support both C and C++ interop ? |
13:33:25 | Clonkk[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:25 | Clonkk[m] | * Wouldn't that be an issue to support both C and C++ interop ? |
13:36:08 | PMunch | I'm pretty sure that was a joke |
13:36:33 | FromDiscord | <Rika> ngl i actually kinda got a cold sweat from that |
13:36:44 | Clonkk[m] | That Nim will eventually compile to LLVM directly ? |
13:37:02 | PMunch | But 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:07 | ForumUpdaterBot | New Nimble package! nimkalc - An advanced parsing library for mathematical expressions and equations, see https://github.com/nocturn9x/nimkalc |
13:41:25 | FromDiscord | <Araq> I wasn't joking... π |
13:41:38 | FromDiscord | <Araq> @Clonkk nlvm already does that |
13:42:55 | Clonkk[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:15 | FromDiscord | <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:13 | PMunch | Keyword "tries to" |
13:47:51 | FromDiscord | <Araq> the idea can work out, Swig is just a bad implementation |
13:49:01 | Clonkk[m] | Wouldn't you lose compile-time C++ feature then ? |
13:49:28 | Clonkk[m] | (To be fair, I'm not sure it's used much in Nim / C++ interop) |
13:49:41 | FromDiscord | <Araq> what is compile-time C++? |
13:50:15 | Clonkk[m] | Recursive template was what I had in mind |
13:51:26 | FromDiscord | <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:49 | FromDiscord | <KnorrFG> why does the last line not work? https://play.nim-lang.org/#ix=2SrS |
13:52:45 | Clonkk[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:14 | FromDiscord | <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:33 | Clonkk[m] | I remember reading a "needed library" issue on github |
13:56:10 | federico3 | https://github.com/nim-lang/needed-libraries |
14:01:32 | FromDiscord | <Araq> er, @Clyybber why don't we mangle like foo34_33 ? |
14:01:42 | FromDiscord | <Araq> (symId_moduleId) |
14:02:14 | FromDiscord | <Araq> why do we need the signature hash, it's outdated junk |
14:10:00 | ForumUpdaterBot | New 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:08 | ForumUpdaterBot | New 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:50 | FromDiscord | <Clyybber> In reply to @Araq "er, <@!107882072974065664> why don't": I think disrupteks mangling did that |
14:29:57 | FromDiscord | <Araq> yeah but there are dragons to watch out for |
14:30:02 | FromDiscord | <Clyybber> yeah |
14:34:01 | FromDiscord | <Araq> happen to remember these dragons? |
14:36:28 | FromDiscord | <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:05 | FromDiscord | <Araq> aMacro(a: int) is not a valid call syntax |
14:40:31 | FromDiscord | <Araq> `aMacro (a: int)` works |
14:41:14 | FromDiscord | <Araq> the secret to understanding Nim is to realize that syntax and semantics are distinct, macros cannot change the syntax |
14:41:46 | FromDiscord | <KnorrFG> but in a function definition, that syntax is valid, isnt it? |
14:41:52 | FromDiscord | <Araq> the benefit is that we can always build a parse tree without having to perform symbol lookups or macro expansions |
14:42:05 | FromDiscord | <Araq> a function def starts with proc/func/iterator/etc |
14:42:14 | FromDiscord | <KnorrFG> ah |
14:42:30 | FromDiscord | <Araq> the usual design is |
14:42:42 | FromDiscord | <Araq> `proc foobar(a: int) {.myMacro.}` |
14:43:18 | FromDiscord | <KnorrFG> i just want my macro to define a function and pass (among other things) the functions signature |
14:43:39 | FromDiscord | <KnorrFG> i want it to define a type and a function to be precise |
14:46:04 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Ssi |
14:46:09 | FromDiscord | <KnorrFG> because he doesnt like the = sign |
14:46:19 | FromDiscord | <KnorrFG> (edit) "he" => "nim" |
14:46:37 | FromDiscord | <Araq> your DSL is not idiomatic either way |
14:46:47 | FromDiscord | <KnorrFG> why? |
14:46:59 | FromDiscord | <mratsim> why dash? |
14:47:04 | FromDiscord | <mratsim> remove it |
14:47:06 | FromDiscord | <Araq> because Nim code doesn't use `-` for enumerations |
14:47:39 | FromDiscord | <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:03 | FromDiscord | <KnorrFG> if i remove it, i cant distinguish new elements from theyr configuration |
14:48:18 | FromDiscord | <KnorrFG> (edit) "theyr" => "their" |
14:48:25 | FromDiscord | <Rika> indent level? |
14:48:36 | FromDiscord | <KnorrFG> could have sub elements |
14:49:07 | FromDiscord | <KnorrFG> ill try to reproduce something like qml |
14:49:15 | FromDiscord | <Araq> to describe UIs declarative, check out how Karax does it |
14:50:46 | FromDiscord | <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:38 | FromDiscord | <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:04 | FromDiscord | <Clyybber> but actually maybe they don't with the idmoduleId sceme |
15:01:08 | FromDiscord | <Clyybber> (edit) "idmoduleId" => "_\_id\moduleId" |
15:01:18 | FromDiscord | <Clyybber> (edit) "sceme" => "scheme" |
15:10:45 | * | PMunch quit (Quit: leaving) |
15:13:18 | FromDiscord | <Araq> just tried it |
15:13:24 | FromDiscord | <Araq> nothing breaks so far |
15:30:53 | * | fredrikhr joined #nim |
15:42:39 | ForumUpdaterBot | New thread by Drkameleon: Compile Nim to JavaScript from inside Nim?, see https://forum.nim-lang.org/t/7609 |
15:44:40 | ForumUpdaterBot | New 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:41 | ForumUpdaterBot | New 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:43 | ForumUpdaterBot | New thread by Marcomq: Running Nim on android, see https://forum.nim-lang.org/t/7612 |
16:16:37 | * | asdflkj joined #nim |
16:38:48 | reversem3 | using nimscript proc listFiles , does not `let x = listFiles("./")` correct ? |
16:38:58 | reversem3 | https://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:03 | PMunch | Todays 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:20 | FromDiscord | <mratsim> Crystal reaching 1.0 https://github.com/crystal-lang/crystal/pull/10500 |
16:53:25 | FromDiscord | <Araq> "Error: unhandled exception: Text file busy" |
16:53:35 | FromDiscord | <Araq> Text file busy? |
16:54:13 | FromDiscord | <mratsim> This reeks of windows |
16:54:31 | FromDiscord | <Araq> https://builds.sr.ht/~araq/job/456190 it's BSD |
16:55:02 | FromDiscord | <haxscramper> IIRC it tries to write in binary file in parallel or something like that |
16:57:41 | reversem3 | the mkDir proc should be mkDir("dir_name") correct |
16:57:44 | reversem3 | https://nim-lang.org/docs/nimscript.html#listFiles%2Cstring |
16:58:42 | reversem3 | Getting error Error: expression 'mkDir("garbage/")' has no type ? |
16:59:17 | FromDiscord | <haxscramper> mkdir does not have any return type |
16:59:23 | FromDiscord | <haxscramper> So expression does not have a type |
17:00:22 | * | salvipeter[m] quit (Quit: authenticating) |
17:00:55 | reversem3 | so what am I doing wrong then ? |
17:00:59 | * | salvipeter[m] joined #nim |
17:01:09 | * | fredrikhr quit (Ping timeout: 264 seconds) |
17:01:32 | FromDiscord | <haxscramper> can you show the code? |
17:02:04 | reversem3 | ok I get it now you can only call mkDir("dir") you can assign it to a variable |
17:02:10 | reversem3 | * ok I get it now you can only call mkDir("dir") you can't assign it to a variable |
17:03:10 | FromDiscord | <haxscramper> yes; you probably want something like `proc getCreateDir(dir: string): string = mkDir(dir); return cwd() / dir` |
17:03:17 | FromDiscord | <haxscramper> If I understand you correctly |
17:08:19 | * | salvipeter[m] is now known as sunwukong |
17:12:11 | FromDiscord | <zajrik> hax I love you. Pattern matching is so nice |
17:12:43 | reversem3 | Yes thank you |
17:14:47 | FromDiscord | <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:24 | FromDiscord | <zajrik> actually, I can just return that employee directly rather than declaring the employee var. Further optimizations :blobsunglasses: |
17:19:50 | FromDiscord | <zetashift> Yes I was also very happy to see pattern matching included in fusion! |
17:20:30 | FromDiscord | <zajrik> @Solitude don't hate :ablobsobbbbbb: |
17:21:47 | FromDiscord | <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:12 | FromDiscord | <zajrik> https://i.imgur.com/SkqxI0a.png |
17:23:17 | FromDiscord | <zajrik> :blobnauseated: |
17:30:09 | * | letto quit (Quit: Konversation terminated!) |
17:31:50 | FromDiscord | <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:08 | FromDiscord | <haxscramper> Well, yeah, two spaces is kind of |
17:34:27 | FromDiscord | <haxscramper> A bit too little sometimes |
17:34:53 | ForumUpdaterBot | New thread by Geekrelief: Bad destructor causing crash in arc/orc?, see https://forum.nim-lang.org/t/7613 |
17:36:43 | FromDiscord | <zajrik> In reply to @haxscramper "A bit too little": Exactly |
17:40:27 | FromDiscord | <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:49 | FromDiscord | <haxscramper> slightly more verbose, but has this nice left-to-right logic order |
17:41:21 | FromDiscord | <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:11 | FromDiscord | <haxscramper> Yes, I was thinking of `if let Some(capture) = expr` when adding `?=` (in nim it would be `if Some(@capture) ?= expr`) |
17:42:20 | FromDiscord | <zajrik> Exactly |
17:43:22 | FromDiscord | <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:25 | FromDiscord | <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:51 | FromDiscord | <haxscramper> It is going to stay in anyway, because `Some(@capture) ?= expr` is just too good to give away |
17:50:03 | reversem3 | I 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:05 | reversem3 | https://nim-lang.org/docs/parsexml.html |
17:50:07 | FromDiscord | <zajrik> Absolutely. That's the pinnacle of matching lol |
17:50:23 | reversem3 | * 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:24 | FromDiscord | <haxscramper> it took me |
17:50:39 | FromDiscord | <haxscramper> four `if let` implementations I think, before I got to this one |
17:51:17 | reversem3 | basically looking for an alternative to lxml and Etree for python |
17:51:35 | FromDiscord | <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:46 | FromDiscord | <zajrik> :drakeLUL: |
17:52:12 | FromDiscord | <zajrik> Speaking of, I suppose I can close that now that fusion is available |
17:55:30 | FromDiscord | <Solitude> reversem3, are you asking if you can parse xml with parsexml? |
17:55:39 | FromDiscord | <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:01 | reversem3 | <FromDiscord "<Solitude> nixfreak, are you ask"> Yes I am |
17:56:31 | reversem3 | Not finding very good examples how to do it unlike lxml |
17:57:08 | PMunch | Stream is live, ready for some more keyboard firmware programming! https://www.twitch.tv/pmunche |
17:57:14 | FromDiscord | <Solitude> https://nim-lang.org/docs/xmlparser.html |
17:57:17 | FromDiscord | <Solitude> use this |
17:57:19 | reversem3 | I see loadXml loads an xml then returns a xmlnode type |
17:58:05 | reversem3 | but how can I extract a tag or attribute in the xml file itself |
17:58:17 | FromDiscord | <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:55 | FromDiscord | <haxscramper> Until I realized it would be much simpler to just concentrate on expression itself |
17:59:22 | FromDiscord | <haxscramper> And it was the right choice I think, because it is now possible to do chains/alternatives and so on |
17:59:23 | FromDiscord | <haxscramper> Tuples |
17:59:32 | FromDiscord | <zajrik> oh that's a good thing to have. Does that work with `?=`? like `if Some(@foo) ?= expr1 and Some(@bar) ?= expr2`? |
18:01:34 | FromDiscord | <haxscramper> !eval import fusion/matching, options; echo (Some(@foo) ?= some(12)) and (Some(@bar) ?= some(2)) |
18:01:37 | NimBot | true |
18:02:00 | FromDiscord | <haxscramper> A little more parenthesis is needed because `?=` is treated like an assignment operator, but otherwise it works fine |
18:02:14 | FromDiscord | <zajrik> Okay, I thought that might be the case |
18:02:55 | FromDiscord | <haxscramper> Though you can just ``template `??????`(a, b: untyped): untyped = matches(a, b)`` |
18:03:08 | FromDiscord | <haxscramper> And `Some(@a) ?????? some(12)` |
18:03:12 | * | rockcavera quit (Remote host closed the connection) |
18:03:18 | FromDiscord | <zajrik> lol |
18:04:16 | FromDiscord | <haxscramper> `template `π€`(a, b: untyped): untyped = matches(a, b)` |
18:04:56 | FromDiscord | <zajrik> does Nim have unicode support in idents? I didn't realize |
18:05:19 | FromDiscord | <haxscramper> yes it does, you don't even need stropping |
18:05:35 | FromDiscord | <haxscramper> !eval let ΠΠΠ = 12; echo ΠΠΠ |
18:05:37 | NimBot | 12 |
18:05:43 | FromDiscord | <zajrik> stropping meaning backticks? |
18:05:49 | FromDiscord | <haxscramper> yes |
18:05:59 | FromDiscord | <zajrik> Had to make sure |
18:07:01 | FromDiscord | <zajrik> I can't wait for the day that editor support is on par with like |
18:07:05 | FromDiscord | <zajrik> TypeScript |
18:08:33 | FromDiscord | <haxscramper> I think I need to use vscode for some time, because I'm clearly missing out on this experience |
18:09:06 | FromDiscord | <zajrik> Yeah? I use VSCode myself since I primarily work with TypeScript and the Nim support is ehhhhh |
18:09:48 | FromDiscord | <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:54 | FromDiscord | <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:57 | FromDiscord | <zajrik> :ablobsweats: |
18:33:54 | * | blackpawn quit (Ping timeout: 260 seconds) |
19:02:57 | * | abm joined #nim |
19:03:06 | ForumUpdaterBot | New 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:12 | PMunch | Anyone good at linking headers in Nim? |
19:17:23 | PMunch | I'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:41 | FromDiscord | <Seedofarson> haha |
20:19:28 | * | asdflkj joined #nim |
20:34:45 | leorize | PMunch: I can help |
20:34:54 | PMunch | A bit too late :P |
20:35:05 | PMunch | Unless you're watching the stream and know what's going on right now |
20:35:46 | leorize | ah, 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:58 | FromDiscord | <Seedofarson> https://github.com/juancarlospaco/faster-than-requests |
21:01:00 | FromDiscord | <Seedofarson> just found this gem |
21:01:10 | FromDiscord | <Seedofarson> its a python wrapper for nim HTTP client |
21:14:37 | * | NimBot joined #nim |
21:15:16 | FromDiscord | <ο½ο½ο½ο½ο½ βΈ π> sent a code paste, see https://play.nim-lang.org/#ix=2SuU |
21:18:22 | FromDiscord | <ο½ο½ο½ο½ο½ βΈ π> (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:41 | PMunch | @Seedofarson, nice way to show Python users that Nim exists :) |
21:24:47 | PMunch | And how it can benefit them |
21:25:09 | FromDiscord | <Seedofarson> Yeah |
21:25:15 | FromDiscord | <Seedofarson> Nim speed go brrrrrrrrr |
21:25:38 | FromDiscord | <ElegantBeef> More like "Nim is not reliant on programmer contracts" |
21:25:41 | FromDiscord | <Seedofarson> I wonder how pyinstaller and Nimpy get along |
21:25:58 | PMunch | @ElegantBeef, what do you mean? |
21:26:16 | FromDiscord | <Seedofarson> In reply to @ElegantBeef "More like "Nim is": Huh |
21:26:18 | FromDiscord | <ElegantBeef> Python is loaded full of "The interpreter doesnt enforce this but it's a convention to tell others dont touch it" |
21:26:29 | FromDiscord | <mratsim> ah the starting underscore |
21:26:34 | FromDiscord | <ElegantBeef> `_Name` for instance of `_` identifiers |
21:26:38 | FromDiscord | <ElegantBeef> (edit) "of" => "or" |
21:26:46 | PMunch | Aaah right |
21:27:03 | PMunch | Yeah I mention that quite a bit when streaming I've noticed |
21:27:23 | PMunch | "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:43 | FromDiscord | <ElegantBeef> Also no first class enums |
21:28:02 | FromDiscord | <ElegantBeef> import the enums module so you can get a primitive! |
21:38:10 | FromDiscord | <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:41 | FromDiscord | <ElegantBeef> I mean it can do inference |
21:38:53 | FromDiscord | <treeform> It cannot |
21:40:47 | FromDiscord | <ElegantBeef> Yea i thought it could when using pure enums but i'm wrong |
21:41:16 | FromDiscord | <treeform> The rest of the language does not use Hungarian notation, but it's required for enums. |
21:43:59 | FromDiscord | <ElegantBeef> Hmm with the `caseStmtMacros` we can actually do part of that |
21:44:14 | FromDiscord | <ElegantBeef> But obviously that doesnt save all the cases |
21:44:38 | * | fputs quit (Quit: WeeChat 3.0.1) |
21:45:59 | FromDiscord | <ElegantBeef> Ah i guess nevermind since we cannot override the default case stmt |
21:55:26 | FromDiscord | <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:29 | FromDiscord | <dom96> Are we recommending this? |
21:56:15 | Prestige | Nim v2? As in 2.0? |
21:56:33 | Prestige | I thought we were quite a ways from that |
22:03:48 | FromDiscord | <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:57 | FromDiscord | <zidsal> (edit) "generation?" => "generation with macros?" |
22:05:57 | * | ubert quit (Ping timeout: 260 seconds) |
22:06:17 | FromDiscord | <Clyybber> @Araq I made the compiler fully bootstraps with --gc:arc |
22:07:42 | * | PMunch quit (Quit: leaving) |
22:15:14 | FromDiscord | <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:26 | FromDiscord | <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:06 | FromDiscord | <zetashift> In reply to @Clyybber "<@!413679055897100289> compiler fully bootstraps": That's pretty big no? |
22:19:23 | FromDiscord | <Clyybber> yeah :D |
22:21:06 | FromDiscord | <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:38 | FromDiscord | <dom96> might need to write your tests in the boring old `block: ...; doAssert ...` style π |
22:28:46 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/pull/17342 |
22:28:56 | FromDiscord | <dom96> `when defined(gcArc)` hehe |
22:29:26 | * | rockcavera joined #nim |
22:29:31 | FromDiscord | <dom96> nice job π |
22:30:07 | FromDiscord | <Clyybber> thanks : ) |
22:32:31 | FromDiscord | <zidsal> @dom96 boo, I suspected as much maybe its time I write a testing library |
22:32:59 | FromGitter | <deech> Wow has that had any effect on perf? |
22:34:29 | FromDiscord | <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:36 | ForumUpdaterBot | New 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:19 | FromDiscord | <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:10 | federico3 | I can refresh it |
22:50:23 | FromDiscord | <ajusa> federico3: Oh wait are you the author? |
22:50:46 | federico3 | yep |
22:51:26 | FromDiscord | <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:37 | FromDiscord | <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:31 | FromDiscord | <ElegantBeef> Thirdly you could use nimscript interop for that live editing but have fun wrapping the calls π |
22:52:31 | federico3 | I'll do it |
22:54:20 | FromDiscord | <geekrelief> In reply to @haxscramper "If you want to": Yes I'm doing this with gdnim |
22:55:37 | FromDiscord | <geekrelief> In reply to @ElegantBeef "Thirdly you could use": Yeah I think I'm going to try nimscripter again! |
22:56:22 | FromDiscord | <ElegantBeef> Cool |
22:56:43 | FromDiscord | <ITR> In reply to @geekrelief "There are two things": oo that's cool |
22:56:51 | FromDiscord | <ElegantBeef> It clearly needs some tweaking but it's a good proof of concept impl |
22:56:56 | FromDiscord | <geekrelief> I have a better understanding of how Godot deals with data now |
22:57:14 | FromDiscord | <geekrelief> using Nodepaths we can access any node, function, parameter |
22:57:19 | FromDiscord | <ElegantBeef> Like the conversation earlier someone needs to make the VM go vrooom |
22:57:35 | FromDiscord | <ElegantBeef> (edit) "Like the conversation earlier ... someone" added "mentioned" |
22:58:16 | FromDiscord | <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:44 | FromDiscord | <geekrelief> Still it's much faster than tcc compiling |
22:59:04 | FromDiscord | <ElegantBeef> Yea remaking the interpreter is very quick |
22:59:21 | FromDiscord | <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:30 | FromDiscord | <ElegantBeef> Sorta related i'm still surprised no one noted the forced matching on the godot pragmas π |
23:00:34 | FromDiscord | <nikki> In reply to @treeform "The rest of the": definitely a thing i've been meh about too re: nim |
23:05:31 | FromDiscord | <ElegantBeef> Hey if this reversed type inference was implemented it'd work for literals of all kinds! π |
23:06:18 | FromDiscord | <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:24 | FromDiscord | <geekrelief> (edit) ":p" => "π" |
23:06:36 | FromDiscord | <ElegantBeef> Lol two lines! π |
23:06:53 | FromDiscord | <geekrelief> actually it's kind of all over the codebase |
23:06:56 | FromDiscord | <ElegantBeef> honestly though i didnt realize macros had a eqIdent, i always use `nimNormalizeIdent` or whatever |
23:07:06 | FromDiscord | <geekrelief> I didn't either until your pr! |
23:07:15 | FromDiscord | <geekrelief> I usually converted the strings to with ident before comparison |
23:07:23 | FromDiscord | <geekrelief> but I was trying to stay in line with the existing code base |
23:07:39 | FromDiscord | <ElegantBeef> Yea i also want to add varblock support |
23:07:44 | FromDiscord | <ElegantBeef> Cause fuck that current impl π |
23:08:16 | FromDiscord | <geekrelief> yeah godot-nim is kind of frozen in time since I think the maintainer still uses nim v.20 |
23:08:31 | FromDiscord | <ElegantBeef> Yea they also seem slow to react to issues/PRs |
23:09:09 | FromDiscord | <geekrelief> I'm all for modernizing godot-nim, that's why I created gdnim, but I'm no nim / godot guru |
23:09:37 | FromDiscord | <geekrelief> For the past couple of days I was trying to figure out why tool scripts crash with orc |
23:09:53 | FromDiscord | <ElegantBeef> Yea my friend tried the godot bindings the otherday and he had issues with the tedium that exact macro issue |
23:10:05 | FromDiscord | <geekrelief> and then the godot-rust maintainer, toasteater, tells me just don't reload your script |
23:10:53 | FromDiscord | <geekrelief> yeah gdnim helps with a lot of the tedium, but I've geared it for my experiments with hot reloading |
23:11:06 | FromDiscord | <geekrelief> it should be pretty easy to use it like godot-nim though |
23:11:27 | FromDiscord | <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:43 | FromDiscord | <geekrelief> by "components" I mean script modules |
23:12:46 | * | lritter joined #nim |
23:13:03 | FromDiscord | <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:41 | FromDiscord | <ElegantBeef> I guess also some work on the object macro |
23:13:57 | FromDiscord | <geekrelief> yeah and better docs π |
23:14:47 | FromDiscord | <geekrelief> I'm going to add those eqIdents into gdnim so it's one less thing to complain about π |
23:15:06 | FromDiscord | <ElegantBeef> I have to note i was just joking around when i pinged you |
23:15:31 | FromDiscord | <geekrelief> huh what joke? |
23:15:32 | FromDiscord | <ElegantBeef> It wasnt an overly large issue just that the .so's were being annoying with the HCR stuff |
23:15:44 | FromDiscord | <geekrelief> oh about hcr? |
23:15:57 | FromDiscord | <ElegantBeef> Yea |
23:16:15 | FromDiscord | <geekrelief> so the way I got HCR to work with Godot is kind of annoying |
23:16:37 | FromDiscord | <geekrelief> it's a unit of a gdns attached to a node in a scene |
23:17:19 | FromDiscord | <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:36 | FromDiscord | <geekrelief> so there are caveats to how this works |
23:18:19 | FromDiscord | <ElegantBeef> I'm curious if it'd be possible to add another option to "Create script" that wouldnt require rebuilding the engine |
23:19:13 | FromDiscord | <geekrelief> i don't follow what do you mean by rebuilding the engine? |
23:19:31 | FromDiscord | <ElegantBeef> Well compiling it from source |
23:19:36 | FromDiscord | <geekrelief> my gdnative unload patch was integrated into the 3.2 branch, so you only need to rebuild the engine once |
23:19:44 | FromDiscord | <geekrelief> it should make it into stable eventually |
23:20:02 | FromDiscord | <ElegantBeef> I mean adding another dropdown to make script window |
23:20:32 | FromDiscord | <ElegantBeef> Here https://media.discordapp.net/attachments/371759389889003532/819711419758936114/unknown.png |
23:21:08 | FromDiscord | <geekrelief> I still don't follow |
23:21:25 | FromDiscord | <geekrelief> You want to be able to create your script inside the editor? |
23:21:46 | FromDiscord | <ElegantBeef> Yea basically adding a way to call your `buildcomp` from inside the editor |
23:22:03 | FromDiscord | <geekrelief> yeah that'd be cool |
23:22:22 | FromDiscord | <ElegantBeef> Ideally it'd not require building the engine cause that's adding a usage curve |
23:22:24 | FromDiscord | <geekrelief> I think gdnative 4.0 might be cooking up something related to that |
23:23:35 | FromDiscord | <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:53 | FromDiscord | <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:46 | FromDiscord | <geekrelief> yeah I think gdnative 4.0 has something like that on the roadmap |
23:25:38 | * | fredrikhr joined #nim |
23:27:41 | FromDiscord | <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:05 | FromDiscord | <geekrelief> The godot source is there for you to hack that in hehe |
23:29:17 | FromDiscord | <geekrelief> yeah it would be nice to have those hooks |
23:29:19 | FromDiscord | <ElegantBeef> That requires me to use C++ and requires users to build my fork |
23:29:36 | FromDiscord | <geekrelief> I just create a PR and hope for the best |
23:29:55 | FromDiscord | <geekrelief> and I've gotten a couple of my PRs merged alreasdy |
23:29:57 | FromDiscord | <geekrelief> (edit) "alreasdy" => "already" |
23:31:18 | FromDiscord | <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:59 | FromDiscord | <nikki> i haven't used godot much but i'm quite interested in trying it |
23:44:07 | FromDiscord | <nikki> @ElegantBeef have u used it much / what are your thoughts? |
23:44:20 | FromDiscord | <nikki> like also about the editor UX and the scene graph world model |
23:44:21 | FromDiscord | <ElegantBeef> I've used it briefly, it's seems fine |
23:44:38 | * | fredrikhr quit (Ping timeout: 245 seconds) |
23:45:04 | FromDiscord | <ElegantBeef> The most i've used it was to make a silly 3D flight controller π |
23:46:33 | FromDiscord | <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:45 | FromDiscord | <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:40 | FromDiscord | <nikki> In reply to @ElegantBeef "Coming from CG i": haha cool cg was my first shader lang too |
23:51:51 | FromDiscord | <nikki> is their lang just glsl? what you wrote looks like glsl |
23:54:36 | FromDiscord | <ElegantBeef> It's gles iirc |
23:56:29 | FromDiscord | <ElegantBeef> So `1 float` is undefined and you need to do `1.0 float` aswell, tends to be annoying to me |