<< 21-08-2023 >>

00:04:59FromDiscord<Chronos [She/Her]> Huh?
00:05:10FromDiscord<Chronos [She/Her]> That is the first thing I see lol
00:05:40FromDiscord<Elegantbeef> Huh?
00:08:29FromDiscord<Chronos [She/Her]> Simd accelerated string finding
00:09:01FromDiscord<Chronos [She/Her]> What usecases is SIMD useful for anyway?
00:09:17FromDiscord<Elegantbeef> Speeding up any operation that you're doing that simd can do 😄
00:09:30FromDiscord<Elegantbeef> It's a collection of hardware extensions so there is no 1 answer
00:10:14FromDiscord<Elegantbeef> Many of them are aimed at speeding up floating point calculations
00:11:42FromDiscord<Chronos [She/Her]> Ah so specifically working with floats as a whole?
00:11:52FromDiscord<Elegantbeef> I mean that's not the whole purpose
00:12:02FromDiscord<Elegantbeef> There are simd extensions for a variety of operations
00:12:22FromDiscord<Elegantbeef> Using simd for string find isnt actually daft and is a mild way of speeding up finding on a string
00:13:44termersimd means Single Instruction Multiple Data
00:13:58FromDiscord<Elegantbeef> https://www.officedaytime.com/simd512e/
00:13:58termerIf there's a SIMD instruction that works with the data you want to process to do what you want, use it
00:14:31FromDiscord<Chronos [She/Her]> Oh huh
00:14:54FromDiscord<Chronos [She/Her]> So then an example of one way it could be used is game dev for handling physics for example?
00:15:20FromDiscord<Elegantbeef> If you can find a way to use simd there, sure
00:15:31termerI have no examples
00:15:36FromDiscord<Chronos [She/Her]> Neat
00:15:38termerbut you can probably find them
00:15:43FromDiscord<Chronos [She/Her]> Fair
00:15:45FromDiscord<Elegantbeef> The thing with simd operations is they're very very specific with a purposeful use case
00:15:53FromDiscord<Chronos [She/Her]> Makes sense
00:17:16FromDiscord<Elegantbeef> The premise is that the operation on the large list that you load/unload from is faster than doing it independantly
00:17:29FromDiscord<Elegantbeef> So it's not like you can just wildly throw simd at problems and it turns out faster
00:26:00FromDiscord<Chronos [She/Her]> Ah
00:26:01FromDiscord<Andreas> In reply to @Elegantbeef "So it's not like": exactly, and thats why esp. this talk demonstrates the applied-usage of SIMD - in contrast to the more theoretic-lectures i've found earlier. String-finds and such, that you can find in SIMDJson. My guy sorts things in registers 🙂
00:26:15FromDiscord<Chronos [She/Her]> SIMDJson-
00:29:27FromDiscord<that_dude.> Can someone please help me with concepts? https://play.nim-lang.org/#ix=4E7R Is there anything wrong with this code, as in why it wouldn't compile? I'm getting a type mismatch for `C.ready()`, but not for `C.other()` Is this another naming issue where for whatever reason I can't use the proc name ready?
00:30:09FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4E7T
00:30:12FromDiscord<Elegantbeef> As always a mixin issue
00:30:31FromDiscord<Elegantbeef> https://www.jasonbeetham.com/writeups/codereuse.html I didnt link this now I realise
00:31:32FromDiscord<that_dude.> I thought those are already know though?
00:31:52FromDiscord<Elegantbeef> `mixin` forces the compiler to look at both declaration and instantiation
00:31:53FromDiscord<heysokam> how do you define an array of 4 elements, where 3 of them are empty?↵not seq, fixed sized array 🤔
00:32:06FromDiscord<Elegantbeef> also do not do `Type[T: Bleh] = seq[T]` that makes no sense
00:32:25FromDiscord<that_dude.> Because we know that `EventContainer` must hold a `ValidEvent` which because it's concepts says so
00:32:27FromDiscord<Elegantbeef> `[default T, default T, default T, bleh]`
00:32:40FromDiscord<Elegantbeef> Sure but `seq[T]` is an alias not a distinct type
00:32:43FromDiscord<that_dude.> That was probably a remnant of me trying to figure out what I was having issues with
00:32:46FromDiscord<heysokam> In reply to @Elegantbeef "`[default T, default T,": isnt' `default cstring` the same as saying `""`?
00:32:57FromDiscord<heysokam> i need them to be truly empty, not ""
00:33:11FromDiscord<Elegantbeef> So i can just pass an `seq[int]` in
00:33:11FromDiscord<Elegantbeef> Yes you didnt say it was a cstring
00:33:11FromDiscord<Elegantbeef> nil if it's a cstring
00:33:24FromDiscord<Elegantbeef> default cstring is actually `nil`
00:33:27FromDiscord<heysokam> oh
00:36:27termercstring is a pointer
00:36:32FromDiscord<Elegantbeef> Ah actually it seems that a alias does not lose it's constraint
00:36:39FromDiscord<Elegantbeef> So I guess that's fine
00:37:07FromDiscord<Elegantbeef> Look at this guy writes a string library then thinks he's an authority on the matter! 😛
00:38:31FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E7U
00:38:42FromDiscord<Elegantbeef> `cstring(nil), nil, nil, nil]`
00:38:53FromDiscord<Elegantbeef> As long as the first one is typed the others will fall in place
00:39:25FromDiscord<Elegantbeef> also not using `cstring"..."` shame on you
00:39:54FromDiscord<heysokam> i can't, because vulkan crashes
00:39:57termerI know everything about strings now, that's simply the case
00:39:59FromDiscord<Elegantbeef> What
00:40:06termerI've become an authority
00:40:07termersimple as
00:40:26termerPointers? Buffers? Null-termination? I've got it all
00:40:43FromDiscord<heysokam> In reply to @Elegantbeef "What": empty array, failed if not typed. string array? needed to be cstring. array with `[""]`... validation error and crashed
00:40:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E7V
00:41:01FromDiscord<Elegantbeef> What are you even talking about
00:41:13*xaltsc_ joined #nim
00:41:20FromDiscord<heysokam> well an error i got that didn't understand
00:41:31FromDiscord<heysokam> i just had to hardcode the size like that and then it worked
00:41:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E7W
00:41:45FromDiscord<heysokam> k
00:41:49FromDiscord<Elegantbeef> The first parameter of the array has to be typed
00:41:55FromDiscord<Elegantbeef> Thats how Nim's array literals work
00:42:02FromDiscord<Elegantbeef> If the first is typed the rest are inferred
00:42:12*xaltsc quit (Ping timeout: 246 seconds)
00:42:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E7X
00:44:00FromDiscord<heysokam> how do `array[0..Limit, Type]` arrays work?
00:44:23FromDiscord<Elegantbeef> The same as `array[Limit, T]` cause that's what they compile to
00:44:50FromDiscord<Elegantbeef> Arrays allow a range type as the first parameter, Nim implicitly converts arrays to range indexed
00:45:05FromDiscord<Elegantbeef> So `array[0..3, cstring] is array[4, cstring]`
00:45:20FromDiscord<Elegantbeef> but `array[-1..2, cstring] isnot array[4, cstring]`
00:52:28FromDiscord<heysokam> ic
00:52:57FromDiscord<heysokam> can you do `var arr :array[4, cstring] = []`?
00:53:15FromDiscord<heysokam> basically, that's what i would ideally need 🤔
00:54:12FromDiscord<that_dude.> Thanks for both the link and the help Beef, but I'm still wondering why `other` worked but `ready` didn't. Is this a compiler bug that I should report?
00:54:39FromDiscord<that_dude.> I'll use the mixin like you recomended anyways
00:54:55FromDiscord<that_dude.> This is more of a follow up thing now
00:55:00FromDiscord<that_dude.> (edit) "This is more of a follow up thing now ... " added "for me"
00:55:14FromDiscord<Elegantbeef> `arr = default(array[4, cstring])`
00:55:44FromDiscord<heysokam> In reply to @Elegantbeef "`arr = default(array[4, cstring])`": yeah, but sometimes I need to pass `["AnActualValue"]` to the `=`
00:55:56FromDiscord<Elegantbeef> Nim doesnt have shortcuts for array literals
00:56:05FromDiscord<Elegantbeef> Make a macro or find the one I posted eons ago
00:56:33FromDiscord<heysokam> what could i search for? i don't remember seeing that
00:56:44FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/10037#66190
00:57:42FromDiscord<Elegantbeef> In your case it'd be `makeArr(4, "Bleh", ...nil)`
00:57:46FromDiscord<heysokam> leyendary. that's exactly what I was trying to make with a generic function 🙈
00:58:19FromDiscord<Elegantbeef> Hmmmm you might be able to do this with a generic
00:58:29*azimut joined #nim
00:59:34FromDiscord<heysokam> yeah but im failing rn, so was searching for the easier alternative
00:59:49FromDiscord<Elegantbeef> I more meant that inquistiively
01:00:28FromDiscord<heysokam> i understood that last sentence the least 🙈
01:01:24FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E82
01:01:27FromDiscord<heysokam> but have 3 versions, and some don't really work
01:02:22FromDiscord<Elegantbeef> Nothing there should not work really
01:03:55FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E83
01:04:05FromDiscord<heysokam> i had this one hardcoded... but... yeah
01:11:29FromDiscord<Elegantbeef> So odd, apparently a `cstring(nil)` at compile time gets emitted to a string that points to `"\0"`
01:13:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E84
01:13:28FromDiscord<Elegantbeef> Using procedures is simple enough
01:13:41FromDiscord<Elegantbeef> And when you want custom spread you can use `spread = bleh`
01:16:34FromDiscord<heysokam> ty ✍️
01:23:06FromDiscord<ShalokShalom (ShalokShalom)> https://codeberg.org/ShalokShalom/add-and-friends
01:23:07FromDiscord<ShalokShalom (ShalokShalom)> @Phil\: We were speaking about abstract naming. This is the result of my personal madness \:D
01:35:15*xet7 quit (Remote host closed the connection)
03:54:28FromDiscord<terrygillis> I'm feeling like I'm being trolled by the Nim compiler again because now suddenly I cannot find the output exe file with `nim c file.nim` and `nim c -r file.nim` just output hints and `....................` and then immediately exits
03:55:09FromDiscord<terrygillis> but this time it's not resolving itself after a few attempts and computer restarts like previous hiccups
03:55:18FromDiscord<Elegantbeef> Any user configs being loaded?
03:56:09FromDiscord<terrygillis> sent a code paste, see https://play.nim-lang.org/#ix=4E8t
03:56:43FromDiscord<terrygillis> (edit) "https://play.nim-lang.org/#ix=4E8t" => "https://play.nim-lang.org/#ix=4E8u"
03:57:24FromDiscord<Elegantbeef> If those are the only two it makes no sense for this behaviour
03:57:37FromDiscord<Elegantbeef> does `nim --outDir:./ file.nim` work?
03:59:27FromDiscord<terrygillis> nope
03:59:51FromDiscord<Elegantbeef> throw a `-f` in there
04:01:44FromDiscord<terrygillis> the peculiar thing is that it still outputs the exe files for other nim files in the same folder except for this particular one (which doesn't even appear in the nimcache folder)
04:02:09FromDiscord<terrygillis> In reply to @Elegantbeef "throw a `-f` in": it doesn't work 😭
04:02:21FromDiscord<Elegantbeef> This doesnt make any sense `--listcmd` then
04:02:39FromDiscord<Elegantbeef> It might be a compiler crash
04:02:59FromDiscord<Elegantbeef> Actually yea it's a compiler crash
04:03:05FromDiscord<Elegantbeef> so build a debug compiler and use that to compile it
04:06:02FromDiscord<terrygillis> I tried changing that file's name and still nothing shows up in the nimcache folder. I guess it has something to do with code in that file but I can't find out why.
04:06:28FromDiscord<Elegantbeef> Use a debug compiler to hunt the bug
04:06:33FromDiscord<terrygillis> In reply to @Elegantbeef "so build a debug": How do I do that?
04:06:46FromDiscord<terrygillis> compile from source?
04:07:11FromDiscord<Elegantbeef> Yea
04:08:14FromDiscord<Elegantbeef> Or thereabouts
04:08:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E8x
04:48:00FromDiscord<terrygillis> thanks I found out the problematic from the souce compiled compiler
04:48:29FromDiscord<Elegantbeef> Nice now min repro and make an issue 😛
04:49:18FromDiscord<terrygillis> It's my fault and not the compiler's really, but an error message instead of shutting itself down would have been useful
04:49:28FromDiscord<Elegantbeef> What'd you do?
04:49:39*cm_ joined #nim
04:50:32*cm quit (Ping timeout: 240 seconds)
04:50:32*cm_ is now known as cm
04:50:44FromDiscord<terrygillis> It turns out I used a template instead of proc when there's recursion. Just changing one word `template` to `proc` solved everything.
04:51:37FromDiscord<terrygillis> But still, an error message instead of quietly die would have saved tons of time debugging it
04:51:46FromDiscord<terrygillis> (edit) "die" => "dying"
04:53:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4E8I
04:55:17FromDiscord<terrygillis> somehow the compiler doesn't show anything at all and the debug compiler says some thing like `too nested call` without mentioning it's from a template, but that's enough to guide me to the right solution
04:59:01FromDiscord<Elegantbeef> You likely somehow bypass the check
06:21:55*advesperacit joined #nim
07:01:32*PMunch joined #nim
07:46:48FromDiscord<yaarb> How do i convert a `string` to a `seq[byte]` ? ( like []byte(string) in go
07:48:17FromDiscord<Elegantbeef> There is not much reason to
07:48:55FromDiscord<Elegantbeef> you can do `str.toOpenArrayByte(0, str.high)` for any proc that takes a `openArray[byte]`, or put a `@` in front to copy to a new sequence
07:49:11FromDiscord<Elegantbeef> You also can technically cast to a `seq[byte]` but that's unsafe so do not do that
07:50:44*PMunch_ joined #nim
07:51:03*PMunch quit (Killed (NickServ (GHOST command used by PMunch_)))
07:51:11*PMunch_ is now known as PMunch
07:51:21FromDiscord<odexine> In reply to @yaarb "How do i convert": just curious, for what? answers are already above by beef
07:52:33*PMunch_ joined #nim
07:52:41*PMunch quit (Killed (NickServ (GHOST command used by PMunch_)))
07:52:41FromDiscord<yaarb> i think a try to emulate the way i do stuff in go ... maybe not a good idea
07:52:47*PMunch_ is now known as PMunch
07:52:49FromDiscord<yaarb> (edit) "a" => "i"
08:11:18*azimut quit (Remote host closed the connection)
08:11:44*azimut joined #nim
08:18:25*rockcavera quit (Remote host closed the connection)
08:22:52*grasek joined #nim
08:23:00grasekIs Nim the future?
08:23:21PMunchIn that case the future is now!
08:24:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @grasek "Is Nim the future?": Yeah, it's the future!
08:31:56NimEventerNew Nimble package! margrave - dialect of Markdown in pure Nim with focus on HTML output, see https://github.com/metagn/margrave
08:36:56NimEventerNew Nimble package! rtmidi - Nim bindings for RtMidi, a cross-platform realtime MIDI input/output library., see https://github.com/stoneface86/nim-rtmidi/
08:36:57NimEventerNew Nimble package! reed_solomon - Library to encode and decode data using Reed-Solomon correction codes., see https://github.com/lscrd/Reed-Solomon
09:29:16*grasek quit (Read error: Connection reset by peer)
09:36:33FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4E9w
09:45:28PMunchHuh?
09:45:51PMunchYou probably don't want to cast to uint by the way
09:45:58PMunchThat's a recipe for disaster
09:46:45*azimut quit (Ping timeout: 246 seconds)
09:49:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "You probably don't want": It's intentionnal↵so if the position is negative, it warps to positive↵I avoid an extra modulo
09:50:25PMunchWell that doesn't do what you think it does I believe
09:50:41PMunch!eval echo cast[uint](-1)
09:50:44NimBot18446744073709551615
09:50:57PMunch!eval echo cast[uint](-2)
09:51:00NimBot18446744073709551614
09:51:31FromDiscord<System64 ~ Flandre Scarlet> So I was right↵it underflows and this is what I want
09:52:00PMunchEh, if that's what you want sure
09:52:24FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Eh, if that's what": This is for a tilemap, and it warps around
09:52:34PMunchYou're question was a bit strange though, why does using a modulo go slower than using a modulo?
09:53:12FromDiscord<odexine> the question is why does manually doing if ...: smth -= smth (manually wrapping) go slower than using modulo
09:53:33PMunchIs it?
09:53:40PMunchThe question I mean
09:53:44FromDiscord<odexine> yes
09:53:50PMunchThe reason it's slower is because of branching
09:54:12FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4E9A
09:54:27FromDiscord<odexine> are you timing that correctly?
09:54:31FromDiscord<odexine> 0 nanoseconds reads wrong
09:54:46PMunchHaha, yeah 0 nanoseconds is a but suspect
09:54:49FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4E9B
09:57:52PMunchSwitched to using monotimes: https://play.nim-lang.org/#ix=4E9C
09:59:11PMunchBy the way, why do you just add stuff in a loop?
09:59:22PMunchWouldn't it be much faster to just drop the loop entirely?
10:00:37FromDiscord<System64 ~ Flandre Scarlet> I'm trying algorithms for warping around a tilemap/bitmap
10:00:54PMunchThat code doesn't do anything more than `(posX + swidth) mod mapLen` does it?
10:01:18FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4E9D
10:01:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "That code doesn't do": Yeah, I try my algorithms for my graphics engine in a smaller scale
10:27:01FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E9I
10:28:01FromDiscord<heysokam> I'm making a new type, and writing tests for it, so I want to be certain that the conversions are actually doing what they should under the hood, so `==` can be sketchy with type conversion sometimes
10:29:44*PMunch_ joined #nim
10:32:14*PMunch quit (Ping timeout: 246 seconds)
10:33:16*PMunch__ joined #nim
10:35:32*PMunch_ quit (Ping timeout: 240 seconds)
10:40:02FromDiscord<odexine> In reply to @heysokam "is there a better": this might compare padding bits which may not be equal between the two but will not influence the visible values of that type
10:40:43FromDiscord<heysokam> In reply to @odexine "this might compare padding": how would padding bits look like on numerical types?
10:41:06FromDiscord<odexine> if they are not structs then they wont have padding
10:41:25FromDiscord<heysokam> ah maybe I can just say `not object` in the generic then
10:41:25FromDiscord<odexine> In reply to @heysokam "how would padding bits": wdym?
10:42:20FromDiscord<heysokam> In reply to @odexine "wdym?": i was thinking about numerical types only, didn't consider the case of structs (which you were)
10:42:52FromDiscord<odexine> okay
10:45:04FromDiscord<heysokam> is there an existing way to get the bitrepr of a type as a string?
10:45:23FromDiscord<heysokam> i know about `toHex`
10:46:06FromDiscord<heysokam> (edit) "is" => "~~is" | "string?" => "string?~~↵sry found it right after https://nim-lang.org/docs/strutils.html#toBin%2CBiggestInt%2CPositive"
10:55:14*PMunch_ joined #nim
10:57:44*PMunch__ quit (Ping timeout: 252 seconds)
11:47:52FromDiscord<pk.kyle> sent a code paste, see https://play.nim-lang.org/#ix=4E9V
11:48:11FromDiscord<pk.kyle> im on windows and nim 2.0.0
11:48:56PMunch_Maybe use `--gc:refc` if you don't need ORC for anything in particular
11:49:42FromDiscord<pk.kyle> works now! thanks!
11:51:22FromDiscord<heysokam> how do you expres `5 elevated to -524` in nim's float notation?
11:52:50PMunch_5.pow(-524)?
11:53:05PMunch_!eval import math; echo 5.pow(-524)
11:53:07NimBotCompile failed: /usercode/in.nim(1, 20) Error: ambiguous call; both math.pow(x: float32, y: float32) [func declared in /playground/nim/lib/pure/math.nim(627, 8)] and math.pow(x: float64, y: float64) [func declared in /playground/nim/lib/pure/math.nim(628, 8)] match for: (int literal(5), int literal(-524))
11:53:20PMunch_!eval import math; echo 5.0.pow(-524)
11:53:24NimBot0.0
11:53:41FromDiscord<heysokam> In reply to @PMunch_ "!eval import math; echo": right, but that's just `0f_1`.... why pow when its just a 1 bit active float?
11:53:44PMunch_Hmm, seems to be too small a number
11:54:03FromDiscord<heysokam> yeah its probably the smallest possible i imagine
11:54:18PMunch_float.low then maybe?
11:54:42*PMunch_ is now known as PMunch
11:54:50FromDiscord<heysokam> sure, but then i have the problem. how do i express the next check? `0b_10`
11:55:02FromDiscord<heysokam> meaning as a float, ofc
11:55:07FromDiscord<heysokam> its also gonna be really smalkl
11:55:09FromDiscord<heysokam> (edit) "smalkl" => "small"
11:56:22PMunchI have no idea what you're trying to do
11:56:40PMunchCould always cast a binary number
11:56:55FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4E9X
11:58:23FromDiscord<jviega> I'm also trying to understand. Why would you be doing that? You remember the intricacies of IEEE 754 and write out your bit patterns??
11:58:52FromDiscord<jviega> What are you really trying to accomplish??
11:58:55FromDiscord<heysokam> In reply to @jviega "I'm also trying to": im just trying to check for the first few bits in particular
11:59:22FromDiscord<heysokam> In reply to @jviega "What are you really": a deterministic fixed point math library, that does not crash on float-to-fixed conversion without knowing why
11:59:37FromDiscord<heysokam> so im just making sure that the things im casting do make sense, before i continue
12:00:19Amun-Racasting or .union.
12:02:25Amun-Rahttps://play.nim-lang.org/#ix=4Ea0
12:03:30FromDiscord<heysokam> yeah casting works. i was just trying to understand nim's float syntax for `NeVAL` numbers
12:03:46FromDiscord<heysokam> (edit) "`NeVAL`" => "`Ne-Exp`"
12:04:02*jmdaemon quit (Ping timeout: 260 seconds)
13:16:58*rockcavera joined #nim
14:00:16*PMunch quit (Quit: Leaving)
14:05:01FromDiscord<System64 ~ Flandre Scarlet> Does someone know how I can require a local package please? https://media.discordapp.net/attachments/371759389889003532/1143183981903360010/image.png
14:05:54FromDiscord<odexine> Do you plan on publishing either packages
14:05:57FromDiscord<odexine> (edit) "packages" => "packages#"
14:06:00FromDiscord<odexine> (edit) "packages#" => "package"
14:07:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Do you plan on": No, it's a package required by both client and server↵It contains stuff that is used by both, so I put thoses common stuff inside
14:10:20FromDiscord<System64 ~ Flandre Scarlet> Even absolute paths don't seems to work
14:13:20FromDiscord<jviega> You're "requiring" the github URL of the common code?
14:13:57FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4Eaw
14:14:33FromDiscord<System64 ~ Flandre Scarlet> and the nimble in server requires common
14:16:06FromDiscord<System64 ~ Flandre Scarlet> Oh, it has to be a git repo
14:22:15FromDiscord<jviega> That's the way that definitely works
14:22:32FromDiscord<jviega> There's also "nim develp" but I've never gotten that to work very well
14:47:36FromDiscord<heysokam> In reply to @sys64 "Oh, it has to": it can also take `requires "file://../common"`
14:48:13FromDiscord<heysokam> or a `config.nims` file that says `--path:"../common"`
14:48:47FromDiscord<odexine> In reply to @heysokam "it can also take": I’ve never heard of that, huh
14:49:01FromDiscord<heysokam> In reply to @odexine "I’ve never heard of": atlas does it, thought it should be compatible
14:49:11FromDiscord<heysokam> never heard of it either, just saw it testing atlas
14:49:17FromDiscord<odexine> It might not be compatible for nimble
14:49:24FromDiscord<heysokam> oh
14:49:58FromDiscord<heysokam> well it adds it to the nimble file, so I guess that's atlas saying "its either me or him, pick one"
14:50:15FromDiscord<heysokam> (edit) "one"" => "one. cant have it all""
14:51:54FromDiscord<ShalokShalom (ShalokShalom)> https://diataxis.fr/
14:52:19*xet7 joined #nim
15:08:41*azimut joined #nim
15:10:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "or a `config.nims` file": And in the config.nims, can I do a script that copy some files such as DLLs ?
15:13:06FromDiscord<heysokam> In reply to @sys64 "And in the config.nims,": I would personally take a good look at `heysokam/confy` if you need to configure the buildsystem to do system admin↵I tried already with nimscript, and it gets messy and limiting super fast. With confy you have a proper (self auto-built) executable running the show
15:13:28FromDiscord<heysokam> I had similar requirements in a project, and I never got rid of them until I ported it to confy
15:13:48FromDiscord<heysokam> to answer the question, a `config.nims` file is just nimscript, so yeah I figure it can
15:13:57FromDiscord<heysokam> (edit) "can" => "can. ive never tried though"
15:14:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "to answer the question,": Will take a look to confy↵Btw, should the nims be in src folder, or same folder as the nimble file?
15:15:08FromDiscord<heysokam> i personally store it in the root of where the file being built is
15:15:18FromDiscord<heysokam> so if its a test, is in the `tests` folder, and such
15:15:52FromDiscord<heysokam> the prject setup with `nimble init thefolder` has that setup basically
15:15:57FromDiscord<heysokam> you can take a look at how its made
15:20:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EaO
15:23:11FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EaP
15:23:29FromDiscord<heysokam> you need `--outdir:out` and `-o:server.exe`
15:25:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "you need `--outdir:out` and": -o is undeclared
15:26:34FromDiscord<heysokam> In reply to @sys64 "-o is undeclared": https://nim-lang.org/docs/nimc.html https://media.discordapp.net/attachments/371759389889003532/1143204500065226925/image.png
15:26:48FromDiscord<heysokam> try --out, maybe it doesn't know the -o one
15:26:52FromDiscord<griffith1deadly> In reply to @sys64 "-o is undeclared": try --o:"" or --out:""
15:26:54FromDiscord<heysokam> happened with -d to me some times
15:27:05FromDiscord<heysokam> (edit) "happened with -d to me some times ... " added "inside the .nims config"
15:27:17FromDiscord<heysokam> (edit) removed ".nims"
15:28:03FromDiscord<griffith1deadly> In reply to @heysokam "happened with -d to": why did you stop supporting nassimp? that would be really cool..
15:28:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "https://nim-lang.org/docs/nimc.html": Even that doesn't put the exe in out
15:29:22FromDiscord<heysokam> In reply to @griffith1deadly "why did you stop": because i moved on into `ngltf` which is much better than interoperating with cpp↵there is still https://github.com/beef331/nimassimp, mine was a fork of that to make it static. but their buildsystem is a mess, and interop with tens of unchecked arrays is a pain in the A
15:29:49FromDiscord<heysokam> (edit) "their" => "the assimp" | "mess," => "mess (as in really complex),"
15:30:25FromDiscord<heysokam> In reply to @sys64 "Even that doesn't put": 🤷‍♂️ no clue, i always write tasks for that type of functionality
15:30:42FromDiscord<heysokam> better if its expressed right there in the `nimble tasks` feature, than being hidden in a config file
15:30:47FromDiscord<heysokam> at least in my view
15:30:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "🤷‍♂️ no clue, i": and is it possible to do tasks only after compilation?
15:31:00FromDiscord<griffith1deadly> In reply to @heysokam "because i moved on": do you plan to make support for gltf2? or vrm files
15:31:05FromDiscord<heysokam> In reply to @sys64 "and is it possible": yeah
15:31:21FromDiscord<heysokam> `afterBuild: echo "Hello After"`
15:31:31FromDiscord<heysokam> or even `afterMyCustomTask: ...`
15:31:47FromDiscord<heysokam> In reply to @griffith1deadly "do you plan to": gltf2 is the only file format supported
15:31:50FromDiscord<heysokam> i don't know what vrm files are
15:32:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "`afterBuild: echo "Hello After"`": Undeclared too
15:32:23FromDiscord<griffith1deadly> https://github.com/assimp/assimp/issues/2096↵vrm based on gltf2 format
15:33:14FromDiscord<heysokam> In reply to @griffith1deadly "https://github.com/assimp/assimp/issues/2096 vrm ba": if its -really- based on gltf truly, then you should be able to access the common parts of the file without issues
15:33:37FromDiscord<heysokam> my reader just ignores extensions currently, so I figure that file format must be a custom set of extensions
15:33:52FromDiscord<heysokam> (edit) "so" => "and" | "extensions" => "extensions, which means it -might- read them"
15:34:20FromDiscord<heysokam> (edit) "extensions" => "gltf-extensions"
15:34:27FromDiscord<heysokam> (edit) "gltf-extensions" => "gltf-spec-extensions"
15:36:54FromDiscord<heysokam> @griffith1deadly if this is true, then -all- of the vrm data is contained inside the data that `ngltf` will give you in memory↵just that the metadata will be contained as json inside the respective sections, and you will need to implement those parts https://media.discordapp.net/attachments/371759389889003532/1143207104115654706/image.png
15:37:51*tiorock joined #nim
15:37:52*tiorock quit (Changing host)
15:37:52*tiorock joined #nim
15:37:52*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
15:37:52*tiorock is now known as rockcavera
15:38:07FromDiscord<heysokam> (edit) "you" => "their buffer data contained in the buffers read from the file glb↵you" | "their buffer data contained in the buffers read from the file glb↵youwill ... needto" added "just" | "willjustneed to implement those parts ... https://media.discordapp.net/attachments/371759389889003532/1143207104115654706/image.png" added "to access them"
15:38:51*azimut quit (Ping timeout: 246 seconds)
15:39:35FromDiscord<heysokam> only exception would be if they implemented their buffers as a separate binary blob inside the glb... in that case I don't read that, I only read the json and buffer1 blocks
15:39:40FromDiscord<heysokam> (edit) "blocks" => "blob"
15:40:53FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4EaU
15:42:41FromDiscord<user2m> I know you can use fieldPairs but it loks like u have to instatiate the object before you can iterate over the fields
15:43:04*syl quit (Quit: C-x C-c)
15:44:38FromDiscord<odexine> Just make the object then? for fieldName, field in Foo().fieldPairs:...
15:47:32*syl joined #nim
15:48:18FromDiscord<user2m> Hmm yeah that's what i've been doing but I thought there would a more direct way. if it work it works.
16:12:59FromDiscord<fabricio> how many spaces do yall use to indent nim code? I use 2 spaces but the code becomes hard to read when a file grows into hundreds of lines of code so I'm thinking of switching to 4
16:14:19FromDiscord<odexine> most people do 2
16:14:26FromDiscord<odexine> if it is hard for you, then go with 4
16:15:40FromDiscord<Phil> I tend to just split stuff up when a file goes into the hundreds of jubes
16:15:48FromDiscord<Phil> (edit) "jubes" => "lines"
16:16:19FromDiscord<Phil> 200 lines tends to be around the time where that thought starts tickling me for a given module
16:17:56FromDiscord<heysokam> In reply to @fabricio "how many spaces do": if the file grows into hundreds, you have a bigger architectural problem than 2 spaces, imo
16:18:09FromDiscord<heysokam> nim has proper modules, its not C/C++
16:32:13FromDiscord<jviega> Yeah I still use 2, but do end up making indentation mistakes that would be easier to avoid w/ 4 spaces (or braces which I do not care about 🙂
16:36:25FromDiscord<nervecenter> In reply to @fabricio "how many spaces do": I write it just like Python, 4 spaces and camel_case
16:36:58FromDiscord<nervecenter> (edit) "camel_case" => "snake_case"
16:37:07FromDiscord<nervecenter> I've never liked less than 4 spaces in any language, and I haven't liked camelCase in a loooooong time
16:37:25FromDiscord<nervecenter> Totally fine with kebab-case though, I like lisps
16:37:49FromDiscord<jviega> Yeah, the problem is I try to stick to 80 columns because I'm old and 4 spaces with nim seems to leave me with too much weird wrapping
16:38:23FromDiscord<nervecenter> Careful but liberal use of Nim's punctuation-newline rule is good
16:40:53FromDiscord<jviega> I do that too, but it's not always the most readable thing either, depends on the circumstances.
16:42:59FromDiscord<jviega> For instance, if I've got a block of sequential lets, I want the names lined up, the types lined up if I feel it's important for clarity, and the assignments lined up. Wrapping in that world sucks, and it uses 80 cols pretty past if you name things well.
16:45:07*xet7_ joined #nim
16:45:08*xet7_ quit (Remote host closed the connection)
16:45:43*xet7 quit (Remote host closed the connection)
16:49:03*xet7 joined #nim
16:54:57FromDiscord<fabricio> In reply to @heysokam "if the file grows": yeah, I probably should split it up :p
16:56:43FromDiscord<fabricio> also I'm asking because I'm trying to put that thin line that appears at the begining of every block of indentation and with 2 spaces they look very crammed up
16:58:02FromDiscord<Phil> I tend to go for 2 lines because I very often want to have 2 code-views side by side, so I tend like my lines too long
16:58:12FromDiscord<Phil> And for me that grants enough visual separation
16:59:12*lucasta_ quit (Ping timeout: 256 seconds)
16:59:23FromDiscord<heysokam> In reply to @fabricio "also I'm asking because": ive seen 4spaces used around. its not the common thing, but its seen often enough i would say
16:59:29FromDiscord<heysokam> (edit) "thing," => "thing in nim,"
16:59:46*mal`` quit (Ping timeout: 260 seconds)
17:01:18FromDiscord<jviega> For the FFI, if I'm returning a C "whatever_t " where that's actually an unchecked array, if the nim type decl is a ref type, then the return value should be an UncheckedArray[NimWhatever]? Or is a ptr to one? I can obviously experiment but if anyone knows off the top of my head (trying to make things a bit more natural on top of Futhark output)
17:15:57FromDiscord<odexine> its not wrong to use, no one (~~worth listening to~~) will flame you for using 4 spaces
17:23:09FromDiscord<duskhorn> sent a long message, see http://ix.io/4Ebb
17:28:09FromDiscord<jviega> I'm not a windows person by try this: `https://stackoverflow.com/questions/9507184/can-openssl-on-windows-use-the-system-certificate-store`
17:28:28FromDiscord<saint._._.> Anyone know how to get tree-parser to work with neovim for nim
17:28:35FromDiscord<jviega> You can bring a whole store with you, or pin the cert if it's just one cite.
17:28:52FromDiscord<saint._._.> It says it's installed but the syntax highlighting isnt working for nim
17:29:13FromDiscord<saint._._.> (edit) "nim" => "nim? It says it's installed but the syntax highlighting isnt working for nim. I'm using https://github.com/aMOPel/tree-sitter-nim"
17:30:19FromDiscord<duskhorn> In reply to @jviega "I'm not a windows": This feels so weird to do by myself honestly, can't the openssl library do it by itself or is there an issue?
17:32:22FromDiscord<heysokam> is there any way I could assign a type from a `{.strdefine.}` at compile time?↵something like the user gives me `-d:DefinedType:int32` and i do `type MyType = DefinedType` so it becomes an int32↵i figure it should be a macro, maybe? 🤔
17:32:29*mal`` joined #nim
17:33:53FromDiscord<arathanis> In reply to @heysokam "is there any way": that sounds right to me, yeah
17:33:56FromDiscord<arathanis> probably using `bindSym`
17:38:22FromDiscord<duskhorn> In reply to @duskhorn "I don't know where": someone help me think here↵it seems like I need to "ship" a certificate file with my app. ↵Can I somehow "mbed" a .pem file into mi executable?↵If not, do I need to make an installer?
17:40:23FromDiscord<jviega> Why do you need to ship a cert?? That is not true in the slightest.
17:41:04FromDiscord<duskhorn> then I don't understand how to solve my problem XD
17:41:13FromDiscord<jviega> The link I gave you the question was about using the windows-native cert store. They could just install OpenSSL on Windows would do the same thing. Or, you could carry around a whole cert store, but seems daft.
17:41:50FromDiscord<arathanis> In reply to @duskhorn "then I don't understand": is the issue that his machine does not have an SSL cert set up?
17:42:08FromDiscord<arathanis> Lots of http clients by default won't allow non-secure requests unless you specifically enable it.
17:42:16FromDiscord<duskhorn> In reply to @arathanis "is the issue that": probably? I'm gonna ask him
17:42:33FromDiscord<arathanis> if he has not done something like let's encrypt i imagine a request to have that kind of error
17:42:41FromDiscord<arathanis> (edit) "let's encrypt" => "Let's Encrypt"
17:42:50FromDiscord<arathanis> (edit) "to" => "would"
17:43:10FromDiscord<jviega> Not if it works from another machine to the same server
17:43:23FromDiscord<duskhorn> In reply to @arathanis "Lots of http clients": I mean. I used this↵https://nim-lang.org/docs/httpclient.html
17:43:28FromDiscord<jviega> That error indicates it's not finding the local cert store
17:43:43FromDiscord<jviega> That it GOT a cert but can't validate it
17:43:47FromDiscord<arathanis> In reply to @jviega "Not if it works": If the URL is hard coded as an external URL it will still go over the internet and fail even if its technically on localhost
17:44:30FromDiscord<jviega> It's not going to give an error about no cert when you don't make a TLS connection
17:44:31FromDiscord<duskhorn> I had the same error at first, I did this and it got fixed↵https://github.com/nim-lang/nimble/issues/904#issuecomment-808376364
17:44:49FromDiscord<arathanis> @duskhorn look at this section: https://nim-lang.org/docs/httpclient.html#sslslashtls-support
17:45:36FromDiscord<arathanis> you might only need `var client = newHttpClient(sslContext=newContext(verifyMode=CVerifyNone)))`
17:45:39FromDiscord<jviega> Yes, that is saying the same thing, you need to make sure OpenSSL (which nim is using) has root CA information so it can validate.
17:45:57FromDiscord<arathanis> i don't recommend it but if that fixes it its beacuse your friend's server is not SSL secured.
17:45:58FromDiscord<jviega> You can copy them in yourself, hook up to the windows one, or whatever
17:46:01FromDiscord<arathanis> pretty common issue.
17:48:37FromDiscord<arathanis> if that does not fix it, jtv's suggestion to bundle a cert is probably the right way.
17:49:06FromDiscord<jviega> That wasn't my suggestion at all.
17:49:22FromDiscord<jviega> Nor should you do CVerifyNone, that's a horrible idea
17:49:44FromDiscord<arathanis> oh you meant root certs
17:50:05FromDiscord<arathanis> In reply to @jviega "Nor should you do": im not saying its the right thing to do, im saying try it and if it fixes it then you know whats happening and can now approach the situation.
17:50:08FromDiscord<arathanis> (edit) "situation." => "situation correctly."
17:50:12FromDiscord<jviega> I said do it right, either use the Windows cert store or install a root CA store if it's too hard
17:50:27FromDiscord<jviega> I'd pin a cert before I'd turn off TLS
17:50:38FromDiscord<jviega> Tho that's much easier to do in OpenSSL3 than in 2
17:51:10FromDiscord<arathanis> if their friends server has no SSL certs for the endpoint hes pinging you can get these kinds of errors. im merely suggesting using that very small change to see if that is the cause or not
17:51:20FromDiscord<arathanis> narrowing down the issue is classic troubleshooting
17:51:38FromDiscord<arathanis> actually turning SSL off as a solution is big no
17:51:40FromDiscord<arathanis> (edit) "actually turning SSL off as a solution is ... big" added "a"
17:51:56FromDiscord<duskhorn> I'm disabling the verify so far, tho I don't think this is the issue
17:52:21FromDiscord<arathanis> then it probably needs the root cert of your friends server so it can verify
17:52:41FromDiscord<arathanis> like jtv was sasying. either install the root certs of their vendor or pin the proper cert
17:53:39FromDiscord<jviega> OpenSSL and Windows both ship with a trusted store of root certs. Shouldn't have to install anything else unless they've self-signed, which isn't likely, given if they had, they'd presumably know how to install their self-signed cert
17:55:24FromDiscord<duskhorn> It still doesn't work. I don't understand what I need to do right now tbh lol
17:56:18FromDiscord<duskhorn> you said something about root certs, is it something on my app's end, my friend's pc or his sevrer?
17:56:21FromDiscord<duskhorn> (edit) "sevrer?" => "server?"
17:56:34FromDiscord<jviega> If he can hit the URL in a browser w/o error then it's going to be the link I posted you or install the OpenSSL roots
17:57:20FromDiscord<arathanis> when you connect to your friends server, there is an SSL handshake where certificates are exchanged. Your app uses the built-in cert store on the device to verify the cert from the server. Our current assumption is the machine running the application and pinging the server is failing to verify your friend's server's certificate.
17:57:21FromDiscord<jviega> It's a bit of both. If your friends' server has the openssl store installed, then your app will work. Otherwise your app needs to use the windows one (I think that link I gave you) or drop off the OpenSSl store.
17:57:25FromDiscord<duskhorn> we can both hit the url with no errors
17:57:37FromDiscord<arathanis> cert issues are the best
17:58:27FromDiscord<jviega> Your app is not finding the info it needs to validate, as OpenSSL does not look at the Windows store itself.
17:58:38FromDiscord<jviega> But the browsers certainly do.
17:58:58FromDiscord<duskhorn> so my app needs to load the ssl store somehow. is that the issue?
17:59:04FromDiscord<jviega> Yes
17:59:22FromDiscord<jviega> You either need to integrate w/ the windows one or automatically bring the OpenSSL one.
18:00:17FromDiscord<duskhorn> ok but why is this not an issue on linux then? I remember doing something like this with an http server sending POSTs to a different server?↵Is it a Windows quirkiness?
18:01:10FromDiscord<jviega> Because every distro uses the OpenSSL cert store
18:01:17FromDiscord<jviega> And every other crypto library does too
18:02:39FromDiscord<jviega> Even MacOS pre-installs it, even though they also have their own secure enclave for cert storage.
18:03:01FromDiscord<duskhorn> so hold up a second though
18:03:09FromDiscord<duskhorn> hm
18:03:11FromDiscord<duskhorn> ok I got it
18:04:16FromDiscord<duskhorn> Ok but suppose you need to ship an actual application to users, how do you do this? Whats the most convenient thing to do? Trying to use the windows certs or some other thing?
18:04:24FromDiscord<jos7388> is there a binding generator to generate rust bindings for nim code?
18:04:27FromDiscord<jos7388> kind of like the reverse of nbindgen
18:19:23FromDiscord<jviega> I'd probably try to get the Windows cert store working yes
18:23:21FromDiscord<duskhorn> In reply to @jviega "I'd probably try to": ok, thank you both @jviega and @arathanis!
18:24:07FromDiscord<arathanis> np dude and gl
18:33:02*junaid_ joined #nim
18:33:15*junaid_ quit (Client Quit)
19:29:09*jmdaemon joined #nim
19:54:39FromDiscord<Elegantbeef> You could try the `--header` and if rust has something like futhark that could work↵(@jos7388)
19:55:17FromDiscord<jos7388> that’s a good idea
19:55:27FromDiscord<jos7388> they should work pretty well
19:55:29FromDiscord<jos7388> Ty
19:57:53FromDiscord<Elegantbeef> Worth noting it's technically not supported, but it does work
20:11:33FromDiscord<jos7388> the idea in general is good
20:11:40FromDiscord<jos7388> i found genny and i might use that instead of --header
20:41:10FromDiscord<.maverk> is there any difference between using ``float64`` or ``float`` ?
20:42:35Amun-Ranot on 64-bit arch
20:42:37FromDiscord<Andreas> In reply to @.maverk "is there any difference": no difference when your on a 64-bit CPU.
20:43:08FromDiscord<.maverk> In reply to @Andreas "no difference when your": so ``float`` is a c datatype in nim ?
20:45:05Amun-Rano
20:45:33FromDiscord<Andreas> @.maverk not sure, but there is a `cfloat`-type, so no. `float` is 32-bit on 32-bit-arch and 64-bit on 64-bit Cpu
20:45:37FromDiscord<.maverk> In reply to @Amun-Ra "no": then what ? why do we need float when we have float64 ?
20:46:15FromDiscord<.maverk> In reply to @Andreas "<@1021771961040375900> not sure, but": oky now i understand
20:46:20FromDiscord<.maverk> machine dependent
20:46:46FromDiscord<Andreas> In reply to @.maverk "then what ? why": convenience, and when you compile for a 32-bit platform `float` works too
20:46:53Amun-Rafloat has architecture dependent length, if you want a specific length regardless of cpu arch, use either float32 or float64
20:47:08FromDiscord<.maverk> In reply to @Andreas "convenience, and when you": but works on windows ?
20:47:28FromDiscord<Andreas> In reply to @.maverk "but works on windows": not sure, not living there...
20:47:46Amun-Ra.maverk: it does
20:47:48FromDiscord<.maverk> In reply to @Andreas "not sure, not living": i see
20:47:57FromDiscord<.maverk> In reply to @Amun-Ra ".maverk: it does": now i understand it
20:48:04FromDiscord<.maverk> it is a machine dependt type
20:48:14FromDiscord<.maverk> it can be 64 on 64 and 32 on 32
20:48:26FromDiscord<.maverk> float is both float32 / float64
20:48:40Amun-Rawell, it's either 32 or 64
20:48:51FromDiscord<.maverk> In reply to @Amun-Ra "well, it's either 32": thank you brother
20:48:59FromDiscord<.maverk> In reply to @Andreas "not sure, not living": thanks brother
20:48:59Amun-Rano worries mate
21:29:01FromDiscord<konsumlamm> actually, `float` is always `float64`
21:30:57FromDiscord<.maverk> In reply to @konsumlamm "actually, `float` is always": why always ?
21:31:20FromDiscord<.maverk> if it is always 64 what is the benefit of it then ???
21:31:34FromDiscord<konsumlamm> ask Araq
21:43:17*genr8eofl_ quit (Ping timeout: 245 seconds)
21:44:46FromDiscord<djazz> In reply to @konsumlamm "actually, `float` is always": Learned the hard way when coding for embedded. Float was slower than float32, and float32 was silently interpreted as float64 in compiletime.
21:44:46*genr8eofl_ joined #nim
21:48:17FromDiscord<Chronos [She/Her]> float32 treated as float64? Huh?
22:06:29*advesperacit quit ()
22:19:07FromDiscord<Elegantbeef> The VM should mimic the host, so it's likely just that whole `floatVal: BiggestFloat`
23:23:46*azimut joined #nim