00:12:00 | FromDiscord | <eyecon> In reply to @ripluke "Does Nim have an": Therapist: https://maxgrenderjones.bitbucket.io/therapist/latest/therapist.html |
00:13:07 | FromDiscord | <eyecon> I'm very happy with it |
00:19:14 | * | ltriant quit (Ping timeout: 246 seconds) |
00:19:23 | FromDiscord | <m4ul3r> Therapist looks good. I'll have to try it out too |
00:20:41 | FromDiscord | <ripluke> In reply to @eyecon "Therapist: https://maxgrenderjones.bitbucket.io/the": Woah |
00:30:34 | noeontheend | Wow, I've always been very happy with nim-argparse, but that looks nifty |
00:33:15 | * | \u is now known as meowray |
00:33:36 | * | meowray quit (Changing host) |
00:33:36 | * | meowray joined #nim |
00:38:07 | FromDiscord | <retkid> so |
00:38:32 | FromDiscord | <retkid> in prologue im trying to statically share a file |
00:38:33 | FromDiscord | <retkid> (edit) "file" => "folder" |
00:38:35 | FromDiscord | <retkid> im doing it |
00:38:44 | FromDiscord | <retkid> however when i try and connect everything 404s |
00:39:22 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=40PU |
00:39:28 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/990053580172062720/unknown.png |
00:39:40 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/990053630281412628/unknown.png |
00:39:41 | FromDiscord | <Not Saucx> can someone join general? i wanna ask questions about NIM |
00:40:07 | FromDiscord | <Not Saucx> (edit) "NIM" => "No," |
00:40:10 | FromDiscord | <Not Saucx> (edit) "No," => "Nim" |
00:42:07 | FromDiscord | <retkid> ah |
00:42:14 | FromDiscord | <retkid> they're being hosted /public/ |
00:42:15 | FromDiscord | <retkid> (edit) "/public/" => "/public/" |
00:42:20 | FromDiscord | <retkid> but thats kinda stupid as shit |
00:43:46 | FromDiscord | <huantian> I mean that's normal |
00:43:59 | FromDiscord | <huantian> iirc django hosts static files at /static/ or something |
00:44:25 | FromDiscord | <retkid> but now i need to figure out what middleware i write so I can make it so all GET requests for non routed pages get redirected |
00:44:25 | FromDiscord | <huantian> you should probably use something else for your static files anyways |
00:53:39 | * | TakinOver quit (Ping timeout: 268 seconds) |
01:00:02 | FromDiscord | <retkid> i just |
01:00:18 | FromDiscord | <retkid> need to add redirects for every single file in /public |
01:00:20 | FromDiscord | <retkid> (edit) "/public" => "/public/\" |
01:00:21 | FromDiscord | <retkid> (edit) "/public/\" => "/public/" |
01:12:22 | * | TakinOver joined #nim |
01:13:54 | * | lnxw37 joined #nim |
01:13:59 | * | lnxw37 quit (Read error: Connection reset by peer) |
01:14:22 | * | lnxw37 joined #nim |
01:16:38 | * | TakinOver quit (Ping timeout: 246 seconds) |
01:21:05 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Q2 |
01:21:10 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/990064070097006612/unknown.png |
01:21:16 | FromDiscord | <Not Saucx> each file is supposed to have a .csv ending |
01:23:13 | * | noeontheend quit (Ping timeout: 256 seconds) |
01:24:36 | FromDiscord | <Rika> You’re writing a line with the content of the string you gave it? |
01:24:52 | FromDiscord | <Not Saucx> In reply to @Rika "You’re writing a line": yeah |
01:25:00 | FromDiscord | <Not Saucx> it basically reads a file i input |
01:25:09 | FromDiscord | <Rika> I mean the file content is the one with the CSV |
01:25:14 | FromDiscord | <Rika> CSV thing I mean |
01:25:23 | FromDiscord | <Not Saucx> oh no its a txt |
01:25:26 | FromDiscord | <Not Saucx> i input a txt |
01:25:27 | FromDiscord | <Rika> Open it |
01:25:30 | FromDiscord | <Not Saucx> and it just comes out as file |
01:25:43 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/990065215695622154/unknown.png |
01:25:51 | FromDiscord | <Rika> The files you made I mean |
01:26:05 | FromDiscord | <Not Saucx> In reply to @Rika "The files you made": https://media.discordapp.net/attachments/371759389889003532/990065310323326996/unknown.png |
01:26:11 | FromDiscord | <Rika> Open them |
01:26:20 | FromDiscord | <Not Saucx> ahh i see |
01:26:20 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/990065373867044944/unknown.png |
01:26:34 | FromDiscord | <Rika> That’s the thing you have “csv” added onto |
01:27:03 | FromDiscord | <Rika> I assume you meant to put it on the first argument, not the second argument |
01:28:21 | FromDiscord | <Not Saucx> In reply to @Rika "I assume you meant": https://media.discordapp.net/attachments/371759389889003532/990065881998577714/unknown.png |
01:29:48 | FromDiscord | <huantian> well if you wanna change the name of the file you're writing to you have to do that when you open the file |
01:33:41 | FromDiscord | <Rika> Oh so you’re not using the procs that open a file then write something in it okay |
01:33:47 | FromDiscord | <Rika> You do it when you open the file yes |
01:41:21 | FromDiscord | <!Patitotective> In reply to @eyecon "Therapist: https://maxgrenderjones.bitbucket.io/the": it looks really really cool↵hope the owner pulishes it on nimble |
02:17:10 | NimEventer | New Nimble package! openurl - Open Any Url/File in the default App / WebBrowser., see https://github.com/foxoman/openurl |
02:17:12 | * | ltriant joined #nim |
02:22:05 | * | ltriant quit (Ping timeout: 246 seconds) |
02:23:49 | FromDiscord | <!Patitotective> In reply to @NimEventer "New Nimble package! openurl": @ElegantBeef they published it first lol |
02:32:41 | * | tiorock joined #nim |
02:32:41 | * | tiorock quit (Changing host) |
02:32:41 | * | tiorock joined #nim |
02:32:41 | * | rockcavera is now known as Guest9015 |
02:32:41 | * | tiorock is now known as rockcavera |
02:33:12 | * | noeontheend joined #nim |
02:35:27 | FromDiscord | <Rika> That embed though |
02:36:38 | * | Guest9015 quit (Ping timeout: 268 seconds) |
02:39:33 | FromDiscord | <!Patitotective> In reply to @Rika "That embed though": yeah.. lol |
02:47:14 | FromDiscord | <Not Saucx> In reply to @Isofruit "*blinks* ... I don't": hey phil |
02:47:15 | FromDiscord | <Not Saucx> so |
02:47:51 | FromDiscord | <Not Saucx> i fixed my problem however nonw im trying to figure out how to keep the first line of the original file, and add them to all the new files |
02:47:59 | FromDiscord | <Not Saucx> (edit) "i fixed my problem however nonw im trying to figure out how to keep the first line of the original file, and add them to all the new files ... " added "(as the new file)" |
02:48:06 | FromDiscord | <Not Saucx> (edit) "(as" => "(in" |
03:02:24 | * | arkurious quit (Quit: Leaving) |
03:03:07 | * | ltriant joined #nim |
03:10:08 | * | ltriant quit (Ping timeout: 255 seconds) |
03:13:11 | FromDiscord | <!Patitotective> see https://nim-lang.org/docs/io.html#open%2Cstring%2CFileMode%2Cint↵`FileMode.fmAppend` |
03:33:14 | * | ltriant joined #nim |
03:40:48 | * | rockcavera quit (Remote host closed the connection) |
03:41:16 | * | Figworm joined #nim |
03:43:00 | * | Figworm quit (Client Quit) |
05:09:23 | * | noeontheend quit (Ping timeout: 255 seconds) |
05:19:03 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=40Qt |
05:20:26 | FromDiscord | <Rika> What did you do? |
05:20:30 | FromDiscord | <Rika> What’s your code |
05:21:25 | FromDiscord | <untoreh> It pops up after a while when I run my server |
05:21:31 | FromDiscord | <untoreh> it spams a lot |
05:23:08 | FromDiscord | <Elegantbeef> somehow it's getting `-1` for `pkey.ident` |
05:35:21 | FromDiscord | <ripluke> How can I see if a url exists? |
05:35:41 | FromDiscord | <ripluke> Like if I returns 404 or not |
05:35:43 | FromDiscord | <Elegantbeef> Send a request and if you get a response it exists |
05:36:09 | FromDiscord | <ripluke> In reply to @Elegantbeef "Send a request and": What library can I use for that |
05:37:54 | FromDiscord | <Elegantbeef> std/httpclient |
05:38:00 | FromDiscord | <ripluke> Oh ok |
05:39:31 | FromDiscord | <untoreh> In reply to @Elegantbeef "somehow it's getting `-1`": maybe has to do with resource limits on file descriptors |
05:41:08 | FromDiscord | <Elegantbeef> @Prestige\: https://github.com/nim-lang/Nim/pull/19925 dont know if you seen this |
05:53:05 | FromDiscord | <Prestige> oh I haven't, sweet |
06:03:51 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40Qy |
06:04:18 | FromDiscord | <Prestige> Do they not have a rest api? |
06:04:32 | FromDiscord | <ripluke> i have no idea lol |
06:05:28 | FromDiscord | <ripluke> i usually only write and push PKGBUILD so i dont know too much about the aur |
06:05:31 | FromDiscord | <Prestige> Wow it looks like they don't |
06:05:38 | FromDiscord | <ripluke> oh rip |
06:12:26 | FromDiscord | <Prestige> https://gitlab.archlinux.org/archlinux/aurweb/-/blob/master/doc/rpc.txt |
06:12:32 | FromDiscord | <Elegantbeef> You need a `defer: file.close` in there |
06:12:38 | FromDiscord | <Elegantbeef> sorry `client.close` |
06:20:02 | FromDiscord | <huantian> You might wanna do a HEAD instead of a GET |
06:41:25 | FromDiscord | <ripluke> In reply to @huantian "You might wanna do": Oh lol |
06:43:35 | FromDiscord | <ripluke> I hate when I accidentally reference a function as a variable |
06:43:41 | FromDiscord | <ripluke> The my code has errors |
06:43:48 | FromDiscord | <ripluke> (edit) "The" => "Then" |
06:44:07 | FromDiscord | <ripluke> I try rewiting the whole thing |
06:44:15 | FromDiscord | <ripluke> (edit) |
06:47:45 | FromDiscord | <ambient> should i be using testament or nimble for testing? |
06:48:16 | FromDiscord | <Elegantbeef> `nimble test` just compiles and runs all files that start with `t` in `tests/` |
06:48:28 | FromDiscord | <ambient> oh ok |
06:50:01 | FromDiscord | <ambient> apparently there's also "testes" and "balls" testing frameworks |
06:50:30 | FromDiscord | <Elegantbeef> balls is testes |
06:50:44 | FromDiscord | <ambient> oh, so it is |
06:52:51 | FromDiscord | <ripluke> In reply to @ambient "apparently there's also "testes"": Nice name tho |
07:01:26 | FromDiscord | <ambient> it's surprisingly easy to quickly read Nim projects and understand what's going on. |
07:01:39 | FromDiscord | <ambient> or maybe I just haven't looked at any super large projects |
07:01:54 | FromDiscord | <huantian> Balls is a pretty nice testing framework, can recommend |
07:02:06 | FromDiscord | <huantian> I think to some extent it will depend on the project as always |
07:03:08 | FromDiscord | <Elegantbeef> Depends on the author of course but there is some overlap with good code and using Nim 😄 |
07:03:43 | FromDiscord | <xflywind> testament is gold for intergrated tests. There is also a fork of unittest => https://github.com/status-im/nim-unittest2 |
07:03:43 | FromDiscord | <ambient> my code is horrible but I seem to be able to express what I want with minimal extraneous gunk |
07:08:58 | FromDiscord | <Phil> In reply to @Not Saucx "i fixed my": Yo, responding when Rika and Patito offer to help might lead to you not having to wait until I'm awake for a response 😉↵Generally it's recommended to post your current version of the code if it's shortish (which it likely is still, right? like 20-30 lines of code?)↵You can post it on https://play.nim-lang.org/ , press "share to ix" and post the link here |
07:10:00 | FromDiscord | <Phil> In reply to @flywind "testament is gold for": Does testament have the ability to spin up a docker container as part of a test? Would've loved to actually write tests for tinypool for mysql without having to spin up a local mysql instance and figure out with which credentials to connect to it |
07:10:42 | FromDiscord | <Elegantbeef> If i understand the problem just read/write the first line then write all the lines from the other file |
07:12:19 | FromDiscord | <Phil> In reply to @Elegantbeef "If i understand the": Yeh, should overall be easy, though I've got 2 approaches in my head that I'm not sure on if they'd work.↵Does nim have something like "zip" where you iterate over 2 seqs at the same time? This is purely about the syntax, I know I could achieve the same by iterating over a range of indices and accessing both seqs in that loop |
07:12:37 | FromDiscord | <huantian> Sequtils should have zip |
07:12:45 | FromDiscord | <Elegantbeef> No it doesnt have what you'd want |
07:12:55 | FromDiscord | <Elegantbeef> Why do you need zip? |
07:13:03 | FromDiscord | <Phil> It does? one sec, I must've missed that then on my last read |
07:13:25 | FromDiscord | <Phil> Huh, yeah, at the very end |
07:13:35 | FromDiscord | <huantian> In reply to @Elegantbeef "Why do you need": He needs to make more extra copies of sequences! |
07:13:39 | FromDiscord | <Phil> I need to skim over sequtils more thoroughly |
07:13:39 | FromDiscord | <Elegantbeef> I mean i'd never suggest using it if you're iterating |
07:14:15 | FromDiscord | <Phil> I like the syntax is mostly my response there |
07:14:28 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L287-L290 |
07:16:32 | FromDiscord | <Phil> Neat!↵Might go over my bits where I use sequtils in ~30 files and replace them with slicerator equivalents |
07:16:53 | FromDiscord | <Elegantbeef> There is also zerofunctional and itertools |
07:17:06 | FromDiscord | <Phil> 90% of my usecases are map and filter eitherway |
07:17:24 | FromDiscord | <Phil> make that 90% using "map" and the other 10% using filter |
07:17:49 | FromDiscord | <Elegantbeef> https://github.com/beef331/slicerator/blob/master/src/chainimpl.nim#L88-L95 if you have chained functional operations |
07:18:10 | FromDiscord | <Elegantbeef> It's not much cleaner than the manual loop method but i still like it |
07:20:38 | * | ltriant quit (Ping timeout: 246 seconds) |
07:22:11 | FromDiscord | <Elegantbeef> I dont know if it's my small procedural mind but i think in Nim the best way to handle FP related things is to use for loop macros and iterators |
07:23:54 | FromDiscord | <Phil> I tend to not think too much about it since in my usecase the size of seqs I'm dealing with measures mostly at 1-20 and rarely goes above that. I have a couple rare cases that go up to 500 but that is a campaign having 500 different characters of note, we cracked the 200 mark after around 3 years or so. |
07:24:10 | FromDiscord | <Phil> So my performance constraints won't ever be sequences and their manipulations but how well I can reduce the amount of DB queries I do |
07:24:39 | FromDiscord | <Phil> (edit) "characters" => "dungeons and dragons-characters" |
07:24:54 | FromDiscord | <Phil> (edit) "note," => "note (as in NPCs)," |
07:25:18 | FromDiscord | <Elegantbeef> Yea but it's all about being performant without effort! 😛 |
07:25:44 | FromDiscord | <Phil> Very fair! It's basically free ~~real estate~~ performance |
07:26:07 | FromDiscord | <ambient> so what i gather here is that iterating with zip does a copy? |
07:26:12 | FromDiscord | <ambient> that's a little disappointing |
07:26:31 | FromDiscord | <Phil> I think everything in sequtils copies like no tomorrow is what I gathered the last couple times I talked about it |
07:26:36 | FromDiscord | <Elegantbeef> Yes |
07:27:00 | FromDiscord | <Elegantbeef> It has to since Nim doesnt have iterator -\> closure in the stdlib |
07:27:26 | FromDiscord | <Elegantbeef> My `asClosure` is the bestest tool that should be in Nim 😄 |
07:27:43 | FromDiscord | <ambient> oh man, time to revisit all my foldl parts 🥲 |
07:28:08 | FromDiscord | <ambient> i hope it's inplace |
07:28:09 | FromDiscord | <Elegantbeef> I mean if you're iterating foldls you're allocating new collections then iterating them 😄 |
07:28:41 | FromDiscord | <Elegantbeef> Actually i dont know what foldl does |
07:29:13 | FromDiscord | <Elegantbeef> Oh it's a accumulator applied ontop of a collection |
07:29:25 | FromDiscord | <Elegantbeef> Yea that's going to copy ever single time 😄 |
07:29:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40QN |
07:30:42 | FromDiscord | <Elegantbeef> It really should be↵`concatenation = foldl(words, a.add b)` |
07:30:51 | FromDiscord | <Phil> Hmm if I wanted to submit tinypool for any "this month in nim" stuff, who do I bother? |
07:31:00 | FromDiscord | <Elegantbeef> Technically me |
07:31:12 | FromDiscord | <Elegantbeef> https://github.com/beef331/website/issues/new?assignees=beef331&labels=&template=this-month-with-nim.md&title= |
07:31:16 | FromDiscord | <Prestige> tinypool? |
07:31:48 | FromDiscord | <Elegantbeef> Hmm i think github now has proper forums, who wants to PR that for me 😛 |
07:31:52 | FromDiscord | <Elegantbeef> forms\ rather |
07:31:57 | FromDiscord | <Phil> In reply to @Avahe "tinypool?": I mini package. Basically a global variable seq with a lock for thread safe access that stores db connections from db_sqlite/db_postgres/db_mysql |
07:32:02 | FromDiscord | <Phil> (edit) "I" => "A" |
07:32:22 | FromDiscord | <Elegantbeef> Is it a generic type? |
07:32:36 | FromDiscord | <Phil> Nope, couldn't quite figure that one out |
07:32:50 | FromDiscord | <Elegantbeef> Tuples |
07:33:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40QO |
07:33:45 | FromDiscord | <Phil> I basically made a core package that handles 90% of it generically, then made explicit variations for each of the connection types for explicitly typed public procs |
07:34:09 | FromDiscord | <Elegantbeef> Guess it doesnt need `active` since the `O(1)` deletion method can be used |
07:34:15 | FromDiscord | <Elegantbeef> And i forgot the lock that guards those variables |
07:35:17 | FromDiscord | <Phil> sent a long message, see http://ix.io/40QP |
07:36:03 | FromDiscord | <Elegantbeef> Why can those procedures not be built ontop of a pool type? |
07:36:37 | FromDiscord | <Phil> IIRC the main reason I ran into with a generic pool was an issue with templates that I could not be bothered to figure out |
07:36:45 | FromDiscord | <Phil> Let me scrounge it up again |
07:36:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40QQ |
07:37:02 | FromDiscord | <Elegantbeef> I mean you'll of course need to build ontop of this primitive |
07:38:02 | FromDiscord | <Elegantbeef> But this is a primitive type afaict it just needs to have accessors to `pop` entries and destroy entries |
07:38:16 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40QR |
07:38:18 | FromDiscord | <Elegantbeef> I guess it should be `T: ref or ptr` |
07:38:43 | FromDiscord | <Elegantbeef> Why doesnt your `Connection` type close it inside the `=destroy`? |
07:38:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40QS |
07:39:27 | FromDiscord | <Elegantbeef> Idk the way i see it a threadsafe pool like this is a primitive that you'd build ontop of with specialization |
07:40:09 | FromDiscord | <Elegantbeef> If you want to have all your connections in a single pool you'd use object variants or OOP afaict |
07:40:47 | FromDiscord | <Elegantbeef> Also your generic parameter doesnt do what you want it to do |
07:41:01 | FromDiscord | <Elegantbeef> `[Connection]` does not force it to be only `Connection` it's a generic parameter name |
07:41:10 | FromDiscord | <Elegantbeef> It'd be like `T: Connection` |
07:41:21 | FromDiscord | <Elegantbeef> It's just confusing to use the type like that |
07:41:23 | FromDiscord | <Phil> It does since:↵`type Connection = db_sqlite.DbConn | db_postgres.DbConn | db_mysql.DbConn` |
07:41:32 | FromDiscord | <Elegantbeef> No it doesnt |
07:41:38 | FromDiscord | <Elegantbeef> It makes a generic parameter named `Connection` |
07:42:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40QT |
07:47:25 | FromDiscord | <Phil> Welp, screw that then >_> |
07:50:33 | FromDiscord | <Phil> Huh, not running into that issue since the final pools that you interact with require the DbConn type |
07:51:02 | FromDiscord | <Phil> literally can't initialize a postgres pool with a "createConnection" proc that does not return db_postgres.DbConn |
07:51:19 | FromDiscord | <ambient> is there a way for a macro to find out which variables are read and which are written in a piece of code? like insert a hook into the compiler, where it does assignment into a variable, or reads from variable |
07:51:55 | * | ehmry quit (Ping timeout: 256 seconds) |
07:51:57 | FromDiscord | <ambient> probably some kind of AST library |
07:52:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40QV |
07:52:36 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=40QU |
07:52:46 | FromDiscord | <Elegantbeef> Phil compile that with orc/arc |
07:53:05 | FromDiscord | <Elegantbeef> That should show how not to depend on the dbconn inside your pool |
07:53:28 | FromDiscord | <Elegantbeef> Though using `ptr` might not work with it |
07:57:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40QX |
08:02:54 | FromDiscord | <Phil> What I'm confused by is the guard pragma as I can't find that anywhere |
08:03:44 | FromDiscord | <Phil> Argh, another experimental feature |
08:11:51 | FromDiscord | <xflywind> In reply to @Isofruit "Argh, another experimental feature": I recommend to read the latest devel docs https://nim-lang.github.io/Nim/manual.html#guards-and-locks It is expermental anymore on devel. Though lock levels are scheduled to be removed. |
08:12:21 | FromDiscord | <xflywind> (edit) "In reply to @Isofruit "Argh, another experimental feature": I recommend to read the latest devel docs https://nim-lang.github.io/Nim/manual.html#guards-and-locks It is ... expermental" added "not" |
08:12:26 | FromDiscord | <xflywind> (edit) "expermental" => "experimental" |
08:21:52 | FromDiscord | <ezquerra> I am a bit surprised to learn that sequtils does so much copying internally. Can’t it be improved in a backwards compatible way? |
08:29:10 | FromDiscord | <demotomohiro> @ezquerra Maybe some of copies are removed or replaced with move by Nim's optimizer. |
08:39:47 | * | crem quit (Quit: WeeChat 3.5) |
08:46:32 | FromDiscord | <Elegantbeef> Closure iterators can reduce the copying↵(@ezquerra) |
08:46:43 | FromDiscord | <Elegantbeef> Nim's iterator implementation is mostly the problem |
08:49:22 | FromDiscord | <Elegantbeef> Say you have `for x in [10, 20 30].filter(it > 30).map(it 20): ...` you cannot write an iterator that works with that |
09:10:44 | FromDiscord | <aMOPel> sent a code paste, see https://play.nim-lang.org/#ix=40Rl |
09:10:56 | FromDiscord | <Elegantbeef> You cannot |
09:12:09 | FromDiscord | <aMOPel> damn. what work around could I use, if I can't change the proc, since it's from a lib |
09:12:27 | FromDiscord | <Elegantbeef> You pass each arg |
09:12:51 | FromDiscord | <aMOPel> but what if I don't know beforehand how many args I'm gonna pass? |
09:12:52 | FromDiscord | <Elegantbeef> I mean you can use a template/macro to wrap it if you want |
09:13:09 | FromDiscord | <Elegantbeef> Nim is statically typed |
09:13:17 | FromDiscord | <Elegantbeef> also `varargs` accepts seq |
09:13:43 | FromDiscord | <Elegantbeef> What is the exact use case here |
09:26:39 | * | ltriant joined #nim |
09:29:24 | FromDiscord | <aMOPel> So I'm using this function: https://norm.nim.town/apidocs/norm/sqlite.html#select%2C%2CT%2Cstring%2Cvarargs%5BDbValue%2CdbValue%5D↵There is no overload with an Openarray instead of the varargs.↵↵The values, that I wanna pass to my query into `params`, are based on conditions. And how many I wanna pass is also based on conditions. So I don't know beforehand how many and what values I want to pass, thus I thought filling a sequence would be |
09:29:44 | FromDiscord | <Elegantbeef> varargs accepts openarray |
09:30:13 | FromDiscord | <aMOPel> And unpacks it? |
09:30:30 | FromDiscord | <Elegantbeef> There is no unpacking |
09:30:33 | FromDiscord | <Elegantbeef> Varargs is taken as an array |
09:30:45 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=40Rr |
09:31:05 | FromDiscord | <Elegantbeef> Varargs is just a syntax over array construction with an optional converter call |
09:32:17 | FromDiscord | <aMOPel> Hm, guess I confused myself. Thank you 👍 |
09:36:34 | FromDiscord | <aMOPel> Oh, I was also thinking about how to do an interface the right way in Nim. ↵With interface I mean a description of procs which can then sort of be instantiated in different ways.↵What I came up with was writing a file with a bunch of forward declarations only and then including it into the instance of the interface. How would you approach this? |
09:38:11 | FromDiscord | <aMOPel> (edit) "including" => "`include`ing" |
09:38:21 | FromDiscord | <Yardanico> https://github.com/yglukhov/iface https://github.com/beef331/traitor |
09:38:31 | FromDiscord | <Yardanico> or just make a object with procs yourself, like std/streams does it |
09:42:13 | FromDiscord | <aMOPel> Very nice, thank you |
09:56:20 | FromDiscord | <ezquerra> In reply to @Elegantbeef "Say you have `for": Why not? And how does slicerator library help in these cases then? |
11:16:31 | * | rockcavera joined #nim |
11:16:31 | * | rockcavera quit (Changing host) |
11:16:31 | * | rockcavera joined #nim |
11:16:36 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=40RR |
11:40:21 | FromDiscord | <Kermithos> sent a long message, see http://ix.io/40RT |
11:40:38 | FromDiscord | <Kermithos> (edit) "http://ix.io/40RT" => "http://ix.io/40RU" |
11:40:47 | FromDiscord | <Kermithos> (edit) "sent a long message, see http://ix.io/40RU" => "In reply to @jan0809 "hey, howd i do": `var test = "abcd"↵echo test[1..2]`↵↵?" |
11:40:59 | FromDiscord | <jan0809> ah ty |
12:20:59 | * | noeontheend joined #nim |
12:31:19 | * | om3ga quit (Read error: Connection reset by peer) |
12:34:02 | * | om3ga joined #nim |
13:00:10 | * | gsalazar quit (Remote host closed the connection) |
13:08:09 | FromDiscord | <andreslowrider> hello 👋; in terms of sending edits to the github wiki is there a procedure for that? |
13:34:47 | FromDiscord | <xflywind> In reply to @andreslowrider "hello 👋; in terms": Hello, the Github wiki is supposed to be free to edit. However rcently someone or groups keeps spamming the wiki, It is restricted to edit now. I will lift the restriction. Feel free to edit it. |
13:34:58 | FromDiscord | <xflywind> (edit) "rcently" => "recently" |
13:36:22 | FromDiscord | <Andreas> @xflywind could you pls send a mail-confirmation to me, i registered at the forum, but did not receive the response with the confirmation-link. thxx. |
13:38:31 | FromDiscord | <xflywind> In reply to @Andreas "<@658563905425244160> could you pls": Sorry I am not a moderator of Nim forum. Please tell <@&371760044473319454> about your nickname. |
13:39:32 | FromDiscord | <xflywind> (edit) "nickname." => "name of your forum account." |
13:39:42 | FromDiscord | <xflywind> (edit) "account." => "account here." |
13:40:24 | FromDiscord | <xflywind> Another way is to leave a message on https://github.com/nim-lang/nimforum/issues/127 |
13:41:22 | FromDiscord | <Yardanico> In reply to @Andreas "<@658563905425244160> could you pls": What's your forum nickname? |
13:41:31 | FromDiscord | <Andreas> <@&371760044473319454> Hi nim-forum-moderator, i recently (10-days ago) registered with the nim-forum. I did not receive a confirmation-mail. Nick is Bosinski |
13:42:06 | FromDiscord | <Andreas> In reply to @Yardanico "What's your forum nickname?": Bosinski mail is @icloud.com |
13:42:23 | FromDiscord | <Yardanico> You don't have to repeat everything twice |
13:42:27 | FromDiscord | <Yardanico> I already confirmed it |
13:45:20 | FromDiscord | <Andreas> In reply to @Yardanico "I already confirmed it": thx, today or earlier - i looked everywhere and can't find it ? |
13:45:49 | * | arkurious joined #nim |
13:46:09 | FromDiscord | <Yardanico> Right now after xflywind pinged moderators and you sent the first message with the nickname |
13:51:29 | FromDiscord | <Andreas> In reply to @Yardanico "Right now after xflywind": thx, seems to be still travelling ... |
13:51:37 | FromDiscord | <Yardanico> ? |
13:52:09 | FromDiscord | <Andreas> In reply to @Yardanico "?": mail did not yet arrive, i'll keep you posted.. |
13:52:11 | FromDiscord | <Yardanico> If you haven't received the mail in the first 10-15 min, it'll probably never arrive |
13:52:16 | FromDiscord | <Yardanico> No need to wait |
13:52:31 | FromDiscord | <Yardanico> It's caused by Nim forum using nim's own mail server |
13:53:00 | FromDiscord | <Andreas> In reply to @Yardanico "It's caused by Nim": did the mail get blocked somewhere in-between ? |
13:53:09 | FromDiscord | <Yardanico> yes, most probably |
13:53:17 | FromDiscord | <Yardanico> or by your mail provider |
13:53:46 | FromDiscord | <Andreas> In reply to @Yardanico "or by your mail": thx for the protection Apple 😉 |
13:57:48 | FromDiscord | <undel> icloud mail has a bad habit of rejecting emails entirely for no good reason |
13:58:12 | FromDiscord | <undel> one time they dropped all emails from namecheap and I couldn't log in |
13:58:59 | FromDiscord | <Andreas> @Yardanico @undel i changed ma mail-addr, would you pls try again.. |
13:59:07 | FromDiscord | <Yardanico> ??? |
13:59:10 | FromDiscord | <Yardanico> try what |
13:59:20 | FromDiscord | <Yardanico> As I said, I already confirmed your account |
13:59:25 | FromDiscord | <Yardanico> I don't understand what else do you need |
14:01:54 | FromDiscord | <Yardanico> Of course I had to reconfirm your account because you changed the email, but I still don't get why you did that |
14:03:12 | FromDiscord | <Andreas> In reply to @Yardanico "Of course I had": i tried to let the CMS send me a passwd-change mail - which never arrived. Thus, maybe my mail-provider eats any mail from the forum. And i want this to work properly.. |
14:03:31 | FromDiscord | <Yardanico> Well, I can't help with that, I don't maintain the forum |
14:03:39 | FromDiscord | <Andreas> (edit) "properly.." => "properly..↵It seems my accout is working now, ty.." |
14:03:54 | FromDiscord | <Yardanico> I don't know why it uses a custom mail server in the first place |
14:17:22 | FromDiscord | <jmgomez> hey guys, when looking at the compiled nim files, Im seeing that the std libs files (i.e stdlib_system.nim.cpp) uses types imported from Cpp, however it doesnt import the headers |
14:18:25 | FromDiscord | <jmgomez> is that the default behaviour? I mean, should it define types imported from c/cpp in them or those types should just be defined where they are used? |
14:18:58 | FromDiscord | <jmgomez> in concrete, it happens with types that has seq[cppType] |
14:49:53 | * | noeontheend quit (Ping timeout: 255 seconds) |
14:59:47 | FromDiscord | <exelotl> Hey so, in fatal.nim there is this line:↵`include "$projectpath/panicoverride"` |
14:59:51 | FromDiscord | <exelotl> https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/lib/system/fatal.nim#L18 |
15:02:59 | FromDiscord | <exelotl> I'm thinking of using a similar pattern in my library (which depends on certain types being generated on the user's side) - but I'm just curious that the ability to use dollar variables in `include` statements doesn't seem to be documented anywhere, nor can I find where the variables themselves are documented |
15:03:17 | FromDiscord | <exelotl> (I thought they were part of the docs for nim.cfg but I can't find those lol) |
15:05:42 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=40Sn |
15:10:32 | FromDiscord | <Not Saucx> hey @exelotl could u help me with something its pretty simple and im new to nim |
15:11:29 | FromDiscord | <exelotl> depends what it is xP |
15:12:43 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Sr |
15:12:59 | FromDiscord | <Not Saucx> (edit) "https://play.nim-lang.org/#ix=40Sr" => "https://paste.rs/N3a" |
15:13:28 | FromDiscord | <Not Saucx> so it looks like this https://media.discordapp.net/attachments/371759389889003532/990273527875797063/unknown.png |
15:13:29 | FromDiscord | <Not Saucx> however |
15:14:08 | FromDiscord | <Not Saucx> i need it to look like this and i dont have the slightest clue https://media.discordapp.net/attachments/371759389889003532/990273697749282826/unknown.png |
15:14:36 | * | ehmry joined #nim |
15:17:47 | FromDiscord | <exelotl> hmm it's kinda hard to make sense of this without seeing the input data |
15:21:23 | FromDiscord | <exelotl> it also looks like you have several pieces of code that are trying to do the same thing |
15:23:28 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=40St |
15:26:42 | FromDiscord | <Not Saucx> In reply to @exelotl "it also looks like": just faking it till i make it |
15:26:55 | FromDiscord | <Not Saucx> In reply to @exelotl "hmm it's kinda hard": https://media.discordapp.net/attachments/371759389889003532/990276914096771112/unknown.png |
15:28:38 | FromDiscord | <exelotl> ah I see, so it's trying to turn a single CSV into several of the same format, but grouped by their first character? |
15:28:48 | FromDiscord | <Not Saucx> In reply to @exelotl "ah I see, so": exactly |
15:33:42 | FromDiscord | <exelotl> working on it, will get back to you in a sec |
15:46:32 | FromDiscord | <exelotl> @Not Saucx OK, here is my feedback: |
15:46:43 | FromDiscord | <exelotl> sent a long message, see http://ix.io/40Sx |
15:48:00 | FromDiscord | <exelotl> (edit) "http://ix.io/40Sx" => "http://ix.io/40Sy" |
15:50:31 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=40SA |
16:03:55 | FromDiscord | <Space Ghost> Some very good and useful feedback from @exelotl above. I want to thank you for a professional response and I learned from your comments. Thank you. |
16:34:19 | FromDiscord | <Stanley-GF (Stanley)> hi |
16:34:25 | FromDiscord | <Stanley-GF (Stanley)> when i'm trying to do https get requests using Puppy it's not working |
16:35:42 | FromDiscord | <!Patitotective> code + error |
16:36:18 | * | wallabra quit (Ping timeout: 240 seconds) |
16:36:33 | FromDiscord | <Stanley-GF (Stanley)> sent a code paste, see https://play.nim-lang.org/#ix=40SG |
16:37:13 | FromDiscord | <Stanley-GF (Stanley)> sent a code paste, see https://play.nim-lang.org/#ix=40SH |
16:39:00 | FromDiscord | <xflywind> How about using libcurl backing on windows? https://github.com/treeform/puppy#always-use-libcurl |
16:40:03 | FromDiscord | <!Patitotective> In reply to @Stanley-GF (Stanley) "Error\: \`\`\`platform.nim(117) ": apparently that error code means that↵> _The server name or address could not be resolved_ |
16:40:52 | FromDiscord | <federico3> anybody familiar with osx wants to help with https://github.com/nim-lang/Nim/pull/19814 ? |
16:41:26 | FromDiscord | <Stanley-GF (Stanley)> Ok fixed thanks |
16:41:52 | FromDiscord | <m4ul3r> In reply to @Stanley-GF (Stanley) "Error\: \`\`\`platform.nim(117) ": Just lookin out for ya, but is that a discord token in the code? If so, you might want to edit that value out |
16:42:22 | FromDiscord | <Stanley-GF (Stanley)> yeah but its ok i changed my password |
16:42:31 | FromDiscord | <Stanley-GF (Stanley)> failed my copy paste |
16:42:57 | FromDiscord | <!Patitotective> does the password affect the discord token? |
16:43:16 | FromDiscord | <m4ul3r> I believe so? |
16:43:35 | FromDiscord | <m4ul3r> (edit) "so?" => "so?↵ediT: yes" |
16:56:06 | * | xet7 joined #nim |
16:58:24 | FromDiscord | <eyecon> I use the forum rarely (with the same nickname, I have 2 messages over there I think), and I just took a look at it and wrote something. However, when looking at my settings, I saw that I was "under moderation". I am apparently effectively shadowbanned for everyone except moderators:↵↵> Your account is under moderation. This is a spam prevention measure. You can write posts but only moderators and admins will see them until your account is |
16:58:38 | FromDiscord | <eyecon> Is this normal? Is it because I am a new user? |
16:58:42 | FromDiscord | <glover> good afternoon everyone |
16:58:47 | FromDiscord | <Phil> cheers |
17:01:21 | FromDiscord | <xflywind> In reply to @eyecon "Is this normal? Is": Yeah new users need moderators' approval to post. |
17:02:24 | FromDiscord | <eyecon> In reply to @flywind "Yeah new users need": Ah, thanks. I occasionally saw the verification conversations but I thought that's only when things go wrong, didn't realize that applied to everyone. |
17:03:02 | FromDiscord | <eyecon> So, how do I get approved? 🙂 |
17:04:11 | FromDiscord | <xflywind> What's your nickname for forum? You can @ Moderators on Discord. |
17:04:28 | FromDiscord | <eyecon> In reply to @flywind "What's your nickname for": `EyeCon` |
17:04:55 | FromDiscord | <xflywind> In reply to @eyecon "`EyeCon`": <@&371760044473319454> |
17:07:02 | FromDiscord | <Yardanico> In reply to @flywind "<@&371760044473319454>": There's no such account |
17:07:38 | FromDiscord | <Yardanico> Ah nvm casing, approved |
17:07:55 | FromDiscord | <eyecon> In reply to @Yardanico "Ah nvm casing, approved": Thanks! |
17:08:06 | FromDiscord | <Yardanico> @eyecon you usually get your account approved when you post and moderators notice it |
17:09:11 | FromDiscord | <eyecon> OK, good to know. Apparently I joined some monts ago but I don't post often |
17:09:21 | FromDiscord | <eyecon> (edit) "monts" => "months" |
18:02:33 | FromDiscord | <!Patitotective> damn, codewars only supports nim 1.0 :/ |
18:03:31 | FromDiscord | <Prestige> Could probably request they add newer versions |
18:03:43 | FromDiscord | <huantian> Yeah it shouldn’t be that hard |
18:03:59 | FromDiscord | <huantian> It’s kinda neat that uh replit uses mic |
18:04:01 | FromDiscord | <huantian> Nix |
18:04:10 | FromDiscord | <huantian> So it’s super easy to update |
18:05:40 | FromDiscord | <!Patitotective> there is already an issue from 3 months ago :/ https://github.com/codewars/runner/issues/174 |
18:06:18 | FromDiscord | <Prestige> I almost feel like opening a new issue `Add Nim 1.6.6` lol |
18:06:28 | FromDiscord | <!Patitotective> yea, im gonna comment that lol |
18:06:53 | FromDiscord | <Prestige> `+1 reaction might help to get this request prioritized.` should get everyone to react for us |
18:07:42 | FromDiscord | <Prestige> lmao you +1'd my message |
18:24:20 | FromDiscord | <jan0809> hey, not sure which channel so ill ask here 🙂↵↵can somebody tell me how the matrix↵-arg is expected to look here(pixie) https://media.discordapp.net/attachments/371759389889003532/990321564073480252/IMG_20220625_202026.jpg |
18:25:43 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=40T6 |
18:27:02 | FromDiscord | <vestel> Do I have to call `NimMain` in every native thread(created using system api)? |
18:31:52 | FromDiscord | <Prestige> What? |
18:46:18 | * | xet7 quit (Read error: Connection reset by peer) |
19:02:28 | * | vilhelmbergsoe joined #nim |
19:03:27 | FromDiscord | <demotomohiro> @jan0809 It seems that matrix comes from this library: https://github.com/treeform/vmath |
19:03:45 | vilhelmbergsoe | how do you do something like "echo arrayofstrings[1..]" in nim? |
19:06:48 | FromDiscord | <demotomohiro> !eval echo [0, 1, 2, 3][1..^1] |
19:06:52 | NimBot | @[1, 2, 3] |
19:10:29 | * | vilhelmbergsoe quit (Quit: WeeChat 3.5) |
19:17:12 | FromDiscord | <jan0809> sent a code paste, see https://play.nim-lang.org/#ix=40Tj |
19:18:12 | FromDiscord | <jan0809> just pasting without any offset (at 0, 0) works just like that |
19:18:59 | FromDiscord | <jan0809> (edit) "https://play.nim-lang.org/#ix=40Tj" => "https://play.nim-lang.org/#ix=40Tk" |
19:25:15 | NimEventer | New thread by Bosinski: Back to the basics (of research) - Concurrent data-structures in 2.0 ?, see https://forum.nim-lang.org/t/9264 |
19:35:13 | FromDiscord | <demotomohiro> In reply to @jan0809 "yeah seems like, but": I think this is what you want to do:↵`image_a.draw(image_b, translate(vec2(x, y)))` |
19:36:17 | FromDiscord | <demotomohiro> `translate` proc returns a matrix that translate to (x, y) |
19:42:06 | FromDiscord | <jan0809> In reply to @demotomohiro "I think this is": yes, exactly that, vec2 was the first thing i tried and translate was whats missing there! tysm ❤️ |
19:52:38 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40Ts |
19:56:30 | * | wallabra joined #nim |
20:20:01 | Amun-Ra | I just find out parseopt is unable to parse short option with value separated by space, hm |
20:22:47 | FromDiscord | <demotomohiro> Terminals treat command line options as separated with space. Did you use ' or " to quote the value containing space? |
20:24:56 | FromDiscord | <Prestige> I think he means like `foo -d 2` doesn't work, parseopt requires `foo -d:2` iirc |
20:25:07 | FromDiscord | <Prestige> which is odd |
20:25:34 | Amun-Ra | yes |
20:26:12 | Amun-Ra | well, time to make my own, getopt compatible module |
20:28:15 | FromDiscord | <m4ul3r> Look into argparse, it is space delimited and is pretty easy to use |
20:30:50 | Amun-Ra | looks nice, thanks |
20:34:23 | FromDiscord | <Prestige> Oh that's a nice lib |
20:36:02 | FromDiscord | <!Patitotective> time to look into therapist↵https://maxgrenderjones.bitbucket.io/therapist/latest/therapist.html |
20:37:20 | FromDiscord | <m4ul3r> I took a look at it and it seems like it's no longer maintained? I installed it and it was using a few deprecated procs, although it still works |
20:38:49 | FromDiscord | <!Patitotective> :/ https://media.discordapp.net/attachments/371759389889003532/990355405358121060/unknown.png |
20:40:32 | FromDiscord | <eyecon> It... does what it's supposed to do |
20:41:44 | FromDiscord | <!Patitotective> this PR never was reviewed :/ https://bitbucket.org/maxgrenderjones/therapist/pull-requests/5 |
20:42:10 | FromDiscord | <m4ul3r> It does what it needs to do until the procs get fully depreciated |
20:42:26 | FromDiscord | <!Patitotective> i mean, 4 months without even commenting on the PR :/ |
20:43:08 | FromDiscord | <Elegantbeef> But but it doesnt have a commit in the future |
20:43:31 | FromDiscord | <!Patitotective> 🤨 |
20:44:55 | FromDiscord | <Elegantbeef> The thing you need to be cognisant about is there is no license t hat i see |
20:45:16 | FromDiscord | <eyecon> In reply to @Elegantbeef "The thing you need": I was just about to comment on that |
20:46:08 | FromDiscord | <eyecon> So we can fork if the author agrees and applies a suitable license, if he's not going to do any more development |
20:46:45 | FromDiscord | <Elegantbeef> The nimble file has `MIT` but yea |
20:49:26 | FromDiscord | <SirOlaf> Is there a stdlib function to search in strings that aren't null-terminated |
20:49:58 | FromDiscord | <SirOlaf> strutils.find seems to use strstr |
20:50:15 | FromDiscord | <Elegantbeef> nim-v? |
20:50:38 | FromDiscord | <SirOlaf> Am on git hash b41226001ce596fe520fd326a302c6f4e91c2504 |
20:50:48 | FromDiscord | <Elegantbeef> Is that devel? |
20:50:57 | FromDiscord | <SirOlaf> It's some sort of devel, not most recent |
20:51:00 | FromDiscord | <SirOlaf> Did find change recently? |
20:51:19 | FromDiscord | <Elegantbeef> IIRC that usage was removed |
20:51:27 | FromDiscord | <Elegantbeef> And it was backported, but i might be wrong |
20:52:57 | FromDiscord | <SirOlaf> It was changed 15 months ago |
20:53:01 | FromDiscord | <!Patitotective> https://bitbucket.org/maxgrenderjones/therapist/issues/4/abandonded :] |
20:54:19 | FromDiscord | <SirOlaf> So rfind and find have different behavior not just because of direction but because rfind allows null |
20:54:28 | FromDiscord | <SirOlaf> Epic |
20:54:53 | FromDiscord | <Elegantbeef> Might just be a case of writing your own then since it seems 1.6.6 still has the cstring optimization |
20:55:15 | FromDiscord | <SirOlaf> No I'll just switch to rfind I guess |
20:55:23 | FromDiscord | <SirOlaf> Same thing in my usecase |
20:56:05 | FromDiscord | <Elegantbeef> cause apparently 10 loc is too many? 😄 |
20:56:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40TD |
20:56:21 | FromDiscord | <SirOlaf> The pain |
20:56:28 | FromDiscord | <Elegantbeef> Shit line 4 should be `-1` |
20:56:36 | FromDiscord | <Elegantbeef> well `result = -1` |
20:57:24 | FromDiscord | <SirOlaf> Hm guess that's fine for now, thanks |
20:57:31 | FromDiscord | <SirOlaf> Docs should probably mention that null is not accepted though |
20:57:49 | FromDiscord | <Elegantbeef> It shouldnt use cstrstrt |
20:57:56 | FromDiscord | <Not Saucx> -+ |
20:59:24 | FromDiscord | <SirOlaf> Also can't use count because that uses find 😼 |
20:59:40 | FromDiscord | <SirOlaf> Time to copy and paste that too |
21:02:34 | FromDiscord | <Elegantbeef> Yea welcome to "i thought it was a good idea" design 😄 |
21:04:02 | FromDiscord | <SirOlaf> Actually can work around this using SkipTable it seems |
21:04:17 | FromDiscord | <SirOlaf> Not for count though |
21:05:28 | FromDiscord | <SirOlaf> Gonna open an issue |
21:05:47 | FromDiscord | <Elegantbeef> Yea relying on C functions for strings is always suspect with pascal strings |
21:05:58 | FromDiscord | <SirOlaf> Someone already made one https://github.com/nim-lang/Nim/issues/19500 |
21:07:47 | FromDiscord | <Elegantbeef> Ah there is a PR it just wasnt merged |
21:07:49 | FromDiscord | <Elegantbeef> See i'm not crazy! |
21:08:16 | FromDiscord | <SirOlaf> Well it would be cool if it had been merged in two months |
21:10:03 | FromDiscord | <Elegantbeef> Indeed |
21:10:07 | FromDiscord | <Elegantbeef> Bump it! |
21:11:27 | FromDiscord | <Elegantbeef> Does cstrstr use SIMD or something? I dont get how it's an optimization |
21:13:37 | FromDiscord | <SirOlaf> Will tell you if I can find the implementation |
21:14:17 | FromDiscord | <Elegantbeef> cstrstr is the C stdlib's strstr |
21:18:52 | FromDiscord | <SirOlaf> https://github.com/bminor/glibc/blob/master/string/strstr.c |
21:18:55 | FromDiscord | <SirOlaf> Yeah this is pretty wild |
21:19:59 | FromDiscord | <xflywind> Wasn't it a severe regression? I cannot understand why let optimization affect correctness. |
21:20:13 | FromDiscord | <Elegantbeef> It's a massive regression |
21:20:37 | FromDiscord | <Elegantbeef> It disregards the existence of pascal strings which is what everyone uses, and people often use string as a binary buffer |
21:21:50 | FromDiscord | <xflywind> Maybe bumping the issue with new usecases helps. |
21:22:36 | FromDiscord | <Tuatarian> how can relatively normal/weaker programmers contribute to nim development? |
21:23:03 | FromDiscord | <Tuatarian> I'd like to help but I don't really have the technical ability or understanding to be able to contribute useful things to the compiler I don't think |
21:24:15 | FromDiscord | <xflywind> I started to contribute to Nim by fixing typos, add testcase and examlples. |
21:24:34 | FromDiscord | <xflywind> See also https://dev.to/xflywind/best-ways-to-make-your-first-contribution-to-nim-language-4ml2 |
21:24:35 | FromDiscord | <Tuatarian> that's a good idea, making improvements in docs |
21:24:49 | FromDiscord | <SirOlaf> For compiler itself you need like a month of pure free time to understand anything |
21:25:37 | FromDiscord | <Tuatarian> yeah I can't quite justify committing that much time |
21:25:53 | FromDiscord | <Tuatarian> if you look at commits to the nim repo araq has like 6k and next is dom96 with <1k |
21:26:11 | FromDiscord | <Tuatarian> which is kind of hilarious to me for some reason |
21:26:22 | FromDiscord | <xflywind> You can also remove deprecated code/modules, for instance implicit cstring conversion gives warnings on devel. Remove them to get rid of warnings. |
21:26:46 | FromDiscord | <xflywind> take over https://github.com/nim-lang/Nim/pull/19488 for instance |
21:26:51 | FromDiscord | <Elegantbeef> Impatiently waits for it to be turned into an error |
21:27:23 | FromDiscord | <Tuatarian> I think for it to be an error we would want something `$$` for cstring conversion |
21:27:28 | FromDiscord | <Elegantbeef> Actually it shouldnt do anything, so we dont have the `openarray[char]` `cstring` |
21:27:29 | FromDiscord | <Elegantbeef> No |
21:27:34 | FromDiscord | <Tuatarian> just something to reduce typing |
21:27:35 | FromDiscord | <Elegantbeef> We'd still use `cstring(myString)` |
21:27:40 | FromDiscord | <Elegantbeef> Fuck no |
21:27:46 | FromDiscord | <Tuatarian> too much mental load? |
21:27:48 | FromDiscord | <SirOlaf> Ok this is garbage, maybe I'll just hook find using minhook or something |
21:27:49 | FromDiscord | <xflywind> Some good first issues are relatively easier https://github.com/nim-lang/Nim/labels/good%20first%20issue |
21:28:02 | FromDiscord | <Elegantbeef> It's stupid as hell to use an operator |
21:28:13 | FromDiscord | <Tuatarian> ooh that's a wonderful label @xflywind |
21:28:27 | FromDiscord | <Tuatarian> thank you that's amazingly helpful |
21:28:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40TO |
21:28:53 | FromDiscord | <Elegantbeef> I do not see the benefit in shoehorning operators for things like this |
21:29:09 | FromDiscord | <Tuatarian> that's what I ended up doing for my library but I agree it's not worth making an operator for htis |
21:29:20 | FromDiscord | <Tuatarian> better to use words in general |
21:29:33 | FromDiscord | <Tuatarian> why template and not inline proc? |
21:29:41 | FromDiscord | <Elegantbeef> If your code is using a ton of conversions to cstrings what're you doing |
21:30:03 | FromDiscord | <Elegantbeef> It's a type conversion no reason to have a proc overhead for it |
21:30:07 | FromDiscord | <Tuatarian> using raylib which wants cstring occasionally |
21:30:13 | FromDiscord | <Tuatarian> would inline also introduce overhead? |
21:30:14 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "If your code is": imgui 😀 |
21:30:24 | FromDiscord | <Tuatarian> I thought that was kinda the point |
21:30:29 | FromDiscord | <Elegantbeef> if the inline is actually inlined |
21:30:32 | FromDiscord | <Elegantbeef> It's not always inlined |
21:30:35 | FromDiscord | <Tuatarian> oh what |
21:30:42 | FromDiscord | <Elegantbeef> It's a compiler suggestion it's not forced |
21:30:55 | FromDiscord | <Elegantbeef> The compiler still decides if it's worthwhile |
21:31:02 | FromDiscord | <Tuatarian> so I guess to force inline you just use a template |
21:32:10 | FromDiscord | <xflywind> inline pragmas doesnt work for JS backend. Thats the reason I end up using templates everywhere in my js frameworks. |
21:36:59 | FromDiscord | <jamiepopkin> Can anyone recommend a nim library for the database postgres? I'm spiraling in github repos that aren't well supported. \:( |
21:39:18 | FromDiscord | <m4ul3r> Did the std lib postgres implementation not work for you? |
21:40:48 | FromDiscord | <jamiepopkin> Is that this one https://xzfc.github.io/ndb.nim/v0.19.6/postgres.html |
21:41:38 | FromDiscord | <m4ul3r> Yeah, here's the official doc page that is newer and might have more info https://nim-lang.org/docs/db_postgres.html |
21:43:13 | FromDiscord | <jamiepopkin> Sorry. I'm fairly new to nim. But if it says "std/" Does that mean it's installed by default? |
21:43:55 | FromDiscord | <m4ul3r> Yup, no need to do anything else |
21:44:11 | FromDiscord | <m4ul3r> either `import std/db_postgres` or just `import db_postgres` |
21:44:22 | FromDiscord | <jamiepopkin> Oh fantastic. Thanks so much @m4ul3r \:) |
22:05:32 | FromDiscord | <SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=40U4 |
22:06:19 | FromDiscord | <SirOlaf> Surprised that is possible |
22:06:32 | FromDiscord | <SirOlaf> (edit) "Surprised that is possible ... " added "without breakage" |
22:09:43 | FromDiscord | <Luckayla> Sometimes I forget how low level Nim is that this stuff has to/can be done lol |
22:12:44 | FromDiscord | <Elegantbeef> you know you can just do `cast[pointer](find)`?↵(@SirOlaf) |
22:13:06 | FromDiscord | <Elegantbeef> sorry it's `cast[pointer](proc(a, b: string, c: Natural, d: int)(find))` |
22:13:55 | FromDiscord | <SirOlaf> Neither of those work, but without the proc stuff you get a nice compiler crash |
22:14:26 | FromDiscord | <Elegantbeef> I mean i dont know what create/enableHook does |
22:14:34 | FromDiscord | <SirOlaf> The cast fails I mean |
22:14:41 | FromDiscord | <SirOlaf> As in compiler does not like it |
22:14:53 | FromDiscord | <SirOlaf> Is that actually how you select a type? |
22:15:37 | FromDiscord | <SirOlaf> Reason I did it in this way is because I could not figure out how to select the correct `find` |
22:17:03 | FromDiscord | <Elegantbeef> You should be able to do it without the temp var |
22:17:08 | FromDiscord | <Elegantbeef> But hmmm |
22:17:19 | FromDiscord | <SirOlaf> Well it just does the job of selecting the right one for me |
22:17:30 | FromDiscord | <Elegantbeef> So does `(proc(a, b: string, c: Natural, d: int))(find)` |
22:18:00 | FromDiscord | <SirOlaf> Say's it's ambiguous |
22:19:13 | FromDiscord | <SirOlaf> Is there even a syntax for this |
22:19:43 | FromDiscord | <SirOlaf> Oh wait that is the correct way of doing it |
22:19:46 | FromDiscord | <SirOlaf> Just missing return type |
22:19:55 | FromDiscord | <SirOlaf> Thanks |
22:23:25 | FromDiscord | <Elegantbeef> Cause i'm an idiot |
22:23:26 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=40U6 |
22:23:26 | FromDiscord | <Elegantbeef> Works fine once you remember it has a return type |
22:23:36 | FromDiscord | <Elegantbeef> For what? |
22:24:08 | FromDiscord | <Elegantbeef> Matrix bridge makes me cry |
22:28:29 | FromDiscord | <j-james> is the matrix bridge matrix-appservice-discord? |
22:28:43 | FromDiscord | <Elegantbeef> It's unreliable is what it is |
22:28:45 | FromDiscord | <j-james> i wonder why it's so occasionally laggy |
22:28:58 | FromDiscord | <j-james> but only occasionally |
22:41:29 | FromDiscord | <Elegantbeef> No clue i do want to eventually make my own client/server/bridge 😄 |
23:36:26 | * | wallabra quit (Ping timeout: 246 seconds) |
23:37:53 | FromDiscord | <kevin> is there a good way to get Nim to play well with WinINET? |
23:38:24 | FromDiscord | <kevin> I want to use httpclient on Windows using wininet as the SSL backend, instead of default OpenSSL |
23:38:42 | FromDiscord | <kevin> possible without writing C code and linking that in? |
23:39:07 | FromDiscord | <kevin> (edit) "in?" => "in (or Nim to call Win32 apis)?" |
23:41:05 | FromDiscord | <Elegantbeef> Does treeform's puppy not work for you? |
23:41:23 | FromDiscord | <Elegantbeef> I dont think that the stdlib has a way to drop in your SSL backend |
23:43:22 | FromDiscord | <kevin> hmm, i think this might work |
23:43:31 | FromDiscord | <kevin> https://github.com/treeform/puppy |
23:43:42 | FromDiscord | <kevin> Thanks @ElegantBeef |
23:44:28 | FromDiscord | <kevin> It would be cool to get that supported into the standard library for `net` and `httpclient` but this works for me |
23:44:29 | FromDiscord | <kevin> https://github.com/nim-lang/Nim/issues/14719 |
23:44:40 | FromDiscord | <Elegantbeef> I mean replacing openssl with libressl is the best |
23:44:44 | FromDiscord | <Elegantbeef> or bearssl |
23:45:13 | FromDiscord | <kevin> why even bother with other SSL implementations on Windows? |
23:45:22 | FromDiscord | <Elegantbeef> Single implementation |
23:46:11 | FromDiscord | <kevin> I guess that's fair. Still would be nice to have the option for `net` , `httpclient` `-d:ssl` to use WinInet on Windows |
23:46:29 | FromDiscord | <kevin> means you wouldn't have to bring any additional code w/ your binary |
23:47:10 | FromDiscord | <Elegantbeef> Sure, but bearssl can be statically compiled so it has basically 0 binary size overhead 😄 |
23:47:16 | FromDiscord | <Elegantbeef> Not 0 of course but it's very small |
23:48:18 | FromDiscord | <kevin> that would be very cool as well |
23:49:04 | FromDiscord | <kevin> I love Nim but am put off by how every program that performs a web request on Windows must ship openssl DLLs along side the project |
23:50:08 | FromDiscord | <kevin> OpenSSL is also huge as well which isn't great |
23:50:15 | FromDiscord | <kevin> If I wanted 6MB binaries I'd just use Go 😂 |
23:56:11 | FromDiscord | <Elegantbeef> Well https://github.com/status-im/nim-bearssl exists so have at 'er 😄 |