00:18:02 | FromDiscord | <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:46 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Oh <@762008715162419261> just noticed": :] |
01:07:54 | arkanoid | I 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:19 | arkanoid | is there a compile time way to the absolute path of a module |
01:21:46 | arkanoid | found: https://nim-lang.org/docs/system.html#currentSourcePath.t |
01:29:37 | * | arkurious quit (Quit: Leaving) |
01:55:22 | FromDiscord | <Rika> Oh wow this channel sure was lively |
01:55:50 | FromDiscord | <Elegantbeef> Yea more than 2 people were talking, it's wild |
02:12:06 | FromDiscord | <Rika> Beef 💪 |
02:12:15 | FromDiscord | <Rika> Carried the channel lol |
02:12:32 | FromDiscord | <Elegantbeef> I just tippity type |
02:12:46 | FromDiscord | <Elegantbeef> And i didnt answer Mike's async question |
02:12:50 | FromDiscord | <Elegantbeef> So you best answer it |
02:13:12 | FromDiscord | <Rika> Where |
02:14:01 | FromDiscord | <Elegantbeef> About reading from stdin async |
02:14:18 | FromDiscord | <Rika> Windows standard terminal IO cannot be non blocking without an extra thread simulating it |
02:14:36 | FromDiscord | <Rika> Legitimately no way, from what I recall |
02:14:48 | FromDiscord | <Rika> If it’s not windows then the open async version should have worked |
02:15:51 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4dIF |
02:45:27 | FromDiscord | <Prestige> How's it hangin Beef |
02:51:33 | FromDiscord | <Elegantbeef> How do i reply to that without something comical |
02:52:10 | FromDiscord | <Rika> You just did |
02:52:16 | FromDiscord | <Elegantbeef> Damn it rika! |
03:05:01 | FromDiscord | <Prestige> haha |
03:11:05 | FromDiscord | <Patitotective> huh, whi is there `readDataStr` and not `peekDataStr` |
03:11:21 | FromDiscord | <Patitotective> (edit) "whi" => "why" |
03:12:20 | * | derpydoo quit (Quit: derpydoo) |
03:13:05 | FromDiscord | <Elegantbeef> Peek doesnt move ahead |
03:13:37 | FromDiscord | <Patitotective> yea but there is `readData` and `peekData` |
03:13:46 | FromDiscord | <Elegantbeef> Yes cause `peek` doesnt move ahead |
03:13:51 | FromDiscord | <Elegantbeef> Oh i misread |
03:13:55 | FromDiscord | <Elegantbeef> Lol i can read |
03:14:11 | FromDiscord | <Patitotective> anyways there is `peekStr` :p |
03:14:48 | FromDiscord | <Rika> In reply to @Elegantbeef "Oh i misread": I was gonna say |
03:14:50 | FromDiscord | <Rika> Lol |
03:15:24 | FromDiscord | <Patitotective> can i peek backwards? i need to get the start and end of line by just knowing a column |
03:15:42 | FromDiscord | <Patitotective> sort of "read line from start" |
03:15:43 | FromDiscord | <Rika> No |
03:15:45 | FromDiscord | <Patitotective> (edit) "start"" => "start of the last line"" |
03:15:59 | FromDiscord | <Rika> Once it’s read you have to seek to go back |
03:18:56 | FromDiscord | <Patitotective> `setPosition(getPosition() - 1)`? |
03:19:29 | FromDiscord | <Elegantbeef> Correct |
03:19:54 | FromDiscord | <Patitotective> he can read |
03:20:36 | FromDiscord | <Rika> I’m shocked |
03:20:37 | FromDiscord | <Elegantbeef> Only on seconds that end with 4 |
03:20:56 | FromDiscord | <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:33 | FromDiscord | <Rika> Think that’s just because it’s old |
03:22:21 | FromDiscord | <Patitotective> old people had more time to spend it writing verbose names, i get it |
03:22:27 | FromDiscord | <Patitotective> (edit) removed "it" |
03:23:53 | FromDiscord | <Rika> Lol |
03:25:33 | FromDiscord | <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:35 | FromDiscord | <Patitotective> 🌃 |
03:28:59 | FromDiscord | <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:35 | FromDiscord | <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:42 | FromDiscord | <sOkam!> I guess `thing.delete(thing.len-1)` works 🤷♂️ |
04:52:48 | FromDiscord | <Elegantbeef> `thing.delete(thing.high)` |
05:23:55 | FromDiscord | <demotomohiro> `thing.setLen(thing.high)` |
05:25:49 | FromDiscord | <demotomohiro> Or implement `proc delete[T](x: var seq[T]; i: BackwardsIndex)` |
05:39:47 | FromDiscord | <sOkam!> Can a variable have multiple types?↵something like `var num: int | nil` |
05:40:15 | FromDiscord | <Elegantbeef> No object variants must be used |
05:40:21 | FromDiscord | <Elegantbeef> Or in your case `std/options` |
05:40:37 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> `std/options` |
05:43:14 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> What? |
05:43:43 | FromDiscord | <sOkam!> type Thing = object |
05:43:50 | FromDiscord | <Elegantbeef> you can also just do `var num = -1` if you're really after it |
05:44:28 | FromDiscord | <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:21 | NimEventer | New thread by miran: NimConf 2022 - Saturday, October 22nd, see https://forum.nim-lang.org/t/9539 |
07:10:39 | FromDiscord | <narimiran> sent a long message, see http://ix.io/4dJr |
07:25:23 | FromDiscord | <sOkam!> does the `is` keyword preform weird like with python, or is it just the intuitive `==`, but aliased? |
07:25:35 | FromDiscord | <Elegantbeef> It's a type comparison |
07:33:07 | * | krux02 joined #nim |
07:38:40 | * | rockcavera quit (Remote host closed the connection) |
08:10:00 | FromDiscord | <sOkam!> how does one join two separate tables, of the shape`std/tables.Table[Type, Type]`? |
08:10:12 | FromDiscord | <sOkam!> (edit) "shape`std/tables.Table[Type," => "shape `std/tables.Table[Type," |
08:14:05 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJA |
08:22:42 | FromDiscord | <Elegantbeef> No, but also worth noting you hide an 'error' |
08:23:12 | FromDiscord | <Elegantbeef> in your second loop you silently replace a duplicated value |
08:23:34 | FromDiscord | <Elegantbeef> That might be fine in your case though i guess |
08:30:03 | FromDiscord | <sOkam!> yeah, i know. keys won't be duplicate in this file format, so its not a problm for this usecase |
08:32:29 | FromDiscord | <Elegantbeef> Why do you even have a table then? |
08:32:41 | FromDiscord | <Elegantbeef> I dont get the point if they're set values |
08:32:44 | FromDiscord | <sOkam!> because that's what i found when searching "nim dictionary" |
08:33:07 | FromDiscord | <sOkam!> and they key names are unknown, they can be anything |
08:33:16 | FromDiscord | <Elegantbeef> Ah ok |
08:33:18 | FromDiscord | <sOkam!> (edit) "key" => "pairs" |
08:34:09 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJC |
08:34:25 | FromDiscord | <Rika> Set length to 0? |
08:34:35 | FromDiscord | <sOkam!> wdym? |
08:34:38 | FromDiscord | <sOkam!> not following |
08:35:04 | FromDiscord | <Elegantbeef> `input.setLen(0)` |
08:35:04 | FromDiscord | <Elegantbeef> It's much more efficient |
08:35:05 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#setLen%2Cseq%5BT%5D%2CNatural |
08:35:12 | FromDiscord | <sOkam!> kk. but it was complaining about the generic part, i believe |
08:35:22 | FromDiscord | <Rika> Clear[T] |
08:36:06 | FromDiscord | <Elegantbeef> for generic types if you dont care about the generics you can do `proc clear(input: var seq) = input.setLen(0)` |
08:36:35 | FromDiscord | <sOkam!> ah that works, yep. tyty ✍️ |
08:36:50 | * | ttkap quit (Ping timeout: 248 seconds) |
08:50:13 | FromDiscord | <sOkam!> Is there an existing way to iterate through all fields of a custom object type recursively? |
08:50:49 | FromDiscord | <Elegantbeef> Nope, there is `fieldPairs` but that doesnt do it recursively |
08:56:11 | FromDiscord | <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:38 | FromDiscord | <Elegantbeef> It doesnt "just unroll" |
08:57:11 | FromDiscord | <Elegantbeef> And cmon phil i'm pretty proud of my variation |
08:57:35 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dJG |
08:57:42 | FromDiscord | <Elegantbeef> Works on all iterators and isnt that complicated |
08:57:46 | FromDiscord | <sOkam!> What am I missing? |
08:57:48 | FromDiscord | <Phil> In reply to @Elegantbeef "And cmon phil i'm": Which I added to the SO question! |
08:58:01 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT |
08:58:10 | FromDiscord | <Elegantbeef> Lol the docs are wrong |
08:58:17 | FromDiscord | <Phil> Also, "unrolling" is the only thing I can see documented about it |
08:58:19 | FromDiscord | <Elegantbeef> it's `for name, field in obj.fieldPairs` |
08:58:21 | FromDiscord | <Phil> So thus "just unrolls" |
08:59:05 | FromDiscord | <Elegantbeef> Actually nevermind docs arent wrong |
08:59:22 | FromDiscord | <Elegantbeef> That's an overload for yielding over two objects of the same type |
08:59:33 | FromDiscord | <Elegantbeef> Yea that's more of how it works and less it does↵(@Phil) |
08:59:41 | FromDiscord | <Elegantbeef> Static type system requires that unroll there |
09:00:56 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> What? |
09:01:36 | FromDiscord | <Phil> If you do for loop over seq[static string] the iterator-variable type is not static string |
09:01:59 | FromDiscord | <Phil> Which is really effing Annoying if you want to generate dot expressions with the strings in that seq[static string] |
09:02:43 | FromDiscord | <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:39 | FromDiscord | <Elegantbeef> Or just feed the seq to the macro |
09:06:53 | FromDiscord | <Phil> Bah, that'd mean more macro code than absolutely necessary! |
09:07:08 | FromDiscord | <Elegantbeef> he says as he has a macro to unroll the loop |
09:07:23 | FromDiscord | <Phil> exactly! |
09:07:42 | FromDiscord | <Elegantbeef> 1 \< 1 |
09:08:31 | FromDiscord | <Phil> sent a long message, see http://ix.io/4dJK |
09:08:46 | FromDiscord | <Phil> (edit) "http://ix.io/4dJK" => "https://paste.rs/HJr" |
09:10:48 | FromDiscord | <Phil> It's honestly kinda bonkers how far generics and a compile-time proc here or there can get you in general |
09:11:19 | FromDiscord | <Elegantbeef> Yea i have a full toy ECS that has a single macro |
09:12:13 | FromDiscord | <Elegantbeef> And it supports querying with `for (health, pos) in archetypes.filter((Health, Position))` |
09:13:47 | NimEventer | New 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:51 | arkanoid | is nil a float nan, under the hood? |
11:17:42 | * | wallabra quit (Ping timeout: 255 seconds) |
11:17:49 | * | wallabra_ joined #nim |
11:20:03 | FromDiscord | <exelotl> You mean a float with binary zero value? |
11:20:14 | * | wallabra_ is now known as wallabra |
11:35:47 | FromDiscord | <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:58 | FromDiscord | <auxym> floats, as a value type, aren't nullable though. `ref float` is, but then it's just a null pointer. |
11:44:00 | FromDiscord | <Generic> it's actually pretty clever design |
11:44:59 | FromDiscord | <Generic> how zero is technically a subnormal which allows the factor to become actually zero |
11:45:19 | FromDiscord | <Ekopalypse> dir |
12:04:39 | NimEventer | New 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:31 | FromDiscord | <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:09 | FromDiscord | <Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dKz |
12:51:23 | FromDiscord | <Andycol> what am i missing |
12:54:10 | PMunch | @Andycol, you're not assigning clusterId to anything? |
12:57:32 | FromDiscord | <Andycol> im assigning it to the output of the stdin |
12:58:29 | FromDiscord | <Andycol> or am i wrong? |
12:59:17 | * | PMunch quit (Quit: Leaving) |
13:00:14 | FromDiscord | <Andycol> would you mind to show me? |
13:18:46 | FromDiscord | <Andycol> actually sorry that was stupid i fixed it |
13:28:23 | * | kenran quit (Remote host closed the connection) |
13:39:04 | FromDiscord | <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:45 | FromDiscord | <auxym> yes, but arkanoid said "nil" |
14:11:29 | FromDiscord | <auxym> floats can be nan, but also other subnormals, inf, -inf. which aren't really nil (= null pointer). |
14:12:25 | qwr | and its that way in any language supporting IEEE 754 floating point numbers... |
14:13:02 | FromDiscord | <auxym> yes. I just have no idea what "is nil a float nan, under the hood?" is actually supposed to mean |
14:13:42 | FromDiscord | <auxym> like, "nil in general" is a null pointer, nothing to do with any kind of float... |
14:13:50 | ehmry | you can use NaN boxing to express nil as a hack |
14:14:21 | ehmry | there is a buttload of NaNs waiting to be abused as special errors |
14:14:23 | FromDiscord | <auxym> you can, but that's not implemented natively in nim |
14:14:39 | FromDiscord | <auxym> and not part of ieee 754 |
14:14:47 | ehmry | right, because floating point isn't native in any modern languages |
14:16:00 | ehmry | the hardware does extra exception handling and then it is always thrown away |
14:16:09 | qwr | imho 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:38 | FromDiscord | <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:13 | ehmry | but you don't "natively" interact with the FPU the way it was intended |
14:18:46 | ehmry | whatever, I just don't like floats |
14:21:18 | ehmry | and 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:17 | FromDiscord | <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:55 | ehmry | we also don't have float16 support but I don't know who does |
14:28:13 | FromDiscord | <Generic> cpus don't really suppord doing math with those |
14:28:24 | FromDiscord | <Generic> aarch64 has instructions to convert from and to them, but that's it |
14:29:11 | FromDiscord | <Generic> so float16 would mostly be just a hazard similar to <32 bit integer types |
14:45:18 | * | pro joined #nim |
15:01:52 | FromDiscord | <Andycol> sent a code paste, see https://paste.rs/Oza |
15:01:57 | FromDiscord | <Andycol> cant understand it |
15:05:41 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4dLd |
15:05:50 | FromDiscord | <qb> (edit) "https://play.nim-lang.org/#ix=4dLd" => "https://play.nim-lang.org/#ix=4dLe" |
15:06:47 | FromDiscord | <ChocolettePalette> Try it with var instead of let↵(@Andycol) |
15:07:59 | FromDiscord | <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:24 | FromDiscord | <Phil> In reply to @qb "Could a user defined": You mean have a pragma with a value? Yeah that's possible |
15:27:04 | FromDiscord | <Phil> Look at norm and its table name pragma for an example |
15:27:56 | FromDiscord | <qb> Sorry? |
15:28:47 | FromDiscord | <Phil> You want to have a pragma that, when you later access it, has some kind of value , right? |
15:29:04 | FromDiscord | <Phil> Line a certain number or a string |
15:31:55 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4dLk |
15:33:22 | FromDiscord | <Phil> Ah, you mean pass it a compile-time variable instead of an explicit value |
15:34:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLl |
15:34:41 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4dLl" => "https://play.nim-lang.org/#ix=4dLm" |
15:34:51 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4dLm" => "https://play.nim-lang.org/#ix=4dLn" |
15:36:10 | FromDiscord | <Andycol> Would anyone mind telling me why line 85 here is saying variable is undeclared when it works above? |
15:36:11 | FromDiscord | <Andycol> https://pastebin.com/V2QWBJQ1 |
15:36:33 | FromDiscord | <Andycol> (edit) "85" => "89" |
15:37:08 | FromDiscord | <Andycol> im pulling all my hair out here |
15:39:09 | FromDiscord | <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:45 | FromDiscord | <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:00 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4dLs |
15:44:33 | FromDiscord | <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:08 | FromDiscord | <Phil> It would at the very least reduce your chances of it being some kind of indentation error |
15:46:24 | FromDiscord | <Phil> Because at the very least I can't guarantee you it isn't one of those |
15:46:43 | FromDiscord | <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:00 | FromDiscord | <Andycol> but yea let me clean it up like with different procs and see from there |
15:48:01 | FromDiscord | <Andycol> thanks |
15:48:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLv |
15:48:57 | FromDiscord | <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:33 | FromDiscord | <Andycol> it should still be in `proc configonly` |
15:50:40 | FromDiscord | <demotomohiro> Line 85 doesnt have indent. |
15:52:10 | FromDiscord | <Andycol> In reply to @demotomohiro "Line 85 doesnt have": that fixed it!!! but why didnt it moan about indentation |
15:52:17 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLw |
15:53:05 | FromDiscord | <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:05 | FromDiscord | <Andycol> In reply to @Isofruit "Stuff like that is": this is awesome |
15:53:19 | FromDiscord | <Andycol> In reply to @Isofruit "Because it could've been": aaah i see |
15:53:53 | FromDiscord | <Andycol> you guys are awesome thanks!!!!! |
15:54:06 | FromDiscord | <Andycol> @Phil and @demotomohiro 🚀 |
15:54:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4dLz |
15:55:08 | FromDiscord | <Andycol> thanks!! |
15:55:51 | FromDiscord | <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:11 | FromDiscord | <Andycol> thanks for the recommendation |
15:57:33 | * | CyberTailor joined #nim |
16:41:06 | * | jmdaemon joined #nim |
17:07:01 | arkanoid | how can I force rebuild when "nimble build"? |
17:07:33 | arkanoid | I am modifying C++ files imported with compile pragma, but if I edit them nimble seems not picking up the difference |
17:14:06 | FromDiscord | <demotomohiro> nim has `-f` option to force rebuild. |
17:21:38 | * | CyberTailor left #nim (Konversation terminated!) |
17:35:26 | arkanoid | thanks |
17:38:17 | * | LuxuryMode joined #nim |
18:23:41 | FromDiscord | <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:54 | FromDiscord | <Horizon [She/Her]> Should i use async programming? Or threading? |
18:24:08 | FromDiscord | <Horizon [She/Her]> The goal is to make this an android app eventually so gotta keep that in mind too |
18:27:13 | FromDiscord | <Bung> all android programing I known is programing under framework, it provide its own solution |
18:29:57 | FromDiscord | <Horizon [She/Her]> I'm using Raylib for my game aha |
18:30:53 | * | CyberTailor joined #nim |
18:32:14 | FromDiscord | <Bung> I think you'll make ui thread as main thread |
18:34:07 | * | CyberTailor left #nim (#nim) |
18:34:28 | FromDiscord | <Horizon [She/Her]> Yeah that's the idea |
18:34:42 | FromDiscord | <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:42 | FromDiscord | <Horizon [She/Her]> Nim devel doesn't support the lsp and nimsuggest is dying :/ |
18:40:40 | FromDiscord | <Horizon [She/Her]> Wait does nim suggest not provide that highlight/snippet when you hover over code? |
18:42:44 | FromDiscord | <Bung> your lsp server may die |
18:44:51 | FromDiscord | <Horizon [She/Her]> The lsp has always worked better for me, in my experience when using it on nim stable |
18:50:38 | FromDiscord | <Horizon [She/Her]> God i really want Nim to improve their lsp |
18:50:46 | FromDiscord | <Horizon [She/Her]> Editor support in general |
18:50:50 | FromDiscord | <Horizon [She/Her]> It's so helpful when it works |
18:52:19 | FromDiscord | <Bung> someone has done some contribution to nimsuggest recently |
18:59:39 | FromDiscord | <Horizon [She/Her]> Oh? |
18:59:50 | FromDiscord | <Horizon [She/Her]> My issue rn is nimlangserver won't even compile and I'm trying to tinker lol |
18:59:57 | FromDiscord | <Horizon [She/Her]> Is there a way to ignore gcsafe warnings? |
19:04:08 | FromDiscord | <Horizon [She/Her]> Ah, compiling with laxEffects works, I'm assuming it's because of the strictEffects option now becoming the default |
19:16:11 | FromDiscord | <hovsater> sent a code paste, see https://play.nim-lang.org/#ix=4dMq |
19:21:37 | FromDiscord | <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:42 | FromDiscord | <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:26 | FromDiscord | <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:14 | NimEventer | New 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:19 | FromDiscord | <Mike> Holy shit it works, thank you!↵(@Rika) |
20:32:19 | FromDiscord | <Mike> linux-only is fine for now. I'll figure it out on windows if I really need to |
20:46:03 | FromDiscord | <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:34 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4dMO |
21:05:44 | * | wallabra joined #nim |
21:17:40 | FromDiscord | <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:58 | FromDiscord | <haywireSSC> Why does nim compile to c |
22:14:11 | FromDiscord | <haywireSSC> Instead of machine code directly |
22:14:31 | arkanoid | is it possible to create a stack-only table? |
22:14:37 | FromDiscord | <Elegantbeef> It gives you some wonderful capabillities |
22:14:50 | FromDiscord | <Elegantbeef> Human readable IR(yes llvm exists), the abillity to use obscure compilers for obscure hardware |
22:15:18 | FromDiscord | <Elegantbeef> Depends ark, what are the types? |
22:15:34 | arkanoid | float |
22:15:40 | arkanoid | float64 actually |
22:15:54 | FromDiscord | <Elegantbeef> The key is a float and the val is a float? |
22:16:19 | FromDiscord | <Elegantbeef> Is this for a LUT? |
22:16:30 | arkanoid | actually, my fault, the key is an int, the value is a float |
22:16:37 | arkanoid | (just found a bug in my code, lol) |
22:17:22 | arkanoid | initTable[int, float](100) allocates on the heap, right? |
22:17:24 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Yes tables are heap allocated |
22:17:48 | arkanoid | so you suggest an array of (int, float) ? |
22:17:59 | FromDiscord | <Elegantbeef> Tables are dynamically allocated since they can have N number of elements and are a sparse collection |
22:18:10 | FromDiscord | <Elegantbeef> Well depends what you're doing |
22:18:15 | FromDiscord | <Elegantbeef> You havent given much to work with |
22:19:26 | arkanoid | it's ok, it's sufficient to know that tables are on heap, and that I have to roll my own solution |
22:19:36 | arkanoid | it's not rocket science :P |
22:19:47 | FromDiscord | <Elegantbeef> Well it depends on what you're doing |
22:20:00 | FromDiscord | <Elegantbeef> Like that's a very important question |
22:20:54 | arkanoid | optimizing 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:11 | arkanoid | and valgrind tells me that I'm doing allocations, so I'm replacing those parts |
22:21:51 | FromDiscord | <Elegantbeef> you could always just preallocate more data for the table |
22:22:13 | arkanoid | exactly |
22:22:15 | FromDiscord | <Elegantbeef> How many entries do you have in the table anyway |
22:22:27 | arkanoid | an huge number ... 6 |
22:22:42 | FromDiscord | <Elegantbeef> So then what's wrong with `array[6, float]` 😄 |
22:23:15 | arkanoid | nothing wrong, but actually I need array[6, (int, float)] |
22:23:33 | FromDiscord | <Elegantbeef> Well then there you go |
22:23:57 | FromDiscord | <Elegantbeef> Likely faster than a hash table |
22:24:16 | arkanoid | sure, I came here for the table-heap thing :P I was confused by the "initTable" naming. Init usually is for stack |
22:24:22 | arkanoid | new for heap |
22:24:41 | FromDiscord | <Elegantbeef> well the `Table` is stack allocated |
22:24:41 | FromDiscord | <Elegantbeef> But the table data is heap allocated |
22:24:57 | FromDiscord | <Elegantbeef> Hence `newTable` which the `Table` is heap allocated |
22:25:17 | FromDiscord | <Elegantbeef> It's bad naming |
22:25:28 | FromDiscord | <Elegantbeef> should be `newTable` and `newTableRef` |
22:26:40 | arkanoid | I 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:52 | FromDiscord | <Elegantbeef> Yea there is some naming issues there, plus the entire `newT` is garbage |
22:29:32 | arkanoid | I'm very curious about tomorrow's videos |
22:38:46 | * | wallabra joined #nim |
22:43:42 | FromDiscord | <Patitotective> me too |
23:22:02 | FromDiscord | <Mike> I wanted to watch them live, but I just realized it will be like 2am for me \:/ |
23:23:49 | FromDiscord | <Patitotective> how could i use `runeAt` with a stream? 🤔 |
23:27:01 | FromDiscord | <Patitotective> i think i can `peekStr(maxRuneLen)` and then runeAt that string |
23:27:18 | FromDiscord | <Patitotective> though i dont know whats the max length for a rune |
23:32:48 | FromDiscord | <Patitotective> https://github.com/johnnovak/gridmonger/blob/9053a50e745d531e9405a64a0dbd3f6b1dbe8728/src/hocon.nim#L30 🧐 |
23:45:37 | FromDiscord | <Elegantbeef> Max length of a rune is 4 |
23:45:53 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/unicode.nim#L26 |
23:45:57 | FromDiscord | <Patitotective> literally just found that |
23:46:00 | FromDiscord | <Patitotective> :] |
23:46:30 | FromDiscord | <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) |