00:10:33 | * | noeontheend joined #nim |
00:12:11 | FromDiscord | <Dale> Do any of you guys use the language server? I can't get it to compile |
00:12:21 | FromDiscord | <Elegantbeef> Which one |
00:12:26 | FromDiscord | <Elegantbeef> Nimlsp or nimlangserver |
00:12:36 | FromDiscord | <Dale> https://github.com/nim-lang/langserver |
00:12:53 | FromDiscord | <Elegantbeef> You probably need to use the devel compiler for that right now |
00:13:03 | FromDiscord | <Dale> I tried changing the visx to use the lsp one but it doesn't seem to work |
00:13:42 | FromDiscord | <Elegantbeef> There hasnt been a 1.6.x update that contains the required PR yet |
00:13:49 | FromDiscord | <Dale> Ah |
00:13:52 | FromDiscord | <Elegantbeef> 1.7.x will have it |
00:14:12 | FromDiscord | <Elegantbeef> I have used both LSPs and they both do indeed work |
00:14:19 | FromDiscord | <Elegantbeef> But i dont use vscode |
00:18:41 | FromDiscord | <Dale> I guess I'll stick to using nimsuggest and look into it some other time |
00:19:10 | FromDiscord | <Dale> It's just a bit odd that you have to save to get it to parse |
00:19:38 | FromDiscord | <Generic> you don't have to |
00:21:15 | FromDiscord | <Dale> I don't get any error/warnings without saving |
00:21:34 | FromDiscord | <Generic> that has nothing to do with language server vs nimsuggest |
00:21:48 | FromDiscord | <Dale> Oh |
00:22:26 | FromDiscord | <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:46 | FromDiscord | <Generic> and that would be too slow to do this while typing |
00:22:51 | FromDiscord | <Generic> atleast in larger projects |
00:24:24 | FromDiscord | <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:18 | FromDiscord | <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:46 | FromDiscord | <Dale> Yeah that'd be terrible |
00:26:27 | FromDiscord | <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:31 | FromDiscord | <Dale> Thanks for the info :) |
00:26:52 | FromDiscord | <huantian> You can also enable auto save every 1 second or something |
00:27:18 | FromDiscord | <Generic> but the satisfaction of saving progress is half the fun 😄 |
00:49:12 | FromDiscord | <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:21 | FromDiscord | <Dale> I share the satisfaction for saves, haha |
00:52:53 | FromDiscord | <Dale> It's so ingrained that I rarely ever think about hitting the keys anymore |
01:07:14 | FromDiscord | <Dale> I've been learning about the macros today. Man, they are kinda daunting given that you actually modify the AST |
01:07:33 | FromDiscord | <Elegantbeef> Yea but they're supremely powerful |
01:07:37 | FromDiscord | <Dale> Mhmm |
01:07:59 | FromDiscord | <Elegantbeef> A language without macros means more needs to be done in compiler space which sucks if you ask me |
01:08:21 | FromDiscord | <Dale> Well it's a tradeoff, right? |
01:08:31 | FromDiscord | <Dale> Zig has zero macros, and for a very good reason |
01:08:59 | FromDiscord | <Dale> Something like what nim offers can be used very poorly, making it difficult to understand what's going on |
01:09:33 | FromDiscord | <Elegantbeef> Sure, but that's a mild issue if you ask me |
01:09:47 | FromDiscord | <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:04 | FromDiscord | <Elegantbeef> I mean you can do so much in macros that'd otherwise require compiler support |
01:10:15 | FromDiscord | <Elegantbeef> Take for instance async |
01:10:19 | FromDiscord | <Dale> I think it's a rather large issue, I intend to use macros sparingly |
01:10:55 | FromDiscord | <Dale> Yeah I've been looking at that stuff today too. Templates too of course. Was surprised to see things like `!=` there |
01:11:13 | FromDiscord | <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:23 | FromDiscord | <Dale> Precisely! |
01:11:56 | FromDiscord | <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:38 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> Yea that's something i've looked into |
01:13:32 | FromDiscord | <Elegantbeef> Custom pragma on object fields an a generic `serializer` procedure that operates on them |
01:13:58 | FromDiscord | <Dale> I imagine I'll need to build a bunch of proc ASTs or something for `serialise` or `getEditorProps` etc |
01:14:14 | FromDiscord | <Elegantbeef> I think it's much less complicated than you realize |
01:14:24 | FromDiscord | <Elegantbeef> You dont really need a many macros for this |
01:14:32 | FromDiscord | <Elegantbeef> generic programming is mostly sufficient |
01:14:57 | FromDiscord | <Elegantbeef> Really what you're saying is "I want to implement a generic procedure that can be specialized for specific types" |
01:15:06 | FromDiscord | <Elegantbeef> So you dont really need many macros |
01:15:18 | FromDiscord | <Dale> Of course :) |
01:15:22 | FromDiscord | <Elegantbeef> the most obvious one is of course if you have an object variant you cannot use `fieldPairs` |
01:15:51 | FromDiscord | <Elegantbeef> so you'd have to use something like `disruptek/assume`'s `typeit` |
01:15:56 | FromDiscord | <Dale> I'm not familiar with that, is that an iterator for an object's fields? |
01:16:07 | FromDiscord | <Elegantbeef> yes |
01:16:16 | FromDiscord | <Elegantbeef> It works on tuples and objects aslong as the object is not an object variant |
01:16:53 | FromDiscord | <Dale> Is "variant" a concrete concept? |
01:17:07 | FromDiscord | <Elegantbeef> It's nimspeak for tagged union |
01:17:12 | FromDiscord | <Dale> AH |
01:17:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants |
01:17:27 | FromDiscord | <Elegantbeef> The fieldPairs presently doesnt work on it sadly, but alas |
01:19:19 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=44tB |
01:23:37 | FromDiscord | <Elegantbeef> Just to show how simple this can be |
01:30:05 | FromDiscord | <Dale> Thanks, that's neat! |
01:30:59 | FromDiscord | <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:09 | FromDiscord | <Rika> It can |
01:31:18 | FromDiscord | <Dale> oh cool! |
01:31:31 | FromDiscord | <Rika> {.something: “a value I don’t know”.} |
01:31:34 | FromDiscord | <Rika> Like that? |
01:32:32 | FromDiscord | <Dale> `{.edit: min: 0 max: 0.}` I don't know if that's valid, but it expresses my intent |
01:32:42 | FromDiscord | <Rika> Ah, use a tuple then |
01:32:45 | FromDiscord | <Elegantbeef> We can do better |
01:32:46 | FromDiscord | <Rika> Or a range since that’s a min max |
01:32:56 | FromDiscord | <Elegantbeef> Yep |
01:33:02 | FromDiscord | <Rika> {.edit: 0..0.} |
01:33:12 | FromDiscord | <Elegantbeef> `template edit(a: Slice){.pragma.}` |
01:33:32 | FromDiscord | <Rika> HSlice probably better? |
01:33:44 | FromDiscord | <Elegantbeef> Probably not |
01:33:54 | FromDiscord | <Rika> I forgot which is homo and which is Herero |
01:33:57 | FromDiscord | <Elegantbeef> Since you probably never want to support `"hello"..10` |
01:33:57 | FromDiscord | <Rika> Hetero |
01:34:09 | FromDiscord | <Elegantbeef> `Slice` is the homogenous |
01:34:17 | FromDiscord | <Rika> Okay then that’s what I meant |
01:34:39 | FromDiscord | <Elegantbeef> You will need a macro in this case but alas |
01:36:33 | FromDiscord | <Generic> you can have pragmas with multiple parameters though |
01:38:49 | FromDiscord | <Elegantbeef> Nevermind we can bodge around the `hasCustomPragma` and `getCustomPragma` limitation with an overloaded template |
01:43:52 | FromDiscord | <voidwalker> Help. Stuck. So I have this: |
01:44:34 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44tD |
01:44:49 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44tD" => "https://play.nim-lang.org/#ix=44tE" |
01:44:54 | FromDiscord | <voidwalker> `INSERT OR REPLACE INTO title_basics (tconst,titleType,primaryTitle,originalTitle,isAdult,startYear,endYear,runtimeMinutes,genres) VALUES (?,?,?,?,?,?,?,?,?)` |
01:45:18 | FromDiscord | <voidwalker> result of echo |
01:45:51 | FromDiscord | <Rika> The issue is! |
01:45:52 | FromDiscord | <Rika> ? |
01:45:54 | FromDiscord | <Rika> |
01:46:07 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44tE" => "https://play.nim-lang.org/#ix=44tF" |
01:46:10 | FromDiscord | <voidwalker> (edit) "result of ... echo" added "first " |
01:46:39 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44tG |
01:46:48 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44tG" => "https://play.nim-lang.org/#ix=44tH" |
01:47:59 | FromDiscord | <voidwalker> it would appear it errors after binding, when doing tryExec |
01:48:22 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=44tI to really get fancy 😛↵(@Dale) |
01:48:54 | FromDiscord | <Elegantbeef> Yes that `Slice or array or seq or typedesc[Default]` is a bodge |
01:49:13 | FromDiscord | <Elegantbeef> you could have those all be their own names |
01:49:16 | FromDiscord | <Elegantbeef> like `editRange` `editColl` `edit` |
01:49:31 | FromDiscord | <Elegantbeef> Or a macro that properly resolves them |
01:51:30 | FromDiscord | <Dale> Yeah that's a little closer to what I'd create |
01:51:37 | FromDiscord | <Dale> These are great examples thoguh, thank you |
01:51:43 | FromDiscord | <Dale> (edit) "thoguh," => "though," |
01:51:44 | FromDiscord | <Elegantbeef> No problem |
01:52:07 | FromDiscord | <Elegantbeef> You actually can do quite a lot with Nim without writing macros |
01:52:16 | FromDiscord | <Elegantbeef> I have a whole toy ECS written that way |
01:52:39 | FromDiscord | <Dale> Oh god, I have been debating whether to go with ECS or not recently |
01:52:41 | FromDiscord | <Elegantbeef> Well it has a single macro, but other than that it's all just tuples 😄 |
01:53:45 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> It's was a fun exercise, if interested https://github.com/beef331/nimtrest/blob/master/yeacs.nim#L128-L160 |
01:54:03 | FromDiscord | <Elegantbeef> Depending on your game it's really complicated for not much benefit |
01:54:17 | FromDiscord | <Dale> Yeah I'm making mostly platformers |
01:54:24 | FromDiscord | <Elegantbeef> 3D or 2D? |
01:54:42 | FromDiscord | <Elegantbeef> A rules engine, or EC could be enough for you |
01:54:46 | FromDiscord | <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:50 | FromDiscord | <Dale> 2D |
01:55:14 | FromDiscord | <Dale> I'm gonna use a hybrid system where you have actors and components, with logic and data in them |
01:55:19 | FromDiscord | <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:47 | FromDiscord | <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:03 | FromDiscord | <Elegantbeef> Yea if you're not making stupid simple games like me makes sense 😄 |
01:58:33 | FromDiscord | <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:54 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> I mean you could use flags for that |
02:00:09 | FromDiscord | <Elegantbeef> Some ECS have a tag system |
02:00:18 | * | rockcavera quit (Remote host closed the connection) |
02:00:45 | FromDiscord | <Elegantbeef> But i shush about ecs as i've never used one |
02:00:51 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> I defer to rlipsc |
02:01:05 | FromDiscord | <Dale> I mean, I could be missing something, but I have little experience with hardcore ECS so |
02:01:27 | FromDiscord | <Dale> I'll try it out eventually haha |
02:02:24 | FromDiscord | <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:06 | FromDiscord | <Elegantbeef> ECS seems to have this weird side effect with gamedevs, a lot of people are like "Must use ECS now" |
02:08:25 | FromDiscord | <Elegantbeef> But most of the time it's like "Dude you're making pong" |
02:08:35 | FromDiscord | <huantian> What if I need to customize my balls |
02:08:47 | FromDiscord | <Dale> That's a great quote |
02:08:47 | FromDiscord | <huantian> Or my paddles |
02:09:19 | FromDiscord | <Elegantbeef> Cant tell if huan had the good quote or me |
02:09:36 | FromDiscord | <Dale> Huan haha |
02:09:43 | FromDiscord | <Dale> You are right though |
02:10:10 | FromDiscord | <Elegantbeef> No related one bit, but jesus does the gnome screencast not have a way to customize the bitrate |
02:10:23 | FromDiscord | <Elegantbeef> I do not need a 300mb file for like a minute of video |
02:10:37 | FromDiscord | <huantian> Just ffmpeg it down |
02:10:44 | FromDiscord | <Elegantbeef> Lol |
02:10:47 | FromDiscord | <Elegantbeef> Oh wait you're serious |
02:12:09 | FromDiscord | <huantian> I mean I’m kinda serious |
02:12:35 | FromDiscord | <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:20 | FromDiscord | <voidwalker> https://discord.com/channels/371759389889003530/371759389889003532/997680610309066792 any idea? |
02:56:33 | FromDiscord | <TryAngle> I haven't seen a single include yet, always used import |
02:56:36 | FromDiscord | <TryAngle> what is include? |
02:56:47 | FromDiscord | <Elegantbeef> It's copy paste the module at the `include` site |
02:56:50 | FromDiscord | <Dale> Think it pastes code directly |
02:56:55 | FromDiscord | <Elegantbeef> You pretty much never use it directly |
02:56:59 | FromDiscord | <TryAngle> ah I see |
02:57:24 | FromDiscord | <Elegantbeef> Include is only for specific cases that like wanting to seperate a module across multiple files |
02:58:34 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Include is only for": 🤔 |
02:58:57 | FromDiscord | <TryAngle> I see so have something like a "mod.rs" like rust does and u include all the other files in that? |
02:59:07 | FromDiscord | <Elegantbeef> `include` works just like C's include |
02:59:25 | FromDiscord | <TryAngle> I haven't written any multifile c projects in my life |
02:59:37 | FromDiscord | <TryAngle> only uni homework |
02:59:41 | FromDiscord | <Elegantbeef> you've never `#iinclude`d anything? |
02:59:56 | FromDiscord | <TryAngle> sometimes I included .h files |
03:00:00 | FromDiscord | <Elegantbeef> The way C's include work is paste the content of the file you include where you call it |
03:00:21 | FromDiscord | <TryAngle> ah wait, so u inlcude .h files to not include the full code, only the forward declarations? |
03:00:26 | FromDiscord | <TryAngle> is that the point of .h fiels?? |
03:00:32 | FromDiscord | <Elegantbeef> So if you `#include "myfile.h"` it copies `myfile.h` there |
03:00:50 | FromDiscord | <TryAngle> wow finally I understand the point of .h files |
03:00:55 | FromDiscord | <TryAngle> not even c fanboys could explain |
03:01:04 | FromDiscord | <TryAngle> (edit) "c" => "c/c++" |
03:01:05 | FromDiscord | <Elegantbeef> Header files exist to seperate compilation units iirc |
03:02:13 | FromDiscord | <Elegantbeef> The funny thing tryangle is it makes a lot more sense when you realise `#include` is just a preprocessor |
03:02:44 | FromDiscord | <Elegantbeef> This is also why people heavily use `ifndef` |
03:03:07 | FromDiscord | <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:12 | FromDiscord | <Dale> Even though C++ has pragma once, I still see people using old school header guards |
03:05:42 | FromDiscord | <Elegantbeef> Cant teach an old dog new tricks apparently 😄 |
03:06:24 | FromDiscord | <Elegantbeef> Dont know how old the once pragma is but maybe it's due to people being used to an older C++ |
03:07:18 | FromDiscord | <Elegantbeef> To answer this you could↵(@TryAngle) |
03:07:26 | FromDiscord | <Elegantbeef> https://github.com/filcuc/nimqml/blob/master/src/nimqml.nim it's what this library does |
03:07:45 | FromDiscord | <Elegantbeef> It's not a great way to write code, but depending on what you're working on it might be forced |
03:08:20 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Cant teach an old": I mean isn't that the issue with languages like c++? |
03:08:57 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Kinda, also the whole standard/ multiple compilers slowing down progress |
03:09:40 | FromDiscord | <Elegantbeef> Modules were supposed to be amazing but the spec and implementation makes them pretty much useless |
03:09:51 | FromDiscord | <TryAngle> for example in java in my shool we still got tought anonymous classes instead of lamdas |
03:10:09 | FromDiscord | <TryAngle> I was actually super suprised at my uni we used lamdas and streams in java |
03:14:23 | FromDiscord | <TryAngle> I'm already scared of rust's always backwards compatible default |
03:14:35 | FromDiscord | <TryAngle> (edit) "compatible default" => "compatibility rule" |
03:14:44 | FromDiscord | <Elegantbeef> I mean it's a requirement for major releases |
03:15:05 | FromDiscord | <Elegantbeef> You do not want to cause issues for your users unless you have to with major releases |
03:15:23 | FromDiscord | <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:32 | FromDiscord | <TryAngle> like rust 2015, 2018 and 2021 |
03:15:43 | FromDiscord | <Elegantbeef> Yea that's mostly dumb |
03:18:44 | FromDiscord | <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:27 | FromDiscord | <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:45 | FromDiscord | <creikey> some kind of `s.add(0)` then cast it into a string |
04:15:58 | FromDiscord | <huantian> You can probably just toOpenArray? |
04:15:59 | FromDiscord | <creikey> (although the struct for seq is different from string I think) |
04:16:09 | FromDiscord | <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:12 | FromDiscord | <huantian> Is there one for strings I can never remember |
04:16:15 | FromDiscord | <creikey> strings are ull terminated |
04:16:16 | FromDiscord | <creikey> (edit) "ull" => "null" |
04:16:23 | FromDiscord | <creikey> utf8 seq byte isn't |
04:26:03 | FromDiscord | <huantian> Oh I thought that toOpenArray would return a view but I don’t think that would’ve worked anyways |
04:34:50 | FromDiscord | <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:18 | FromDiscord | <Pestillium> sent a code paste, see https://play.nim-lang.org/#ix=44tY |
04:38:23 | FromDiscord | <Pestillium> (edit) "https://play.nim-lang.org/#ix=44tY" => "https://play.nim-lang.org/#ix=44tZ" |
04:41:13 | FromDiscord | <Elegantbeef> Sadly not↵(@huantian) |
04:42:08 | FromDiscord | <Elegantbeef> Aslong as you arent passing it to a procedure that expects a cstring it's a non issue↵(@creikey) |
04:42:45 | FromDiscord | <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:31 | FromDiscord | <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:37 | FromDiscord | <creikey> so I just cast it back to string because the bytes are utf8 |
04:49:06 | FromDiscord | <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:03 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Which extension? |
05:03:09 | FromDiscord | <creikey> the most popular one |
05:03:20 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997730131248423033/unknown.png |
05:03:26 | FromDiscord | <Elegantbeef> Switch to saems |
05:03:28 | FromDiscord | <Elegantbeef> Live happy life |
05:03:41 | FromDiscord | <creikey> this looks cool |
05:03:44 | FromDiscord | <creikey> it's written in nim? |
05:03:50 | FromDiscord | <Elegantbeef> Yes |
05:04:27 | FromDiscord | <creikey> error is gone but go to definition doesn't work |
05:04:36 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997730450430771301/unknown.png |
05:05:00 | FromDiscord | <creikey> weird even local variables doesnt work |
05:05:16 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim#options you may have to setup `nim.project` if it doesnt understand your project |
05:05:43 | FromDiscord | <Elegantbeef> Or if you havent just restart vscode |
05:05:47 | FromDiscord | <Elegantbeef> that also might get it to work |
05:06:52 | FromDiscord | <creikey> oh interesting does it not recursively search for nimble file |
05:07:03 | FromDiscord | <creikey> I think problem might be that the nimble project isn't in the root directory of the folder I opened |
05:07:13 | FromDiscord | <Elegantbeef> I imagine not |
05:07:22 | FromDiscord | <Elegantbeef> Finding nim projects accurately is a whole ordeal |
05:08:00 | FromDiscord | <creikey> why not like git? |
05:08:07 | FromDiscord | <creikey> search for first .nimble it sees recursively updwards |
05:08:09 | FromDiscord | <creikey> (edit) "updwards" => "upwards" |
05:08:10 | FromDiscord | <creikey> from file location |
05:08:25 | FromDiscord | <Elegantbeef> PRs welcome is my response |
05:08:32 | FromDiscord | <Elegantbeef> I know saem had said it was a bitch to do |
05:08:41 | FromDiscord | <creikey> oh dang I'll look into it |
05:09:12 | FromDiscord | <Elegantbeef> I think it might be down to a nimsuggest thing |
05:09:14 | FromDiscord | <creikey> I'm not sure what this project mapping is |
05:09:32 | FromDiscord | <creikey> doesn't seem to be the nimble file |
05:09:48 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997731755970797568/unknown.png |
05:09:54 | FromDiscord | <creikey> is this supposed to be all the files in the project? |
05:10:24 | FromDiscord | <Elegantbeef> It should be your main entry file |
05:10:24 | FromDiscord | <Elegantbeef> If you dont have a single entry yes |
05:10:53 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim/issues/93#issuecomment-1129486086 |
05:11:23 | FromDiscord | <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:38 | FromDiscord | <creikey> after setting project path and reloading twice still doesn't work |
05:12:11 | FromDiscord | <creikey> no way https://media.discordapp.net/attachments/371759389889003532/997732356146339930/unknown.png |
05:12:50 | FromDiscord | <voidwalker> Error: unhandled exception: error binding param in position 1 [DbError] |
05:13:06 | FromDiscord | <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:12 | FromDiscord | <voidwalker> how do you handle bindParam on a dbsqlite/preparedSql statement ? |
05:13:29 | FromDiscord | <voidwalker> it seems that on rebinding, it errors out |
05:14:28 | FromDiscord | <voidwalker> do I need to reinitialize it as a var, every time I use bind/exec ? |
05:15:12 | FromDiscord | <voidwalker> Oh I think I have to do finalize |
05:15:26 | FromDiscord | <voidwalker> https://nim-lang.org/docs/db_sqlite.html#finalize%2CSqlPrepared |
05:15:29 | FromDiscord | <voidwalker> 0 words explaining it :\ |
05:21:42 | FromDiscord | <creikey> yeah nimsuggest is completely broken on my machine beef |
05:21:44 | FromDiscord | <creikey> just doesn't start |
05:21:54 | FromDiscord | <creikey> this is a clean install of windows 11 new computer |
05:21:59 | FromDiscord | <Elegantbeef> Well how the hell was it working a few seconds ago 😄 |
05:22:16 | FromDiscord | <Elegantbeef> You're on `1.6.6`? |
05:22:33 | FromDiscord | <creikey> In reply to @Elegantbeef "Well how the hell": it's not |
05:22:37 | FromDiscord | <creikey> it never was |
05:22:39 | FromDiscord | <Elegantbeef> It was too |
05:22:42 | FromDiscord | <creikey> the checking is done via the compiler |
05:22:43 | FromDiscord | <creikey> In reply to @Elegantbeef "It was too": when/ |
05:22:44 | FromDiscord | <creikey> (edit) "when/" => "when?" |
05:22:46 | FromDiscord | <creikey> In reply to @Elegantbeef "You're on `1.6.6`?": yes |
05:22:53 | FromDiscord | <creikey> currently cloning nim so I can build nimsuggest with koch |
05:23:05 | FromDiscord | <voidwalker> may I suggest you use a real development enviroment, and try a popular linux distro ? :\ |
05:23:16 | FromDiscord | <Elegantbeef> Lol |
05:23:17 | FromDiscord | <creikey> In reply to @voidwalker "may I suggest you": I'm shipping to windows users this is a waste of time |
05:23:27 | FromDiscord | <Elegantbeef> you can always use nimlsp + kate 😛 |
05:23:38 | FromDiscord | <creikey> I just switched to nimlsp and it crashes does not startt |
05:23:38 | FromDiscord | <creikey> (edit) "startt" => "start" |
05:23:41 | FromDiscord | <creikey> I think because it uses nimsuggest |
05:23:45 | FromDiscord | <Elegantbeef> Yea it does |
05:23:52 | FromDiscord | <Elegantbeef> Everything uses nimsuggest |
05:23:55 | FromDiscord | <voidwalker> VSCodium has been incredibly reliable so far for me on linux.. surprising. |
05:23:56 | FromDiscord | <creikey> oh go |
05:23:57 | FromDiscord | <creikey> (edit) "go" => "god" |
05:24:05 | FromDiscord | <creikey> In reply to @voidwalker "VSCodium has been incredibly": I'm sure it would work fine on linux |
05:24:07 | FromDiscord | <creikey> I have no doubt about that |
05:24:10 | * | noeontheend quit (Ping timeout: 240 seconds) |
05:24:15 | FromDiscord | <creikey> I can use linux I used linux for years |
05:24:28 | FromDiscord | <creikey> but that's a waste of time most people are windows users this game is for windows |
05:24:39 | FromDiscord | <creikey> you can't debug platform specific windows bugs on linux |
05:24:54 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> Meanwhile me just assuming my code works on windows |
05:25:04 | FromDiscord | <Elegantbeef> I dont know sql |
05:25:56 | FromDiscord | <creikey> do I have to build everything or can I just build nimsuggest? |
05:26:07 | FromDiscord | <Elegantbeef> That's not me being humble or coy I have never used sql in my life |
05:26:15 | FromDiscord | <creikey> lol https://media.discordapp.net/attachments/371759389889003532/997735896700964904/unknown.png |
05:26:37 | FromDiscord | <Elegantbeef> I dont remember how to just build tools |
05:26:59 | FromDiscord | <creikey> looks like we're building alll |
05:27:01 | FromDiscord | <creikey> (edit) "alll" => "all" |
05:27:03 | FromDiscord | <creikey> surely it can't take that long |
05:27:16 | FromDiscord | <Elegantbeef> On my xeon1231v3 it takes like 2 minutes without a cache |
05:27:26 | FromDiscord | <creikey> that's so fast actually what |
05:27:36 | FromDiscord | <creikey> I have a 7nth gen laptop i7 |
05:27:49 | FromDiscord | <creikey> is the bootstrap compiler generated C? |
05:27:51 | FromDiscord | <creikey> or is that banned |
05:28:07 | FromDiscord | <Elegantbeef> Bootstrapped is a cherrypicked C source |
05:28:29 | FromDiscord | <Elegantbeef> It's of course generated from a bootstrapped compiler |
05:28:49 | FromDiscord | <Elegantbeef> The fun compiler paradox |
05:29:03 | FromDiscord | <creikey> do people look at the nimsuggest github for issues or is my issue there not going to do anything? |
05:29:16 | FromDiscord | <creikey> I know the issue https://media.discordapp.net/attachments/371759389889003532/997736655450554490/unknown.png |
05:29:23 | FromDiscord | <creikey> oh my god windows antivirus has to have deleted dlls |
05:29:26 | FromDiscord | <creikey> that nimsuggest used |
05:29:27 | FromDiscord | <creikey> I knew it |
05:29:40 | FromDiscord | <Elegantbeef> I cant remember if nimsuggest issues are supposed to be on that repo or Nim's |
05:29:54 | FromDiscord | <Elegantbeef> Using Nim to write a windows game, it's going to go swimmingly 😄 |
05:29:59 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997736834580885575/unknown.png |
05:30:03 | FromDiscord | <creikey> In reply to @Elegantbeef "*Using Nim to write": technically it's not a windows game |
05:30:09 | FromDiscord | <creikey> the game is in godot |
05:30:11 | FromDiscord | <creikey> this server is in nim |
05:30:27 | FromDiscord | <Elegantbeef> So then why are you making the server for windows? |
05:30:31 | FromDiscord | <Elegantbeef> Most people run servers on Linux |
05:30:39 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> Ah ok |
05:30:59 | FromDiscord | <Elegantbeef> You're using gdscript though eh? |
05:31:03 | FromDiscord | <creikey> yeah |
05:31:07 | FromDiscord | <creikey> gdscript is great I'm very fast with it |
05:31:18 | FromDiscord | <Elegantbeef> Eh i dislike it but that's cause i'm an asshat |
05:31:26 | FromDiscord | <creikey> In reply to @Elegantbeef "Eh i dislike it": it's probably not good |
05:31:27 | FromDiscord | <Elegantbeef> I'm just a bit confused about the window specific things then |
05:31:37 | FromDiscord | <creikey> I would really like one language to do anything like nim |
05:31:43 | FromDiscord | <creikey> nim would be great for godot |
05:31:52 | FromDiscord | <creikey> but like honestly |
05:31:53 | FromDiscord | <Elegantbeef> It's pretty interesting for godot |
05:32:02 | FromDiscord | <creikey> godot is so good because to script you don't need to depend on a C toolchain |
05:32:13 | FromDiscord | <creikey> it's just like 8 cpp files bundled into the application |
05:32:16 | FromDiscord | <Elegantbeef> Bit tedious to use but that aside it's nice to use a proper language for gamedev |
05:32:34 | FromDiscord | <creikey> In reply to @creikey "it's just like 8": the interpreter for gdscript |
05:32:46 | FromDiscord | <creikey> right now you can download 40 megabytes and program for any godot game on any platform |
05:32:47 | FromDiscord | <creikey> very nice |
05:32:52 | FromDiscord | <creikey> with nim not so much |
05:33:06 | FromDiscord | <creikey> choosenim was completely broken on ubuntu 22.04 for a bit |
05:33:09 | FromDiscord | <creikey> needed openssl 1.1 |
05:33:21 | FromDiscord | <Elegantbeef> I mean sure |
05:33:22 | FromDiscord | <creikey> like just because it transpiles to C the toolchain for nim is so complicated |
05:33:46 | FromDiscord | <Dale> Complicated? |
05:33:52 | FromDiscord | <Elegantbeef> I've honestly never found it that way |
05:34:08 | FromDiscord | <creikey> I mean like it automatically is because you don't need 1 compiler to compile a nim program you need 2 |
05:34:34 | FromDiscord | <creikey> 2 compilers is more complicated than 0 in gdscript's case |
05:34:36 | FromDiscord | <Elegantbeef> I mean in theory you could ship zig 😛 |
05:34:38 | FromDiscord | <Dale> I did `pacman -S nim`, wrote a file, and did `nim c -r file`, can’t get much simpler than that |
05:34:40 | FromDiscord | <creikey> gdscript is 0.2 of a compiler |
05:35:01 | FromDiscord | <Elegantbeef> Yea i mean you're just talking about the benefits of a scripting langauge |
05:35:03 | FromDiscord | <creikey> In reply to @Dale "I did `pacman -S": arch linux is always nice |
05:35:14 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Like this is established feature of scripting languages |
05:35:56 | FromDiscord | <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:04 | FromDiscord | <creikey> probably not depend on gcc or llvm or anything giant and complicated |
05:36:20 | FromDiscord | <Elegantbeef> Now you have a very specific language that's not very portable |
05:36:34 | FromDiscord | <creikey> well like it would be if you had team of people and like 5 years |
05:36:35 | FromDiscord | <Dale> And probably not very well optimised |
05:36:49 | FromDiscord | <Elegantbeef> At that point just compile to wasm and use a wasm runtime |
05:36:55 | FromDiscord | <creikey> In reply to @Elegantbeef "At that point just": wasm runtime so complicated |
05:36:59 | FromDiscord | <Elegantbeef> Atleast you'd be portable have a small toolchain and fastish |
05:37:30 | FromDiscord | <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:11 | FromDiscord | <creikey> In reply to @Elegantbeef "Now you have a": yeah it would be lot of work to be portable |
05:38:15 | FromDiscord | <creikey> but like 99% of end users are running windows |
05:38:18 | FromDiscord | <Dale> I wouldn’t bet. Just being native doesn’t equate to speed |
05:38:24 | FromDiscord | <creikey> for games windows x64 for everything else wasm |
05:38:31 | FromDiscord | <creikey> (edit) "x64" => "x86" |
05:39:03 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> Adds another "todo" item to his list, a language that compiles to wasm |
05:39:16 | FromDiscord | <creikey> I mean I don't know that this is true but it seems like probably |
05:39:32 | FromDiscord | <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:42 | FromDiscord | <creikey> but look at how much time andrew is putting into upgrading llvm for zig |
05:39:48 | FromDiscord | <Elegantbeef> A JIT'd wasm runtime is probably going to be faster than unoptimized code |
05:40:07 | FromDiscord | <Dale> Yeah, I was thinking of LuaJIT personally |
05:40:14 | FromDiscord | <creikey> I was thinking of python |
05:40:17 | FromDiscord | <Elegantbeef> The hell are you talking about, it's an item on my list of things I want to do 😄↵(@creikey) |
05:40:29 | FromDiscord | <Dale> Python is slow compared to the other two |
05:40:34 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> Why C++ |
05:40:49 | FromDiscord | <creikey> In reply to @Elegantbeef "Why C++": don't have to bootstrap |
05:40:54 | FromDiscord | <creikey> maybe nim and you use the transpiled C |
05:41:09 | FromDiscord | <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:24 | FromDiscord | <Elegantbeef> I mean you could always just replace `cgen` with `asmgen` 😄 |
05:42:01 | FromDiscord | <creikey> In reply to @Elegantbeef "I mean you could": honestly not worth it |
05:42:16 | FromDiscord | <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:12 | FromDiscord | <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:18 | FromDiscord | <Dale> Bob Nystrom (spelling?) has a cool book for that kinda thing |
05:44:06 | FromDiscord | <Elegantbeef> But not explicitly needing a C compiler is really a small benefit |
05:44:24 | FromDiscord | <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:30 | FromDiscord | <creikey> I am probably a minority nim user |
05:44:35 | FromDiscord | <creikey> windows 11 |
05:44:45 | FromDiscord | <Elegantbeef> Windows is a small userbase for Nim users yes |
05:45:19 | FromDiscord | <Elegantbeef> I dont doubt the whole "This is a virus" isnt aiding it's growth |
05:45:41 | FromDiscord | <Dale> What’s the reason for that? I find that really odd |
05:46:07 | FromDiscord | <Elegantbeef> No clue the exact reason, but I do know there is a sizeable malware community that uses Nim |
05:46:17 | FromDiscord | <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:21 | FromDiscord | <creikey> nimsuggest in 1.6.0 works |
05:46:21 | FromDiscord | <creikey> fine |
05:46:24 | FromDiscord | <Elegantbeef> So if they use signature analysis it might hit Nim generated code |
05:46:34 | FromDiscord | <creikey> I've added .nimble to excluded list of windows antivirus |
05:46:48 | FromDiscord | <Dale> Do people still use antivirus programs these days? |
05:46:54 | FromDiscord | <Elegantbeef> Windows forces you to |
05:47:02 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997741125173526539/unknown.png |
05:47:09 | FromDiscord | <Elegantbeef> Windows defender is on by default and without going into registry you cannot disable it |
05:47:19 | FromDiscord | <Elegantbeef> Or atleast you couldnt |
05:47:27 | FromDiscord | <creikey> In reply to @creikey "": this error is when a dll used was made by a different compiler or something |
05:47:28 | FromDiscord | <Elegantbeef> Is that the from source nimsuggest?\> |
05:47:41 | FromDiscord | <creikey> In reply to @Elegantbeef "Is that the from": no just showing that itis' only 1.6.6 not 1.6.0 |
05:47:43 | FromDiscord | <creikey> 1.6.4 is also broken |
05:47:52 | FromDiscord | <creikey> In reply to @creikey "this error is when": what dll does nimsuggest use |
05:48:03 | FromDiscord | <Elegantbeef> you have the `.exe` right there |
05:48:21 | FromDiscord | <Elegantbeef> Dumpbin that bish |
05:48:37 | FromDiscord | <creikey> In reply to @Elegantbeef "you have the `.exe`": ? https://media.discordapp.net/attachments/371759389889003532/997741524647419974/unknown.png |
05:48:45 | FromDiscord | <Pestillium> sent a code paste, see https://play.nim-lang.org/#ix=44ue |
05:48:49 | FromDiscord | <flywind> I used win11 and kaspersky, didnt encounter antivirus issue anymore. I probably added some paths to the exception though. |
05:49:12 | FromDiscord | <Elegantbeef> pestillium you've fallen into a performance trap |
05:49:16 | FromDiscord | <Elegantbeef> each `zip` and `map` is allocating a brand new sequence |
05:49:38 | FromDiscord | <flywind> (edit) "used" => "use" | "didnt" => "dont" |
05:50:14 | FromDiscord | <creikey> how do I build koch? the linked doc page on the nim readme is broken |
05:50:19 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997741955343720488/unknown.png |
05:50:25 | FromDiscord | <Elegantbeef> It's built with `build_all` |
05:50:31 | FromDiscord | <creikey> I ran that and have nim.exe but not coche |
05:50:33 | FromDiscord | <creikey> (edit) "coche" => "koch" |
05:50:42 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997742050537644132/unknown.png |
05:50:51 | FromDiscord | <Elegantbeef> it's not in bin |
05:50:53 | FromDiscord | <flywind> nim c koch.nim |
05:50:59 | FromDiscord | <creikey> In reply to @flywind "nim c koch.nim": makes so much sense |
05:50:59 | FromDiscord | <Elegantbeef> it's in the root of `Nim` |
05:51:14 | FromDiscord | <creikey> In reply to @Elegantbeef "it's in the root": ? https://media.discordapp.net/attachments/371759389889003532/997742185283850270/unknown.png |
05:51:32 | FromDiscord | <Elegantbeef> I'm trying to figure out what you're after, you have 3 sequences and what is the desired outcome↵(@Pestillium) |
05:51:41 | FromDiscord | <creikey> In reply to @flywind "nim c koch.nim": wooo thanks |
05:52:21 | FromDiscord | <creikey> I'm so lost https://media.discordapp.net/attachments/371759389889003532/997742467929620490/unknown.png |
05:52:29 | FromDiscord | <creikey> I think I'm using the nim not just built by this codebase but from choosenim |
05:52:47 | FromDiscord | <Elegantbeef> no you're using the nim built here |
05:52:49 | FromDiscord | <creikey> no koch used the nim I just built |
05:52:56 | FromDiscord | <Elegantbeef> `bin\nim.exe` |
05:52:57 | FromDiscord | <creikey> so the config is broken? |
05:53:05 | FromDiscord | <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:26 | FromDiscord | <creikey> I checked out to version-1-6 |
05:53:27 | FromDiscord | <Elegantbeef> So you want a sequence with the sum of all 3 elements? |
05:53:36 | FromDiscord | <creikey> (edit) "version-1-6" => "version-1-6, this is 1.6.6 right?" |
05:55:01 | FromDiscord | <flywind> In reply to @creikey "no koch used the": How about `nim c -o:bin\nimsuggest.exe -d:danger nimsuggest/nimsuggest.nim`? |
05:55:44 | FromDiscord | <creikey> In reply to @flywind "How about `nim c": this will use the nim from choosenim |
05:55:48 | FromDiscord | <creikey> not just built |
05:56:07 | FromDiscord | <creikey> In reply to @flywind "How about `nim c": ? https://media.discordapp.net/attachments/371759389889003532/997743409747988480/unknown.png |
05:56:37 | FromDiscord | <creikey> do I open an issue on the nim github for not being able to build choosenim or is this user error |
05:56:42 | FromDiscord | <Elegantbeef> This is what i'd do |
05:56:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uf |
05:56:57 | FromDiscord | <Elegantbeef> Atleast if i understand the goal |
05:57:27 | FromDiscord | <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:36 | FromDiscord | <flywind> (edit) "the" => "to" |
05:57:44 | FromDiscord | <creikey> In reply to @flywind "Is the Nim source": no, I checked out to version-1-6-6 |
05:57:51 | FromDiscord | <creikey> because choosenim.exe fails to run at all on my machine |
05:57:57 | FromDiscord | <creikey> so I wanted to compile from source and see if that one would run |
05:59:03 | FromDiscord | <Pestillium> In reply to @Elegantbeef "Atleast if i understand": yeah that works, so I should just about the functional/declarative sequence methods? |
05:59:24 | FromDiscord | <Pestillium> (edit) "about" => "avoid" | "methods?" => "methods?e" |
05:59:28 | FromDiscord | <Elegantbeef> You only really want to use them in the case you only use them as a single operation |
05:59:28 | FromDiscord | <Pestillium> (edit) "methods?e" => "methods?" |
05:59:36 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> Chaining them is a performance trap |
05:59:49 | FromDiscord | <creikey> In reply to @flywind "So you checkout https://github.com/nim-lang/Nim/tre": not the tag the branch |
05:59:52 | FromDiscord | <Elegantbeef> There are things like zero functional and itertools which can make your life easier |
05:59:53 | FromDiscord | <creikey> I think that's the issue I'm having |
06:01:04 | FromDiscord | <creikey> nimsuggest compiled from scratch fails to run too! https://media.discordapp.net/attachments/371759389889003532/997744659638013992/unknown.png |
06:01:31 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997744769704927312/unknown.png |
06:01:31 | FromDiscord | <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:39 | FromDiscord | <Pestillium> In reply to @Elegantbeef "There are things like": zero functional looks like what I want then |
06:03:46 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997745337009721365/unknown.png |
06:03:54 | FromDiscord | <creikey> it looks like the compiled executable just links to a bunch of dlls that can't be found? |
06:04:07 | FromDiscord | <ripluke> https://github.com/Hejsil/zig-clap↵↵Does Nim have something like this? |
06:04:18 | FromDiscord | <ripluke> Or do I make it myself? |
06:04:28 | FromDiscord | <creikey> why is nimsuggest linking to kernel 32 |
06:04:30 | FromDiscord | <Elegantbeef> cligen, argparse and so many more |
06:04:56 | FromDiscord | <# Luke> In reply to @Elegantbeef "cligen, argparse and so": Argparse is literally killing me |
06:05:21 | FromDiscord | <flywind> docopt |
06:05:27 | FromDiscord | <# Luke> In reply to @ripluke "Argparse is literally killing": I provide params and it says I doesn't |
06:05:34 | FromDiscord | <creikey> In reply to @creikey "why is nimsuggest linking": does anybody know if this is normal? |
06:05:41 | FromDiscord | <# Luke> In reply to @flywind "docopt": O.o I’ll check that out |
06:05:41 | FromDiscord | <creikey> like is kernel32.dll what you link to even on 64 bit windows |
06:05:49 | FromDiscord | <Elegantbeef> Mine doesnt link to kernel32 😛↵(@creikey) |
06:05:54 | * | kenran joined #nim |
06:05:55 | * | kenran quit (Client Quit) |
06:05:55 | FromDiscord | <creikey> In reply to @Elegantbeef "*Mine doesnt link to": I'm sure it doesn't |
06:06:11 | FromDiscord | <Elegantbeef> is kernel32 even actually 32bit |
06:06:17 | FromDiscord | <Elegantbeef> Or is it backwards compat named |
06:06:24 | FromDiscord | <creikey> that's what I'm thinking |
06:06:24 | FromDiscord | <creikey> I think this is normal |
06:06:30 | FromDiscord | <creikey> I'm walking the dependencies of another working exe |
06:06:31 | FromDiscord | <creikey> to see what's different |
06:06:35 | FromDiscord | <creikey> ok this dependency walker is just bad |
06:07:05 | FromDiscord | <creikey> the problem is pthreads |
06:07:09 | FromDiscord | <creikey> that's the difference |
06:07:12 | FromDiscord | <flywind> `nim -v`? |
06:07:23 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997746251133104190/unknown.png |
06:07:36 | FromDiscord | <Elegantbeef> That's not 1.0.6 |
06:07:40 | FromDiscord | <Elegantbeef> 1.6.6 i mean |
06:07:42 | FromDiscord | <creikey> that's the one I just compiled |
06:07:48 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997746353193091082/unknown.png |
06:07:52 | FromDiscord | <Elegantbeef> Uhh |
06:08:04 | FromDiscord | <creikey> here is the one that choosenim installed https://media.discordapp.net/attachments/371759389889003532/997746422390726777/unknown.png |
06:08:28 | FromDiscord | <creikey> ok so the reason nimsuggest is failing to launch is because it's linking to libwinpthread-1.DLL |
06:08:32 | FromDiscord | <creikey> which I don't think can be found |
06:08:50 | FromDiscord | <creikey> ladies and gentlemen we have our solution https://media.discordapp.net/attachments/371759389889003532/997746611235070022/unknown.png |
06:08:57 | FromDiscord | <creikey> we'll just use free download |
06:08:58 | FromDiscord | <Elegantbeef> Oh god |
06:09:38 | FromDiscord | <creikey> I mean I don't see libwinpthreads in the nimble bin |
06:09:41 | FromDiscord | <Elegantbeef> Does this mean you dont have mingw in your path? |
06:09:49 | FromDiscord | <creikey> In reply to @Elegantbeef "Does this mean you": probably, but shouldn't choosenim do that? |
06:09:51 | FromDiscord | <Elegantbeef> `where gcc.exe` |
06:09:52 | FromDiscord | <creikey> what should be in my path |
06:10:00 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997746905545195621/unknown.png |
06:10:01 | FromDiscord | <creikey> the nimble bin is in my path |
06:10:05 | FromDiscord | <creikey> but libwinpthreads-1 is not in nimble bin |
06:10:23 | FromDiscord | <Elegantbeef> mingw where are you, we have a lot of things to do |
06:10:34 | FromDiscord | <creikey> where does choosenim install mingw? |
06:10:43 | FromDiscord | <creikey> here https://media.discordapp.net/attachments/371759389889003532/997747084033785998/unknown.png |
06:10:49 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997747108461432873/unknown.png |
06:10:51 | FromDiscord | <creikey> this is looking suspect |
06:11:20 | FromDiscord | <creikey> no libwinpthreads in 1.6.6 toolchain |
06:11:35 | FromDiscord | <flywind> It is in my mingw toolchain |
06:11:36 | FromDiscord | <creikey> none in 1.6.0 either |
06:11:43 | FromDiscord | <creikey> In reply to @flywind "It is in my": where did you check? |
06:11:44 | FromDiscord | <creikey> I'm in the bin |
06:11:56 | FromDiscord | <creikey> `libwinpthread-1.dll` |
06:12:01 | FromDiscord | <Elegantbeef> I think Mingw gets installed in programfiles by default |
06:12:10 | FromDiscord | <creikey> no it's in .choosenim I think |
06:12:57 | FromDiscord | <flywind> mingw64\bin\libwinpthread-1.dll |
06:12:59 | FromDiscord | <creikey> ok I'm analyzing dependencies of the choosenim that works |
06:13:06 | FromDiscord | <creikey> In reply to @flywind "mingw64\bin\libwinpthread-1.dll": oh not in 64 but the specific toolchain |
06:13:46 | FromDiscord | <creikey> spotted https://media.discordapp.net/attachments/371759389889003532/997747851532714064/unknown.png |
06:13:53 | FromDiscord | <creikey> how is choosenim accessing this if it's not in my path? |
06:14:07 | FromDiscord | <creikey> ok I have the answer fo rwhy the new nimsuggest is broken |
06:14:21 | FromDiscord | <creikey> 1.6.0 nimsuggest - does not link to libwinpthread↵1.6.6 nimsuggest - links to libwinpthread |
06:15:03 | FromDiscord | <creikey> it searches in path |
06:15:03 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997748178352869496/unknown.png |
06:15:13 | FromDiscord | <creikey> can you echo %PATH% flywind? |
06:15:41 | FromDiscord | <creikey> choosenim seems like it copies gcc.exe etc into the bin but doesn't copy libraries like libwinpthread-1 |
06:15:47 | FromDiscord | <creikey> afaik those aren't in my path |
06:16:14 | FromDiscord | <flywind> I added mingw64\mingw64\bin myself |
06:16:19 | FromDiscord | <creikey> whaat |
06:16:26 | FromDiscord | <creikey> In reply to @flywind "I added mingw64\mingw64\bin myself": what's the gcc in the nimble bin then? |
06:17:04 | FromDiscord | <creikey> https://media.discordapp.net/attachments/371759389889003532/997748686476017674/unknown.png |
06:17:06 | FromDiscord | <creikey> two gccs |
06:17:21 | FromDiscord | <creikey> In reply to @flywind "I added mingw64\mingw64\bin myself": nimsuggest works after I do this |
06:17:37 | FromDiscord | <creikey> do I open an issue in choosenim to add that to the path? |
06:17:42 | FromDiscord | <flywind> no gcc in my .nimble directory |
06:17:52 | FromDiscord | <creikey> In reply to @flywind "no gcc in my": do you use choosenim? |
06:18:13 | FromDiscord | <flywind> yeah |
06:18:27 | FromDiscord | <creikey> how is this possible |
06:18:35 | FromDiscord | <flywind> I probably install mingw myself |
06:18:47 | FromDiscord | <Phil> Been so long you forgot you did? |
06:18:54 | FromDiscord | <flywind> (edit) "I probably install mingw ... myself" added "by" |
06:19:23 | FromDiscord | <flywind> Yeah, I don't remeber how I install them especially after it works. |
06:19:30 | FromDiscord | <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:06 | FromDiscord | <voidwalker> is there such a proc that simply allows to run a proc, any proc, for each element of the sequence? |
06:20:14 | FromDiscord | <creikey> https://github.com/dom96/choosenim/issues/281 |
06:20:18 | FromDiscord | <creikey> I think this is an open issue |
06:21:58 | FromDiscord | <Elegantbeef> void what do you mean exactly |
06:22:10 | FromDiscord | <Elegantbeef> You could use `applyIt` |
06:22:27 | FromDiscord | <Elegantbeef> `mySeq.applyit(myProcCall(it, arg1, arg2))` |
06:22:55 | FromDiscord | <creikey> vscode fully working now |
06:23:00 | FromDiscord | <creikey> that was an adventure |
06:23:15 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44uh |
06:23:36 | FromDiscord | <voidwalker> I don't want to have the same type, I just want to run a proc having the elements as arguments |
06:23:53 | FromDiscord | <Elegantbeef> I do not follow |
06:24:07 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44ui |
06:24:22 | FromDiscord | <Elegantbeef> Yes i know what the template does |
06:24:47 | FromDiscord | <voidwalker> for k, val in tsv.row: |
06:24:48 | FromDiscord | <voidwalker> sqlQPrepd.bindParam(k+1, importDict[tsv.headers[k]].parseSq(val)) |
06:25:02 | FromDiscord | <voidwalker> I want to replace this with an applyIt or something |
06:26:54 | FromDiscord | <voidwalker> possible? |
06:27:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uj |
06:27:03 | FromDiscord | <Elegantbeef> I dont know why you want to but you do you |
06:27:17 | FromDiscord | <voidwalker> because you can write it one line ? 🙂 |
06:27:23 | FromDiscord | <voidwalker> I love one liners |
06:27:28 | FromDiscord | <Elegantbeef> One liners are horrid |
06:27:51 | FromDiscord | <Elegantbeef> Vertical code \> horizontal code |
06:27:57 | FromDiscord | <voidwalker> That must mean I am a very unelegant beef |
06:28:09 | FromDiscord | <voidwalker> Is your room tidy ? |
06:29:21 | FromDiscord | <Elegantbeef> Mostly |
06:34:05 | FromDiscord | <potatoxel> diagonal code c\:\:\:\: |
06:34:29 | FromDiscord | <Elegantbeef> Uhh |
06:34:31 | FromDiscord | <Elegantbeef> Sure |
06:34:36 | FromDiscord | <potatoxel> \:D |
06:35:01 | FromDiscord | <Elegantbeef> As long as your head is askew and that diagonal is vertical for everyone else |
06:35:17 | FromDiscord | <potatoxel> \:o |
06:38:11 | * | kots joined #nim |
06:39:50 | * | kots left #nim (#nim) |
06:44:11 | FromDiscord | <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:42 | FromDiscord | <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:28 | FromDiscord | <creikey> is orc slower or is this propaganda? |
06:47:30 | FromDiscord | <Dale> Has anyone made a voxellly block game in nim before? |
06:47:52 | FromDiscord | <creikey> In reply to @Dale "Has anyone made a": this sounds like a fun project |
06:48:04 | FromDiscord | <creikey> https://github.com/yglukhov/minecraft here's this from 6 years ago |
06:48:07 | FromDiscord | <huantian> In reply to @Dale "I’ve been doing some": Minecraft modding is fun but java is kinda like that |
06:48:13 | FromDiscord | <Elegantbeef> I made a raymarched renderer in Nim↵(@Dale) |
06:48:21 | FromDiscord | <Elegantbeef> raymarched voxel renderer\ |
06:48:31 | FromDiscord | <Elegantbeef> https://streamable.com/ancd8h |
06:49:15 | FromDiscord | <Dale> Haha that’s cool |
06:49:28 | FromDiscord | <creikey> In reply to @Elegantbeef "https://streamable.com/ancd8h": awesome |
06:49:33 | FromDiscord | <j-james> In reply to @creikey "is orc slower or": orc is broadly significantly faster |
06:49:38 | FromDiscord | <j-james> in certain cases it can be slower |
06:50:16 | FromDiscord | <Elegantbeef> Didnt we go over this yesterday creikey |
06:50:22 | FromDiscord | <creikey> yes I think so |
06:50:25 | FromDiscord | <creikey> I was double checking |
06:50:37 | FromDiscord | <Elegantbeef> GC's have performance characteristics |
06:51:27 | FromDiscord | <creikey> I still don't understand how orc works and I read like 3 things about it |
06:51:57 | FromDiscord | <Elegantbeef> Orc is RAII but on destructor it does a conventional GC check on any possible cyclic types |
06:52:05 | FromDiscord | <creikey> In reply to @Elegantbeef "Orc is RAII but": I thought this was refc? |
06:52:11 | FromDiscord | <Elegantbeef> It's ARC + a cycle breaker |
06:52:16 | FromDiscord | <Elegantbeef> No refc is not RAII based |
06:52:27 | FromDiscord | <creikey> refc is everything reference count |
06:52:40 | FromDiscord | <creikey> wait wait |
06:52:47 | FromDiscord | <creikey> how do you do RAII on things allocated like into an array |
06:52:49 | FromDiscord | <creikey> in the case of arc |
06:52:58 | FromDiscord | <creikey> oh just delete them when the array is deleted |
06:53:06 | FromDiscord | <creikey> I feel like if you don't count references it's easy to leak |
06:53:08 | FromDiscord | <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:10 | FromDiscord | <Elegantbeef> You decrement the ref counter on deletion |
06:53:19 | FromDiscord | <flywind> With scoped destructors, you can use destructora with refc. But seqs, strings are not. |
06:53:28 | FromDiscord | <flywind> (edit) "destructora" => "destructors" |
06:53:29 | FromDiscord | <creikey> In reply to @Elegantbeef "You decrement the ref": so arc does count references? |
06:53:33 | FromDiscord | <Elegantbeef> Then if their ref count is 0 you delete |
06:53:35 | FromDiscord | <Elegantbeef> Yes |
06:53:37 | FromDiscord | <Dale> Yep it counts |
06:53:41 | FromDiscord | <creikey> what's the difference with that and ref |
06:53:42 | FromDiscord | <creikey> (edit) "ref" => "refc" |
06:53:47 | FromDiscord | <Elegantbeef> Arc is scopep based memory management |
06:53:54 | FromDiscord | <creikey> refc is "deferred reference counting" |
06:53:57 | FromDiscord | <Elegantbeef> Arc injects the checks in at compile time so is deterministic |
06:54:19 | FromDiscord | <creikey> In reply to @Elegantbeef "Arc injects the checks": so there's no program time ref counting: |
06:54:20 | FromDiscord | <j-james> In reply to @creikey "so arc does count": arc is reference counting + significant optimizations to not count references whenever possible |
06:54:24 | FromDiscord | <creikey> (edit) "program time" => "runtime" | "counting:" => "counting?" |
06:54:28 | FromDiscord | <creikey> oh I see |
06:54:29 | FromDiscord | <creikey> so arc |
06:54:30 | FromDiscord | <creikey> like |
06:54:32 | FromDiscord | <creikey> looks at the program |
06:54:35 | FromDiscord | <creikey> and doesn't refc ref objects when i tcan |
06:54:37 | FromDiscord | <creikey> (edit) "i tcan" => "it can" |
06:54:44 | FromDiscord | <creikey> if it can't figure it out it's dynamic |
06:54:51 | FromDiscord | <j-james> yup |
06:54:51 | FromDiscord | <flywind> refc uses thread local heap allocators while are supports custom allocators. |
06:54:57 | FromDiscord | <Elegantbeef> Thanks to movement semantics and cursor↵(@j-james) |
06:55:08 | FromDiscord | <flywind> (edit) "are" => "arc" |
06:55:12 | FromDiscord | <creikey> so that's why it's so complicated? that sounds really hard |
06:55:18 | FromDiscord | <creikey> to analyze the program and decide when to inject a destructor |
06:55:18 | FromDiscord | <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:35 | FromDiscord | <creikey> In reply to @flywind "refc uses thread local": interesting |
06:55:44 | FromDiscord | <creikey> global heap allocator so memory can be used across threads? |
06:55:59 | FromDiscord | <Elegantbeef> Yes arc/orc are very good for threaded applications |
06:56:02 | FromDiscord | <Dale> I was looking at cursor earlier. Is that like a weak reference? |
06:56:08 | FromDiscord | <Elegantbeef> Sorta |
06:56:21 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> It's really just a alias to a reference that doesnt increment the counter |
06:56:34 | FromDiscord | <creikey> how does it do this?? https://media.discordapp.net/attachments/371759389889003532/997758625063907408/unknown.png |
06:56:38 | FromDiscord | <creikey> this is magic |
06:56:57 | FromDiscord | <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:17 | FromDiscord | <Dale> Hmm, so if I used it like a weak ref, I’d have to nil check before dereferencing? |
06:57:20 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> If you want to↵(@Dale) |
06:57:52 | FromDiscord | <Elegantbeef> I dont really know what a weak ref really entails |
06:57:56 | FromDiscord | <Elegantbeef> I've never written C++ |
06:58:40 | FromDiscord | <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:02 | FromDiscord | <Dale> Basically cache invalidation |
06:59:51 | FromDiscord | <Dale> If you don’t want your cache to prevent the object from being collected , a weak ref is what you want |
07:00:16 | FromDiscord | <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:17 | FromDiscord | <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:25 | FromDiscord | <flywind> (edit) removed "=> Yeah," |
07:01:48 | FromDiscord | <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:01 | FromDiscord | <voidwalker> wait, I think you can put if statements inside the brackets ? |
07:02:09 | FromDiscord | <Phil> Which, my lord does it make life easier |
07:02:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44uo |
07:03:05 | FromDiscord | <voidwalker> 😦 |
07:03:25 | FromDiscord | <Elegantbeef> Nim has move semantics if you cannot move you copy |
07:03:41 | FromDiscord | <Elegantbeef> It proves it in a programmer friendly way |
07:04:16 | FromDiscord | <j-james> or reference count with `ref` types |
07:04:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44up |
07:04:29 | FromDiscord | <Dale> In reply to @flywind "Yeah they are like": Wooo. Kinda like the name cursor too. |
07:05:37 | FromDiscord | <Elegantbeef> I guess to be idiomatic rust i should've done `do_something_that_moves` 😛 |
07:06:20 | FromDiscord | <j-james> i do kind of think a `--finetune/optimize` flag that throws warnings every time you copy/reference would be nice |
07:07:17 | FromDiscord | <Elegantbeef> You can enable `--hintAsError[Performance]:on` but it's not great |
07:07:55 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44uq |
07:08:00 | FromDiscord | <voidwalker> one line in my editor : D |
07:08:21 | FromDiscord | <Elegantbeef> Unreadable as hell, i love it |
07:08:52 | * | kots quit (Quit: Konversation terminated!) |
07:08:53 | FromDiscord | <voidwalker> other people's code has to be readable, not mine |
07:09:32 | FromDiscord | <Elegantbeef> \didnt you want contributors for this project? 😄 |
07:10:19 | FromDiscord | <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:35 | FromDiscord | <j-james> go for zero readability and do `from modules import nil` |
07:10:59 | FromDiscord | <voidwalker> and slapping if else on the same line is not elegant, and also defeats the purpose |
07:11:11 | FromDiscord | <Elegantbeef> I... hate you↵(@j-james) |
07:11:27 | FromDiscord | <Elegantbeef> I guess it's time for me to go find my libwayland whip |
07:12:16 | FromDiscord | <j-james> another pro tip: if you're going for line length, snake_case adds extra characters |
07:13:00 | FromDiscord | <Elegantbeef> Also remember java enterprise conventions |
07:13:12 | FromDiscord | <Elegantbeef> If the variable names are atleast 3 full words long it's not enterprise quality |
07:14:04 | FromDiscord | <j-james> oh yeah i'm about halfway done getting nim-wayland to build |
07:14:27 | FromDiscord | <j-james> i should be able to finish it tomorrow |
07:14:45 | FromDiscord | <j-james> got to wake up in six hours though so no time tonight |
07:15:27 | FromDiscord | <Elegantbeef> Hey dont give me excuses you're saving me the headache so i should thank you |
07:16:15 | FromDiscord | <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:50 | FromDiscord | <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:10 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Yea sometimes the Nim magic is too inviting |
07:18:38 | FromDiscord | <Elegantbeef> This goes to what dale implied earlier |
07:19:10 | FromDiscord | <Elegantbeef> Nim metaprogramming is extremely powerful which is scary 😄 |
07:23:44 | FromDiscord | <Phil> sent a long message, see http://ix.io/44us |
07:24:10 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44ut |
07:24:20 | FromDiscord | <Elegantbeef> `seq[Node]` |
07:24:29 | FromDiscord | <Phil> Not seq[pointer]? |
07:24:42 | FromDiscord | <Elegantbeef> Phil yard ships mimalloc with that repo |
07:24:57 | FromDiscord | <Elegantbeef> it's `src/mimalloc/include` |
07:26:07 | FromDiscord | <flywind> In reply to @Isofruit "Sidenote, beef you played": We have discussed regarding making mimalloc default if we see enough benefits. |
07:26:13 | FromDiscord | <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:34 | FromDiscord | <Phil> (edit) "repository".↵I" => "repository"-section.↵I" |
07:27:30 | FromDiscord | <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:09 | FromDiscord | <sOkam!> In reply to @Elegantbeef "`seq[Node]`": is `seq[Node](number)` needed? or are they dynamic? |
07:28:20 | FromDiscord | <sOkam!> meaning when they are initialized |
07:28:27 | FromDiscord | <sOkam!> (edit) "meaning when they are initialized ... " added "in the constructor" |
07:28:44 | FromDiscord | <Elegantbeef> `seq` are growable arrays |
07:29:03 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> I assume mimalloc doesnt hurt portability any? |
07:30:02 | FromDiscord | <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:12 | FromDiscord | <voidwalker> I get a linker error when running it |
07:30:19 | FromDiscord | <flywind> In reply to @Elegantbeef "I assume mimalloc doesnt": Yeah |
07:30:50 | FromDiscord | <Elegantbeef> I guess even if it did someone could just make a patchfile for their obscure compiler/platform |
07:30:51 | FromDiscord | <flywind> https://github.com/Araq/araqsgc is using mimalloc too,. |
07:31:23 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> You'd need https://github.com/Yardanico/mimalloc_nim/blob/master/src/main.nims |
07:32:08 | FromDiscord | <Elegantbeef> So you're best bet is cloning his repo copying `src` and the config to the project you want and going |
07:32:11 | FromDiscord | <flywind> true |
07:32:16 | FromDiscord | <Phil> Ahhhh, the config file there |
07:32:59 | FromDiscord | <flywind> Cloning your repo to that package will be a good option. |
07:33:15 | FromDiscord | <Elegantbeef> Hmm how much does it change the binary size? |
07:33:25 | FromDiscord | <Elegantbeef> Eh nevermind i'm dumb |
07:33:29 | FromDiscord | <Elegantbeef> `-d:useMalloc` would still exist 😄 |
07:42:22 | * | Jjp137 quit (Ping timeout: 244 seconds) |
07:42:41 | * | Jjp137 joined #nim |
08:16:00 | madprops | my github addon has buttons now https://i.imgur.com/y1XnYCQ.jpg |
08:18:07 | FromDiscord | <Elegantbeef> Nice |
08:34:19 | FromDiscord | <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:43 | FromDiscord | <voidwalker> wait.. don't i need the .c/.h files to wrap a c proc ? |
08:38:37 | * | matt_133779 joined #nim |
08:39:59 | FromDiscord | <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:03 | FromDiscord | <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:06 | FromDiscord | <voidwalker> but now I get an error on the line calling the function: `discard sqlite3_enable_load_extension(dbsql, onoff=1)` |
08:41:13 | FromDiscord | <voidwalker> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
08:41:59 | FromDiscord | <voidwalker> ah nvm, it was put before the db initialization |
08:42:32 | FromDiscord | <voidwalker> hmm nope, it's after |
08:45:27 | FromDiscord | <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:14 | FromDiscord | <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:36 | FromDiscord | <Dale> Was just looking at the nim extension settings in codium, what is the project file? |
09:19:55 | FromDiscord | <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:37 | FromDiscord | <Dale> Is it referring to the entrypoint file you pass to the compiler? |
09:23:19 | FromDiscord | <Phil> Yep |
09:23:58 | FromDiscord | <Dale> Ah, I should probably set that in a workspace config |
09:24:19 | FromDiscord | <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:40 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44uQ |
10:57:47 | FromDiscord | <aruZeta> (edit) "https://play.nim-lang.org/#ix=44uQ" => "https://paste.rs/E70" |
12:42:32 | FromDiscord | <PyryTheBurger> how do i iterate through a seq while every iteration i remove something from it |
12:43:41 | FromDiscord | <enthus1ast> i would return a new sequence where you've filtered out all the elements |
12:43:56 | FromDiscord | <PyryTheBurger> how |
12:44:06 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/sequtils.html#filterIt.t%2Cuntyped%2Cuntyped |
12:45:57 | FromDiscord | <PyryTheBurger> but what do you mean by return a new sequence and why do i need to filter? |
12:46:39 | FromDiscord | <PyryTheBurger> In reply to @enthus1ast "https://nim-lang.org/docs/sequtils.html#filterIt.t%": ? |
12:46:42 | FromDiscord | <enthus1ast> you cannot remove elements from a sequence you currently iterate over |
12:46:51 | FromDiscord | <PyryTheBurger> why |
12:47:01 | FromDiscord | <enthus1ast> try it, then you see |
12:47:25 | FromDiscord | <PyryTheBurger> i know but can you at least send like a code example of how do you mean "return a new seq" |
12:49:58 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/d6n |
12:52:26 | FromDiscord | <PyryTheBurger> oh so if i filter it returns a new seq |
13:00:06 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=44v8 |
13:00:41 | FromDiscord | <Phil> correct. For what purpose do you want to remove individual elements? |
13:00:55 | FromDiscord | <PyryTheBurger> In reply to @Isofruit "correct. For what purpose": particle system |
13:00:57 | FromDiscord | <Phil> Is it "remove all entries that do not satisfy condition X"? |
13:02:02 | FromDiscord | <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:27 | FromDiscord | <PyryTheBurger> remove all entries that have a lifeTime of 0 |
13:03:19 | FromDiscord | <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:36 | FromDiscord | <PyryTheBurger> yes ecactly |
13:04:29 | FromDiscord | <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:48 | FromDiscord | <Phil> I'm not sure I understand your question |
13:05:29 | FromDiscord | <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:39 | FromDiscord | <PyryTheBurger> yes yes but |
13:06:18 | FromDiscord | <PyryTheBurger> WHEN i wanmt to loop over a seq, should i loop over the lenght or the items in there |
13:09:29 | FromDiscord | <enthus1ast> you can find out yourself, just benchmark the different solutions (eg. using benchy) |
13:10:27 | FromDiscord | <enthus1ast> i would be quite suprised if there is a difference |
13:10:30 | FromDiscord | <Phil> In reply to @PyryTheBurger "WHEN i wanmt to": https://github.com/treeform/benchy↵That makes it pretty simple |
13:10:40 | FromDiscord | <Phil> In reply to @enthus1ast "i would be quite": Fascinatingly enough, there is one |
13:11:10 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vd |
13:11:36 | FromDiscord | <PyryTheBurger> so lenght is faster right |
13:11:46 | FromDiscord | <enthus1ast> have you compiled with all the correct defines? |
13:11:55 | FromDiscord | <enthus1ast> -d\:danger -d\:lto |
13:11:55 | FromDiscord | <Phil> Actually that's a fair point, let me check |
13:12:01 | FromDiscord | <PyryTheBurger> i dont know what defines mean |
13:12:09 | * | noeontheend joined #nim |
13:12:16 | FromDiscord | <enthus1ast> --gc\:arc |
13:12:19 | FromDiscord | <Phil> Nope, forgot that |
13:12:23 | FromDiscord | <Phil> And I tend to use orc |
13:14:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44ve |
13:15:20 | FromDiscord | <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:18 | FromDiscord | <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:10 | FromDiscord | <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:22 | Amun-Ra | or -d=xxx for posix afficionados |
13:26:51 | * | arkurious joined #nim |
13:30:38 | FromDiscord | <PyryTheBurger> okay |
13:52:00 | FromDiscord | <deech> Is there a `flatten` macro/template that concats a bunch of arbitrarily nested seqs `@[ @[...],@[[...]], @[], @[[[[...]]] ]` into a `@[...]`? |
14:03:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vm |
14:04:05 | FromDiscord | <Phil> Ignore benchy, that's a leftover from previous code in my "playground" project |
14:05:27 | FromDiscord | <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:59 | FromDiscord | <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:14 | FromDiscord | <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:25 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=44vo |
14:11:22 | FromDiscord | <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:12 | FromDiscord | <Require Support> is it impossible to use `when defined(xxx)` in a try/except block? getting weird errors |
14:17:48 | FromDiscord | <Require Support> nvm it was an error when using it before a `of "case1":` in a case statement |
14:21:14 | FromDiscord | <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:19 | FromDiscord | <retkid> how can i make a sequence of 1 value of a set size |
14:42:41 | FromDiscord | <retkid> i want a seq of 256 for a single string |
14:44:45 | FromDiscord | <retkid> eh i just used collect |
14:44:58 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/997876503977152522/unknown.png |
14:45:03 | FromDiscord | <retkid> we got graphs |
14:54:11 | FromDiscord | <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:47 | FromDiscord | <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:45 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44vQ |
15:26:27 | FromDiscord | <voidwalker> not really sure how to call sqlite3_load_extension, but the enable_load_extension one looks pretty straightforward.. |
15:29:09 | FromDiscord | <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:35 | FromDiscord | <Phil> I could see that causing issues during concatenation |
15:30:23 | FromDiscord | <voidwalker> I noticed that, but it happens when I try to run either procs |
15:30:46 | FromDiscord | <Phil> Also, I think you should enable the ability to load extensions first before actually loading one at a glance |
15:30:48 | FromDiscord | <Rika> Are you passing in a null c string |
15:31:03 | FromDiscord | <Phil> That is me not having any idea tbh tho |
15:31:14 | FromDiscord | <voidwalker> yeah as I said, I get that error running either/both procs |
15:31:37 | FromDiscord | <Phil> try to assign that proc to a variable and check if that variable is == nil |
15:34:11 | FromDiscord | <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:42 | FromDiscord | <voidwalker> the result of those procs are cint.. what do you mean assignment, like a pointer to it ? |
15:35:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44vZ |
15:36:11 | FromDiscord | <Phil> That should give you proper "false" and a proper typing |
15:36:21 | FromDiscord | <Rika> In reply to @Isofruit "That should rule out": Linux does not search in the CWD for dynamic libraries |
15:36:39 | FromDiscord | <Phil> Does it look on the PATH? |
15:37:13 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w0 |
15:37:29 | FromDiscord | <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:31 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44w0" => "https://play.nim-lang.org/#ix=44w1" |
15:37:42 | FromDiscord | <Phil> Try the same for the other proc just to be sure but I'm 99% convinced it must work |
15:38:48 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w2 |
15:39:41 | FromDiscord | <voidwalker> Wish someone actually cared about this and tried on their comp : P |
15:39:56 | FromDiscord | <Rika> I assume most of us are not at their computers |
15:40:07 | FromDiscord | <Phil> I am, but I'm not sure what all to import |
15:40:17 | FromDiscord | <Phil> The code copy paste is kinda incomplete 😛 |
15:40:29 | FromDiscord | <Rika> Use a debugger like GDB or something to see where it dies |
15:42:07 | FromDiscord | <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:26 | FromDiscord | <voidwalker> I think this should be enough |
15:42:27 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44w4 |
15:42:41 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44w4" => "https://play.nim-lang.org/#ix=44w5" |
15:42:55 | FromDiscord | <Phil> Ah, that one means I'd need an sqlite3.c file |
15:43:00 | FromDiscord | <voidwalker> ohh yeah, and the C source code from here: https://sqlite.org/amalgamation.html |
15:43:01 | FromDiscord | <Phil> Welp |
15:43:18 | FromDiscord | <voidwalker> (edit) "https://sqlite.org/amalgamation.html" => "https://sqlite.org/download.html" |
15:45:11 | FromDiscord | <Require Support> how to i know which module uses `pcre64.dll` 🤔 |
15:45:26 | FromDiscord | <voidwalker> Wish we'd get a free "ping Araq" with that nim book : P |
15:48:47 | Amun-Ra | it would have been some kind of non-electronic kind of ping |
15:48:55 | Amun-Ra | a knock rather |
15:56:21 | FromDiscord | <enthus1ast> @voidwalker\: try this↵echo dbsql.getAllRows(sql"SELECT sqlite\_compileoption\_used('ENABLE\_LOAD\_EXTENSION');") |
15:56:32 | FromDiscord | <enthus1ast> for me it outputs\:↵↵@[@["0"]] |
15:56:45 | FromDiscord | <enthus1ast> so i guess its just not compiled with that option |
15:58:36 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44w7 |
15:58:40 | FromDiscord | <enthus1ast> or .so in your case |
16:04:45 | FromDiscord | <voidwalker> I get `@[@["0"]]` as well |
16:05:23 | FromDiscord | <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:38 | FromDiscord | <voidwalker> Running `SELECT sqlite_compileoption_used('ENABLE_LOAD_EXTENSION');` in dbeaver, returns me a 1 |
16:06:49 | FromDiscord | <voidwalker> with that specific database opened |
16:07:12 | FromDiscord | <enthus1ast> dbeaver prolly has its own libsqlite3.dll |
16:07:17 | FromDiscord | <enthus1ast> .so |
16:07:33 | FromDiscord | <enthus1ast> in sqlite the db is just a file |
16:07:58 | FromDiscord | <enthus1ast> it depends wether the sqlite3 lib you're using can handle extenstions |
16:08:10 | FromDiscord | <voidwalker> ohh |
16:08:33 | FromDiscord | <voidwalker> sqlite> SELECT sqlite_compileoption_used('ENABLE_LOAD_EXTENSION');↵0 |
16:08:45 | FromDiscord | <voidwalker> i get this from sqlite cli |
16:08:49 | FromDiscord | <enthus1ast> yeah |
16:09:03 | FromDiscord | <enthus1ast> then your systems lib seem not to handle extentions |
16:09:38 | FromDiscord | <voidwalker> I am confused :[ |
16:10:18 | FromDiscord | <voidwalker> .dbconfig yield ` load_extension on` |
16:14:12 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix= |
16:16:15 | FromDiscord | <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:59 | FromDiscord | <voidwalker> this worked from sqlite cli |
16:24:00 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wc |
16:26:20 | FromDiscord | <!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:09 | FromDiscord | <enthus1ast> strange↵(@voidwalker) |
16:28:27 | FromDiscord | <voidwalker> I believe that compile option is deprecated |
16:28:58 | FromDiscord | <voidwalker> so that means it's on by default, off by option |
16:28:59 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=44we" => "https://paste.rs/UHn" |
16:29:00 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/wv6 |
16:30:45 | FromDiscord | <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:16 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix= |
16:39:16 | FromDiscord | <voidwalker> `select load_extension('/home/sgm/igma/libsqlite_zstd.so');` ? :\ |
16:40:29 | FromDiscord | <enthus1ast> if i try this i get\: ↵Error\: unhandled exception\: not authorized [DbError] |
16:42:59 | FromDiscord | <voidwalker> ah yes, that just loads the extension, loading still must be enabled via the C API |
16:55:41 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/997909399773388850/image.png |
16:55:50 | FromDiscord | <enthus1ast> mhh, any idea? |
16:56:03 | FromDiscord | <Generic> stack corruption |
16:57:13 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=44wk |
16:57:35 | FromDiscord | <enthus1ast> i was playing with the code |
16:57:48 | FromDiscord | <carlosri> sent a code paste, see https://play.nim-lang.org/#ix=44wl |
16:59:14 | FromDiscord | <Generic> what's the problem? |
17:02:59 | FromDiscord | <voidwalker> @carlosri https://nim-lang.org/docs/tut1.html#procedures-forward-declarations - you talking about the code or the forward declaration aspect ? |
17:03:14 | FromDiscord | <enthus1ast> @voidwalker\: no idea why it crashes |
17:03:20 | FromDiscord | <enthus1ast> or why it corrupts the stack |
17:03:20 | FromDiscord | <voidwalker> sigh 😦 |
17:03:31 | FromDiscord | <voidwalker> aren't we doing something obviously wrong ? |
17:03:38 | FromDiscord | <enthus1ast> not even sure what causes stack corruptions |
17:03:45 | FromDiscord | <enthus1ast> maybe wrong calling convention? |
17:03:46 | FromDiscord | <voidwalker> Like, we supposed to call it with the DbConn varaible ? |
17:03:58 | FromDiscord | <voidwalker> which is a PSQlite3 |
17:04:07 | FromDiscord | <vestel> In reply to @carlosri "Hi, i can understand": You need to return true somewhere |
17:04:10 | FromDiscord | <# 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:53 | FromDiscord | <Generic> In reply to @vestel "You need to return": it's already in there in the `n == 1` or `n == 0` branch |
17:05:15 | FromDiscord | <vestel> Oh, yes |
17:05:28 | FromDiscord | <# Luke> In reply to @vestel "You need to return": Nim doesn't make you explicitly write return |
17:05:33 | FromDiscord | <vestel> Then just forward declare both? |
17:05:43 | FromDiscord | <Generic> yeah |
17:05:58 | FromDiscord | <Generic> I'm super tired so I'm currently thinking in slow motion |
17:06:02 | FromDiscord | <# Luke> Why forward declare both? |
17:06:10 | FromDiscord | <Generic> yeah you only need to forward declare one |
17:06:15 | FromDiscord | <vestel> In reply to @ripluke "Nim doesn't make you": Ik, just didnt saw that if expression bruh |
17:06:16 | FromDiscord | <voidwalker> @arnetheduck any chance you're around ? |
17:07:28 | FromDiscord | <vestel> Btw why not just `n and 1`? |
17:07:45 | FromDiscord | <Generic> to impress their CS prof |
17:08:42 | FromDiscord | <Generic> also `n mod 2` is probably more understandable for a lot of people |
17:09:55 | FromDiscord | <vestel> In reply to @Generic "also `n mod 2`": Wrong.↵https://www.npmjs.com/package/is-odd |
17:10:38 | FromDiscord | <Generic> don't remind me of people not knowing basic builtin operators of the programming language they earn their living with |
17:15:00 | FromDiscord | <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:18 | FromDiscord | <# Luke> In reply to @Generic "also `n mod 2`": Yea |
17:51:29 | FromDiscord | <voidwalker> don't we have anyone really smart in here, that can figure out how to call sqlite C API ? :\ |
17:57:43 | FromDiscord | <enthus1ast> What one can try is to compile both, sqlite3 and the extension, I think we call it corretly |
18:15:04 | FromDiscord | <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:23 | FromDiscord | <sharpcdf> i havent really used nimscript before |
18:16:24 | * | CyberTailor joined #nim |
18:22:41 | * | krux02 joined #nim |
18:30:56 | FromDiscord | <voidwalker> @enthus1ast no need to compile the extension at this point, since the code fails even when just calling enable_load_extension |
18:33:13 | FromDiscord | <voidwalker> Oh wait, I saw you modified the proc declaration to point to the .dll |
18:35:04 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wG |
18:35:19 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44wH |
18:35:29 | FromDiscord | <voidwalker> it's working ? |
18:47:13 | FromDiscord | <# Luke> So I basically want to implement something that gets the version the cli program at comptime by reading the nimble file |
18:47:45 | FromDiscord | <# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44wJ |
18:49:53 | FromDiscord | <# Luke> sent a code paste, see https://play.nim-lang.org/#ix=44wL |
18:53:02 | FromDiscord | <# Luke> Any solution? |
18:54:03 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/SdK |
18:54:16 | FromDiscord | <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:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44wT |
19:17:26 | FromDiscord | <sharpcdf> oh ok |
19:17:34 | FromDiscord | <sharpcdf> i thought you use `nim` and not `nimble` |
19:17:59 | FromDiscord | <Phil> Try it first, typically you define tasks in nimble files, though I've also seen them defined in nims files |
19:18:21 | FromDiscord | <sharpcdf> nah it doesnt work, says it needs a .nimble file |
19:19:39 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44wU |
19:29:30 | FromDiscord | <Phil> In reply to @lantos "is there a way": What's the output you desire? A seq[proc] ? |
19:29:52 | FromDiscord | <lantos> yea |
19:29:54 | FromDiscord | <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:20 | FromDiscord | <creikey> In reply to @treeform "I cast seq[utin8] to": ws and jsony are working great together by the way |
19:30:26 | FromDiscord | <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:48 | FromDiscord | <treeform> In reply to @creikey "ws and jsony are": great! I am glad to hear it. |
19:31:27 | * | krux02 joined #nim |
19:31:37 | FromDiscord | <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:47 | FromDiscord | <Phil> maybe you can do some stuff there with macro magic, but I wouldn't bet on it. |
19:32:59 | FromDiscord | <Phil> Because this is hitting the wall of static typing |
19:33:10 | FromDiscord | <lantos> yeah I was thinking probably a register macro |
19:33:58 | FromDiscord | <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:10 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=44wX |
19:36:50 | FromDiscord | <sharpcdf> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: can you help me out with nimscript |
19:37:31 | FromDiscord | <sharpcdf> i think i might need to use nimble but i dont know for sure |
19:37:44 | FromDiscord | <Phil> Just as a sideremark, you have read the nimscript docs already I assume? |
19:37:48 | FromDiscord | <sharpcdf> yea |
19:37:52 | FromDiscord | <sharpcdf> they arent very helpful |
19:38:09 | FromDiscord | <sharpcdf> they dont say how to actually run nimscript tasks or anything like that |
19:38:38 | FromDiscord | <voidwalker> `var pzErrMsg: ptr cstring = cast[ptr cstring](alloc(4096))` |
19:38:45 | FromDiscord | <voidwalker> how do you print this pointer to cstring ? |
19:38:54 | FromDiscord | <voidwalker> i don't know pointers and cast yet, or cstrings :\ |
19:40:58 | Amun-Ra | what do you want to achieve? |
19:41:05 | FromDiscord | <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:05 | FromDiscord | <voidwalker> print the string it points to |
19:41:38 | Amun-Ra | echo pzErrMsgp[ |
19:41:42 | FromDiscord | <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:44 | Amun-Ra | echo pzErrMsg[] |
19:41:51 | FromDiscord | <sharpcdf> not task running |
19:41:56 | FromDiscord | <Phil> Man, I forgot how relaxing PMunch's voice is |
19:44:20 | FromDiscord | <voidwalker> `/usr/lib/libsqlite_zstd.so: undefined symbol: ` |
19:45:41 | FromDiscord | <voidwalker> I wonder what this means |
19:45:49 | FromDiscord | <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:08 | FromDiscord | <sharpcdf> 👍 |
19:46:34 | FromDiscord | <voidwalker> `echo dbsql.sqlite3_load_extension(zFile, zProc, pzErrMsg)` |
19:46:40 | FromDiscord | <voidwalker> `/usr/lib/libsqlite_zstd.so: undefined symbol: foo` |
19:46:42 | FromDiscord | <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:50 | FromDiscord | <voidwalker> (edit) "`echo" => "`var zProc: cstring = "foo"↵echo" |
19:47:23 | FromDiscord | <Phil> In reply to @voidwalker "`var zProc: cstring =": Don't you have to manually typecast normal strings to cstring via "foo".cstring ? |
19:47:39 | FromDiscord | <voidwalker> eh, enthus1ast's code, I took it for granted |
19:48:09 | FromDiscord | <voidwalker> well, it's `var zProc: cstring = "foo"` it's good |
19:48:11 | FromDiscord | <Phil> Hmm apparently I'm wrong |
19:48:17 | FromDiscord | <# Luke> In reply to @ripluke "I have the following": Can someone help me w/ this pls |
19:48:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44wY |
19:49:25 | FromDiscord | <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:34 | FromDiscord | <# Luke> In reply to @Isofruit "Just to be sure,": Yea |
19:49:47 | FromDiscord | <Phil> Interesting thought, not sure you can actually read a file at compiletime |
19:49:54 | FromDiscord | <# Luke> Hmm |
19:50:19 | FromDiscord | <# Luke> Lol gonna have to think about something else to get my version data |
19:51:04 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44wZ |
19:51:56 | FromDiscord | <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:01 | FromDiscord | <sharpcdf> yea |
19:52:04 | FromDiscord | <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:16 | FromDiscord | <huantian> you need to have openssl 1.1 installed |
19:52:22 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x0 |
19:52:24 | FromDiscord | <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:40 | FromDiscord | <# Luke> In reply to @sharpcdf "i have a `config.nims`": Isn't it -d? |
19:52:45 | FromDiscord | <# Luke> Only 1 dash? |
19:52:45 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=44x1 |
19:52:58 | FromDiscord | <# Luke> Or does that not make a difference? |
19:53:00 | FromDiscord | <sharpcdf> In reply to @ripluke "Isn't it -d?": `--` is a template you use to add arguments in nimscript |
19:53:01 | FromDiscord | <Phil> either `-d:ssl` or `--define:ssl` |
19:53:18 | FromDiscord | <# Luke> In reply to @sharpcdf "`--` is a template": Oh then try using define |
19:53:20 | FromDiscord | <Phil> As compiler flags |
19:53:31 | FromDiscord | <# Luke> In reply to @ripluke "Oh then try using": Instead of d |
19:53:34 | FromDiscord | <huantian> In reply to @huantian "you need to have": also make sure you have this installed |
19:53:47 | FromDiscord | <# Luke> In reply to @huantian "also make sure you": Afaik fedora does have it |
19:54:04 | FromDiscord | <# Luke> It's not arch 😁 |
19:54:10 | FromDiscord | <huantian> if the issue was the --d: thing then it would say you didn't compile with -d:ssl |
19:54:26 | FromDiscord | <# Luke> Oh |
19:54:32 | FromDiscord | <huantian> In reply to @ripluke "It's not arch 😁": you mean it's not ubuntu |
19:54:41 | FromDiscord | <# Luke> Ah yes |
19:54:58 | FromDiscord | <# Luke> Arch doesn't have it either tho |
19:55:03 | FromDiscord | <# Luke> Well base arch |
19:55:04 | FromDiscord | <huantian> I had it personally? |
19:55:14 | FromDiscord | <# Luke> I had to install it |
19:55:17 | FromDiscord | <huantian> since I had another package that depended on it for me |
19:55:21 | FromDiscord | <huantian> so I had 0 problems |
19:55:30 | FromDiscord | <# Luke> In reply to @huantian "since I had another": Yea that's how I got it |
19:55:46 | FromDiscord | <huantian> but making this a distro issue is dumb |
19:55:53 | FromDiscord | <huantian> it's a nim issue, it shouldn't need ancient openssl |
19:56:18 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x3 |
19:56:22 | FromDiscord | <# Luke> In reply to @huantian "it's a nim issue,": Yea |
19:56:25 | FromDiscord | <Phil> try it more step by step |
19:56:28 | FromDiscord | <# Luke> In reply to @Isofruit "Huh, you *can* read": O.o |
19:56:36 | FromDiscord | <# Luke> I'll try this |
19:56:41 | FromDiscord | <huantian> or use staticRead |
19:56:58 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x5 |
19:57:11 | FromDiscord | <# Luke> In reply to @huantian "or use staticRead": Yea, and if it's a multiline file can I use splitLines? |
19:57:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x6 |
19:58:03 | FromDiscord | <# Luke> In reply to @Isofruit "Can confirm staticRead works:": Yea I'll try it, thx for the help tho |
19:59:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44x7 |
19:59:04 | FromDiscord | <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:20 | FromDiscord | <sharpcdf> got it working when i manually put in the args |
19:59:24 | FromDiscord | <# Luke> In reply to @Isofruit "And yeah you can": Yea that's good |
20:00:10 | FromDiscord | <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:40 | FromDiscord | <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:55 | FromDiscord | <d4rckh> i want to do this in nim and not really sure where to start 🤔 |
20:01:56 | FromDiscord | <Phil> In reply to @sharpcdf "well now i get": Could you post your code again? |
20:02:19 | FromDiscord | <Phil> In reply to @d4rckh "what would be the": Formatting strings? Without having understand your task, strformat an option? |
20:02:31 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44x9 |
20:02:39 | FromDiscord | <sharpcdf> it works when i just put in the args manually |
20:02:41 | FromDiscord | <sharpcdf> without a nimscript |
20:02:51 | FromDiscord | <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:13 | FromDiscord | <huantian> In reply to @sharpcdf "its just a nimscript": what is the file holding this called? |
20:03:14 | FromDiscord | <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:26 | FromDiscord | <huantian> you can also use strscans to parse the string |
20:03:27 | FromDiscord | <d4rckh> but with any string |
20:04:59 | FromDiscord | <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:36 | FromDiscord | <voidwalker> Omfg finally I think it worked |
20:05:39 | FromDiscord | <voidwalker> `int success = sqlite3_load_extension(db, "libsqlite_zstd.so", NULL, NULL);` |
20:05:48 | FromDiscord | <Phil> sent a long message, see http://ix.io/44xa |
20:05:52 | FromDiscord | <d4rckh> exactly |
20:06:05 | FromDiscord | <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:07 | FromDiscord | <Phil> In reply to @d4rckh "exactly": Isn't the answer to this for Step 1 use a regex and step 2 strformat? |
20:06:21 | FromDiscord | <huantian> I'll be beef and go "ew no regex use strscans" |
20:06:29 | FromDiscord | <Phil> In reply to @huantian "I'll be beef and": coward! |
20:06:34 | FromDiscord | <d4rckh> it needs to be more user friendly |
20:06:41 | FromDiscord | <d4rckh> its supposed to take these things from a config |
20:06:49 | FromDiscord | <d4rckh> which anyone should be able to edit |
20:06:59 | FromDiscord | <d4rckh> omg strscans is perfect!! |
20:07:53 | FromDiscord | <# Luke> In reply to @Isofruit "And yeah you can": Thx that works :) |
20:07:59 | FromDiscord | <Phil> ~~As a former bioinformatician, regex or death!~~ |
20:08:20 | FromDiscord | <enthus1ast> what you want is very simple string parsing↵(@d4rckh) |
20:08:25 | FromDiscord | <d4rckh> yup |
20:08:25 | FromDiscord | <enthus1ast> simple done even by hand |
20:08:34 | FromDiscord | <d4rckh> but it would be better if it returned something like a table? |
20:08:41 | FromDiscord | <d4rckh> i think it would be a good coding exercise if i do it by hand |
20:09:14 | FromDiscord | <voidwalker> hey @enthus1ast, success ! |
20:09:21 | FromDiscord | <enthus1ast> oh nice |
20:09:22 | FromDiscord | <enthus1ast> how? |
20:09:31 | FromDiscord | <voidwalker> echo dbsql.sqlite3_load_extension(zFile, nil, pzErrMsg) |
20:09:47 | FromDiscord | <voidwalker> (edit) "echo" => "`echo" | "pzErrMsg)" => "pzErrMsg)` nil instead of foo, and using your dynlib pragma" |
20:09:49 | FromDiscord | <enthus1ast> without enableing |
20:09:54 | FromDiscord | <voidwalker> with enabling |
20:09:55 | FromDiscord | <enthus1ast> ? |
20:10:25 | FromDiscord | <Phil> In reply to @voidwalker "`int success = sqlite3_load_extension(db,": Congratz! |
20:10:28 | FromDiscord | <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:29 | FromDiscord | <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:00 | FromDiscord | <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:10 | FromDiscord | <enthus1ast> @voidwalker\: still does not work for me |
20:13:22 | FromDiscord | <enthus1ast> not even this |
20:13:24 | FromDiscord | <enthus1ast> echo dbsql.sqlite3\_enable\_load\_extension(1) |
20:13:31 | FromDiscord | <voidwalker> I copied the .so to /usr/lib.. not sure what's the deal with the .dll |
20:14:11 | FromDiscord | <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:31 | FromDiscord | <the_dumbest_developer> In reply to @Isofruit "Basically, I'd say for": thanks alot |
20:17:17 | FromDiscord | <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:52 | FromDiscord | <enthus1ast> @the_dumbest_developer\: what issue do you face? |
20:18:34 | FromDiscord | <enthus1ast> @the_dumbest_developer\: ping @dom96 for the forum's email issue |
20:19:05 | FromDiscord | <the_dumbest_developer> @dom96 I have an issue with forum mail confirmation |
20:19:47 | FromDiscord | <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:37 | FromDiscord | <geekrelief> In reply to @the_dumbest_developer "https://nim-lang.github.io/Nim/backends.html#interf": what error are you getting? |
20:21:48 | FromDiscord | <d4rckh> https://play.nim-lang.org/#ix=44xf |
20:21:50 | FromDiscord | <d4rckh> came up with this for now |
20:22:08 | FromDiscord | <d4rckh> is there any better way of doing it? |
20:22:19 | FromDiscord | <geekrelief> maybe the issue is with gcc and the '.cache' folder? might it be 'nimcache'? |
20:22:56 | FromDiscord | <enthus1ast> sure there always are, but this doesn't look to bad↵(@d4rckh) |
20:23:27 | FromDiscord | <enthus1ast> you could change this into an iterator |
20:23:41 | FromDiscord | <enthus1ast> so that you do not need to return a table, but a tuple |
20:23:48 | FromDiscord | <enthus1ast> but yield a tuple |
20:24:39 | FromDiscord | <the_dumbest_developer> sent a code paste, see https://paste.rs/PEs |
20:25:53 | FromDiscord | <d4rckh> In reply to @enthus1ast "but yield a tuple": ah yes |
20:25:57 | * | noeontheend quit (Ping timeout: 276 seconds) |
20:27:07 | FromDiscord | <d4rckh> now extracting the actual variables is going to be a bit hard i think? |
20:27:20 | FromDiscord | <enthus1ast> @d4rckh\: where do you use input? |
20:27:31 | FromDiscord | <d4rckh> i dont use it for now |
20:27:40 | FromDiscord | <d4rckh> ;-; |
20:28:00 | FromDiscord | <geekrelief> In reply to @the_dumbest_developer "I tried to delete": double check the path to the cache folder exists |
20:28:54 | FromDiscord | <geekrelief> For example, I'm on windows so that'd be in my user nimcache/fib_d folder |
20:29:14 | FromDiscord | <d4rckh> id need 2 indices i think, one for the format and one for the input |
20:29:40 | FromDiscord | <enthus1ast> @the_dumbest_developer\: why not compile to a static lib and link it that way? |
20:30:18 | FromDiscord | <enthus1ast> @d4rckh\: for formatting you can just use strformat |
20:30:18 | FromDiscord | <enthus1ast> with the syntax you provided |
20:30:40 | FromDiscord | <d4rckh> yes |
20:30:45 | FromDiscord | <d4rckh> but i need to extract the variables first |
20:30:48 | FromDiscord | <enthus1ast> "/abc/?id=10"↵is this always like this? |
20:30:56 | FromDiscord | <d4rckh> no |
20:31:18 | FromDiscord | <d4rckh> this function should also check if its valid input for the format |
20:31:19 | FromDiscord | <enthus1ast> what is the common pattern? |
20:31:49 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/cgU |
20:31:56 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=44xk" => "https://play.nim-lang.org/#ix=44xj" |
20:32:13 | FromDiscord | <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:17 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=44xj" => "https://play.nim-lang.org/#ix=44xl" |
20:33:12 | FromDiscord | <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:20 | FromDiscord | <the_dumbest_developer> (edit) "-Inimcache" => "-I~/.cache/nim/fib_d" |
20:34:32 | FromDiscord | <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:33 | FromDiscord | <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:27 | FromDiscord | <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:49 | FromDiscord | <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:01 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xm |
20:37:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=44xn |
20:37:30 | FromDiscord | <the_dumbest_developer> sent a code paste, see https://play.nim-lang.org/#ix=44xo |
20:37:51 | FromDiscord | <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:53 | FromDiscord | <d4rckh> In reply to @enthus1ast "<@648552095531663361>\: 1. parse the": like this?↵`aaaa{id}bbbb` => @[String("aaaa"), Variable("id"), String("bbbb")] |
20:38:08 | FromDiscord | <enthus1ast> yhea |
20:38:24 | FromDiscord | <enthus1ast> then you could use the procs from parseutils |
20:38:25 | FromDiscord | <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:31 | FromDiscord | <d4rckh> In reply to @enthus1ast "then you could use": oh how |
20:38:33 | FromDiscord | <d4rckh> (edit) "how" => "which one?" |
20:38:36 | FromDiscord | <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:40 | FromDiscord | <enthus1ast> @d4rckh\: eg. skip() |
20:40:11 | FromDiscord | <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:03 | FromDiscord | <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:09 | FromDiscord | <mbenam> In reply to @Isofruit "Hmm, does jester write": There is no log. And nothing in the console either |
20:42:44 | FromDiscord | <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:10 | FromDiscord | <mbenam> let me try with curl |
20:43:27 | FromDiscord | <Phil> Fair, I tend to use postman for this since I take way too long to write the curl commands |
20:45:04 | FromDiscord | <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:23 | FromDiscord | <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:55 | FromDiscord | <mbenam> In reply to @Isofruit "Fair, I tend to": Everything works as expected using curl |
20:46:14 | FromDiscord | <geekrelief> In reply to @the_dumbest_developer "This part didn't happen": The issue is you need an extern for NimMain |
20:46:33 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xt |
20:46:46 | FromDiscord | <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:56 | FromDiscord | <geekrelief> normally those externs would be in a header |
20:48:14 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=44xu |
20:48:16 | FromDiscord | <geekrelief> then you include "fib.h" in maths.c |
20:48:40 | FromDiscord | <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:09 | FromDiscord | <geekrelief> are you using `nim c --noMain --noLinking fib.nim`? |
20:49:43 | FromDiscord | <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:32 | FromDiscord | <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:07 | FromDiscord | <the_dumbest_developer> In reply to @PMunch "<@655721137480925185>, what's the forum": you mean username ? |
20:54:24 | FromDiscord | <PMunch> Yes |
20:54:29 | FromDiscord | <the_dumbest_developer> baronleonardo |
20:56:06 | FromDiscord | <PMunch> There, your account should be active now |
20:56:21 | FromDiscord | <the_dumbest_developer> In reply to @PMunch "There, your account should": much thanks |
20:59:21 | FromDiscord | <sharpcdf> why does it error when i `exec()` in a nimble file? |
20:59:34 | FromDiscord | <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:11 | FromDiscord | <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:40 | NimEventer | New thread by Baronleonardo: From nim to C (C interop), see https://forum.nim-lang.org/t/9307 |
21:10:16 | FromDiscord | <geekrelief> @the_dumbest_developer |
21:10:38 | FromDiscord | <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:41 | FromDiscord | <geekrelief> and it compiled |
21:11:12 | FromDiscord | <the_dumbest_developer> In reply to @geekrelief "<@655721137480925185> that was silly..": OMG 😂 |
21:11:20 | FromDiscord | <geekrelief> `nim c --app:staticlib --noMain -o:libfib.lib fib.nim ` |
21:11:26 | FromDiscord | <geekrelief> then the gcc command works fo rme |
21:11:29 | FromDiscord | <geekrelief> (edit) "fo rme" => "for me" |
21:11:34 | FromDiscord | <geekrelief> never did this before 😄 |
21:11:46 | FromDiscord | <the_dumbest_developer> It works now 😂 |
21:11:55 | FromDiscord | <the_dumbest_developer> then there is a bug in the doc |
21:11:59 | FromDiscord | <geekrelief> for sure |
21:12:05 | * | noeontheend joined #nim |
21:12:20 | FromDiscord | <geekrelief> I guess it assumes you understand what your compiler wants 😄 |
21:13:37 | FromDiscord | <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:26 | FromDiscord | <geekrelief> not sure.. but maybe pull. the sources and edit the manual to push a pr |
21:15:05 | FromDiscord | <geekrelief> I'm in the middle of a PR right now.. so let me see |
21:15:48 | FromDiscord | <geekrelief> @the_dumbest_developer do you want to try doing it? |
21:15:55 | FromDiscord | <geekrelief> otherwise I'll create the PR |
21:16:27 | FromDiscord | <the_dumbest_developer> right now I can't |
21:16:43 | FromDiscord | <geekrelief> ok, I'll do it |
21:17:07 | FromDiscord | <the_dumbest_developer> In reply to @geekrelief "ok, I'll do it": much thanks |
21:17:13 | FromDiscord | <geekrelief> np |
21:21:48 | FromDiscord | <pruno> i feel stupid asking this but how would you print a string two characters by two characters in a loop ? |
21:27:23 | FromDiscord | <geekrelief> In reply to @pruno "i feel stupid asking": What does your data look like? |
21:28:32 | FromDiscord | <Elegantbeef> i believe nimscript tasks are just run `nim taskname` |
21:28:58 | FromDiscord | <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:23 | FromDiscord | <Elegantbeef> `for i in countup(0, myStr.len, 2): echo myStr[i], myStr[i + 1]`↵(@pruno) |
21:30:39 | FromDiscord | <Elegantbeef> Actually should probably be `myStr.high - 1` |
21:32:30 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> `myStr.high - 1` |
21:33:11 | FromDiscord | <pruno> Does not print the last character |
21:33:21 | FromDiscord | <Elegantbeef> Yes |
21:33:38 | FromDiscord | <Elegantbeef> If you want it to be smarter you need more logic |
21:33:38 | FromDiscord | <Elegantbeef> I gave the base you can figure out an if statement |
21:34:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44xB |
21:34:53 | FromDiscord | <Elegantbeef> Heres an implementation that works with any sliding window |
21:35:32 | FromDiscord | <Elegantbeef> Really it should be `s: openarray[char]` |
21:36:08 | FromDiscord | <pruno> Thanks ! |
21:36:51 | FromDiscord | <Elegantbeef> Guess it should also be `groupSize: Positive` |
21:39:31 | FromDiscord | <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:40 | FromDiscord | <creikey> that the "var lobby" can't be capturede |
21:39:41 | FromDiscord | <creikey> (edit) "capturede" => "captured" |
21:39:56 | FromDiscord | <Elegantbeef> Cause `var T` cannot be captured as it can live on the stack |
21:40:32 | FromDiscord | <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:37 | FromDiscord | <creikey> by the makeMetaData |
21:41:07 | FromDiscord | <Elegantbeef> `async` uses closure iterators which capture parameters |
21:41:20 | FromDiscord | <Elegantbeef> Make lobby a ref type and remove `var` and you can capture it |
21:41:42 | FromDiscord | <Elegantbeef> I guess it doesnt capture parameters but does capture used parameters |
21:42:22 | FromDiscord | <Elegantbeef> The capture happens inside `updatePlayersOnLobby` the call `makeMetaData` requires capture of `lobby` |
21:42:40 | FromDiscord | <creikey> In reply to @Elegantbeef "The capture happens inside": because it's not a ref object the data is copied right? |
21:42:47 | FromDiscord | <Elegantbeef> No |
21:42:55 | FromDiscord | <Elegantbeef> It's `var T` there is no good way of capturing it |
21:43:23 | FromDiscord | <Elegantbeef> You dont know if it's a pointer to a ref held object or a stack held object |
21:43:52 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> Your copy is useless cause it's not what you need/want generally |
21:45:37 | FromDiscord | <creikey> interesting |
21:45:50 | FromDiscord | <sharpcdf> does nimscript not support std/terminal and std/io? |
21:45:57 | FromDiscord | <Elegantbeef> No |
21:45:59 | FromDiscord | <Elegantbeef> I mean yes it does not |
21:46:05 | FromDiscord | <sharpcdf> im trying to print some colored text but its erroring weirdly |
21:46:17 | FromDiscord | <Elegantbeef> Nimscript does not support anything that requires `importc` |
21:46:24 | FromDiscord | <Elegantbeef> Or lowlevel memory access |
21:47:38 | FromDiscord | <sharpcdf> aw that sucks |
21:47:53 | FromDiscord | <sharpcdf> is there another way to print colored text in nimscript |
21:48:11 | FromDiscord | <Elegantbeef> I mean you should be able to use the `terminal` module |
21:48:24 | FromDiscord | <Elegantbeef> ansi codes shouldnt require anything low level |
21:49:03 | FromDiscord | <Elegantbeef> Or does it not allow you to import? |
21:51:29 | FromDiscord | <mbenam> In reply to @Isofruit "Glad I could help!": Will take a look. Thanks again. |
21:53:41 | FromDiscord | <sharpcdf> In reply to @Elegantbeef "Or does it not": no i can import but it requires stdout |
21:53:46 | FromDiscord | <sharpcdf> and thats when it errors |
21:53:49 | FromDiscord | <sharpcdf> doesnt let me use stdout |
21:54:12 | FromDiscord | <Elegantbeef> you can use `ansiBackgroundColorCode` and `ansiForegroundColorCode` no? |
21:54:20 | FromDiscord | <sharpcdf> oh yea |
21:54:27 | FromDiscord | <sharpcdf> i was using `styledWriteLine` |
21:56:08 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44xD |
21:56:24 | FromDiscord | <sharpcdf> In reply to @Elegantbeef "you can use `ansiBackgroundColorCode`": is that the same as `setForegroundColor`? |
21:56:26 | FromDiscord | <aruZeta> (edit) "https://play.nim-lang.org/#ix=44xD" => "https://play.nim-lang.org/#ix=44xE" |
21:56:36 | FromDiscord | <Elegantbeef> It's going to call the macro and pass the arguments |
21:57:12 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=44xF |
21:57:27 | FromDiscord | <Elegantbeef> those two procedures return the ansicode so you'd do like `ansiBackGroundColorCode(bgRed) & ansiForeGroundColorCode(fgGreen) & "Christmas" & ansiResetCode` |
21:57:40 | FromDiscord | <Elegantbeef> `setForegroundColor` might work |
21:57:42 | FromDiscord | <Elegantbeef> I dont know though |
21:57:54 | FromDiscord | <sharpcdf> well thats not the problem |
21:57:56 | FromDiscord | <aruZeta> (edit) "https://play.nim-lang.org/#ix=44xE" => "https://play.nim-lang.org/#ix=44xG" |
21:58:09 | FromDiscord | <sharpcdf> i cant even call `styledWriteLine` because it needs stdout but it errors when i pass stdout |
21:58:12 | FromDiscord | <sharpcdf> or am i misunderstanding |
21:58:22 | FromDiscord | <Elegantbeef> You can use `echo ansiBackGroundColorCode(bgRed) & ansiForeGroundColorCode(fgGreen) & "Christmas" & ansiResetCode` |
21:58:43 | FromDiscord | <Elegantbeef> And make a template so you can do `myWriteStyled(bgRed, fgGreen, "Christmas")` |
21:59:28 | FromDiscord | <sharpcdf> ah ok |
21:59:59 | FromDiscord | <sharpcdf> theres also `styledEcho` which i believe is similar to what you're saying but it also errors |
22:00:03 | FromDiscord | <sharpcdf> ill try your way too |
22:03:03 | FromDiscord | <Elegantbeef> I assume aru you're solving the issue with the deleted messages |
22:03:59 | FromDiscord | <sharpcdf> wdym |
22:04:12 | FromDiscord | <Elegantbeef> Not you |
22:04:18 | FromDiscord | <Elegantbeef> aruzeta here 😄 |
22:04:21 | FromDiscord | <aruZeta> not that I solved that exactly but did it in another way |
22:04:46 | FromDiscord | <aruZeta> or better said, thought of another way to do it, since what I was trying to do is impossible |
22:05:30 | FromDiscord | <aruZeta> writing macros melts your brain lol |
22:05:31 | FromDiscord | <sharpcdf> ah ok lol |
22:05:58 | FromDiscord | <Elegantbeef> Eh it stops melting it after awhile |
22:07:07 | FromDiscord | <aruZeta> i've written lisp macros before, but these ones are different |
22:07:29 | FromDiscord | <aruZeta> it's just getting used to it |
22:08:45 | FromDiscord | <sharpcdf> https://media.discordapp.net/attachments/371759389889003532/997988182631137360/unknown.png |
22:08:55 | FromDiscord | <sharpcdf> 😔 |
22:11:30 | * | noeontheend quit (Ping timeout: 240 seconds) |
22:13:09 | * | noeontheend joined #nim |
22:46:56 | NimEventer | New thread by Ggibson: How to create structures based on user types/fields?, see https://forum.nim-lang.org/t/9308 |
22:57:28 | FromDiscord | <creikey> thinking about how stacked treeform's resume is rn |
22:57:38 | FromDiscord | <creikey> 8 billion side projects |
23:07:15 | FromDiscord | <# Luke> Lol yea |
23:07:46 | FromDiscord | <# Luke> And 90% of them end with "y" or "ie" 😄 |
23:14:58 | FromDiscord | <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:13 | FromDiscord | <creikey> This can't be done with nginx as it treats websocket connections opaquely |
23:19:17 | FromDiscord | <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:19 | FromDiscord | <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:36 | FromDiscord | <creikey> so you could burn out any vps by just sending a few large messages like that |
23:31:43 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> `recievePacket(ws: WebSocket, maxLength: static int)` 😄 |
23:33:32 | FromDiscord | <Elegantbeef> I actually dont know how WS/TCP works so dont know if that would work |
23:34:43 | FromDiscord | <treeform> its same as spend large HTTP post body etc... |
23:37:23 | FromDiscord | <creikey> In reply to @treeform "its same as spend": https://github.com/treeform/ws/pull/40 does something like this make sense? |
23:37:27 | FromDiscord | <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:36 | FromDiscord | <creikey> I think if you provide a maximum size to tcp recv it would be good |
23:38:10 | FromDiscord | <dom96> You’re honestly better off just using Cloudflare and not worrying about this stuff too much |
23:38:54 | FromDiscord | <creikey> In reply to @dom96 "You’re honestly better off": oh wow they have websocket protection |
23:39:04 | FromDiscord | <dom96> Of course |
23:39:52 | FromDiscord | <creikey> maybe my PR to ws isn't useful then |
23:40:08 | FromDiscord | <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:27 | FromDiscord | <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:41 | FromDiscord | <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:21 | FromDiscord | <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:44 | FromDiscord | <creikey> In reply to @dom96 "https://support.cloudflare.com/hc/en-us/articles/20": so no limit? |
23:41:52 | FromDiscord | <creikey> that page was from 2014 is why I have confusion |
23:42:05 | FromDiscord | <creikey> like they just say volume |
23:43:02 | FromDiscord | <creikey> lol they contact you?? https://media.discordapp.net/attachments/371759389889003532/998011914514878524/unknown.png |
23:44:55 | FromDiscord | <treeform> In reply to @creikey "oh wow they have": I use cloudflare |
23:45:39 | FromDiscord | <treeform> it saves me thousands of dollars in transfer fees |
23:46:14 | FromDiscord | <Dale> They reach out because they deal with huge clients, and their clientele is also huge |
23:46:24 | FromDiscord | <creikey> yeah I can only imagine |
23:46:24 | FromDiscord | <Dale> (actually quite controversial) |
23:46:46 | FromDiscord | <Elegantbeef> What a cloudflare outage taking down most of the internet is fine!↵(@Dale) |
23:46:55 | FromDiscord | <Dale> Centralise everything! |
23:47:00 | FromDiscord | <creikey> but honestly |
23:47:02 | FromDiscord | <creikey> centralizing it like that |
23:47:05 | FromDiscord | <creikey> probably makes it more efficient |
23:47:12 | FromDiscord | <Dale> Quite the opposite |
23:47:27 | FromDiscord | <Dale> The services they offer are fantastic and first-class |
23:47:30 | FromDiscord | <Elegantbeef> I mean after the Rogers incident Canada had, I guess it's my Canadian duty to suggest centralisation |
23:47:39 | FromDiscord | <Dale> But the consequences are debatably terrible |
23:47:45 | FromDiscord | <creikey> doesn't it make sense for the cloud functions and ddos protection and all that to be on the same site |
23:47:55 | FromDiscord | <Dale> No |
23:48:04 | FromDiscord | <Dale> Because if cloudflare doesn't work, then nothing works |
23:48:11 | FromDiscord | <Dale> Web == dead |
23:48:15 | FromDiscord | <creikey> not in terms of reliability but like efficienty |
23:48:18 | FromDiscord | <Elegantbeef> You funnel the internet and make it easier to shutoff |
23:48:21 | FromDiscord | <creikey> if the servers are farther apart more latency |
23:48:28 | FromDiscord | <Elegantbeef> Humans are distributed |
23:48:35 | FromDiscord | <Dale> Nah, because you're shovelling everything through one pipe |
23:48:38 | FromDiscord | <Elegantbeef> If you have to go to the same server you load the same lines |
23:48:50 | FromDiscord | <Dale> Distributed is better even for realiability (look at mesh networks) |
23:49:03 | FromDiscord | <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:13 | FromDiscord | <creikey> or does the dns change the destination ip for load balancing dynamically |
23:49:22 | FromDiscord | <Dale> They're not, but they're going through 1 service |
23:49:51 | FromDiscord | <creikey> everybody goes through `142.251.40.46` right and that has to be some modem somewhere right |
23:49:51 | FromDiscord | <Elegantbeef> The DNS just gives you an address to deliver your packet your network determines the path to take it afaik↵(@creikey) |
23:50:10 | FromDiscord | <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:10 | FromDiscord | <creikey> In reply to @Elegantbeef "The DNS just gives": yeah so like somewhere is the giant google `142.251.40.46` modem |
23:50:38 | FromDiscord | <Elegantbeef> Decentralisation is the best for consumers and people |
23:51:02 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> It reduces the fault points and gives more control! 😛 |
23:51:24 | FromDiscord | <Elegantbeef> but i'm sitting here talking on matrix using the matrix.org homeserver so the fuck do i know 😛 |
23:51:28 | FromDiscord | <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:50 | FromDiscord | <Dale> I keep meaning to try out matrix, I really dislike discord, but y'know, the whole de facto dealio |
23:51:53 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> creikey steam has an API for this |
23:52:17 | FromDiscord | <creikey> for multiplayer yeah |
23:52:18 | FromDiscord | <Elegantbeef> Steam has remote play together |
23:52:19 | FromDiscord | <dom96> In reply to @creikey "I mean ideally I'd": It’s all about serverless these days. So you can :D |
23:52:24 | FromDiscord | <creikey> In reply to @dom96 "It’s all about serverless": loool |
23:52:29 | FromDiscord | <creikey> In reply to @dom96 "It’s all about serverless": actually laughed out loud |
23:52:36 | FromDiscord | <creikey> In reply to @Elegantbeef "Steam has remote play": not what I'm looking for |
23:52:47 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> Ah not a single screen game |
23:52:57 | FromDiscord | <creikey> yeah this very much does not work as a single screen game |
23:53:16 | FromDiscord | <Elegantbeef> Steam has the API for free game tickets |
23:53:19 | FromDiscord | <creikey> at first I was like webrtc with the host being the server host |
23:53:27 | FromDiscord | <creikey> In reply to @Elegantbeef "Steam has the API": I don't want the friends you invite to go through steam |
23:53:39 | FromDiscord | <creikey> convincing your friend to download a steam game is a lot harder than sending them a link |
23:53:42 | FromDiscord | <Elegantbeef> Well then have fun 😄 |
23:53:46 | FromDiscord | <Elegantbeef> Not my friends |
23:54:03 | FromDiscord | <Elegantbeef> "Hey fucko come play this game"↵"Ok" |
23:54:11 | FromDiscord | <creikey> yeah I mean maybe I have the market wrong |
23:54:41 | FromDiscord | <Dale> I think people would be more inclined to play if you send a gift |
23:54:50 | FromDiscord | <Dale> People like to receive tangible things |
23:54:56 | FromDiscord | <Elegantbeef> Hey i already called them "fucko"↵(@Dale) |
23:55:00 | FromDiscord | <Dale> It adds a whole new emotional aspect to it |
23:55:02 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> I mean that's what games do |
23:55:17 | FromDiscord | <Elegantbeef> Look at just act natural |
23:55:32 | FromDiscord | <Elegantbeef> the free version is locked down and i dont think you can host a game |
23:55:38 | FromDiscord | <Elegantbeef> Or if you can it's only a few game modes |
23:55:55 | FromDiscord | <Elegantbeef> The upgrade pack unlocks the remainder of the game modes |
23:55:56 | FromDiscord | <Dale> Ah like the game sharing on DS/PSP! |
23:56:08 | FromDiscord | <creikey> In reply to @Dale "Ah like the game": this is more what I was thinking of |
23:56:10 | FromDiscord | <Elegantbeef> Yea steam actually has a gameshare API |
23:56:20 | FromDiscord | <Dale> You can do that easy with nim if you do your cross-platform stuff right |
23:56:23 | FromDiscord | <creikey> In reply to @Elegantbeef "Yea steam actually has": you mean like family sharing? |
23:56:27 | FromDiscord | <Elegantbeef> No |
23:56:43 | FromDiscord | <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:48 | FromDiscord | <Elegantbeef> The latest WWE game uses it |
23:56:53 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> Some others aswell of course |
23:57:23 | FromDiscord | <Elegantbeef> I dont know if the shared API is small or not |
23:57:28 | FromDiscord | <Elegantbeef> well shared game rather |
23:57:31 | FromDiscord | <creikey> I can't find any mention of this online |
23:58:23 | FromDiscord | <Elegantbeef> I know it exists but dont know what steam calls it |
23:58:47 | FromDiscord | <creikey> whatever like 5 people will play my game anyways I have no reason to worry about complex ddos attacks |