00:02:38 | * | blackpawn joined #nim |
00:23:58 | * | astronavt left #nim (#nim) |
00:26:01 | * | astronavt joined #nim |
00:33:10 | FromGitter | <redblack3_gitlab> Hey guys, this code: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Is there a way to get the type of the parameter `b` of `proc test`? [https://gitter.im/nim-lang/Nim?at=602c6446a7fc4b573bdbf08c] |
00:34:41 | * | sz0 quit (Quit: Connection closed for inactivity) |
00:38:59 | * | Tanger quit (Remote host closed the connection) |
00:43:15 | * | vqrs quit (Ping timeout: 272 seconds) |
00:49:47 | FromDiscord | <ElegantBeef> try `s[3][1][0].getImpl` |
00:50:21 | * | vqrs joined #nim |
00:50:50 | FromDiscord | <ElegantBeef> Ah sorry on that procdef |
00:51:55 | FromDiscord | <ElegantBeef> Ah it's actually `getType` |
00:52:02 | FromDiscord | <ElegantBeef> I'm good at programming trust me 😄 |
00:57:11 | * | Vladar quit (Quit: Leaving) |
01:13:08 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:13:31 | * | njoseph joined #nim |
01:16:18 | * | Tanger joined #nim |
01:36:18 | * | abm quit (Quit: Leaving) |
01:43:25 | * | a_chou joined #nim |
01:54:51 | * | j-james joined #nim |
02:00:10 | * | j-james quit (Quit: WeeChat 3.0) |
02:24:28 | FromGitter | <redblack3_gitlab> Ah awesome, thanks! I believe you haha |
02:27:16 | FromDiscord | <garett> sent a long message, see http://ix.io/2PGD |
02:27:49 | FromDiscord | <garett> In the second case, I can see -lgdi32 in the linker invocation when I turn up the verbosity |
02:30:11 | FromDiscord | <garett> Not sure if this is a bug in the nim compiler, or just a misunderstanding on my part. |
02:33:32 | * | blueberrypie quit (Quit: leaving) |
02:34:11 | * | blueberrypie joined #nim |
02:38:03 | FromDiscord | <garett> Hah, nevermind, I found my bug 🙂 |
02:38:37 | FromDiscord | <garett> Note to future self: If the code you think is compiling is not doing what you expect, maybe you're not compiling the code you think you're compiling |
02:38:38 | * | asdflkj_ quit (Ping timeout: 272 seconds) |
02:40:16 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PGF |
02:40:16 | FromDiscord | <Anonymous Poet> just trying to print out the commandline args :/ |
02:41:38 | FromDiscord | <ElegantBeef> you know you can just `echo commandLineParams()`? |
02:42:01 | FromDiscord | <ElegantBeef> Unless you want them all on newlines and not in `@[]` |
02:42:31 | Prestige | man that's cool |
02:42:31 | FromDiscord | <Anonymous Poet> 😦 |
02:42:35 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PGH |
02:42:43 | FromDiscord | <ElegantBeef> You didnt invoke command line pararms |
02:42:45 | FromDiscord | <ElegantBeef> (edit) "pararms" => "params" |
02:42:50 | FromDiscord | <ElegantBeef> It's a function |
02:42:56 | FromDiscord | <Anonymous Poet> rip me |
02:43:02 | FromDiscord | <Anonymous Poet> you're right, thank you |
02:43:16 | FromDiscord | <Anonymous Poet> i thought UFCS would "just know" but i guess not |
02:43:30 | FromDiscord | <Anonymous Poet> what is the rule for when it's necessary to add parens? |
02:44:14 | FromDiscord | <ElegantBeef> Well the issue there is you just used the name of a procedure, which is valid syntax since you can assign values to that and have pointer procedures |
02:44:20 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
02:44:35 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
02:44:45 | FromDiscord | <Anonymous Poet> also, as a curiosity, this still doesn't work `echo commandLineParams().map($)` |
02:44:51 | FromDiscord | <Anonymous Poet> `Error: expression expected, but found ')'` |
02:44:54 | FromDiscord | <Anonymous Poet> but ty |
02:45:06 | FromDiscord | <ElegantBeef> Backticks on $ |
02:45:17 | FromDiscord | <ElegantBeef> you need to strop it or it thinks it's an operator |
02:45:21 | FromDiscord | <Anonymous Poet> `Error: '$' cannot be passed to a procvar` |
02:45:39 | FromDiscord | <ElegantBeef> Yep, it's a magic and cannot be passed that way 😄 |
02:46:34 | FromDiscord | <ElegantBeef> Also worth noting the return type of `commandLineParams` is a `seq[string]` |
02:46:47 | FromDiscord | <Anonymous Poet> i think its still tainted string |
02:46:58 | FromDiscord | <ElegantBeef> That's just a string alias in most cases |
02:47:07 | FromDiscord | <ElegantBeef> Think you need a specific flag to tell the compiler otherwise |
02:47:52 | FromDiscord | <Anonymous Poet> ahh, good to know |
02:47:54 | FromDiscord | <Anonymous Poet> ty ty |
02:49:12 | FromDiscord | <ElegantBeef> Prestige what's cool? |
02:49:51 | Prestige | echo commandLineParams() |
02:51:04 | FromDiscord | <exelotl> Silly question but what's the easiest way to get the inversion of a set? |
02:51:19 | FromDiscord | <exelotl> i.e. bitwise not |
02:52:11 | FromDiscord | <ElegantBeef> wouldnt `yourSet - {}` do that? |
02:53:07 | FromDiscord | <ElegantBeef> Nope i'm dumb and wrong 😄 |
02:53:23 | FromDiscord | <exelotl> I read that as 'everything in yourset that's not in {}' |
02:53:47 | FromDiscord | <ElegantBeef> sorry it's `fullSet - yourset` right? |
02:54:11 | FromDiscord | <exelotl> Ah that sounds promising |
02:54:15 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2PGL |
02:54:26 | FromDiscord | <ElegantBeef> Seems to work |
02:59:23 | FromDiscord | <exelotl> I guess I have to do it that way. I'm tempted to use `not cast[uint16](mySet)` but that will flip bits that aren't part of the set, making equality checks possibly fail |
02:59:37 | * | xace quit (Ping timeout: 265 seconds) |
03:00:50 | FromDiscord | <ElegantBeef> Meanwhile i'm pondering if it makes sense to make this an inclusion in the stdlib 😄 |
03:01:13 | FromDiscord | <exelotl> Haha possibly x) |
03:01:36 | FromDiscord | <exelotl> Unary minus perhaps? |
03:01:47 | FromDiscord | <ElegantBeef> `.invert` 😛 |
03:02:39 | FromDiscord | <exelotl> Also decent I guess :) |
03:03:13 | FromDiscord | <ElegantBeef> I prefer words for things like that |
03:06:41 | FromDiscord | <ElegantBeef> Hey a proper impl https://play.nim-lang.org/#ix=2PGS |
03:09:15 | FromDiscord | <ElegantBeef> Sadly though think the end point of this would be in `setutils` instead of directly in the stdlib |
03:22:14 | saem | No name fits: yeah, that's the course. |
03:51:16 | * | xace joined #nim |
04:01:45 | * | xace quit (Ping timeout: 264 seconds) |
04:02:56 | * | xace joined #nim |
04:08:05 | * | xace quit (Ping timeout: 240 seconds) |
04:30:14 | * | watzon joined #nim |
04:41:00 | * | spiderstew_ joined #nim |
04:42:04 | * | spiderstew quit (Ping timeout: 240 seconds) |
04:48:00 | FromDiscord | <Gaz> Can I use pointers in nim to change the value of something in a text file? |
04:49:12 | FromDiscord | <Gaz> If yes how would I go about doing this |
04:53:37 | FromDiscord | <ElegantBeef> You need the file in memory to change the value at a specific position afaik |
04:54:04 | FromDiscord | <ElegantBeef> So you'd read the file then modify then write it |
04:56:35 | * | Cthalupa quit (Ping timeout: 256 seconds) |
05:13:02 | * | Cthalupa joined #nim |
05:17:25 | * | Cthalupa quit (Ping timeout: 240 seconds) |
05:19:30 | * | Cthalupa joined #nim |
05:30:46 | * | wasted_youth2 quit (Quit: Leaving) |
05:31:28 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:44:57 | * | Cthalupa quit (Ping timeout: 264 seconds) |
05:46:34 | * | Cthalupa joined #nim |
06:00:10 | * | xace joined #nim |
06:22:36 | * | a_chou quit (Quit: a_chou) |
06:26:38 | * | Tanger quit (Ping timeout: 272 seconds) |
06:37:39 | * | Tanger joined #nim |
06:38:28 | * | Tanger quit (Remote host closed the connection) |
06:39:15 | * | Tanger joined #nim |
06:43:44 | * | xace quit (Ping timeout: 272 seconds) |
06:48:29 | FromDiscord | <Gaz> Well I managed to do what I wanted @ElegantBeef I dont know if I did it the right way so I will post my code here in ~15 mins |
06:54:03 | * | narimiran joined #nim |
06:58:30 | FromDiscord | <Gaz> https://hatebin.com/qpwjprcclv |
06:58:41 | FromDiscord | <Gaz> Recommendations and comments are welcome |
06:59:04 | FromDiscord | <Rika> will look |
07:00:52 | FromDiscord | <Rika> `readLineFromStdin` can be `stdin.readLine`, dont know why you did that |
07:01:19 | FromDiscord | <ElegantBeef> that prints out `"Enter New Username: "` |
07:02:00 | FromDiscord | <Rika> ah thats true, it also prints |
07:02:08 | FromDiscord | <Rika> but thats a long name for such |
07:02:18 | FromDiscord | <Rika> prolly just do like python and name it `input1 |
07:02:19 | FromDiscord | <Rika> (edit) "`input1" => "`input`" |
07:02:33 | FromDiscord | <ElegantBeef> I mean it's in the stdlib so feel free to attempt to rename it 😄 |
07:02:42 | ForumUpdaterBot | New thread by Halloleo: How to access command line parameters under the JS backend, see https://forum.nim-lang.org/t/7519 |
07:02:57 | FromDiscord | <Rika> i dont see why you need the pointer |
07:03:16 | FromDiscord | <Rika> just change username? |
07:03:38 | FromDiscord | <ElegantBeef> Instead of `execCmd "clear"` use `terminal.clearScreen` |
07:04:38 | FromDiscord | <ElegantBeef> Yea the is silly have the `changeUsername` take a `name: var string` |
07:04:47 | FromDiscord | <ElegantBeef> Or just touch the global variable |
07:05:24 | FromDiscord | <Rika> the is |
07:05:25 | FromDiscord | <Rika> 😛 |
07:05:52 | FromDiscord | <ElegantBeef> the `defer` is not needed either, you can just `f.close()` |
07:06:05 | FromDiscord | <ElegantBeef> Yea yea rika, ptr's escape everyone even my sentences |
07:06:09 | FromDiscord | <Rika> i mean its fine to use defer |
07:06:15 | FromDiscord | <Rika> it can be better sometimes |
07:06:35 | FromDiscord | <ElegantBeef> Considering they're moving defer down where there isnt any file calls anymore |
07:06:58 | FromDiscord | <ElegantBeef> isnt defer supposed to be used after opening the file so you dont have to worry about it? |
07:07:15 | FromDiscord | <Rika> well then tell them to use it properly instead 😛 |
07:07:56 | FromDiscord | <ElegantBeef> Well fine, defer adds it's body after all the statements that follow it, so you want to move that to the line after opening |
07:09:01 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2PHF |
07:09:29 | * | xace joined #nim |
07:10:23 | FromDiscord | <ElegantBeef> In change username you actually never even use that opened file |
07:10:44 | FromDiscord | <ElegantBeef> you use the `writeFile` proc which opens the file and writes to it, and closes it |
07:11:29 | FromDiscord | <ElegantBeef> Anything else rika? 😛 |
07:11:50 | FromDiscord | <Rika> lmao |
07:12:35 | FromDiscord | <ElegantBeef> The real thing is let's hope they like all of what we've said and dont just get angry for us "ragging on them" |
07:13:20 | FromDiscord | <Rika> xd |
07:13:58 | * | xace quit (Ping timeout: 260 seconds) |
07:16:24 | * | xace joined #nim |
07:25:22 | FromDiscord | <Gaz> Oh I'm not angry |
07:25:30 | FromDiscord | <Gaz> I am trying to improve |
07:25:58 | FromDiscord | <slymilano> Hi guys, I started this project with the hope that it helps people new to Nim. I love the language and hope it get more mindshare, making it very easy to start should help in that regard. This is my little grain of sand. https://github.com/sergiotapia/nimlings |
07:26:02 | FromDiscord | <Gaz> In reply to @Rika "i dont see why": As for the pointer I just wanted some practice using pointers |
07:28:25 | * | xace quit (Ping timeout: 240 seconds) |
07:30:25 | FromDiscord | <ElegantBeef> @slymilano nice, if you add more projects certainly should throw it on the monthly nim blog 😄 |
07:30:33 | FromDiscord | <Rika> looks interesting sly |
07:30:47 | FromDiscord | <ElegantBeef> It's a good way to understand compiler error messages |
07:31:17 | FromDiscord | <Gaz> I think I will use defer since its more commonly used in the docs and tuts and rika said it can be better |
07:31:33 | FromDiscord | <ElegantBeef> Well you have to use it properly though |
07:31:54 | FromDiscord | <Gaz> So where should my defers be |
07:32:16 | FromDiscord | <Gaz> Cause I thought you are supposed to place them after all commands involving files |
07:32:17 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2PHK |
07:32:39 | FromDiscord | <Rika> you dont |
07:32:53 | FromDiscord | <ElegantBeef> Nope defer moves all things below defer into a try finally block |
07:33:00 | FromDiscord | <Rika> i have to go actually i have like 2 hours to set up a webserver so |
07:33:46 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2PHL |
07:33:50 | FromDiscord | <Gaz> Mhm... |
07:34:08 | * | haxscramper joined #nim |
07:34:08 | FromDiscord | <Gaz> Now as for the terminal.clearScreen how does that work |
07:34:15 | FromDiscord | <Gaz> I tried googling it |
07:34:20 | FromDiscord | <ElegantBeef> Dont google, use the docs |
07:34:24 | FromDiscord | <Gaz> Ok |
07:34:26 | FromDiscord | <Rika> https://nim-lang.org/docs/terminal.html |
07:34:46 | FromDiscord | <ElegantBeef> Nim is too obscure for search engines to give good results |
07:35:01 | FromDiscord | <ElegantBeef> Both the name and the users |
07:35:35 | FromDiscord | <ElegantBeef> If you type in anything CS related and nim 9/10 you'll get someone attempting to implement the game of nim near the top 😄 |
07:36:41 | FromDiscord | <Rika> Nim, from Wikipedia, the free Encyclopedia |
07:36:51 | FromDiscord | <Rika> Nim is a mathematical game of strategy in which two players take turns removing (or "nimming") objects from distinct heaps or piles. |
07:36:54 | FromDiscord | <Rika> sorry ill stop |
07:36:55 | FromDiscord | <Rika> xd |
07:37:09 | * | PMunch joined #nim |
07:37:22 | FromDiscord | <ElegantBeef> Rust has similar issues, due to the popular game |
07:37:33 | FromDiscord | <Gaz> So whens a good time to use pointers in Nim |
07:37:37 | FromDiscord | <ElegantBeef> Never |
07:37:51 | FromDiscord | <ElegantBeef> If writing pure nim you dont need them, we have safer methods |
07:37:53 | FromDiscord | <Rika> when you must |
07:37:59 | FromDiscord | <Rika> aka c interop |
07:38:12 | FromDiscord | <Rika> otherwise you have to have very specific needs to use a ptr instead of a ref |
07:38:30 | FromDiscord | <ElegantBeef> We have `ref`, `var`, and `lent` all of which give you safer managed options |
07:39:53 | FromDiscord | <Gaz> Thanks boys |
07:40:13 | FromDiscord | <slymilano> use `nimlang` |
07:40:15 | FromDiscord | <slymilano> not just `nim` |
07:40:34 | FromDiscord | <ElegantBeef> There are also experimental view types which give you borrowed memory access akin to a pointer, but with borrow checking |
07:40:43 | FromDiscord | <ElegantBeef> Yea i know sly, still i tend to just use the index/docs |
07:40:58 | FromDiscord | <ElegantBeef> This is dead simple but very effective↵https://nim-lang.org/docs/theindex.html |
07:41:27 | FromDiscord | <Gaz> Although I am finding third party stuff about nim |
07:41:35 | FromDiscord | <Gaz> If I look hard enough |
07:50:31 | * | xace joined #nim |
07:52:45 | * | fputs quit (Ping timeout: 240 seconds) |
07:53:15 | FromDiscord | <ElegantBeef> @slymilano I assume it's rather early for that repo, but consider a project for planning so others can contribute to the excersizes making it easier on you and quicker to get it usable |
07:54:42 | FromDiscord | <ElegantBeef> I imagine it can be as simple as "Make a nil ref error", "Have an unimplemented method", "Incorrect Option/tuple unpacking" |
07:55:05 | * | xace quit (Ping timeout: 256 seconds) |
07:57:54 | FromDiscord | <ElegantBeef> Suppose those could be issues aswell |
08:01:10 | FromDiscord | <slymilano> thats a good suggestion i'll think about adding it once i have more exercises up |
08:07:54 | FromDiscord | <Rika> then the boss error should be a massive macro error xddd i kid |
08:10:25 | PMunch | Are you trying to teach people how to create errors? |
08:11:50 | * | xace joined #nim |
08:13:26 | FromDiscord | <haxscramper> zig has something similar https://github.com/ratfactor/ziglings |
08:14:09 | FromDiscord | <haxscramper> HN discussion on this one seemed generally positive overall |
08:19:36 | PMunch | Yeah it sounds like a cool idea |
08:23:16 | FromDiscord | <ElegantBeef> If you dont know how to make an error in a macro do you even know how to make an error? |
08:24:16 | * | xace quit (Ping timeout: 240 seconds) |
08:29:35 | * | kenran joined #nim |
08:39:30 | * | xace joined #nim |
08:47:14 | * | dv^_^9691 quit (Ping timeout: 272 seconds) |
08:48:20 | * | Tanger quit (Quit: Leaving) |
08:49:47 | PMunch | !eval echo cast[ptr int](nil)[] |
08:49:50 | NimBot | Traceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
08:57:26 | FromGitter | <StefanSalewski> Unfortunately we have lost Adam Dingle (the one from the bacon paper) to Python: https://github.com/StefanSalewski/gintro/issues/106#issuecomment-774691132 |
08:57:34 | FromGitter | <StefanSalewski> > A key difference is that assignment in Nim means copying, like in C and C++. I definitely want a language where assignment instead means making another reference to the same object, like in C#, Java, and Python. |
08:57:39 | FromGitter | <StefanSalewski> Strange. |
08:57:52 | FromDiscord | <ElegantBeef> The string that got emitted on the discord side for that message pmunch confused the fuck outta me was "castptr int[]" |
08:58:26 | FromDiscord | <ElegantBeef> Is using `ref object` that hard? |
08:58:48 | FromGitter | <timotheecour> this is what `var a {.byaddr.} = expr` is for |
08:59:59 | FromDiscord | <ElegantBeef> Well byaddr might get tedious |
09:00:29 | * | dv^_^9691 joined #nim |
09:04:28 | FromGitter | <timotheecour> there’s a way to define `let a = expr.byAddr` too, with some compiler magic; it’d make it easier to use. |
09:04:32 | * | kenran quit (Read error: Connection reset by peer) |
09:04:44 | FromDiscord | <ElegantBeef> yea that'd be ideal |
09:05:22 | FromDiscord | <ElegantBeef> I assume a `set[T].invert` should be added to `setutils` and not the system module eh? |
09:05:45 | FromGitter | <timotheecour> indeed (and “obviously” :) ) |
09:06:20 | FromDiscord | <ElegantBeef> Well idk like my initial PR i'm a numpty that thinks first class types should get first class operations 😄 |
09:06:45 | FromGitter | <timotheecour> the name may need to be bikeshedded (`complement` ? `not` ? etc) |
09:07:11 | FromDiscord | <ElegantBeef> exelotl suggested a unary `-` but that's way to non-descript |
09:08:01 | FromGitter | <timotheecour> there’s no benefit to adding to system.nim; importing is cheap and doesn’t pollute namespace |
09:09:49 | FromDiscord | <ElegantBeef> Yea i agree, main reason to put it in the global imports is for accessibility of new people but if that was a main concern modules wouldnt exist 😛 |
09:10:42 | * | kenran joined #nim |
09:14:52 | PMunch | `not` seems the most obvious to me, as it is similar to binary not |
09:16:07 | FromDiscord | <ElegantBeef> Seems the most sensible, not overly wordy and pretty self explanatory |
09:17:31 | PMunch | And I agree that it should be put in system along with the other `set` stuff |
09:18:10 | PMunch | Seems silly to have a setutils module with nothing but a `not` operator in it.. |
09:18:19 | FromDiscord | <ElegantBeef> It has `toSet` |
09:19:03 | Oddmonger | seq elements are not counted on a sizeof ? Only the «seq» itself is counted ? (like the sizeof in C ?) |
09:19:27 | FromDiscord | <ElegantBeef> well seqs are just a pointer + len |
09:19:29 | FromGitter | <timotheecour> the point of setutils is it can grow without affecting all modules (which implicitly import system) |
09:19:58 | FromDiscord | <Rika> In reply to @StefanSalewski "> A key difference": sounds like something we can convince is different |
09:20:44 | Oddmonger | i was wondering using seq for each element in a game with million elements |
09:21:06 | Oddmonger | there will be empty elements, so using an array would be waste of space |
09:21:37 | Oddmonger | https://play.nim-lang.org/#ix=2PIg |
09:22:24 | Oddmonger | i won't need more than 4 elements per cell, with 16 bit value, so an array could be a good bet, though |
09:23:38 | FromDiscord | <ElegantBeef> Well a seq will always be that size, arrays can be smaller |
09:26:01 | FromDiscord | <enimatek> ah, in homebrew you can just do `brew edit nim` add the _v1 to the csources and it works 🙂 |
09:35:00 | FromDiscord | <Clyybber> In reply to @ElegantBeef "Meanwhile i'm pondering if": I thought a more general way would he to provide a universe for a set type |
09:35:07 | FromDiscord | <Clyybber> which would just be the full set |
09:35:27 | FromDiscord | <ElegantBeef> What? |
09:36:20 | FromDiscord | <ElegantBeef> I assume that was a joke, but i can never be to certain |
09:36:23 | FromDiscord | <ElegantBeef> (edit) "to" => "too" |
09:36:27 | FromDiscord | <Clyybber> a macro or magic thats equivalent/expands to {true, false} for bool for example |
09:36:37 | FromDiscord | <Clyybber> In reply to @ElegantBeef "I assume that was": lol, I was serious |
09:36:52 | FromDiscord | <ElegantBeef> well that's just `T.low..T.high` |
09:37:11 | FromDiscord | <Clyybber> no |
09:37:19 | FromDiscord | <Clyybber> because holes |
09:37:36 | FromDiscord | <Clyybber> oh, well hmm those shouldnt matter I guess? |
09:37:39 | FromDiscord | <Varriount> In reply to @Clyybber "a macro or magic": Yes, by all means, let's add more miscellaneous errata to the standard library. |
09:37:59 | FromDiscord | <ElegantBeef> I do not know how holes work with sets |
09:38:36 | FromDiscord | <ElegantBeef> But dont use sets with a holey type, we arent all christians no need to believe in the holy |
09:40:27 | FromDiscord | <ElegantBeef> As expected a bunch of invalidi data |
09:40:29 | FromDiscord | <ElegantBeef> (edit) "invalidi" => "invalid" |
09:42:33 | FromDiscord | <ElegantBeef> Considering sets are used with contains or not contains i dont think the holes are causing any issue though right? |
09:42:46 | * | Tanger joined #nim |
09:47:21 | FromDiscord | <ElegantBeef> Though i suppose it doesnt hurt to make a `fullSet` template, and put it in setutils, but would like comments on if that's dumb 😄 |
09:49:03 | FromDiscord | <Clyybber> if at all it would belong in setutils yeah |
09:49:32 | FromDiscord | <ElegantBeef> I more mean if the `fullSet` is dumb, and a more apt name 😄 |
09:49:53 | FromDiscord | <Clyybber> but not should suffice |
09:49:59 | FromDiscord | <Clyybber> just not the empty set |
09:50:16 | FromDiscord | <Varriount> What would this template do? |
09:50:26 | FromDiscord | <Clyybber> need to make sure that holy sets properly ignore the unused buts |
09:50:32 | FromDiscord | <Clyybber> (edit) "buts" => "bits" |
09:50:58 | FromDiscord | <ElegantBeef> Well not'ing an empty doesnt remove the redundant bits |
09:51:02 | FromDiscord | <Clyybber> In reply to @Varriount "What would this template": you would give it a set type and it would give you the set containing all elements |
09:51:42 | FromDiscord | <ElegantBeef> The issue is clyyber as you pointed out my large set is all bits even invalid that are in the range for holy sets 😄 |
09:51:44 | FromDiscord | <Varriount> When would you need a set containing all possible elements? |
09:51:55 | FromDiscord | <Varriount> Why wouldn't you just use a range? |
09:51:56 | FromDiscord | <ElegantBeef> To invert the other set |
09:52:39 | FromDiscord | <Varriount> So why wouldn't you loop over the other set and create an inverted version right there? |
09:52:53 | FromDiscord | <ElegantBeef> You need a mask of only the valid values to flip it using `-` atleast |
09:53:05 | FromDiscord | <Varriount> When do you need to invert a set? |
09:53:12 | FromDiscord | <ElegantBeef> exelotl needed to earlier today |
09:53:28 | FromDiscord | <Varriount> Has anyone else needed to? |
09:53:51 | FromDiscord | <ElegantBeef> No clue |
09:54:10 | FromDiscord | <Clyybber> In reply to @Varriount "Has anyone else needed": yeah it comes up once in a while |
09:54:25 | FromDiscord | <Clyybber> but really not is probably a better idea |
09:54:40 | FromDiscord | <ElegantBeef> Well i need to generate that full set regardless with `not` |
09:54:51 | FromDiscord | <ElegantBeef> So it'll be internalized at the very most |
09:54:54 | FromDiscord | <Clyybber> and by handling the unused bits of holy enums I meant handling them correctly when converting to something else |
09:55:01 | FromDiscord | <Clyybber> not during the set operations |
09:55:16 | FromDiscord | <ElegantBeef> Well that's why i need `fullSet` so only the valid options are flipped in the `not` operation |
09:55:24 | FromDiscord | <Clyybber> no |
09:55:45 | FromDiscord | <Clyybber> not if the conversions from set -> something else are handling it |
09:55:45 | * | Vladar joined #nim |
09:55:52 | FromDiscord | <Clyybber> then its just a binary not |
09:55:59 | FromDiscord | <Clyybber> which is best since its also faster |
09:56:30 | FromDiscord | <ElegantBeef> Well you're limited to 64 values no? |
09:56:51 | FromDiscord | <ElegantBeef> Unless you generate an array to do the value using the size of the enum i guess |
09:57:25 | FromDiscord | <ElegantBeef> Remember that Nim's sets are at most 2^16 bits iirc |
09:57:42 | FromDiscord | <Clyybber> I dont see how thats related :p |
09:57:59 | FromDiscord | <ElegantBeef> Well i dont know how you binary not something that large whilst ensuring all values are valid |
09:58:19 | FromDiscord | <Clyybber> you dont need to ensure anything |
09:58:45 | FromDiscord | <Clyybber> you just need to ensure that the unused bits are not leaking out of the set abstraction |
09:59:17 | FromDiscord | <ElegantBeef> Yep out of my paygrade |
10:00:11 | FromDiscord | <Clyybber> but it gets tricky when passing holy sets to C libraries |
10:01:12 | FromDiscord | <ElegantBeef> Yea if you dont look at a holy set it's fine, but if you echo it or you cast it to an int it's evident it's wrong |
10:01:37 | FromDiscord | <Clyybber> yeah |
10:06:07 | * | aeverr joined #nim |
10:17:11 | * | kenran quit (Quit: leaving) |
10:22:03 | * | filcuc joined #nim |
10:34:41 | FromDiscord | <arnetheduck> whoa, the time constructor takes the day of the month first 😱 : https://nim-lang.org/docs/times.html#initDateTime%2CMonthdayRange%2CMonth%2Cint%2CHourRange%2CMinuteRange%2CSecondRange%2CNanosecondRange%2CTimezone |
10:35:33 | liblq-dev | this ain't america sir |
10:35:44 | FromDiscord | <ElegantBeef> It's a miracle proper time 😄 |
10:36:05 | filcuc | well is ok fine in europe i think... |
10:36:13 | filcuc | ok/fine |
10:36:38 | FromDiscord | <ElegantBeef> Well it's d/m/y which is standard everywhere but the US pretty much |
10:36:51 | FromDiscord | <ElegantBeef> @Clyybber feel free to go complain about my code now https://github.com/nim-lang/Nim/pull/17066 😛 |
10:36:54 | FromDiscord | <ElegantBeef> I sleep now |
10:38:45 | liblq-dev | night |
10:40:07 | Clonkk[m] | 4 |
10:40:13 | Clonkk[m] | 44444444444455555555555555555547444444444444444444444444444444444444444444 |
10:40:39 | * | abm joined #nim |
10:42:24 | Clonkk[m] | 65565(-èè-6è--èèèèèèèèèèè_èèèèèèèèèèèèèèèèèè_èèèèèèèèèuuy__è_è_u_u_çi_èuuuu__u___uuuuuu_èyyè__uè__uu |
10:42:25 | Clonkk[m] | yu |
10:44:15 | FromDiscord | <Clyybber> @ElegantBeef good night |
10:45:51 | PMunch | Clonkk[m], you alright? |
10:46:04 | Clonkk[m] | Coffee on laptop |
10:46:13 | Clonkk[m] | 😕 |
10:46:21 | PMunch | Ouch |
10:46:28 | Clonkk[m] | Was cleaning it ^ |
10:46:38 | FromDiscord | <arnetheduck> err.. year should be first? I mean year-month-day-hour-minute-second, there's a pattern there, which is why, er.. it's an international standard used in engineering? |
10:49:38 | * | filcuc_ joined #nim |
10:52:17 | Oddmonger | Clonkk[m]: azerty ? |
10:52:45 | Clonkk[m] | yup |
10:53:03 | * | filcuc quit (Ping timeout: 272 seconds) |
10:53:13 | Clonkk[m] | gotta make your finger work to write backtick and { |
10:53:26 | PMunch | Where are those on AZERTY? |
10:53:43 | Oddmonger | french people |
10:54:07 | Oddmonger | ah excuse me |
10:54:14 | PMunch | Haha, yeah I know who uses it |
10:54:20 | PMunch | I lived in Belgium for a year |
10:54:25 | Oddmonger | misread. The keys «impacted» are on the right |
10:54:29 | PMunch | Never could get used to having numbers as secondary |
10:55:09 | Clonkk[m] | The worst part i that I have both azerty and qwerty keyboard so i'm switching constantly |
10:55:27 | PMunch | Dvorak master race |
10:55:27 | Clonkk[m] | Depending on the computer I use |
10:55:51 | Oddmonger | i use bépo on a german keyboard |
10:57:02 | Clonkk[m] | Bepo / Dvorak are good and all, but not having to bring your own keyboard whenever you go is also practical 😛 |
10:57:34 | Oddmonger | i can type on azerty (with two fingers, like the cops) |
11:02:23 | PMunch | I can type just fine on QWERTY once I get warmed up to it |
11:02:33 | PMunch | But it's always a bit rough in the switch |
11:06:08 | Clonkk[m] | Isn't Dvorak hard to use with Vim though ? |
11:08:38 | PMunch | Depends |
11:08:43 | PMunch | I have a lot of things rebound |
11:31:54 | * | Cthalupa quit (Ping timeout: 272 seconds) |
11:32:38 | * | Cthalupa joined #nim |
11:35:58 | * | teasea quit (Quit: teasea) |
11:37:54 | * | teasea joined #nim |
11:52:49 | vindaar[m] | Neo master race if anything |
11:57:03 | * | liblq-devel joined #nim |
11:57:03 | * | liblq-devel quit (Client Quit) |
11:57:10 | FromDiscord | <JoeMan> helloooo |
11:57:15 | PMunch | Hello |
11:57:40 | FromDiscord | <JoeMan> when i was searching for programming languages like python but also fast |
11:57:46 | FromDiscord | <JoeMan> i found this programming language |
11:58:10 | PMunch | Sounds about right |
11:58:14 | FromDiscord | <JoeMan> should i read the nim-basics pdf? |
11:58:43 | PMunch | Well, it's mostly geared towards people with minimal programming experience |
11:58:52 | PMunch | So it might be a bit terse if you're already familiar with programming |
11:59:16 | FromDiscord | <JoeMan> oh okay |
11:59:36 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers and https://nim-lang.org/learn.html |
11:59:44 | PMunch | Of course this also means it's quite thorough |
11:59:53 | FromDiscord | <JoeMan> okay |
11:59:58 | FromDiscord | <haxscramper> First one is feature-by-feature comparison, second is a collection of longs for various tutorials etc. |
12:00:58 | FromDiscord | <JoeMan> there is so much more programming languages than I thought |
12:02:16 | FromDiscord | <zetashift> Any emacers know how to disable nimsuggest in nim-mode? |
12:03:35 | PMunch | TIL you can define tuples like this: https://play.nim-lang.org/#ix=2PJ9 |
12:04:58 | PMunch | If you are very familiar with programming then this might be helpful: https://learnxinyminutes.com/docs/nim/ |
12:05:57 | FromDiscord | <zetashift> huh TIL |
12:06:36 | FromDiscord | <JoeMan> It seems I have gotten an error |
12:07:14 | PMunch | Well that was quick : |
12:07:27 | FromDiscord | <mratsim> btw, should we create a "needed-tutorials" to mirror the "needed-libraries"? |
12:07:51 | PMunch | That might be useful |
12:07:54 | FromDiscord | <mratsim> For example someone asked me about using a state machine for UI but I think using async for UI would be more idiomatic. |
12:08:29 | FromDiscord | <JoeMan> do i need the gcc compiler to run nim? |
12:08:53 | PMunch | Well, you need a C compiler, not necessarily GCC |
12:09:07 | PMunch | What OS are you using? |
12:09:18 | FromDiscord | <JoeMan> windows 8 |
12:10:09 | FromDiscord | <JoeMan> codeblocks has a c compiler right? |
12:10:31 | PMunch | Well that just gave me more questions :P But if you run `finish.exe` in the zip you have it will install MinGW for you |
12:10:44 | FromDiscord | <JoeMan> ohhh |
12:14:35 | FromDiscord | <JoeMan> I also found this discord on a 3 year old forum post |
12:19:48 | PMunch | It's also listed on the frontpage of the website: https://nim-lang.org/community.html |
12:20:10 | PMunch | With a link to that page, although there is not link in the navigation bar to it.. |
12:23:32 | FromDiscord | <JoeMan> |
12:27:35 | FromDiscord | <Clyybber> TIL that --gc:stack was a thing |
12:28:30 | * | Vladar quit (Quit: Leaving) |
12:28:38 | FromDiscord | <Clyybber> ah, it was the precursor of gc:regions |
12:29:23 | FromDiscord | <KSun> Hey guys, which of the 3 VSCode extensions for Nim is the correct, or most up-to-date one? |
12:29:42 | FromDiscord | <Rika> The one by saem |
12:30:14 | FromDiscord | <KSun> Thanks Rika |
12:31:22 | * | haxscramper quit (Remote host closed the connection) |
12:32:37 | * | haxscramper joined #nim |
12:39:30 | * | wasted_youth2 joined #nim |
12:46:37 | PMunch | Hmm, illwill seems to not properly support non-fullscreen stuff |
12:46:42 | PMunch | Any other similar libraries out there? |
12:50:14 | * | haxscramper quit (Remote host closed the connection) |
12:50:50 | * | haxscramper joined #nim |
12:52:55 | * | hallou joined #nim |
12:53:08 | * | aeverr left #nim ("Konversation terminated!") |
12:53:35 | * | hallou left #nim (#nim) |
12:53:44 | FromDiscord | <Clyybber> PMunch: WDYM with non-fullscreen? |
12:54:09 | PMunch | Well basically I want to create a simple spreadsheet style thing |
12:54:16 | PMunch | But I don't want it to be fullscreen |
12:54:54 | PMunch | When you run it it should only show a single line with a single cell. Then you have to move right/down to create more cells and rows |
12:55:24 | PMunch | If you move back up without having input any data it will erase the lines as you go |
12:55:26 | FromDiscord | <Clyybber> Ah, and it should not use the alternate terminal buffer? |
12:57:30 | FromDiscord | <Clyybber> Or does that not matter? |
12:59:01 | PMunch | Alternate terminal buffer? |
12:59:45 | FromDiscord | <Clyybber> It's a second buffer for your terminal, which illwill uses I think, because then you can easily restore the original contents once the application exits |
13:00:51 | FromDiscord | <Clyybber> PMunch: But what I was asking basically is, if you want it to behave like cat, in the sense that while using it, you can still see the commands you previously executed |
13:02:53 | FromDiscord | <Clyybber> thats what I understood as "non-fullscreen stuff" |
13:02:58 | PMunch | Yes |
13:04:12 | FromDiscord | <Clyybber> hmm, what doesn't work with illwill with fullscreen = false? |
13:04:59 | PMunch | No it still draws at 0, 0 |
13:05:11 | PMunch | It does setCursor(0, 0) |
13:05:23 | PMunch | When you draw a buffer |
13:05:55 | PMunch | I tried creating a small buffer and starting illwill with fullscreen = false and it just drew in the top left corner |
13:06:26 | * | NimBot joined #nim |
13:08:01 | FromDiscord | <KSun> Any know if there is a repo for the nim-lang.org/docs/ ? |
13:09:25 | PMunch | It's in the main repo: https://github.com/nim-lang/Nim/tree/devel/doc |
13:09:50 | PMunch | And module documentation is generated by `nim doc` |
13:10:05 | FromDiscord | <KSun> Thank you |
13:10:16 | FromDiscord | <KSun> I couldn't find it in the website repo, got lost. |
13:11:04 | FromDiscord | <flywind> The devel docs even have edit and source button. |
13:11:05 | FromDiscord | <flywind> https://nim-lang.github.io/Nim |
13:11:19 | FromDiscord | <flywind> https://nim-lang.github.io/Nim/tut1.html |
13:11:58 | FromDiscord | <Clyybber> PMunch: Looking at https://github.com/junegunn/fzf/commit/95f8650455b2c01181fb355b696ed88fbaaaa6f3 at least ncurses and tcell should support that |
13:13:35 | ForumUpdaterBot | New thread by Mrhdias: How to kill a process and all of its descendants in Nim?, see https://forum.nim-lang.org/t/7520 |
13:14:44 | PMunch | Hmm |
13:16:03 | * | cornfeedhobo quit (Ping timeout: 260 seconds) |
13:18:47 | * | xet7_ is now known as xet7 |
13:26:55 | PMunch | @Clybber, this is what I want to do: https://asciinema.org/a/96edvgQ8FzfV04m1FRIANRjVw |
13:30:03 | PMunch | The code I threw together for that though is super hacky :P |
13:30:38 | PMunch | In case you're curious: http://ix.io/2PJz |
13:34:32 | FromDiscord | <Clyybber> PMunch: My only question is: what kind of cursed keyboard layout do you use haha ;D |
13:35:44 | PMunch | Haha, Dvorak, why? |
13:36:02 | PMunch | Oh, the ABCD to move around stuff? |
13:36:35 | PMunch | That's what I meant by hacky :P |
13:36:58 | FromDiscord | <Clyybber> ooh, wait you are parsing the sequences :D |
13:37:08 | PMunch | Not really parsing them :P |
13:37:47 | FromDiscord | <Clyybber> yeah :D some terminals put an O before the A B C D so I guess thats where it would break |
13:37:50 | PMunch | It's just ^[[A, ^[[B, ^[[C, and ^[[D for the cursor buttons |
13:38:08 | PMunch | And I just don't care about the Esc-[ part of that sequence |
13:38:26 | PMunch | That's why I only allow 'a'..'z' to be input into fields :P |
13:39:28 | FromDiscord | <Clyybber> ah, right |
13:40:55 | PMunch | Told you it was hacky! |
13:50:08 | * | waleee-cl joined #nim |
13:55:06 | PMunch | TBH it will probably be easier to just write it myself |
14:01:59 | * | asdflkj_ joined #nim |
14:11:44 | FromDiscord | <exelotl> Sooo adding close-able sections in parsecfg... |
14:11:49 | FromDiscord | <exelotl> https://play.nim-lang.org/#ix=2PJS |
14:11:59 | FromDiscord | <exelotl> is this a good idea or a horrible hack? xD |
14:16:30 | FromDiscord | <exelotl> in my existing project I'm using includes & macros as a config |
14:17:05 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2PJV |
14:18:38 | FromDiscord | <exelotl> but I'm trying to make something that's not just compile-time, and is more robust / good fit for a variety of projects |
14:19:21 | Clonkk[m] | Hmm I have a difference in behaviour when casting pointer to function pointer between C and Nim |
14:19:47 | Clonkk[m] | ``` |
14:19:47 | Clonkk[m] | var addMeBabyInt: (proc(a: cint, b: cint): cint) = cast[ptr (proc(a: cint, b: cint): cint)](fPtr)[] |
14:19:47 | Clonkk[m] | ``` |
14:20:20 | Clonkk[m] | fPtr is the result of calling a C function that works in pure C. I can't figure out the difference |
14:21:17 | PMunch | @Clonkk[m], please don't multi-line paste into IRC |
14:22:13 | PMunch | @Clonkk[m], what is the error? |
14:22:15 | Clonkk[m] | Erf, sorry I'm using Matrix; formatting looks fine here. |
14:22:26 | Clonkk[m] | Segmentation fault during function call |
14:22:27 | PMunch | It might be something as simple as call conventions |
14:22:40 | Clonkk[m] | IF I use ARC it's a sigbus |
14:23:53 | PMunch | See how it's done here: https://nim-lang.org/docs/dynlib.html#examples-loading-a-simple-c-function |
14:24:08 | PMunch | No ptr, and the procedure is declared with gcsafe and stdcall |
14:25:21 | Yardanico | Clonkk[m]: as PMunch said, you just cast fPtr to the proc type itself |
14:25:26 | Yardanico | because proc itself is a pointer already |
14:27:27 | Clonkk[m] | Ah okay proc type hides the pointer aspect. What is ``gcsafe, stdcall`` purpose ? |
14:27:48 | Yardanico | gcsafe if you want to specify that the proc is gcsafe |
14:27:51 | Yardanico | stdcall is the calling convention |
14:28:38 | PMunch | Calling convention is how the computer actually performs the function call in regards to pushing stuff on the stack and such |
14:29:42 | Clonkk[m] | Okay, thanks ! |
14:30:13 | Oddmonger | cannot remember (and find) what ord() do in nim… obviously, it returns a number but cannot remember the rules implied |
14:31:01 | FromDiscord | <Yardanico> it returns the int value of an ordinal type |
14:31:18 | Clonkk[m] | orc get the number value as integer of an enum or Ordinal type |
14:31:21 | Oddmonger | ah sort of cast from a value ? |
14:31:26 | liblq-dev | don't use stdcall |
14:31:27 | liblq-dev | use cdecl |
14:32:08 | Clonkk[m] | <liblq-dev "use cdecl"> Got it ! What's the issue with stdcall ? |
14:33:45 | liblq-dev | it's exclusive to windows |
14:34:09 | liblq-dev | cdecl is the default C calling convention which should be what you want |
14:35:04 | Clonkk[m] | Okay, good to know. But FYI, stdcall worked on my Linux (but I agree using Windows specific notation is bad) |
14:35:15 | Clonkk[m] | So there's probably an indirection here somewhere |
14:35:49 | PMunch | Probably just forwarded to the compiler and promptly ignored |
14:36:34 | Clonkk[m] | Except without either ``cdecl`` or ``stdcall`` the compiler complain about the cast from pointer to proc |
14:36:53 | Clonkk[m] | So the compiler see ``stdcall``, allow the cast but then ignore it ? |
14:36:57 | Clonkk[m] | Weird |
14:37:49 | liblq-dev | PMunch: `__stdcall` does not exist in gcc so Nim just doesn't emit code for it |
14:37:55 | liblq-dev | so it's equivalent to cdecl |
14:38:02 | PMunch | Aah, right |
14:40:07 | Clonkk[m] | An error message that mentions cdecl pragma when casting pointer to proc could be useful btw 😛. It's not trivial that you have to annotate the proc type with cdecl pragma to allow the cast from a pointer. |
14:40:39 | * | Clonkk[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/PSKKIjIGzPcZIFrVlciAoDDC/message.txt > |
14:47:35 | liblq-dev | no no |
14:47:42 | liblq-dev | `proc` *is* a pointer in nim |
14:48:38 | liblq-dev | so `var addMeBabyInt = cast[proc (a, b: cint): cint](fPtr)` |
14:53:41 | * | Vladar joined #nim |
14:59:19 | * | astronavt quit (Quit: ...) |
15:01:16 | * | astronavt joined #nim |
15:23:48 | * | superbia joined #nim |
15:30:15 | * | PMunch quit (Quit: leaving) |
15:35:27 | FromDiscord | <zetashift> @PMunch it might be overkill for a full on PR but for me your link `Toccatas novel boolean approach ` in https://github.com/PMunch/nim-optionsutils is broken because a github url is pasted in front of it? |
15:58:25 | * | superbia quit (Quit: WeeChat 3.0) |
16:12:36 | * | tane joined #nim |
16:13:11 | * | vicfred joined #nim |
16:18:33 | * | gmaggior joined #nim |
16:19:35 | gmaggior | Hi. Is there an alternative for the .projectile file in Windows? (because it is not a valid Windows filename) |
16:20:05 | FromDiscord | <Yardanico> wdym? |
16:20:36 | FromDiscord | <Yardanico> .gitignore is valid, but why .projectile is not? |
16:20:58 | gmaggior | I v |
16:21:19 | gmaggior | I cannot create a file with such name (extension) |
16:21:56 | FromDiscord | <Yardanico> try doing it from the cmd |
16:22:01 | FromDiscord | <Yardanico> from a terminal |
16:22:59 | * | a_b_m joined #nim |
16:24:45 | gmaggior | FromDiscord, it worked! Thank you :) |
16:25:56 | * | abm quit (Ping timeout: 240 seconds) |
16:27:07 | FromDiscord | <Yardanico> i'm not FromDiscord :P |
16:27:10 | FromDiscord | <Yardanico> I'm "Yardanico" |
16:27:31 | FromDiscord | <Yardanico> FromDiscord is the bridge that transmits messages between Discord and IRC |
16:29:22 | gmaggior | ahh right. Sorry. Thanks (just joined irc quickly to ask this) |
16:31:12 | FromDiscord | <no name fits> I think it might just be an issue with creating the file via Windows Explorer. It works just fine from my editor |
16:31:27 | FromDiscord | <no name fits> I couldn't replicate the issue |
16:34:40 | gmaggior | no name fits: yes I think so... just Windows Explorer file create |
16:36:00 | ForumUpdaterBot | New thread by MerryMurray: Redis - how to select database, see https://forum.nim-lang.org/t/7521 |
16:42:46 | * | AndChat|21441 joined #nim |
16:44:43 | * | gmaggior quit (Ping timeout: 260 seconds) |
16:50:59 | * | gmaggior joined #nim |
16:52:59 | * | AndChat|21441 quit (Ping timeout: 272 seconds) |
16:56:27 | * | AndChat|21441 joined #nim |
16:57:47 | * | gmaggior quit (Ping timeout: 260 seconds) |
16:59:23 | * | AndChat|21441 quit (Client Quit) |
17:21:01 | * | abm joined #nim |
17:21:25 | * | a_b_m quit (Ping timeout: 240 seconds) |
17:22:46 | * | aeverr joined #nim |
17:25:25 | * | letto quit (Quit: Konversation terminated!) |
17:26:01 | * | letto joined #nim |
17:42:09 | ForumUpdaterBot | New thread by Roberthaba: Installation and configuration of the Nim language, see https://forum.nim-lang.org/t/7522 |
18:23:27 | * | jess quit (Quit: updates) |
18:25:26 | FromDiscord | <Littleli> my appologies, I'm quite new to nim... I cannot find way how to initialize array of uint16 using literal syntax. Is it possible? |
18:28:17 | sekao[m] | Cast the first number in the array to uint16 |
18:29:02 | sekao[m] | Like [1.uint16, 2, 3] |
18:31:05 | FromDiscord | <Littleli> Thank you! 🙂 |
18:43:11 | FromDiscord | <mratsim> In reply to @Littleli "Thank you! 🙂": I find this more elegant: [uint16 1, 2, 3] |
18:46:54 | vindaar[m] | Can someone explain me how to get the CI with Github Actions working again on Windows after the recent SSL change? I saw Araq's post on the forum, but I don't get it / trying that yields another unhelpful error message :/ |
18:51:43 | leorize[m] | are you using my setup-nim action? |
18:56:33 | FromDiscord | <Littleli> In reply to @mratsim "I find this more": nice 🙂 |
18:57:00 | FromDiscord | <mratsim> @Vindaar https://github.com/mratsim/constantine/pull/157/files#diff-7915b9b726a397ae7ba6af7b9703633d21c031ebf21682f3ee7e6a4ec52837a5R233 |
18:59:40 | vindaar[m] | @mratsim: yes, I saw the constantine PR. But since you're building Nim yourself it seems it doesn't apply. I still get this: https://github.com/Vindaar/ggplotnim/pull/109/checks?check_run_id=1911314590 (click on "Install dependencies (Windows)" if it doesn't open that). |
18:59:40 | vindaar[m] | "Unable to add file - 0x80070057" ok? |
18:59:40 | vindaar[m] | leorize: yes! |
19:00:47 | FromDiscord | <mratsim> normally the certificate is shipped in Nim dlls |
19:01:03 | leorize[m] | vindaar: then it's a bug in nightlies, I'll investigate later today |
19:01:21 | FromDiscord | <mratsim> I expect the certificate comes with these now: https://nim-lang.org/download/dlls.zip |
19:01:40 | FromDiscord | <zetashift> Is there a more idiomatic/nicer way to implement neighbors? https://play.nim-lang.org/#ix=2PLG |
19:02:05 | vindaar[m] | <leorize[m] "vindaar: then it's a bug in nigh"> Thanks! |
19:02:26 | FromDiscord | <dom96> I don't think certs get shipped |
19:02:36 | FromDiscord | <dom96> they should be loaded from the OS |
19:02:43 | FromDiscord | <mratsim> In reply to @zetashift "Is there a more": not sure what neigbor is but https://github.com/mratsim/golem-prime/blob/master/src/datatypes.nim#L155-L165 |
19:02:43 | leorize[m] | vindaar: actually, can you try upgrading to [email protected] first? |
19:03:13 | leorize[m] | @dom96 they has to be shipped for Windows. We don't have cert store import yet |
19:03:40 | vindaar[m] | leorize: oh, didn't know there was a new version. Yup, trying now |
19:04:09 | leorize[m] | the readme also has how to setup update notification if you're interested |
19:05:04 | vindaar[m] | Still a bit overwhelmed with all this github actions stuff 🤭 |
19:05:11 | FromDiscord | <zetashift> @mratsim ah neighbor is just another cell, I'll use an iterator! |
19:05:42 | FromDiscord | <mratsim> So they are prisoners? |
19:07:59 | FromDiscord | <zetashift> no just a cell in a grid with a x,y. Maybe prisoners might be a more sadistic metaphor though |
19:08:04 | * | cornfeedhobo joined #nim |
19:09:45 | FromDiscord | <mratsim> I was joking 😉 |
19:10:19 | FromDiscord | <mratsim> In reply to @vindaar "Still a bit overwhelmed": Wait until you here about DOcker and Kubernetes |
19:11:25 | FromDiscord | <zetashift> In reply to @mratsim "I was joking 😉": I was thinking if it was a joke, but I guessed wrong at the end 😛 |
19:12:19 | FromDiscord | <zetashift> Mhmhm, iterator might still be unhandy later on, I might use it outside of for loops |
19:12:39 | FromDiscord | <mratsim> for loop is life, forget about Haskell |
19:13:26 | liblq-dev | for lööps |
19:13:39 | FromDiscord | <zetashift> blasphemy! |
19:13:50 | FromDiscord | <zetashift> One may never forget about Haskell |
19:14:09 | FromDiscord | <zetashift> imma Monad all the thing |
19:14:10 | FromDiscord | <zetashift> d |
19:14:23 | FromDiscord | <zetashift> s damnit |
19:14:59 | FromDiscord | <dom96> In reply to @leorize "<@132595483838251008> they has to": that sucks :/ |
19:15:13 | vindaar[m] | ok, turns out the problem really just was that the path to the Nim install was wrong :| |
19:16:26 | leorize[m] | the update fixed it? |
19:18:47 | vindaar[m] | oh no, nevermind what I just said. Still not working :) |
19:18:56 | vindaar[m] | Nope, the update also did nothing |
19:21:10 | vindaar[m] | <FromDiscord "<mratsim> In reply to @vindaar ""> I mean the underlying issue is just that there's all sorts of functionality that isn't well explained (well it might be, guess I'm just too lazy to properly read the docs) and a way too long feedback loop |
19:22:23 | leorize[m] | okay, then it's probably a nightlies bug |
19:24:35 | vindaar[m] | ok, just went the hardcoded path to output of setup-nim and now it /seems/ to be working |
19:25:24 | vindaar[m] | I will never understand why CIs do not show the full path from where commands are run. Makes it such a PITA to figure these things out |
19:25:57 | leorize[m] | <vindaar[m] "ok, just went the hardcoded path"> hmm? |
19:26:14 | vindaar[m] | https://github.com/Vindaar/ggplotnim/pull/109/commits/5cf003f8bb5b341ddcfa63ef628790754fb8bba6 |
19:26:48 | vindaar[m] | I didn't realize that setup nim puts Nim into that directory |
19:29:33 | leorize[m] | I'll push an update to handle this certificate thing automatically later then |
19:31:37 | vindaar[m] | That'd be nice, thanks! |
19:32:27 | leorize[m] | wait, you shouldn't need it... |
19:32:45 | leorize[m] | maybe araq forgot to update windeps.zip, gotta investigate later |
19:34:36 | leorize[m] | nvm, I know exactly what's the issue... |
19:35:36 | leorize[m] | nightlies uses a cache to avoid redownloading of deps |
19:36:22 | leorize[m] | since windeps is not versioned, updates to it are ignored by nightlies |
19:53:20 | * | gmaggior joined #nim |
19:58:07 | * | vsantana joined #nim |
19:59:56 | * | letto quit (Remote host closed the connection) |
20:03:43 | * | letto joined #nim |
20:20:03 | * | sz0 joined #nim |
20:20:51 | * | Sembei quit (Remote host closed the connection) |
20:40:41 | ForumUpdaterBot | New thread by User71383: Error: Closure iterators are not supported by JS backend!, see https://forum.nim-lang.org/t/7523 |
20:49:45 | * | fosred joined #nim |
20:59:22 | * | haxscramper quit (Remote host closed the connection) |
21:00:56 | * | fosred quit (Quit: Leaving) |
21:03:29 | * | fosred joined #nim |
21:04:21 | * | fosred quit (Client Quit) |
21:10:36 | * | vsantana_1 joined #nim |
21:12:05 | * | fosred joined #nim |
21:12:55 | * | narimiran quit (Ping timeout: 265 seconds) |
21:14:33 | * | vsantana quit (Ping timeout: 272 seconds) |
21:23:49 | * | vsantana_1 quit (Quit: Leaving) |
21:46:47 | * | fosred quit (Quit: Leaving) |
21:51:11 | FromDiscord | <xCFF> trying force the comparison operator for strings `==` to be time independent for managing sessions. Figured the move was to use use == and then at compile time use a term rewriting macro to swap out a == b with secure_cmp(a,b). How do you use quote to iteate over all pairs of string literals being compared? |
21:54:52 | ForumUpdaterBot | New thread by Mantielero: Strange memory problem, see https://forum.nim-lang.org/t/7524 |
22:05:32 | * | jess joined #nim |
22:06:30 | FromDiscord | <mratsim> In reply to @xCFF "trying force the": use a distinct type: https://github.com/mratsim/constantine/blob/master/constantine/arithmetic/limbs.nim#L125-L131 |
22:07:53 | FromDiscord | <mratsim> here are my primitives to enforce constant-time: https://github.com/mratsim/constantine/blob/master/constantine/primitives/constant_time.nim and the types: https://github.com/mratsim/constantine/blob/master/constantine/primitives/constant_time_types.nim#L9-L34 |
22:08:19 | FromDiscord | <xCFF> holy shit what an amazing library |
22:08:23 | FromDiscord | <xCFF> how have i not seen this |
22:08:33 | FromDiscord | <mratsim> and the high level types I use: https://github.com/mratsim/constantine/blob/master/constantine/config/common.nim#L20-L37 |
22:09:01 | FromDiscord | <xCFF> goddamn! pairing based crypto for nim!!? |
22:09:05 | FromDiscord | <mratsim> and if you're bored of programming, you can read on my collection of constant-time failures: https://github.com/mratsim/constantine/wiki/Constant-time-arithmetics |
22:09:06 | FromDiscord | <xCFF> 🥳 |
22:09:29 | FromDiscord | <mratsim> state of the art speed as well: https://hackmd.io/@zkteam/eccbench#BLS12-381 |
22:09:57 | FromDiscord | <mratsim> note that since the benchmarks were done perf has improved by about 35%-50% on pairings and towerings. |
22:10:15 | FromDiscord | <mratsim> there was a parameter passing bug in Nim that forced a copy :/ |
22:10:39 | FromDiscord | <mratsim> And yes, pairing based crypto for Nim is in good shape |
22:11:04 | FromDiscord | <xCFF> you absolute wizard, sage reference code + nim 😍 |
22:11:04 | FromDiscord | <mratsim> some people at Status (my company and Nim biggest sponsor) are exploring zero knowledge proofs: https://github.com/status-im/nescience |
22:11:35 | FromDiscord | <mratsim> I'm researching polynomial commitment as well: https://github.com/mratsim/constantine/tree/master/research/kzg_poly_commit |
22:12:04 | FromDiscord | <mratsim> In reply to @xCFF "you absolute wizard, sage": The sage code is generating Nim code 😉 |
22:12:44 | FromDiscord | <mratsim> For scalar multiplication acceleration based on lattice decomposition for example: https://github.com/mratsim/constantine/blob/master/constantine/curves/bls12_381_glv.nim#L37-L63 |
22:13:51 | FromDiscord | <xCFF> different application, but are you guys planning on adding support for ed25519? |
22:14:33 | FromDiscord | <mratsim> It's personal lib now because we are using another one in prod that is being formally verified as we speek. |
22:14:38 | FromDiscord | <mratsim> (edit) "speek." => "speak." |
22:14:52 | FromDiscord | <mratsim> I'm interested in palying around with Ristretto and Bulletproof |
22:15:25 | FromDiscord | <mratsim> but Curve25519 is already there, hidden: https://github.com/mratsim/constantine/blob/master/constantine/config/curves_declaration.nim#L111-L113 |
22:15:50 | FromDiscord | <mratsim> (edit) "palying" => "playing" |
22:16:52 | FromDiscord | <mratsim> You can open an issue with the protocols or primitives you need, I can see if I can get some hacky PoC out. |
22:18:04 | FromDiscord | <mratsim> My main issue right now is likely that all curves I implemented are short weierstrass curves so I would need to implement the Edwars formula |
22:18:18 | FromDiscord | <mratsim> that said in other Nim packages you can lift the following: |
22:18:52 | FromDiscord | <mratsim> - https://github.com/status-im/nim-libp2p/blob/master/libp2p/crypto/curve25519.nim↵- https://github.com/status-im/nim-libp2p/blob/master/libp2p/crypto/ed25519/ed25519.nim↵↵This was audited by NCC |
22:19:53 | FromDiscord | <mratsim> (edit) "Edwars formula" => "Edwards formulae" |
22:21:10 | FromDiscord | <mratsim> example report: https://github.com/status-im/nim-libp2p/issues/297 |
22:22:48 | FromDiscord | <mratsim> In reply to @xCFF "different application, but are": got to sleep but if you have questions about cryptography in Nim feel free, I guess we can occupy the #science channel a bit for that. |
22:27:12 | * | filcuc_ quit (Ping timeout: 272 seconds) |
22:47:38 | FromGitter | <deech> I haven't pushed it too hard yet but that `matching` library from `fusion` is really freaking cool. A fun thing to add might be limited exhaustiveness checking; it would be really hard with all supported matching expressions but for simple variant/seq matches it should be possible. |
22:50:08 | FromDiscord | <zetashift> I'm about to play with it too, it looked so good, haxscramper documentated it so well |
22:51:01 | FromGitter | <deech> Yep, really fun to read. |
22:53:03 | FromGitter | <deech> Is `fusion` supposed to be stable-ish? |
22:53:19 | FromDiscord | <ElegantBeef> It's supposed to be stdlib-ish 😄 |
22:55:03 | * | vivus joined #nim |
22:55:18 | * | tane quit (Quit: Leaving) |
23:41:59 | krux02 | disruptek |
23:42:08 | krux02 | sorry |
23:42:21 | krux02 | I wanted to search for that name here not write it. |
23:42:29 | krux02 | Can't delete a message on IRC |
23:42:39 | krux02 | disruptek |
23:42:40 | FromDiscord | <zetashift> Does `newSeq` always need an initial length passed through? I'm getting `RangeDefect` when using `var foo = newSeq[Option[Cell]]()` but for example `var foo = newSeq[Option[Cell]](2)` works fine |
23:42:48 | krux02 | args :( |
23:43:07 | FromDiscord | <zetashift> Maybe easier to search through the online irclogs? |
23:43:14 | krux02 | yea probably |
23:50:00 | leorize[m] | @zetashift newSeq don't need an initial length |
23:50:21 | * | vivus quit (Quit: Leaving) |
23:50:27 | leorize[m] | can you make a reproducible sample of this RangeDefect bug? |
23:59:08 | FromDiscord | <dk> any rules of thumb on when to split things into multiple modules? |