<< 16-07-2022 >>

00:10:33*noeontheend joined #nim
00:12:11FromDiscord<Dale> Do any of you guys use the language server? I can't get it to compile
00:12:21FromDiscord<Elegantbeef> Which one
00:12:26FromDiscord<Elegantbeef> Nimlsp or nimlangserver
00:12:36FromDiscord<Dale> https://github.com/nim-lang/langserver
00:12:53FromDiscord<Elegantbeef> You probably need to use the devel compiler for that right now
00:13:03FromDiscord<Dale> I tried changing the visx to use the lsp one but it doesn't seem to work
00:13:42FromDiscord<Elegantbeef> There hasnt been a 1.6.x update that contains the required PR yet
00:13:49FromDiscord<Dale> Ah
00:13:52FromDiscord<Elegantbeef> 1.7.x will have it
00:14:12FromDiscord<Elegantbeef> I have used both LSPs and they both do indeed work
00:14:19FromDiscord<Elegantbeef> But i dont use vscode
00:18:41FromDiscord<Dale> I guess I'll stick to using nimsuggest and look into it some other time
00:19:10FromDiscord<Dale> It's just a bit odd that you have to save to get it to parse
00:19:38FromDiscord<Generic> you don't have to
00:21:15FromDiscord<Dale> I don't get any error/warnings without saving
00:21:34FromDiscord<Generic> that has nothing to do with language server vs nimsuggest
00:21:48FromDiscord<Dale> Oh
00:22:26FromDiscord<Generic> by default (and for best results) this is done with nim check which is just invoking the compiler with no outputting stages
00:22:46FromDiscord<Generic> and that would be too slow to do this while typing
00:22:51FromDiscord<Generic> atleast in larger projects
00:24:24FromDiscord<Dale> I knew that much. I thought I was missing something, there's a video I was watching earlier and the gent was using vim and it was linting as he typed
00:25:18FromDiscord<Generic> well theoretically the plugin could continously invoke nim check/nimsuggest chk while typing, but I don't think it'll hold up in larger projects
00:25:46FromDiscord<Dale> Yeah that'd be terrible
00:26:27FromDiscord<Dale> I'm fine with it running on save anyways, it's technically an upgrade for me since I don't usually use a linter at all haha
00:26:31FromDiscord<Dale> Thanks for the info :)
00:26:52FromDiscord<huantian> You can also enable auto save every 1 second or something
00:27:18FromDiscord<Generic> but the satisfaction of saving progress is half the fun 😄
00:49:12FromDiscord<exelotl> I saved manually for years and then I realised... why am I doing this, I'm straining my fingers hitting Ctrl+S dozens or hundreds of times every day when I could just... not 😅
00:52:21FromDiscord<Dale> I share the satisfaction for saves, haha
00:52:53FromDiscord<Dale> It's so ingrained that I rarely ever think about hitting the keys anymore
01:07:14FromDiscord<Dale> I've been learning about the macros today. Man, they are kinda daunting given that you actually modify the AST
01:07:33FromDiscord<Elegantbeef> Yea but they're supremely powerful
01:07:37FromDiscord<Dale> Mhmm
01:07:59FromDiscord<Elegantbeef> A language without macros means more needs to be done in compiler space which sucks if you ask me
01:08:21FromDiscord<Dale> Well it's a tradeoff, right?
01:08:31FromDiscord<Dale> Zig has zero macros, and for a very good reason
01:08:59FromDiscord<Dale> Something like what nim offers can be used very poorly, making it difficult to understand what's going on
01:09:33FromDiscord<Elegantbeef> Sure, but that's a mild issue if you ask me
01:09:47FromDiscord<Dale> But one of the reasons I chose nim is because it has this, since I was thinking of making a pre-processor for Lua (mostly for the equivalent of `when`), so it does appeal to me
01:10:04FromDiscord<Elegantbeef> I mean you can do so much in macros that'd otherwise require compiler support
01:10:15FromDiscord<Elegantbeef> Take for instance async
01:10:19FromDiscord<Dale> I think it's a rather large issue, I intend to use macros sparingly
01:10:55FromDiscord<Dale> Yeah I've been looking at that stuff today too. Templates too of course. Was surprised to see things like `!=` there
01:11:13FromDiscord<Elegantbeef> Just as unreadable non macro code can exist good macro code can exist to solve the problems that you face more elegantly or with less work
01:11:23FromDiscord<Dale> Precisely!
01:11:56FromDiscord<Elegantbeef> So yes you only should use them when you need them but their existence and the ability to write shitty macros does not discredit them
01:12:38FromDiscord<Dale> One thing I want to do, is make some macros for defining object properties, so I can specify them to serialisable/transient for my game state, and also whether they will appear in an editor. Kinda like UE4 macros if you've ever used it
01:13:10FromDiscord<Elegantbeef> Yea that's something i've looked into
01:13:32FromDiscord<Elegantbeef> Custom pragma on object fields an a generic `serializer` procedure that operates on them
01:13:58FromDiscord<Dale> I imagine I'll need to build a bunch of proc ASTs or something for `serialise` or `getEditorProps` etc
01:14:14FromDiscord<Elegantbeef> I think it's much less complicated than you realize
01:14:24FromDiscord<Elegantbeef> You dont really need a many macros for this
01:14:32FromDiscord<Elegantbeef> generic programming is mostly sufficient
01:14:57FromDiscord<Elegantbeef> Really what you're saying is "I want to implement a generic procedure that can be specialized for specific types"
01:15:06FromDiscord<Elegantbeef> So you dont really need many macros
01:15:18FromDiscord<Dale> Of course :)
01:15:22FromDiscord<Elegantbeef> the most obvious one is of course if you have an object variant you cannot use `fieldPairs`
01:15:51FromDiscord<Elegantbeef> so you'd have to use something like `disruptek/assume`'s `typeit`
01:15:56FromDiscord<Dale> I'm not familiar with that, is that an iterator for an object's fields?
01:16:07FromDiscord<Elegantbeef> yes
01:16:16FromDiscord<Elegantbeef> It works on tuples and objects aslong as the object is not an object variant
01:16:53FromDiscord<Dale> Is "variant" a concrete concept?
01:17:07FromDiscord<Elegantbeef> It's nimspeak for tagged union
01:17:12FromDiscord<Dale> AH
01:17:16FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants
01:17:27FromDiscord<Elegantbeef> The fieldPairs presently doesnt work on it sadly, but alas
01:19:19FromDiscord<Dale> I don't think that caveat will present much of an issue for what I want to do
01:21:50*TakinOver quit (Ping timeout: 240 seconds)
01:23:32FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44tB
01:23:37FromDiscord<Elegantbeef> Just to show how simple this can be
01:30:05FromDiscord<Dale> Thanks, that's neat!
01:30:59FromDiscord<Dale> A pragma can't have values associated with it though right? So I'd need a macro if I wanted to specify something like a string size limit, or bounds for a number
01:31:09FromDiscord<Rika> It can
01:31:18FromDiscord<Dale> oh cool!
01:31:31FromDiscord<Rika> {.something: “a value I don’t know”.}
01:31:34FromDiscord<Rika> Like that?
01:32:32FromDiscord<Dale> `{.edit: min: 0 max: 0.}` I don't know if that's valid, but it expresses my intent
01:32:42FromDiscord<Rika> Ah, use a tuple then
01:32:45FromDiscord<Elegantbeef> We can do better
01:32:46FromDiscord<Rika> Or a range since that’s a min max
01:32:56FromDiscord<Elegantbeef> Yep
01:33:02FromDiscord<Rika> {.edit: 0..0.}
01:33:12FromDiscord<Elegantbeef> `template edit(a: Slice){.pragma.}`
01:33:32FromDiscord<Rika> HSlice probably better?
01:33:44FromDiscord<Elegantbeef> Probably not
01:33:54FromDiscord<Rika> I forgot which is homo and which is Herero
01:33:57FromDiscord<Elegantbeef> Since you probably never want to support `"hello"..10`
01:33:57FromDiscord<Rika> Hetero
01:34:09FromDiscord<Elegantbeef> `Slice` is the homogenous
01:34:17FromDiscord<Rika> Okay then that’s what I meant
01:34:39FromDiscord<Elegantbeef> You will need a macro in this case but alas
01:36:33FromDiscord<Generic> you can have pragmas with multiple parameters though
01:38:49FromDiscord<Elegantbeef> Nevermind we can bodge around the `hasCustomPragma` and `getCustomPragma` limitation with an overloaded template
01:43:52FromDiscord<voidwalker> Help. Stuck. So I have this:
01:44:34FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44tD
01:44:49FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44tD" => "https://play.nim-lang.org/#ix=44tE"
01:44:54FromDiscord<voidwalker> `INSERT OR REPLACE INTO title_basics (tconst,titleType,primaryTitle,originalTitle,isAdult,startYear,endYear,runtimeMinutes,genres) VALUES (?,?,?,?,?,?,?,?,?)`
01:45:18FromDiscord<voidwalker> result of echo
01:45:51FromDiscord<Rika> The issue is!
01:45:52FromDiscord<Rika> ?
01:45:54FromDiscord<Rika>
01:46:07FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44tE" => "https://play.nim-lang.org/#ix=44tF"
01:46:10FromDiscord<voidwalker> (edit) "result of ... echo" added "first "
01:46:39FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44tG
01:46:48FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44tG" => "https://play.nim-lang.org/#ix=44tH"
01:47:59FromDiscord<voidwalker> it would appear it errors after binding, when doing tryExec
01:48:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44tI to really get fancy 😛↵(@Dale)
01:48:54FromDiscord<Elegantbeef> Yes that `Slice or array or seq or typedesc[Default]` is a bodge
01:49:13FromDiscord<Elegantbeef> you could have those all be their own names
01:49:16FromDiscord<Elegantbeef> like `editRange` `editColl` `edit`
01:49:31FromDiscord<Elegantbeef> Or a macro that properly resolves them
01:51:30FromDiscord<Dale> Yeah that's a little closer to what I'd create
01:51:37FromDiscord<Dale> These are great examples thoguh, thank you
01:51:43FromDiscord<Dale> (edit) "thoguh," => "though,"
01:51:44FromDiscord<Elegantbeef> No problem
01:52:07FromDiscord<Elegantbeef> You actually can do quite a lot with Nim without writing macros
01:52:16FromDiscord<Elegantbeef> I have a whole toy ECS written that way
01:52:39FromDiscord<Dale> Oh god, I have been debating whether to go with ECS or not recently
01:52:41FromDiscord<Elegantbeef> Well it has a single macro, but other than that it's all just tuples 😄
01:53:45FromDiscord<Dale> I like ECS, but for what I want to make, all I need is the composition stuff, and it's a different enough paradigm that I think it will slow down my progress enough that it would outweigh its benefits
01:53:51FromDiscord<Elegantbeef> It's was a fun exercise, if interested https://github.com/beef331/nimtrest/blob/master/yeacs.nim#L128-L160
01:54:03FromDiscord<Elegantbeef> Depending on your game it's really complicated for not much benefit
01:54:17FromDiscord<Dale> Yeah I'm making mostly platformers
01:54:24FromDiscord<Elegantbeef> 3D or 2D?
01:54:42FromDiscord<Elegantbeef> A rules engine, or EC could be enough for you
01:54:46FromDiscord<Dale> I mean, I will be using some of the concepts for rendering and particles, stuff like that, but for my gameplay logic I don't think I need it
01:54:50FromDiscord<Dale> 2D
01:55:14FromDiscord<Dale> I'm gonna use a hybrid system where you have actors and components, with logic and data in them
01:55:19FromDiscord<Elegantbeef> Yea i mean i indirectly use a kinda ECS like thing but that's just cause i make 2D games that are grid aligned
01:56:47FromDiscord<Dale> Well I want to be able to attach transforms together and I will be doing a lot of collision stuff, which inevitably leads to a lot dereferencing , so there's not much point in using flat arrays
01:58:03FromDiscord<Elegantbeef> Yea if you're not making stupid simple games like me makes sense 😄
01:58:33FromDiscord<Dale> For example, if I have some entity with a collision rect, I would like to use that rect for multiple things - maybe it damages some things but affects other things differently. With ECS I can't think of an efficient way to do that without having separate rects for each one. So I'd need a callback, which is refs, so cache miss, so ECS is pointless
01:59:54FromDiscord<Dale> I do have some ideas for games with large object counts, but again, I can deal with those in their own 'mini-ECS' and stick to the actor<>component model for everything else and develop faster in the more familiar paradigm
01:59:59FromDiscord<Elegantbeef> I mean you could use flags for that
02:00:09FromDiscord<Elegantbeef> Some ECS have a tag system
02:00:18*rockcavera quit (Remote host closed the connection)
02:00:45FromDiscord<Elegantbeef> But i shush about ecs as i've never used one
02:00:51FromDiscord<Dale> I have thought about this, but that means a boatload of additional logic, and if I want to expand the number of ways to react to collisions it doesn't scale well
02:00:54FromDiscord<Elegantbeef> I defer to rlipsc
02:01:05FromDiscord<Dale> I mean, I could be missing something, but I have little experience with hardcore ECS so
02:01:27FromDiscord<Dale> I'll try it out eventually haha
02:02:24FromDiscord<Dale> I watched a GDC lecture by an overwatch dev, and it took them like 3 years to master it, so that affirmed that I should just 'stick to what I know' for now
02:08:06FromDiscord<Elegantbeef> ECS seems to have this weird side effect with gamedevs, a lot of people are like "Must use ECS now"
02:08:25FromDiscord<Elegantbeef> But most of the time it's like "Dude you're making pong"
02:08:35FromDiscord<huantian> What if I need to customize my balls
02:08:47FromDiscord<Dale> That's a great quote
02:08:47FromDiscord<huantian> Or my paddles
02:09:19FromDiscord<Elegantbeef> Cant tell if huan had the good quote or me
02:09:36FromDiscord<Dale> Huan haha
02:09:43FromDiscord<Dale> You are right though
02:10:10FromDiscord<Elegantbeef> No related one bit, but jesus does the gnome screencast not have a way to customize the bitrate
02:10:23FromDiscord<Elegantbeef> I do not need a 300mb file for like a minute of video
02:10:37FromDiscord<huantian> Just ffmpeg it down
02:10:44FromDiscord<Elegantbeef> Lol
02:10:47FromDiscord<Elegantbeef> Oh wait you're serious
02:12:09FromDiscord<huantian> I mean I’m kinda serious
02:12:35FromDiscord<huantian> That’s what I do when I’m too lazy to change the bittate in OBS
02:33:30*noeontheend quit (Ping timeout: 240 seconds)
02:42:20FromDiscord<voidwalker> https://discord.com/channels/371759389889003530/371759389889003532/997680610309066792 any idea?
02:56:33FromDiscord<TryAngle> I haven't seen a single include yet, always used import
02:56:36FromDiscord<TryAngle> what is include?
02:56:47FromDiscord<Elegantbeef> It's copy paste the module at the `include` site
02:56:50FromDiscord<Dale> Think it pastes code directly
02:56:55FromDiscord<Elegantbeef> You pretty much never use it directly
02:56:59FromDiscord<TryAngle> ah I see
02:57:24FromDiscord<Elegantbeef> Include is only for specific cases that like wanting to seperate a module across multiple files
02:58:34FromDiscord<TryAngle> In reply to @Elegantbeef "Include is only for": 🤔
02:58:57FromDiscord<TryAngle> I see so have something like a "mod.rs" like rust does and u include all the other files in that?
02:59:07FromDiscord<Elegantbeef> `include` works just like C's include
02:59:25FromDiscord<TryAngle> I haven't written any multifile c projects in my life
02:59:37FromDiscord<TryAngle> only uni homework
02:59:41FromDiscord<Elegantbeef> you've never `#iinclude`d anything?
02:59:56FromDiscord<TryAngle> sometimes I included .h files
03:00:00FromDiscord<Elegantbeef> The way C's include work is paste the content of the file you include where you call it
03:00:21FromDiscord<TryAngle> ah wait, so u inlcude .h files to not include the full code, only the forward declarations?
03:00:26FromDiscord<TryAngle> is that the point of .h fiels??
03:00:32FromDiscord<Elegantbeef> So if you `#include "myfile.h"` it copies `myfile.h` there
03:00:50FromDiscord<TryAngle> wow finally I understand the point of .h files
03:00:55FromDiscord<TryAngle> not even c fanboys could explain
03:01:04FromDiscord<TryAngle> (edit) "c" => "c/c++"
03:01:05FromDiscord<Elegantbeef> Header files exist to seperate compilation units iirc
03:02:13FromDiscord<Elegantbeef> The funny thing tryangle is it makes a lot more sense when you realise `#include` is just a preprocessor
03:02:44FromDiscord<Elegantbeef> This is also why people heavily use `ifndef`
03:03:07FromDiscord<Elegantbeef> Cause when you're copying and pasting files over and over again you dont want to have multiple declarations of the same code
03:03:12FromDiscord<Dale> Even though C++ has pragma once, I still see people using old school header guards
03:05:42FromDiscord<Elegantbeef> Cant teach an old dog new tricks apparently 😄
03:06:24FromDiscord<Elegantbeef> Dont know how old the once pragma is but maybe it's due to people being used to an older C++
03:07:18FromDiscord<Elegantbeef> To answer this you could↵(@TryAngle)
03:07:26FromDiscord<Elegantbeef> https://github.com/filcuc/nimqml/blob/master/src/nimqml.nim it's what this library does
03:07:45FromDiscord<Elegantbeef> It's not a great way to write code, but depending on what you're working on it might be forced
03:08:20FromDiscord<TryAngle> In reply to @Elegantbeef "Cant teach an old": I mean isn't that the issue with languages like c++?
03:08:57FromDiscord<TryAngle> they become so "bloated" + backwards compatible that the backwards compatiblility will stay the norm and the new features become the "bloat" while being 10x better
03:09:15FromDiscord<Elegantbeef> Kinda, also the whole standard/ multiple compilers slowing down progress
03:09:40FromDiscord<Elegantbeef> Modules were supposed to be amazing but the spec and implementation makes them pretty much useless
03:09:51FromDiscord<TryAngle> for example in java in my shool we still got tought anonymous classes instead of lamdas
03:10:09FromDiscord<TryAngle> I was actually super suprised at my uni we used lamdas and streams in java
03:14:23FromDiscord<TryAngle> I'm already scared of rust's always backwards compatible default
03:14:35FromDiscord<TryAngle> (edit) "compatible default" => "compatibility rule"
03:14:44FromDiscord<Elegantbeef> I mean it's a requirement for major releases
03:15:05FromDiscord<Elegantbeef> You do not want to cause issues for your users unless you have to with major releases
03:15:23FromDiscord<TryAngle> In reply to @Elegantbeef "You do not want": I mean they sitll have to be fully backwards compatible even for major releases
03:15:32FromDiscord<TryAngle> like rust 2015, 2018 and 2021
03:15:43FromDiscord<Elegantbeef> Yea that's mostly dumb
03:18:44FromDiscord<Elegantbeef> Though i guess most things should be the same across major releases so perhaps not
03:31:10*noeontheend joined #nim
04:00:32*arkurious quit (Quit: Leaving)
04:15:27FromDiscord<creikey> anybody know of a way to zero copy a `seq[byte]` into `string`? given that it's seq I can append the null terminator, hoping to avoid the newString
04:15:45FromDiscord<creikey> some kind of `s.add(0)` then cast it into a string
04:15:58FromDiscord<huantian> You can probably just toOpenArray?
04:15:59FromDiscord<creikey> (although the struct for seq is different from string I think)
04:16:09FromDiscord<creikey> In reply to @huantian "You can probably just": openarray requires a copy because it's not assumed there is O(1) append
04:16:12FromDiscord<huantian> Is there one for strings I can never remember
04:16:15FromDiscord<creikey> strings are ull terminated
04:16:16FromDiscord<creikey> (edit) "ull" => "null"
04:16:23FromDiscord<creikey> utf8 seq byte isn't
04:26:03FromDiscord<huantian> Oh I thought that toOpenArray would return a view but I don’t think that would’ve worked anyways
04:34:50FromDiscord<creikey> In reply to @huantian "Oh I thought that": I just cast it back to string like `cast[string](theSeq)` if it has a null terminator, I think it works
04:37:18FromDiscord<Pestillium> sent a code paste, see https://play.nim-lang.org/#ix=44tY
04:38:23FromDiscord<Pestillium> (edit) "https://play.nim-lang.org/#ix=44tY" => "https://play.nim-lang.org/#ix=44tZ"
04:41:13FromDiscord<Elegantbeef> Sadly not↵(@huantian)
04:42:08FromDiscord<Elegantbeef> Aslong as you arent passing it to a procedure that expects a cstring it's a non issue↵(@creikey)
04:42:45FromDiscord<Elegantbeef> the only difference memorywise between `seq[byte]` and `string` is that string actually is `len + 1` which has a `\0` at that +1 index
04:43:31FromDiscord<creikey> In reply to @Elegantbeef "the only difference memorywise": I'm using treeform's ws, and the client I'm connecting with only supports sending byte websocket packets, and he casts a string to seq[byte] before returning it in the read bytes
04:43:37FromDiscord<creikey> so I just cast it back to string because the bytes are utf8
04:49:06FromDiscord<Elegantbeef> Yea like i said as long as the code you use doesnt expect that `\0` `seq[byte]` -\> `string` is a 'safe' cast
05:02:03FromDiscord<creikey> anybody know why nim vscode is always complaining about this async thing? goto definition is always broken https://media.discordapp.net/attachments/371759389889003532/997729806147915827/unknown.png
05:02:31FromDiscord<Elegantbeef> Which extension?
05:03:09FromDiscord<creikey> the most popular one
05:03:20FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997730131248423033/unknown.png
05:03:26FromDiscord<Elegantbeef> Switch to saems
05:03:28FromDiscord<Elegantbeef> Live happy life
05:03:41FromDiscord<creikey> this looks cool
05:03:44FromDiscord<creikey> it's written in nim?
05:03:50FromDiscord<Elegantbeef> Yes
05:04:27FromDiscord<creikey> error is gone but go to definition doesn't work
05:04:36FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997730450430771301/unknown.png
05:05:00FromDiscord<creikey> weird even local variables doesnt work
05:05:16FromDiscord<Elegantbeef> https://github.com/saem/vscode-nim#options you may have to setup `nim.project` if it doesnt understand your project
05:05:43FromDiscord<Elegantbeef> Or if you havent just restart vscode
05:05:47FromDiscord<Elegantbeef> that also might get it to work
05:06:52FromDiscord<creikey> oh interesting does it not recursively search for nimble file
05:07:03FromDiscord<creikey> I think problem might be that the nimble project isn't in the root directory of the folder I opened
05:07:13FromDiscord<Elegantbeef> I imagine not
05:07:22FromDiscord<Elegantbeef> Finding nim projects accurately is a whole ordeal
05:08:00FromDiscord<creikey> why not like git?
05:08:07FromDiscord<creikey> search for first .nimble it sees recursively updwards
05:08:09FromDiscord<creikey> (edit) "updwards" => "upwards"
05:08:10FromDiscord<creikey> from file location
05:08:25FromDiscord<Elegantbeef> PRs welcome is my response
05:08:32FromDiscord<Elegantbeef> I know saem had said it was a bitch to do
05:08:41FromDiscord<creikey> oh dang I'll look into it
05:09:12FromDiscord<Elegantbeef> I think it might be down to a nimsuggest thing
05:09:14FromDiscord<creikey> I'm not sure what this project mapping is
05:09:32FromDiscord<creikey> doesn't seem to be the nimble file
05:09:48FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997731755970797568/unknown.png
05:09:54FromDiscord<creikey> is this supposed to be all the files in the project?
05:10:24FromDiscord<Elegantbeef> It should be your main entry file
05:10:24FromDiscord<Elegantbeef> If you dont have a single entry yes
05:10:53FromDiscord<Elegantbeef> https://github.com/saem/vscode-nim/issues/93#issuecomment-1129486086
05:11:23FromDiscord<creikey> I mean when I try to just run nimsuggest on its own on my terminal it does this https://media.discordapp.net/attachments/371759389889003532/997732151959244870/unknown.png
05:11:38FromDiscord<creikey> after setting project path and reloading twice still doesn't work
05:12:11FromDiscord<creikey> no way https://media.discordapp.net/attachments/371759389889003532/997732356146339930/unknown.png
05:12:50FromDiscord<voidwalker> Error: unhandled exception: error binding param in position 1 [DbError]
05:13:06FromDiscord<creikey> https://github.com/nim-lang/Nim/issues/19713 the same issue I had like three months ago that made my stop using nim for awhile
05:13:12FromDiscord<voidwalker> how do you handle bindParam on a dbsqlite/preparedSql statement ?
05:13:29FromDiscord<voidwalker> it seems that on rebinding, it errors out
05:14:28FromDiscord<voidwalker> do I need to reinitialize it as a var, every time I use bind/exec ?
05:15:12FromDiscord<voidwalker> Oh I think I have to do finalize
05:15:26FromDiscord<voidwalker> https://nim-lang.org/docs/db_sqlite.html#finalize%2CSqlPrepared
05:15:29FromDiscord<voidwalker> 0 words explaining it :\
05:21:42FromDiscord<creikey> yeah nimsuggest is completely broken on my machine beef
05:21:44FromDiscord<creikey> just doesn't start
05:21:54FromDiscord<creikey> this is a clean install of windows 11 new computer
05:21:59FromDiscord<Elegantbeef> Well how the hell was it working a few seconds ago 😄
05:22:16FromDiscord<Elegantbeef> You're on `1.6.6`?
05:22:33FromDiscord<creikey> In reply to @Elegantbeef "Well how the hell": it's not
05:22:37FromDiscord<creikey> it never was
05:22:39FromDiscord<Elegantbeef> It was too
05:22:42FromDiscord<creikey> the checking is done via the compiler
05:22:43FromDiscord<creikey> In reply to @Elegantbeef "It was too": when/
05:22:44FromDiscord<creikey> (edit) "when/" => "when?"
05:22:46FromDiscord<creikey> In reply to @Elegantbeef "You're on `1.6.6`?": yes
05:22:53FromDiscord<creikey> currently cloning nim so I can build nimsuggest with koch
05:23:05FromDiscord<voidwalker> may I suggest you use a real development enviroment, and try a popular linux distro ? :\
05:23:16FromDiscord<Elegantbeef> Lol
05:23:17FromDiscord<creikey> In reply to @voidwalker "may I suggest you": I'm shipping to windows users this is a waste of time
05:23:27FromDiscord<Elegantbeef> you can always use nimlsp + kate 😛
05:23:38FromDiscord<creikey> I just switched to nimlsp and it crashes does not startt
05:23:38FromDiscord<creikey> (edit) "startt" => "start"
05:23:41FromDiscord<creikey> I think because it uses nimsuggest
05:23:45FromDiscord<Elegantbeef> Yea it does
05:23:52FromDiscord<Elegantbeef> Everything uses nimsuggest
05:23:55FromDiscord<voidwalker> VSCodium has been incredibly reliable so far for me on linux.. surprising.
05:23:56FromDiscord<creikey> oh go
05:23:57FromDiscord<creikey> (edit) "go" => "god"
05:24:05FromDiscord<creikey> In reply to @voidwalker "VSCodium has been incredibly": I'm sure it would work fine on linux
05:24:07FromDiscord<creikey> I have no doubt about that
05:24:10*noeontheend quit (Ping timeout: 240 seconds)
05:24:15FromDiscord<creikey> I can use linux I used linux for years
05:24:28FromDiscord<creikey> but that's a waste of time most people are windows users this game is for windows
05:24:39FromDiscord<creikey> you can't debug platform specific windows bugs on linux
05:24:54FromDiscord<voidwalker> Beef, I got a problem with sql prepared statement.. it takes forever now to import to db. Can I use "BGIN"/"Commit" with it ?
05:24:56FromDiscord<Elegantbeef> Meanwhile me just assuming my code works on windows
05:25:04FromDiscord<Elegantbeef> I dont know sql
05:25:56FromDiscord<creikey> do I have to build everything or can I just build nimsuggest?
05:26:07FromDiscord<Elegantbeef> That's not me being humble or coy I have never used sql in my life
05:26:15FromDiscord<creikey> lol https://media.discordapp.net/attachments/371759389889003532/997735896700964904/unknown.png
05:26:37FromDiscord<Elegantbeef> I dont remember how to just build tools
05:26:59FromDiscord<creikey> looks like we're building alll
05:27:01FromDiscord<creikey> (edit) "alll" => "all"
05:27:03FromDiscord<creikey> surely it can't take that long
05:27:16FromDiscord<Elegantbeef> On my xeon1231v3 it takes like 2 minutes without a cache
05:27:26FromDiscord<creikey> that's so fast actually what
05:27:36FromDiscord<creikey> I have a 7nth gen laptop i7
05:27:49FromDiscord<creikey> is the bootstrap compiler generated C?
05:27:51FromDiscord<creikey> or is that banned
05:28:07FromDiscord<Elegantbeef> Bootstrapped is a cherrypicked C source
05:28:29FromDiscord<Elegantbeef> It's of course generated from a bootstrapped compiler
05:28:49FromDiscord<Elegantbeef> The fun compiler paradox
05:29:03FromDiscord<creikey> do people look at the nimsuggest github for issues or is my issue there not going to do anything?
05:29:16FromDiscord<creikey> I know the issue https://media.discordapp.net/attachments/371759389889003532/997736655450554490/unknown.png
05:29:23FromDiscord<creikey> oh my god windows antivirus has to have deleted dlls
05:29:26FromDiscord<creikey> that nimsuggest used
05:29:27FromDiscord<creikey> I knew it
05:29:40FromDiscord<Elegantbeef> I cant remember if nimsuggest issues are supposed to be on that repo or Nim's
05:29:54FromDiscord<Elegantbeef> Using Nim to write a windows game, it's going to go swimmingly 😄
05:29:59FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997736834580885575/unknown.png
05:30:03FromDiscord<creikey> In reply to @Elegantbeef "*Using Nim to write": technically it's not a windows game
05:30:09FromDiscord<creikey> the game is in godot
05:30:11FromDiscord<creikey> this server is in nim
05:30:27FromDiscord<Elegantbeef> So then why are you making the server for windows?
05:30:31FromDiscord<Elegantbeef> Most people run servers on Linux
05:30:39FromDiscord<creikey> In reply to @Elegantbeef "So then why are": I'm making the game and the server at the same time on the same devel machine
05:30:51FromDiscord<Elegantbeef> Ah ok
05:30:59FromDiscord<Elegantbeef> You're using gdscript though eh?
05:31:03FromDiscord<creikey> yeah
05:31:07FromDiscord<creikey> gdscript is great I'm very fast with it
05:31:18FromDiscord<Elegantbeef> Eh i dislike it but that's cause i'm an asshat
05:31:26FromDiscord<creikey> In reply to @Elegantbeef "Eh i dislike it": it's probably not good
05:31:27FromDiscord<Elegantbeef> I'm just a bit confused about the window specific things then
05:31:37FromDiscord<creikey> I would really like one language to do anything like nim
05:31:43FromDiscord<creikey> nim would be great for godot
05:31:52FromDiscord<creikey> but like honestly
05:31:53FromDiscord<Elegantbeef> It's pretty interesting for godot
05:32:02FromDiscord<creikey> godot is so good because to script you don't need to depend on a C toolchain
05:32:13FromDiscord<creikey> it's just like 8 cpp files bundled into the application
05:32:16FromDiscord<Elegantbeef> Bit tedious to use but that aside it's nice to use a proper language for gamedev
05:32:34FromDiscord<creikey> In reply to @creikey "it's just like 8": the interpreter for gdscript
05:32:46FromDiscord<creikey> right now you can download 40 megabytes and program for any godot game on any platform
05:32:47FromDiscord<creikey> very nice
05:32:52FromDiscord<creikey> with nim not so much
05:33:06FromDiscord<creikey> choosenim was completely broken on ubuntu 22.04 for a bit
05:33:09FromDiscord<creikey> needed openssl 1.1
05:33:21FromDiscord<Elegantbeef> I mean sure
05:33:22FromDiscord<creikey> like just because it transpiles to C the toolchain for nim is so complicated
05:33:46FromDiscord<Dale> Complicated?
05:33:52FromDiscord<Elegantbeef> I've honestly never found it that way
05:34:08FromDiscord<creikey> I mean like it automatically is because you don't need 1 compiler to compile a nim program you need 2
05:34:34FromDiscord<creikey> 2 compilers is more complicated than 0 in gdscript's case
05:34:36FromDiscord<Elegantbeef> I mean in theory you could ship zig 😛
05:34:38FromDiscord<Dale> I did `pacman -S nim`, wrote a file, and did `nim c -r file`, can’t get much simpler than that
05:34:40FromDiscord<creikey> gdscript is 0.2 of a compiler
05:35:01FromDiscord<Elegantbeef> Yea i mean you're just talking about the benefits of a scripting langauge
05:35:03FromDiscord<creikey> In reply to @Dale "I did `pacman -S": arch linux is always nice
05:35:14FromDiscord<creikey> In reply to @Elegantbeef "Yea i mean you're": I don't think it needs to be a scripting language I think it just needs to be simple
05:35:15FromDiscord<Elegantbeef> Like this is established feature of scripting languages
05:35:56FromDiscord<creikey> it's possible to make a simple language which compiles to machine code you just have to do a lot more work
05:36:04FromDiscord<creikey> probably not depend on gcc or llvm or anything giant and complicated
05:36:20FromDiscord<Elegantbeef> Now you have a very specific language that's not very portable
05:36:34FromDiscord<creikey> well like it would be if you had team of people and like 5 years
05:36:35FromDiscord<Dale> And probably not very well optimised
05:36:49FromDiscord<Elegantbeef> At that point just compile to wasm and use a wasm runtime
05:36:55FromDiscord<creikey> In reply to @Elegantbeef "At that point just": wasm runtime so complicated
05:36:59FromDiscord<Elegantbeef> Atleast you'd be portable have a small toolchain and fastish
05:37:30FromDiscord<creikey> In reply to @Dale "And probably not very": who cares it would be 10x faster than an interpreted language unoptimized I'd bet
05:38:11FromDiscord<creikey> In reply to @Elegantbeef "Now you have a": yeah it would be lot of work to be portable
05:38:15FromDiscord<creikey> but like 99% of end users are running windows
05:38:18FromDiscord<Dale> I wouldn’t bet. Just being native doesn’t equate to speed
05:38:24FromDiscord<creikey> for games windows x64 for everything else wasm
05:38:31FromDiscord<creikey> (edit) "x64" => "x86"
05:39:03FromDiscord<creikey> In reply to @Dale "I wouldn’t bet. Just": if you're doing string compares and constantly allocating in a scripting interpreter it's so so much slower
05:39:14FromDiscord<Elegantbeef> Adds another "todo" item to his list, a language that compiles to wasm
05:39:16FromDiscord<creikey> I mean I don't know that this is true but it seems like probably
05:39:32FromDiscord<creikey> In reply to @Elegantbeef "*Adds another "todo" item": this language does not exist and probably never will because it's easier to use llvm or something else big
05:39:42FromDiscord<creikey> but look at how much time andrew is putting into upgrading llvm for zig
05:39:48FromDiscord<Elegantbeef> A JIT'd wasm runtime is probably going to be faster than unoptimized code
05:40:07FromDiscord<Dale> Yeah, I was thinking of LuaJIT personally
05:40:14FromDiscord<creikey> I was thinking of python
05:40:17FromDiscord<Elegantbeef> The hell are you talking about, it's an item on my list of things I want to do 😄↵(@creikey)
05:40:29FromDiscord<Dale> Python is slow compared to the other two
05:40:34FromDiscord<creikey> In reply to @Elegantbeef "The hell are you": how hard would it be to remake a nim compiler from scratch in C++ that compiles to windows x86
05:40:45FromDiscord<Elegantbeef> Why C++
05:40:49FromDiscord<creikey> In reply to @Elegantbeef "Why C++": don't have to bootstrap
05:40:54FromDiscord<creikey> maybe nim and you use the transpiled C
05:41:09FromDiscord<creikey> In reply to @Dale "Python is slow compared": yeah and this is arguably also because the interpreter is just not well optimized code
05:41:24FromDiscord<Elegantbeef> I mean you could always just replace `cgen` with `asmgen` 😄
05:42:01FromDiscord<creikey> In reply to @Elegantbeef "I mean you could": honestly not worth it
05:42:16FromDiscord<creikey> I don't know what I'm saying is probably stupid anyways because I've never shipped a compiler or anything like that
05:43:12FromDiscord<Elegantbeef> One could feasibly ship Nim + Zig and setup a config to use that seemlessly and you'd have a fairly portable Nim
05:43:18FromDiscord<Dale> Bob Nystrom (spelling?) has a cool book for that kinda thing
05:44:06FromDiscord<Elegantbeef> But not explicitly needing a C compiler is really a small benefit
05:44:24FromDiscord<creikey> In reply to @Elegantbeef "But not explicitly needing": yeah, it's just caused me problems in the past twice so I'm annoyed
05:44:30FromDiscord<creikey> I am probably a minority nim user
05:44:35FromDiscord<creikey> windows 11
05:44:45FromDiscord<Elegantbeef> Windows is a small userbase for Nim users yes
05:45:19FromDiscord<Elegantbeef> I dont doubt the whole "This is a virus" isnt aiding it's growth
05:45:41FromDiscord<Dale> What’s the reason for that? I find that really odd
05:46:07FromDiscord<Elegantbeef> No clue the exact reason, but I do know there is a sizeable malware community that uses Nim
05:46:17FromDiscord<creikey> In reply to @Dale "What’s the reason for": nim is used in a lot of malware so it's become a keyword blocked by antivirus programs
05:46:21FromDiscord<creikey> nimsuggest in 1.6.0 works
05:46:21FromDiscord<creikey> fine
05:46:24FromDiscord<Elegantbeef> So if they use signature analysis it might hit Nim generated code
05:46:34FromDiscord<creikey> I've added .nimble to excluded list of windows antivirus
05:46:48FromDiscord<Dale> Do people still use antivirus programs these days?
05:46:54FromDiscord<Elegantbeef> Windows forces you to
05:47:02FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997741125173526539/unknown.png
05:47:09FromDiscord<Elegantbeef> Windows defender is on by default and without going into registry you cannot disable it
05:47:19FromDiscord<Elegantbeef> Or atleast you couldnt
05:47:27FromDiscord<creikey> In reply to @creikey "": this error is when a dll used was made by a different compiler or something
05:47:28FromDiscord<Elegantbeef> Is that the from source nimsuggest?\>
05:47:41FromDiscord<creikey> In reply to @Elegantbeef "Is that the from": no just showing that itis' only 1.6.6 not 1.6.0
05:47:43FromDiscord<creikey> 1.6.4 is also broken
05:47:52FromDiscord<creikey> In reply to @creikey "this error is when": what dll does nimsuggest use
05:48:03FromDiscord<Elegantbeef> you have the `.exe` right there
05:48:21FromDiscord<Elegantbeef> Dumpbin that bish
05:48:37FromDiscord<creikey> In reply to @Elegantbeef "you have the `.exe`": ? https://media.discordapp.net/attachments/371759389889003532/997741524647419974/unknown.png
05:48:45FromDiscord<Pestillium> sent a code paste, see https://play.nim-lang.org/#ix=44ue
05:48:49FromDiscord<flywind> I used win11 and kaspersky, didnt encounter antivirus issue anymore. I probably added some paths to the exception though.
05:49:12FromDiscord<Elegantbeef> pestillium you've fallen into a performance trap
05:49:16FromDiscord<Elegantbeef> each `zip` and `map` is allocating a brand new sequence
05:49:38FromDiscord<flywind> (edit) "used" => "use" | "didnt" => "dont"
05:50:14FromDiscord<creikey> how do I build koch? the linked doc page on the nim readme is broken
05:50:19FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997741955343720488/unknown.png
05:50:25FromDiscord<Elegantbeef> It's built with `build_all`
05:50:31FromDiscord<creikey> I ran that and have nim.exe but not coche
05:50:33FromDiscord<creikey> (edit) "coche" => "koch"
05:50:42FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997742050537644132/unknown.png
05:50:51FromDiscord<Elegantbeef> it's not in bin
05:50:53FromDiscord<flywind> nim c koch.nim
05:50:59FromDiscord<creikey> In reply to @flywind "nim c koch.nim": makes so much sense
05:50:59FromDiscord<Elegantbeef> it's in the root of `Nim`
05:51:14FromDiscord<creikey> In reply to @Elegantbeef "it's in the root": ? https://media.discordapp.net/attachments/371759389889003532/997742185283850270/unknown.png
05:51:32FromDiscord<Elegantbeef> I'm trying to figure out what you're after, you have 3 sequences and what is the desired outcome↵(@Pestillium)
05:51:41FromDiscord<creikey> In reply to @flywind "nim c koch.nim": wooo thanks
05:52:21FromDiscord<creikey> I'm so lost https://media.discordapp.net/attachments/371759389889003532/997742467929620490/unknown.png
05:52:29FromDiscord<creikey> I think I'm using the nim not just built by this codebase but from choosenim
05:52:47FromDiscord<Elegantbeef> no you're using the nim built here
05:52:49FromDiscord<creikey> no koch used the nim I just built
05:52:56FromDiscord<Elegantbeef> `bin\nim.exe`
05:52:57FromDiscord<creikey> so the config is broken?
05:53:05FromDiscord<Pestillium> In reply to @Elegantbeef "I'm trying to figure": `zip` the 3 sequences together, sum the elements in each sublist, but the sublists from `zip` are tuples like `((x, y), z)`
05:53:26FromDiscord<creikey> I checked out to version-1-6
05:53:27FromDiscord<Elegantbeef> So you want a sequence with the sum of all 3 elements?
05:53:36FromDiscord<creikey> (edit) "version-1-6" => "version-1-6, this is 1.6.6 right?"
05:55:01FromDiscord<flywind> In reply to @creikey "no koch used the": How about `nim c -o:bin\nimsuggest.exe -d:danger nimsuggest/nimsuggest.nim`?
05:55:44FromDiscord<creikey> In reply to @flywind "How about `nim c": this will use the nim from choosenim
05:55:48FromDiscord<creikey> not just built
05:56:07FromDiscord<creikey> In reply to @flywind "How about `nim c": ? https://media.discordapp.net/attachments/371759389889003532/997743409747988480/unknown.png
05:56:37FromDiscord<creikey> do I open an issue on the nim github for not being able to build choosenim or is this user error
05:56:42FromDiscord<Elegantbeef> This is what i'd do
05:56:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uf
05:56:57FromDiscord<Elegantbeef> Atleast if i understand the goal
05:57:27FromDiscord<flywind> In reply to @creikey "do I open an": Is the Nim source the devel compiler? 1.6.6 is not necessay the compile everything on devel?
05:57:36FromDiscord<flywind> (edit) "the" => "to"
05:57:44FromDiscord<creikey> In reply to @flywind "Is the Nim source": no, I checked out to version-1-6-6
05:57:51FromDiscord<creikey> because choosenim.exe fails to run at all on my machine
05:57:57FromDiscord<creikey> so I wanted to compile from source and see if that one would run
05:59:03FromDiscord<Pestillium> In reply to @Elegantbeef "Atleast if i understand": yeah that works, so I should just about the functional/declarative sequence methods?
05:59:24FromDiscord<Pestillium> (edit) "about" => "avoid" | "methods?" => "methods?e"
05:59:28FromDiscord<Elegantbeef> You only really want to use them in the case you only use them as a single operation
05:59:28FromDiscord<Pestillium> (edit) "methods?e" => "methods?"
05:59:36FromDiscord<flywind> In reply to @creikey "no, I checked out": So you checkout https://github.com/nim-lang/Nim/tree/v1.6.6 ? version-1-6 stilll accepts new pactches.
05:59:41FromDiscord<Elegantbeef> Chaining them is a performance trap
05:59:49FromDiscord<creikey> In reply to @flywind "So you checkout https://github.com/nim-lang/Nim/tre": not the tag the branch
05:59:52FromDiscord<Elegantbeef> There are things like zero functional and itertools which can make your life easier
05:59:53FromDiscord<creikey> I think that's the issue I'm having
06:01:04FromDiscord<creikey> nimsuggest compiled from scratch fails to run too! https://media.discordapp.net/attachments/371759389889003532/997744659638013992/unknown.png
06:01:31FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997744769704927312/unknown.png
06:01:31FromDiscord<Elegantbeef> If you really want to use more FP style code https://github.com/zero-functional/zero-functional is what you're going to want↵(@Pestillium)
06:01:39FromDiscord<Pestillium> In reply to @Elegantbeef "There are things like": zero functional looks like what I want then
06:03:46FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997745337009721365/unknown.png
06:03:54FromDiscord<creikey> it looks like the compiled executable just links to a bunch of dlls that can't be found?
06:04:07FromDiscord<ripluke> https://github.com/Hejsil/zig-clap↵↵Does Nim have something like this?
06:04:18FromDiscord<ripluke> Or do I make it myself?
06:04:28FromDiscord<creikey> why is nimsuggest linking to kernel 32
06:04:30FromDiscord<Elegantbeef> cligen, argparse and so many more
06:04:56FromDiscord<# Luke> In reply to @Elegantbeef "cligen, argparse and so": Argparse is literally killing me
06:05:21FromDiscord<flywind> docopt
06:05:27FromDiscord<# Luke> In reply to @ripluke "Argparse is literally killing": I provide params and it says I doesn't
06:05:34FromDiscord<creikey> In reply to @creikey "why is nimsuggest linking": does anybody know if this is normal?
06:05:41FromDiscord<# Luke> In reply to @flywind "docopt": O.o I’ll check that out
06:05:41FromDiscord<creikey> like is kernel32.dll what you link to even on 64 bit windows
06:05:49FromDiscord<Elegantbeef> Mine doesnt link to kernel32 😛↵(@creikey)
06:05:54*kenran joined #nim
06:05:55*kenran quit (Client Quit)
06:05:55FromDiscord<creikey> In reply to @Elegantbeef "*Mine doesnt link to": I'm sure it doesn't
06:06:11FromDiscord<Elegantbeef> is kernel32 even actually 32bit
06:06:17FromDiscord<Elegantbeef> Or is it backwards compat named
06:06:24FromDiscord<creikey> that's what I'm thinking
06:06:24FromDiscord<creikey> I think this is normal
06:06:30FromDiscord<creikey> I'm walking the dependencies of another working exe
06:06:31FromDiscord<creikey> to see what's different
06:06:35FromDiscord<creikey> ok this dependency walker is just bad
06:07:05FromDiscord<creikey> the problem is pthreads
06:07:09FromDiscord<creikey> that's the difference
06:07:12FromDiscord<flywind> `nim -v`?
06:07:23FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997746251133104190/unknown.png
06:07:36FromDiscord<Elegantbeef> That's not 1.0.6
06:07:40FromDiscord<Elegantbeef> 1.6.6 i mean
06:07:42FromDiscord<creikey> that's the one I just compiled
06:07:48FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997746353193091082/unknown.png
06:07:52FromDiscord<Elegantbeef> Uhh
06:08:04FromDiscord<creikey> here is the one that choosenim installed https://media.discordapp.net/attachments/371759389889003532/997746422390726777/unknown.png
06:08:28FromDiscord<creikey> ok so the reason nimsuggest is failing to launch is because it's linking to libwinpthread-1.DLL
06:08:32FromDiscord<creikey> which I don't think can be found
06:08:50FromDiscord<creikey> ladies and gentlemen we have our solution https://media.discordapp.net/attachments/371759389889003532/997746611235070022/unknown.png
06:08:57FromDiscord<creikey> we'll just use free download
06:08:58FromDiscord<Elegantbeef> Oh god
06:09:38FromDiscord<creikey> I mean I don't see libwinpthreads in the nimble bin
06:09:41FromDiscord<Elegantbeef> Does this mean you dont have mingw in your path?
06:09:49FromDiscord<creikey> In reply to @Elegantbeef "Does this mean you": probably, but shouldn't choosenim do that?
06:09:51FromDiscord<Elegantbeef> `where gcc.exe`
06:09:52FromDiscord<creikey> what should be in my path
06:10:00FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997746905545195621/unknown.png
06:10:01FromDiscord<creikey> the nimble bin is in my path
06:10:05FromDiscord<creikey> but libwinpthreads-1 is not in nimble bin
06:10:23FromDiscord<Elegantbeef> mingw where are you, we have a lot of things to do
06:10:34FromDiscord<creikey> where does choosenim install mingw?
06:10:43FromDiscord<creikey> here https://media.discordapp.net/attachments/371759389889003532/997747084033785998/unknown.png
06:10:49FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997747108461432873/unknown.png
06:10:51FromDiscord<creikey> this is looking suspect
06:11:20FromDiscord<creikey> no libwinpthreads in 1.6.6 toolchain
06:11:35FromDiscord<flywind> It is in my mingw toolchain
06:11:36FromDiscord<creikey> none in 1.6.0 either
06:11:43FromDiscord<creikey> In reply to @flywind "It is in my": where did you check?
06:11:44FromDiscord<creikey> I'm in the bin
06:11:56FromDiscord<creikey> `libwinpthread-1.dll`
06:12:01FromDiscord<Elegantbeef> I think Mingw gets installed in programfiles by default
06:12:10FromDiscord<creikey> no it's in .choosenim I think
06:12:57FromDiscord<flywind> mingw64\bin\libwinpthread-1.dll
06:12:59FromDiscord<creikey> ok I'm analyzing dependencies of the choosenim that works
06:13:06FromDiscord<creikey> In reply to @flywind "mingw64\bin\libwinpthread-1.dll": oh not in 64 but the specific toolchain
06:13:46FromDiscord<creikey> spotted https://media.discordapp.net/attachments/371759389889003532/997747851532714064/unknown.png
06:13:53FromDiscord<creikey> how is choosenim accessing this if it's not in my path?
06:14:07FromDiscord<creikey> ok I have the answer fo rwhy the new nimsuggest is broken
06:14:21FromDiscord<creikey> 1.6.0 nimsuggest - does not link to libwinpthread↵1.6.6 nimsuggest - links to libwinpthread
06:15:03FromDiscord<creikey> it searches in path
06:15:03FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997748178352869496/unknown.png
06:15:13FromDiscord<creikey> can you echo %PATH% flywind?
06:15:41FromDiscord<creikey> choosenim seems like it copies gcc.exe etc into the bin but doesn't copy libraries like libwinpthread-1
06:15:47FromDiscord<creikey> afaik those aren't in my path
06:16:14FromDiscord<flywind> I added mingw64\mingw64\bin myself
06:16:19FromDiscord<creikey> whaat
06:16:26FromDiscord<creikey> In reply to @flywind "I added mingw64\mingw64\bin myself": what's the gcc in the nimble bin then?
06:17:04FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/997748686476017674/unknown.png
06:17:06FromDiscord<creikey> two gccs
06:17:21FromDiscord<creikey> In reply to @flywind "I added mingw64\mingw64\bin myself": nimsuggest works after I do this
06:17:37FromDiscord<creikey> do I open an issue in choosenim to add that to the path?
06:17:42FromDiscord<flywind> no gcc in my .nimble directory
06:17:52FromDiscord<creikey> In reply to @flywind "no gcc in my": do you use choosenim?
06:18:13FromDiscord<flywind> yeah
06:18:27FromDiscord<creikey> how is this possible
06:18:35FromDiscord<flywind> I probably install mingw myself
06:18:47FromDiscord<Phil> Been so long you forgot you did?
06:18:54FromDiscord<flywind> (edit) "I probably install mingw ... myself" added "by"
06:19:23FromDiscord<flywind> Yeah, I don't remeber how I install them especially after it works.
06:19:30FromDiscord<voidwalker> `proc apply[T](s: openArray[T]; op: proc (x: T) {.closure.}) {.inline,↵ effectsOf: op.}↵↵ Same as apply but for a proc that does not return anything and does not mutate s directly`
06:20:06FromDiscord<voidwalker> is there such a proc that simply allows to run a proc, any proc, for each element of the sequence?
06:20:14FromDiscord<creikey> https://github.com/dom96/choosenim/issues/281
06:20:18FromDiscord<creikey> I think this is an open issue
06:21:58FromDiscord<Elegantbeef> void what do you mean exactly
06:22:10FromDiscord<Elegantbeef> You could use `applyIt`
06:22:27FromDiscord<Elegantbeef> `mySeq.applyit(myProcCall(it, arg1, arg2))`
06:22:55FromDiscord<creikey> vscode fully working now
06:23:00FromDiscord<creikey> that was an adventure
06:23:15FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44uh
06:23:36FromDiscord<voidwalker> I don't want to have the same type, I just want to run a proc having the elements as arguments
06:23:53FromDiscord<Elegantbeef> I do not follow
06:24:07FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44ui
06:24:22FromDiscord<Elegantbeef> Yes i know what the template does
06:24:47FromDiscord<voidwalker> for k, val in tsv.row:
06:24:48FromDiscord<voidwalker> sqlQPrepd.bindParam(k+1, importDict[tsv.headers[k]].parseSq(val))
06:25:02FromDiscord<voidwalker> I want to replace this with an applyIt or something
06:26:54FromDiscord<voidwalker> possible?
06:27:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uj
06:27:03FromDiscord<Elegantbeef> I dont know why you want to but you do you
06:27:17FromDiscord<voidwalker> because you can write it one line ? 🙂
06:27:23FromDiscord<voidwalker> I love one liners
06:27:28FromDiscord<Elegantbeef> One liners are horrid
06:27:51FromDiscord<Elegantbeef> Vertical code \> horizontal code
06:27:57FromDiscord<voidwalker> That must mean I am a very unelegant beef
06:28:09FromDiscord<voidwalker> Is your room tidy ?
06:29:21FromDiscord<Elegantbeef> Mostly
06:34:05FromDiscord<potatoxel> diagonal code c\:\:\:\:
06:34:29FromDiscord<Elegantbeef> Uhh
06:34:31FromDiscord<Elegantbeef> Sure
06:34:36FromDiscord<potatoxel> \:D
06:35:01FromDiscord<Elegantbeef> As long as your head is askew and that diagonal is vertical for everyone else
06:35:17FromDiscord<potatoxel> \:o
06:38:11*kots joined #nim
06:39:50*kots left #nim (#nim)
06:44:11FromDiscord<Dale> I’ve been doing some minecraft modding recently and one of the things that I despise the most about java is the amount of function chains
06:45:42FromDiscord<Dale> It makes sense sometimes, but they over-engineer everything to use factories and builders, so you have these massive chains. Often they do get spread out across lines, but it’s still horrible to read
06:46:56*kots joined #nim
06:47:28FromDiscord<creikey> is orc slower or is this propaganda?
06:47:30FromDiscord<Dale> Has anyone made a voxellly block game in nim before?
06:47:52FromDiscord<creikey> In reply to @Dale "Has anyone made a": this sounds like a fun project
06:48:04FromDiscord<creikey> https://github.com/yglukhov/minecraft here's this from 6 years ago
06:48:07FromDiscord<huantian> In reply to @Dale "I’ve been doing some": Minecraft modding is fun but java is kinda like that
06:48:13FromDiscord<Elegantbeef> I made a raymarched renderer in Nim↵(@Dale)
06:48:21FromDiscord<Elegantbeef> raymarched voxel renderer\
06:48:31FromDiscord<Elegantbeef> https://streamable.com/ancd8h
06:49:15FromDiscord<Dale> Haha that’s cool
06:49:28FromDiscord<creikey> In reply to @Elegantbeef "https://streamable.com/ancd8h": awesome
06:49:33FromDiscord<j-james> In reply to @creikey "is orc slower or": orc is broadly significantly faster
06:49:38FromDiscord<j-james> in certain cases it can be slower
06:50:16FromDiscord<Elegantbeef> Didnt we go over this yesterday creikey
06:50:22FromDiscord<creikey> yes I think so
06:50:25FromDiscord<creikey> I was double checking
06:50:37FromDiscord<Elegantbeef> GC's have performance characteristics
06:51:27FromDiscord<creikey> I still don't understand how orc works and I read like 3 things about it
06:51:57FromDiscord<Elegantbeef> Orc is RAII but on destructor it does a conventional GC check on any possible cyclic types
06:52:05FromDiscord<creikey> In reply to @Elegantbeef "Orc is RAII but": I thought this was refc?
06:52:11FromDiscord<Elegantbeef> It's ARC + a cycle breaker
06:52:16FromDiscord<Elegantbeef> No refc is not RAII based
06:52:27FromDiscord<creikey> refc is everything reference count
06:52:40FromDiscord<creikey> wait wait
06:52:47FromDiscord<creikey> how do you do RAII on things allocated like into an array
06:52:49FromDiscord<creikey> in the case of arc
06:52:58FromDiscord<creikey> oh just delete them when the array is deleted
06:53:06FromDiscord<creikey> I feel like if you don't count references it's easy to leak
06:53:08FromDiscord<j-james> i _think_ the certain slower cases for orc are when you have a very large number of objects that you have to attach a reference count to each
06:53:10FromDiscord<Elegantbeef> You decrement the ref counter on deletion
06:53:19FromDiscord<flywind> With scoped destructors, you can use destructora with refc. But seqs, strings are not.
06:53:28FromDiscord<flywind> (edit) "destructora" => "destructors"
06:53:29FromDiscord<creikey> In reply to @Elegantbeef "You decrement the ref": so arc does count references?
06:53:33FromDiscord<Elegantbeef> Then if their ref count is 0 you delete
06:53:35FromDiscord<Elegantbeef> Yes
06:53:37FromDiscord<Dale> Yep it counts
06:53:41FromDiscord<creikey> what's the difference with that and ref
06:53:42FromDiscord<creikey> (edit) "ref" => "refc"
06:53:47FromDiscord<Elegantbeef> Arc is scopep based memory management
06:53:54FromDiscord<creikey> refc is "deferred reference counting"
06:53:57FromDiscord<Elegantbeef> Arc injects the checks in at compile time so is deterministic
06:54:19FromDiscord<creikey> In reply to @Elegantbeef "Arc injects the checks": so there's no program time ref counting:
06:54:20FromDiscord<j-james> In reply to @creikey "so arc does count": arc is reference counting + significant optimizations to not count references whenever possible
06:54:24FromDiscord<creikey> (edit) "program time" => "runtime" | "counting:" => "counting?"
06:54:28FromDiscord<creikey> oh I see
06:54:29FromDiscord<creikey> so arc
06:54:30FromDiscord<creikey> like
06:54:32FromDiscord<creikey> looks at the program
06:54:35FromDiscord<creikey> and doesn't refc ref objects when i tcan
06:54:37FromDiscord<creikey> (edit) "i tcan" => "it can"
06:54:44FromDiscord<creikey> if it can't figure it out it's dynamic
06:54:51FromDiscord<j-james> yup
06:54:51FromDiscord<flywind> refc uses thread local heap allocators while are supports custom allocators.
06:54:57FromDiscord<Elegantbeef> Thanks to movement semantics and cursor↵(@j-james)
06:55:08FromDiscord<flywind> (edit) "are" => "arc"
06:55:12FromDiscord<creikey> so that's why it's so complicated? that sounds really hard
06:55:18FromDiscord<creikey> to analyze the program and decide when to inject a destructor
06:55:18FromDiscord<j-james> In reply to @creikey "and doesn't refc ref": refc is probably not the right term to use here, since it also refers to `--mm:refc`
06:55:35FromDiscord<creikey> In reply to @flywind "refc uses thread local": interesting
06:55:44FromDiscord<creikey> global heap allocator so memory can be used across threads?
06:55:59FromDiscord<Elegantbeef> Yes arc/orc are very good for threaded applications
06:56:02FromDiscord<Dale> I was looking at cursor earlier. Is that like a weak reference?
06:56:08FromDiscord<Elegantbeef> Sorta
06:56:21FromDiscord<Phil> On that note, Yard recently linked a repo of his here showing off mimalloc and how it's apparently a pretty fast allocator
06:56:27FromDiscord<Elegantbeef> It's really just a alias to a reference that doesnt increment the counter
06:56:34FromDiscord<creikey> how does it do this?? https://media.discordapp.net/attachments/371759389889003532/997758625063907408/unknown.png
06:56:38FromDiscord<creikey> this is magic
06:56:57FromDiscord<j-james> In reply to @creikey "to analyze the program": deciding when to inject destructors is easier than move semantics, i think, but i also didn't write the thing 😛
06:57:17FromDiscord<Dale> Hmm, so if I used it like a weak ref, I’d have to nil check before dereferencing?
06:57:20FromDiscord<creikey> In reply to @j-james "deciding when to inject": is it just optimizing out the reference when it's trivially on the stack and not aliased?
06:57:29FromDiscord<Elegantbeef> If you want to↵(@Dale)
06:57:52FromDiscord<Elegantbeef> I dont really know what a weak ref really entails
06:57:56FromDiscord<Elegantbeef> I've never written C++
06:58:40FromDiscord<Dale> They’re good for caches, events, and lists of things that you don’t want to have to manually clear all the time
06:59:02FromDiscord<Dale> Basically cache invalidation
06:59:51FromDiscord<Dale> If you don’t want your cache to prevent the object from being collected , a weak ref is what you want
07:00:16FromDiscord<voidwalker> Thank you for that template Beef. Now I have one little more thing to figure out and I can proceed. On this line `tsv.row.pairs.applyIt sqlQPrepd.bindParam(it[0]+1, importDict[tsv.headers[it[0]]].parseSq(it[1])) ` - how would I selectively pick bindParam or bindNull to run, depending on the value of tsv.row[i] / it[1])
07:01:17FromDiscord<flywind> In reply to @Dale "Hmm, so if I": Yeah => Yeah, they are like weak refs => https://github.com/nim-lang/Nim/pull/20001/files
07:01:25FromDiscord<flywind> (edit) removed "=> Yeah,"
07:01:48FromDiscord<j-james> In reply to @creikey "is it just optimizing": no, as i understand it the compiler tries to prove ownership like in rust - and if it can't, falling back to Rc or Copy instead of failing to compile
07:02:01FromDiscord<voidwalker> wait, I think you can put if statements inside the brackets ?
07:02:09FromDiscord<Phil> Which, my lord does it make life easier
07:02:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uo
07:03:05FromDiscord<voidwalker> 😦
07:03:25FromDiscord<Elegantbeef> Nim has move semantics if you cannot move you copy
07:03:41FromDiscord<Elegantbeef> It proves it in a programmer friendly way
07:04:16FromDiscord<j-james> or reference count with `ref` types
07:04:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44up
07:04:29FromDiscord<Dale> In reply to @flywind "Yeah they are like": Wooo. Kinda like the name cursor too.
07:05:37FromDiscord<Elegantbeef> I guess to be idiomatic rust i should've done `do_something_that_moves` 😛
07:06:20FromDiscord<j-james> i do kind of think a `--finetune/optimize` flag that throws warnings every time you copy/reference would be nice
07:07:17FromDiscord<Elegantbeef> You can enable `--hintAsError[Performance]:on` but it's not great
07:07:55FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44uq
07:08:00FromDiscord<voidwalker> one line in my editor : D
07:08:21FromDiscord<Elegantbeef> Unreadable as hell, i love it
07:08:52*kots quit (Quit: Konversation terminated!)
07:08:53FromDiscord<voidwalker> other people's code has to be readable, not mine
07:09:32FromDiscord<Elegantbeef> \didnt you want contributors for this project? 😄
07:10:19FromDiscord<voidwalker> yes. And now I realize, the template adds 3 lines of code + the 2 empty lines surrounding it. It kind of defeats the purpose at this stage
07:10:35FromDiscord<j-james> go for zero readability and do `from modules import nil`
07:10:59FromDiscord<voidwalker> and slapping if else on the same line is not elegant, and also defeats the purpose
07:11:11FromDiscord<Elegantbeef> I... hate you↵(@j-james)
07:11:27FromDiscord<Elegantbeef> I guess it's time for me to go find my libwayland whip
07:12:16FromDiscord<j-james> another pro tip: if you're going for line length, snake_case adds extra characters
07:13:00FromDiscord<Elegantbeef> Also remember java enterprise conventions
07:13:12FromDiscord<Elegantbeef> If the variable names are atleast 3 full words long it's not enterprise quality
07:14:04FromDiscord<j-james> oh yeah i'm about halfway done getting nim-wayland to build
07:14:27FromDiscord<j-james> i should be able to finish it tomorrow
07:14:45FromDiscord<j-james> got to wake up in six hours though so no time tonight
07:15:27FromDiscord<Elegantbeef> Hey dont give me excuses you're saving me the headache so i should thank you
07:16:15FromDiscord<Phil> In reply to @Elegantbeef "\*didnt you want contributors": I think this line of code works somewhere along the lines of "A line of this a day keeps the contributors away"
07:16:50FromDiscord<Elegantbeef> Yea i think it's equivalent of walking around a town with your pants down asking who wants to go to the bar with you
07:18:10FromDiscord<Phil> At this point there's just morbid curiosity how much more logic he can pack into that line. Will it be able to calculate the last digit of pi? The purpose of life? The amount of hair on Tom Cruise's head? Nobody knows, for nobody understand what it does!
07:18:33FromDiscord<Elegantbeef> Yea sometimes the Nim magic is too inviting
07:18:38FromDiscord<Elegantbeef> This goes to what dale implied earlier
07:19:10FromDiscord<Elegantbeef> Nim metaprogramming is extremely powerful which is scary 😄
07:23:44FromDiscord<Phil> sent a long message, see http://ix.io/44us
07:24:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44ut
07:24:20FromDiscord<Elegantbeef> `seq[Node]`
07:24:29FromDiscord<Phil> Not seq[pointer]?
07:24:42FromDiscord<Elegantbeef> Phil yard ships mimalloc with that repo
07:24:57FromDiscord<Elegantbeef> it's `src/mimalloc/include`
07:26:07FromDiscord<flywind> In reply to @Isofruit "Sidenote, beef you played": We have discussed regarding making mimalloc default if we see enough benefits.
07:26:13FromDiscord<Phil> Ah, so that repo provides it in general. I wasn't sure how to interpret the "Mimalloc in this repository".↵I could read it as "You have to get the software from here or MS" or as "You already have a mimalloc version, if you want this specific one take it from here"
07:26:34FromDiscord<Phil> (edit) "repository".↵I" => "repository"-section.↵I"
07:27:30FromDiscord<Phil> In reply to @flywind "We have discussed regarding": I mean, I assume at this level there's no "right" or "wrong" around allocators, but mostly different strategies that are beneficial in different scenarios, no?
07:28:09FromDiscord<sOkam!> In reply to @Elegantbeef "`seq[Node]`": is `seq[Node](number)` needed? or are they dynamic?
07:28:20FromDiscord<sOkam!> meaning when they are initialized
07:28:27FromDiscord<sOkam!> (edit) "meaning when they are initialized ... " added "in the constructor"
07:28:44FromDiscord<Elegantbeef> `seq` are growable arrays
07:29:03FromDiscord<flywind> In reply to @Isofruit "I mean, I assume": Yeah, now the single-threaded compiler suffers from threads + orc. If mimalloc helps that, it will probably win.
07:29:43FromDiscord<Elegantbeef> I assume mimalloc doesnt hurt portability any?
07:30:02FromDiscord<voidwalker> anyone willing to try if they can enable extension loading for sqlite in nim ? Using this proc: https://github.com/arnetheduck/nim-sqlite3-abi/blob/fda455cfea2df707dde052034411ce63de218453/sqlite3_gen.nim#L5225
07:30:12FromDiscord<voidwalker> I get a linker error when running it
07:30:19FromDiscord<flywind> In reply to @Elegantbeef "I assume mimalloc doesnt": Yeah
07:30:50FromDiscord<Elegantbeef> I guess even if it did someone could just make a patchfile for their obscure compiler/platform
07:30:51FromDiscord<flywind> https://github.com/Araq/araqsgc is using mimalloc too,.
07:31:23FromDiscord<Phil> In reply to @flywind "Yeah, now the single-threaded": If I wanted to use mimalloc for funsies, would I just nimble-install yards mimalloc repo and the flag would magically work?↵Would I need to clone it somewhere special?↵This line: `To compile with Mimalloc, simply add -d:mimalloc to your compilation flags, or uncomment the relevant line in the main.nims file.` confuses me a bit, given that I've never seen anything just "magically" kn
07:31:46FromDiscord<Elegantbeef> You'd need https://github.com/Yardanico/mimalloc_nim/blob/master/src/main.nims
07:32:08FromDiscord<Elegantbeef> So you're best bet is cloning his repo copying `src` and the config to the project you want and going
07:32:11FromDiscord<flywind> true
07:32:16FromDiscord<Phil> Ahhhh, the config file there
07:32:59FromDiscord<flywind> Cloning your repo to that package will be a good option.
07:33:15FromDiscord<Elegantbeef> Hmm how much does it change the binary size?
07:33:25FromDiscord<Elegantbeef> Eh nevermind i'm dumb
07:33:29FromDiscord<Elegantbeef> `-d:useMalloc` would still exist 😄
07:42:22*Jjp137 quit (Ping timeout: 244 seconds)
07:42:41*Jjp137 joined #nim
08:16:00madpropsmy github addon has buttons now https://i.imgur.com/y1XnYCQ.jpg
08:18:07FromDiscord<Elegantbeef> Nice
08:34:19FromDiscord<voidwalker> anyone willing to try if they can enable extension loading for sqlite in nim ? Using this proc: https://github.com/arnetheduck/nim-sqlite3-abi/blob/fda455cfea2df707dde052034411ce63de218453/sqlite3_gen.nim#L5225↵I get a linker error when running it
08:36:43FromDiscord<voidwalker> wait.. don't i need the .c/.h files to wrap a c proc ?
08:38:37*matt_133779 joined #nim
08:39:59FromDiscord<voidwalker> i put sqlite3.c/.h in the progrma dir, and added `{.compile: "sqlite3.c".}` below the proc, as mentioned here: https://forum.nim-lang.org/t/4477
08:40:03FromDiscord<Elegantbeef> As long as the symbols are known by the compile at compile time nope the C compiler is happy
08:40:26*matt_13377 quit (Ping timeout: 255 seconds)
08:40:26*matt_133779 is now known as matt_13377
08:41:06FromDiscord<voidwalker> but now I get an error on the line calling the function: `discard sqlite3_enable_load_extension(dbsql, onoff=1)`
08:41:13FromDiscord<voidwalker> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
08:41:59FromDiscord<voidwalker> ah nvm, it was put before the db initialization
08:42:32FromDiscord<voidwalker> hmm nope, it's after
08:45:27FromDiscord<voidwalker> hah the sqlite.c version on the nim wrapper git was a bit old, got newer one: sqlite-amalgamation-3390100.zip and it does not error
08:48:14FromDiscord<voidwalker> hm nope still errors, I managed to get it to run just one time, putting the function somewhere in the middle of the program code
09:18:36FromDiscord<Dale> Was just looking at the nim extension settings in codium, what is the project file?
09:19:55FromDiscord<Dale> > `nim.project` - optional array of projects file, if nim.project is not defined then all nim files will be used as separate project
09:21:37FromDiscord<Dale> Is it referring to the entrypoint file you pass to the compiler?
09:23:19FromDiscord<Phil> Yep
09:23:58FromDiscord<Dale> Ah, I should probably set that in a workspace config
09:24:19FromDiscord<Phil> That or leave it empty to use the default
10:20:06*genpaku quit (Remote host closed the connection)
10:20:47*genpaku joined #nim
10:57:40FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44uQ
10:57:47FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=44uQ" => "https://paste.rs/E70"
12:42:32FromDiscord<PyryTheBurger> how do i iterate through a seq while every iteration i remove something from it
12:43:41FromDiscord<enthus1ast> i would return a new sequence where you've filtered out all the elements
12:43:56FromDiscord<PyryTheBurger> how
12:44:06FromDiscord<enthus1ast> https://nim-lang.org/docs/sequtils.html#filterIt.t%2Cuntyped%2Cuntyped
12:45:57FromDiscord<PyryTheBurger> but what do you mean by return a new sequence and why do i need to filter?
12:46:39FromDiscord<PyryTheBurger> In reply to @enthus1ast "https://nim-lang.org/docs/sequtils.html#filterIt.t%": ?
12:46:42FromDiscord<enthus1ast> you cannot remove elements from a sequence you currently iterate over
12:46:51FromDiscord<PyryTheBurger> why
12:47:01FromDiscord<enthus1ast> try it, then you see
12:47:25FromDiscord<PyryTheBurger> i know but can you at least send like a code example of how do you mean "return a new seq"
12:49:58FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/d6n
12:52:26FromDiscord<PyryTheBurger> oh so if i filter it returns a new seq
13:00:06FromDiscord<PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=44v8
13:00:41FromDiscord<Phil> correct. For what purpose do you want to remove individual elements?
13:00:55FromDiscord<PyryTheBurger> In reply to @Isofruit "correct. For what purpose": particle system
13:00:57FromDiscord<Phil> Is it "remove all entries that do not satisfy condition X"?
13:02:02FromDiscord<Phil> In reply to @PyryTheBurger "particle system": That's the overarching thing. What's the specific task you wish to achieve by removing individual entries? Remove all entries that do not satisfy condition X? Remove all entries that you have "processed" in a manner?
13:02:27FromDiscord<PyryTheBurger> remove all entries that have a lifeTime of 0
13:03:19FromDiscord<Phil> So you wish to remove entries that do not satisfy condition X (being lifeTime > 0). That's perfect for filter, which will iterate once over your seq and generate a new one without only the entries that satisfy the condition.
13:03:36FromDiscord<PyryTheBurger> yes ecactly
13:04:29FromDiscord<PyryTheBurger> i just have 1 question... is it more performant to do for i in 0..< len(seq) or for thing in seq?
13:04:48FromDiscord<Phil> I'm not sure I understand your question
13:05:29FromDiscord<Phil> Oh, you mean when making your own forloop to iterate over the thing yourself? Why bother with that, filter/filterIt does that for you as enthus1ast wrote
13:05:39FromDiscord<PyryTheBurger> yes yes but
13:06:18FromDiscord<PyryTheBurger> WHEN i wanmt to loop over a seq, should i loop over the lenght or the items in there
13:09:29FromDiscord<enthus1ast> you can find out yourself, just benchmark the different solutions (eg. using benchy)
13:10:27FromDiscord<enthus1ast> i would be quite suprised if there is a difference
13:10:30FromDiscord<Phil> In reply to @PyryTheBurger "WHEN i wanmt to": https://github.com/treeform/benchy↵That makes it pretty simple
13:10:40FromDiscord<Phil> In reply to @enthus1ast "i would be quite": Fascinatingly enough, there is one
13:11:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vd
13:11:36FromDiscord<PyryTheBurger> so lenght is faster right
13:11:46FromDiscord<enthus1ast> have you compiled with all the correct defines?
13:11:55FromDiscord<enthus1ast> -d\:danger -d\:lto
13:11:55FromDiscord<Phil> Actually that's a fair point, let me check
13:12:01FromDiscord<PyryTheBurger> i dont know what defines mean
13:12:09*noeontheend joined #nim
13:12:16FromDiscord<enthus1ast> --gc\:arc
13:12:19FromDiscord<Phil> Nope, forgot that
13:12:23FromDiscord<Phil> And I tend to use orc
13:14:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44ve
13:15:20FromDiscord<Phil> In reply to @PyryTheBurger "i dont know what": It tends to not matter what loop you use. That type of optimization will never be the cause for your program being slow. That's much more likely going to be your algorithm or improper use of a lib at one point.
13:16:18FromDiscord<Phil> In exchange for this miniscule and questionable performance gain, you're giving up on readability, personally for me for a questionable ~1% bump I'd not want to make my code less readable
13:19:10FromDiscord<Phil> In reply to @PyryTheBurger "i dont know what": defines are compiler parameters that you can use to tell the compiler to do sth, e.g. optimize linkage of your individual C files etc.↵A define is a `-d:<Something>` flag, or in its long form `--define:<Something>`
13:26:22Amun-Raor -d=xxx for posix afficionados
13:26:51*arkurious joined #nim
13:30:38FromDiscord<PyryTheBurger> okay
13:52:00FromDiscord<deech> Is there a `flatten` macro/template that concats a bunch of arbitrarily nested seqs `@[ @[...],@[[...]], @[], @[[[[...]]] ]` into a `@[...]`?
14:03:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vm
14:04:05FromDiscord<Phil> Ignore benchy, that's a leftover from previous code in my "playground" project
14:05:27FromDiscord<deech> In reply to @Isofruit "Best I can do": That doesn't work with seq's of different aritites. I'm guessing a template/macro that takes varargs is the only way.
14:05:59FromDiscord<Phil> In reply to @deech "That doesn't work with": That's why it's pretty much the best I can give you
14:07:14FromDiscord<deech> In reply to @Isofruit "That's why it's pretty": I appreciate you taking the time. I was hoping it was a common enough need that there would be something in the standard library.
14:10:25FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=44vo
14:11:22FromDiscord<Rika> In reply to @deech "Is there a `flatten`": You usually can’t make seqs like that though? Unless you have only either “terminates to empty” or “has values at this specific depth”
14:14:12FromDiscord<Require Support> is it impossible to use `when defined(xxx)` in a try/except block? getting weird errors
14:17:48FromDiscord<Require Support> nvm it was an error when using it before a `of "case1":` in a case statement
14:21:14FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=44vt
14:42:05*noeontheend quit (Ping timeout: 260 seconds)
14:42:19FromDiscord<retkid> how can i make a sequence of 1 value of a set size
14:42:41FromDiscord<retkid> i want a seq of 256 for a single string
14:44:45FromDiscord<retkid> eh i just used collect
14:44:58FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/997876503977152522/unknown.png
14:45:03FromDiscord<retkid> we got graphs
14:54:11FromDiscord<deech> What is the best way to generate valid Nim code from a `NimNode`? `repr` works ok for debugging purposes but, eg. when you `repr` a `proc` with a empty body it generates `proc p() =` with the trailing `=`.
14:56:47*noeontheend joined #nim
14:57:59*CyberTailor quit (Ping timeout: 268 seconds)
14:59:23*CyberTailor joined #nim
15:21:47FromDiscord<deech> In reply to @deech "What is the best": I see from https://github.com/nim-lang/Nim/blob/fb5fbf1e087563f0288b8ed684c8dcc1891730b0/tests/macros/tmacrostmt.nim#L41-L45 that `repr` should be producing valid parseable Nim code, so this is a bug.
15:25:45FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44vQ
15:26:27FromDiscord<voidwalker> not really sure how to call sqlite3_load_extension, but the enable_load_extension one looks pretty straightforward..
15:29:09FromDiscord<Phil> In reply to @voidwalker "Hey <@719962937095356507> or": You sure that isn't because prErrMsg is a ref-string, yet has no value associated with it?
15:29:35FromDiscord<Phil> I could see that causing issues during concatenation
15:30:23FromDiscord<voidwalker> I noticed that, but it happens when I try to run either procs
15:30:46FromDiscord<Phil> Also, I think you should enable the ability to load extensions first before actually loading one at a glance
15:30:48FromDiscord<Rika> Are you passing in a null c string
15:31:03FromDiscord<Phil> That is me not having any idea tbh tho
15:31:14FromDiscord<voidwalker> yeah as I said, I get that error running either/both procs
15:31:37FromDiscord<Phil> try to assign that proc to a variable and check if that variable is == nil
15:34:11FromDiscord<Phil> That should rule out any issues on the front that the procs themselves might be nil.↵Further is the libsqlite_zstd.so file in the same dir as where the binary is that you're executing? because with a filename like that it looks to me like it's looking for the file in the CWD
15:34:42FromDiscord<voidwalker> the result of those procs are cint.. what do you mean assignment, like a pointer to it ?
15:35:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vZ
15:36:11FromDiscord<Phil> That should give you proper "false" and a proper typing
15:36:21FromDiscord<Rika> In reply to @Isofruit "That should rule out": Linux does not search in the CWD for dynamic libraries
15:36:39FromDiscord<Phil> Does it look on the PATH?
15:37:13FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w0
15:37:29FromDiscord<Phil> Alright, so you have procs. So while they're being executed they're trying to read from sth being nil at one point
15:37:31FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44w0" => "https://play.nim-lang.org/#ix=44w1"
15:37:42FromDiscord<Phil> Try the same for the other proc just to be sure but I'm 99% convinced it must work
15:38:48FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w2
15:39:41FromDiscord<voidwalker> Wish someone actually cared about this and tried on their comp : P
15:39:56FromDiscord<Rika> I assume most of us are not at their computers
15:40:07FromDiscord<Phil> I am, but I'm not sure what all to import
15:40:17FromDiscord<Phil> The code copy paste is kinda incomplete 😛
15:40:29FromDiscord<Rika> Use a debugger like GDB or something to see where it dies
15:42:07FromDiscord<enthus1ast> https://www.sqlite.org/c3ref/load_extension.html↵↵If an error occurs and pzErrMsg is not 0, then the sqlite3\_load\_extension() interface shall attempt to fill \pzErrMsg with error message text stored in memory obtained from sqlite3\_malloc(). The calling function should free this memory by calling sqlite3\_free().
15:42:26FromDiscord<voidwalker> I think this should be enough
15:42:27FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w4
15:42:41FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44w4" => "https://play.nim-lang.org/#ix=44w5"
15:42:55FromDiscord<Phil> Ah, that one means I'd need an sqlite3.c file
15:43:00FromDiscord<voidwalker> ohh yeah, and the C source code from here: https://sqlite.org/amalgamation.html
15:43:01FromDiscord<Phil> Welp
15:43:18FromDiscord<voidwalker> (edit) "https://sqlite.org/amalgamation.html" => "https://sqlite.org/download.html"
15:45:11FromDiscord<Require Support> how to i know which module uses `pcre64.dll` 🤔
15:45:26FromDiscord<voidwalker> Wish we'd get a free "ping Araq" with that nim book : P
15:48:47Amun-Rait would have been some kind of non-electronic kind of ping
15:48:55Amun-Raa knock rather
15:56:21FromDiscord<enthus1ast> @voidwalker\: try this↵echo dbsql.getAllRows(sql"SELECT sqlite\_compileoption\_used('ENABLE\_LOAD\_EXTENSION');")
15:56:32FromDiscord<enthus1ast> for me it outputs\:↵↵@[@["0"]]
15:56:45FromDiscord<enthus1ast> so i guess its just not compiled with that option
15:58:36FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44w7
15:58:40FromDiscord<enthus1ast> or .so in your case
16:04:45FromDiscord<voidwalker> I get `@[@["0"]]` as well
16:05:23FromDiscord<voidwalker> I wonder if that's just a db specific option that can be enabled, all other hints point to load_extension support begin present
16:06:38FromDiscord<voidwalker> Running `SELECT sqlite_compileoption_used('ENABLE_LOAD_EXTENSION');` in dbeaver, returns me a 1
16:06:49FromDiscord<voidwalker> with that specific database opened
16:07:12FromDiscord<enthus1ast> dbeaver prolly has its own libsqlite3.dll
16:07:17FromDiscord<enthus1ast> .so
16:07:33FromDiscord<enthus1ast> in sqlite the db is just a file
16:07:58FromDiscord<enthus1ast> it depends wether the sqlite3 lib you're using can handle extenstions
16:08:10FromDiscord<voidwalker> ohh
16:08:33FromDiscord<voidwalker> sqlite> SELECT sqlite_compileoption_used('ENABLE_LOAD_EXTENSION');↵0
16:08:45FromDiscord<voidwalker> i get this from sqlite cli
16:08:49FromDiscord<enthus1ast> yeah
16:09:03FromDiscord<enthus1ast> then your systems lib seem not to handle extentions
16:09:38FromDiscord<voidwalker> I am confused :[
16:10:18FromDiscord<voidwalker> .dbconfig yield ` load_extension on`
16:14:12FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=
16:16:15FromDiscord<Phil> Is enable load extension the type of functionality that can be dynamically turned on? I'd assume it must be compiled in
16:23:59FromDiscord<voidwalker> this worked from sqlite cli
16:24:00FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wc
16:26:20FromDiscord<!Patitotective> Guys, Codewars is almost ready to update from Nim v1.0 to v.1.6.6 but it needs to update 96 Katas (exercises)↵So if any of you guys want to help here is the link https://github.com/codewars/content-issues/wiki/List-of-Nim-Kata-to-Update↵❤️
16:28:09FromDiscord<enthus1ast> strange↵(@voidwalker)
16:28:27FromDiscord<voidwalker> I believe that compile option is deprecated
16:28:58FromDiscord<voidwalker> so that means it's on by default, off by option
16:28:59FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=44we" => "https://paste.rs/UHn"
16:29:00FromDiscord<voidwalker> sent a code paste, see https://paste.rs/wv6
16:30:45FromDiscord<voidwalker> glad to see you enthus1ast. Maybe we should contribute this knowledge somewhere in case someone else needs it in the future, once we figure it out
16:35:16FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=
16:39:16FromDiscord<voidwalker> `select load_extension('/home/sgm/igma/libsqlite_zstd.so');` ? :\
16:40:29FromDiscord<enthus1ast> if i try this i get\: ↵Error\: unhandled exception\: not authorized [DbError]
16:42:59FromDiscord<voidwalker> ah yes, that just loads the extension, loading still must be enabled via the C API
16:55:41FromDiscord<enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/997909399773388850/image.png
16:55:50FromDiscord<enthus1ast> mhh, any idea?
16:56:03FromDiscord<Generic> stack corruption
16:57:13FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44wk
16:57:35FromDiscord<enthus1ast> i was playing with the code
16:57:48FromDiscord<carlosri> sent a code paste, see https://play.nim-lang.org/#ix=44wl
16:59:14FromDiscord<Generic> what's the problem?
17:02:59FromDiscord<voidwalker> @carlosri https://nim-lang.org/docs/tut1.html#procedures-forward-declarations - you talking about the code or the forward declaration aspect ?
17:03:14FromDiscord<enthus1ast> @voidwalker\: no idea why it crashes
17:03:20FromDiscord<enthus1ast> or why it corrupts the stack
17:03:20FromDiscord<voidwalker> sigh 😦
17:03:31FromDiscord<voidwalker> aren't we doing something obviously wrong ?
17:03:38FromDiscord<enthus1ast> not even sure what causes stack corruptions
17:03:45FromDiscord<enthus1ast> maybe wrong calling convention?
17:03:46FromDiscord<voidwalker> Like, we supposed to call it with the DbConn varaible ?
17:03:58FromDiscord<voidwalker> which is a PSQlite3
17:04:07FromDiscord<vestel> In reply to @carlosri "Hi, i can understand": You need to return true somewhere
17:04:10FromDiscord<# Luke> In reply to @voidwalker "<@750548803769073695> https://nim-lang.org/docs/tut": Lol that's the only thing I hate about Nim, rust or zig don't have that issue lol
17:04:53FromDiscord<Generic> In reply to @vestel "You need to return": it's already in there in the `n == 1` or `n == 0` branch
17:05:15FromDiscord<vestel> Oh, yes
17:05:28FromDiscord<# Luke> In reply to @vestel "You need to return": Nim doesn't make you explicitly write return
17:05:33FromDiscord<vestel> Then just forward declare both?
17:05:43FromDiscord<Generic> yeah
17:05:58FromDiscord<Generic> I'm super tired so I'm currently thinking in slow motion
17:06:02FromDiscord<# Luke> Why forward declare both?
17:06:10FromDiscord<Generic> yeah you only need to forward declare one
17:06:15FromDiscord<vestel> In reply to @ripluke "Nim doesn't make you": Ik, just didnt saw that if expression bruh
17:06:16FromDiscord<voidwalker> @arnetheduck any chance you're around ?
17:07:28FromDiscord<vestel> Btw why not just `n and 1`?
17:07:45FromDiscord<Generic> to impress their CS prof
17:08:42FromDiscord<Generic> also `n mod 2` is probably more understandable for a lot of people
17:09:55FromDiscord<vestel> In reply to @Generic "also `n mod 2`": Wrong.↵https://www.npmjs.com/package/is-odd
17:10:38FromDiscord<Generic> don't remind me of people not knowing basic builtin operators of the programming language they earn their living with
17:15:00FromDiscord<krisppurg> whenever I have an object with a field that is an enum and echo it, in some cases it can be seen as `0 (invalid data!)` is there a reason to why it says that?
17:21:10*noeontheend quit (Ping timeout: 240 seconds)
17:36:18FromDiscord<# Luke> In reply to @Generic "also `n mod 2`": Yea
17:51:29FromDiscord<voidwalker> don't we have anyone really smart in here, that can figure out how to call sqlite C API ? :\
17:57:43FromDiscord<enthus1ast> What one can try is to compile both, sqlite3 and the extension, I think we call it corretly
18:15:04FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44ww
18:15:20*CyberTailor quit (Remote host closed the connection)
18:16:23FromDiscord<sharpcdf> i havent really used nimscript before
18:16:24*CyberTailor joined #nim
18:22:41*krux02 joined #nim
18:30:56FromDiscord<voidwalker> @enthus1ast no need to compile the extension at this point, since the code fails even when just calling enable_load_extension
18:33:13FromDiscord<voidwalker> Oh wait, I saw you modified the proc declaration to point to the .dll
18:35:04FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wG
18:35:19FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wH
18:35:29FromDiscord<voidwalker> it's working ?
18:47:13FromDiscord<# Luke> So I basically want to implement something that gets the version the cli program at comptime by reading the nimble file
18:47:45FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44wJ
18:49:53FromDiscord<# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44wL
18:53:02FromDiscord<# Luke> Any solution?
18:54:03FromDiscord<voidwalker> sent a code paste, see https://paste.rs/SdK
18:54:16FromDiscord<voidwalker> @enthus1ast so enabling works, loading doesn't
19:03:33*spff joined #nim
19:16:41*krux02 quit (Remote host closed the connection)
19:17:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44wT
19:17:26FromDiscord<sharpcdf> oh ok
19:17:34FromDiscord<sharpcdf> i thought you use `nim` and not `nimble`
19:17:59FromDiscord<Phil> Try it first, typically you define tasks in nimble files, though I've also seen them defined in nims files
19:18:21FromDiscord<sharpcdf> nah it doesnt work, says it needs a .nimble file
19:19:39FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=44wU
19:29:30FromDiscord<Phil> In reply to @lantos "is there a way": What's the output you desire? A seq[proc] ?
19:29:52FromDiscord<lantos> yea
19:29:54FromDiscord<treeform> In reply to @creikey "I'm using treeform's ws,": I cast seq[utin8] to string all the time. Just don't pass them to a c library afterwards.
19:30:20FromDiscord<creikey> In reply to @treeform "I cast seq[utin8] to": ws and jsony are working great together by the way
19:30:26FromDiscord<Phil> In reply to @sharpcdf "nah it doesnt work,": In that case your best bet is likely Yardanico, Rika, Beef or any of the other more experienced folks, I haven't done anything with nimscript itself
19:30:48FromDiscord<treeform> In reply to @creikey "ws and jsony are": great! I am glad to hear it.
19:31:27*krux02 joined #nim
19:31:37FromDiscord<Phil> In reply to @lantos "yea": That will be difficult to do in a useful manner.↵For a seq they'll all need to have the same type. Unless your procs for that object all have the same signature and only differ by name, that means the best you could do is a seq of pointers to those procs.↵But that means you only have pointers, you'll lose all information about what their signature is, with which parameters you need to call them etc. That won'
19:32:47FromDiscord<Phil> maybe you can do some stuff there with macro magic, but I wouldn't bet on it.
19:32:59FromDiscord<Phil> Because this is hitting the wall of static typing
19:33:10FromDiscord<lantos> yeah I was thinking probably a register macro
19:33:58FromDiscord<Phil> For the realms of macros I'm still out. I'm not sure macros can actually get around the "all members of a seq must have the same type" limitation.↵ObjectVariants are the solution for that, but in your case those object variants would be kinda useless
19:35:10FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=44wX
19:36:50FromDiscord<sharpcdf> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: can you help me out with nimscript
19:37:31FromDiscord<sharpcdf> i think i might need to use nimble but i dont know for sure
19:37:44FromDiscord<Phil> Just as a sideremark, you have read the nimscript docs already I assume?
19:37:48FromDiscord<sharpcdf> yea
19:37:52FromDiscord<sharpcdf> they arent very helpful
19:38:09FromDiscord<sharpcdf> they dont say how to actually run nimscript tasks or anything like that
19:38:38FromDiscord<voidwalker> `var pzErrMsg: ptr cstring = cast[ptr cstring](alloc(4096))`
19:38:45FromDiscord<voidwalker> how do you print this pointer to cstring ?
19:38:54FromDiscord<voidwalker> i don't know pointers and cast yet, or cstrings :\
19:40:58Amun-Rawhat do you want to achieve?
19:41:05FromDiscord<Phil> In reply to @sharpcdf "they dont say how": Huh, turns out PMunch has a youtube channel, at least I'm semi sure that's him. He also has a blog. ↵These may interest you:↵https://www.youtube.com/watch?time_continue=2&v=BdQkU_HepIg&feature=emb_logo↵https://peterme.net/using-nimscript-as-a-configuration-language-embedding-nimscript-pt-1.html
19:41:05FromDiscord<voidwalker> print the string it points to
19:41:38Amun-Raecho pzErrMsgp[
19:41:42FromDiscord<sharpcdf> In reply to @Isofruit "Huh, turns out PMunch": haha i also looked at his blog, he only talks about nimscript for embedding and config
19:41:44Amun-Raecho pzErrMsg[]
19:41:51FromDiscord<sharpcdf> not task running
19:41:56FromDiscord<Phil> Man, I forgot how relaxing PMunch's voice is
19:44:20FromDiscord<voidwalker> `/usr/lib/libsqlite_zstd.so: undefined symbol: `
19:45:41FromDiscord<voidwalker> I wonder what this means
19:45:49FromDiscord<Phil> In reply to @sharpcdf "haha i also looked": If push comes to shove, you can always defined a nims file with all the procs you want, then define a nimble task that imports the nims file and executes the procs you want. Just found an example:↵https://github.com/andreaferretti/nimcuda/blob/master/nimcuda.nimble#L72↵↵Those nimble tasks you can then run as normal
19:46:08FromDiscord<sharpcdf> 👍
19:46:34FromDiscord<voidwalker> `echo dbsql.sqlite3_load_extension(zFile, zProc, pzErrMsg)`
19:46:40FromDiscord<voidwalker> `/usr/lib/libsqlite_zstd.so: undefined symbol: foo`
19:46:42FromDiscord<Phil> In reply to @voidwalker "`/usr/lib/libsqlite_zstd.so: undefined symbol: `": That means some C code somewhere is trying to make use of a struct of proc somewhere with a given name and that proc/struct doesn't exist
19:46:50FromDiscord<voidwalker> (edit) "`echo" => "`var zProc: cstring = "foo"↵echo"
19:47:23FromDiscord<Phil> In reply to @voidwalker "`var zProc: cstring =": Don't you have to manually typecast normal strings to cstring via "foo".cstring ?
19:47:39FromDiscord<voidwalker> eh, enthus1ast's code, I took it for granted
19:48:09FromDiscord<voidwalker> well, it's `var zProc: cstring = "foo"` it's good
19:48:11FromDiscord<Phil> Hmm apparently I'm wrong
19:48:17FromDiscord<# Luke> In reply to @ripluke "I have the following": Can someone help me w/ this pls
19:48:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44wY
19:49:25FromDiscord<Phil> In reply to @ripluke "I have the following": Just to be sure, you want to read that file at compile time (since you're using const) and extract data from it to put into your binary?
19:49:34FromDiscord<# Luke> In reply to @Isofruit "Just to be sure,": Yea
19:49:47FromDiscord<Phil> Interesting thought, not sure you can actually read a file at compiletime
19:49:54FromDiscord<# Luke> Hmm
19:50:19FromDiscord<# Luke> Lol gonna have to think about something else to get my version data
19:51:04FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44wZ
19:51:56FromDiscord<Phil> In reply to @sharpcdf "well now i have": I haven't seen that error before, but just in case, you did use -d:ssl?
19:52:01FromDiscord<sharpcdf> yea
19:52:04FromDiscord<the_dumbest_developer> can someone help me with this https://nim-lang.github.io/Nim/backends.html#interfacing-backend-code-calling-nim, the examples are not working
19:52:16FromDiscord<huantian> you need to have openssl 1.1 installed
19:52:22FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x0
19:52:24FromDiscord<Phil> In reply to @sharpcdf "yea": In that case gimme a bit, I'll take a look at LUke's problem whether he can read a file in at compiletime
19:52:40FromDiscord<# Luke> In reply to @sharpcdf "i have a `config.nims`": Isn't it -d?
19:52:45FromDiscord<# Luke> Only 1 dash?
19:52:45FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44x1
19:52:58FromDiscord<# Luke> Or does that not make a difference?
19:53:00FromDiscord<sharpcdf> In reply to @ripluke "Isn't it -d?": `--` is a template you use to add arguments in nimscript
19:53:01FromDiscord<Phil> either `-d:ssl` or `--define:ssl`
19:53:18FromDiscord<# Luke> In reply to @sharpcdf "`--` is a template": Oh then try using define
19:53:20FromDiscord<Phil> As compiler flags
19:53:31FromDiscord<# Luke> In reply to @ripluke "Oh then try using": Instead of d
19:53:34FromDiscord<huantian> In reply to @huantian "you need to have": also make sure you have this installed
19:53:47FromDiscord<# Luke> In reply to @huantian "also make sure you": Afaik fedora does have it
19:54:04FromDiscord<# Luke> It's not arch 😁
19:54:10FromDiscord<huantian> if the issue was the --d: thing then it would say you didn't compile with -d:ssl
19:54:26FromDiscord<# Luke> Oh
19:54:32FromDiscord<huantian> In reply to @ripluke "It's not arch 😁": you mean it's not ubuntu
19:54:41FromDiscord<# Luke> Ah yes
19:54:58FromDiscord<# Luke> Arch doesn't have it either tho
19:55:03FromDiscord<# Luke> Well base arch
19:55:04FromDiscord<huantian> I had it personally?
19:55:14FromDiscord<# Luke> I had to install it
19:55:17FromDiscord<huantian> since I had another package that depended on it for me
19:55:21FromDiscord<huantian> so I had 0 problems
19:55:30FromDiscord<# Luke> In reply to @huantian "since I had another": Yea that's how I got it
19:55:46FromDiscord<huantian> but making this a distro issue is dumb
19:55:53FromDiscord<huantian> it's a nim issue, it shouldn't need ancient openssl
19:56:18FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x3
19:56:22FromDiscord<# Luke> In reply to @huantian "it's a nim issue,": Yea
19:56:25FromDiscord<Phil> try it more step by step
19:56:28FromDiscord<# Luke> In reply to @Isofruit "Huh, you *can* read": O.o
19:56:36FromDiscord<# Luke> I'll try this
19:56:41FromDiscord<huantian> or use staticRead
19:56:58FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x5
19:57:11FromDiscord<# Luke> In reply to @huantian "or use staticRead": Yea, and if it's a multiline file can I use splitLines?
19:57:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x6
19:58:03FromDiscord<# Luke> In reply to @Isofruit "Can confirm staticRead works:": Yea I'll try it, thx for the help tho
19:59:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x7
19:59:04FromDiscord<the_dumbest_developer> <@&371760044473319454> can someone help me with this https://nim-lang.github.io/Nim/backends.html#interfacing-backend-code-calling-nim, the examples are not working
19:59:20FromDiscord<sharpcdf> got it working when i manually put in the args
19:59:24FromDiscord<# Luke> In reply to @Isofruit "And yeah you can": Yea that's good
20:00:10FromDiscord<Phil> In reply to @the_dumbest_developer "<@&371760044473319454> can someone": When it comes to C interop I'm out of my depth sadly.↵However, Moderator is not the correct group to call here. They are here for banning the occassional crypto or job posting spammer or when debates start to get beyond heated
20:01:40FromDiscord<d4rckh> what would be the easiest way to reformat strings? if i have let's say `/{X}?id={Y}` and `/{Y}/{X}` and i supply `/abc?id=2`, the function should return `/2/abc`
20:01:55FromDiscord<d4rckh> i want to do this in nim and not really sure where to start 🤔
20:01:56FromDiscord<Phil> In reply to @sharpcdf "well now i get": Could you post your code again?
20:02:19FromDiscord<Phil> In reply to @d4rckh "what would be the": Formatting strings? Without having understand your task, strformat an option?
20:02:31FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x9
20:02:39FromDiscord<sharpcdf> it works when i just put in the args manually
20:02:41FromDiscord<sharpcdf> without a nimscript
20:02:51FromDiscord<the_dumbest_developer> In reply to @Isofruit "When it comes to": sry about the moderator part I just asked the question multiple times without any attention↵I don't know how it works here↵I even felt impolite to interrupt the discussion here
20:03:13FromDiscord<huantian> In reply to @sharpcdf "its just a nimscript": what is the file holding this called?
20:03:14FromDiscord<d4rckh> In reply to @Isofruit "Formatting strings? Without having": yes, similar to how you can do with dates, where you can parse a string with a format (YY-MM-DD, whatever) and then reformat it as a string however you want (like DD-MM-YY)
20:03:26FromDiscord<huantian> you can also use strscans to parse the string
20:03:27FromDiscord<d4rckh> but with any string
20:04:59FromDiscord<Phil> In reply to @the_dumbest_developer "sry about the moderator": No worries. C interop is as stated something I'm not sure anybody that is currently available has much experience on. PMunch would be my main dude that I can recall for that. Given that you appear to not be hitting them at the right time, have you tried making a nim forum post?
20:05:36FromDiscord<voidwalker> Omfg finally I think it worked
20:05:39FromDiscord<voidwalker> `int success = sqlite3_load_extension(db, "libsqlite_zstd.so", NULL, NULL);`
20:05:48FromDiscord<Phil> sent a long message, see http://ix.io/44xa
20:05:52FromDiscord<d4rckh> exactly
20:06:05FromDiscord<voidwalker> It needed NULL for some reason in place of zProc, I called it with `echo dbsql.sqlite3_load_extension(zFile, nil, pzErrMsg)` and got success : D
20:06:07FromDiscord<Phil> In reply to @d4rckh "exactly": Isn't the answer to this for Step 1 use a regex and step 2 strformat?
20:06:21FromDiscord<huantian> I'll be beef and go "ew no regex use strscans"
20:06:29FromDiscord<Phil> In reply to @huantian "I'll be beef and": coward!
20:06:34FromDiscord<d4rckh> it needs to be more user friendly
20:06:41FromDiscord<d4rckh> its supposed to take these things from a config
20:06:49FromDiscord<d4rckh> which anyone should be able to edit
20:06:59FromDiscord<d4rckh> omg strscans is perfect!!
20:07:53FromDiscord<# Luke> In reply to @Isofruit "And yeah you can": Thx that works :)
20:07:59FromDiscord<Phil> ~~As a former bioinformatician, regex or death!~~
20:08:20FromDiscord<enthus1ast> what you want is very simple string parsing↵(@d4rckh)
20:08:25FromDiscord<d4rckh> yup
20:08:25FromDiscord<enthus1ast> simple done even by hand
20:08:34FromDiscord<d4rckh> but it would be better if it returned something like a table?
20:08:41FromDiscord<d4rckh> i think it would be a good coding exercise if i do it by hand
20:09:14FromDiscord<voidwalker> hey @enthus1ast, success !
20:09:21FromDiscord<enthus1ast> oh nice
20:09:22FromDiscord<enthus1ast> how?
20:09:31FromDiscord<voidwalker> echo dbsql.sqlite3_load_extension(zFile, nil, pzErrMsg)
20:09:47FromDiscord<voidwalker> (edit) "echo" => "`echo" | "pzErrMsg)" => "pzErrMsg)` nil instead of foo, and using your dynlib pragma"
20:09:49FromDiscord<enthus1ast> without enableing
20:09:54FromDiscord<voidwalker> with enabling
20:09:55FromDiscord<enthus1ast> ?
20:10:25FromDiscord<Phil> In reply to @voidwalker "`int success = sqlite3_load_extension(db,": Congratz!
20:10:28FromDiscord<voidwalker> (edit) "`echo dbsql.sqlite3_load_extension(zFile, nil, pzErrMsg)` nil instead of foo, and using your dynlib pragma" => "sent a code paste, see https://play.nim-lang.org/#ix=44xd"
20:10:29FromDiscord<the_dumbest_developer> In reply to @Isofruit "No worries. C interop": I tried to create an account to post a forum but no confirmation email sent to me (maybe there is an issue or something)
20:11:00FromDiscord<Phil> In reply to @the_dumbest_developer "I tried to create": Now that's <@&371760044473319454> worthy!↵Ma dudes, we have somebody here who did not receive a confirmation email
20:12:55*noeontheend joined #nim
20:13:10FromDiscord<enthus1ast> @voidwalker\: still does not work for me
20:13:22FromDiscord<enthus1ast> not even this
20:13:24FromDiscord<enthus1ast> echo dbsql.sqlite3\_enable\_load\_extension(1)
20:13:31FromDiscord<voidwalker> I copied the .so to /usr/lib.. not sure what's the deal with the .dll
20:14:11FromDiscord<Phil> In reply to @the_dumbest_developer "I tried to create": Basically, I'd say for now we wait for reaction on that and you can make a forum post once that's solved. Or you manage to grab Pmunch/Yard/whoever else has C interop knowledge
20:15:31FromDiscord<the_dumbest_developer> In reply to @Isofruit "Basically, I'd say for": thanks alot
20:17:17FromDiscord<Phil> Sorry I couldn't help more, I'm only slowly expanding my knowledge in various deeper areas of nim, since I never really did C
20:17:52FromDiscord<enthus1ast> @the_dumbest_developer\: what issue do you face?
20:18:34FromDiscord<enthus1ast> @the_dumbest_developer\: ping @dom96 for the forum's email issue
20:19:05FromDiscord<the_dumbest_developer> @dom96 I have an issue with forum mail confirmation
20:19:47FromDiscord<the_dumbest_developer> In reply to @enthus1ast "<@655721137480925185>\: what issue do": https://nim-lang.github.io/Nim/backends.html#interfacing-backend-code-calling-nim I can't run the examples (I think they are outdated or something)
20:21:37FromDiscord<geekrelief> In reply to @the_dumbest_developer "https://nim-lang.github.io/Nim/backends.html#interf": what error are you getting?
20:21:48FromDiscord<d4rckh> https://play.nim-lang.org/#ix=44xf
20:21:50FromDiscord<d4rckh> came up with this for now
20:22:08FromDiscord<d4rckh> is there any better way of doing it?
20:22:19FromDiscord<geekrelief> maybe the issue is with gcc and the '.cache' folder? might it be 'nimcache'?
20:22:56FromDiscord<enthus1ast> sure there always are, but this doesn't look to bad↵(@d4rckh)
20:23:27FromDiscord<enthus1ast> you could change this into an iterator
20:23:41FromDiscord<enthus1ast> so that you do not need to return a table, but a tuple
20:23:48FromDiscord<enthus1ast> but yield a tuple
20:24:39FromDiscord<the_dumbest_developer> sent a code paste, see https://paste.rs/PEs
20:25:53FromDiscord<d4rckh> In reply to @enthus1ast "but yield a tuple": ah yes
20:25:57*noeontheend quit (Ping timeout: 276 seconds)
20:27:07FromDiscord<d4rckh> now extracting the actual variables is going to be a bit hard i think?
20:27:20FromDiscord<enthus1ast> @d4rckh\: where do you use input?
20:27:31FromDiscord<d4rckh> i dont use it for now
20:27:40FromDiscord<d4rckh> ;-;
20:28:00FromDiscord<geekrelief> In reply to @the_dumbest_developer "I tried to delete": double check the path to the cache folder exists
20:28:54FromDiscord<geekrelief> For example, I'm on windows so that'd be in my user nimcache/fib_d folder
20:29:14FromDiscord<d4rckh> id need 2 indices i think, one for the format and one for the input
20:29:40FromDiscord<enthus1ast> @the_dumbest_developer\: why not compile to a static lib and link it that way?
20:30:18FromDiscord<enthus1ast> @d4rckh\: for formatting you can just use strformat
20:30:18FromDiscord<enthus1ast> with the syntax you provided
20:30:40FromDiscord<d4rckh> yes
20:30:45FromDiscord<d4rckh> but i need to extract the variables first
20:30:48FromDiscord<enthus1ast> "/abc/?id=10"↵is this always like this?
20:30:56FromDiscord<d4rckh> no
20:31:18FromDiscord<d4rckh> this function should also check if its valid input for the format
20:31:19FromDiscord<enthus1ast> what is the common pattern?
20:31:49FromDiscord<d4rckh> sent a code paste, see https://paste.rs/cgU
20:31:56FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=44xk" => "https://play.nim-lang.org/#ix=44xj"
20:32:13FromDiscord<the_dumbest_developer> In reply to @geekrelief "double check the path": I had used `nimchoose` to download nim↵and the cache for mine is on `~/.cache/nim/fib_d`↵@enthus1ast the error I post was for the static build (both examples failed anyway but I wanted the static version)
20:32:17FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=44xj" => "https://play.nim-lang.org/#ix=44xl"
20:33:12FromDiscord<the_dumbest_developer> this is the command I used (and the one that error appears on)↵`gcc -o m -Inimcache -I~/.choosenim/toolchains/nim-1.6.6/lib libfib.a maths.c`
20:34:20FromDiscord<the_dumbest_developer> (edit) "-Inimcache" => "-I~/.cache/nim/fib_d"
20:34:32FromDiscord<geekrelief> In reply to @the_dumbest_developer "I had used `nimchoose`": In your cache folder there should be a fib.nim.c (it might be prefixed with something).. there should be a NimMain declaration in there.
20:34:33FromDiscord<mbenam> Hello, while setting up nginx reverse proxy for jester, do you need to specify location for each individual route in the nginx sites-available config file?
20:35:27FromDiscord<enthus1ast> @d4rckh\:↵1. parse the format to tokens (keys; string)↵2. iterate over the tokens, and if token is string, skik the string in input, if its a key, parse the string in input until you hit the next string token
20:35:49FromDiscord<enthus1ast> @d4rckh\:↵1. parse the format to tokens (keys; string)↵2. iterate over the tokens, and if token is string, skip the string in input, if its a key, parse the string in input until you hit the next string token or the end
20:36:01FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xm
20:37:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=44xn
20:37:30FromDiscord<the_dumbest_developer> sent a code paste, see https://play.nim-lang.org/#ix=44xo
20:37:51FromDiscord<Phil> You don't necessarily need the `rewrite` rule, I need that for my own setup where my nginx server serves front and backend at the same time
20:37:53FromDiscord<d4rckh> In reply to @enthus1ast "<@648552095531663361>\: 1. parse the": like this?↵`aaaa{id}bbbb` => @[String("aaaa"), Variable("id"), String("bbbb")]
20:38:08FromDiscord<enthus1ast> yhea
20:38:24FromDiscord<enthus1ast> then you could use the procs from parseutils
20:38:25FromDiscord<Phil> In reply to @mbenam "Hello, while setting up": You don't necessarily need the rewrite rule, I need that for my own setup where my nginx server serves front and backend at the same time
20:38:31FromDiscord<d4rckh> In reply to @enthus1ast "then you could use": oh how
20:38:33FromDiscord<d4rckh> (edit) "how" => "which one?"
20:38:36FromDiscord<geekrelief> In reply to @the_dumbest_developer "`cat ~/.cache/nim/fib_d/@mfib.nim.c | grep": you should be able to include "~/.cache/nim/fib_d/.c" for the gcc command then
20:39:40FromDiscord<enthus1ast> @d4rckh\: eg. skip()
20:40:11FromDiscord<mbenam> In reply to @Isofruit "You don't necessarily need": I have pretty much the same thing except for the rewrite line. "/" works. But "/abc" is giving a jester 404
20:41:03FromDiscord<Phil> In reply to @mbenam "I have pretty much": Hmm, does jester write logs somewhere? Can you check them to see whether jester received the request or not?
20:42:09FromDiscord<mbenam> In reply to @Isofruit "Hmm, does jester write": There is no log. And nothing in the console either
20:42:44FromDiscord<Phil> In reply to @mbenam "There is no log.": If you ping the server directly, bypassing nginx, do you get something in the console / would you expect to get something?
20:43:10FromDiscord<mbenam> let me try with curl
20:43:27FromDiscord<Phil> Fair, I tend to use postman for this since I take way too long to write the curl commands
20:45:04FromDiscord<the_dumbest_developer> In reply to @geekrelief "you should be able": This part didn't happen↵`The Nim compiler will handle linking the source files generated in the nimcache directory into the libfib.nim.a static library, which you can then link into your C program.`
20:45:23FromDiscord<the_dumbest_developer> there is something missing from this command `nim c --app:staticLib --noMain fib.nim`
20:45:29*Jjp137 quit (Quit: Leaving)
20:45:55FromDiscord<mbenam> In reply to @Isofruit "Fair, I tend to": Everything works as expected using curl
20:46:14FromDiscord<geekrelief> In reply to @the_dumbest_developer "This part didn't happen": The issue is you need an extern for NimMain
20:46:33FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xt
20:46:46FromDiscord<Phil> In reply to @mbenam "Everything works as expected": Alright, what do your access and error logs of nginx say under `/var/log/nginx` ? Just throw a tail at them and paste here
20:46:56FromDiscord<geekrelief> normally those externs would be in a header
20:48:14FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xu
20:48:16FromDiscord<geekrelief> then you include "fib.h" in maths.c
20:48:40FromDiscord<the_dumbest_developer> In reply to @geekrelief "The issue is you": This will not help with the undefined reference↵`libfib.nim.a` is missing and I think it will hold the missing references
20:49:09FromDiscord<geekrelief> are you using `nim c --noMain --noLinking fib.nim`?
20:49:43FromDiscord<the_dumbest_developer> In reply to @geekrelief "are you using `nim": I'm using this↵`nim c --app:staticLib --noMain fib.nim`
20:49:58*krux02 quit (Remote host closed the connection)
20:52:32FromDiscord<PMunch> @the_dumbest_developer, what's the forum nick you tried to register? I can manually fix it for you
20:52:43*Jjp137 joined #nim
20:53:07FromDiscord<the_dumbest_developer> In reply to @PMunch "<@655721137480925185>, what's the forum": you mean username ?
20:54:24FromDiscord<PMunch> Yes
20:54:29FromDiscord<the_dumbest_developer> baronleonardo
20:56:06FromDiscord<PMunch> There, your account should be active now
20:56:21FromDiscord<the_dumbest_developer> In reply to @PMunch "There, your account should": much thanks
20:59:21FromDiscord<sharpcdf> why does it error when i `exec()` in a nimble file?
20:59:34FromDiscord<mbenam> In reply to @Isofruit "Alright, what do your": looked at the error log. It was an issue of nginx not transferring correct routes. Used similar rewrite statement from your example. It's all good now. Thanks a lot for the help.
21:00:36*CyberTailor quit (Quit: Konversation terminated!)
21:04:11FromDiscord<Phil> In reply to @mbenam "looked at the error": Glad I could help!↵Sidenote, since you're at the stage of setting up reverse proxy:↵If you want to deploy your project with docker, there is a guide on how to do that for alpine/ bitnami/minideb for prologue. ↵The vast majority of it is 1:1 the same between jester and prologue, so you might be interested in taking a look should it be relevant
21:04:40NimEventerNew thread by Baronleonardo: From nim to C (C interop), see https://forum.nim-lang.org/t/9307
21:10:16FromDiscord<geekrelief> @the_dumbest_developer
21:10:38FromDiscord<geekrelief> (edit) "@the_dumbest_developer ... " added "that was silly.. I just had to put the maths.c first ` gcc -o m -I".nimcache" -I"C:\Nim\lib\" maths.c libfib.lib`"
21:10:41FromDiscord<geekrelief> and it compiled
21:11:12FromDiscord<the_dumbest_developer> In reply to @geekrelief "<@655721137480925185> that was silly..": OMG 😂
21:11:20FromDiscord<geekrelief> `nim c --app:staticlib --noMain -o:libfib.lib fib.nim `
21:11:26FromDiscord<geekrelief> then the gcc command works fo rme
21:11:29FromDiscord<geekrelief> (edit) "fo rme" => "for me"
21:11:34FromDiscord<geekrelief> never did this before 😄
21:11:46FromDiscord<the_dumbest_developer> It works now 😂
21:11:55FromDiscord<the_dumbest_developer> then there is a bug in the doc
21:11:59FromDiscord<geekrelief> for sure
21:12:05*noeontheend joined #nim
21:12:20FromDiscord<geekrelief> I guess it assumes you understand what your compiler wants 😄
21:13:37FromDiscord<the_dumbest_developer> dammit I'm so rusty with gcc↵this is a gcc issue↵anyway thanks man very very much↵just what to do to change the doc ?
21:14:26FromDiscord<geekrelief> not sure.. but maybe pull. the sources and edit the manual to push a pr
21:15:05FromDiscord<geekrelief> I'm in the middle of a PR right now.. so let me see
21:15:48FromDiscord<geekrelief> @the_dumbest_developer do you want to try doing it?
21:15:55FromDiscord<geekrelief> otherwise I'll create the PR
21:16:27FromDiscord<the_dumbest_developer> right now I can't
21:16:43FromDiscord<geekrelief> ok, I'll do it
21:17:07FromDiscord<the_dumbest_developer> In reply to @geekrelief "ok, I'll do it": much thanks
21:17:13FromDiscord<geekrelief> np
21:21:48FromDiscord<pruno> i feel stupid asking this but how would you print a string two characters by two characters in a loop ?
21:27:23FromDiscord<geekrelief> In reply to @pruno "i feel stupid asking": What does your data look like?
21:28:32FromDiscord<Elegantbeef> i believe nimscript tasks are just run `nim taskname`
21:28:58FromDiscord<pruno> In reply to @geekrelief "What does your data": Let's say i have a string that looks like this : "MySuperString", note that it's 13 characters, not twelve
21:30:23FromDiscord<Elegantbeef> `for i in countup(0, myStr.len, 2): echo myStr[i], myStr[i + 1]`↵(@pruno)
21:30:39FromDiscord<Elegantbeef> Actually should probably be `myStr.high - 1`
21:32:30FromDiscord<pruno> In reply to @Elegantbeef "`for i in countup(0,": Well that was my base idea but the thing is that if `myStr` is 13 characters (so not a multiple of 2), it errors `Error: unhandled exception: index 13 not in 0 .. 12 [IndexDefect]`
21:32:44FromDiscord<Elegantbeef> `myStr.high - 1`
21:33:11FromDiscord<pruno> Does not print the last character
21:33:21FromDiscord<Elegantbeef> Yes
21:33:38FromDiscord<Elegantbeef> If you want it to be smarter you need more logic
21:33:38FromDiscord<Elegantbeef> I gave the base you can figure out an if statement
21:34:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44xB
21:34:53FromDiscord<Elegantbeef> Heres an implementation that works with any sliding window
21:35:32FromDiscord<Elegantbeef> Really it should be `s: openarray[char]`
21:36:08FromDiscord<pruno> Thanks !
21:36:51FromDiscord<Elegantbeef> Guess it should also be `groupSize: Positive`
21:39:31FromDiscord<creikey> why is it telling me that the capture on line 59 is memory unsafe? https://media.discordapp.net/attachments/371759389889003532/997980828711796756/unknown.png
21:39:40FromDiscord<creikey> that the "var lobby" can't be capturede
21:39:41FromDiscord<creikey> (edit) "capturede" => "captured"
21:39:56FromDiscord<Elegantbeef> Cause `var T` cannot be captured as it can live on the stack
21:40:32FromDiscord<creikey> In reply to @Elegantbeef "Cause `var T` cannot": it's a pure function though so the reference to it is not held right?
21:40:37FromDiscord<creikey> by the makeMetaData
21:41:07FromDiscord<Elegantbeef> `async` uses closure iterators which capture parameters
21:41:20FromDiscord<Elegantbeef> Make lobby a ref type and remove `var` and you can capture it
21:41:42FromDiscord<Elegantbeef> I guess it doesnt capture parameters but does capture used parameters
21:42:22FromDiscord<Elegantbeef> The capture happens inside `updatePlayersOnLobby` the call `makeMetaData` requires capture of `lobby`
21:42:40FromDiscord<creikey> In reply to @Elegantbeef "The capture happens inside": because it's not a ref object the data is copied right?
21:42:47FromDiscord<Elegantbeef> No
21:42:55FromDiscord<Elegantbeef> It's `var T` there is no good way of capturing it
21:43:23FromDiscord<Elegantbeef> You dont know if it's a pointer to a ref held object or a stack held object
21:43:52FromDiscord<Elegantbeef> consider you have a `seq[Lobby]` and call that update procedure on an element then add another lobby causing the address of lobby to move
21:44:07FromDiscord<Elegantbeef> Your copy is useless cause it's not what you need/want generally
21:45:37FromDiscord<creikey> interesting
21:45:50FromDiscord<sharpcdf> does nimscript not support std/terminal and std/io?
21:45:57FromDiscord<Elegantbeef> No
21:45:59FromDiscord<Elegantbeef> I mean yes it does not
21:46:05FromDiscord<sharpcdf> im trying to print some colored text but its erroring weirdly
21:46:17FromDiscord<Elegantbeef> Nimscript does not support anything that requires `importc`
21:46:24FromDiscord<Elegantbeef> Or lowlevel memory access
21:47:38FromDiscord<sharpcdf> aw that sucks
21:47:53FromDiscord<sharpcdf> is there another way to print colored text in nimscript
21:48:11FromDiscord<Elegantbeef> I mean you should be able to use the `terminal` module
21:48:24FromDiscord<Elegantbeef> ansi codes shouldnt require anything low level
21:49:03FromDiscord<Elegantbeef> Or does it not allow you to import?
21:51:29FromDiscord<mbenam> In reply to @Isofruit "Glad I could help!": Will take a look. Thanks again.
21:53:41FromDiscord<sharpcdf> In reply to @Elegantbeef "Or does it not": no i can import but it requires stdout
21:53:46FromDiscord<sharpcdf> and thats when it errors
21:53:49FromDiscord<sharpcdf> doesnt let me use stdout
21:54:12FromDiscord<Elegantbeef> you can use `ansiBackgroundColorCode` and `ansiForegroundColorCode` no?
21:54:20FromDiscord<sharpcdf> oh yea
21:54:27FromDiscord<sharpcdf> i was using `styledWriteLine`
21:56:08FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44xD
21:56:24FromDiscord<sharpcdf> In reply to @Elegantbeef "you can use `ansiBackgroundColorCode`": is that the same as `setForegroundColor`?
21:56:26FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=44xD" => "https://play.nim-lang.org/#ix=44xE"
21:56:36FromDiscord<Elegantbeef> It's going to call the macro and pass the arguments
21:57:12FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44xF
21:57:27FromDiscord<Elegantbeef> those two procedures return the ansicode so you'd do like `ansiBackGroundColorCode(bgRed) & ansiForeGroundColorCode(fgGreen) & "Christmas" & ansiResetCode`
21:57:40FromDiscord<Elegantbeef> `setForegroundColor` might work
21:57:42FromDiscord<Elegantbeef> I dont know though
21:57:54FromDiscord<sharpcdf> well thats not the problem
21:57:56FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=44xE" => "https://play.nim-lang.org/#ix=44xG"
21:58:09FromDiscord<sharpcdf> i cant even call `styledWriteLine` because it needs stdout but it errors when i pass stdout
21:58:12FromDiscord<sharpcdf> or am i misunderstanding
21:58:22FromDiscord<Elegantbeef> You can use `echo ansiBackGroundColorCode(bgRed) & ansiForeGroundColorCode(fgGreen) & "Christmas" & ansiResetCode`
21:58:43FromDiscord<Elegantbeef> And make a template so you can do `myWriteStyled(bgRed, fgGreen, "Christmas")`
21:59:28FromDiscord<sharpcdf> ah ok
21:59:59FromDiscord<sharpcdf> theres also `styledEcho` which i believe is similar to what you're saying but it also errors
22:00:03FromDiscord<sharpcdf> ill try your way too
22:03:03FromDiscord<Elegantbeef> I assume aru you're solving the issue with the deleted messages
22:03:59FromDiscord<sharpcdf> wdym
22:04:12FromDiscord<Elegantbeef> Not you
22:04:18FromDiscord<Elegantbeef> aruzeta here 😄
22:04:21FromDiscord<aruZeta> not that I solved that exactly but did it in another way
22:04:46FromDiscord<aruZeta> or better said, thought of another way to do it, since what I was trying to do is impossible
22:05:30FromDiscord<aruZeta> writing macros melts your brain lol
22:05:31FromDiscord<sharpcdf> ah ok lol
22:05:58FromDiscord<Elegantbeef> Eh it stops melting it after awhile
22:07:07FromDiscord<aruZeta> i've written lisp macros before, but these ones are different
22:07:29FromDiscord<aruZeta> it's just getting used to it
22:08:45FromDiscord<sharpcdf> https://media.discordapp.net/attachments/371759389889003532/997988182631137360/unknown.png
22:08:55FromDiscord<sharpcdf> 😔
22:11:30*noeontheend quit (Ping timeout: 240 seconds)
22:13:09*noeontheend joined #nim
22:46:56NimEventerNew thread by Ggibson: How to create structures based on user types/fields?, see https://forum.nim-lang.org/t/9308
22:57:28FromDiscord<creikey> thinking about how stacked treeform's resume is rn
22:57:38FromDiscord<creikey> 8 billion side projects
23:07:15FromDiscord<# Luke> Lol yea
23:07:46FromDiscord<# Luke> And 90% of them end with "y" or "ie" 😄
23:14:58FromDiscord<creikey> @treeform is there any way to limit the size of the received ws packet? What if a malicious person tries to send a 1 gigabyte tcp packet to stall the server?
23:15:13FromDiscord<creikey> This can't be done with nginx as it treats websocket connections opaquely
23:19:17FromDiscord<treeform> you can probably put a check like that in
23:20:47*jkl quit (Quit: Gone.)
23:22:08*jkl joined #nim
23:29:19FromDiscord<creikey> In reply to @treeform "you can probably put": doesn't sending a large message like that already allocate the memory in tcp recv before the check?
23:29:36FromDiscord<creikey> so you could burn out any vps by just sending a few large messages like that
23:31:43FromDiscord<creikey> In reply to @treeform "you can probably put": https://github.com/treeform/ws/blob/master/src/ws.nim#L393 here there's no limit passed
23:32:43FromDiscord<Elegantbeef> `recievePacket(ws: WebSocket, maxLength: static int)` 😄
23:33:32FromDiscord<Elegantbeef> I actually dont know how WS/TCP works so dont know if that would work
23:34:43FromDiscord<treeform> its same as spend large HTTP post body etc...
23:37:23FromDiscord<creikey> In reply to @treeform "its same as spend": https://github.com/treeform/ws/pull/40 does something like this make sense?
23:37:27FromDiscord<dom96> In reply to @creikey "doesn't sending a large": You typically recv a certain number of bytes. You don’t ever recv all.
23:37:36FromDiscord<creikey> I think if you provide a maximum size to tcp recv it would be good
23:38:10FromDiscord<dom96> You’re honestly better off just using Cloudflare and not worrying about this stuff too much
23:38:54FromDiscord<creikey> In reply to @dom96 "You’re honestly better off": oh wow they have websocket protection
23:39:04FromDiscord<dom96> Of course
23:39:52FromDiscord<creikey> maybe my PR to ws isn't useful then
23:40:08FromDiscord<voidwalker> any idea about this with db_sqlite: `title_basics is a view not a table [DbError]` ? I enabled a compression extension for sqlite, which turns the actual table into a view, and stores data in a renamed table
23:40:27FromDiscord<creikey> In reply to @dom96 "You’re honestly better off": I don't really get their pricing, how many concurrent websocket protections will they protect in the free plan?
23:40:41FromDiscord<voidwalker> `The data will be moved to _table_name_zstd, while table_name will be a view that can be queried as normally, including SELECT, INSERT, UPDATE, and DELETE queries.`
23:41:21FromDiscord<dom96> In reply to @creikey "I don't really get": https://support.cloudflare.com/hc/en-us/articles/200169466-Using-Cloudflare-with-WebSockets#12345682
23:41:44FromDiscord<creikey> In reply to @dom96 "https://support.cloudflare.com/hc/en-us/articles/20": so no limit?
23:41:52FromDiscord<creikey> that page was from 2014 is why I have confusion
23:42:05FromDiscord<creikey> like they just say volume
23:43:02FromDiscord<creikey> lol they contact you?? https://media.discordapp.net/attachments/371759389889003532/998011914514878524/unknown.png
23:44:55FromDiscord<treeform> In reply to @creikey "oh wow they have": I use cloudflare
23:45:39FromDiscord<treeform> it saves me thousands of dollars in transfer fees
23:46:14FromDiscord<Dale> They reach out because they deal with huge clients, and their clientele is also huge
23:46:24FromDiscord<creikey> yeah I can only imagine
23:46:24FromDiscord<Dale> (actually quite controversial)
23:46:46FromDiscord<Elegantbeef> What a cloudflare outage taking down most of the internet is fine!↵(@Dale)
23:46:55FromDiscord<Dale> Centralise everything!
23:47:00FromDiscord<creikey> but honestly
23:47:02FromDiscord<creikey> centralizing it like that
23:47:05FromDiscord<creikey> probably makes it more efficient
23:47:12FromDiscord<Dale> Quite the opposite
23:47:27FromDiscord<Dale> The services they offer are fantastic and first-class
23:47:30FromDiscord<Elegantbeef> I mean after the Rogers incident Canada had, I guess it's my Canadian duty to suggest centralisation
23:47:39FromDiscord<Dale> But the consequences are debatably terrible
23:47:45FromDiscord<creikey> doesn't it make sense for the cloud functions and ddos protection and all that to be on the same site
23:47:55FromDiscord<Dale> No
23:48:04FromDiscord<Dale> Because if cloudflare doesn't work, then nothing works
23:48:11FromDiscord<Dale> Web == dead
23:48:15FromDiscord<creikey> not in terms of reliability but like efficienty
23:48:18FromDiscord<Elegantbeef> You funnel the internet and make it easier to shutoff
23:48:21FromDiscord<creikey> if the servers are farther apart more latency
23:48:28FromDiscord<Elegantbeef> Humans are distributed
23:48:35FromDiscord<Dale> Nah, because you're shovelling everything through one pipe
23:48:38FromDiscord<Elegantbeef> If you have to go to the same server you load the same lines
23:48:50FromDiscord<Dale> Distributed is better even for realiability (look at mesh networks)
23:49:03FromDiscord<creikey> In reply to @Dale "Nah, because you're shovelling": I don't even really understand how this works, like a site like google how can they possibly have all of that traffic going to one ip
23:49:13FromDiscord<creikey> or does the dns change the destination ip for load balancing dynamically
23:49:22FromDiscord<Dale> They're not, but they're going through 1 service
23:49:51FromDiscord<creikey> everybody goes through `142.251.40.46` right and that has to be some modem somewhere right
23:49:51FromDiscord<Elegantbeef> The DNS just gives you an address to deliver your packet your network determines the path to take it afaik↵(@creikey)
23:50:10FromDiscord<Dale> And outside of OS kernels (also debatable) it's been proven time and time again in software that monolithic things are a bad idea
23:50:10FromDiscord<creikey> In reply to @Elegantbeef "The DNS just gives": yeah so like somewhere is the giant google `142.251.40.46` modem
23:50:38FromDiscord<Elegantbeef> Decentralisation is the best for consumers and people
23:51:02FromDiscord<Dale> Anyways, I'm not trying to deter you from using cloudflare, go for it, just saying to be wary of things like that :)
23:51:08FromDiscord<Elegantbeef> It reduces the fault points and gives more control! 😛
23:51:24FromDiscord<Elegantbeef> but i'm sitting here talking on matrix using the matrix.org homeserver so the fuck do i know 😛
23:51:28FromDiscord<creikey> In reply to @Dale "Anyways, I'm not trying": I mean ideally I'd like to not host anything at all but I don't think that's feasible
23:51:50FromDiscord<Dale> I keep meaning to try out matrix, I really dislike discord, but y'know, the whole de facto dealio
23:51:53FromDiscord<creikey> I want the steam version of this you buy for $5 then you invite your friends for free and they play over web
23:52:07FromDiscord<Elegantbeef> creikey steam has an API for this
23:52:17FromDiscord<creikey> for multiplayer yeah
23:52:18FromDiscord<Elegantbeef> Steam has remote play together
23:52:19FromDiscord<dom96> In reply to @creikey "I mean ideally I'd": It’s all about serverless these days. So you can :D
23:52:24FromDiscord<creikey> In reply to @dom96 "It’s all about serverless": loool
23:52:29FromDiscord<creikey> In reply to @dom96 "It’s all about serverless": actually laughed out loud
23:52:36FromDiscord<creikey> In reply to @Elegantbeef "Steam has remote play": not what I'm looking for
23:52:47FromDiscord<creikey> I want to if you own the game on steam you click a button send a link to your friends and they play with you on the web
23:52:49FromDiscord<Elegantbeef> Ah not a single screen game
23:52:57FromDiscord<creikey> yeah this very much does not work as a single screen game
23:53:16FromDiscord<Elegantbeef> Steam has the API for free game tickets
23:53:19FromDiscord<creikey> at first I was like webrtc with the host being the server host
23:53:27FromDiscord<creikey> In reply to @Elegantbeef "Steam has the API": I don't want the friends you invite to go through steam
23:53:39FromDiscord<creikey> convincing your friend to download a steam game is a lot harder than sending them a link
23:53:42FromDiscord<Elegantbeef> Well then have fun 😄
23:53:46FromDiscord<Elegantbeef> Not my friends
23:54:03FromDiscord<Elegantbeef> "Hey fucko come play this game"↵"Ok"
23:54:11FromDiscord<creikey> yeah I mean maybe I have the market wrong
23:54:41FromDiscord<Dale> I think people would be more inclined to play if you send a gift
23:54:50FromDiscord<Dale> People like to receive tangible things
23:54:56FromDiscord<Elegantbeef> Hey i already called them "fucko"↵(@Dale)
23:55:00FromDiscord<Dale> It adds a whole new emotional aspect to it
23:55:02FromDiscord<creikey> In reply to @Dale "I think people would": if everybody was playing through steam I'd have the game be free and the ability to host being a $5 DLC
23:55:14FromDiscord<Elegantbeef> I mean that's what games do
23:55:17FromDiscord<Elegantbeef> Look at just act natural
23:55:32FromDiscord<Elegantbeef> the free version is locked down and i dont think you can host a game
23:55:38FromDiscord<Elegantbeef> Or if you can it's only a few game modes
23:55:55FromDiscord<Elegantbeef> The upgrade pack unlocks the remainder of the game modes
23:55:56FromDiscord<Dale> Ah like the game sharing on DS/PSP!
23:56:08FromDiscord<creikey> In reply to @Dale "Ah like the game": this is more what I was thinking of
23:56:10FromDiscord<Elegantbeef> Yea steam actually has a gameshare API
23:56:20FromDiscord<Dale> You can do that easy with nim if you do your cross-platform stuff right
23:56:23FromDiscord<creikey> In reply to @Elegantbeef "Yea steam actually has": you mean like family sharing?
23:56:27FromDiscord<Elegantbeef> No
23:56:43FromDiscord<Elegantbeef> Steam has it if you own a game that enables this api you can download a limited version of the game to play
23:56:48FromDiscord<Elegantbeef> The latest WWE game uses it
23:56:53FromDiscord<Dale> Family share is library sharing, you have to download the binaries still, and only 1 client can load game X at a time
23:56:56FromDiscord<Elegantbeef> Some others aswell of course
23:57:23FromDiscord<Elegantbeef> I dont know if the shared API is small or not
23:57:28FromDiscord<Elegantbeef> well shared game rather
23:57:31FromDiscord<creikey> I can't find any mention of this online
23:58:23FromDiscord<Elegantbeef> I know it exists but dont know what steam calls it
23:58:47FromDiscord<creikey> whatever like 5 people will play my game anyways I have no reason to worry about complex ddos attacks