00:23:37 | * | vicfred quit (Quit: Leaving) |
01:14:00 | * | neurocyte8614492 quit (Ping timeout: 276 seconds) |
01:39:25 | NimEventer | New Nimble package! ruby - Bindings for libruby and high-level Ruby embedding framework, see https://github.com/ryukoposting/ruby-nim |
01:46:16 | * | arkurious quit (Quit: Leaving) |
01:58:39 | madprops | https://stackoverflow.com/questions/71976217/does-any-change-in-an-array-gets-to-change-the-entire-array |
01:59:43 | FromDiscord | <huantian> is this a JavaScript question? |
01:59:58 | madprops | he asks about other languages |
02:00:11 | FromDiscord | <Rika> did i miss a question |
02:00:40 | madprops | wondering how that works in javascript and in nim |
02:01:10 | FromDiscord | <Rika> you? or the asker? the asker only mentions js |
02:01:28 | madprops | "Does it change radically from one language to another?" |
02:37:22 | * | Zectbumo joined #nim |
03:40:37 | FromDiscord | <Yardanico> heh, checked today and prologue is crashing with arc/orc |
03:40:42 | FromDiscord | <Yardanico> apparently for some reason they have `cursor` for a proc field |
03:40:47 | FromDiscord | <Yardanico> at least it's not an arc bug :P |
03:42:31 | * | duuude joined #nim |
03:53:08 | FromDiscord | <Elegantbeef> "for a proc field" |
03:53:27 | FromDiscord | <Elegantbeef> The hell is the point of that |
03:53:48 | FromDiscord | <Yardanico> đ€· |
03:54:13 | FromDiscord | <Elegantbeef> aliasing is the same cost as cursor inference for that đ |
03:54:22 | FromDiscord | <Yardanico> maybe someone working on prologue was trying it with ARC and saw the warning that the compiler gives when it finds a cycle with that proc field |
03:54:30 | FromDiscord | <Yardanico> and added the cursor pragma as the compiler suggests |
03:54:56 | FromDiscord | <Elegantbeef> Odd |
03:55:24 | FromDiscord | <Elegantbeef> We're talking about the field being a pointer proc right? |
03:55:29 | FromDiscord | <Yardanico> yes |
03:55:37 | FromDiscord | <Yardanico> https://github.com/planety/prologue/pull/162 |
03:55:50 | FromDiscord | <Yardanico> not just a proc pointer, but a closure pointer specifically |
03:56:32 | FromDiscord | <Elegantbeef> I guess there's a chance there, but odd |
04:04:53 | FromDiscord | <huantian> thinking about <https://github.com/nim-lang/Nim/issues/5021>, trying some stuff https://media.discordapp.net/attachments/371759389889003532/967274836441333760/unknown.png |
04:05:05 | FromDiscord | <huantian> honestly wonder if it should be renamed to "handling futures" or something |
04:05:14 | FromDiscord | <Yardanico> @ElegantBeef this is the exact warning the compiler gives with ARC btw: |
04:05:15 | FromDiscord | <Yardanico> "/home/dian/.nimble/pkgs/prologue-#head/prologue/core/beast/server.nim(25, 22) Warning: ':env.app1.startupClosure = (doStartup, :env)' creates an uncollectable ref cycle; annotate 'app1' with .cursor" |
04:05:20 | FromDiscord | <Yardanico> i guess some people might get confused by it |
04:05:48 | FromDiscord | <huantian> (edit) "stuff" => "stuffâ”~~not my first issue but it's been open for too long heh~~" |
04:05:53 | FromDiscord | <Yardanico> In reply to @huantian "honestly wonder if it": noticed a typo there :P |
04:05:56 | FromDiscord | <Yardanico> "proceudres" |
04:06:03 | FromDiscord | <huantian> ah thanks |
04:06:12 | FromDiscord | <Rika> French word for procedures |
04:06:18 | FromDiscord | <Rika> I donât actually know |
04:06:28 | FromDiscord | <Yardanico> good joke, but it's not actually |
04:06:28 | FromDiscord | <huantian> I need to turn on autocorrect for comments or something |
04:08:43 | FromDiscord | <Yardanico> yeah someone should check for typos in docs once in a while |
04:08:48 | FromDiscord | <huantian> wondering if I should add things likeâ”"Usually `waitFor is used as an entry point to asynchronous code from synchronous code" or if that's obvious or belongs in a different place |
04:09:05 | FromDiscord | <huantian> But I do wanna have some kind of waitFor vs await vs asyncCheck somewhere in the docs |
04:09:11 | FromDiscord | <Yardanico> i mean it's never bad to add this into the docs |
04:09:24 | FromDiscord | <Yardanico> some people want docs to cover everything from the simplest things, so it wouldn't hurt :) |
04:09:43 | FromDiscord | <huantian> personally when I just started I had no idea when to use which |
04:09:48 | FromDiscord | <Yardanico> but sometimes you use runForever instead of waitFor as well |
04:10:07 | FromDiscord | <Yardanico> especially if the whatever async library you're using doesn't give you a future you can waitFor for (pun not intended ) |
04:10:53 | FromDiscord | <Elegantbeef> I mean there needs to be some docs on how to use async from non async |
04:12:14 | FromDiscord | <Elegantbeef> Like i refactored my game project's ipc to use async now that i learned you can just do `poll(0)` at the end of a frame |
04:12:52 | FromDiscord | <Yardanico> are you using async for IO? |
04:13:03 | FromDiscord | <Elegantbeef> Yea IPC |
04:13:10 | FromDiscord | <Yardanico> oh |
04:14:11 | FromDiscord | <Elegantbeef> My troll rika logic here |
04:14:13 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/967277188330180638/image.png |
04:14:42 | FromDiscord | <huantian> Beef: says `addCallback`â”Rika: dies |
04:14:50 | FromDiscord | <Elegantbeef> Pretty much |
04:15:27 | FromDiscord | <Rika> I mean whatever |
04:19:56 | FromDiscord | <huantian> slightly tweaked https://media.discordapp.net/attachments/371759389889003532/967278626263420948/unknown.png |
04:20:11 | FromDiscord | <huantian> In reply to @Rika "I mean whatever": dang we've killed rika's hatred of callbacks |
04:20:59 | FromDiscord | <Yardanico> In reply to @huantian "slightly tweaked": hm, not sure, but maybe some might get confused by "blocking" in await entry? |
04:21:02 | FromDiscord | <Rika> No I just donât care enough |
04:21:21 | FromDiscord | <Yardanico> because "blocking" in waitFor is not the same as "blocking" in await |
04:21:29 | FromDiscord | <huantian> hmmm ok |
04:21:35 | FromDiscord | <Yardanico> waitFor blocks the entire thread, while `await` lets other futures run |
04:21:48 | FromDiscord | <Yardanico> while it's waiting for its own future to return |
04:24:19 | FromDiscord | <huantian> what if I this lmao https://media.discordapp.net/attachments/371759389889003532/967279728295805018/unknown.png |
04:25:16 | FromDiscord | <Yardanico> fine, just fix typos :) |
04:25:26 | FromDiscord | <Yardanico> it'll be reviewed when you make a PR anyway |
04:25:35 | FromDiscord | <huantian> yeah I guess |
04:58:58 | * | slowButPresent quit (Quit: leaving) |
05:12:41 | FromDiscord | <TryAngle> my lexer is a bit not good imo.â”are there good libraries to lex and build to build syntax trees |
05:12:47 | FromDiscord | <TryAngle> (edit) "trees" => "trees?" |
05:12:57 | FromDiscord | <TryAngle> (edit) removed "to build" |
05:26:48 | FromDiscord | <TryAngle> https://github.com/openpeep/toktokâ”this looks actually pretty cool đ€ đł |
05:28:31 | * | droidrage quit (Ping timeout: 256 seconds) |
05:28:52 | * | rockcavera quit (Remote host closed the connection) |
05:29:38 | FromDiscord | <Rika> Isnât there lexbase |
05:29:44 | FromDiscord | <Rika> In the standard libraryy# |
05:31:18 | FromDiscord | <TryAngle> In reply to @Rika "Isnât there lexbase": well there is but the docs are almost nonexistant |
05:34:47 | FromDiscord | <Yardanico> don't use built-in sets with big types like int16!111 https://github.com/SamWoolerton/fast-flood-solver/pull/1 |
05:35:03 | FromDiscord | <Yardanico> my classic "check a random nim repo if you can improve it" |
05:35:13 | FromDiscord | <Yardanico> 400x perf increase from set[int16] to set[range[0..49]] |
05:36:46 | FromDiscord | <Elegantbeef> I love the `table[enum, T]` |
05:37:00 | FromDiscord | <Elegantbeef> Always a fun one to fix cause it's much faster to use an array đ |
05:37:03 | FromDiscord | <Yardanico> xd |
05:37:15 | FromDiscord | <Yardanico> i've actually tried HashSet first for this repo, and it also gives a really big perf boost |
05:37:36 | FromDiscord | <Yardanico> it's like 70ms, but pure sets with a small range are ~4x faster - ~15ms |
05:37:37 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Always a fun one": true, I need to rethink this myself lol |
05:37:59 | FromDiscord | <TryAngle> is there any other language besides nim that allows enum indexed arrays? |
05:39:48 | FromDiscord | <Yardanico> that poor int16 set https://media.discordapp.net/attachments/371759389889003532/967298725053628466/unknown.png |
05:39:50 | FromDiscord | <Yardanico> in compiled C |
05:39:57 | FromDiscord | <Yardanico> (this is just 1/3 of its definition) |
05:41:53 | FromDiscord | <Elegantbeef> Who new 2^16 bits was a lot |
05:41:58 | FromDiscord | <Yardanico> xd |
05:42:27 | FromDiscord | <Yardanico> we should really document this somewhere, it seems like new nim people make this mistake sometimes |
05:59:20 | FromDiscord | <SirElephant> are there any notable softwares that are made in nim? |
05:59:33 | FromDiscord | <TryAngle> what is a good / standard way to write tests for a submodule?â”just putting `when isMainModule:` at the end? |
05:59:35 | FromDiscord | <SirElephant> (edit) "softwares" => "software" |
05:59:42 | FromDiscord | <TryAngle> (edit) "end?" => "end and the tests there?" |
05:59:53 | FromDiscord | <TryAngle> (edit) "what is a good / standard way to write tests for a submodule?â”just putting `when isMainModule:` at the end and the tests there? ... " added "or is there a better way?" |
06:01:26 | FromDiscord | <Rika> In reply to @Yardanico "we should really document": Time to add a new warning? |
06:01:44 | FromDiscord | <Yardanico> In reply to @SirElephant "are there any notable": nitter |
06:02:02 | FromDiscord | <Yardanico> In reply to @Rika "Time to add a": yeah, maybe a warning or at least a hint when you have a set that's over X bytes big |
06:02:07 | FromDiscord | <Yardanico> with X maybe being 64 or 128 bytes |
06:02:21 | FromDiscord | <Yardanico> because set[int16] takes 8192 bytes, and copying 8kb on stack isn't fun |
06:02:36 | FromDiscord | <Rika> 64 bytes⊠crazy |
06:04:35 | FromDiscord | <TryAngle> how can I return a ref to range of a string?â”string1 = "Hello World"â”string2 = string1[6..10] <- ref to string1 |
06:04:47 | FromDiscord | <TryAngle> (edit) "string1" => "string1â”string2 == "World"" |
06:05:48 | FromDiscord | <Yardanico> IIRC you can't safely, strings in Nim have value semantics |
06:05:59 | FromDiscord | <Yardanico> you can have a `ref string` or modify with the slice directly |
06:06:07 | FromDiscord | <Yardanico> or maybe it'll work with experimental views, but not by default |
06:06:26 | FromDiscord | <SirElephant> In reply to @Yardanico "nitter": do you mean https://nitter.nl/ |
06:06:33 | FromDiscord | <Yardanico> that's just one of instances of it |
06:06:45 | FromDiscord | <Yardanico> nitter has tens of public instances, https://github.com/zedeus/nitter is the main repo |
06:06:50 | FromDiscord | <Yardanico> and nitter.net is the main instance |
06:06:59 | FromDiscord | <Elegantbeef> You can do `toOpenArray` but that cannot be held in a variable can can only be passed to parameters |
06:07:00 | FromDiscord | <SirElephant> oh |
06:07:12 | FromDiscord | <SirElephant> so is this made using wasm> |
06:07:14 | FromDiscord | <Yardanico> no? |
06:07:16 | FromDiscord | <SirElephant> (edit) "wasm>" => "wasm?" |
06:07:23 | FromDiscord | <Yardanico> the backend is in Nim |
06:07:32 | FromDiscord | <Yardanico> nitter has no JS except for some optional one so you can scroll infinitely |
06:07:45 | FromDiscord | <Yardanico> Zed recently said in the Telegram chat: "tens of millions of daily requests spread across over 50 public instances" about Nitter |
06:07:53 | FromDiscord | <Yardanico> so it's most probably the most used (per user count) nim project |
06:08:08 | FromDiscord | <TryAngle> In reply to @Yardanico "you can have a": I have a ref string |
06:08:19 | FromDiscord | <SirElephant> any other popular stuff made in nim? |
06:08:26 | FromDiscord | <TryAngle> so in ur opinion I should just return a range to use with this string? |
06:08:53 | FromDiscord | <Yardanico> In reply to @SirElephant "any other popular stuff": https://status.im/ isn't that popular (I think), but they do extensively use Nim |
06:09:27 | FromDiscord | <SirElephant> can we use wasm with nim? |
06:09:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VZT |
06:09:30 | FromDiscord | <Yardanico> yes |
06:09:40 | FromDiscord | <Yardanico> there are some games made in Nim, https://store.steampowered.com/app/1444480/Turing_Complete/ is probably the most popular one (it's not pure Nim though, it uses Godot with Nim) |
06:10:21 | FromDiscord | <TryAngle> In reply to @Elegantbeef "If you have a": how do I index with that?â”myStr[selection] ? |
06:10:48 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3VZU |
06:10:55 | FromDiscord | <Yardanico> ah right, you also need to dereference it |
06:11:15 | FromDiscord | <Elegantbeef> And you just make everything a nice API |
06:11:18 | FromDiscord | <TryAngle> ss.myStr[][ss.selection] then? |
06:11:55 | FromDiscord | <Yardanico> hm, it won't work the way you want anyway |
06:12:15 | FromDiscord | <Yardanico> i assume you will then want to store a reference to a part of your string in a different variable |
06:12:23 | FromDiscord | <Yardanico> can you explain what you need this for? |
06:14:37 | FromDiscord | <TryAngle> I'm rewriting my lexer to be more flexibleâ”I would like to use have a cursor that only operators over a local area in that text |
06:14:43 | FromDiscord | <TryAngle> (edit) "use" => "" |
06:18:42 | FromDiscord | <huantian> hey that's sick https://media.discordapp.net/attachments/371759389889003532/967308512466194442/unknown.png |
06:18:46 | FromDiscord | <TryAngle> In reply to @Elegantbeef "If you have a": but I think this will do đ€ |
06:18:47 | FromDiscord | <TryAngle> thanks |
06:19:53 | FromDiscord | <huantian> (edit) "sick" => "sick, thank you github for cool features" |
06:23:43 | FromDiscord | <Elegantbeef> You also can just use `toOpenArray` and pass it to a function or have an index and slice you own |
06:23:46 | FromDiscord | <Elegantbeef> Or use unsafe methods |
06:26:30 | FromDiscord | <TryAngle> using slice is better than what I wanted before tbh |
06:27:21 | FromDiscord | <TryAngle> @ElegantBeef one more question though... how do I make a string ref đ ? |
06:27:36 | FromDiscord | <Elegantbeef> `new string` |
06:27:47 | FromDiscord | <TryAngle> and how I give it a value? |
06:28:11 | FromDiscord | <Elegantbeef> `let myRefString = new string; myRefString[] = "Hello World"` |
06:28:21 | FromDiscord | <TryAngle> oh |
06:28:30 | FromDiscord | <TryAngle> I forgot the [] |
06:28:33 | FromDiscord | <TryAngle> thanks beef |
07:00:11 | * | jmdaemon quit (Ping timeout: 246 seconds) |
07:05:41 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/1Om |
07:08:04 | FromDiscord | <Rika> Rune at is for byte indexes |
07:08:42 | FromDiscord | <Elegantbeef> What you're doing is silly |
07:08:46 | FromDiscord | <Yardanico> :D |
07:08:54 | FromDiscord | <Rika> Yes that too lol |
07:08:56 | FromDiscord | <Elegantbeef> `runeLen` is iterative do not use it like this |
07:09:08 | FromDiscord | <Rika> In reply to @Elegantbeef "`runeLen` is iterative do": Huh? |
07:09:17 | FromDiscord | <Rika> Ah |
07:09:19 | FromDiscord | <Rika> Okay |
07:09:28 | FromDiscord | <TryAngle> In reply to @Elegantbeef "What you're doing is": well I'm a bit perplexed from utf8 vs just chars |
07:09:36 | FromDiscord | <TryAngle> (edit) "In reply to @Elegantbeef "What you're doing is": well I'm a bit perplexed from utf8 vs just chars ... " added "thingy" |
07:10:02 | FromDiscord | <Elegantbeef> Well what are you trying to solve? |
07:10:48 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Well what are you": well I need the StringSlices to fully support utf8 |
07:10:56 | FromDiscord | <Elegantbeef> That's not the question |
07:11:09 | FromDiscord | <TryAngle> I'm rewriting my parser / lexer |
07:11:18 | FromDiscord | <TryAngle> because it's đ€ą |
07:11:30 | FromDiscord | <TryAngle> (edit) "because it's đ€ą ... " added "rn" |
07:12:12 | FromDiscord | <Elegantbeef> And these slices are supposed to solve what? |
07:12:44 | FromDiscord | <TryAngle> In reply to @Elegantbeef "And these slices are": partially |
07:12:45 | FromDiscord | <Rika> Youâre not doing the iterating part right at all |
07:12:57 | FromDiscord | <Rika> In reply to @TryAngle "partially": Solve what partially? |
07:13:02 | FromDiscord | <Rika> The heck does that mean |
07:13:30 | FromDiscord | <TryAngle> not copy the entire string all the time |
07:13:53 | FromDiscord | <TryAngle> it doens't matter in most cases but I'd like to overegineer a bit here |
07:14:01 | FromDiscord | <TryAngle> (edit) "it doens't matter in ... most" added "99.999999%" |
07:14:04 | FromDiscord | <TryAngle> (edit) "most" => "" |
07:14:57 | FromDiscord | <Rika> Youâre making a string copy with rune at anyway? |
07:15:10 | FromDiscord | <Rika> Are you even sure itâs the strings making you slow |
07:15:50 | FromDiscord | <Elegantbeef> Why are you needing to slice the string? |
07:16:33 | FromDiscord | <Yardanico> In reply to @TryAngle "not copy the entire": for this you usually just have an object that stores the string and currect position in the string |
07:16:46 | FromDiscord | <Yardanico> then you can use e.g. procs from parseutils by specifying start index |
07:19:01 | FromDiscord | <TryAngle> In reply to @Yardanico "for this you usually": I had that before and it wokrs well I just messed up and my code got too messy to edit it wellâ”but now I want try and do a bit more of a functional approach to this and do something like a combinator (I think?) |
07:19:14 | FromDiscord | <Yardanico> then why not just use a combinator lib? :P |
07:19:24 | FromDiscord | <Rika> If you want to make things faster wouldnât it be better to use streams? Not as in the module necessarily but the concept |
07:19:55 | FromDiscord | <Yardanico> In reply to @TryAngle "I had that before": also yeah, functional approach would probably be slower |
07:21:40 | FromDiscord | <Elegantbeef> Is this where i say "Just use a closure iterator" đ |
07:21:46 | FromDiscord | <TryAngle> In reply to @Rika "If you want to": step by step >.>â”Also I don't think streams can help me that much speedwise |
07:22:15 | FromDiscord | <Rika> âŠwhy not |
07:22:29 | FromDiscord | <Rika> Wasnât your issue copying strings |
07:22:44 | FromDiscord | <Rika> Why would you have an issue with that in the first place other than âbecause theyâre largeâ |
07:22:49 | FromDiscord | <Rika> Which streams would fix no? |
07:23:03 | FromDiscord | <Elegantbeef> And closure iterators are basically streams so yay! |
07:23:25 | FromDiscord | <Rika> In reply to @Elegantbeef "And closure iterators are": Resettable when |
07:23:33 | FromDiscord | <Yardanico> In reply to @Rika "Resettable when": already |
07:23:37 | FromDiscord | <Elegantbeef> They are if you dont use them nested |
07:23:39 | FromDiscord | <Rika> Wait when |
07:23:49 | FromDiscord | <Rika> Did I forget lmao |
07:23:52 | FromDiscord | <TryAngle> In reply to @Elegantbeef "And closure iterators are": what is a closure iterator? |
07:24:01 | FromDiscord | <Rika> In reply to @TryAngle "what is a closure": An iterator with state |
07:24:03 | FromDiscord | <Elegantbeef> I have a proc inside slicerator that resets them |
07:26:14 | FromDiscord | <TryAngle> In reply to @Yardanico "for this you usually": ah yes now I remember why I had issues with it.â”For example when parsing identifiers, strings, numbers etc. I always did a "subcounter"â”with that I can just lex a substring just as I would lex the whole text |
07:26:26 | FromDiscord | <TryAngle> (edit) ""subcounter"â”with" => ""subcounter" and that got messy fastâ”with" |
07:52:09 | FromDiscord | <aph> hii are there tools to detect the minimum version i need for my library? i dont know what to put in in the `requires "nim >= ???"` |
07:52:16 | FromDiscord | <aph> thanks |
07:53:01 | FromDiscord | <Yardanico> In reply to @aph "hii are there tools": just put latest your version of nim if you're not sure |
07:53:10 | FromDiscord | <Yardanico> but generally if you're using e.g. 1.6.4 you can just put 1.6.0 |
07:53:27 | FromDiscord | <Yardanico> @aph this requires nim field is only for when installing packages |
07:53:37 | FromDiscord | <Yardanico> so if some user has an old nim and the package requires a newer nim, the package won't install |
07:53:54 | FromDiscord | <Yardanico> it doesn't affect packages in any other way |
07:54:03 | FromDiscord | <aph> ohh thanks! |
07:56:26 | FromDiscord | <Yardanico> @ElegantBeef btw, as I've asked before, do you think it'd make sense to make a warning/hint if someone makes a set that's larger than for example 64 bytes? |
07:56:50 | FromDiscord | <Elegantbeef> Hint it's not anything "wrong" |
07:56:56 | FromDiscord | <Yardanico> yeah you're right |
07:58:11 | FromDiscord | <Elegantbeef> Would like to see tables/hashsets emit a hint aswell if the value is a `enum and Ordinal` |
08:00:50 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Would like to see": why for hashsets? |
08:01:04 | FromDiscord | <Elegantbeef> Cause a bitset is more efficient |
08:01:11 | FromDiscord | <Yardanico> yeah, that's true |
08:01:36 | FromDiscord | <Yardanico> so: 1) when set too big 2) when using a table with enum as keys 3) when using a hashset for enum type |
08:01:42 | FromDiscord | <Yardanico> time to make something like "nim-perf-hinter" |
08:02:05 | FromDiscord | <Elegantbeef> I always go back to the powerpc emulator when it was like 20 times slower due to `table[enum, val]` |
08:02:14 | FromDiscord | <Yardanico> xdd |
08:02:23 | FromDiscord | <Elegantbeef> changed`{}.toTable` to `[]` and it go 20 times faster |
08:02:51 | FromDiscord | <Yardanico> is it on github? |
08:05:22 | FromDiscord | <Elegantbeef> https://github.com/BracketMaster/nimulatorPPC/commit/a87da9cd2d11ea0eada42f94e77bfc81632e619e |
08:10:09 | FromDiscord | <Yardanico> would a case statement be faster than an array over enum values? |
08:10:58 | FromDiscord | <Elegantbeef> Eh iirc most of their program was in logic after that change |
08:11:04 | FromDiscord | <Elegantbeef> Before that change 90% of their program was hashing |
08:11:13 | FromDiscord | <Yardanico> also isn't this inefficient? https://github.com/BracketMaster/nimulatorPPC/blob/main/src/cpu/decoder.nim#L19 |
08:11:26 | FromDiscord | <Yardanico> shouldn't they instead have ISAInfo as keys |
08:11:52 | FromDiscord | <Yardanico> they iterate over all possible instructions in the array to find one instruction, no? |
08:11:55 | FromDiscord | <Elegantbeef> No clue i dont know what any of the code does |
08:11:59 | FromDiscord | <Yardanico> heh |
08:12:13 | FromDiscord | <Elegantbeef> I all did was profile it cause they said "Damn it's slow" |
08:12:30 | FromDiscord | <Yardanico> lemme try changing the logic a bit then |
08:12:35 | FromDiscord | <Elegantbeef> Then i looked at the profiler and went "heh, we can fix this" |
08:13:19 | FromDiscord | <Elegantbeef> I'm a simple man bigger number better |
08:15:10 | FromDiscord | <Yardanico> do you have the compiled firmware.bin for loopback asm? i just don't want to compile ppc64 gcc |
08:15:28 | FromDiscord | <Elegantbeef> Look at that commit date, i dont have anything related to that anymore đ |
08:16:48 | FromDiscord | <Yardanico> oh ok |
08:17:09 | FromDiscord | <Yardanico> looks like community/ppc64le-elf-binutils in arch repos works |
08:17:23 | FromDiscord | <Yardanico> "SIMULATED FOR 26603074 INSTRUCTIONS AT ROUGHLY 2914915 INSTRUCTIONS PER SECOND" |
08:17:48 | FromDiscord | <Yardanico> this is the default with danger |
08:18:04 | FromDiscord | <Yardanico> clang makes it slower :P |
08:19:11 | FromDiscord | <Yardanico> @ElegantBeef i'm afraid but it looks like your prepareMutation fix for streams didn't work :P |
08:19:20 | FromDiscord | <Elegantbeef> Yep |
08:19:28 | FromDiscord | <Yardanico> no I mean after https://github.com/nim-lang/Nim/pull/19717/ |
08:19:33 | FromDiscord | <Elegantbeef> Doesnt really matter cause stringstreams dont work at compile time apparently |
08:19:50 | FromDiscord | <Yardanico> it does with refc |
08:19:51 | FromDiscord | <Elegantbeef> I give up cause why the fuck arent these tests running on multiple gcs |
08:20:17 | FromDiscord | <Yardanico> nimulatorppc parses json at compile-time which uses stringstreams https://media.discordapp.net/attachments/371759389889003532/967339113319645224/unknown.png |
08:20:25 | FromDiscord | <Yardanico> I've parsed json at compile time in some of projects too and it works |
08:21:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3W0v |
08:21:28 | FromDiscord | <Elegantbeef> That doesnt run |
08:21:35 | FromDiscord | <Yardanico> it does with refc |
08:21:44 | FromDiscord | <Elegantbeef> It does fucking not |
08:21:50 | FromDiscord | <Yardanico> it does here đ€· |
08:22:04 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/967339561665568778/unknown.png |
08:22:25 | FromDiscord | <Elegantbeef> `nim -v`? |
08:22:33 | FromDiscord | <Yardanico> bb839029d5065bcd8367661802bf04e1e7eebb58 |
08:22:34 | FromDiscord | <Yardanico> latest devel |
08:22:42 | FromDiscord | <Yardanico> lemme try on latest stable on playground |
08:23:00 | FromDiscord | <Yardanico> yeah it fails there |
08:23:33 | FromDiscord | <Yardanico> guess it got fixed in devel after 1.6.4 |
08:24:09 | FromDiscord | <Elegantbeef> `Error: unhandled exception: field 'sym' is not accessible for type 'TNode' using 'kind = nkNilLit' [FieldDefect]` |
08:24:49 | FromDiscord | <Elegantbeef> I'm using the same version as you |
08:24:51 | FromDiscord | <Elegantbeef> You cannot write to the ss at compile time |
08:25:26 | FromDiscord | <Yardanico> I don't know what this is about, but it works on devel for real |
08:25:29 | FromDiscord | <Yardanico> i've even checked on godbolt |
08:25:34 | FromDiscord | <Elegantbeef> The code i gave you? |
08:25:37 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/967340456679714866/unknown.png |
08:25:39 | FromDiscord | <Yardanico> yes |
08:25:46 | FromDiscord | <Yardanico> ah your code |
08:25:50 | FromDiscord | <Yardanico> i was testing the different one lol |
08:25:55 | FromDiscord | <Elegantbeef> Exactly |
08:25:55 | FromDiscord | <Yardanico> yeah yeah your code fails, sure |
08:26:12 | FromDiscord | <Yardanico> anyway, the point is that some of stringstreams works for compiletime stuff |
08:26:12 | FromDiscord | <Elegantbeef> Like it's a pointless fix |
08:26:15 | FromDiscord | <Yardanico> enough to get json working |
08:26:18 | FromDiscord | <Yardanico> it's not a pointless fix |
08:26:28 | FromDiscord | <Yardanico> parsing json at compile time is not "pointless" in my view |
08:27:27 | FromDiscord | <Elegantbeef> Well a stringstream that can only read is quite fucking silly |
08:27:42 | FromDiscord | <Yardanico> yes, but again, a lot of other stuff depends on it |
08:30:29 | FromDiscord | <Elegantbeef> Well anyway yea thanks for suggesting olaf PR it đ |
08:30:38 | FromDiscord | <Yardanico> i'll pr it myself then |
08:31:22 | FromDiscord | <Elegantbeef> Dont forget to enable testing with refc and arc |
08:31:34 | FromDiscord | <Elegantbeef> I'm more annoyed at that than anything really |
08:31:48 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Dont forget to enable": for what? |
08:31:57 | FromDiscord | <Elegantbeef> The stream test |
08:34:36 | FromDiscord | <Elegantbeef> I mostly expected all tests that arent testing codegen/language semantics to run a matrix of refc/orc |
08:36:26 | * | Zectbumo quit (Remote host closed the connection) |
08:45:36 | FromDiscord | <Knedlik> Hey guys, why would sleep(5000) not let the code past? The docs show itâs in milsecs, which corresponds to what happends when I do sleep(5) |
08:45:56 | FromDiscord | <Elegantbeef> It'll sleep for 5 seconds |
08:46:01 | FromDiscord | <Elegantbeef> What's the entire code? |
08:46:18 | FromDiscord | <Knedlik> You mean all files or the main file? |
08:46:28 | FromDiscord | <Elegantbeef> Where the sleep is |
08:47:09 | FromDiscord | <Knedlik> sent a code paste, see https://paste.rs/9mZ |
08:47:14 | FromDiscord | <Knedlik> Ignore the commentation |
08:47:29 | FromDiscord | <Knedlik> With the comment it does go past |
08:47:38 | FromDiscord | <Yardanico> well it should work even with 5000 |
08:47:40 | FromDiscord | <Yardanico> just after 5 seconds |
08:47:50 | FromDiscord | <Knedlik> It doesnât even after 10 |
08:48:51 | FromDiscord | <Knedlik> The log doesnât show Passed sleep |
08:49:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/gSh |
08:49:34 | FromDiscord | <Yardanico> @Knedlik it might have something to do with you using sdl2, etc |
08:50:18 | FromDiscord | <Yardanico> but I don't think using `sleep` for showing a splash screen is a good idea anyway, instead you should save the state of your game and show splash screen as long as state == Splash for example |
08:50:30 | FromDiscord | <Yardanico> because what if your splash screen will be animated in the future |
08:50:37 | FromDiscord | <Yardanico> not just a static image |
08:50:58 | FromDiscord | <Knedlik> I donât know what you mean by save the state and show as long as state == splash |
08:51:25 | FromDiscord | <Yardanico> have an enum of your game states, switch between them in the main game loop, if the state is splash, you show the splash screen, if it's menu you show the main menu, etc |
08:51:28 | FromDiscord | <Yardanico> just a rough idea |
08:51:59 | FromDiscord | <Knedlik> Pretty sure Nimgame doesnât have a main game loop |
08:52:11 | FromDiscord | <Knedlik> It has update() for scenes and entities |
08:52:39 | FromDiscord | <Elegantbeef> Dont look now that's a main game loop |
08:53:10 | FromDiscord | <Knedlik> I mean, somewhat |
08:53:25 | FromDiscord | <Knedlik> You still handle switching between scenes outside a game loop |
08:53:42 | FromDiscord | <Knedlik> Or atleast unless itâs triggered by letâs say a button press |
08:54:48 | FromDiscord | <Yardanico> btw @ElegantBeef streams don't support writing over existing data, so this doesn't work either (even with refc) https://github.com/nim-lang/Nim/blob/devel/tests/stdlib/tstreams.nim#L77 but it wasn't caught since there was no ss.peakStr(5) == "hello" test |
08:55:03 | FromDiscord | <Yardanico> well, at least not the string stream |
08:55:31 | FromDiscord | <Rika> Did you misspell that intentionally? |
08:55:34 | FromDiscord | <Elegantbeef> String streams support writing over data |
08:55:52 | FromDiscord | <Yardanico> hm why doesn't it work then |
08:56:00 | FromDiscord | <Yardanico> In reply to @Rika "Did you misspell that": no, just a mistake |
08:56:27 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3W0F |
08:56:30 | FromDiscord | <Yardanico> ah yeah i'm stupid nvm |
08:56:35 | FromDiscord | <Yardanico> needed to do setPosition again, yeah |
08:56:42 | FromDiscord | <Yardanico> anyway, I'll add it to the test since iut wasn't tested |
08:56:46 | FromDiscord | <Yardanico> (edit) "iut" => "it" |
08:56:49 | FromDiscord | <Elegantbeef> Ok |
08:57:19 | FromDiscord | <Elegantbeef> That oddly caused me to be irrationally angry đ |
08:57:38 | FromDiscord | <Yardanico> dog? |
08:57:53 | FromDiscord | <Elegantbeef> No the "string streams cant write over data" |
08:57:59 | FromDiscord | <Yardanico> heh |
08:58:13 | FromDiscord | <Yardanico> yeah i rarely use streams in general |
08:59:09 | FromDiscord | <Rika> Beef angry huh |
08:59:26 | FromDiscord | <Knedlik> Does irrationally angry mean less or more angry than 3.14 angry? |
08:59:33 | FromDiscord | <Solitude> In reply to @Rika "Beef angry huh": im infecting people with irrational anger over the internet |
08:59:48 | FromDiscord | <Elegantbeef> it's 6.28 angry since it's the superior constant |
09:00:01 | FromDiscord | <Elegantbeef> Nah tired + still slightly sick is my excuse |
09:00:11 | FromDiscord | <Knedlik> But thatâs really angry |
09:04:49 | FromDiscord | <Yardanico> anyway, time to actually test if I can speedup nimulatorPPC |
09:04:55 | FromDiscord | <Yardanico> i got side-lined by streams |
09:05:06 | FromDiscord | <Elegantbeef> Lol |
09:05:23 | FromDiscord | <Elegantbeef> Go speed up benchmarks instead since people think they matter |
09:05:42 | FromDiscord | <Yardanico> yeah i saw that thread |
09:05:46 | FromDiscord | <Yardanico> classic |
09:05:51 | FromDiscord | <Knedlik> I love when I forget a word in a parent function call and cause a recursion down to hell |
09:06:02 | FromDiscord | <Rika> What word |
09:06:16 | FromDiscord | <Rika> In reply to @Elegantbeef "Go speed up benchmarks": Now this made me angry |
09:06:42 | FromDiscord | <Knedlik> update() instead of updateScene() in my own function update() |
09:07:54 | FromDiscord | <Elegantbeef> Why isnt it `update` that takes scene as a paramter |
09:07:57 | FromDiscord | <Elegantbeef> Literally unusable |
09:08:14 | FromDiscord | <Elegantbeef> Yea it's sillyâ”(@Rika) |
09:08:50 | FromDiscord | <Knedlik> They both take scene as a param |
09:09:02 | FromDiscord | <Knedlik> But Nim prefers my own function |
09:10:45 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] â I don't check my email often since it's full of crap, but in any case, [email protected]) |
09:19:30 | * | neurocyte8614492 joined #nim |
09:36:06 | FromDiscord | <Knedlik> Ummmm guys Iâm having a problem - I need to import splashScene in some way into main, but also main into splashScene, and without causing a circular import |
09:36:20 | FromDiscord | <Knedlik> (edit) "circular" => "recursive" |
09:38:23 | FromDiscord | <Knedlik> I think I got it |
09:42:07 | FromDiscord | <Knedlik> Also can I somehow overwrite echo to behave as my own function (log)? |
09:42:49 | FromDiscord | <Rika> No not really, use a different function name |
09:43:02 | FromDiscord | <Knedlik> What? |
09:43:08 | FromDiscord | <Knedlik> I meant for default errors |
09:45:05 | FromDiscord | <Rika> What? |
09:45:09 | FromDiscord | <Rika> What do you mean now |
09:45:31 | FromDiscord | <Knedlik> Like can I make default errors use log() I created instead of echo? |
09:45:33 | FromDiscord | <Rika> Catch the error, log it with your logger, re raise it |
09:45:51 | FromDiscord | <Knedlik> How do I catch the error? |
09:45:57 | FromDiscord | <Rika> Try except? |
09:47:46 | FromDiscord | <Knedlik> Hmm, how do I get the exception tho? |
09:48:05 | FromDiscord | <Knedlik> getCurrenException()? |
09:48:26 | FromDiscord | <Knedlik> Or getCurrentExceptionMsg()? |
09:48:40 | FromDiscord | <Yardanico> the first gets you the exception object itself, the latter - the exception message |
09:48:49 | FromDiscord | <Knedlik> Oh okay, thanks |
09:53:58 | FromDiscord | <Knedlik> Also why am I getting Canât load font: Library not initialized? |
09:55:33 | FromDiscord | <TryAngle> In reply to @Knedlik "Also why am I": we talked about this yesterady |
09:55:38 | FromDiscord | <TryAngle> the order you execute is wrong |
09:56:00 | FromDiscord | <TryAngle> first init scene, then load |
09:56:24 | FromDiscord | <Knedlik> But thatâs what Iâm doing |
09:57:30 | FromDiscord | <Knedlik> sent a code paste, see https://paste.rs/DPK |
09:58:43 | FromDiscord | <Knedlik> I can also try doing a return instead |
10:01:22 | FromDiscord | <Knedlik> Nope, still the same |
10:01:50 | FromDiscord | <TryAngle> no idea then sorry đŠ |
10:02:47 | FromDiscord | <Knedlik> Hmm, can we do multi-line comments in nim? |
10:03:23 | FromDiscord | <Rika> Yes |
10:03:32 | FromDiscord | <Rika> #[ ⊠]# |
10:03:39 | FromDiscord | <Knedlik> Oh yeah |
10:05:14 | * | flynn joined #nim |
10:05:47 | * | flynn quit (Read error: Connection reset by peer) |
10:07:45 | * | xet7 quit (Remote host closed the connection) |
10:10:02 | * | xet7 joined #nim |
10:10:28 | FromDiscord | <Knedlik> This is funny |
10:10:48 | FromDiscord | <Knedlik> I replaced my init in Main with echo fileExists() and it outputs as the last thing |
10:14:46 | FromDiscord | <TryAngle> is there something that abstracts over Rune and Char? |
10:15:26 | FromDiscord | <Knedlik> Is that a response to me or a general question? |
10:15:33 | FromDiscord | <TryAngle> general qusetion lol |
10:15:49 | FromDiscord | <TryAngle> also @Knedlik there is a #gamedev channel |
10:16:39 | FromDiscord | <TryAngle> but most of us there use nimgl rn đ |
10:17:22 | FromDiscord | <Knedlik> I mean, nimgame is better than making own engine, or atleast easier I would assume |
10:17:47 | FromDiscord | <Knedlik> How much work is it to make own engine with nimgl (2D)? |
10:18:48 | FromDiscord | <Yardanico> one thing to note - nimgame isn't an engine, it's just a library abstracting some of the more usual game dev stuff |
10:18:56 | FromDiscord | <Rika> In reply to @TryAngle "is there something that": Abstracts how |
10:18:57 | FromDiscord | <Yardanico> "engine" is really different from a "framework" |
10:19:19 | FromDiscord | <Yardanico> i mean nimgame says it's an engine, but imo it's more of a framework |
10:19:24 | FromDiscord | <Knedlik> I mean, engine can also be without an editor <:ondra_shrug:815540303841853450> |
10:20:12 | FromDiscord | <Knedlik> I guess I could try using straight up NimGL, but how much more work would that be? |
10:21:41 | FromDiscord | <TryAngle> In reply to @Rika "Abstracts how": idk single character that can be typed like "x" or 'x' or maybe idk Rune("x") or Rune('x') |
10:23:21 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3W0S |
10:24:13 | FromDiscord | <TryAngle> ah nvm I'm stoopid |
10:24:23 | FromDiscord | <TryAngle> (edit) "stoopid" => "stoopidâ”I tried to match a string with a char" |
10:24:40 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3W0S" => "https://play.nim-lang.org/#ix=3W0T" |
11:10:17 | * | vicecea quit (Remote host closed the connection) |
11:10:48 | * | vicecea joined #nim |
11:21:06 | * | neurocyte8614492 quit (Ping timeout: 276 seconds) |
11:23:05 | FromDiscord | <TryAngle> When dereferencing a ref, does it copy the ref object ? |
11:23:58 | FromDiscord | <Rika> If you store it in a variable |
11:25:29 | FromDiscord | <TryAngle> In reply to @Rika "If you store it": Oh I worded a bit open...â”I mean if it copys the entire value |
11:25:48 | FromDiscord | <TryAngle> Or just the ref |
11:26:04 | FromDiscord | <Rika> If you store the dereferenced object it copies the object |
11:26:16 | FromDiscord | <TryAngle> Ok thanks |
11:26:56 | FromDiscord | <Rika> In reply to @Rika "If you store the": Youâre undoing a reference so it becomes a regular object with value semantics no? |
11:28:10 | FromDiscord | <TryAngle> Well idk. Hypothetically this could be a pointer internally or smth like that and just looks like a new variable from the code |
11:31:25 | FromDiscord | <Rika> ? |
12:23:18 | * | v9fk quit (Remote host closed the connection) |
12:24:25 | * | v9fk joined #nim |
12:29:52 | * | v9fk quit (Remote host closed the connection) |
13:27:21 | * | v9fk joined #nim |
13:32:07 | FromDiscord | <TryAngle> how can I make a rune from a string or char? |
13:34:50 | FromDiscord | <Yardanico> https://nim-lang.org/docs/unicode.html#runeAt%2Cstring%2CNatural |
13:35:01 | FromDiscord | <Yardanico> for chars you first convert them to $ |
13:41:22 | * | slowButPresent joined #nim |
13:43:24 | FromDiscord | <2F42BBA1> Trying to use this library for clipboard https://github.com/Guevara-chan/Cliptomaniaâ”â”What I want is that when software detects via regex that there's a word containg `foo`, then it would replace with `bar`â”How it would look like in Nim code? Perhaps there are better ways of doing that... |
13:44:11 | FromDiscord | <2F42BBA1> It's also a bit of hard to use this lib since there aren't much of examples here |
13:45:43 | FromDiscord | <Yardanico> well this lib doesn't seem to have a way of "waiting" for clipboard modification, so your best bet is checking clipboards contents e.g. once in 100ms (or once 1s), then you replace the value you want in the string and set it in the clipboard |
13:46:33 | FromDiscord | <2F42BBA1> I will try to use winim. |
13:46:42 | FromDiscord | <Yardanico> ?? |
13:47:06 | FromDiscord | <Solitude> In reply to @Yardanico "for chars you first": or just char.Rune? |
13:47:18 | FromDiscord | <2F42BBA1> I noticed that, uh... functions that are in library I linked above are also available in winim as well. |
13:47:31 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "I noticed that, uh...": yes, but winim is quite big and that lib is multiplatform |
13:48:37 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/etz |
13:48:42 | FromDiscord | <Yardanico> is this not what you wanted? |
13:49:09 | FromDiscord | <2F42BBA1> In reply to @Yardanico "from a minute of": looks fine |
13:49:10 | FromDiscord | <2F42BBA1> thanks |
13:49:31 | FromDiscord | <2F42BBA1> yet it looks so damn simple |
13:49:53 | FromDiscord | <Yardanico> the examples/basic actually has all of those functions |
13:49:55 | FromDiscord | <Yardanico> shown |
13:50:09 | FromDiscord | <Yardanico> ah, sorry, it'll be a bit different |
13:50:36 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3W1j |
13:50:40 | FromDiscord | <Yardanico> don't forget to also import strutils |
13:51:00 | FromDiscord | <Yardanico> In reply to @Solitude "or just char.Rune?": yeah that'd also work |
13:51:24 | * | v9fk quit (Remote host closed the connection) |
13:52:45 | FromDiscord | <2F42BBA1> sent a code paste, see https://paste.rs/v2v |
13:52:48 | FromDiscord | <Yardanico> why? |
13:52:59 | FromDiscord | <Yardanico> regex would just be slower, but if you really want to, there would be no different |
13:53:01 | FromDiscord | <Yardanico> (edit) "different" => "difference" |
13:53:13 | FromDiscord | <Yardanico> just check with a regex condition instead of my "foo" in str |
13:53:53 | FromDiscord | <Solitude> In reply to @2F42BBA1 "hm... it would be": aw hell naw |
13:54:21 | FromDiscord | <2F42BBA1> ok đŠ |
13:54:40 | FromDiscord | <Yardanico> why do you specifically want regex? I just don't understand |
13:54:42 | FromDiscord | <2F42BBA1> since yardanico explained why not use that |
13:54:55 | FromDiscord | <Yardanico> if you just want to check if a string is inside another string, `in` is enough |
13:57:55 | FromDiscord | <Knedlik> Hey guys, is there a tutorial somwhere on how to get started with nimgl? |
13:58:06 | FromDiscord | <Solitude> nah |
13:58:12 | FromDiscord | <Yardanico> it's better if you ask #gamedev |
13:58:19 | FromDiscord | <Yardanico> there are people working with nimgl |
14:04:55 | * | v9fk joined #nim |
14:32:17 | FromDiscord | <Entikan> hello |
14:32:34 | FromDiscord | <Entikan> I'm having a lot of fun with nim |
14:32:58 | FromDiscord | <Rika> that is good |
14:33:02 | FromDiscord | <Knedlik> Hello having a lot of fun with nim, Iâm Knedlik and I enjoy nim |
14:33:14 | FromDiscord | <Rika> ok dad |
14:33:18 | FromDiscord | <Entikan> nim is great I love nim |
14:33:18 | FromDiscord | <Solitude> @mods |
14:33:38 | FromDiscord | <Entikan> nim nim nimnim nim nimnimnim |
14:33:41 | FromDiscord | <Yardanico> In reply to @Entikan "nim is great I": why |
14:33:51 | FromDiscord | <Solitude> name one good thing about nim |
14:34:24 | FromDiscord | <Entikan> it's as intuitive to write as python but as fast as C and has stricter typing, what more do you want |
14:35:04 | FromDiscord | <Solitude> lisp-like macros? |
14:35:12 | FromDiscord | <Knedlik> ~~a functional and easy to use game lib~~ |
14:35:23 | FromDiscord | <Entikan> the sdl2 bindings seem pretty good |
14:35:30 | FromDiscord | <Entikan> so far at least |
14:35:52 | FromDiscord | <Knedlik> Well, are you using them by themselves, or with Nimgame? |
14:35:59 | * | PMunch joined #nim |
14:37:41 | FromDiscord | <Entikan> by itself |
14:38:33 | FromDiscord | <Entikan> I don't really appreciate concepts like Entity or Scene |
14:38:37 | FromDiscord | <Entikan> unless I write them myself |
14:39:09 | FromDiscord | <Entikan> just give me gltf, a scenegraph and input control and get out of my way |
14:40:13 | FromDiscord | <Knedlik> I never actually tried SDL |
14:40:44 | FromDiscord | <Knedlik> Is it actually good, or is it another long names that are hard to read, donât make much sense to a beginner and you need 10 of them to do once thing? |
14:40:51 | FromDiscord | <TryAngle> In reply to @Solitude "name one good thing": I can name one bad thing about nimâ”the way chars are not utf8 encoded and runes are annoying to work with |
14:41:01 | FromDiscord | <TryAngle> (edit) "nimâ”the" => "nim (first thing I don't like tbh)â”the" |
14:41:21 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3W1v |
14:41:41 | FromDiscord | <2F42BBA1> `Error: type mismatch: got <string, array[0..1, Regex]>` |
14:41:53 | FromDiscord | <Entikan> I'm using SDL2 for now to learn nim, because I'm familiar with it. But I'm also flirting a bit with Knim https://github.com/IbrahimHindawi/Knim |
14:42:40 | FromDiscord | <Knedlik> And is it easy to learn? |
14:43:01 | FromDiscord | <Entikan> SDL2 or nim? |
14:43:08 | FromDiscord | <Entikan> knim isn't, there's very little docs |
14:43:10 | FromDiscord | <Knedlik> Sdl |
14:43:20 | FromDiscord | <Entikan> yeah SDL is very easy to use |
14:43:24 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "`Error: type mismatch: got": that's not how you check for regex |
14:44:10 | FromDiscord | <Yardanico> if you're using https://nim-lang.org/docs/re.html, can you just check examples in there? |
14:44:22 | FromDiscord | <Yardanico> and maybe search a bit https://media.discordapp.net/attachments/371759389889003532/967435768081555466/unknown.png |
14:45:19 | FromDiscord | <2F42BBA1> In reply to @Yardanico "that's not how you": I am trying to use this https://github.com/nitely/nim-regex |
14:45:31 | FromDiscord | <Yardanico> then have you seen https://nitely.github.io/nim-regex/regex.html ? |
14:45:35 | FromDiscord | <Yardanico> there's a link for that in readme |
14:45:47 | FromDiscord | <2F42BBA1> I am blind :/ |
14:45:52 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/967436147330519080/unknown.png |
14:46:13 | FromDiscord | <enthus1ast> if you use regex to solve a problem, you have two problems \:) |
14:46:43 | FromDiscord | <Yardanico> true |
14:46:53 | FromDiscord | <Yardanico> in a lot of cases just string parsing is enough, or at least strscans |
14:47:42 | NimEventer | New post on r/nim by ryu-ryu-ryu: Embedded Ruby Interpreter in Nim, see https://reddit.com/r/nim/comments/ua70h3/embedded_ruby_interpreter_in_nim/ |
14:47:45 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3W1w |
14:48:30 | FromDiscord | <Yardanico> not a regex |
14:48:34 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/EAk |
14:48:41 | FromDiscord | <Yardanico> remove the [] that you have, they're not needed |
14:49:53 | FromDiscord | <Rika> solitude is speeeeeed when it comes to ryu huh' |
14:50:09 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3W1y |
14:50:14 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3W1z |
14:50:17 | FromDiscord | <Rika> ? |
14:50:28 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/v5C |
14:50:31 | FromDiscord | <Yardanico> please |
14:50:36 | FromDiscord | <Yardanico> `if reg.contains(str):` |
14:50:58 | FromDiscord | <Yardanico> learn a bit of nim please :( |
14:51:01 | FromDiscord | <2F42BBA1> i am bad at nim |
14:51:01 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3W1A |
14:51:06 | FromDiscord | <Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3W1B |
14:52:13 | FromDiscord | <Entikan> be nice |
14:52:23 | duuude | has anyone made android apps using nim? |
14:52:36 | PMunch | duuude, yup |
14:52:40 | PMunch | But not a whole lot of people |
14:53:03 | duuude | what toolkits are the best |
14:53:07 | nrds | <Prestige99> I should look into that, I'd like to make android apps but I'm tired of java |
14:53:36 | PMunch | @Solitude, that feeling when you can't afford to use copilot, so you must randomly mush code snippets together yourself |
14:53:45 | FromDiscord | <2F42BBA1> In reply to @Solitude "have you seen the": just walked through the eyes |
14:53:51 | FromDiscord | <Rika> eyes> |
14:53:53 | FromDiscord | <Rika> (edit) "eyes>" => "eyes?" |
14:53:56 | FromDiscord | <Rika> is this a saying |
14:54:00 | FromDiscord | <Rika> rather an idiom |
14:54:27 | PMunch | duuude, well that's the thing. Not a lot of people doing it == not a lot of solid ways of doing it |
14:54:40 | FromDiscord | <2F42BBA1> In reply to @Rika "eyes?": i scrolled through tutorials, and didn't look much deep into them |
14:54:51 | FromDiscord | <Rika> please read through it |
14:54:51 | PMunch | I've exported games written in Nim to run on an Android phone, but that was just using SDL |
14:55:10 | PMunch | I know some people have looked at generating more native stuff though |
14:55:41 | PMunch | Don't get me wrong, SDL is going to run native, it's not like it's emulated or anything. But it's not very integrated into the Android ecosystem |
14:56:18 | PMunch | @Rika, not an idiom I've heard at least. I guess it's a literal translation of an idiom similar to the english "I just skimmed through it" |
14:56:18 | nrds | <Prestige99> Actually just getting SDL running would be great as well |
14:56:31 | PMunch | Oh that was pretty easy last time I tried |
14:57:24 | duuude | EFL could use SDL and was used in Tizen so it could be probably somewhat mobile-optimized |
15:00:19 | duuude | and it has a good C api |
15:01:33 | FromDiscord | <Rika> given an image loaded on pixie, how do i run a shader (let's say i have it in a glsl file) on it then save it back? |
15:04:56 | PMunch | @Rika, you probably just feed the shader the Image.data buffer |
15:06:45 | FromDiscord | <Rika> yes, via what đ |
15:07:02 | FromDiscord | <TryAngle> after years of rewriting ... my lexer finally tokenizes again đ„ș |
15:07:07 | FromDiscord | <TryAngle> and it's beautiful |
15:09:00 | PMunch | Oooh, what's it lexing? |
15:11:19 | FromDiscord | <TryAngle> In reply to @PMunch "Oooh, what's it lexing?": a toy lang I'm working onâ”got some discussion earlier with rika yardanico and beef about the way I could lex |
15:11:28 | FromDiscord | <TryAngle> (edit) "onâ”got" => "on for learning purposeâ”got" |
15:12:52 | PMunch | Toy languages are fun :) |
15:17:09 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/KgW |
15:20:07 | FromDiscord | <Yardanico> ` c.inner.slice.a..cursor.inner.slice.a - 1` |
15:20:16 | FromDiscord | <Yardanico> đ |
15:20:20 | FromDiscord | <Yardanico> idk it just looks weird |
15:21:03 | FromDiscord | <TryAngle> I mean I could make that look better but for 1 line I don't make an extra function now xd |
15:21:20 | FromDiscord | <TryAngle> but it looks really sus I agre |
15:21:22 | FromDiscord | <TryAngle> (edit) "agre" => "agree" |
15:22:57 | FromDiscord | <2F42BBA1> I am wonder for how long it takes to learn Nim lang? |
15:23:20 | FromDiscord | <Solitude> 1 week and you're good to go |
15:23:35 | FromDiscord | <2F42BBA1> 1 week, wow. |
15:23:55 | FromDiscord | <2F42BBA1> Rust taken me to learn for a month or so? |
15:24:39 | FromDiscord | <TryAngle> I mean it really dependsâ”the whole std, probably long (or never?)â”â”getting the basics done, some hours to some days depending on background |
15:25:03 | FromDiscord | <TryAngle> In reply to @2F42BBA1 "Rust taken me to": đ„ș I feel that |
15:25:45 | FromDiscord | <TryAngle> learned rust just to RIIN later |
15:29:34 | FromDiscord | <2F42BBA1> In reply to @TryAngle "learned rust just to": RIIN? |
15:30:10 | FromDiscord | <TryAngle> In reply to @2F42BBA1 "RIIN?": It's a parody of RIIR |
15:31:25 | FromDiscord | <spoon> thanks google |
15:32:24 | FromDiscord | <TryAngle> In reply to @TryAngle "It's a parody of": rewrite it in rust |
15:34:15 | NimEventer | New Nimble package! nimmikudance - MMD I/O!, see https://github.com/aphkyle/NimMikuDance |
15:34:44 | FromDiscord | <2F42BBA1> In reply to @TryAngle "It's a parody of": Heh |
15:34:58 | FromDiscord | <2F42BBA1> I did once a rewrite a utility |
15:35:08 | FromDiscord | <2F42BBA1> It used to calculate hashes CRC32 ones |
15:35:27 | FromDiscord | <2F42BBA1> My goal was by learning Rust make my own utility with modern OSes support etc. |
15:35:35 | FromDiscord | <TryAngle> No joke this is the first time I read about nim https://news.ycombinator.com/item?id=9050114 |
15:35:40 | FromDiscord | <2F42BBA1> I did it, plus added many more hash functions |
15:37:05 | FromDiscord | <TryAngle> (edit) "https://news.ycombinator.com/item?id=9050114" => "https://news.ycombinator.com/item?id=9050114â”I think I found this post on rustjerk subreddit but unsure đ" |
15:37:52 | * | Guest32 joined #nim |
15:40:16 | FromDiscord | <Knedlik> Hey guys, how do I parse a string into int64 and not a regular int? |
15:41:27 | FromDiscord | <dom96> ParseBiggestInt |
15:41:47 | FromDiscord | <Knedlik> Why not just name it parseInt64 wtf |
15:42:04 | FromDiscord | <Knedlik> Or just name it a long and use parseLong |
15:42:06 | FromDiscord | <Rika> because int64 will not be the biggest int in the future |
15:42:11 | FromDiscord | <Rika> long is not a good name |
15:42:56 | FromDiscord | <TryAngle> Speaking about that, is there a plan already when 128bit types will come? |
15:43:13 | FromDiscord | <Solitude> no |
15:43:16 | FromDiscord | <Knedlik> I guess parseBiggestInt is an option, but is it worth it using those extra 64b when the time comes? |
15:43:34 | FromDiscord | <Rika> what do you mean in that case |
15:43:35 | FromDiscord | <Knedlik> In reply to @TryAngle "Speaking about that, is": Wouldnât you need a 128b processor for that? |
15:43:43 | FromDiscord | <Rika> not necessarily |
15:43:46 | FromDiscord | <TryAngle> Is the issue that c doesn't support them? |
15:44:04 | FromDiscord | <TryAngle> In reply to @Knedlik "Wouldnât you need a": No, 128bit processesors would just be a lot faster |
15:44:08 | FromDiscord | <Yardanico> what? noi |
15:44:09 | FromDiscord | <Yardanico> (edit) "noi" => "no" |
15:44:12 | FromDiscord | <Rika> you can have arbitrarily sized integers, its just a matter of how well you want them to perform |
15:44:13 | FromDiscord | <Yardanico> more bits was never about faster lol |
15:44:16 | FromDiscord | <Yardanico> wtf |
15:44:22 | FromDiscord | <xflywind> In reply to @TryAngle "Speaking about that, is": see https://github.com/nim-lang/RFCs/issues/399 |
15:44:29 | FromDiscord | <Yardanico> 32bit -> 64bit change was mainly needed because of memory requirements |
15:44:34 | FromDiscord | <Knedlik> In reply to @Rika "what do you mean": Like when 128b integers become a thing in nim |
15:44:43 | FromDiscord | <Yardanico> with 32bit you can't effectively address over 4GB of memory without different hacks |
15:44:56 | FromDiscord | <Rika> In reply to @Knedlik "Like when 128b integers": i mean what do you mean by "worth it" |
15:45:13 | FromDiscord | <xflywind> It would not come at 2.0 I think. |
15:45:33 | FromDiscord | <Knedlik> Like is it significantly worse performance-wise? |
15:45:48 | FromDiscord | <Rika> if they become a thing, they most likely will not |
15:45:56 | FromDiscord | <TryAngle> Depends on the registers your cpu has I think |
15:45:57 | FromDiscord | <Knedlik> Okay, good |
15:46:04 | FromDiscord | <Rika> and even if they were, they would be not at parsing but at arithmetic, i'd assume\ |
15:46:05 | FromDiscord | <Rika> (edit) "assume\" => "assume" |
15:46:10 | FromDiscord | <Rika> and not even all of arithmetic |
15:46:13 | FromDiscord | <TryAngle> In reply to @TryAngle "Depends on the registers": And how well the OS works with it |
15:46:15 | FromDiscord | <Yardanico> C compilers already have 128-bit int types, but almost no CPUs have native support for 128 bits |
15:46:20 | FromDiscord | <Rika> probably only for stuff like powers and whatnot |
15:46:36 | FromDiscord | <Rika> AND thats not accommodating for whether cpus will get native support |
15:46:41 | FromDiscord | <Rika> oh i didnt see what yardy said |
15:46:41 | FromDiscord | <Rika> xd |
15:46:48 | FromDiscord | <Yardanico> anyway just go read https://en.wikipedia.org/wiki/128-bit_computing |
15:46:57 | FromDiscord | <Yardanico> or lets go to #offtopic :) |
15:47:23 | FromDiscord | <Rika> cpus wont need to be 128bit to support 128bit arith natively id say |
15:47:46 | FromDiscord | <Rika> wont? i mean dont |
15:49:20 | FromDiscord | <TryAngle> In reply to @Rika "wont? i mean dont": I think they only need the registers.. The 64x is just the address space just like yardanico said I thought |
15:49:33 | FromDiscord | <Rika> not even i think |
15:49:44 | FromDiscord | <Rika> you could just use 2 64b registers fused |
15:49:48 | FromDiscord | <TryAngle> I mean u said natively |
15:49:53 | FromDiscord | <Rika> yes |
15:49:54 | FromDiscord | <Rika> i did |
15:50:08 | FromDiscord | <Yardanico> modern CPUs have 128 bit registers, and even bigger ones, but they don't have 128 bit native arithmetics |
15:50:37 | FromDiscord | <Yardanico> have you heard of AVX-512 |
15:50:39 | FromDiscord | <Yardanico> 512 means 512bit |
15:50:52 | FromDiscord | <TryAngle> In reply to @Yardanico "have you heard of": But that's SIMD no? |
15:50:55 | FromDiscord | <Yardanico> so? |
15:50:55 | FromDiscord | <Rika> im just imagining how fucked up quad floats would be to process |
15:51:34 | FromDiscord | <TryAngle> In reply to @Yardanico "so?": Idk đ |
15:51:35 | FromDiscord | <Knedlik> Really fucked up |
15:52:40 | FromDiscord | <Rika> 256b floats đ |
15:52:53 | FromDiscord | <Rika> LETS GO 512b FLOATS |
15:53:30 | FromDiscord | <TryAngle> I thought that would just be a 64x8 operation with AVX-512.â”But it's been a year and only short I looked into smth like that so I have really no clue tbh. |
15:54:23 | FromDiscord | <2F42BBA1> yo uh... what's nimsuggest? is this sorta like clippy here in rust? to point out the issues in code and what's to improve on |
15:55:29 | FromDiscord | <Yardanico> no, it's general code autocomplete and error checker |
15:58:53 | FromDiscord | <Alea> Clippy for nim would be the dream <:ritchie_prayge:889231238009876520> |
16:02:13 | duuude | the MS Office paperclip? |
16:06:57 | FromDiscord | <Knedlik> Hey guys, can I somehow automatically call the same-named function from multiple files at once? Letâs say multiple things have a proc update() and I want to call all those update() procs? |
16:07:45 | FromDiscord | <Yardanico> you store them all in a sequence? |
16:07:49 | FromDiscord | <Yardanico> the objects or proc themselves |
16:09:06 | * | vicfred joined #nim |
16:09:29 | * | vicfred quit (Remote host closed the connection) |
16:10:10 | FromDiscord | <Knedlik> :hidethepain: |
16:10:42 | FromDiscord | <spoon> like making the proc public and importing it? |
16:10:47 | FromDiscord | <Yardanico> In reply to @Knedlik "<:hidethepain:790306236985245706>": ?? |
16:10:56 | FromDiscord | <Yardanico> In reply to @Knedlik "<:hidethepain:790306236985245706>": > java community |
16:11:11 | FromDiscord | <spoon> - respect |
16:11:17 | FromDiscord | <Rika> In reply to @Knedlik "Hey guys, can I": i have no idea what you meant by this |
16:11:17 | FromDiscord | <Solitude> sussy |
16:11:28 | FromDiscord | <Knedlik> They have good memes |
16:11:57 | FromDiscord | <spoon> yeah if you want to use a function in a different file, you put an `` at the end and `import` that file |
16:12:15 | FromDiscord | <Knedlik> Yeah, so I guess Iâll put all of those in a proc |
16:12:55 | FromDiscord | <TryAngle> Omg imagine we had a nim spring framework |
16:13:09 | FromDiscord | <Rika> In reply to @Knedlik "Yeah, so I guess": ? |
16:13:24 | FromDiscord | <Rika> did i actually have a stroke that last time |
16:13:30 | FromDiscord | <Rika> am i the only one not understanding |
16:13:54 | FromDiscord | <Knedlik> Basically call many procs of the same name by one statement |
16:14:15 | FromDiscord | <spoon> what |
16:14:15 | FromDiscord | <Rika> can you pseudocode example? |
16:15:51 | * | arkurious joined #nim |
16:15:57 | * | def- quit (Quit: -) |
16:16:31 | FromDiscord | <Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3W27 |
16:16:35 | * | def- joined #nim |
16:16:36 | FromDiscord | <Knedlik> (edit) |
16:16:57 | FromDiscord | <Knedlik> I donât think itâs possible, but it could be |
16:17:00 | FromDiscord | <TryAngle> U can import as |
16:17:25 | FromDiscord | <Rika> `proc update() = file1.update(); file2.update()` ? |
16:17:37 | FromDiscord | <Rika> In reply to @TryAngle "U can import as": you dont need to actually |
16:17:39 | FromDiscord | <Knedlik> Yeah, but thatâs creating another proc |
16:17:42 | FromDiscord | <Rika> you can but you dont need to |
16:17:45 | FromDiscord | <Yardanico> In reply to @Knedlik "Yeah, but thatâs creating": ???? |
16:17:46 | FromDiscord | <Rika> In reply to @Knedlik "Yeah, but thatâs creating": no other way around it |
16:17:51 | FromDiscord | <TryAngle> In reply to @Rika "you dont need to": đł |
16:17:53 | FromDiscord | <Knedlik> Thatâs what I thought |
16:18:00 | FromDiscord | <Rika> calling `update()` bare will give an ambiguous error |
16:18:11 | FromDiscord | <Knedlik> Ik |
16:18:14 | FromDiscord | <Rika> okay |
16:18:21 | FromDiscord | <Knedlik> Gone that rabbit hole before :heh: |
16:18:44 | FromDiscord | <Knedlik> (edit) "Gone ... that" added "down" |
16:18:54 | FromDiscord | <spoon> you can do `proc update() = file1.update();file2.update()` and then use `update()` in the loop lol |
16:18:54 | FromDiscord | <demotomohiro> Create a template or macro that transform `Call(update, foo, bar)` to `foo.update(); bar.update()`. |
16:20:05 | FromDiscord | <Knedlik> Meh, itâs gonna be done only once and Iâm lazy |
16:20:40 | * | duuude quit (Ping timeout: 248 seconds) |
16:24:39 | * | ehmry quit (Ping timeout: 276 seconds) |
16:24:48 | * | emery joined #nim |
16:27:34 | * | neurocyte8614492 joined #nim |
16:33:40 | * | kenran joined #nim |
16:33:50 | * | kenran quit (Client Quit) |
16:47:06 | * | rockcavera joined #nim |
16:47:06 | * | rockcavera quit (Changing host) |
16:47:06 | * | rockcavera joined #nim |
16:52:58 | * | duuude joined #nim |
16:54:05 | PMunch | Hmm, bit annoying that an enum used in a case statement can still get ambiguous errors.. |
17:04:19 | FromDiscord | <Solitude> and with experminetal: enumOverloading? |
17:06:07 | FromDiscord | <enthus1ast> it seems like somehow calling dll functions like to crash |
17:07:11 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/967471710767054848/image.png |
17:08:43 | FromDiscord | <enthus1ast> could it be an issue that my proc types are {.stdcall.}, but my dll procs actually are normal nimcall? |
17:08:59 | FromDiscord | <enthus1ast> it works 30-40 times, then it crashes |
17:09:01 | FromDiscord | <Solitude> In reply to @enthus1ast "image.png": tried with arc? |
17:09:06 | FromDiscord | <enthus1ast> orc |
17:09:11 | FromDiscord | <enthus1ast> crashes with both |
17:09:18 | FromDiscord | <enthus1ast> orc and old gc |
17:10:20 | NimEventer | New post on r/nim by icey: Up to date AWS SDK?, see https://reddit.com/r/nim/comments/uaa0ym/up_to_date_aws_sdk/ |
17:10:40 | FromDiscord | <enthus1ast> its interesting, i have the same issue in another project that also uses dlls |
17:12:44 | FromDiscord | <enthus1ast> i'm starting to belive that this is a nim bug |
17:14:46 | FromDiscord | <enthus1ast> I'm passing a ref object to the procs in the dll |
17:14:56 | FromDiscord | <enthus1ast> but this should be supported or? |
17:15:28 | * | duuude quit (Ping timeout: 250 seconds) |
17:30:33 | FromDiscord | <enthus1ast> ok when i give a "ptr ref Object" then it at least do not crash |
17:30:44 | FromDiscord | <enthus1ast> but i do not use the ref Object much yet |
17:31:15 | FromDiscord | <Rika> Pointer to a reference, pretty cursed Iâd say |
17:32:23 | FromDiscord | <enthus1ast> sure, but any better idea? |
17:34:28 | FromDiscord | <Rika> If it worked before then itâs a bug no? |
17:35:19 | FromDiscord | <enthus1ast> it did not work, i just finished a simple module system, and as soon i implemented stuff in the module, it started to crash |
17:35:38 | FromDiscord | <Rika> Your calling conventions must match |
17:35:41 | FromDiscord | <Rika> Do they not? |
17:35:47 | FromDiscord | <enthus1ast> now they do |
17:36:03 | FromDiscord | <Rika> How do we even start to debug this |
17:36:17 | FromDiscord | <Rika> oh it might be related to A/ORC perhaps? |
17:36:47 | FromDiscord | <enthus1ast> i think i must first try to reproduce it in a small repo |
17:58:00 | * | duuude joined #nim |
18:42:08 | * | rockcavera quit (Remote host closed the connection) |
18:53:19 | * | duuude quit (Ping timeout: 240 seconds) |
18:57:33 | FromDiscord | <-|-> I successfully compiled "Hello World" in Nim for 16-bit MS-DOS, using the OpenWatcom compiler. I can do a write-up, but the process is really quite terrible. |
19:01:28 | PMunch | -|-, really? That sounds amazing! |
19:02:59 | FromDiscord | <-|-> It was a painful process that required a modified nimbase.h. The resulting binary is rather large at about 72K, but overall this project was an interesting way to spend a few hours. |
19:10:31 | PMunch | Is 72K with -d:danger and stripping? |
19:13:18 | FromDiscord | <dom96> definitely do a write up, sounds cool! |
19:13:31 | FromDiscord | <dom96> if you could upstream the nimbase.h mods that would be cool too |
19:14:31 | PMunch | Man building Nim on an old Raspberry Pi takes forever :P |
19:23:07 | FromDiscord | <-|-> In reply to @PMunch "Is 72K with -d:danger": Oh, I haven't tried -d:danger. Stripping is done, but I didn't compile with `owcc -Os`. |
19:24:01 | PMunch | Nim will by default include a bunch of debug information and checks. With -d:release or -d:danger it gets stripped out. This impacts binary size a lot! |
19:26:48 | PMunch | Nim with -d:release --opt:size and then strip -s on a `echo "Hello world"` program on my machine goes from 110k to 35k |
19:30:12 | FromDiscord | <-|-> I'ma make sure to test that. |
19:30:25 | FromDiscord | <-|-> and make my patches to nimbase.h a little less hacky first |
19:33:44 | FromDiscord | <-|-> Also, OpenWatcom seems to hate multiple dots in file names (even on non DOS/Windows) platforms. I'm not quite sure why. |
19:34:03 | PMunch | What kind of changes did you have to make? |
19:34:13 | PMunch | Like my.file.nim? |
19:36:55 | FromDiscord | <-|-> For the file names issue, I had to snag the `.nim.c` files and rename them to `_nim.c`. I also had to remove any `@` from the file names, as that caused a snag. |
19:37:05 | FromDiscord | <-|-> After that, the linking stage was able to finish successfully |
19:37:21 | FromDiscord | <Yardanico> does memory allocation work? :P |
19:37:34 | FromDiscord | <-|-> I haven't tested |
19:38:06 | FromDiscord | <-|-> Presumably it does. I enabled `-d:useMalloc` and the arc reference counter. |
19:38:13 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/o1j |
19:38:38 | FromDiscord | <-|-> I did hit a little snag with the pointer size, since DOS has 16-bit pointers (except for those cursed far ones), and that's smaller than NI. |
19:38:49 | FromDiscord | <-|-> I targeted the i386 CPU since there's no i086... |
19:38:57 | FromDiscord | <Yardanico> heh |
19:39:55 | FromDiscord | <-|-> This is all a terrible ideaâąïž, but on the other hand, we could build programs for the 8086. |
19:40:09 | FromDiscord | <-|-> The resulting binaries run fine in an 8086 (only 8086 instructions) emulator |
19:40:34 | PMunch | I mean that alone is worth an article |
19:40:50 | PMunch | Nim truly is a language you can get to run anywhere! :P |
20:02:03 | * | Zectbumo joined #nim |
20:37:42 | * | jmdaemon joined #nim |
20:44:52 | FromDiscord | <-|-> I hope nobody objects to me adding an i086 CPU target |
20:45:29 | FromDiscord | <Knedlik> Lol |
20:46:15 | FromDiscord | <Knedlik> Donât look at my discord tag |
20:47:49 | FromDiscord | <Knedlik> Also, how do I continuously dump the debug stream into a file? |
20:48:10 | PMunch | What do you mean "the debug stream"? |
20:48:21 | FromDiscord | <-|-> stderr? |
20:48:21 | PMunch | ./myprogram > my.log |
20:48:52 | FromDiscord | <Knedlik> What? By the debug stream I mean the windows debug stream SDL uses for logs |
20:50:13 | FromDiscord | <Elegantbeef> Redirect your stderr to a file should work afaik |
20:50:51 | FromDiscord | <-|-> `(program and arguments here) 2>debug.log` |
20:50:57 | FromDiscord | <Elegantbeef> I think you can do `stderr = aFileHandleToYourErrorFile` |
20:51:10 | FromDiscord | <Elegantbeef> Does that piping even work with winblows? |
20:53:22 | FromDiscord | <Knedlik> aFileHandle? |
20:53:38 | FromDiscord | <Elegantbeef> Yes |
20:53:45 | FromDiscord | <Knedlik> I see it⊠hmmm |
20:55:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3W3q |
20:55:27 | FromDiscord | <Elegantbeef> For instance on redirecting the stdout |
20:55:33 | FromDiscord | <Elegantbeef> The same works for stderr afaik |
21:03:38 | FromDiscord | <Knedlik> Hmmm, the open command doesnât create the file |
21:04:34 | FromDiscord | <Elegantbeef> I tested it before hand it certainly does |
21:04:57 | FromDiscord | <Knedlik> Where did it put the file? |
21:05:09 | nrds | <Prestige99> Elegantbeef how can I avoid this variable name conflict issue in https://play.nim-lang.org/#ix=3W3t ? |
21:05:17 | FromDiscord | <Elegantbeef> In the CWD |
21:05:32 | FromDiscord | <Knedlik> CWD? |
21:05:37 | nrds | <Prestige99> ah, `this` |
21:05:41 | FromDiscord | <Elegantbeef> change the template parameter |
21:05:53 | nrds | <Prestige99> grave markers fixed it |
21:05:57 | FromDiscord | <Elegantbeef> current working directory |
21:06:26 | FromDiscord | <Elegantbeef> Also perhaps stop pretending it's C# đ |
21:09:59 | FromDiscord | <Knedlik> So on stdout = logFile I got lvalue required as left operand |
21:10:34 | FromDiscord | <Elegantbeef> I really like the code you've supplied it makes it very clear what the issue is |
21:12:51 | FromDiscord | <Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3W3u |
21:13:30 | FromDiscord | <Elegantbeef> Perhaps you cannot redirect stderr |
21:14:02 | FromDiscord | <Knedlik> Got the same with stdout |
21:14:28 | FromDiscord | <Elegantbeef> Ah windows |
21:14:29 | FromDiscord | <Elegantbeef> Fun |
21:14:45 | FromDiscord | <Elegantbeef> Yea i get the same issue with mingw |
21:15:44 | FromDiscord | <Knedlik> Perhaps I can just instruct people to launch from command line (or create a script for that) when I need to solve a bug |
21:22:01 | * | Gustavo6046 joined #nim |
21:26:59 | FromDiscord | <-|-> I'm going to have to submit a patch to OpenWatcom to fix `@` in file names, but adding 8086/MS-DOS and owcc support to Nim is going well. |
21:29:45 | * | neurocyte8614492 quit (Ping timeout: 272 seconds) |
21:29:50 | FromDiscord | <-|-> `-d:danger` gets a hello world down to 12k, which I say is good enough |
21:31:50 | FromDiscord | <Knedlik> Iâm for some reason continuously failing to route streams to a file⊠|
21:32:14 | FromDiscord | <Elegantbeef> Blame windows |
21:32:18 | FromDiscord | <Knedlik> Is it even possible through a batch script? |
21:32:31 | FromDiscord | <-|-> This is just usual SDL_Log, right? |
21:33:06 | FromDiscord | <Knedlik> SDL-made logCritical |
21:33:25 | FromDiscord | <Knedlik> Atleast the messages I make |
21:36:40 | FromDiscord | <Knedlik> Like the file gets created, but it doesnât get routed there for some reason |
22:17:53 | FromDiscord | <jmgomez> is there a helper to remove the null terminator in a cstring? |
22:18:29 | FromDiscord | <Elegantbeef> I'm just looking at that question going "what" |
22:19:03 | FromDiscord | <Elegantbeef> A cstring doesnt store length so "removing the null terminator" would be..... what making the cstring infinite size? |
22:19:46 | PMunch | @Elegantbeef, well it wouldn't be infinite, just arbitrary. There's bound to be a null in memory somewhere |
22:20:10 | FromDiscord | <Elegantbeef> Nah cause that means you didnt remove the null terminator |
22:20:19 | FromDiscord | <Elegantbeef> You iterate from the stack removing all `\0` until you're done! |
22:20:26 | FromDiscord | <jmgomez> thing is it's getting in the way, unreal has a FName system where strings (their implementation of string) is store in a table and indexed. So if I build a string from a nim c_string they identify it as another string with the same "value" |
22:20:59 | FromDiscord | <jmgomez> so when calling function via their reflection system it cant find it due to it being in the midle |
22:21:04 | FromDiscord | <jmgomez> (edit) "midle" => "middle" |
22:21:45 | FromDiscord | <Elegantbeef> Is there any way to get it from cstring? |
22:21:51 | FromDiscord | <Elegantbeef> Cause what you're asking doesnt make sense |
22:23:27 | FromDiscord | <jmgomez> Im asking if you can access to it from nim's cstring so I can remove it and convert it to a FString before going to the FName |
22:24:11 | FromDiscord | <Elegantbeef> I mean just do `$myCstring` and you now have a pascal string copy |
22:24:25 | FromDiscord | <Elegantbeef> I dont see how removing it changes anything |
22:24:49 | FromDiscord | <Elegantbeef> If you have a cstring and need an FString you need to just convert it |
22:25:12 | FromDiscord | <Elegantbeef> That conversion is on you afaict and not something UE supplies |
22:26:40 | FromDiscord | <Elegantbeef> What's the layout of fstring? |
22:28:47 | FromDiscord | <jmgomez> I have bind the constructor where it's supposedly takes a FString(cstring) will see if can get it by binding something else, it was just frustrating that was finding the bug somewhere else and found that the actual function was a null pointer due to that \0 |
22:29:40 | FromDiscord | <Elegantbeef> I mean that `\0` is required for anything that operates on a cstring, so removing it is just going to ruin your day |
22:30:01 | FromDiscord | <Elegantbeef> It's odd that they dont take pascal strings anywhere |
22:30:01 | FromDiscord | <jmgomez> It wouldnt in this particular case but I understand what you are saying |
22:30:14 | FromDiscord | <Elegantbeef> How wouldnt it ruin your day? |
22:30:43 | FromDiscord | <Elegantbeef> Dropping the `\0` means the function that takes just a cstring has 0 clue where it terminates |
22:30:44 | FromDiscord | <jmgomez> because it would match to their FString value |
22:31:00 | FromDiscord | <Elegantbeef> It already does |
22:31:34 | FromDiscord | <jmgomez> apparently not because it cant find the name in the table but when doing it in cpp directly it does |
22:31:43 | FromDiscord | <Elegantbeef> Can i see the code? |
22:31:59 | FromDiscord | <Elegantbeef> You're using a cstring in the C++? |
22:32:17 | FromDiscord | <jmgomez> sure but there are a lot of things going on, whatever Cpp uses a literal |
22:33:00 | FromDiscord | <Elegantbeef> So if C++ uses a string literal and you use a cstring literal in nim there is no difference |
22:33:03 | FromDiscord | <Elegantbeef> The issue is elsewhere |
22:34:37 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3W3D |
22:34:56 | FromDiscord | <Elegantbeef> `makeFString` takes a `cstring` correct? |
22:35:01 | FromDiscord | <jmgomez> yes |
22:35:17 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3W3E |
22:35:28 | PMunch | Hmm, I'm working on a system to automatically generate routes from a route specification and converter procedures. Essentially I take a procedure like `proc getPost(user: User, post: Post): string` it will look for a procedure which takes a Request and returns a User, and one which takes a Request or a Request and a User and returns a Post. |
22:35:35 | PMunch | I have that part working well now |
22:35:55 | PMunch | But now I want to create a nice system to define these |
22:36:12 | FromDiscord | <Elegantbeef> Where in your C++ side do you make the FString? |
22:36:44 | FromDiscord | <jmgomez> it is just like FString("string here") |
22:37:05 | PMunch | I'm thinking of just grabbing the Jester DSL, `router myName: get "/user/$id/posts/$post": getPost` can anything think of a better one? |
22:37:06 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3W3F |
22:37:08 | FromDiscord | <Elegantbeef> Ok so then it's identical |
22:37:48 | FromDiscord | <jmgomez> you think? So maybe it's me. Tomorrow I will pick the problem again |
22:38:09 | PMunch | I guess I could have a pragma so the proc would be `proc getPost(user: User, post: Post): string {.routeGet: "/user/$id/posts/$post".}` |
22:38:17 | FromDiscord | <Elegantbeef> Short of `(get, "/user/$id/posts/$post", getPos)` not really pmunch đ |
22:38:39 | PMunch | Hmm, you want them as tuples? |
22:38:52 | FromDiscord | <Elegantbeef> Thought you were already doing the annotation |
22:39:13 | PMunch | Huh? |
22:39:45 | FromDiscord | <Elegantbeef> Thought you already were doing the pragma annotation |
22:39:58 | PMunch | Oh, I do it for the converters |
22:41:03 | PMunch | Currently my testing code looks like this: http://ix.io/3W3G |
22:42:02 | PMunch | And I've just been calling my test macro as `autoroute("/user/$id/post/$pid", getTest)` :P |
22:42:04 | FromDiscord | <Elegantbeef> What's the point of the annotation here? |
22:42:13 | PMunch | routeConverter? |
22:42:21 | FromDiscord | <Elegantbeef> Yea |
22:42:55 | PMunch | It registers the procedure as one which can be used to convert things from requests to the requested type |
22:43:15 | PMunch | You can't get all procedures in Nim unfortunately :( |
22:43:44 | FromDiscord | <Elegantbeef> Cant you just use procedure dispatch? |
22:43:45 | FromDiscord | <Elegantbeef> Or am i missing something |
22:43:55 | PMunch | Procedure dispatch? |
22:44:13 | PMunch | The problem is I don't know the name of those procedures |
22:44:15 | FromDiscord | <Elegantbeef> Yea cant you just import this file and have it reason what you need |
22:44:40 | FromDiscord | <Elegantbeef> Who cares |
22:44:56 | PMunch | How would I generate a call to a procedure I don't know the name of? |
22:45:39 | FromDiscord | <Elegantbeef> You use a more generic `get(T: typedesc[User], req: Request): T` |
22:45:53 | FromDiscord | <Elegantbeef> Then you dont need the names you just need the exported procedure in scope |
22:46:08 | PMunch | I thought about that |
22:46:19 | FromDiscord | <Elegantbeef> replace `get` with a more reasonable named procedure for your solution |
22:46:34 | PMunch | I thoughts about that |
22:46:46 | FromDiscord | <Elegantbeef> You thoughtseded about that |
22:47:13 | PMunch | It's late and I'm drinking gin and tonic, give me a break :P |
22:47:44 | FromDiscord | <Elegantbeef> But yea i think using Nim's dispatch is a more reasonable solution |
22:47:53 | PMunch | But yeah, I thought about that, but I had some trouble with it |
22:48:16 | FromDiscord | <Elegantbeef> Like what? |
22:48:46 | FromDiscord | <Elegantbeef> I'm guessing calling the specific get? |
22:50:34 | PMunch | I don't remember.. |
22:50:39 | PMunch | Hmm, let me try it again |
22:51:17 | FromDiscord | <Elegantbeef> See kids drugs are bad no matter if they come from a bottle or a rolle |
22:51:41 | PMunch | One benefit of the "register the procs you want" approach is I could technically have a procedure that isn't actually written for this purpose and insert that into the logic |
22:52:22 | FromDiscord | <Elegantbeef> I mean you have to annotate it anyway |
22:52:27 | FromDiscord | <Elegantbeef> So that's like as much work as making an alias to it |
22:52:31 | PMunch | Besides, I will have to generate all different combinations of previous arguments in `when compiles` statements to pick the correct one |
22:52:46 | FromDiscord | <Elegantbeef> No you dont |
22:53:17 | PMunch | Well it doesn't have to be done through a pragma, I was planning on having a `registerConverter` procedure as well |
22:53:22 | FromDiscord | <Elegantbeef> Type all the parameters and convert the name to the write procedure and invoke it |
22:53:27 | PMunch | Which just took a bunch of names and registered all of them |
22:54:04 | PMunch | Not quite sure what you mean |
22:54:10 | FromDiscord | <Elegantbeef> Atleast i think this can be statically reasoned |
22:54:20 | FromDiscord | <Elegantbeef> Give an example of the types/procedures if you dont mind |
22:54:54 | FromDiscord | <Elegantbeef> Like i see your previous example but i dont get how it's dispatched |
22:55:50 | PMunch | Ah, the dispatch is basically "pick the procedure which returns the type I want and takes as many arguments of types I have already parsed as possible" |
22:56:48 | FromDiscord | <Elegantbeef> Ok so then you can just use the nim proc conversion dispatch where you do `(proc(r: RetType, argA: ArgAType, argB: ArgBType): RetType)(get)(argA, argB)` no? |
22:57:22 | PMunch | Oh sure |
22:57:32 | PMunch | But for that I need to know the arguments |
22:58:20 | PMunch | Let's say I can get a post through `/post/$postId` |
22:58:30 | PMunch | That would return the latest version of the post |
23:01:12 | PMunch | And then I could have another route to e.g. `put /post/$postId`, for that you need an authenticated user. So I have a converter which takes a Request and returns an AuthenticatedUser (probably by checking for a session cookie), and then a procedure which takes a Request and an AuthenticatedUser and returns a Post which can be modified (or something like that) |
23:01:48 | PMunch | Hmm, it's kinda hard to explain.. |
23:01:58 | PMunch | Maybe I don't need that feature |
23:02:14 | PMunch | Okay, scratch that |
23:02:22 | FromDiscord | <Elegantbeef> The way i see it you could do `AuthenticatedUser(put /post/$postId)` |
23:02:59 | FromDiscord | <Elegantbeef> The macro then expands it calling a converter to `AuthenticatedUser` then calling `AuthenticatedUser.get(postId)` |
23:03:04 | FromDiscord | <Elegantbeef> Or whatever it should do |
23:03:14 | PMunch | You have a route which needs a User, a Post, and an Edit for example |
23:03:31 | PMunch | User needs the Request to get the session |
23:03:59 | FromDiscord | <Elegantbeef> The url looks like what? |
23:04:00 | PMunch | Post needs the Request and the User to get the post ID and check that it is editable by the user |
23:04:44 | PMunch | Now Edit takes a Post and a Request and checks that the payload in the request is valid for the post you want to edit |
23:06:05 | FromDiscord | <Elegantbeef> And the url is the same? |
23:06:22 | PMunch | So you have `get(_: typedesc[User], r: Request): User`, `get(_: typedesc[Post], u: User, r: Request)`, and `get(_: typedesc[Edit], p: Post, r: Request)` |
23:06:54 | PMunch | The route is `put "/post/$id"` with a JSON payload body |
23:07:35 | PMunch | And the procedure call is `proc editPost(p: Post, e: Edit)` |
23:07:59 | PMunch | And does some database stuff to update the post with whatever fields are present in the Edit |
23:08:05 | FromDiscord | <Elegantbeef> Ok i see the issue |
23:08:28 | FromDiscord | <Elegantbeef> The URL alone cannot hold the logic and there is no nice way to explictly state what's required |
23:08:35 | PMunch | Exactly |
23:08:38 | FromDiscord | <Elegantbeef> Though i'd argue that's why it should be explicit |
23:08:51 | PMunch | How would you make it explicit? |
23:09:35 | FromDiscord | <Elegantbeef> I dont think you can really do it easily |
23:10:06 | FromDiscord | <Elegantbeef> Like you cannot really say "This requires X, Y, Z and call get(X), get(X, Y), get(Y, Z)\` |
23:10:28 | PMunch | Exactly, that would void the entire concept :P |
23:10:55 | FromDiscord | <Elegantbeef> Well I mean your concept was static typed, dyanmic dispatch isnt statically typed đ |
23:11:10 | PMunch | Well it is still static dispatch |
23:11:22 | FromDiscord | <Elegantbeef> Is it really |
23:11:28 | PMunch | One route will always call the same procedures |
23:11:57 | FromDiscord | <Elegantbeef> How do you even plan on annotating the requirements of a route |
23:12:01 | FromDiscord | <Elegantbeef> Or is it all inferred? |
23:12:20 | PMunch | Requirements? |
23:13:39 | PMunch | The types required for a route is read from the signature of the procedure you link to the route |
23:15:28 | PMunch | The stuff required to parse the types isn't defined anywhere, that is all up to the converter procs |
23:20:31 | FromDiscord | <Elegantbeef> Ah ok so it's the same thing as the `get` just dispatch is done slightly differently |
23:22:48 | PMunch | Well the dispatch is done based on which types are in the signature |
23:23:13 | FromDiscord | <Elegantbeef> I mean it's the same thing as my suggestion just with manual annotations and not using `when` blocks |
23:23:24 | PMunch | Sure |
23:23:40 | PMunch | But those when blocks would be annoying to generate |
23:24:18 | FromDiscord | <Elegantbeef> Worse than the typechecking macro logic? |
23:24:33 | PMunch | Because every getter can take either just a request, or any combination of arguments in the route procedure |
23:24:46 | PMunch | The above example of editPost for example |
23:24:59 | FromDiscord | <Elegantbeef> Dont you have to do the exact same thing but for parameter comparisons? |
23:25:07 | PMunch | Not quite |
23:25:34 | PMunch | I have a set of `availableTypes` which are the types I've already seen, and the stuff they can convert to |
23:25:46 | PMunch | It starts out with only Request |
23:26:13 | PMunch | And anything that only takes a request as an argument |
23:26:41 | PMunch | So in the above example the initial set of availableTypes would be Request and User (because User only takes a Request as an argument) |
23:27:07 | FromDiscord | <Elegantbeef> I mean it's still "make all the permutations of parameters" đ |
23:27:22 | PMunch | Then when in encounters Post it finds the (Request, User) -> Post procedure and now the set is `Request, User, Post` |
23:27:55 | PMunch | Sure, but I don't have to generate a bunch of `when compiles` for every combination of arguments |
23:28:00 | FromDiscord | <ajusa> I haven't followed the whole conversation here, but aren't converters limited to doing one conversion at once? Like you can't sequence multiple at a time |
23:28:12 | PMunch | @ajusa, yes, normal Nim converts are |
23:28:20 | FromDiscord | <Elegantbeef> We're not talking about converters converters |
23:28:21 | PMunch | But this is a custom system |
23:28:32 | PMunch | I really need to find a better name for them.. |
23:28:59 | FromDiscord | <Elegantbeef> You dont even need the `compiles` assuming a `get` is in scope you can just do `(proc(...))(get) != nil` đ |
23:29:42 | PMunch | Ooh, that's true |
23:29:52 | PMunch | But I still need to build all the different arguments |
23:30:15 | PMunch | With the current system it's just `if myType in availableTypes` |
23:30:37 | FromDiscord | <Elegantbeef> Again you still have to do the permutations though |
23:30:58 | PMunch | Not really |
23:31:18 | FromDiscord | <Elegantbeef> `proc getThing(a: User, p: Post)` and `getThing(p: Post, u: User)` is both valid |
23:31:30 | PMunch | Ah, no |
23:31:42 | PMunch | You must specify the arguments in order |
23:31:55 | PMunch | Wait, was that a route or a converter? |
23:32:02 | FromDiscord | <Elegantbeef> Converter |
23:32:09 | PMunch | Oh, yeah that works |
23:32:56 | PMunch | availableTypes is a table of types to converter procs, and when I look one up I will know all the available procedures it has (because I have them all pre-registered) |
23:33:44 | FromDiscord | <Elegantbeef> Yea i got that, point is you still need to do the same application of logic just slightly differently. But anyway just disregard me |
23:34:57 | PMunch | Oh yeah, the logic is similar |
23:44:22 | * | Guest32 quit (Quit: Client closed) |
23:46:01 | PMunch | With `(proc(...))(get) != nil`, is this still static dispatch? |
23:56:50 | PMunch | Hmm, there is nothing really related to routes here.. |
23:56:57 | PMunch | I could make it even more generic |
23:58:00 | PMunch | So you attach a pragma to your "routables" and then it generates a procedure to call it with only the base type. |