00:04:42 | * | rb quit (Ping timeout: 250 seconds) |
00:12:12 | * | rwb joined #nim |
00:16:48 | FromDiscord | <abdu> How to declare/define/initialize sequence of array↵i.e. flexible size array of a fixed sizxe array type ? |
00:17:19 | FromDiscord | <Elegantbeef> `let mySeq = newSeq[array[size, T]](seqSize)` |
00:26:17 | FromDiscord | <Bloss> has anyone tried making exceptions work with --gc:orc in DLLs? i can't even catch them |
00:26:55 | FromDiscord | <Elegantbeef> You'd need to catch exceptions inside the dll |
00:27:02 | FromDiscord | <Bloss> yeah that's what I'm trying to do |
00:27:10 | FromDiscord | <Bloss> it just exits |
00:27:47 | FromDiscord | <Elegantbeef> You are trying to catch exceptions the dll is raising right? |
00:28:19 | FromDiscord | <Bloss> no |
00:28:46 | FromDiscord | <abdu> In reply to @Elegantbeef "`let mySeq = newSeq[array[size,": newSeq is in module what ? |
00:28:49 | FromDiscord | <Bloss> I am using try/except inside the DLL, but the except block is never reached, when an exception is raised it just quits entirely |
00:28:52 | FromDiscord | <Elegantbeef> I dont think you can catch exceptions across the DLL boundry |
00:29:07 | FromDiscord | <Elegantbeef> `newSeq` is a procedure |
00:29:17 | FromDiscord | <Bloss> In reply to @abdu "newSeq is in module": system, it is imported by default |
00:32:45 | FromDiscord | <Bloss> ok it actually works, i messed up something really simple |
01:47:22 | FromDiscord | <hector> In reply to @krisppurg "Well, is it located": Step 1: Stop using Windows |
02:05:54 | FromDiscord | <Rika> We don’t know how you installed the compiler |
02:06:20 | FromDiscord | <Rika> Uninstall it with information given from the way you installed it |
02:06:33 | * | neurocyte0917090 quit (Ping timeout: 252 seconds) |
02:22:26 | NimEventer | New question by pooooky: Compiler throws 'no return type declared' even though the function returns, see https://stackoverflow.com/questions/71120422/compiler-throws-no-return-type-declared-even-though-the-function-returns |
02:28:46 | FromDiscord | <abdu> sent a code paste, see https://play.nim-lang.org/#ix=3PDO |
02:29:10 | FromDiscord | <abdu> (edit) "https://play.nim-lang.org/#ix=3PDO" => "https://paste.rs/0dk" |
02:29:25 | FromDiscord | <Elegantbeef> What are you trying to do, that's not valid Nim code in any regard |
02:30:27 | FromDiscord | <abdu> (edit) "https://play.nim-lang.org/#ix=3PDQ" => "https://play.nim-lang.org/#ix=3PDP" |
02:31:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PDR |
02:39:26 | * | krux02 quit (Remote host closed the connection) |
02:40:25 | FromDiscord | <Arathanis> what are the rules for infix procs |
02:40:26 | FromDiscord | <Arathanis> (edit) "procs" => "procs?" |
02:40:44 | FromDiscord | <Arathanis> im trying to experiment it out but its very hard to determine what kind of proc name can be used as an infix, symbolic only? |
02:44:01 | FromDiscord | <ynfle> In reply to @Arathanis "im trying to experiment": Symbolic and div and mod. |
02:44:12 | FromDiscord | <ynfle> It talks about it in the manual |
02:50:25 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-operators |
02:53:28 | FromDiscord | <Arathanis> ok, so anything made entirely of the symbols on the Operator characters plus "div" and "mod" explicitly |
02:53:37 | FromDiscord | <Arathanis> (edit) "on" => "in" |
02:54:52 | FromDiscord | <Elegantbeef> well `mod` `div` `as` `of` |
02:54:53 | FromDiscord | <Arathanis> well theres more I guess but I think I get it. I can override the explicit ascii infixes for my own types, or I can define wholly new ones as long as they are composed entirely of operator characters |
02:55:03 | FromDiscord | <Arathanis> `in` `notin` `shl` `shr` are in there too |
02:55:15 | FromDiscord | <Elegantbeef> `and or not xor shl shr div mod in notin is isnot of as` |
02:55:20 | FromDiscord | <Elegantbeef> full list |
02:56:18 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3PDW |
02:56:25 | FromDiscord | <Elegantbeef> you need backticks |
02:56:40 | FromDiscord | <Elegantbeef> All operators require backticks to strop their usage |
02:56:43 | FromDiscord | <Arathanis> right cause they are lexicographically special it wont even compile without the backticks |
02:56:56 | FromDiscord | <Arathanis> it will think im trying to say `proc in (e: ElemType...)` |
02:56:57 | FromDiscord | <Elegantbeef> Yep |
02:57:06 | FromDiscord | <Elegantbeef> dont use `in` |
02:57:09 | FromDiscord | <Elegantbeef> make a `contains` proc |
02:57:11 | FromDiscord | <Arathanis> use contains |
02:57:16 | FromDiscord | <Arathanis> and let the in template do its magic |
02:57:20 | FromDiscord | <Elegantbeef> Yep |
02:57:41 | FromDiscord | <Elegantbeef> Many operators are inferred thanks to template magic |
02:57:56 | FromDiscord | <Arathanis> yeah, |
02:58:08 | FromDiscord | <Arathanis> i always forget which comparison operator you need to define, is it `>=`? |
02:58:19 | FromDiscord | <Elegantbeef> think it's `<` |
02:59:13 | FromDiscord | <Elegantbeef> This just reminds me how lovely a small core language really is 😀 |
02:59:50 | * | arkurious quit (Quit: Leaving) |
02:59:53 | FromDiscord | <Elegantbeef> So many things can be done in user space and dont require special support |
03:00:02 | FromDiscord | <Arathanis> you are right https://media.discordapp.net/attachments/371759389889003532/942978530638180392/unknown.png |
03:00:18 | FromDiscord | <Arathanis> it doesnt mention <= |
03:00:26 | FromDiscord | <Arathanis> surely that is an accidently omission |
03:00:51 | FromDiscord | <ynfle> Probably |
03:01:22 | FromDiscord | <Elegantbeef> PR time for arathanis 😛 |
03:02:38 | FromDiscord | <Valdar> Is a seq guaranteed to be contiguous? |
03:02:52 | FromDiscord | <Elegantbeef> Yes |
03:03:16 | FromDiscord | <Valdar> how does it handle .add? |
03:03:16 | FromDiscord | <Elegantbeef> @abdu\: thanks to your forum post i can say the answer is `thisStr = str[^3..^1]` |
03:03:18 | FromDiscord | <Arathanis> turns out you have to define `<=` as well |
03:03:32 | FromDiscord | <Arathanis> so its not omitted by accident |
03:03:52 | FromDiscord | <Elegantbeef> if adding a value goes over the capacity it'll allocated and move the sequence to more memory |
03:04:11 | FromDiscord | <Elegantbeef> The seq is basically `(len, cap, ptrToData)` |
03:04:20 | FromDiscord | <Elegantbeef> if len goes over `cap` it has to realloc |
03:04:21 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3PE0 |
03:05:08 | FromDiscord | <Valdar> Thx Beef. I thought that must be it, but i couldn't find a definitive answer in the docs |
03:05:30 | FromDiscord | <Elegantbeef> Yea someone needs to document strings explicitly |
03:06:28 | FromDiscord | <ynfle> In reply to @Elegantbeef "Yea someone needs to": @Valdar was talking about seq |
03:06:36 | FromDiscord | <Elegantbeef> Strings and seqs |
03:06:37 | FromDiscord | <Elegantbeef> Same shit |
03:06:54 | FromDiscord | <ynfle> Implementation detail |
03:06:54 | FromDiscord | <Elegantbeef> Not documented on their internal data or how they work |
03:07:08 | FromDiscord | <Arathanis> sounds like they are implemented in a similar fashion to python collections |
03:07:22 | FromDiscord | <Arathanis> as far as len vs cap goes |
03:07:24 | FromDiscord | <Elegantbeef> That's how you implement dynamic sized collections |
03:07:41 | FromDiscord | <Arathanis> yeah it works out for the best that way |
03:07:44 | FromDiscord | <Elegantbeef> There arent really many good alternatives for memory/performance |
03:07:51 | FromDiscord | <Valdar> and both strings and seqs are heap, right? |
03:07:53 | FromDiscord | <Elegantbeef> Linked lists are god awful 😀 |
03:07:55 | FromDiscord | <Arathanis> you are trying to find the sweet spot between the two |
03:07:56 | FromDiscord | <Elegantbeef> Yes |
03:08:09 | FromDiscord | <Arathanis> linked lists are pretty bad until nothing else will do |
03:08:14 | FromDiscord | <Arathanis> but until then |
03:08:15 | FromDiscord | <Arathanis> they suck lol |
03:08:21 | FromDiscord | <Elegantbeef> Anything dynamic tends to be heap allocated |
03:08:39 | FromDiscord | <Valdar> 👍 |
03:08:47 | FromDiscord | <Elegantbeef> Just a nature of how dynamic stuff works |
03:08:48 | FromDiscord | <Elegantbeef> \Also why `newSeq` and `newString` are used 😀 |
03:09:13 | FromDiscord | <Elegantbeef> `new` denotes heap allocation, though it seems the convention is only if the base type allocates |
03:09:23 | FromDiscord | <Elegantbeef> Look at tables/hashsets for `init` being used |
03:09:38 | FromDiscord | <Elegantbeef> Whatcha doing valdar? 😀 |
03:09:57 | FromDiscord | <Valdar> how about newSeqOfCap? still heap? |
03:11:03 | FromDiscord | <Valdar> Working on a game/engine. Just trying to decide on structuring nodes atm |
03:11:04 | FromDiscord | <Elegantbeef> Yep |
03:11:15 | FromDiscord | <Elegantbeef> The only difference is that's a given size allocation |
03:11:24 | FromDiscord | <Elegantbeef> If you want static heap stuff use `array[Size, T]` |
03:11:47 | FromDiscord | <Elegantbeef> You can wrap an array rather quickly for a "growable" collection |
03:11:55 | FromDiscord | <Elegantbeef> I thought you were valdar which is why i asked |
03:12:08 | FromDiscord | <Valdar> haha, what gave it away? |
03:12:22 | FromDiscord | <Elegantbeef> Eh just guessed based off you |
03:12:31 | FromDiscord | <Arathanis> `newSeq` and `newString` are there for when you know, or have an idea, of the size but you are going to need but are going to add the data piecemeal right? So you aren't slamming your performance with reallocation/copy |
03:12:58 | FromDiscord | <Elegantbeef> What a minute valdar isnt vladar 😀 |
03:13:01 | FromDiscord | <Valdar> you might have me confused with vladar? |
03:13:05 | FromDiscord | <Valdar> yep |
03:13:07 | FromDiscord | <Elegantbeef> Yea |
03:13:27 | FromDiscord | <Elegantbeef> Thought it was odd you were asking about memory stuff |
03:13:43 | FromDiscord | <Valdar> I'm too quiet for anyone to be that perceptive 🙂 |
03:14:23 | FromDiscord | <Elegantbeef> Yes arath that's the purpose |
03:14:37 | FromDiscord | <Elegantbeef> You have a size you think your data will fit in and want to assume that it does |
03:14:57 | FromDiscord | <Elegantbeef> This way you dont over allocate unless you really need to in the small cases |
03:15:07 | FromDiscord | <Arathanis> or under alloc |
03:15:14 | FromDiscord | <Elegantbeef> The issue with heap isnt where it is but when you need to grow it it's slow |
03:15:52 | FromDiscord | <Arathanis> so does newSeq allocate a large amount but set the len to 0? |
03:15:57 | FromDiscord | <Arathanis> so you just fill in the hugely allocated space? |
03:16:07 | FromDiscord | <Elegantbeef> it allocates 64 elements |
03:16:10 | FromDiscord | <Arathanis> i guess it initializes to the types default value too |
03:16:20 | FromDiscord | <Elegantbeef> well 64 elements by default |
03:16:58 | FromDiscord | <Elegantbeef> there is `newSeqUnintialized` if you want to alloc without 0ing |
03:17:06 | FromDiscord | <Valdar> so what would be the benefit of using cap? |
03:18:31 | FromDiscord | <Elegantbeef> If the size matches perfectly you use the least amount of memory |
03:19:14 | FromDiscord | <Elegantbeef> If the size is larger than what you need you never allocate again |
03:19:45 | FromDiscord | <Elegantbeef> Like i said the issue with dynamic memory is always growing it, it's a slow process, you have to as the OS for more memory, copy your memory over and then add an entry |
03:19:47 | FromDiscord | <Elegantbeef> It's slooooooow |
03:20:06 | FromDiscord | <Elegantbeef> Static is almost always better if you can do it |
03:21:06 | FromDiscord | <Valdar> yeah, slow is what i'm trying to avoid. |
03:21:54 | FromDiscord | <Valdar> ok, that makes sense, if it's larger than I would need... |
03:22:20 | FromDiscord | <Valdar> nut I can Never overfill, right. it'll seqfault? |
03:22:28 | FromDiscord | <Valdar> but |
03:22:36 | FromDiscord | <Elegantbeef> Overfill what? |
03:22:40 | FromDiscord | <Valdar> the cap |
03:23:02 | FromDiscord | <Elegantbeef> Well if you give a cap larger than your system has memory it'll give you an out of memory message and crash |
03:23:36 | FromDiscord | <Valdar> no, i mean if I cap at 100 and try to add 101 |
03:23:49 | FromDiscord | <Valdar> for example |
03:23:59 | FromDiscord | <Elegantbeef> It'll grow the sequence and add the extra one |
03:24:03 | FromDiscord | <Elegantbeef> capacity doesnt make it static |
03:24:19 | FromDiscord | <Elegantbeef> It just says "allocate precisely this much since i think i need it" |
03:24:24 | FromDiscord | <Elegantbeef> it's still just a seq |
03:24:57 | FromDiscord | <Valdar> oh, I must have read the docs wrong then |
03:25:16 | FromDiscord | <Elegantbeef> Arrays are static sizes and ungrowable |
03:25:30 | FromDiscord | <Elegantbeef> Sequences are always growable, but allocate a fixed size and have a fixed growth rate without your intervention |
03:26:38 | FromDiscord | <Elegantbeef> like `var a = newSeq[int]()` is going to allocated enough memory for 64 integers |
03:26:44 | FromDiscord | <Elegantbeef> allocate\ |
03:27:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PE4 |
03:27:31 | FromDiscord | <Elegantbeef> No error since it'll grow on the 65th element to be large enough for 128 element if i recall correctly |
03:27:54 | FromDiscord | <Arathanis> sequence can grow until the computer runs out of memory. The point of `newSeq` and `newSeqOfCap` is for when you don't know exactly how much space you need but you have an idea, you can allocate that space and then do what you need with it (copy into it, start processing, etc) without tanking your performance if the seq needs to grow in size which kicks of a realloc -> copy |
03:28:03 | FromDiscord | <Elegantbeef> Yep |
03:28:23 | FromDiscord | <Elegantbeef> `var data = newSeqOfCap[int](65)` means the above wouldnt allocate more than once, in the first example there are two allocations |
03:30:57 | FromDiscord | <Elegantbeef> As is typical "Beef says stuff that confuses more than it helps" 😛 |
03:31:02 | FromDiscord | <huantian> is there a way I can get strscans to match any one of multiple strings? |
03:31:25 | FromDiscord | <Elegantbeef> use a custom matcherr |
03:32:12 | FromDiscord | <huantian> k |
03:32:34 | FromDiscord | <Elegantbeef> You could also match the pattern then check the string after |
03:33:32 | FromDiscord | <Valdar> I KNOW I read somewhere that adding past a cap would cause an error, but it's not in the official docs, so it must have been someone's blog or something. I just tried it and you're right. Works with no error. Thx for clearing that up |
03:34:03 | FromDiscord | <Rika> Are you sure you weren’t reading about an array |
03:34:05 | FromDiscord | <Arathanis> In reply to @Valdar "I KNOW I read": they were probably talking about arrays |
03:34:09 | FromDiscord | <Elegantbeef> Perhaps you're thinking of indexing arrays |
03:34:10 | FromDiscord | <Valdar> I'm sure |
03:34:20 | FromDiscord | <Elegantbeef> `default(array[3, int])[4]` |
03:34:29 | FromDiscord | <Valdar> No, it was def seqofcap |
03:34:44 | FromDiscord | <Elegantbeef> Well you were lied to |
03:34:53 | FromDiscord | <Valdar> I Was |
03:35:18 | FromDiscord | <Valdar> I'll see if I can find it |
03:36:32 | FromDiscord | <huantian> does std have something that can split a string into chunks of 3, or perhaps slicerator |
03:36:45 | FromDiscord | <Elegantbeef> chunks of 3 what? |
03:36:58 | FromDiscord | <huantian> sorry chunks of 3 chars |
03:37:13 | FromDiscord | <huantian> eg "abcdef" -> ["abc", "def"] |
03:37:20 | FromDiscord | <Rika> Doesn’t (3rd party) itertools have that |
03:37:43 | FromDiscord | <Elegantbeef> You'd need to write an iterator but sliecerator does have the `group` macro |
03:38:44 | FromDiscord | <Elegantbeef> Itertools is probably the go to then |
03:42:47 | FromDiscord | <huantian> 👍 |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
05:12:10 | FromDiscord | <evoalg> Rika is right, the itertools lib has "chunked"↵(@huantian) |
05:14:39 | FromDiscord | <evoalg> I have no idea if `for x in numbers.chunked(3)` does unnecessary copies ... if it does then "group" from slicerator would be more efficient |
05:15:00 | FromDiscord | <Rika> Optimise only when you need to... |
05:16:11 | FromDiscord | <Arathanis> Yes, listen to Donald Knuth |
05:16:13 | FromDiscord | <Arathanis> (edit) "Knuth" => "Knuth." |
05:16:28 | * | wyrd quit (Remote host closed the connection) |
05:16:46 | * | wyrd joined #nim |
05:17:46 | FromDiscord | <evoalg> it leaves a bad taste in my mouth if it does unnecessary copies ... even python does it right ... so it's reasonable to assume it's doing it efficiently. When I find it's not, it doesn't feel right |
05:18:05 | FromDiscord | <huantian> I mean it shouldn’t be too hard to check |
05:19:22 | FromDiscord | <huantian> It seems to just be yielding slices in a while loop, that shouldn’t make copies right? |
05:19:33 | FromDiscord | <Rika> Whichever you think is best. I will not care if it copies or not until it severely affects my runtime |
05:19:45 | FromDiscord | <Elegantbeef> That's the way to live |
05:20:06 | FromDiscord | <Rika> If I want speed then sure but usually I don't care |
05:20:34 | FromDiscord | <evoalg> I thought the whole point of slicerator lib being made was because slices does make copies instead of iterating?↵(@huantian) |
05:20:37 | FromDiscord | <Arathanis> What is the best way to initialize all the the elements of a seq? |
05:20:50 | FromDiscord | <Arathanis> Specifically a sequence of arrays |
05:20:56 | FromDiscord | <Elegantbeef> `newSeqWith` from sequtils |
05:21:22 | FromDiscord | <Elegantbeef> I mean it's one part of slicerator is the non allocating slices |
05:22:17 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3PEh |
05:22:26 | FromDiscord | <Arathanis> i think newSeqWith is the way im going to do it, but I am wondering if there is a way to do the above |
05:22:30 | FromDiscord | <Rika> mitems |
05:22:53 | FromDiscord | <Arathanis> lmao i knew about mitems woops |
05:26:32 | FromDiscord | <Arathanis> im surprised that newSeq takes len as Natural but newSeqWith uses int |
05:33:09 | termer | Is the discord<->irc bridge broken? |
05:33:16 | termer | can anyone see this message |
05:33:22 | FromDiscord | <Elegantbeef> Yes |
05:33:25 | termer | Sweet |
05:33:31 | termer | does anyone have any experience with asyncnet |
05:33:44 | FromDiscord | <Elegantbeef> So that means Matrix -\> Discord -\> IRC is working 😛 |
05:34:02 | FromDiscord | <Elegantbeef> What's the actual question? |
05:34:07 | termer | I'm trying to figure out the difference between a natural disconnect and a close(AsyncSocket) call |
05:34:17 | termer | Because a natural close causes recv calls to return |
05:34:22 | termer | and close() causes them to hang forever |
05:34:42 | termer | this is making my application hang |
05:36:36 | FromDiscord | <Elegantbeef> Wonder if it's the `SafeDisconn` |
05:36:43 | termer | not quite sure |
05:36:54 | termer | how would I tell it not to use that |
05:37:06 | FromDiscord | <Elegantbeef> `flags = {}` |
05:38:13 | termer | One odd effect this is having is also seemingly making accept(AsyncSocket) hang as well |
05:38:16 | termer | it's very very odd |
05:38:27 | termer | Nope, same effect with no flags |
05:38:56 | termer | There's something messed up with close() I think because the documentation doesn't even line up with the proc definition |
05:39:06 | termer | It doesn't return a Future anymore |
05:40:37 | termer | Right now, a call to close(AsyncSocket) will just make everything hang |
05:41:02 | termer | including unrelated calls like accept(AsyncSocket) on the server accept loop |
05:41:41 | termer | Actually, I'm going to do some more testing |
05:42:04 | FromDiscord | <Elegantbeef> Well the best thing to do imo is make a minimal reproduction |
05:42:06 | termer | Yup that's what's happening |
05:42:09 | termer | All right |
05:59:39 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3PEk |
06:05:44 | FromDiscord | <Arathanis> sent a code paste, see https://paste.rs/Eus |
06:06:29 | FromDiscord | <Arathanis> (edit) "https://paste.rs/1wF" => "https://play.nim-lang.org/#ix=3PEo" |
06:07:13 | FromDiscord | <Arathanis> (edit) "https://play.nim-lang.org/#ix=3PEo" => "https://play.nim-lang.org/#ix=3PEp" |
06:08:08 | FromDiscord | <Arathanis> or maybe it does, sometimes it... doesn't |
06:08:08 | FromDiscord | <Arathanis> hmm |
06:11:25 | termer | ElegantBeef https://play.nim-lang.org/#ix=3PEs |
06:11:36 | termer | Here is a minimal example of my issue |
06:11:57 | termer | There are two ways I close the socket here, and they both have different side effects |
06:12:26 | termer | The first is an async timers implementation I wrote, which is what I'm using in my real world code |
06:12:57 | termer | The second is an async proc that closes it, and running that with asyncCheck |
06:14:38 | termer | Using the timer, all asyncnet procs that are being `await`ed will hang, including unrelated ones such as accept(AsyncSocket) for the server |
06:14:55 | termer | Using the proc, the entire program will crash due to an OSError with the message "Bad file descriptor" |
06:15:10 | termer | The stack trace only leads to the accept() call, which is confusing |
06:15:26 | termer | Not the accept call, sorry |
06:15:39 | termer | The accept loop proc call |
06:46:51 | * | rockcavera quit (Remote host closed the connection) |
07:02:27 | termer | https://forum.nim-lang.org/t/8918 |
07:02:42 | termer | Here's a thread I made on my issue with more information and attempts |
07:02:45 | FromDiscord | <Rika> Moderated |
07:02:53 | FromDiscord | <Rika> Prolly need to wait a bit |
07:32:43 | FromDiscord | <pietroppeter> Since the mermaids are cool in GitHub and HN I thought nim(ib) should have a say: https://pietroppeter.github.io/nblog/drafts/mermaid_diagram.html |
07:43:07 | FromDiscord | <kevin> Is there a Nim alphabetical sort somewhere? |
07:43:30 | FromDiscord | <kevin> sorry, numerical sort |
07:44:06 | FromDiscord | <kevin> so instead of `4, 400, 5, 512` it should be `4, 5, 400, 512` |
07:44:12 | FromDiscord | <Elegantbeef> `std/algorithm`? |
07:46:57 | FromDiscord | <Elegantbeef> !eval import std/algorthim; echo [4, 400, 5, 512].sorted |
07:46:58 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: cannot open file: std/algorthim |
07:47:11 | FromDiscord | <Elegantbeef> Maybe if i could spell |
07:47:14 | * | PMunch joined #nim |
07:56:49 | FromDiscord | <kevin> i guess my problem was i needed to `parseInt()` my strings before i tried to `sort()` them 🤷 |
07:58:01 | FromDiscord | <Elegantbeef> `sortedByIt(it[0])` |
07:59:49 | FromDiscord | <haxscramper> In reply to @kevin "i guess my problem": you can supply custom comparator function |
08:00:04 | FromDiscord | <haxscramper> `sort(theArray) do(a, b: string)` |
08:00:47 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual_experimental.html#do-notation |
08:01:36 | FromDiscord | <haxscramper> sadly `do` does not work like `->` from sugar, so you still have to spell the argument types |
08:15:43 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
08:19:08 | * | jmdaemon joined #nim |
09:02:07 | * | vicecea quit (Remote host closed the connection) |
09:02:37 | * | vicecea joined #nim |
09:18:30 | * | m5zs7k quit (Read error: Connection reset by peer) |
09:18:30 | * | oisota quit (Quit: Ping timeout (120 seconds)) |
09:18:45 | * | oisota joined #nim |
09:18:51 | * | m5zs7k_ joined #nim |
09:27:19 | * | jjido joined #nim |
09:27:46 | * | m5zs7k_ is now known as m5zs7k |
09:31:18 | FromDiscord | <hugogranstrom> In reply to @pietroppeter "Since the mermaids are": Oh la la! That wasn't very much code you had to add to support it! 🤯 Does this mean I'll have to add Mermaid syntax highlighting to NimiBoost now? 🤣 |
09:39:12 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:10:24 | NimEventer | New Nimble package! nim_chacha20_poly1305 - xchacha20_poly1305, chacha20, poly1305, see https://github.com/lantos-lgtm/nim_chacha20_poly1305 |
10:21:19 | FromDiscord | <abdu> How to convert string type to bool data type the simplest ? |
10:24:44 | PMunch | parsebool? |
10:25:47 | PMunch | @abdu, it all depends on what kind of bool you want |
10:25:51 | PMunch | Relevant: https://forum.nim-lang.org/t/8906#58185 |
10:29:19 | * | Gustavo6046 joined #nim |
10:43:57 | NimEventer | New question by itil memek cantik: right syntax to have Nim string type to bool type, see https://stackoverflow.com/questions/71125023/right-syntax-to-have-nim-string-type-to-bool-type |
10:45:17 | FromDiscord | <Rika> Sigh |
10:45:28 | FromDiscord | <Rika> Didn’t PMunch answer that |
10:50:18 | supakeen | yes. |
12:02:36 | * | jmdaemon quit (Ping timeout: 240 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:31 | * | supakeen joined #nim |
12:11:49 | * | krux02 joined #nim |
12:18:07 | PMunch | Aah, now I see why you where talking about Mermaid earlier: https://forum.nim-lang.org/t/8906#58185 |
12:18:11 | PMunch | https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/ |
12:18:13 | PMunch | Whoops wrong link |
13:35:11 | * | arkurious joined #nim |
15:01:57 | * | PMunch quit (Quit: Leaving) |
15:10:35 | FromDiscord | <QueenFuckingAdrielle> is it true that arraymancer and laser are no longer being maintained? |
15:15:06 | FromDiscord | <deeuu> In reply to @QueenFuckingAdrielle "is it true that": Might wanna ask in the #science channel |
15:16:48 | FromDiscord | <frankzig> Guys I'm using Nimpy to build a python library, ↵↵this library uses a lot of global variables which hold sequences and other types of objects. ↵then via nimpy I expose the methods to handle this objects. |
15:16:57 | FromDiscord | <frankzig> Is this risky for the GC? |
15:17:22 | FromDiscord | <frankzig> do I risk that nim GC decides to eat up this objects while I'm using the library in python? |
15:23:25 | * | anddam quit (Quit: WeeChat 3.4) |
15:27:18 | FromDiscord | <pietroppeter> In reply to @hugogranstrom.nim "Oh la la! That": well, next step is to actually produce the string starting from Nim object (e.g. an object representing a dependency graph or other stuff). this would save you from highlighting the syntax... 😄 |
15:30:22 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3PGs |
15:34:03 | FromDiscord | <hugogranstrom> In reply to @pietroppeter "well, next step is": Ahh, sounds really nice 👌😁 (wouldn't have been too hard to highlight it now that I think about it. Basically a copy-paste of the markdown highlighting in nbCode blocks) |
15:40:51 | * | anddam joined #nim |
15:44:53 | arkanoid | I've successfully acquired RTC clock writing ioctl device arg using just bit shifting and ffi, great! |
15:45:11 | arkanoid | I mean, I've used NO ffi |
16:30:36 | * | icebattle joined #nim |
17:17:31 | * | sagax joined #nim |
17:34:13 | * | Gustavo6046 quit (Quit: Leaving) |
17:38:26 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3PGY |
17:39:51 | FromDiscord | <ynfle> It's not a range |
17:40:06 | FromDiscord | <ynfle> For the iterator, you can use `countup` |
17:40:22 | FromDiscord | <ynfle> For the set, you can use the `sugar.collect` macro |
17:40:54 | FromDiscord | <Arathanis> kk thnx |
17:41:28 | FromDiscord | <Arathanis> use countup, add collect when doing it with a set |
17:44:30 | FromDiscord | <Arathanis> looks like collect only works with a hashset? this might be something I need to do manually |
17:44:34 | FromDiscord | <Arathanis> thats fine, its not too much work |
17:47:54 | * | rwb is now known as rb |
17:51:51 | nrds | <Prestige99> hmm playground down |
17:58:04 | FromDiscord | <kevin> is there a good way to check for asyncSocket timeout? |
17:58:55 | FromDiscord | <kevin> e.g.: If the socket doesn't connect in like 5 seconds, send a message saying the connection timed out |
18:00:12 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=3PHa |
18:01:05 | FromDiscord | <kevin> I think I'm doing this check wrong though because if the socket doesn't connect right away it blocks all other async functions |
18:02:04 | FromDiscord | <kevin> (edit) "https://play.nim-lang.org/#ix=3PHa" => "https://play.nim-lang.org/#ix=3PHd" |
18:03:49 | nrds | <Prestige99> Is the playground not down for you? |
18:16:05 | FromDiscord | <ynfle> In reply to @nrds "<Prestige> Is the playground": Down for me |
18:18:46 | FromDiscord | <Arathanis> You could use repl.it in the interim. I do most of my online nim noodling there over the playground. |
18:20:13 | FromDiscord | <ynfle> I much prefer local |
18:21:49 | FromDiscord | <Arathanis> Agreed. But I figured since the playground was being talked about we were pretty firmly in the realm of online editors. |
18:22:28 | FromDiscord | <Arathanis> ive got a `noodling` dir in my homedir with a folder for all the languages im playing with just for this kind of thing |
18:23:40 | FromDiscord | <ynfle> In reply to @Arathanis "ive got a `noodling`": I just make standalone files |
18:24:48 | FromDiscord | <Arathanis> im just noodling on something somewhat specific so I either name a file or folder what that specific thing is so its easy for me to reference if I want to integrate it into a project in some capacity |
18:25:12 | FromDiscord | <Arathanis> like when I decided to start actually playing with nim's macro system I had↵`$HOME/noodling/nim/nmacros.nim` |
18:25:32 | * | Gustavo6046 joined #nim |
18:25:48 | FromDiscord | <ynfle> In reply to @Arathanis "like when I decided": Right. I just usually do macrotest.nim etc. |
18:25:57 | FromDiscord | <ynfle> (edit) "macrotest.nim" => "`macrotest.nim`" |
18:26:08 | FromDiscord | <Arathanis> that makes a lot of sense to me |
18:26:39 | FromDiscord | <Arathanis> i have a bad habit of flooding a directory with too many files unless I enforce some extra organization on myself haha |
18:26:51 | FromDiscord | <Arathanis> so my folder structure is kind of their for future me's benefit |
18:27:28 | FromDiscord | <Arathanis> and for a good ol' `ll $HOME/noodling/nim | ack macros` |
18:31:19 | FromDiscord | <ynfle> Lol. Make sense |
18:32:09 | * | cyraxjoe quit (Ping timeout: 252 seconds) |
18:32:44 | * | cyraxjoe joined #nim |
18:34:10 | FromDiscord | <ckennedy> Anyone have experience with SDL2 on OSX M1? I compiled SDL2, but I'm getting `'/usr/local/lib/libSDL2.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')` when I try to run the Nim executable. |
18:40:05 | FromDiscord | <auxym> no experience, but it sounds like you compiled libSDL2 for x86_64 instead of M1 |
18:40:22 | FromDiscord | <auxym> oh wait no |
18:40:24 | FromDiscord | <auxym> that's weird |
18:49:54 | * | PMunch joined #nim |
18:51:03 | FromDiscord | <ckennedy> so compiling SDL2 after running `/usr/bin/arch --x86_64 /bin/zsh --login` got it working |
18:52:31 | * | jjido joined #nim |
18:56:20 | FromDiscord | <ckennedy> which is weird because `nim c` in the arm64 shell seems to be producing an x86_64 binary? |
18:59:40 | PMunch | Why wouldn't it? |
18:59:51 | PMunch | Sorry, I just joined so I can't see what you've typed before |
19:00:19 | Amun-Ra | PMunch: arm64 not amd64 ;> |
19:00:28 | PMunch | Oooh |
19:02:14 | * | rockcavera joined #nim |
19:02:14 | * | rockcavera quit (Changing host) |
19:02:14 | * | rockcavera joined #nim |
19:12:24 | FromDiscord | <auxym> In reply to @ckennedy "which is weird because": you might have to pass --cpu:arm to the compiler? and perhaps the compiler execs for that cpu. Not sure how toolchains work on m1 |
19:40:04 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:48:34 | FromDiscord | <ckennedy> @auxym weirdly `--cpu:arm64` seemed to have no affect. It failed with the same message prior to using `/usr/bin/arch`, and it still has no effect after as well (though it works with or without). |
19:51:11 | FromDiscord | <haolian9 (高浩亮)> hi, what TArg should be for `proc foo(a: int, b: string) {.thread.}`? |
20:04:34 | * | jmdaemon joined #nim |
20:36:07 | FromDiscord | <johndo3> Hey does anyone have any good docs for nimpy? The GitHub examples are straight forward but not thorough. Implementation is simple enough but when you start to get in the weeds all they have is a “faq” section… |
20:50:16 | FromDiscord | <leorize> a thread proc can only receive one argument |
20:53:19 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3PI7 |
20:59:40 | FromDiscord | <reilly> Normally I would just pass these values into IMGUI and let it handle everything, but I need to populate the `content` field ahead of time. |
21:19:40 | PMunch | Safely? Don't use a cstring.. |
21:49:00 | * | PMunch quit (Quit: leaving) |
22:30:49 | FromDiscord | <reilly> I don't really have a choice, so I'll take what I can get. |
22:36:04 | FromDiscord | <Mysterysib> Hi |
22:36:15 | FromDiscord | <Mysterysib> Is anyone using IntelliJ Idea / Jetbrains for nim? |
22:36:20 | FromDiscord | <Mysterysib> I need help getting it to work |
22:41:58 | FromDiscord | <JSONBash> what are the supported `--os:` options? |
22:42:56 | FromDiscord | <JSONBash> i am looking for the macos one |
22:49:36 | FromDiscord | <JSONBash> i think it is `--os:macosx` |
23:21:19 | * | wyrd quit (*.net *.split) |
23:21:19 | * | jmdaemon quit (*.net *.split) |
23:21:19 | * | cyraxjoe quit (*.net *.split) |
23:21:19 | * | icebattle quit (*.net *.split) |
23:21:19 | * | supakeen quit (*.net *.split) |
23:21:19 | * | vicecea quit (*.net *.split) |
23:21:20 | * | mjsir911 quit (*.net *.split) |
23:21:20 | * | oddish quit (*.net *.split) |
23:21:20 | * | dtomato quit (*.net *.split) |
23:21:20 | * | nrds quit (*.net *.split) |
23:21:20 | * | xiamx quit (*.net *.split) |
23:21:20 | * | nixfreaknim[m] quit (*.net *.split) |
23:21:20 | * | GnuYawk quit (*.net *.split) |
23:21:21 | * | Gustavo6046 quit (*.net *.split) |
23:21:21 | * | arkurious quit (*.net *.split) |
23:21:21 | * | rb quit (*.net *.split) |
23:21:21 | * | adium quit (*.net *.split) |
23:21:21 | * | fowl quit (*.net *.split) |
23:21:22 | * | systemdsucks quit (*.net *.split) |
23:21:22 | * | blackbeard420 quit (*.net *.split) |
23:21:22 | * | syl quit (*.net *.split) |
23:21:22 | * | def- quit (*.net *.split) |
23:21:22 | * | tinystoat quit (*.net *.split) |
23:21:22 | * | flynn quit (*.net *.split) |
23:21:22 | * | happycorsair[m] quit (*.net *.split) |
23:21:22 | * | cheer[m] quit (*.net *.split) |
23:21:23 | * | ecs quit (*.net *.split) |
23:21:23 | * | nisstyre quit (*.net *.split) |
23:21:23 | * | droidrage quit (*.net *.split) |
23:21:24 | * | Yardanico_ quit (*.net *.split) |
23:21:24 | * | robertmeta quit (*.net *.split) |
23:21:24 | * | tk quit (*.net *.split) |
23:21:24 | * | Onionhammer quit (*.net *.split) |
23:21:25 | * | GreaseMonkey quit (*.net *.split) |
23:21:25 | * | oprypin quit (*.net *.split) |
23:21:25 | * | notchris quit (*.net *.split) |
23:21:25 | * | NimEventer quit (*.net *.split) |
23:21:25 | * | joast quit (*.net *.split) |
23:21:25 | * | cornfeedhobo quit (*.net *.split) |
23:21:25 | * | toothlessgear quit (*.net *.split) |
23:21:25 | * | ormiret quit (*.net *.split) |
23:21:25 | * | lucerne quit (*.net *.split) |
23:21:26 | * | k0mpjut0r quit (*.net *.split) |
23:21:26 | * | koltrast quit (*.net *.split) |
23:21:26 | * | LyndsySimon quit (*.net *.split) |
23:21:26 | * | greyrat_ quit (*.net *.split) |
23:21:27 | * | Schnouki quit (*.net *.split) |
23:21:27 | * | dv2 quit (*.net *.split) |
23:21:27 | * | redj quit (*.net *.split) |
23:21:27 | * | ldlework quit (*.net *.split) |
23:21:27 | * | termer quit (*.net *.split) |
23:21:27 | * | euantorano quit (*.net *.split) |
23:21:28 | * | om3ga quit (*.net *.split) |
23:21:28 | * | Nuc1eoN quit (*.net *.split) |
23:21:28 | * | crem1 quit (*.net *.split) |
23:21:28 | * | qwestion quit (*.net *.split) |
23:21:28 | * | averell quit (*.net *.split) |
23:21:29 | * | meowray quit (*.net *.split) |
23:21:29 | * | kayabaNerve_ quit (*.net *.split) |
23:21:29 | * | ehmry quit (*.net *.split) |
23:21:29 | * | lain quit (*.net *.split) |
23:21:29 | * | jkl quit (*.net *.split) |
23:21:30 | * | ssiyad quit (*.net *.split) |
23:21:30 | * | dv^_^ quit (*.net *.split) |
23:21:30 | * | mal`` quit (*.net *.split) |
23:21:31 | * | Amun-Ra quit (*.net *.split) |
23:21:31 | * | gshumway quit (*.net *.split) |
23:21:31 | * | madprops quit (*.net *.split) |
23:21:31 | * | djanatyn quit (*.net *.split) |
23:21:31 | * | rp1 quit (*.net *.split) |
23:21:31 | * | FromDiscord quit (*.net *.split) |
23:21:32 | * | Zevv quit (*.net *.split) |
23:21:32 | * | Ekho quit (*.net *.split) |
23:21:33 | * | rockcavera quit (*.net *.split) |
23:21:33 | * | sagax quit (*.net *.split) |
23:21:33 | * | anddam quit (*.net *.split) |
23:21:33 | * | oisota quit (*.net *.split) |
23:21:33 | * | m5zs7k quit (*.net *.split) |
23:21:33 | * | arkanoid quit (*.net *.split) |
23:21:33 | * | mahlon quit (*.net *.split) |
23:21:33 | * | xet7 quit (*.net *.split) |
23:21:33 | * | [R] quit (*.net *.split) |
23:23:40 | * | jmdaemon joined #nim |
23:23:40 | * | rockcavera joined #nim |
23:23:40 | * | cyraxjoe joined #nim |
23:23:40 | * | Gustavo6046 joined #nim |
23:23:40 | * | sagax joined #nim |
23:23:40 | * | icebattle joined #nim |
23:23:40 | * | anddam joined #nim |
23:23:40 | * | arkurious joined #nim |
23:23:40 | * | supakeen joined #nim |
23:23:40 | * | m5zs7k joined #nim |
23:23:40 | * | oisota joined #nim |
23:23:40 | * | vicecea joined #nim |
23:23:40 | * | wyrd joined #nim |
23:23:40 | * | rb joined #nim |
23:23:41 | * | arkanoid joined #nim |
23:23:41 | * | mahlon joined #nim |
23:23:41 | * | adium joined #nim |
23:23:41 | * | systemdsucks joined #nim |
23:23:41 | * | blackbeard420 joined #nim |
23:23:41 | * | syl joined #nim |
23:23:41 | * | def- joined #nim |
23:23:41 | * | tinystoat joined #nim |
23:23:41 | * | flynn joined #nim |
23:23:41 | * | fowl joined #nim |
23:23:41 | * | rp1 joined #nim |
23:23:41 | * | tk joined #nim |
23:23:41 | * | xet7 joined #nim |
23:23:41 | * | [R] joined #nim |
23:23:41 | * | mjsir911 joined #nim |
23:23:41 | * | oddish joined #nim |
23:23:41 | * | ldlework joined #nim |
23:23:41 | * | dtomato joined #nim |
23:23:41 | * | droidrage joined #nim |
23:23:41 | * | kayabaNerve_ joined #nim |
23:23:41 | * | qwestion joined #nim |
23:23:41 | * | FromDiscord joined #nim |
23:23:41 | * | Nuc1eoN joined #nim |
23:23:41 | * | ehmry joined #nim |
23:23:41 | * | nrds joined #nim |
23:23:41 | * | Zevv joined #nim |
23:23:41 | * | crem1 joined #nim |
23:23:41 | * | lain joined #nim |
23:23:41 | * | nixfreaknim[m] joined #nim |
23:23:41 | * | xiamx joined #nim |
23:23:41 | * | happycorsair[m] joined #nim |
23:23:41 | * | cheer[m] joined #nim |
23:23:41 | * | GnuYawk joined #nim |
23:23:41 | * | Onionhammer joined #nim |
23:23:41 | * | jkl joined #nim |
23:23:41 | * | nisstyre joined #nim |
23:23:41 | * | ecs joined #nim |
23:23:41 | * | robertmeta joined #nim |
23:23:41 | * | Yardanico_ joined #nim |
23:23:41 | * | lucerne joined #nim |
23:23:41 | * | ormiret joined #nim |
23:23:41 | * | toothlessgear joined #nim |
23:23:41 | * | cornfeedhobo joined #nim |
23:23:41 | * | joast joined #nim |
23:23:41 | * | NimEventer joined #nim |
23:23:41 | * | notchris joined #nim |
23:23:41 | * | oprypin joined #nim |
23:23:41 | * | GreaseMonkey joined #nim |
23:23:41 | * | redj joined #nim |
23:23:41 | * | dv2 joined #nim |
23:23:41 | * | Schnouki joined #nim |
23:23:41 | * | greyrat_ joined #nim |
23:23:41 | * | LyndsySimon joined #nim |
23:23:41 | * | koltrast joined #nim |
23:23:41 | * | k0mpjut0r joined #nim |
23:23:41 | * | om3ga joined #nim |
23:23:41 | * | euantorano joined #nim |
23:23:41 | * | termer joined #nim |
23:23:41 | * | meowray joined #nim |
23:23:41 | * | averell joined #nim |
23:23:41 | * | mal`` joined #nim |
23:23:41 | * | dv^_^ joined #nim |
23:23:41 | * | ssiyad joined #nim |
23:23:41 | * | djanatyn joined #nim |
23:23:41 | * | madprops joined #nim |
23:23:41 | * | gshumway joined #nim |
23:23:41 | * | Amun-Ra joined #nim |
23:23:41 | * | Ekho joined #nim |
23:23:46 | * | enyc quit (Max SendQ exceeded) |
23:24:03 | * | enyc joined #nim |