00:15:16 | * | leorize quit (Ping timeout: 260 seconds) |
00:17:00 | * | nif quit (Quit: ...) |
00:17:09 | * | nif joined #nim |
00:17:22 | * | leorize joined #nim |
00:18:47 | FromDiscord_ | <exelotl> @yewpad wow lookin good |
00:19:17 | FromDiscord_ | <yewpad> Thanks! |
00:23:23 | FromDiscord_ | <yewpad> The thing is that the new Dracula style would completely replace the current light themed documentation which some people may want to keep. So I have to build in something that people can switch between light and dark. And this might involve using cookies? idk |
00:24:05 | FromDiscord_ | <exelotl> oh yeah or localstorage |
00:25:09 | FromDiscord_ | <yewpad> hm yeah, local storage seems way to be the way to go. |
00:25:19 | FromDiscord_ | <yewpad> seems to be the way to go* |
00:25:23 | FromDiscord_ | <yewpad> typing to fast geez |
00:30:13 | clyybber | gn8 |
00:30:15 | * | clyybber quit (Quit: WeeChat 2.6) |
00:30:25 | FromDiscord_ | <yewpad> gn8 |
00:32:23 | * | norm joined #nim |
00:32:39 | * | norm is now known as Guest135 |
00:32:50 | * | Hideki_ quit (Remote host closed the connection) |
00:36:08 | Guest135 | y |
00:36:29 | FromDiscord_ | <exelotl> y u |
00:39:06 | * | Guest135 quit (Remote host closed the connection) |
00:53:45 | rayman22201 | This just reminds me that one of these days I want to try to fix the search feature of the docs again.... I "fixed" it the first time, and it didn't go as well as I hoped. |
00:54:10 | rayman22201 | but hey, we have a native nim fuzzy matching algorithm now :-P |
00:54:40 | * | dwdv quit (Ping timeout: 252 seconds) |
01:02:56 | disruptek | madprops: yeah, you probably need some dbus stuff. |
01:03:58 | disruptek | that repo is just a collection of little things that don't justify publishing; just figured you might be able to hack the ix tool to do what you want. |
01:34:50 | FromGitter | <Obround> How do you run nim code at run time? Like python's `exec` statement |
01:35:04 | FromDiscord_ | <treeform> I don't think nim search matters, google will beat you no matter what you do. |
01:35:46 | FromDiscord_ | <Nanjizal> I am curious if anyone has used nim ffi with haxe c++. |
01:35:47 | FromDiscord_ | <treeform> after trying to make my own search algos I gave up... |
01:36:18 | FromDiscord_ | <treeform> @Nanjizal sounds too specific probably a forum question. |
01:36:38 | FromDiscord_ | <treeform> Many have used nim ffi with C++.... but haxe c++? |
01:36:40 | FromDiscord_ | <Nanjizal> ie code project in haxe compile to c++ and then use Nim for any bottle necks. |
01:37:16 | FromDiscord_ | <treeform> does haxe produce readable c++ code? |
01:37:37 | FromDiscord_ | <treeform> isn't haxe a dynamic language similar to action script? |
01:37:49 | FromDiscord_ | <treeform> it probably makes really crazy c++ code. |
01:40:20 | FromDiscord_ | <Nanjizal> No it's static for c++ target. It looks like as3 but it's far more functional. |
01:41:31 | FromDiscord_ | <Simula> what is `seq`, is it a linked list, an array, a vector? |
01:45:08 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:45:58 | FromDiscord_ | <Nanjizal> There is this project https://github.com/Aurel300/ammer would it be easy to hook up nim do you think. Haxe has some cool games toolkits but it would be great to be able to write some low level code in Nim and then plug it in. My worry is that Nim and Haxe both have managed memory. |
01:46:24 | FromDiscord_ | <Nanjizal> I am slowly reading the Nim action book. |
01:47:26 | FromDiscord_ | <treeform> I think it will be hard but not impossible. |
01:49:08 | FromDiscord_ | <Simula> just from looking at the generated C code, it *looks* like it's an array? |
01:49:22 | FromDiscord_ | <exelotl> @Simula it's a vector I guess |
01:49:52 | rayman22201 | I only know a little about Haxe. Nim is similar in that it also uses C/C++ as a compile target. What makes you think Nim will be faster than just "optimizing" your Haxe code? |
01:50:30 | FromDiscord_ | <exelotl> like I'm 90% sure it's length + capacity + pointer to data, self-reallocates as you add more stuff |
01:50:35 | FromDiscord_ | <Simula> it sure is |
01:50:51 | FromDiscord_ | <Simula> which means it's technically an array which means i can use it for this project lmao |
01:50:58 | FromDiscord_ | <Simula> real weird requirements from a professor |
01:51:25 | FromDiscord_ | <exelotl> wow your professor lets you use nim |
01:51:25 | rayman22201 | lol |
01:51:28 | FromDiscord_ | <exelotl> that's cool |
01:51:43 | rayman22201 | your professor lets you use Haxe and Nim? |
01:51:47 | rayman22201 | that's very cool lol |
01:51:51 | FromDiscord_ | <Simula> my professor told me to use any language i want and boy howdy am i making my TAs suffer |
01:52:58 | FromDiscord_ | <Nanjizal> Bit late to think about it tonight but I would be interested to do this since I use Haxe for a long time, but I am not keen to use c++/c, would prefer to be able to use some Nim. |
01:52:58 | FromDiscord_ | <Nanjizal> http://old.haxe.org/doc/cpp/ffi |
01:54:27 | FromDiscord_ | <Nanjizal> Haxe c++ is not very fast compared to native c++ so projects like NME use quite a bit of c++ and then connect to it. |
01:56:39 | rayman22201 | ahh. interesting. This is good for Nim. Nim produces relatively fast C++ You should just use Nim for everything. come to the dark side :-P |
01:58:57 | FromDiscord_ | <Nanjizal> Haxe is probably better at javascript and also Haxe has abstracts and classes and as I said quite a few very robust cross target toolkits. I think it would be nice to use Nim with Haxe. I am intending to learn Nim but I am not in a coding role currently... must get some sleep up early. |
01:59:38 | FromDiscord_ | <Nanjizal> So I don't have too much computer time, and am working on my shader vector stuff in haxe. |
02:01:20 | FromDiscord_ | <Nanjizal> I don't have proffessor, getting us mixed up 🙂 |
02:03:45 | FromDiscord_ | <Nanjizal> I think ffi connection between haxe and nim would be really useful, nim could then hook into haxe libraries and vicer verser. |
02:09:59 | * | lritter quit (Ping timeout: 276 seconds) |
02:24:33 | FromDiscord_ | <yewpad> https://imgur.com/vxwo3xI |
02:24:35 | FromDiscord_ | <yewpad> Finally done |
02:24:57 | FromDiscord_ | <yewpad> See the dark mode switch? Works without any flaws |
02:25:25 | disruptek | you should be able to just sniff darkmode. there's browser support now. |
02:25:39 | FromDiscord_ | <yewpad> Hm good idea |
02:40:48 | FromDiscord_ | <yewpad> @disruptek: Is now integrated! The page will now check if you prefer the dark theme. Check hierarchy: Dark? -> Light? -> (Not supported) -> Check local storage |
02:41:03 | disruptek | cool! |
02:41:33 | FromDiscord_ | <yewpad> I'm done with the "re-design". Now gonna create a pull request and hope for the best |
02:41:46 | disruptek | 🤞 |
02:45:17 | shashlick | disruptek - #12796 |
02:45:19 | disbot | https://github.com/nim-lang/Nim/pull/12796 -- 3Path substitution for --out and --outdir @11genotrance |
02:45:39 | disruptek | hah, nice! |
02:45:48 | shashlick | let's see if it passes tests |
03:03:43 | * | rockcavera quit (Remote host closed the connection) |
03:05:13 | FromDiscord_ | <yewpad> Pull request created. Can't wait to use the 'official' dark mode |
03:05:30 | FromDiscord_ | <yewpad> My eyes will thank me |
03:07:18 | * | endragor joined #nim |
03:18:13 | * | Hideki_ joined #nim |
03:19:00 | FromDiscord_ | <Winton> I LOVE NIM! |
04:10:14 | * | chemist69 quit (Ping timeout: 276 seconds) |
04:11:27 | * | chemist69 joined #nim |
04:18:22 | FromDiscord_ | <yewpad> what the f |
04:18:31 | FromDiscord_ | <yewpad> why would you test the output of `nim doc` |
04:18:44 | FromDiscord_ | <yewpad> One minor style change and the tests go belly up |
04:39:29 | * | natrys joined #nim |
04:43:10 | * | nsf joined #nim |
04:55:55 | * | narimiran joined #nim |
05:15:16 | * | njoseph quit (Ping timeout: 240 seconds) |
05:19:59 | * | njoseph joined #nim |
05:33:13 | * | njoseph quit (Ping timeout: 250 seconds) |
05:35:39 | * | njoseph joined #nim |
06:31:55 | FromGitter | <zacharycarter> where are the nimdoc tests? just curious - want to see what all is tested |
06:34:33 | FromGitter | <zacharycarter> Nanjizal: how is Haxe better at JavaScript? Also, Nim doesn't embrace OOP like Haxe does |
06:35:04 | FromGitter | <zacharycarter> that's one thing I find annoying / turns me off of Haxe - is how rigidly OO it is |
06:36:25 | FromGitter | <zacharycarter> I don't see a point in supporting Nim in Haxe anyway... You might as well just use Nim |
06:41:44 | FromGitter | <zacharycarter> Araq: question for you - I read a message from you recently about LLVM being fully embraced in the future by Nim potentially as a target. I believe you also said that you weren't show how excellent C++ interop would be achieved if this were to happen. |
06:41:50 | FromDiscord_ | <yewpad> @zacharycarter: in the "nimdoc" dir (root/nimdoc) |
06:42:47 | FromDiscord_ | <Rika> ??? i cant intersect orderedhashsets? |
06:42:52 | FromGitter | <zacharycarter> Will achieving excellent C++ interop still be a priority if Nim move towards fully supporting LLVM - or will it be a sacrifice we have to live with to gain support for LLVM? |
06:43:08 | FromGitter | <zacharycarter> and if it's the latter, what kind of C++ interop support can we expect? |
06:43:13 | FromGitter | <zacharycarter> yewpad: thanks will check them out |
06:45:56 | FromGitter | <zacharycarter> ooph yeah - having styling rules in the expected output is weird |
06:46:07 | FromGitter | <zacharycarter> but I guess if you don't expect the styling rules to ever change |
06:47:55 | * | solitudesf joined #nim |
06:59:25 | FromDiscord_ | <Stuffe> Pretty sure I found a simple bug: |
06:59:25 | FromDiscord_ | <Stuffe> https://play.nim-lang.org/#ix=23qw |
07:00:38 | madprops | how can i send a seq as a mutable reference to a proc for it to get modified? |
07:01:17 | FromDiscord_ | <Stuffe> proc(myseq: var seq[int]) = |
07:01:33 | FromDiscord_ | <treeform> I would rather we keep C++ interop... |
07:01:35 | FromDiscord_ | <Stuffe> you put the "var" in the function declaration before the argument to make it mutable |
07:03:04 | FromDiscord_ | <Simula> im trying to set a ref object to nil but for some reason it isn't working. is there something im missing? |
07:03:37 | FromDiscord_ | <treeform> @Stuffe this works: https://play.nim-lang.org/#ix=23qy |
07:04:02 | FromDiscord_ | <treeform> I think Ordered table has not been converted to the new nil is empty paradigm... |
07:04:18 | FromDiscord_ | <treeform> procs need to be made work with nil is empty |
07:04:26 | FromDiscord_ | <treeform> still a bug |
07:04:32 | FromDiscord_ | <treeform> but that's why it happened |
07:04:32 | FromDiscord_ | <Stuffe> @treeform ok i see |
07:04:53 | FromDiscord_ | <Stuffe> Helpful work around, better than my dirty try statement |
07:04:55 | FromDiscord_ | <treeform> @Simula do you have a simple example? |
07:05:00 | FromDiscord_ | <Simula> i dont |
07:05:04 | FromDiscord_ | <Simula> its a hundred lines long |
07:05:09 | FromDiscord_ | <Simula> let me see what i can do |
07:05:17 | FromDiscord_ | <treeform> i think its more complex then setting a ref to nil |
07:05:35 | FromDiscord_ | <Stuffe> @treeform are you actively working on the language? |
07:06:03 | FromDiscord_ | <Simula> @treeform happens on line 20 https://pastebin.com/8CVjmNq9 |
07:06:25 | FromDiscord_ | <Simula> not a full working example |
07:06:25 | FromDiscord_ | <treeform> @Simula setting it to nil works: https://play.nim-lang.org/#ix=23qA |
07:06:35 | FromDiscord_ | <Simula> it absolutely doesnt |
07:06:57 | FromDiscord_ | <treeform> `proc deleteNode(node: var BstNode, data: int): bool =` |
07:07:04 | FromDiscord_ | <treeform> var BstNode is wrong |
07:07:09 | FromDiscord_ | <Simula> line 22 still prints out the child node even though it should be nil |
07:07:20 | FromDiscord_ | <treeform> you are making the pointer to the BstNode a mutable |
07:07:32 | FromDiscord_ | <treeform> but BstNode is alreayd a ref object, remove the bar |
07:07:38 | FromDiscord_ | <treeform> but BstNode is alreayd a ref object, remove the var |
07:07:48 | FromDiscord_ | <Simula> `https://pastebin.com/8CVjmNq9` |
07:07:51 | FromDiscord_ | <Simula> whoops |
07:08:00 | FromDiscord_ | <Simula> ` Error: 'node' cannot be assigned to` |
07:08:02 | FromDiscord_ | <Simula> `Error: 'node' cannot be assigned to` |
07:08:21 | FromDiscord_ | <treeform> @Stuffe no, I maybe submitted 5 patches to the language, I am mostly a user. |
07:08:46 | FromDiscord_ | <Simula> i cant set the node to nil if it isnt mutable |
07:09:11 | FromDiscord_ | <Simula> but i think i understand the issue now |
07:09:14 | FromDiscord_ | <treeform> you are setting some thing else to nil |
07:09:20 | FromDiscord_ | <treeform> the address of the callee |
07:09:33 | FromDiscord_ | <treeform> it does not change the data structure, just the passed arguments |
07:09:46 | FromDiscord_ | <Simula> how do i set the actual node to nil then? |
07:09:58 | FromDiscord_ | <treeform> I think by passing the parent node |
07:10:02 | FromDiscord_ | <treeform> and setting it to nil |
07:10:11 | FromDiscord_ | <Simula> im not sure i understand |
07:10:55 | FromDiscord_ | <Simula> is there a way to delete an object? |
07:11:03 | FromDiscord_ | <treeform> your deleteNode function can't work because it can't unset the parent node |
07:11:08 | FromDiscord_ | <treeform> because you don't pass it |
07:11:51 | FromDiscord_ | <treeform> say you have a list of @[1,2,3] |
07:11:58 | FromDiscord_ | <treeform> your function says |
07:12:03 | FromDiscord_ | <treeform> delete(3) |
07:12:08 | FromDiscord_ | <treeform> but from which list??? |
07:12:17 | FromDiscord_ | <treeform> yeah it can delete everything inside 3 ... all of the bits |
07:12:26 | FromDiscord_ | <treeform> but it will not remove it from the list of @[1,2,3] |
07:12:28 | FromDiscord_ | <Simula> im still not following |
07:12:33 | FromDiscord_ | <treeform> you need some thing like |
07:12:36 | FromDiscord_ | <treeform> delete(list, 3) |
07:12:36 | FromDiscord_ | <Simula> im passing the root node, doesnt get more parent than that |
07:12:50 | FromDiscord_ | <Simula> thats what i have |
07:12:50 | FromDiscord_ | <treeform> you need some thing like this: |
07:13:03 | FromDiscord_ | <treeform> `proc deleteNode(root: BstNode, node: BstNode, data: int): bool =` |
07:13:12 | FromDiscord_ | <treeform> you walk through the root node |
07:13:15 | FromDiscord_ | <Simula> but what happens when i want to delete the root node? |
07:13:16 | FromDiscord_ | <treeform> find the node inside it |
07:13:31 | FromDiscord_ | <treeform> well you can't? |
07:13:41 | FromDiscord_ | <treeform> not with that api |
07:13:43 | FromDiscord_ | <Simula> i have to be able to though |
07:14:14 | FromDiscord_ | <Simula> screw it, i'll just have the function return a whole new bst instead of modifying it in-place |
07:14:19 | FromDiscord_ | <treeform> lol |
07:14:28 | FromDiscord_ | <Simula> i mean, what else can i do? |
07:14:28 | FromDiscord_ | <treeform> yeah that could return a nil yes |
07:14:45 | FromDiscord_ | <treeform> the thing that points to the root node is some global of a function local |
07:15:46 | FromDiscord_ | <Simula> i dont unederstand what you mean |
07:16:12 | FromDiscord_ | <treeform> Sorry I was wrong. |
07:16:18 | FromDiscord_ | <treeform> I think I confused myself and you. |
07:16:27 | FromDiscord_ | <treeform> https://play.nim-lang.org/#ix=23qC |
07:16:31 | FromDiscord_ | <treeform> here it works |
07:16:35 | FromDiscord_ | <treeform> you pass it as a var |
07:16:50 | FromDiscord_ | <treeform> which is usually not correct thing to do, in this case you want to modify the address of the thing instead of the thing |
07:16:58 | FromDiscord_ | <treeform> so you correctly pass var |
07:17:06 | FromDiscord_ | <Simula> that's what i was already doing |
07:17:08 | FromDiscord_ | <Simula> and it isnt working |
07:17:11 | Araq | https://www.geeksforgeeks.org/deletion-binary-tree/ port it over to Nim, how hard can it be |
07:17:19 | Araq | * is ref |
07:17:22 | Araq | & is var |
07:17:28 | Araq | NULL is nil |
07:17:35 | Araq | -> is . |
07:17:44 | Araq | that's about it, Nim doesn't innovate anything here |
07:18:17 | FromDiscord_ | <Simula> i'm trying to modify it in-place though |
07:18:24 | FromGitter | <alehander92> such an non-innovative language! |
07:18:40 | FromDiscord_ | <Simula> i just dont understand why this doesnt work |
07:19:17 | FromGitter | <alehander92> `tempnode = nil`? |
07:19:25 | FromDiscord_ | <Simula> that's what im doing |
07:19:30 | FromDiscord_ | <treeform> I have shown the setting to nil part works: https://play.nim-lang.org/#ix=23qC the error is in the other code... |
07:19:31 | Araq | zacharycarter: ideally LLVM is good with C++ interop as long as you compiled the C++ via clang :-) |
07:19:33 | FromGitter | <alehander92> but this cant possibly work |
07:19:55 | FromDiscord_ | <Simula> okay but it clearly doesn't work |
07:19:57 | FromGitter | <alehander92> Simula, so basically `tempnode` is just a local variable, whatever you assign to it , changes only it |
07:20:20 | FromDiscord_ | <Simula> ohhhhh |
07:20:26 | FromGitter | <alehander92> you have to `node = ` |
07:20:36 | FromDiscord_ | <Simula> so im just screwed then :/ |
07:20:40 | FromGitter | <alehander92> if node is var argument, as treeform showed |
07:20:47 | FromGitter | <alehander92> no, you're not |
07:21:17 | FromDiscord_ | <Simula> so how would i modify this in place then? |
07:21:30 | FromDiscord_ | <Stuffe> I wonder what the general focus is for development of NIM is now that v1 has been released? |
07:21:38 | FromDiscord_ | <treeform> don't use the tmp node |
07:21:54 | FromDiscord_ | <Simula> im not sure how else i would do it without that |
07:21:56 | FromDiscord_ | <Simula> b |
07:22:00 | Araq | Stuffe: https://github.com/nim-lang/RFCs/milestone/1 |
07:22:34 | FromDiscord_ | <Stuffe> oh incremental compilation will be cool |
07:22:47 | FromDiscord_ | <treeform> @Simula I think you just have a small bug some place. You are really close. |
07:23:06 | FromDiscord_ | <Simula> setting `tempnode.data = -1` changes that node for all references, but setting that node to nil doesnt |
07:23:22 | FromDiscord_ | <treeform> that's correct |
07:23:24 | FromDiscord_ | <Simula> i just need to set all references to this object to nil |
07:23:35 | FromGitter | <alehander92> Simula you can just restructure |
07:23:38 | FromGitter | <alehander92> e.g. do |
07:23:39 | Araq | Simula: please look at my linked solution |
07:23:51 | FromDiscord_ | <Simula> @Araq i did, it doesn't fit my needs |
07:23:58 | FromDiscord_ | <Simula> it doesn't modify the tree in-place |
07:24:05 | Araq | it does do that. |
07:24:19 | FromGitter | <alehander92> if `node.left < node.right` : node.left = .. else: node.right = .. |
07:24:38 | FromGitter | <alehander92> where you can compare data or just overload `cmp` |
07:24:52 | FromDiscord_ | <treeform> Araq, that is not a lot of plans for 2020... |
07:25:43 | Araq | excuse me? it's an aweful lot |
07:25:45 | FromGitter | <alehander92> treeform it's super much if actually finished |
07:25:55 | FromDiscord_ | <treeform> only 4 things? |
07:26:16 | FromGitter | <alehander92> imagine "nuclear fusion" as "1 thing" |
07:26:59 | FromDiscord_ | <Simula> araq: no, that example returns a completely new BST |
07:28:19 | FromGitter | <alehander92> it really wouldnt |
07:28:33 | Araq | how could it do that? it doesn't even call newNode once |
07:28:36 | FromGitter | <alehander92> it returns a pointer to an existing node |
07:29:02 | FromGitter | <alehander92> `struct Node* temp; ` might seem like that, but it will be assigned with an existing node |
07:29:21 | FromDiscord_ | <Simula> it's literally returning pointers in the first few lines |
07:29:54 | FromGitter | <alehander92> which are literally NULL or the existing `root` |
07:30:00 | Araq | lol |
07:30:03 | FromGitter | <alehander92> please, try to read the code more carefully |
07:30:38 | Araq | and then read a book about data structures and pointers, you don't have a Nim problem, you have a general programming problem |
07:31:06 | FromDiscord_ | <Simula> i am. if you're deleting the root node, the root node would be set to NULL, but the function doesn't do that |
07:31:57 | Araq | proc inplaceDelete(root: var Node; key: Key) = root = deletion(root, key) |
07:32:03 | * | Hideki_ quit (Remote host closed the connection) |
07:32:26 | Araq | so that last step wasn't done, not a big deal |
07:32:47 | FromGitter | <alehander92> Simula, ah i am sorry, but yeah, thats what you should do |
07:32:59 | FromDiscord_ | <Rika> anyone made a nim library for TI-84 calculators? |
07:33:01 | FromGitter | <alehander92> basically always assign to either the `var argument` or a field of it |
07:33:15 | * | Hideki_ joined #nim |
07:34:21 | Araq | https://www.geeksforgeeks.org/avl-tree-set-2-deletion/ has some good pictures |
07:34:34 | Araq | this stuff is not easy |
07:34:36 | FromDiscord_ | <Rika> oh man, i need to learn c past beginner stuff |
07:35:21 | * | PMunch joined #nim |
07:36:30 | * | thomasross_ joined #nim |
07:36:30 | * | thomasross is now known as Guest51441 |
07:36:30 | * | thomasross_ is now known as thomasross |
07:36:48 | FromDiscord_ | <Simula> araq: following the example you linked me, the c++ code uses `delete (d_node);`, is there a nim equivalent to this? |
07:37:14 | * | Guest51441 quit (Ping timeout: 268 seconds) |
07:37:35 | * | Hideki_ quit (Ping timeout: 250 seconds) |
07:38:20 | FromGitter | <zacharycarter> Araq: makes sense - I guess I won't worry about it until it's a thing :) |
07:38:32 | FromGitter | <alehander92> so in your case i'd just not use getMin, but instead something like `if left is smaller than right: callHelper(node.left) else: callhelper(node.right)` |
07:38:43 | FromGitter | <alehander92> or whatever the algorithm needs not sure |
07:38:45 | FromGitter | <alehander92> like logic |
07:38:56 | FromGitter | <alehander92> i am also bad at algos |
07:41:46 | FromDiscord_ | <Simula> does nim not have queues built in? i can't seem to import it |
07:42:17 | Araq | Simula: delete(n) is roughly n[] = default(typeof(n[])) |
07:42:41 | FromDiscord_ | <Simula> thanks |
07:42:43 | Araq | or maybe reset(n[]) |
07:43:16 | Araq | for the queue you can use a seq or import deques |
07:48:19 | FromDiscord_ | <yewpad> @araq: did you have a look on the pull request about the documentation dark mode? i can barely fix any of the broken tests because when I try to generate the doc, the compiler exits and tells me something weird about how "C:\Program" is not a executable etc. and just note: Please don't check against styling rules. That's the reason why all the tests failed. |
07:48:38 | FromDiscord_ | <yewpad> and just a side note* |
07:49:45 | Araq | lin please |
07:49:48 | Araq | link |
07:50:11 | FromDiscord_ | <yewpad> https://github.com/nim-lang/Nim/pull/12797 |
07:50:12 | disbot | ➥ Nim documentation now in gorgeous Dracula theme @11yewpad |
07:50:37 | * | xace quit (Ping timeout: 240 seconds) |
07:50:53 | FromDiscord_ | <Simula> how do i use a dequeue? i cant import it |
07:51:24 | FromGitter | <alehander92> they are Deque in nim |
07:51:26 | * | thomasross quit (Read error: Connection reset by peer) |
07:51:34 | FromGitter | <alehander92> and deques |
07:51:49 | FromDiscord_ | <yewpad> https://nim-lang.org/docs/deques.html |
07:51:52 | FromDiscord_ | <Simula> i see that |
07:51:55 | FromDiscord_ | <Simula> i cant import it |
07:52:03 | FromDiscord_ | <yewpad> Code? |
07:52:03 | FromDiscord_ | <Simula> oh im an idiot |
07:52:39 | FromGitter | <alehander92> off to work |
07:52:41 | * | xace joined #nim |
07:53:06 | FromGitter | <alehander92> yeah, typos can be quite the head scratcher |
07:53:12 | FromGitter | <alehander92> ah this is my peak in english |
07:53:13 | FromGitter | <alehander92> see ya |
07:53:24 | FromDiscord_ | <yewpad> take care |
07:54:36 | Araq | yewpad: FAILURE: files differ: nimdoc/testproject/htmldocs/theindex.html |
07:54:43 | Araq | you didn't patch the tests |
07:55:01 | Araq | there is an easy way to do that. after manual inspection, run this command: |
07:55:17 | FromDiscord_ | <yewpad> I really would like to do so but whenever I try to test tests, it fails with some weird ass error |
07:56:02 | Araq | nim c -r -d:fixup nimdoc/tester |
07:56:14 | FromDiscord_ | <yewpad> aight |
07:56:18 | FromDiscord_ | <yewpad> hold the phone for a sec |
07:56:23 | Araq | ok |
07:57:07 | Araq | I replied on your PR |
07:57:13 | Araq | so that this command is not lost |
07:57:30 | FromDiscord_ | <Simula> araq: the tutorial you linked is incorrect |
07:58:42 | Araq | I seriously doubt that but the general idea is: find correct snippets in C++ and port it to Nim rather than rolling your own |
07:58:51 | FromDiscord_ | <yewpad> playground down? |
07:58:54 | FromDiscord_ | <yewpad> nvm |
07:58:55 | FromDiscord_ | <Simula> it creates an unbalanced bst |
07:59:06 | FromDiscord_ | <yewpad> @araq: https://play.nim-lang.org/#ix=23qH |
07:59:07 | FromDiscord_ | <Simula> i really dont appreciate you linking me incorrect code and then insulting my programming ability when i tell you its wrong |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:00:19 | Araq | wrong or not, you clearly didn't read the code correctly |
08:00:49 | FromDiscord_ | <Simula> i absolutely did |
08:01:04 | FromDiscord_ | <Simula> and it's garbage code |
08:01:24 | Araq | https://www.geeksforgeeks.org/avl-tree-set-2-deletion/ for balanced AVL trees |
08:02:25 | Araq | but go pick a different site that is not "garbage code". I'm only trying to help and it certainly looks to me that you don't really understand pointers, no offense. |
08:02:57 | FromDiscord_ | <Simula> i understand pointers, i just don't understand anything that's happening in nim |
08:03:33 | Araq | well I also told you the basic translation rules, T& is 'var T', T* is 'ref T', etc |
08:04:26 | FromDiscord_ | <yewpad> @araq: https://play.nim-lang.org/#ix=23qH |
08:04:49 | FromDiscord_ | <Simula> what would be the equivalent of T**, `ref ref T`? |
08:04:57 | * | gmpreussner joined #nim |
08:05:35 | Araq | Simula: depends, more likely, 'ptr ref T' |
08:06:59 | Araq | yewpad: strange... put Nim inside a directory without a space for the time being |
08:07:12 | FromDiscord_ | <yewpad> i'll try with wsl |
08:10:59 | * | Hideki_ joined #nim |
08:12:30 | FromDiscord_ | <yewpad> @araq: Well it works but I can't access WSL's storage due to WSL 2 using some different storage mechanism. I'll probably have to painfully patch it using GitHub edit thingy, pull the changes and try test. That's wayyy to painful. I would appreciate it if you just would close the pull request, add the edited nimdoc.cfg yourself and do the patches because it seems to be working on your machine. I can't do jackshit |
08:15:27 | FromDiscord_ | <yewpad> wait, i got an idea |
08:22:38 | FromDiscord_ | <yewpad> well moving nim to the c directory broke everything |
08:22:41 | FromDiscord_ | <yewpad> jesus christ |
08:22:53 | FromDiscord_ | <yewpad> why can't just something work just for once |
08:24:22 | Araq | yewpad, it's fine, we can take over |
08:24:42 | Araq | but I won't close your PR, I'll add to ti |
08:24:45 | Araq | it |
08:25:43 | FromDiscord_ | <yewpad> aight, thank you |
08:26:51 | FromDiscord_ | <yewpad> appreciate it |
08:36:32 | Araq | yewpad: I just saw you contacted my via gitter, I'm available now |
08:42:36 | FromDiscord_ | <Rika> you can access wsl2's files by opening "explorer.exe" within bash |
08:42:42 | FromDiscord_ | <Rika> if thats your issue |
08:45:52 | FromDiscord_ | <yewpad> There was some weird virtual disk file thingy 🤔 |
08:46:00 | FromDiscord_ | <yewpad> Not using WSL 1, I'm using WSL 2 |
08:46:05 | FromDiscord_ | <yewpad> the insider version |
08:56:00 | FromDiscord_ | <Rika> i was talking about wsl2 yes |
08:56:13 | FromDiscord_ | <Rika> wsl1 opening explorer.exe opens a regular explorer |
08:56:28 | FromDiscord_ | <Rika> wsl2 apparently opens explorer.exe for the linux disk |
08:57:34 | FromDiscord_ | <Rika> https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes#place-your-linux-files-in-your-linux-root-file-system |
08:59:18 | * | endragor quit (Remote host closed the connection) |
08:59:47 | * | endragor joined #nim |
09:00:04 | * | natrys quit (Ping timeout: 265 seconds) |
09:00:06 | Araq | ping PMunch |
09:00:13 | * | endragor quit (Read error: Connection reset by peer) |
09:00:32 | * | endragor joined #nim |
09:00:37 | PMunch | Hi |
09:00:47 | PMunch | Araq, |
09:00:58 | Araq | do you have time for a live coding session? |
09:01:13 | PMunch | Right now? I'm at work unfortunately.. |
09:01:38 | Araq | ok, well, can you be in the chat? |
09:01:45 | PMunch | Yeah sure |
09:02:20 | PMunch | I can watch the thing as well |
09:02:36 | PMunch | But I think others in the office would wonder what I was doing if I started voice-chatting :P |
09:03:06 | Araq | ok, let's see if I can get this to setup... |
09:03:24 | PMunch | What're you doing by the way? |
09:04:23 | FromGitter | <alehander92> you can start rapping instead |
09:05:46 | Araq | fixing 'let x = []' so that it works with .codegenDecl |
09:05:57 | Araq | can't let C win this one |
09:08:35 | PMunch | Oh right, that's the thing I had to hack around :) |
09:10:00 | * | dwdv joined #nim |
09:10:11 | PMunch | By the way, any plan on making a way to let Nim declare top-level variables for basic types without having to initialise with NimMain? |
09:10:37 | Araq | sounds to be the very same patch to the codegen |
09:11:08 | PMunch | Hmm, might be, I don't know what is needed to fix that. |
09:13:30 | * | natrys joined #nim |
09:13:50 | * | natrys quit (Client Quit) |
09:16:59 | * | Vladar joined #nim |
09:18:23 | Araq | https://www.twitch.tv/araq4k |
09:21:51 | PMunch | Wait, is it still possible to join the chat via IRC? |
09:24:04 | Araq | dunno |
09:41:37 | * | literal quit (Ping timeout: 240 seconds) |
09:41:44 | * | literal joined #nim |
10:05:12 | * | Hideki_ quit (Remote host closed the connection) |
10:10:43 | * | Hideki_ joined #nim |
10:17:44 | * | endragor quit (Remote host closed the connection) |
10:19:28 | * | endragor joined #nim |
10:20:18 | * | ng0 joined #nim |
10:38:40 | * | Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
10:38:54 | * | Yardanico joined #nim |
10:39:02 | * | spacepluk quit (Quit: leaving) |
10:40:49 | * | spacepluk joined #nim |
10:40:59 | * | spacepluk quit (Client Quit) |
10:42:35 | * | spacepluk joined #nim |
10:43:00 | * | spacepluk quit (Client Quit) |
10:43:49 | * | spacepluk joined #nim |
10:45:17 | * | spacepluk quit (Client Quit) |
10:45:29 | * | spacepluk joined #nim |
10:48:10 | * | salewski joined #nim |
10:48:18 | spacepluk | list unity |
10:48:26 | spacepluk | oops, sorry about that |
10:50:18 | * | njoseph quit (Ping timeout: 246 seconds) |
10:50:54 | salewski | @admins, seems they start hacking in spam links again into forum posts. |
10:51:00 | salewski | https://forum.nim-lang.org/t/5623 |
10:51:21 | salewski | Was a copy of https://old.reddit.com/r/nim/comments/dpdsh7/nim_is_the_friendliest_language_to_start/ |
10:53:18 | * | clyybber joined #nim |
10:53:21 | narimiran | dom96: see ^, that's why we need a much shorter allowed time for edits |
10:54:26 | narimiran | and if somebody wants to edit their message with more info after couple of days - it is better that it is a new comment, that way everybody will see it, otherwise it will be ignored by the majority of readers |
10:54:29 | salewski | Dom, I like late edits. Sometimes I write nonsense! |
10:54:32 | salewski | Bye. |
10:54:36 | Araq | salewski, thanks |
10:54:40 | Araq | I edited it out ;-) |
10:54:44 | * | salewski quit (Quit: WeeChat 2.6) |
10:54:58 | clyybber | Araq: Only got the end of your lifestream, what did you do? |
10:55:11 | clyybber | Made let vars work with .codegenDecl.? |
10:55:44 | clyybber | Was the isConst param related or just some unrelated refactoring? |
10:58:04 | spacepluk | has anybody tried to wrap AWS' cpp sdk? |
11:00:05 | Araq | clyybber, related https://github.com/nim-lang/Nim/pull/12799 PR now here |
11:00:06 | disbot | ➥ better support for PROGMEM like annotations for lets/vars; fixes #12216 👑11Araq |
11:00:38 | Araq | narimiran, do we have an "allowed time limit" already? |
11:01:02 | spacepluk | I see there's aws_sdk but it seems unmaintained and it doesn't use the official sdk |
11:01:04 | narimiran | Araq: yes and it is one week. waaay too relaxed if you ask me |
11:01:46 | Araq | omg, it should be 1 hour |
11:03:31 | narimiran | yep |
11:06:03 | clyybber | Araq: Btw, made the refactoring #12793 against your PR so you can merge it into arc devel if you want. |
11:06:04 | disbot | https://github.com/nim-lang/Nim/pull/12793 -- 3Refactor injectdestructors @11Clyybber |
11:07:10 | Araq | clyybber, noticed, it's great |
11:07:37 | Araq | spacepluk, ask disruptek if he's around |
11:10:38 | * | nif quit (Quit: ...) |
11:10:48 | * | nif joined #nim |
11:12:14 | FromDiscord_ | <mratsim> Maybe just allow late edits if someone has more than 5 posts |
11:12:20 | FromDiscord_ | <mratsim> that's what is done in discuss |
11:12:42 | FromDiscord_ | <mratsim> a spammer won't create more than 5 posts without being spotted |
11:16:09 | FromDiscord_ | <Clyybber> @exelotl https://github.com/nim-lang/Nim/pull/12799 might be relevant to you |
11:16:10 | disbot | ➥ better support for PROGMEM like annotations for lets/vars; fixes #12216 👑11Araq |
11:28:15 | * | rockcavera joined #nim |
11:53:04 | spacepluk | Araq: disruptek: probably not the best idea for a newbie but I'm gonna try 🙈 |
11:55:02 | * | solitudesf quit (Ping timeout: 265 seconds) |
12:00:19 | FromGitter | <alehander92> i have a type with like 150 fields |
12:10:51 | FromDiscord_ | <exelotl> @Clyybber oh snap |
12:14:22 | FromDiscord_ | <Clyybber> @exelotl What exactly did you need? I kind of forgot. |
12:16:03 | PMunch | Araq, looking at your branch with the codegenDecl fix, looks good :) |
12:17:16 | FromDiscord_ | <exelotl> Basically the code examples in this post: https://forum.nim-lang.org/t/5192#32574 |
12:19:29 | clyybber | exelotl: I think you can do that with that PR |
12:19:43 | FromDiscord_ | <exelotl> i.e. let statements producing static initializers where possible, including objects containing pointers to other static data, procedures etc |
12:20:04 | FromDiscord_ | <exelotl> That's really exciting, I'll try it out when I get home |
12:25:11 | Zevv | PMunch: so does it even support the quirky atmel PROGMEM? |
12:28:18 | Araq | well I did the foundation for this feature |
12:28:31 | Araq | maybe it's not good enough, PRs are always welcome |
12:30:49 | * | endragor quit (Remote host closed the connection) |
12:38:43 | PMunch | Hmm, it seems to work well, but I have another bug I think |
12:41:28 | PMunch | Oh wait |
12:42:02 | PMunch | It converted a compile-time seq[byte] to an array of ints when I did: var `name` {.codegenDecl: "const $# PROGMEM $#".} = `spriteData` |
12:42:15 | PMunch | `spriteData` is the sequence of bytes |
12:42:42 | * | njoseph joined #nim |
12:43:12 | Araq | seqs are hard |
12:43:26 | PMunch | Well I want it to generate an array |
12:43:31 | Araq | you can grow them so init via {} is a dangerous thing to do |
12:43:35 | PMunch | But it gathers them in a seq in the macro first |
12:44:16 | PMunch | I changed it to: var `name` {.codegenDecl: "const $# PROGMEM $#".}: array[0..`spriteLen`, uint8] = `spriteData` |
12:44:32 | PMunch | But now I get: Error: type mismatch: got <array[0..25, int]> but expected 'array[0..25, uint8]' |
12:46:50 | Araq | make it uint8s |
12:46:55 | PMunch | Collected them directly in a nnkBrocket and it works |
13:05:37 | PMunch | Works perfectly! |
13:05:59 | * | NimBot joined #nim |
13:12:44 | PMunch | Hmm, is there a way to push an emit statement into the file that imports a module? |
13:13:46 | PMunch | I have some importc, nodecl variables with an emit. But while the types are visible to the importer, the emit isn't. So the C compiler fails |
13:31:50 | clyybber | This doesn't work: https://play.nim-lang.org/#ix=23rJ |
13:32:57 | clyybber | Araq: It should, right? |
13:33:31 | * | sealmove joined #nim |
13:33:36 | sealmove | Good afternoon! |
13:33:46 | * | endragor joined #nim |
13:34:44 | clyybber | sealmove: Hello |
13:47:34 | sealmove | what are you working on today clyybber? |
13:51:10 | * | sealmove quit (Quit: WeeChat 2.6) |
13:59:10 | clyybber | sealmove: Trying to make this work https://play.nim-lang.org/#ix=23rJ :) |
14:00:38 | clyybber | Hmm, well it works in brackets, so its not blocking me. |
14:03:40 | FromDiscord_ | <sealmove> Hmm |
14:06:18 | * | Kaivo joined #nim |
14:06:56 | * | endragor quit (Remote host closed the connection) |
14:10:44 | * | endragor joined #nim |
14:13:00 | * | tane joined #nim |
14:13:52 | Araq | clybber: yes |
14:15:08 | clyybber | I added it to the issue thats the same but with `block:` |
14:20:22 | disruptek | spacepluk: i looked at wrapping aws_sdk; it's tough. i think my solution is better: |
14:20:25 | disruptek | !repo atoz |
14:20:26 | disbot | https://github.com/disruptek/atoz -- 9atoz: 11Amazon Web Services (AWS) APIs in Nim 15 10⭐ 0🍴 |
14:29:58 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
14:30:28 | PMunch | Hmm, when using Nim without the GC, is there a way to make Nim handle all string literals as cstrings? |
14:30:50 | PMunch | I guess I could possibly write a term rewriting macro.. |
14:31:03 | spacepluk | disruptek: oh thanks, I'll take a look |
14:32:13 | spacepluk | basically my nim testing project is downloading a bunch of gzipped jsons from s3 and dumping everything into a postgres db with copy |
14:32:45 | spacepluk | then if I get that working I'll try to parallelize the unziping/copying |
14:32:50 | disruptek | well, http will suffice for that. |
14:33:28 | spacepluk | I need to list the files and only import each file once |
14:33:55 | disruptek | sure. atoz works well. |
14:34:06 | spacepluk | I thought I would try the interop in the process but it's obviously too much for me at this point hehe |
14:34:33 | spacepluk | also, I don't think I understand what nimble is |
14:34:45 | disruptek | it's just not worthwhile, as a native nim interface can be far superior. |
14:34:50 | PMunch | Nimble is Nims package manager |
14:35:10 | PMunch | And it is also used to build most packages |
14:35:45 | spacepluk | I tried to use a few packages that use native graphic libs, but none of them actually include the native libraries when you pull them |
14:35:50 | FromDiscord_ | <mratsim> not sure parallelizing copying is worth it, you'll be limited by disk IO anyway |
14:36:32 | spacepluk | and I'm seeing that the stuff gets installed under ~/.nimble... isn't that a problem when you have multiple versions of a dependency in different projects? |
14:36:40 | disruptek | atoz is async-friendly. |
14:36:50 | * | solitudesf joined #nim |
14:36:57 | disruptek | !repo disruptek/nimph |
14:36:58 | disbot | https://github.com/disruptek/nimph -- 9nimph: 11a nim package hierarchy manager from the future 🧚 15 2⭐ 0🍴 |
14:37:00 | FromDiscord_ | <mratsim> when you have multiple versions they get tagged |
14:37:01 | spacepluk | FromDiscord_: it's mostly for the unzipping |
14:37:14 | FromDiscord_ | <mratsim> but lock files are in progress |
14:37:28 | FromDiscord_ | <mratsim> to better handle multiversioning |
14:37:59 | disruptek | lockfile writes are done; maybe read will be done today. 😎 |
14:38:01 | FromDiscord_ | <mratsim> or I hope they are, anyway that's one of the big issues and priority in nimble at the moment |
14:38:05 | FromDiscord_ | <mratsim> oh |
14:38:44 | disruptek | well, not nimble. i dunno anything about nimble. |
14:39:31 | spacepluk | lock files? |
14:40:01 | spacepluk | disruptek: great name! haha |
14:40:05 | spacepluk | nimph |
14:41:13 | * | Hideki_ quit (Remote host closed the connection) |
14:41:24 | * | lritter joined #nim |
14:41:35 | spacepluk | lock files npm-style? |
14:41:58 | disruptek | not really. |
14:42:09 | * | Hideki_ joined #nim |
14:42:20 | disruptek | i mean, sorta. nim doesn't actually have multi-level deps. |
14:42:21 | spacepluk | why do you need those because of non-specific transitive deps? |
14:43:04 | disruptek | nimph is a tool for a different kind of workflow; one involving git for everything. |
14:43:21 | disruptek | so lockfiles in nimph allow you to roll your entire codebase at once. |
14:43:51 | spacepluk | I'm interested in that, I'll put it on my to read queue :) |
14:44:38 | spacepluk | do you have a comparison doc with nimble? I haven't even finishd reading nim's manual |
14:44:39 | disruptek | it's just another package manager with git/github support built-in. |
14:45:02 | disruptek | it uses nimble assets and nimble itself, if you wish. |
14:47:14 | * | Hideki_ quit (Ping timeout: 276 seconds) |
14:47:19 | spacepluk | got it |
14:47:58 | disruptek | it's kinda like a prototype impl of features that nimble has been expecting to implement for a few years. |
14:50:40 | FromGitter | <alehander92> why can't i |
14:50:48 | disruptek | you can! |
14:50:59 | FromGitter | <alehander92> $(expression.type.name)[0] |
14:51:04 | FromGitter | <alehander92> in a template |
14:51:05 | FromGitter | <alehander92> i cannt |
14:51:14 | clyybber | whats the error? |
14:51:53 | FromGitter | <alehander92> fatal.nim(39) sysFatal ⏎ Error: unhandled exception: index out of bounds, the container is empty [IndexError] |
14:52:00 | FromGitter | <alehander92> but it works with type.name[1..^10] |
14:52:18 | spacepluk | disruptek: looks nice, can you patch the dependencies in place? |
14:52:27 | disruptek | that's the idea, yes. |
14:52:48 | spacepluk | great! |
14:53:21 | disruptek | i'm really happy with it. |
14:53:40 | FromGitter | <alehander92> it comes from semExpr .. some stuff .. elemType .. lastSo |
14:53:45 | FromGitter | <alehander92> lastSon |
14:53:51 | clyybber | alehander92: Hmmm |
14:54:16 | FromGitter | <alehander92> and it works |
14:54:18 | FromGitter | <alehander92> with [0 .. 0] |
14:54:21 | clyybber | Is it parsed as ($(expression.type.name))[0] or the other way around? |
14:54:23 | * | endragor quit (Remote host closed the connection) |
14:54:36 | clyybber | alehander92: Report it. |
14:56:34 | clyybber | s/./? |
14:56:58 | FromGitter | <alehander92> ok ! |
14:57:04 | * | ng0_ joined #nim |
14:58:19 | * | EvilKhaosKat joined #nim |
14:59:36 | * | ng0 quit (Ping timeout: 260 seconds) |
15:01:08 | * | zyklon quit (Ping timeout: 245 seconds) |
15:01:54 | * | EvilKhaosKat quit (Client Quit) |
15:02:10 | * | EvilKhaosKat joined #nim |
15:02:57 | * | ng0_ is now known as ng0 |
15:06:20 | spacepluk | none of the postgresql wrappers have support for copy, right? |
15:09:02 | * | endragor joined #nim |
15:09:28 | spacepluk | I can probably pipe the data to psql stdin... |
15:11:08 | * | EvilKhaosKat quit () |
15:11:58 | * | rokups joined #nim |
15:14:32 | * | endragor quit (Ping timeout: 276 seconds) |
15:16:40 | * | PMunch quit (Quit: Leaving) |
15:17:13 | * | Hideki_ joined #nim |
15:21:42 | disruptek | spacepluk: see if asyncpg works |
15:21:49 | disruptek | !package postgres |
15:21:49 | disbot | https://github.com/cheatfate/asyncpg -- 9asyncpg: 11Asynchronous PostgreSQL driver for Nim Language. 7& 4 more... |
15:22:12 | disruptek | seems to have copy support. |
15:24:24 | lqdev[m] | I figures out what causes the errors to not appear with nim.nvim. it's that `-- INSERT --` overwrites them before I even have a chance to read them |
15:26:02 | disruptek | lqdev[m]: try `:cw` to open the quickfix list. |
15:27:38 | disruptek | lqdev[m]: http://ix.io/23sa |
15:28:39 | lqdev[m] | what's the quickfix list? |
15:29:39 | disruptek | a 2nd buffer associating error messages to locations in the 1st buffer. |
15:31:34 | lqdev[m] | I don't see it populated on `:w`, though |
15:32:18 | * | zyklon joined #nim |
15:38:10 | FromDiscord_ | <Kurolox> regarding string and sequences, what is the best way to slice them from a certain point until the end? |
15:38:54 | FromDiscord_ | <Kurolox> doing something like [2..sequence.len() - 1] looks a bit cluttered, so I was hoping that there would be some shortcut for this |
15:39:31 | disruptek | sequence.high represents the highest index. ^1 represents the last index as well. |
15:40:30 | FromDiscord_ | <Kurolox> ^1 seems to be what I was looking for. Thanks! |
15:43:03 | disruptek | lqdev[m]: i think maybe that functionality is provided by a plugin called `ale`, in my vim config. |
15:45:01 | * | Hideki_ quit (Ping timeout: 268 seconds) |
15:45:23 | * | noonien joined #nim |
15:49:11 | spacepluk | disruptek: oh I missed that one, thanks! |
15:49:31 | FromDiscord_ | <Kurolox> What's the best way to sum two sequences among them? I was hoping for the + operator to work, but it doesn't seem to do so |
15:49:47 | FromGitter | <alehander92> https://github.com/nim-lang/Nim/issues/12804 |
15:49:49 | FromGitter | <alehander92> clyyber |
15:49:49 | disbot | ➥ Crash when trying to use `type.name[0]` in template @11alehander92; snippet at https://play.nim-lang.org/#ix=23sg |
15:50:07 | FromDiscord_ | <Kurolox> as in, @[1, 2] + @[3, 4] = @[4, 6] |
15:50:20 | clyybber | alehander92: Interesting bug |
15:50:24 | FromDiscord_ | <Kurolox> I guess that I can use a mapIt but it seems overly complex |
15:50:43 | disruptek | kurolox: you want a fold. |
15:51:25 | clyybber | alehander92: Works for me :D |
15:51:36 | FromDiscord_ | <Kurolox> Doesn't fold works for the elements in a single sequence? |
15:51:43 | FromDiscord_ | <Kurolox> How do you use it to add multiple sequences with each other? |
15:52:00 | FromDiscord_ | <Kurolox> Apologies if it's a dumb question, I'm getting started with the language |
15:52:05 | clyybber | nevermind I'm dumb |
15:52:15 | disruptek | kurolox: what's the output you want? |
15:52:24 | FromDiscord_ | <Kurolox> @[1, 2] + @[3, 4] = @[4, 6] |
15:52:53 | disruptek | oh. you wanna zip/+ them. |
15:53:07 | disruptek | i think there's a zip macro now. |
15:53:12 | disruptek | else, |
15:53:16 | disruptek | !package loopfusion |
15:53:17 | disbot | https://github.com/numforge/loopfusion -- 9loopfusion: 11Loop efficiently over a variadic number of containers |
15:56:08 | * | snowolf_ is now known as snowolf |
15:58:28 | clyybber | alehander92: It isn't related to templates |
15:58:40 | clyybber | See my comment on github |
16:02:21 | FromDiscord_ | <Kurolox> Zip doesn't seem to be working for me |
16:02:27 | FromDiscord_ | <Kurolox> here's a minimal example and the error I'm getting |
16:02:29 | FromDiscord_ | <Kurolox> https://ghostbin.co/paste/bq5bw |
16:02:38 | FromDiscord_ | <Kurolox> it's exactly like the documentation example, so I'm not sure why it doesn't work |
16:03:24 | disruptek | you have to do something with the result of the expression, or discard it. |
16:03:27 | FromGitter | <alehander92> yep i fixed the title clyybber |
16:04:06 | disruptek | if the documentation doesn't discard the result, then that's a bug in the docs. 😉 |
16:06:25 | FromDiscord_ | <mratsim> @Kurolox, either you use a for-loop, or you use zero-functional or you use loopfusion |
16:06:33 | FromDiscord_ | <mratsim> or you use Arraymancer and tensors |
16:07:14 | FromDiscord_ | <mratsim> depends if you prefer raw Nim, functional programming, imperative for loops or numerical computing |
16:07:30 | FromDiscord_ | <Kurolox> I understood some of those words |
16:07:31 | FromDiscord_ | <mratsim> well actually you could use neo or manu as well for a matrix/vector approach |
16:07:48 | FromDiscord_ | <mratsim> https://github.com/zero-functional/zero-functional |
16:07:50 | FromDiscord_ | <Kurolox> I don't really understand the concept of having to use something or discarding it, though |
16:08:03 | FromDiscord_ | <Kurolox> why does the compiler refuse to execute a floating evaluation? |
16:08:35 | FromDiscord_ | <mratsim> when you compute something that returns a result, Nim errors if you don't use it (because it's probably a bug) |
16:08:49 | FromDiscord_ | <Kurolox> wouldn't a warning make more sense? |
16:09:02 | FromDiscord_ | <mratsim> you need to discard it explicitly |
16:09:30 | FromDiscord_ | <mratsim> it depends, it's very easy to think that you are doing things right and then you realize that you forgot to assign the result |
16:09:37 | disruptek | it's a nice feature. |
16:10:01 | FromDiscord_ | <mratsim> and if it's a routine that is almost never assigned you can add the {.discardable.} pragma anyway |
16:10:07 | FromDiscord_ | <mratsim> and you won't have any error |
16:10:13 | disruptek | but, please don't. |
16:13:53 | FromDiscord_ | <mratsim> Anyway continuing on summing solutions, besides the for loop there is nimfp for a zip + sum approach: https://github.com/vegansk/nimfp, zero functional that I linked and loopfusion https://github.com/numforge/loop-fusion |
16:14:54 | FromDiscord_ | <mratsim> for a numerical computing approach, assuming you work on a lot of sequences of ints: https://github.com/mratsim/Arraymancer, https://github.com/unicredit/neo, https://github.com/b3liever/manu |
16:15:06 | FromDiscord_ | <Kurolox> I think I'm going to try to implement my own solution for this one |
16:15:23 | FromDiscord_ | <Kurolox> it's nice to know that there are so many options and mine is going to be garbage, but this is proving to be a good learning moment |
16:15:34 | FromDiscord_ | <mratsim> That's like a rite of passage, everyone who starts Nim creates his own functional library 😉 |
16:15:52 | FromDiscord_ | <Kurolox> well, not a whole functional library, just getting this sum done by myself |
16:16:41 | FromDiscord_ | <mratsim> have fun |
16:17:02 | spacepluk | is there a plugin for any irc client that makes FromDiscord look normal? |
16:17:14 | spacepluk | it's hard to follow the conversation |
16:17:23 | spacepluk | maybe I'm too old |
16:18:12 | clyybber | pipe your irc through `sed 's/FromDiscord_//g'` :p |
16:18:44 | disruptek | i'm old, too; that's why i wrote the bot. |
16:18:49 | FromDiscord_ | <mratsim> If it gives you solace, the output on discord side is awful as well |
16:18:52 | spacepluk | hehehe |
16:19:20 | spacepluk | mratsim: yeah, I started there and switched to irc |
16:19:24 | FromDiscord_ | <mratsim> everyone's replies are packed together and it's very hard to see when different people are talking |
16:19:43 | shashlick | I initially used weechat to clean things up |
16:20:03 | shashlick | But now just matterbridge which does a good job of cleaning the nicks |
16:20:45 | FromDiscord_ | <mratsim> Maybe a good IRC/Discord/Gitter/Matrix bot would be a killer app for Nim 😉 |
16:20:53 | spacepluk | lol |
16:21:43 | disruptek | the problem is interleaving the output in a normal client. |
16:22:05 | FromGitter | <alehander92> for me in gitter is easiest |
16:22:21 | FromGitter | <alehander92> mostly everyone is <some other service/name> stuff |
16:22:25 | FromDiscord_ | <mratsim> On Status/Nimbus discord it seems to work fine |
16:22:56 | FromDiscord_ | <mratsim> Gitter is nice when you don't need search, but it's broken on Linux :/ |
16:23:58 | FromGitter | <alehander92> i use it on linux |
16:24:05 | FromGitter | <alehander92> but i use the web version |
16:24:06 | * | azed joined #nim |
16:24:21 | FromGitter | <alehander92> i prefer having most stuff in terminal or browser |
16:24:32 | FromGitter | <alehander92> bit ironic me working on a desktop app |
16:25:12 | FromGitter | <mratsim> my browser has 2 many tabs I prefer desktop apps ;) |
16:25:17 | FromGitter | <mratsim> too* |
16:35:38 | leorize | lqdev[m]: all messages emitted can be viewed via :messages |
16:35:53 | leorize | use ALE for that "autobuild" feature you're looking for |
16:36:19 | leorize | the plugin does have a basic :make feature that you should try |
16:37:35 | * | dddddd joined #nim |
17:01:09 | * | azed quit (Quit: WeeChat 2.6) |
17:07:26 | * | azed joined #nim |
17:12:16 | * | spacepluk quit (Quit: leaving) |
17:12:30 | * | spacepluk joined #nim |
17:21:08 | * | tiorock joined #nim |
17:21:08 | * | tiorock quit (Changing host) |
17:21:08 | * | tiorock joined #nim |
17:21:08 | * | rockcavera quit (Killed (wolfe.freenode.net (Nickname regained by services))) |
17:21:08 | * | tiorock is now known as rockcavera |
17:22:38 | * | tiorock joined #nim |
17:22:38 | * | tiorock quit (Changing host) |
17:22:38 | * | tiorock joined #nim |
17:22:38 | * | rockcavera is now known as Guest50916 |
17:22:38 | * | Guest50916 quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
17:22:38 | * | tiorock is now known as rockcavera |
17:24:01 | FromDiscord_ | <Rika> the discord "bot" would need to be a webhook if it were to look nice |
17:25:07 | FromDiscord_ | <Rika> anyway, i'm thinking of making a library for programming for a TI-84+ CE, so is it possible to "augment" the stdlib |
17:31:08 | spacepluk | it looks like asyncpg is broken |
17:31:29 | spacepluk | .nimble/pkgs/asyncpg-0.1.0/asyncpg/apg_array.nim(18, 16) Error: invalid pragma: unchecked |
17:31:46 | FromDiscord_ | <Rika> unchecked pragma was removed afaik |
17:32:51 | * | Trustable joined #nim |
17:32:58 | spacepluk | oh well, time to try nimph |
17:33:10 | spacepluk | in the end I'm going to write this thing in clojure |
17:33:24 | spacepluk | s/write/have to write/ |
17:37:11 | * | nsf quit (Quit: WeeChat 2.6) |
17:41:37 | * | rokups quit (Quit: Connection closed for inactivity) |
17:43:57 | * | azed quit (Read error: Connection reset by peer) |
17:46:08 | FromDiscord_ | <Rika> rip |
17:46:43 | FromDiscord_ | <Rika> afaik for arrays that have unchecked pragma the fix is to remore {.unchecked.} and replace `array` with `uncheckedarray` |
17:46:48 | FromDiscord_ | <Rika> i dont know for sure |
17:48:25 | spacepluk | thanks |
17:58:18 | * | spacepluk quit (Quit: leaving) |
17:58:34 | * | spacepluk joined #nim |
17:59:49 | FromGitter | <Varriount> Gitter is "good enough" in most cases. It's easier than setting up an IRC bouncer |
18:01:57 | Araq | Rika: correct |
18:05:11 | * | leorize quit (Remote host closed the connection) |
18:05:49 | spacepluk | I patched the unchecked arrays but there's more stuff that's broken :( |
18:06:42 | Araq | like? |
18:07:25 | disruptek | `nimph fork asyncpg` 😉 |
18:07:28 | * | leorize joined #nim |
18:08:01 | spacepluk | https://gist.github.com/spacepluk/4e23608f8f172dc0a91eab3f6bea8498 |
18:08:18 | spacepluk | heheh :D |
18:10:13 | disruptek | !repo asyncpg |
18:10:13 | disbot | https://github.com/cheatfate/asyncpg -- 9asyncpg: 11Asynchronous PostgreSQL driver for Nim language 15 44⭐ 6🍴 |
18:12:01 | Araq | this is old code, 'nil' used to be valid for strings/seqs |
18:14:46 | * | nsf joined #nim |
18:16:05 | spacepluk | nevermind, I'll hack this quickly in clojure and I'll find another project to try nim |
18:16:28 | Araq | pity |
18:16:35 | spacepluk | yes :( |
18:16:46 | * | leorize quit (Remote host closed the connection) |
18:17:10 | * | leorize joined #nim |
18:22:02 | spacepluk | there's no way to do postgresql's copy with db_postgres, right? |
18:22:57 | Araq | copy? who knows |
18:23:19 | Araq | db_postgres wraps the low level stuff and the low leve stuff supports everything, including COPY |
18:23:25 | spacepluk | hmm |
18:25:25 | * | Vladar quit (Ping timeout: 250 seconds) |
18:26:15 | FromDiscord_ | <Lantos> lol love the avatar @cheatfate |
18:27:19 | disruptek | Araq: can we backport that --outdir fix, please? |
18:27:27 | disruptek | !pull is:closed author:genotrance |
18:27:28 | disbot | https://github.com/nim-lang/Nim/pull/12796 -- 5Path substitution for --out and --outdir @11genotrance 7& 29 more... |
18:27:37 | Araq | disruptek, later |
18:27:46 | disruptek | 👍 |
18:29:48 | Araq | omg |
18:29:57 | Araq | var a: Thing = Cat() where Thing is a concept does compile... bullshit |
18:30:20 | * | nif quit (Quit: ...) |
18:30:22 | Araq | you cannot use concepts to declare your vars, you cannot do shit with concepts, it's just a generic constraint |
18:30:31 | * | nif_ joined #nim |
18:33:59 | disruptek | i knew it. |
18:34:02 | disruptek | cats are not things. |
18:34:25 | Araq | sure they are not, ask Schrödinger |
18:36:29 | FromDiscord_ | <treeform> disruptek, I found bugs in https://github.com/cheatfate/asyncpg which author did not fix, https://github.com/treeform/pg fixes it and is much simpler. |
18:36:51 | disruptek | sweet. |
18:37:00 | disruptek | spacepluk: ^ |
18:37:12 | spacepluk | reading... |
18:37:22 | FromDiscord_ | <treeform> This one https://github.com/cheatfate/asyncpg/issues/9 |
18:37:28 | FromDiscord_ | <treeform> I closed it after 2 years I guess... |
18:37:50 | disruptek | so impatient. |
18:37:51 | FromDiscord_ | <treeform> Mine is 100 lines, less lines less bugs: https://github.com/treeform/pg/blob/master/src/pg.nim |
18:37:58 | spacepluk | hehe |
18:38:51 | * | Vladar joined #nim |
18:38:56 | FromDiscord_ | <treeform> vs like 1000+ lines in asyncpg |
18:39:13 | * | Vladar quit (Client Quit) |
18:39:18 | spacepluk | I would still need to patch db_postgress to expose the copy thing |
18:39:28 | FromDiscord_ | <treeform> what copy thing? |
18:39:51 | spacepluk | I need to pipe a lot of data into postgres with copy commands |
18:40:20 | FromDiscord_ | <treeform> I pipe like a GB of data into PG every day with this lib, why do you need a copy thing? |
18:40:48 | FromDiscord_ | <treeform> maybe I am doing it wrong |
18:40:52 | spacepluk | a gb is not a lot |
18:41:00 | spacepluk | are you doing separate inserts? |
18:41:42 | FromDiscord_ | <treeform> yes |
18:41:58 | FromDiscord_ | <treeform> I am doing looks like ~1000 rows per inserts |
18:42:10 | spacepluk | yeah, that's very slow if you have a lot of data |
18:42:27 | FromDiscord_ | <treeform> yeah I did not think there was a way around it |
18:42:56 | spacepluk | it's the db equivalent of memcpy |
18:43:11 | spacepluk | if you have indexes or constraints and stuff you have to deal with that yourself |
18:43:18 | spacepluk | but it's as fast as it gets |
18:44:07 | FromDiscord_ | <treeform> I do have indexes but no constraints |
18:44:17 | FromDiscord_ | <treeform> with inserts they just get updated |
18:45:04 | spacepluk | with copy you would have to update them after feeding the data, once |
18:47:51 | FromDiscord_ | <treeform> this command right? https://www.postgresql.org/docs/9.2/sql-copy.html |
18:48:21 | spacepluk | yes |
18:48:23 | FromDiscord_ | <treeform> well https://www.postgresql.org/docs/12/sql-copy.html (modern docs) |
18:49:00 | spacepluk | you know what I'll just use psql with stdin |
18:49:46 | FromDiscord_ | <treeform> and it should be faster than a million 1000 row inserts? |
18:49:49 | FromDiscord_ | <treeform> by how much? |
18:50:52 | spacepluk | it depends, but probably several orders of magnitude |
18:51:15 | spacepluk | you can do a quick test on a separate table it's very impressive |
18:51:16 | FromDiscord_ | <treeform> I think you should be able to write stuff to a file |
18:51:32 | FromDiscord_ | <treeform> then do a `copy from that file` command with regular exec? |
18:51:45 | FromDiscord_ | <treeform> if you are on the same machines as the server |
18:52:11 | * | ntm quit (Quit: Leaving) |
18:53:25 | spacepluk | yeah, for example you can: cat yourfile | psql -c "COPY your_table (field) FROM STDIN;" |
18:53:58 | spacepluk | there are several ways |
18:54:00 | FromDiscord_ | <treeform> I see |
18:54:18 | FromDiscord_ | <treeform> `COPY tbl FROM STDIN;` you need to send it data some other way |
18:54:26 | FromDiscord_ | <treeform> you can't pass it in the query like |
18:54:32 | FromDiscord_ | <treeform> `COPY tbl FROM STDIN "...............";` |
18:54:43 | spacepluk | you can also do it from a query with the path iirc |
18:55:26 | rockcavera | Hello people. I noticed that GCC's builtin bitops.countSetBits implementation is 3.3 times slower than VCC's. So I changed the bitops to when compiling with GCC using the Nim implementation. Result was much better. NIM implementation compiled with GCC was 1.3 times slower than the VCC implementation. I am using GCC 8.1. Has anyone else noticed this? Could the results change from processor to |
18:55:27 | rockcavera | processor? If the Nim implementation is actually faster than the GCC builtin, would it be prudent to propose a change of bitops? |
18:56:18 | FromDiscord_ | <treeform> rockcavera, I love over optimizations, did you run it with -d:release ? |
18:56:35 | rockcavera | treeform, yes, with -d:danger -d:release |
18:56:36 | rockcavera | =) |
18:56:40 | FromDiscord_ | <treeform> 🙂 |
18:56:54 | FromGitter | <dawkot> Is macro overload based on NimNodeKind still supported? I can't find any anything in the manual about it, but I recall someone on the forum showing it |
18:57:30 | FromDiscord_ | <treeform> rockcavera, this function looks wow: https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/bitops.nim#L273 |
18:58:04 | FromDiscord_ | <treeform> rockcavera, you are saying that GCC branch `useGCC_builtins` is slower then the `useVCC_builtins` branch? |
18:58:16 | FromDiscord_ | <treeform> Does gcc support vccc builtins? |
18:58:20 | FromDiscord_ | <treeform> Does gcc support vcc builtins? |
18:58:22 | FromDiscord_ | <mratsim> compile with -popcount |
18:59:00 | rockcavera | treeform: Yes, GCC implementation is slower than VCC, but there is a Nim implementation that is faster than GCC. |
18:59:13 | FromDiscord_ | <mratsim> ah no sorry: -mpopcntb |
18:59:47 | FromDiscord_ | <mratsim> anyway, not all x86_64 CPU supports the POPCNT instructions so GCC is conservative only you pass march=native |
19:00:36 | FromDiscord_ | <mratsim> or is it mpopcnt? so many confusin results |
19:00:47 | FromDiscord_ | <treeform> rockcavera the else countSetBitsNim branch? |
19:00:52 | rockcavera | is mpopcnt |
19:01:06 | rockcavera | wow |
19:02:07 | rockcavera | with -mpopcnt, GCC and VCC run at about the same speed |
19:02:17 | FromDiscord_ | <treeform> solved 🙂 |
19:02:25 | FromDiscord_ | <treeform> should we always -mpopcnt? |
19:02:44 | * | rockcavera quit (Read error: Connection reset by peer) |
19:02:47 | FromDiscord_ | <treeform> should there be a x86_64 CPU version setting? |
19:02:59 | FromDiscord_ | <mratsim> now if you want 3x to 4x faster than builtin popcounts (only works on popcounts on arrays) you can check out this: https://github.com/numforge/laser/issues/41 |
19:03:00 | * | rockcavera joined #nim |
19:03:00 | * | rockcavera quit (Changing host) |
19:03:00 | * | rockcavera joined #nim |
19:03:12 | FromDiscord_ | <treeform> Support everything fast on CPU that are 10 years or younger? |
19:03:21 | rockcavera | with -mpopcnt, GCC and VCC run at about the same speed |
19:03:22 | FromDiscord_ | <mratsim> no popcount is only since 2010/nehalem afaik |
19:03:45 | FromDiscord_ | <treeform> 2010 is about 10 years ago 🙂 |
19:03:55 | FromDiscord_ | <mratsim> but we can introduce a default mode and a legacy mode yes |
19:04:10 | FromDiscord_ | <mratsim> some game makers require AVX now 😄 |
19:04:32 | FromDiscord_ | <treeform> on the server I would like to compile to the CPU i have. |
19:04:55 | FromDiscord_ | <treeform> when shipping games I would like to specify which CPU I want to target |
19:05:49 | FromDiscord_ | <treeform> |
19:05:50 | FromDiscord_ | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/651499351419518986/unknown.png |
19:05:57 | FromDiscord_ | <treeform> from https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam |
19:06:14 | FromDiscord_ | <treeform> hmm only 90% of player have AVX... |
19:06:59 | FromDiscord_ | <mratsim> There are people with AVX512VNNI (Vector Neural instructions) the CPU aren't even out ... |
19:07:27 | FromDiscord_ | <Rika> 0.01% could mean some dude with engineering samples |
19:07:27 | FromDiscord_ | <mratsim> even the SHA CPU aren't out |
19:07:31 | FromDiscord_ | <treeform> Probably the people that implemented the check for them 🙂 |
19:08:10 | FromDiscord_ | <treeform> Is popcount part of some spec or it should be by itself? |
19:08:48 | FromDiscord_ | <mratsim> it's by itself but all CPU that supports AVX supports popcount I think |
19:09:04 | FromDiscord_ | <treeform> not according to this https://gvansickle.github.io/ucg/articles/PortabilityPointers-POPCNT/ |
19:09:08 | FromDiscord_ | <mratsim> similar to FMA (Fused Multiply Add), it's by itself, but all CPU that supports AVX2 supports FMA |
19:10:20 | FromDiscord_ | <treeform> neat |
19:11:04 | FromDiscord_ | <treeform> @mratsim sorry you were right the article does not contradict what you said. |
19:11:37 | FromDiscord_ | <mratsim> I don't mind |
19:11:56 | FromDiscord_ | <mratsim> it's like I try to be a walking encyclopedia of intrinsics :p |
19:12:00 | FromDiscord_ | <mratsim> it's not like* |
19:12:02 | FromDiscord_ | <treeform> AVX was after SSE4.2 so, it makes sense that all AVX CPUs will also have popcount... |
19:12:37 | FromDiscord_ | <mratsim> now let's go back to multithreading and cook up some nasty atomics |
19:13:08 | FromDiscord_ | <treeform> when do we get in the CPU built in GC? |
19:13:29 | FromDiscord_ | <treeform> 90% of the languages use it, just add it do the CPU spec 🙂 |
19:14:01 | FromDiscord_ | <mratsim> proc alloca(size: csize): pointer {.header: "<alloca.h>".} |
19:14:14 | FromDiscord_ | <mratsim> no CPU builtin but portable |
19:14:25 | FromDiscord_ | <mratsim> on Windows: |
19:14:26 | FromDiscord_ | <mratsim> proc alloca(size: csize): pointer {.header: "<malloc.h>".} |
19:14:42 | FromDiscord_ | <mratsim> memory is autoreclaimed 😉 |
19:15:04 | FromDiscord_ | <treeform> when you run out you setjump to the start of your main ... |
19:15:26 | FromDiscord_ | <mratsim> yes, it's a new way of doing exceptions |
19:15:40 | FromDiscord_ | <treeform> thats how chicken scheme GC works |
19:15:49 | FromDiscord_ | <treeform> it stack allocates everything |
19:16:51 | FromDiscord_ | <mratsim> For Flowvars in my multithreading runtime that's what I do as well, they are alloca allocated until the latest possible time if they ever escape their scope/threads |
19:17:54 | FromDiscord_ | <mratsim> The Manticore ML multithreading runtime does the same: http://manticore.cs.uchicago.edu/ (have to find the PhD thesis, I don't have the link handy) |
19:18:52 | FromDiscord_ | <treeform> I wish Nim did threading better. |
19:19:22 | Araq | if only Araq would work 80 hours a week to make threading better. oh wait, he does, cool |
19:19:53 | FromDiscord_ | <Rika> make it 90! |
19:19:55 | FromDiscord_ | <treeform> Araq, thank you! |
19:20:14 | FromDiscord_ | <Rika> ~~i am joking just to be super explicit i dont want to get murdered here~~ |
19:20:31 | FromDiscord_ | <treeform> Araq, how do you stay motivated with such long hours? |
19:20:48 | FromGitter | <Willyboar> Araq you are really doing great job |
19:21:24 | FromDiscord_ | <Rika> all hail Araq |
19:21:32 | FromDiscord_ | <exelotl> too late @Rika I've already dispatched the drone to your house |
19:21:45 | FromDiscord_ | <Rika> > assumed that i have a house |
19:22:06 | FromDiscord_ | <exelotl> touche |
19:29:20 | * | nixfreak44 joined #nim |
19:30:07 | nixfreak44 | Is there a way to search for a function in a nimble library without having to go through every library in order to find it? |
19:31:31 | nixfreak44 | NM I think I can just grep through .nimble |
19:33:25 | disruptek | shashlick: i'm trying to make sense of an installed nimble lib like `regex`, which you're using in nimterop. it has a srcDir but when it's installed, that directory is absent. is there a set of rules i can rely upon to figure out that the package is "installed"? i don't know if i can lock the packages safely otherwise. |
19:37:04 | disruptek | i guess "safety is not guaranteed" works. |
19:40:49 | * | clyybber quit (Ping timeout: 250 seconds) |
19:41:40 | * | Hideki_ joined #nim |
19:43:03 | * | spacepluk quit (Quit: leaving) |
19:43:16 | * | spacepluk joined #nim |
19:43:34 | shashlick | You would need to look at the nimble file |
19:43:44 | shashlick | Cause that's where the srcDir is defined |
19:44:18 | disruptek | i'm already parsing that. but it's still ambiguous, right? |
19:45:11 | shashlick | Not sure, I'd have to look at the code |
19:45:47 | disruptek | i mean, all i have to work with is the url, a version, and some source. i'll just warn for now and people can do what they want with the result. |
19:46:01 | * | Hideki_ quit (Ping timeout: 250 seconds) |
19:48:14 | FromDiscord_ | <mratsim> Well srcDir is one of nimble quirk that I hate, when a package is installed the srcDir goes poof |
19:49:53 | disruptek | tell me what's bad about nimph. |
19:50:22 | FromDiscord_ | <mratsim> @Araq regarding your proposal to replace nim threeadpools by @yglukhov 's, yes sounds good to me. As long as we have a consistent API and we can switch between threadpool backends that will be good |
19:50:38 | FromDiscord_ | <mratsim> The only bad thing about nimph is that I never tried it 😉 |
19:51:52 | disruptek | hmm, i will give you a release. that seems to work. |
19:52:35 | FromDiscord_ | <mratsim> Well right now none of what I'm working on requires a package manager because it's too low level |
19:52:53 | FromDiscord_ | <mratsim> or because we have our own build system and changing it right now would be too disruptive |
19:53:09 | disruptek | disrupt is my maiden name. |
19:58:17 | * | spacepluk quit (Quit: leaving) |
19:58:30 | * | spacepluk joined #nim |
20:15:14 | FromDiscord_ | <onelivesleft> anyone here a git wizard? |
20:20:33 | * | sacredfrog joined #nim |
20:21:47 | * | thomasross joined #nim |
20:24:35 | * | narimiran quit (Quit: leaving) |
20:24:51 | Zevv | try us |
20:28:55 | FromDiscord_ | <Rika> i'm very nervous, updating main server from xenial lts to bionic |
20:29:11 | FromDiscord_ | <Rika> i dont know if i did it right xd |
20:29:53 | * | nsf quit (Quit: WeeChat 2.6) |
20:30:32 | FromDiscord_ | <onelivesleft> hey, thanks, I got it to do what I wanted. But if you want a quiz: I forked a repo, did some work, then made a pull request to update the original repo. Now I want to work on a different problem, but if I commit anything on my master it will update the pr. So, I want to branch my fork... but I want the branch to be at the same point as the original repo, not my master (which is where it starts) |
20:31:07 | FromDiscord_ | <Rika> wait for pull request to be merged |
20:31:12 | FromDiscord_ | <onelivesleft> yeah |
20:31:16 | FromDiscord_ | <onelivesleft> that was plan B 🙂 |
20:31:22 | FromDiscord_ | <Rika> afaik thats the only way to do it properly |
20:31:39 | disruptek | you can branch from anything. |
20:31:40 | FromDiscord_ | <Rika> hey, im no wizard |
20:31:47 | FromDiscord_ | <Rika> at best im prolly some minor apprentice |
20:32:22 | FromDiscord_ | <onelivesleft> so I already did this iteration once earlier, and I cheated by simply pasting the original file over the top of my edits. but this meant that my new PR from the branch had a couple of commits in its history that did nothing, and looked ugly |
20:33:39 | FromDiscord_ | <onelivesleft> the (or a) correct way is: make new branch in github, `git checkout newbranch` -> `git reset --hard <original_head_commit_id>` -> `git push -f origin newbranch` |
20:35:12 | * | spacepluk quit (Quit: leaving) |
20:37:28 | FromDiscord_ | <spacepluk> @onelivesleft iirc you can do: git checkout -b newbranch <commit_sha> |
20:37:52 | FromDiscord_ | <onelivesleft> that looks cleaner |
20:38:06 | disruptek | you can branch from anything. 😉 |
20:41:09 | * | kobi7 joined #nim |
20:41:13 | kobi7 | hello guys |
20:42:29 | kobi7 | I am writing a link checker, it works correctly now, but is single threaded. How do I use async await but limit the number of connections happening simultaneously? (taking urls from a long queue) |
20:45:13 | disruptek | i think there are better ways to do this, but this is what i hacked up for something this: https://github.com/disruptek/rest/blob/master/rest.nim#L317 |
20:46:09 | disruptek | s/something this/something else/ |
20:48:38 | * | clyybber joined #nim |
20:49:51 | * | vesper11 quit (Ping timeout: 246 seconds) |
20:51:18 | kobi7 | Thanks disruptek - though, if I have 1000 items, and threads are 20, won't it "spawn" new ones until it reaches 20 ? |
20:51:56 | * | vesper11 joined #nim |
20:52:14 | FromGitter | <dawkot> Can you save the result of a macro as a const NimNode? |
20:53:18 | kobi7 | I think I can just use normal os threads for that, but the docs suggest 'await' for I/O |
20:53:57 | * | thomasross quit (Ping timeout: 265 seconds) |
20:54:15 | disruptek | kobi7: the idea is you want to process the results and you can manipulate the queue at the same time. |
20:54:29 | disruptek | ie. the waitfor stalls when the queue is too full. |
20:55:33 | kobi7 | ah, I see. I misunderstood futures for items |
20:55:47 | * | thomasross joined #nim |
20:55:57 | kobi7 | futures are the currently executing jobs? (the already sent requests) |
20:56:48 | disruptek | yeah. the iterator just ends if nothing is ready, so you use it in another loop or something. |
20:57:14 | Araq | mratsim: the problem is we got the threadpool API wrong |
20:57:31 | Araq | so it's not that easy to replace it by something else |
20:57:43 | * | tane quit (Quit: Leaving) |
20:59:14 | kobi7 | that's great, knowing the futures count is a way to limit the requests. I will study it a little more to see where that happens |
21:02:49 | kobi7 | oh, u just add one when you run its request. No global way, then. |
21:03:55 | kobi7 | I somehow imagined the system knows how many requests have been sent and didn't come back yet :-) |
21:04:01 | kobi7 | u just track it, so simple |
21:05:14 | kobi7 | disruptek, what's with all the fibonacci stuff? :-) |
21:05:41 | * | kungtotte quit (Ping timeout: 268 seconds) |
21:09:04 | disruptek | i think fib my was my first nim proc. i just use it for backoff. |
21:09:43 | * | xet7 quit (Quit: Leaving) |
21:14:59 | clyybber | Araq: I'm curious why are embedded objects bad for performance? |
21:15:10 | kobi7 | I heard "rumours" of a z3 solver? |
21:15:31 | disruptek | z3 is a thing, sure. |
21:17:25 | Araq | clyybber, are they? |
21:17:47 | Araq | --gc:arc doesn't support it because I got bored |
21:17:51 | clyybber | Araq: I don't know, this comment says they are: https://github.com/nim-lang/Nim/blob/7e747d11c66405f08cc7c69e5afc18348663275e/compiler/cgen.nim#L354 |
21:18:28 | Araq | ah because objectInit is the old RTTI crap |
21:18:41 | Araq | luckily the new runtime doesn't use it anymore |
21:18:55 | clyybber | Ah ok |
21:19:11 | clyybber | How can we make them work in new runtime? |
21:19:17 | clyybber | Its a real blocker for some things |
21:19:21 | Araq | sure be my guest |
21:19:57 | Araq | blocker? I have little code that uses it, but ok |
21:19:57 | clyybber | *How*? |
21:20:16 | clyybber | Araq: Well, it means we can't use more than two objects in an object doesn't it? |
21:20:35 | Araq | only if the objects used inheritance |
21:20:47 | Araq | anyway, the case for 'frHeader' needs to be generalized |
21:20:54 | Araq | that's your *how* |
21:21:40 | clyybber | Ok, I wasn't aware its only a restriction for objects with inheritance.. |
21:21:51 | clyybber | Thats why I was so stumped |
21:21:57 | clyybber | :D |
21:22:07 | Araq | for every object x inside y you need to set y.x.m_type |
21:23:47 | * | xet7 joined #nim |
21:24:11 | clyybber | Araq: So in the new runtime inheritance is basically case objects? |
21:24:21 | clyybber | With a discriminator m_type? |
21:24:53 | Araq | nah |
21:24:55 | FromGitter | <alehander92> does |
21:25:00 | Araq | nothing changed |
21:25:17 | FromGitter | <alehander92> methods run correct in javascript backend? i feel they do, but wanted to ask for sure |
21:25:17 | Araq | except that we don't have objectInit anymore, so we need to inline what it does |
21:25:40 | Araq | alehander42: quite sure they do |
21:25:47 | clyybber | Ah ok. |
21:25:56 | FromGitter | <alehander92> Araq good |
21:26:49 | Araq | clyybber, if you want a new challenge |
21:27:15 | Araq | figure out why tests\stdlib\tmath fails in my araq-better-codegendecl branch |
21:27:24 | clyybber | I was wondering anyhow |
21:27:37 | Araq | for some reason this snippet here |
21:27:39 | Araq | let p = float(c) / float(cdf[^1]) |
21:27:41 | Araq | let n = 5000.0 |
21:27:43 | Araq | let expected = p * n |
21:27:45 | Araq | let stdDev = sqrt(n * p * (1.0 - p)) |
21:27:59 | Araq | produces 0.0 for 'expected' even though p is 0.4 |
21:28:14 | clyybber | that is... interesting |
21:28:14 | Araq | can't reproduce outside the suite/test env |
21:28:22 | clyybber | huh |
21:28:32 | Araq | probably some phase ordering shit going on with .global |
21:28:43 | Araq | time to sleep, good night |
21:28:47 | clyybber | gn8 |
21:30:01 | FromGitter | <alehander92> seee ya |
21:31:29 | kobi7 | me too, good night all |
21:31:33 | * | kobi7 quit (Quit: Leaving) |
21:32:20 | * | Trustable quit (Remote host closed the connection) |
21:35:50 | FromDiscord_ | <Kaynato> I suppose tables withValue is supposed to return pointers for good use of fields with object/tuple types, but is returning pointers to primitive types (behavior with inexact documentation) intended? |
21:58:15 | dom96 | narimiran: regarding https://irclogs.nim-lang.org/03-12-2019.html#10:53:21. I never said we shouldn't do what you suggest, we need to see how common this is and figure out the best way to solve it. |
22:04:47 | dom96 | Argh, remaining motivated to do Advent of Code every day is seriously tough |
22:07:19 | FromDiscord_ | <exelotl> lol right now AoC is procrastination for me every evening |
22:07:53 | FromDiscord_ | <exelotl> I could be coding something useful but instead I'll do a small brainteaser then go play pokemon |
22:09:00 | clyybber | exelotl: Did you test the PR? |
22:09:32 | FromDiscord_ | <exelotl> not yet! that was one of the useful things I could have been doing xD |
22:09:55 | FromDiscord_ | <exelotl> I'll give it a try now tho |
22:16:59 | FromDiscord_ | <mratsim> @Araq, I don't see anything fundamentally wrong in the threadpool API |
22:17:51 | FromDiscord_ | <mratsim> it's the implementation that has issues |
22:18:37 | FromDiscord_ | <mratsim> this is what I expose: |
22:18:37 | FromDiscord_ | <mratsim> https://github.com/mratsim/weave/blob/master/weave.nim#L13-L17 |
22:18:38 | FromDiscord_ | <mratsim> |
22:18:38 | FromDiscord_ | <mratsim> and usage |
22:18:38 | FromDiscord_ | <mratsim> https://github.com/mratsim/weave/blob/master/benchmarks/dfs/weave_dfs.nim#L16-L27 |
22:18:49 | FromDiscord_ | <mratsim> (it's DFS this time, not fibonacci ;)) |
22:21:45 | Araq | I tried to fix blockUntilAny and considered it impossible :P |
22:22:25 | FromDiscord_ | <mratsim> it's not needed 😉 |
22:22:41 | FromDiscord_ | <mratsim> well for the basic usage |
22:33:05 | disruptek | shashlick: nimterop cannot find itself when it's not built in .nimbledir, so installs fine but cannot build wrapped libs. |
22:38:50 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:39:23 | disruptek | can we make it build inside the directory of the wrapper? then nim could pick up the env in the usual fashion. |
22:39:53 | disruptek | oh, we can't get current directory at compile-time, right? |
22:41:20 | * | nixfreak44 quit (Remote host closed the connection) |
22:53:14 | * | rockcavera quit (Read error: Connection reset by peer) |
22:53:56 | * | rockcavera joined #nim |
22:53:57 | * | rockcavera quit (Changing host) |
22:53:57 | * | rockcavera joined #nim |
23:12:06 | clyybber | gn8 yall |
23:12:09 | * | clyybber quit (Quit: WeeChat 2.6) |
23:14:42 | * | ltriant joined #nim |
23:32:17 | shashlick | @disruptek can you please explain the issue - do you mean the toast binary |
23:32:53 | disruptek | so, because it builds the lib in .cache, it's not picking up any of the nim.cfg that it needs to in order for nim to have the right search paths. |
23:33:08 | disruptek | does that make sense? |
23:33:26 | disruptek | the compiler cannot import nimterop/plugin or such. |
23:34:24 | disruptek | i had issues like this before but because i had nimterop in .nimbledir, it was never a problem. now that my nimbledir is empty, i cannot build new libgit2 libs. 😁 |
23:34:49 | shashlick | Ok please walk me thru steps to repro |
23:34:57 | disruptek | i know every couple days i report the same confusing issue, but damnit, it's frustrating! 🤣 |
23:35:05 | shashlick | How are you setting nimble dir |
23:35:15 | shashlick | How are you installing nimterop |
23:35:17 | * | rockcavera quit (Remote host closed the connection) |
23:35:37 | disruptek | it doesn't matter how you set it, because nimterop always builds the library outside of whatever tree you're in. |
23:35:55 | disruptek | so it will never pick up the paths from nim.cfg. |
23:36:13 | shashlick | Only the C code is outside right |
23:36:21 | shashlick | Not the nim wrapper itself |
23:36:39 | disruptek | no, i mean the wrapper itself. toast builds just fine with the proper nimble_dir set, etc. |
23:37:11 | disruptek | we just gotta move it into $nimbledir/lib or something. |
23:37:20 | shashlick | When you nimble install the wrapper, the nim file will be in nimble dir |
23:38:01 | disruptek | okay, say i've installed nimterop and nimgit2 locally. local deps. |
23:38:09 | disruptek | and i build toast and everything. it's all fine. |
23:38:17 | shashlick | Cool |
23:38:21 | disruptek | but now i go to build nimph, and getHeader runs and whatnot. |
23:38:39 | disruptek | (i had to upgrade to libgit2-#head) |
23:38:47 | disruptek | so it wants to build a new .so |
23:39:06 | disruptek | and it runs nim inside ~/.cache which is not anywhere near my repo. |
23:39:13 | disruptek | so nim misses my environment. |
23:43:06 | * | Hideki_ joined #nim |
23:43:32 | * | rockcavera joined #nim |
23:44:41 | * | kungtotte joined #nim |
23:46:03 | disruptek | i guess i can work around this by running `nimph c ...` but it's kinda contrary to the point of nimph. |
23:47:57 | * | Hideki_ quit (Ping timeout: 265 seconds) |
23:55:41 | shashlick | Ya we have an issue open for the so to be built in the data directory |
23:56:53 | shashlick | Nimterop builds binaries in the same spot, it isn't building in the nimble dir |
23:58:05 | disruptek | yeah. |