<< 21-10-2022 >>

00:18:02FromDiscord<Elegantbeef> Oh @Patitotective just noticed my VM addition was merged so that means you can just PR directly now 😄
00:20:27*derpydoo joined #nim
00:43:46FromDiscord<Patitotective> In reply to @Elegantbeef "Oh <@762008715162419261> just noticed": :]
01:07:54arkanoidI need to turn the importcpp header file into an absolute path, as it seems to work relative to the working directory, instead of the directory where the module is
01:08:19arkanoidis there a compile time way to the absolute path of a module
01:21:46arkanoidfound: https://nim-lang.org/docs/system.html#currentSourcePath.t
01:29:37*arkurious quit (Quit: Leaving)
01:55:22FromDiscord<Rika> Oh wow this channel sure was lively
01:55:50FromDiscord<Elegantbeef> Yea more than 2 people were talking, it's wild
02:12:06FromDiscord<Rika> Beef 💪
02:12:15FromDiscord<Rika> Carried the channel lol
02:12:32FromDiscord<Elegantbeef> I just tippity type
02:12:46FromDiscord<Elegantbeef> And i didnt answer Mike's async question
02:12:50FromDiscord<Elegantbeef> So you best answer it
02:13:12FromDiscord<Rika> Where
02:14:01FromDiscord<Elegantbeef> About reading from stdin async
02:14:18FromDiscord<Rika> Windows standard terminal IO cannot be non blocking without an extra thread simulating it
02:14:36FromDiscord<Rika> Legitimately no way, from what I recall
02:14:48FromDiscord<Rika> If it’s not windows then the open async version should have worked
02:15:51FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4dIF
02:45:27FromDiscord<Prestige> How's it hangin Beef
02:51:33FromDiscord<Elegantbeef> How do i reply to that without something comical
02:52:10FromDiscord<Rika> You just did
02:52:16FromDiscord<Elegantbeef> Damn it rika!
03:05:01FromDiscord<Prestige> haha
03:11:05FromDiscord<Patitotective> huh, whi is there `readDataStr` and not `peekDataStr`
03:11:21FromDiscord<Patitotective> (edit) "whi" => "why"
03:12:20*derpydoo quit (Quit: derpydoo)
03:13:05FromDiscord<Elegantbeef> Peek doesnt move ahead
03:13:37FromDiscord<Patitotective> yea but there is `readData` and `peekData`
03:13:46FromDiscord<Elegantbeef> Yes cause `peek` doesnt move ahead
03:13:51FromDiscord<Elegantbeef> Oh i misread
03:13:55FromDiscord<Elegantbeef> Lol i can read
03:14:11FromDiscord<Patitotective> anyways there is `peekStr` :p
03:14:48FromDiscord<Rika> In reply to @Elegantbeef "Oh i misread": I was gonna say
03:14:50FromDiscord<Rika> Lol
03:15:24FromDiscord<Patitotective> can i peek backwards? i need to get the start and end of line by just knowing a column
03:15:42FromDiscord<Patitotective> sort of "read line from start"
03:15:43FromDiscord<Rika> No
03:15:45FromDiscord<Patitotective> (edit) "start"" => "start of the last line""
03:15:59FromDiscord<Rika> Once it’s read you have to seek to go back
03:18:56FromDiscord<Patitotective> `setPosition(getPosition() - 1)`?
03:19:29FromDiscord<Elegantbeef> Correct
03:19:54FromDiscord<Patitotective> he can read
03:20:36FromDiscord<Rika> I’m shocked
03:20:37FromDiscord<Elegantbeef> Only on seconds that end with 4
03:20:56FromDiscord<Patitotective> In reply to @Patitotective "`setPosition(getPosition() - 1)`?": they really like verbose names `getPos`, `setPos` was enough↵properties would also be nice `pos` `pos=`
03:21:33FromDiscord<Rika> Think that’s just because it’s old
03:22:21FromDiscord<Patitotective> old people had more time to spend it writing verbose names, i get it
03:22:27FromDiscord<Patitotective> (edit) removed "it"
03:23:53FromDiscord<Rika> Lol
03:25:33FromDiscord<Patitotective> anyway, i still havent done the strutils thing yet↵i was doing crochet and then started to work on streams support for kdl's lexer
03:25:35FromDiscord<Patitotective> 🌃
03:28:59FromDiscord<Elegantbeef> Hey it's fine it likely will depend on parseutils and that is borked
04:02:24*Onionhammer quit (Quit: Ping timeout (120 seconds))
04:02:43*Onionhammer joined #nim
04:42:35FromDiscord<sOkam!> I'm trying to use this to remove the last element of a seq↵I was using `[^1]` before for other tasks, but this seems to error if you use that syntax↵How would you remove the last element instead? 🤔 ↵https://nim-lang.org/docs/system.html#delete,seq[T],Natural
04:51:42FromDiscord<sOkam!> I guess `thing.delete(thing.len-1)` works 🤷‍♂️
04:52:48FromDiscord<Elegantbeef> `thing.delete(thing.high)`
05:23:55FromDiscord<demotomohiro> `thing.setLen(thing.high)`
05:25:49FromDiscord<demotomohiro> Or implement `proc delete[T](x: var seq[T]; i: BackwardsIndex)`
05:39:47FromDiscord<sOkam!> Can a variable have multiple types?↵something like `var num: int | nil`
05:40:15FromDiscord<Elegantbeef> No object variants must be used
05:40:21FromDiscord<Elegantbeef> Or in your case `std/options`
05:40:37FromDiscord<sOkam!> Otherwise, how can you check that an int has not been previously set, but still be able to handle `0` as a valid index?
05:40:53FromDiscord<Elegantbeef> `std/options`
05:43:14FromDiscord<sOkam!> that sounds way too overcomplicated. Having to need a separate int type with new procedures just for checking for -not-set- sounds not enticing 😔
05:43:30FromDiscord<Elegantbeef> What?
05:43:43FromDiscord<sOkam!> type Thing = object
05:43:50FromDiscord<Elegantbeef> you can also just do `var num = -1` if you're really after it
05:44:28FromDiscord<sOkam!> hmmm true, actually forgot that these numbers are never negative. good point!
06:30:07*PMunch joined #nim
06:47:20*notchris quit (Quit: Connection closed for inactivity)
07:08:36*kenran joined #nim
07:09:21NimEventerNew thread by miran: NimConf 2022 - Saturday, October 22nd, see https://forum.nim-lang.org/t/9539
07:10:39FromDiscord<narimiran> sent a long message, see http://ix.io/4dJr
07:25:23FromDiscord<sOkam!> does the `is` keyword preform weird like with python, or is it just the intuitive `==`, but aliased?
07:25:35FromDiscord<Elegantbeef> It's a type comparison
07:33:07*krux02 joined #nim
07:38:40*rockcavera quit (Remote host closed the connection)
08:10:00FromDiscord<sOkam!> how does one join two separate tables, of the shape`std/tables.Table[Type, Type]`?
08:10:12FromDiscord<sOkam!> (edit) "shape`std/tables.Table[Type," => "shape `std/tables.Table[Type,"
08:14:05FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJA
08:22:42FromDiscord<Elegantbeef> No, but also worth noting you hide an 'error'
08:23:12FromDiscord<Elegantbeef> in your second loop you silently replace a duplicated value
08:23:34FromDiscord<Elegantbeef> That might be fine in your case though i guess
08:30:03FromDiscord<sOkam!> yeah, i know. keys won't be duplicate in this file format, so its not a problm for this usecase
08:32:29FromDiscord<Elegantbeef> Why do you even have a table then?
08:32:41FromDiscord<Elegantbeef> I dont get the point if they're set values
08:32:44FromDiscord<sOkam!> because that's what i found when searching "nim dictionary"
08:33:07FromDiscord<sOkam!> and they key names are unknown, they can be anything
08:33:16FromDiscord<Elegantbeef> Ah ok
08:33:18FromDiscord<sOkam!> (edit) "key" => "pairs"
08:34:09FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJC
08:34:25FromDiscord<Rika> Set length to 0?
08:34:35FromDiscord<sOkam!> wdym?
08:34:38FromDiscord<sOkam!> not following
08:35:04FromDiscord<Elegantbeef> `input.setLen(0)`
08:35:04FromDiscord<Elegantbeef> It's much more efficient
08:35:05FromDiscord<Rika> https://nim-lang.org/docs/system.html#setLen%2Cseq%5BT%5D%2CNatural
08:35:12FromDiscord<sOkam!> kk. but it was complaining about the generic part, i believe
08:35:22FromDiscord<Rika> Clear[T]
08:36:06FromDiscord<Elegantbeef> for generic types if you dont care about the generics you can do `proc clear(input: var seq) = input.setLen(0)`
08:36:35FromDiscord<sOkam!> ah that works, yep. tyty ✍️
08:36:50*ttkap quit (Ping timeout: 248 seconds)
08:50:13FromDiscord<sOkam!> Is there an existing way to iterate through all fields of a custom object type recursively?
08:50:49FromDiscord<Elegantbeef> Nope, there is `fieldPairs` but that doesnt do it recursively
08:56:11FromDiscord<Phil> That just unrolls the loop. Though sadly we don't have a macro for unrolling a loop over compile-time seq, there is now like 3 ways to do it in a SO question that I happen to know by chance!
08:56:38FromDiscord<Elegantbeef> It doesnt "just unroll"
08:57:11FromDiscord<Elegantbeef> And cmon phil i'm pretty proud of my variation
08:57:35FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJG
08:57:42FromDiscord<Elegantbeef> Works on all iterators and isnt that complicated
08:57:46FromDiscord<sOkam!> What am I missing?
08:57:48FromDiscord<Phil> In reply to @Elegantbeef "And cmon phil i'm": Which I added to the SO question!
08:58:01FromDiscord<Elegantbeef> https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT
08:58:10FromDiscord<Elegantbeef> Lol the docs are wrong
08:58:17FromDiscord<Phil> Also, "unrolling" is the only thing I can see documented about it
08:58:19FromDiscord<Elegantbeef> it's `for name, field in obj.fieldPairs`
08:58:21FromDiscord<Phil> So thus "just unrolls"
08:59:05FromDiscord<Elegantbeef> Actually nevermind docs arent wrong
08:59:22FromDiscord<Elegantbeef> That's an overload for yielding over two objects of the same type
08:59:33FromDiscord<Elegantbeef> Yea that's more of how it works and less it does↵(@Phil)
08:59:41FromDiscord<Elegantbeef> Static type system requires that unroll there
09:00:56FromDiscord<Phil> Unrolled for loops also have the very nice side-effect that you can use the outputs of those loops for meta-programming, unlike real loops
09:01:11FromDiscord<Elegantbeef> What?
09:01:36FromDiscord<Phil> If you do for loop over seq[static string] the iterator-variable type is not static string
09:01:59FromDiscord<Phil> Which is really effing Annoying if you want to generate dot expressions with the strings in that seq[static string]
09:02:43FromDiscord<Phil> Got to unroll that loop over the seq[static string] in order to get the variable as static string which you can then use to generate dot expressions
09:06:39FromDiscord<Elegantbeef> Or just feed the seq to the macro
09:06:53FromDiscord<Phil> Bah, that'd mean more macro code than absolutely necessary!
09:07:08FromDiscord<Elegantbeef> he says as he has a macro to unroll the loop
09:07:23FromDiscord<Phil> exactly!
09:07:42FromDiscord<Elegantbeef> 1 \< 1
09:08:31FromDiscord<Phil> sent a long message, see http://ix.io/4dJK
09:08:46FromDiscord<Phil> (edit) "http://ix.io/4dJK" => "https://paste.rs/HJr"
09:10:48FromDiscord<Phil> It's honestly kinda bonkers how far generics and a compile-time proc here or there can get you in general
09:11:19FromDiscord<Elegantbeef> Yea i have a full toy ECS that has a single macro
09:12:13FromDiscord<Elegantbeef> And it supports querying with `for (health, pos) in archetypes.filter((Health, Position))`
09:13:47NimEventerNew thread by drkameleon: Enums, custom overloads & redundant strings, see https://forum.nim-lang.org/t/9540
10:14:16*jmdaemon quit (Ping timeout: 252 seconds)
11:06:51arkanoidis nil a float nan, under the hood?
11:17:42*wallabra quit (Ping timeout: 255 seconds)
11:17:49*wallabra_ joined #nim
11:20:03FromDiscord<exelotl> You mean a float with binary zero value?
11:20:14*wallabra_ is now known as wallabra
11:35:47FromDiscord<demotomohiro> When a float is nan, exponent field is filled with all 1 bit and significand field is not zero:↵https://en.wikipedia.org/wiki/IEEE_754#Binary↵And when float is 0, all bits are 0.
11:43:58FromDiscord<auxym> floats, as a value type, aren't nullable though. `ref float` is, but then it's just a null pointer.
11:44:00FromDiscord<Generic> it's actually pretty clever design
11:44:59FromDiscord<Generic> how zero is technically a subnormal which allows the factor to become actually zero
11:45:19FromDiscord<Ekopalypse> dir
12:04:39NimEventerNew post on r/nim by thindil: NimConf 2022, see https://reddit.com/r/nim/comments/y9ry1z/nimconf_2022/
12:27:42*arkurious joined #nim
12:29:31FromDiscord<pietroppeter> In reply to @Generic "it's actually pretty clever": https://ciechanow.ski/exposing-floating-point/ a great technical explanation of floating point (from the author that recently topped HN with >2k points with his latest blogpost on sound)
12:51:09FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dKz
12:51:23FromDiscord<Andycol> what am i missing
12:54:10PMunch@Andycol, you're not assigning clusterId to anything?
12:57:32FromDiscord<Andycol> im assigning it to the output of the stdin
12:58:29FromDiscord<Andycol> or am i wrong?
12:59:17*PMunch quit (Quit: Leaving)
13:00:14FromDiscord<Andycol> would you mind to show me?
13:18:46FromDiscord<Andycol> actually sorry that was stupid i fixed it
13:28:23*kenran quit (Remote host closed the connection)
13:39:04FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4dKH
13:44:15*derpydoo joined #nim
14:06:18*qwr . o O ( floats are NaNable... )
14:10:45FromDiscord<auxym> yes, but arkanoid said "nil"
14:11:29FromDiscord<auxym> floats can be nan, but also other subnormals, inf, -inf. which aren't really nil (= null pointer).
14:12:25qwrand its that way in any language supporting IEEE 754 floating point numbers...
14:13:02FromDiscord<auxym> yes. I just have no idea what "is nil a float nan, under the hood?" is actually supposed to mean
14:13:42FromDiscord<auxym> like, "nil in general" is a null pointer, nothing to do with any kind of float...
14:13:50ehmryyou can use NaN boxing to express nil as a hack
14:14:21ehmrythere is a buttload of NaNs waiting to be abused as special errors
14:14:23FromDiscord<auxym> you can, but that's not implemented natively in nim
14:14:39FromDiscord<auxym> and not part of ieee 754
14:14:47ehmryright, because floating point isn't native in any modern languages
14:16:00ehmrythe hardware does extra exception handling and then it is always thrown away
14:16:09qwrimho it wouldn't be worth of the effort anyway, because it's pretty rare to actually need an optional float value - and in that case the programmer is free to do its own NaN hacks to optimize
14:16:38FromDiscord<auxym> I'm not sure I follow. float is indeed what I would consider a "native" type of the nim language (it's implemented in the stdlib/compiler). CPUs have FPUs to "natively" handle floats.
14:17:13ehmrybut you don't "natively" interact with the FPU the way it was intended
14:18:46ehmrywhatever, I just don't like floats
14:21:18ehmryand I probably don't know what I'm talking about
14:22:13*rockcavera joined #nim
14:22:13*rockcavera quit (Changing host)
14:22:13*rockcavera joined #nim
14:24:17FromDiscord<auxym> yeah, in that case me neither 😛 no idea about the low level workings of fpus. My point is just that nan boxing or nil floats isn't a concept that exists in the nim language atm.
14:26:55ehmrywe also don't have float16 support but I don't know who does
14:28:13FromDiscord<Generic> cpus don't really suppord doing math with those
14:28:24FromDiscord<Generic> aarch64 has instructions to convert from and to them, but that's it
14:29:11FromDiscord<Generic> so float16 would mostly be just a hazard similar to <32 bit integer types
14:45:18*pro joined #nim
15:01:52FromDiscord<Andycol> sent a code paste, see https://paste.rs/Oza
15:01:57FromDiscord<Andycol> cant understand it
15:05:41FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=4dLd
15:05:50FromDiscord<qb> (edit) "https://play.nim-lang.org/#ix=4dLd" => "https://play.nim-lang.org/#ix=4dLe"
15:06:47FromDiscord<ChocolettePalette> Try it with var instead of let↵(@Andycol)
15:07:59FromDiscord<Andycol> aah that did it but the issue is actually related to my writetofile not liking the variable name 😢
15:15:34*pro quit (Read error: Connection reset by peer)
15:20:33*pro joined #nim
15:26:24FromDiscord<Phil> In reply to @qb "Could a user defined": You mean have a pragma with a value? Yeah that's possible
15:27:04FromDiscord<Phil> Look at norm and its table name pragma for an example
15:27:56FromDiscord<qb> Sorry?
15:28:47FromDiscord<Phil> You want to have a pragma that, when you later access it, has some kind of value , right?
15:29:04FromDiscord<Phil> Line a certain number or a string
15:31:55FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=4dLk
15:33:22FromDiscord<Phil> Ah, you mean pass it a compile-time variable instead of an explicit value
15:34:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLl
15:34:41FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4dLl" => "https://play.nim-lang.org/#ix=4dLm"
15:34:51FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4dLm" => "https://play.nim-lang.org/#ix=4dLn"
15:36:10FromDiscord<Andycol> Would anyone mind telling me why line 85 here is saying variable is undeclared when it works above?
15:36:11FromDiscord<Andycol> https://pastebin.com/V2QWBJQ1
15:36:33FromDiscord<Andycol> (edit) "85" => "89"
15:37:08FromDiscord<Andycol> im pulling all my hair out here
15:39:09FromDiscord<Phil> to you qb:↵I'm mostly trying to wrap my head around what exactly you want, I don't use importc, but I am familiar with doing all sorts of providing metadata via pragma for e.g. model fields
15:43:45FromDiscord<Phil> In reply to @Andycol "Would anyone mind telling": From what I'm seeing I highly recommend just putting all this format-string rendering into separate procs just for readability
15:44:00FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4dLs
15:44:33FromDiscord<Andycol> In reply to @Isofruit "From what I'm seeing": yea i can do that, but do you think that would fix it?
15:46:08FromDiscord<Phil> It would at the very least reduce your chances of it being some kind of indentation error
15:46:24FromDiscord<Phil> Because at the very least I can't guarantee you it isn't one of those
15:46:43FromDiscord<Andycol> yea because the error compiling is `/root/.choosenim/toolchains/nim-1.6.8/lib/core/macros.nim(533, 1) Error: undeclared identifier: 'ffqdn'↵`
15:48:00FromDiscord<Andycol> but yea let me clean it up like with different procs and see from there
15:48:01FromDiscord<Andycol> thanks
15:48:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLv
15:48:57FromDiscord<demotomohiro> In reply to @Andycol "Would anyone mind telling": It is because that `writefile` is out side of the proc that contains the variable `ffqdn`.
15:49:33FromDiscord<Andycol> it should still be in `proc configonly`
15:50:40FromDiscord<demotomohiro> Line 85 doesnt have indent.
15:52:10FromDiscord<Andycol> In reply to @demotomohiro "Line 85 doesnt have": that fixed it!!! but why didnt it moan about indentation
15:52:17FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLw
15:53:05FromDiscord<Phil> In reply to @Andycol "that fixed it!!! but": Because it could've been that you intentionally didn't put it in that context, maybe you wanted to render that string just with different variables and forgot to define them?↵The direct error it registers is that you're trying to put in variable X and X isn't defined, thus it throws that out as the error
15:53:05FromDiscord<Andycol> In reply to @Isofruit "Stuff like that is": this is awesome
15:53:19FromDiscord<Andycol> In reply to @Isofruit "Because it could've been": aaah i see
15:53:53FromDiscord<Andycol> you guys are awesome thanks!!!!!
15:54:06FromDiscord<Andycol> @Phil and @demotomohiro 🚀
15:54:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLz
15:55:08FromDiscord<Andycol> thanks!!
15:55:51FromDiscord<Phil> As a sidenote for coding in general, regardless of the language, I heavily recommend only using variable names that actually have meaning, never ever use abbreviations outside of stuff like "HTML" or "CSS" which is actually universally understood. Just for readability.
15:56:11FromDiscord<Andycol> thanks for the recommendation
15:57:33*CyberTailor joined #nim
16:41:06*jmdaemon joined #nim
17:07:01arkanoidhow can I force rebuild when "nimble build"?
17:07:33arkanoidI am modifying C++ files imported with compile pragma, but if I edit them nimble seems not picking up the difference
17:14:06FromDiscord<demotomohiro> nim has `-f` option to force rebuild.
17:21:38*CyberTailor left #nim (Konversation terminated!)
17:35:26arkanoidthanks
17:38:17*LuxuryMode joined #nim
18:23:41FromDiscord<Horizon [She/Her]> What should i use if i want to separate the game's rendering logic and the actual things like calculations, so if the calculations are taking a long time, the UI doesn't freeze?
18:23:54FromDiscord<Horizon [She/Her]> Should i use async programming? Or threading?
18:24:08FromDiscord<Horizon [She/Her]> The goal is to make this an android app eventually so gotta keep that in mind too
18:27:13FromDiscord<Bung> all android programing I known is programing under framework, it provide its own solution
18:29:57FromDiscord<Horizon [She/Her]> I'm using Raylib for my game aha
18:30:53*CyberTailor joined #nim
18:32:14FromDiscord<Bung> I think you'll make ui thread as main thread
18:34:07*CyberTailor left #nim (#nim)
18:34:28FromDiscord<Horizon [She/Her]> Yeah that's the idea
18:34:42FromDiscord<Horizon [She/Her]> But I don't know how I'm supposed to communicate what is supposed to be rendered? :P
18:37:26*ttkap joined #nim
18:39:42FromDiscord<Horizon [She/Her]> Nim devel doesn't support the lsp and nimsuggest is dying :/
18:40:40FromDiscord<Horizon [She/Her]> Wait does nim suggest not provide that highlight/snippet when you hover over code?
18:42:44FromDiscord<Bung> your lsp server may die
18:44:51FromDiscord<Horizon [She/Her]> The lsp has always worked better for me, in my experience when using it on nim stable
18:50:38FromDiscord<Horizon [She/Her]> God i really want Nim to improve their lsp
18:50:46FromDiscord<Horizon [She/Her]> Editor support in general
18:50:50FromDiscord<Horizon [She/Her]> It's so helpful when it works
18:52:19FromDiscord<Bung> someone has done some contribution to nimsuggest recently
18:59:39FromDiscord<Horizon [She/Her]> Oh?
18:59:50FromDiscord<Horizon [She/Her]> My issue rn is nimlangserver won't even compile and I'm trying to tinker lol
18:59:57FromDiscord<Horizon [She/Her]> Is there a way to ignore gcsafe warnings?
19:04:08FromDiscord<Horizon [She/Her]> Ah, compiling with laxEffects works, I'm assuming it's because of the strictEffects option now becoming the default
19:16:11FromDiscord<hovsater> sent a code paste, see https://play.nim-lang.org/#ix=4dMq
19:21:37FromDiscord<hovsater> I've tried doing `nim c -l='-F /Library/Frameworks -framework SDL2' part1.nim` and while that makes the code compile, it still complains about not finding the dylib (`could not load: libSDL2.dylib`).
19:30:42FromDiscord<hovsater> Got it working! Compiling with `nim c --dynlibOverrideAll -l='-F /Library/Frameworks -framework SDL2 -framework SDL2_ttf' part1.nim` seem to do the trick.
19:31:26FromDiscord<hovsater> It's a shame the book doesn't help you out. Especially since you may not have been exposed to a compiler/linker if you've only done say Ruby and web development.
19:50:14NimEventerNew Nimble package! casting - A wrapper of the C++ cast operators, see https://github.com/sls1005/nim-casting
19:54:02*pro quit (Ping timeout: 272 seconds)
20:06:46*wallabra_ joined #nim
20:08:36*wallabra quit (Ping timeout: 272 seconds)
20:08:39*wallabra_ is now known as wallabra
20:13:12*derpydoo quit (Ping timeout: 255 seconds)
20:14:41*wallabra quit (Ping timeout: 272 seconds)
20:31:19FromDiscord<Mike> Holy shit it works, thank you!↵(@Rika)
20:32:19FromDiscord<Mike> linux-only is fine for now. I'll figure it out on windows if I really need to
20:46:03FromDiscord<hotdog> Hey @hovsater welcome 🤗 Nim is often thought of as a “systems programming language” and has an assumption that the user is familiar with other systems languages like C. Please don’t let that put you off, it’s a great way to get into programming at a lower level than ruby
21:02:34FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4dMO
21:05:44*wallabra joined #nim
21:17:40FromDiscord<Patitotective> sent a code paste, see https://paste.rs/Xn6
21:40:00*CyberTailor joined #nim
21:51:07*CyberTailor left #nim (Konversation terminated!)
22:13:58FromDiscord<haywireSSC> Why does nim compile to c
22:14:11FromDiscord<haywireSSC> Instead of machine code directly
22:14:31arkanoidis it possible to create a stack-only table?
22:14:37FromDiscord<Elegantbeef> It gives you some wonderful capabillities
22:14:50FromDiscord<Elegantbeef> Human readable IR(yes llvm exists), the abillity to use obscure compilers for obscure hardware
22:15:18FromDiscord<Elegantbeef> Depends ark, what are the types?
22:15:34arkanoidfloat
22:15:40arkanoidfloat64 actually
22:15:54FromDiscord<Elegantbeef> The key is a float and the val is a float?
22:16:19FromDiscord<Elegantbeef> Is this for a LUT?
22:16:30arkanoidactually, my fault, the key is an int, the value is a float
22:16:37arkanoid(just found a bug in my code, lol)
22:17:22arkanoidinitTable[int, float](100) allocates on the heap, right?
22:17:24FromDiscord<Elegantbeef> Really you can only use an array then, and that's assuming you have a subset of values and dont want all integers being supported
22:17:31FromDiscord<Elegantbeef> Yes tables are heap allocated
22:17:48arkanoidso you suggest an array of (int, float) ?
22:17:59FromDiscord<Elegantbeef> Tables are dynamically allocated since they can have N number of elements and are a sparse collection
22:18:10FromDiscord<Elegantbeef> Well depends what you're doing
22:18:15FromDiscord<Elegantbeef> You havent given much to work with
22:19:26arkanoidit's ok, it's sufficient to know that tables are on heap, and that I have to roll my own solution
22:19:36arkanoidit's not rocket science :P
22:19:47FromDiscord<Elegantbeef> Well it depends on what you're doing
22:20:00FromDiscord<Elegantbeef> Like that's a very important question
22:20:54arkanoidoptimizing an algoritm for science! I'm porting a python thing to nim, I'm already having 10000x faster code than before, but not yet fast as the reference algorithm, which is in C
22:21:11arkanoidand valgrind tells me that I'm doing allocations, so I'm replacing those parts
22:21:51FromDiscord<Elegantbeef> you could always just preallocate more data for the table
22:22:13arkanoidexactly
22:22:15FromDiscord<Elegantbeef> How many entries do you have in the table anyway
22:22:27arkanoidan huge number ... 6
22:22:42FromDiscord<Elegantbeef> So then what's wrong with `array[6, float]` 😄
22:23:15arkanoidnothing wrong, but actually I need array[6, (int, float)]
22:23:33FromDiscord<Elegantbeef> Well then there you go
22:23:57FromDiscord<Elegantbeef> Likely faster than a hash table
22:24:16arkanoidsure, I came here for the table-heap thing :P I was confused by the "initTable" naming. Init usually is for stack
22:24:22arkanoidnew for heap
22:24:41FromDiscord<Elegantbeef> well the `Table` is stack allocated
22:24:41FromDiscord<Elegantbeef> But the table data is heap allocated
22:24:57FromDiscord<Elegantbeef> Hence `newTable` which the `Table` is heap allocated
22:25:17FromDiscord<Elegantbeef> It's bad naming
22:25:28FromDiscord<Elegantbeef> should be `newTable` and `newTableRef`
22:26:40arkanoidI agree that should be newTable. Probably the target is to match the "value semantics" but then you should also name initSeq, not newSeq
22:26:52*wallabra quit (Ping timeout: 252 seconds)
22:28:52FromDiscord<Elegantbeef> Yea there is some naming issues there, plus the entire `newT` is garbage
22:29:32arkanoidI'm very curious about tomorrow's videos
22:38:46*wallabra joined #nim
22:43:42FromDiscord<Patitotective> me too
23:22:02FromDiscord<Mike> I wanted to watch them live, but I just realized it will be like 2am for me \:/
23:23:49FromDiscord<Patitotective> how could i use `runeAt` with a stream? 🤔
23:27:01FromDiscord<Patitotective> i think i can `peekStr(maxRuneLen)` and then runeAt that string
23:27:18FromDiscord<Patitotective> though i dont know whats the max length for a rune
23:32:48FromDiscord<Patitotective> https://github.com/johnnovak/gridmonger/blob/9053a50e745d531e9405a64a0dbd3f6b1dbe8728/src/hocon.nim#L30 🧐
23:45:37FromDiscord<Elegantbeef> Max length of a rune is 4
23:45:53FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/unicode.nim#L26
23:45:57FromDiscord<Patitotective> literally just found that
23:46:00FromDiscord<Patitotective> :]
23:46:30FromDiscord<Patitotective> (edit) "literally just found that ... " added "(i mean that utf8 has a max 4 byte yea)"
23:59:59*krux02 quit (Remote host closed the connection)