00:56:09 | fn | <ForumUpdaterBot99> New thread by Stu002: Need confirmation this code causes a `SIGSEGV: Illegal storage access`, see https://forum.nim-lang.org/t/8260 |
01:20:35 | FromDiscord | <creonico> Hey, Sorry for asking so many questions(and probably stupid ones). In C, I have this `if(queue_family_properties[i].queueFlags & (enum VkQueueFlagBits)1){` and in Nim this `if queue_family_property.queueFlags and cast[VkQueueFlagBits](1):`, but I get `type mismatch: got <VkQueueFlags, VkQueueFlagBits>`. So my question is, do I need to overload `and` for this to work? |
01:21:33 | FromDiscord | <ElegantBeef> What vulkan bindings are you using? |
01:21:41 | * | arkurious quit (Quit: Leaving) |
01:24:14 | FromDiscord | <creonico> https://github.com/nimgl/vulkan |
01:24:15 | fn | <R2D299> itHub: 7"Vulkan bindings for Nim" |
01:25:21 | FromDiscord | <ElegantBeef> Ok so what you should be able to do is `queueFlags.uint32 and 1u32` |
01:25:40 | FromDiscord | <creonico> Thats what I though I would need |
01:25:51 | FromDiscord | <creonico> But why won't it work like iin C |
01:25:59 | FromDiscord | <creonico> (edit) "iin" => "in" |
01:26:03 | FromDiscord | <ElegantBeef> Cause there is no and operator for enums |
01:26:16 | FromDiscord | <creonico> oh |
01:26:46 | FromDiscord | <checkersai> you could overload the operator for that enum type |
01:26:51 | FromDiscord | <ElegantBeef> well more accurately no and operator for `type(queueFlags), VkQueueFlagBits` |
01:27:12 | FromDiscord | <ElegantBeef> Yea that's a solution |
01:27:27 | FromDiscord | <ElegantBeef> Personally i try to holeless enums as much as possible |
01:27:43 | FromDiscord | <ElegantBeef> Might be a bit of an overhead but makes life easier imo |
01:28:39 | FromDiscord | <checkersai> holeless? |
01:29:00 | FromDiscord | <ElegantBeef> Enum's without any gaps inbetween values that can be used in an array or a bitset safely |
01:30:13 | FromDiscord | <checkersai> ah yeah makes perfect sense |
01:30:34 | FromDiscord | <checkersai> personally I'd probably just use a bitfield and consts |
01:30:36 | FromDiscord | <creonico> In reply to @ElegantBeef "Enum's without any gaps": How make? |
01:30:56 | FromDiscord | <creonico> I never heard that concept |
01:30:59 | FromDiscord | <checkersai> (edit) "bitfield" => "bitset" |
01:31:35 | FromDiscord | <ElegantBeef> Well i'm probably one of the few that's odd enough to do it ๐ |
01:32:05 | FromDiscord | <ElegantBeef> He's my example with assimp i did today https://github.com/beef331/nimassimp/blob/master/src/assimp.nim#L232-L290 |
01:32:46 | FromDiscord | <ElegantBeef> Which is a replacement for https://github.com/awr1/nimassimp/blob/master/assimp.nim#L235-L276 |
01:33:22 | FromDiscord | <ElegantBeef> there is an overhead of going from the bitset to the original int ofc, but i'm a silly bastard |
01:33:50 | FromDiscord | <ElegantBeef> I did a similar thing for SDL2 |
01:34:33 | FromDiscord | <checkersai> What is assimp lol |
01:35:06 | FromDiscord | <checkersai> is it as-simp like "as a simp, I ..." or ass-imp like "an imp's ass" |
01:35:09 | FromDiscord | <ElegantBeef> An asset importing library |
01:35:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> obviously |
01:36:15 | FromDiscord | <@bracketmaster-5a708063d73408ce4> jk - I didn't know what assimp meant at all either |
01:36:49 | FromDiscord | <ElegantBeef> For context i wrote a macro to convert the sdl2 keycode enum to a holeless one and emit a converter to the new version for the sdl poll event logic, which outputs https://play.nim-lang.org/#ix=3tLS |
01:37:17 | FromDiscord | <ElegantBeef> I do silly shit all the time, only worthwhile to copy me if you like it ๐ |
01:49:49 | FromDiscord | <checkersai> I'll tackle inputs if my software renderer ends up fast enough to be able to make a game out of it |
01:53:04 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Shouldn't static in the macro work here? https://play.nim-lang.org/#ix=3tMa |
01:53:33 | FromDiscord | <Elegantbeef> No `let` is a runtime value |
01:53:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh |
01:53:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> How do I get around that? |
01:53:51 | FromDiscord | <Elegantbeef> `const` |
02:04:09 | * | aeverr quit (Ping timeout: 265 seconds) |
02:11:57 | * | rockcavera joined #nim |
02:11:57 | * | rockcavera quit (Changing host) |
02:11:57 | * | rockcavera joined #nim |
02:16:05 | FromDiscord | <checkersai> Is it worth compiling with -d:danger instead of -d:release? |
02:16:19 | FromDiscord | <Rika> Your call |
02:16:27 | FromDiscord | <Rika> You lose runtime checks that way |
02:16:32 | FromDiscord | <Elegantbeef> If you want speed |
02:16:50 | FromDiscord | <Elegantbeef> It's a lot like "is it worth going down hill on a bicycle without a helmet" |
02:17:05 | FromDiscord | <Rika> Donโt out me like that beef what the hell |
02:17:26 | FromDiscord | <Elegantbeef> Rika doesnt wear protection confirmed |
02:17:48 | FromDiscord | <Rika> I like doing it without, feels much better |
02:17:51 | FromDiscord | <Rika> Feels open |
02:18:04 | FromDiscord | <Elegantbeef> The wind in your hair eh? |
02:19:20 | FromDiscord | <Rika> Yeah especially with the length of it |
02:19:29 | FromDiscord | <Rika> My hairโs very long |
02:22:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> COVID hair? |
02:22:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> also - templates don't seem to like `consts` |
02:22:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> https://play.nim-lang.org/#ix=3tMo |
02:22:58 | FromDiscord | <Elegantbeef> If your covid has hair it's not covid, but mould |
02:23:23 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well - during covid - it was hard to find brave barbers for some |
02:23:28 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so they just didn't cut their hair |
02:23:51 | FromDiscord | <Elegantbeef> I'm not stupid i make jokes |
02:24:02 | FromDiscord | <@bracketmaster-5a708063d73408ce4> where I live though, many people pretended like covid wasn't a thing |
02:24:04 | FromDiscord | <Rika> No more of โI was planning on growing it out and COVID hit so I had an actual excuse nowโ |
02:24:20 | FromDiscord | <Elegantbeef> So consts dont seem to support tuple unpacking? |
02:24:30 | FromDiscord | <@bracketmaster-5a708063d73408ce4> they do, just not in templates |
02:24:37 | FromDiscord | <Rika> Why? |
02:24:44 | FromDiscord | <Rika> I mean the template part |
02:24:45 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i have no idea |
02:24:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so I've been doing some really weird AST manipulations in Nim |
02:25:10 | FromDiscord | <@bracketmaster-5a708063d73408ce4> And let me tell you, nim macros have some really dark corners |
02:25:13 | FromDiscord | <@bracketmaster-5a708063d73408ce4> where things just break |
02:25:22 | FromDiscord | <Rika> Yes |
02:25:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> maybe nim should learn from lisp |
02:25:45 | FromDiscord | <@bracketmaster-5a708063d73408ce4> lisp is know for being a little more robust in the AST department |
02:26:36 | FromDiscord | <Rika> I believe that lisp is a bit too different in terms of AST to learn from? |
02:28:26 | FromDiscord | <Elegantbeef> This seems like a simple fix, but we'll see |
02:33:20 | FromDiscord | <Elegantbeef> Doesnt seem like there is an existing issue related to this |
02:33:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh? |
02:33:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> huh... |
02:33:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> maybe is a feature? |
02:33:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> it -\> its |
02:34:17 | FromDiscord | <Elegantbeef> Well it's useless code presently |
02:34:29 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i actually make good use of that |
02:34:31 | FromDiscord | <Elegantbeef> Since those cannot be accessed outside the template ๐ |
02:34:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i'm currently writing a hardware virtual machine |
02:35:28 | FromDiscord | <@bracketmaster-5a708063d73408ce4> its a virtual machine where you can instantiate adders, subtractors, multipliers, nand gates, or gates, etc. |
02:35:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> and connect them up and simulate |
02:35:55 | FromDiscord | <Elegantbeef> Anywho i'm looking fixing it, though idk if i can |
02:36:04 | FromDiscord | <@bracketmaster-5a708063d73408ce4> a higher level RTL would emit hardware VM code which is valid nim |
02:36:29 | FromDiscord | <@bracketmaster-5a708063d73408ce4> the reason I use so many macros is I require the all the connections to be frozen by runtime |
02:36:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> which means I need to traverse and build parts of the netlist during compiletime |
02:37:21 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I say this to justify me using const - in that weird way |
02:37:42 | FromDiscord | <Elegantbeef> Yea yea i get it |
02:38:44 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh? |
02:38:47 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ok cool |
02:38:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm glad I don't have to explain more |
02:39:31 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Although I do provide a higher level overview here\: https://yehowshuaimmanuel.com/posts/polish_new_rtl/ |
02:43:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> actually it seems it works if you don't use tuples |
02:43:27 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sent a long message, see http://ix.io/3tMA |
02:44:05 | FromDiscord | <Elegantbeef> Yea i'm looking at the compiler and i see why it fails, now to just fix it \:P |
02:44:31 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sounds very advanced |
02:45:06 | FromDiscord | <@bracketmaster-5a708063d73408ce4> One of my friends works at Google and he knows a compiler engineer there that gets paid 1M/yr. |
02:45:11 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Maybe you should work at Google |
02:45:15 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Probably won't be on nim |
02:45:21 | FromDiscord | <Elegantbeef> I'm not a compiler dev though |
02:45:43 | FromDiscord | <Elegantbeef> I just like fixing issues if I can |
02:45:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that's how it starts |
02:52:18 | FromDiscord | <Elegantbeef> ehh |
02:52:18 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/867962298503933972/image.png |
03:03:01 | FromDiscord | <Jakraes> Does anyone have a tutorial for the net library? |
03:03:27 | FromDiscord | <Jakraes> Kinda struggling here trying to find out how to do certain things |
03:06:01 | FromDiscord | <Elegantbeef> What's the problem? |
03:07:14 | FromDiscord | <Jakraes> I'm trying to make a client send info over TCP to a server and then make the server send an updated version of the info back to the client |
03:08:34 | FromDiscord | <Jakraes> I get that you can use trySend() in the client, but how could I read that message in the server? |
03:09:40 | FromDiscord | <Elegantbeef> one of the recv functions if i get the question |
03:10:04 | FromDiscord | <Jakraes> Gotcha, I'll see if it works |
03:10:09 | FromDiscord | <Jakraes> Thank you in advance! |
03:30:46 | FromDiscord | <Bung> @treeform do you have todo list of fidget? I might contribute some code |
03:33:58 | FromDiscord | <Elegantbeef> Well bracketmaster watch this PR for me, thanks ๐ https://github.com/nim-lang/Nim/pull/18562 |
03:34:50 | FromDiscord | <Elegantbeef> Back to opengl |
03:39:35 | FromDiscord | <Bung> nice catch |
03:40:01 | FromDiscord | <treeform> In reply to @Bung "<@!107140179025735680> do you have": Sorry, I am currently working on Fidget 2 and I am not looking for help. |
03:40:58 | FromDiscord | <Bung> okay |
03:51:34 | FromDiscord | <demotomohiro> @Jakraes This is Nim's asyncnet tutorial: https://xmonader.github.io/nimdays/day15_tcprouter.html |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:39 | * | supakeen joined #nim |
05:03:52 | FromDiscord | <i_right_i> How do you 'echo i' and i be printed in hexadecimal? |
05:05:04 | FromDiscord | <ElegantBeef> !eval import std/strutils; echo 100.toHex |
05:05:08 | NimBot | 0000000000000064 |
05:05:25 | FromDiscord | <i_right_i> okay thanks |
05:16:05 | FromDiscord | <Rika> In reply to @NimBot "0000000000000064": Strange representation |
05:28:50 | * | tiorock joined #nim |
05:28:50 | * | tiorock quit (Changing host) |
05:28:50 | * | tiorock joined #nim |
05:28:50 | * | rockcavera is now known as Guest5036 |
05:28:50 | * | Guest5036 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
05:28:50 | * | tiorock is now known as rockcavera |
05:30:19 | FromDiscord | <Jakraes> How can I turn an int into a string? I can't find it in the documentation, I tried doing string(int) and it didn't work |
05:30:29 | FromDiscord | <treeform> you would use `$i` |
05:30:39 | FromDiscord | <Elegantbeef> `$` is the nim stringify operator |
05:30:47 | FromDiscord | <Jakraes> Oh nice, thank you |
05:32:09 | FromDiscord | <Elegantbeef> Oh hey treeform would you be opposed to a PR that added distinct `Radian` and `Degree` types to VMath to not run into runtime errors? ๐ |
05:32:43 | FromDiscord | <Elegantbeef> I say runtime errors, but it's more just wrong runtime logic |
05:33:11 | FromDiscord | <treeform> so you would have to cast to Degree or Radians? |
05:33:17 | FromDiscord | <treeform> Naa I don't think I like that |
05:33:35 | FromDiscord | <treeform> all math should be done in radians |
05:33:45 | FromDiscord | <Elegantbeef> Tell that to `perspective` |
05:33:50 | FromDiscord | <treeform> Degree should be display only |
05:34:43 | FromDiscord | <treeform> fovy should probably be in radians you are right |
05:35:59 | FromDiscord | <treeform> On the other hand fovy is more of a user preference |
05:36:31 | FromDiscord | <treeform> when you set fov 90 you don't take out a ruler to measure how far your eyes from the screen |
05:36:39 | FromDiscord | <treeform> you just adjust the number till it feels good |
05:38:04 | FromDiscord | <treeform> https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml |
05:38:10 | FromDiscord | <treeform> "Specifies the field of view angle, in degrees, in the y direction." |
05:38:17 | FromDiscord | <treeform> even openGL did it in degrees |
05:38:21 | FromDiscord | <treeform> I don't know |
05:39:12 | * | max22- joined #nim |
05:39:30 | * | max22- quit (Remote host closed the connection) |
05:39:42 | FromDiscord | <Elegantbeef> Still thinking about distincts could do `-d:vmathUnsafeAngles`, but would ruin all that depend on vmath |
05:39:53 | * | max22- joined #nim |
05:42:43 | FromDiscord | <treeform> GLM also uses perspective: https://knowww.eu/nodes/59b8e93cd54a862e9d7e40e3 in degrees |
05:43:03 | FromDiscord | <Elegantbeef> Yea it might be common |
05:43:04 | FromDiscord | <treeform> but it uses 45 when I use 90 so there is that |
05:43:57 | FromDiscord | <treeform> I don't like the distinct Radian and Degree because it almost never comes up |
05:44:12 | FromDiscord | <treeform> and there is ton of angle math everywhere |
06:09:11 | fn | <ForumUpdaterBot99> New Nimble package! mycouch - a couchDB client written in Nim, see https://github.com/hamidb80/mycouch |
06:09:11 | fn | <R2D299> itHub: 7"a CouchDB client for nimmers" |
06:52:55 | * | fredrikhr joined #nim |
06:59:16 | * | max22- quit (Ping timeout: 250 seconds) |
07:00:30 | * | max22- joined #nim |
07:34:58 | * | max22- quit (Remote host closed the connection) |
07:35:30 | * | rockcavera quit (Ping timeout: 252 seconds) |
07:38:02 | * | rockcavera joined #nim |
07:38:02 | * | rockcavera quit (Changing host) |
07:38:02 | * | rockcavera joined #nim |
07:42:33 | FromDiscord | <enthus1ast> If it runs on linux, maybe start it via systemd with its service restart feature.โต(@treeform) |
08:08:24 | * | max22- joined #nim |
08:19:08 | * | stkrdknmibalz quit (Ping timeout: 252 seconds) |
08:30:38 | * | pro joined #nim |
08:46:31 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3tQ7 |
09:02:03 | FromDiscord | <haxscramper> If you guarantee `x: var T` would outlive closure you can just capture pointer to it instead |
09:03:01 | FromDiscord | <haxscramper> `var ptrX = addr x` and `fieldPairs(ptrX[])` |
09:03:28 | FromDiscord | <impbox [ftsf]> thanks! that works |
09:03:45 | FromDiscord | <haxscramper> But be aware of use-after-free in that case |
09:17:25 | * | Vladar joined #nim |
09:49:59 | FromDiscord | <hamidb80> In reply to @fn "<ForumUpdaterBot> New Nimble package!": yay |
10:08:04 | * | aeverr joined #nim |
10:12:05 | * | pro quit (Quit: WeeChat 3.2) |
10:28:44 | * | max22- quit (Remote host closed the connection) |
10:29:08 | * | max22- joined #nim |
11:49:51 | * | arkurious joined #nim |
11:55:30 | * | max22- quit (Ping timeout: 276 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:38 | * | supakeen joined #nim |
12:55:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> How can I set up a variable that lets me keep track of how many times I've called a macro? |
12:58:27 | * | max22- joined #nim |
13:02:54 | FromDiscord | <Tuatarian> Hello |
13:03:22 | FromDiscord | <Tuatarian> I'm trying to implement an ML agent for a risk-like strategy game |
13:03:58 | FromDiscord | <Tuatarian> Was thinking of using neuroevolution (nnet + genetic selection for weights and biases) |
13:04:10 | FromDiscord | <Tuatarian> The issue being... What is the output layer? |
13:04:25 | FromDiscord | <Tuatarian> The set of possible moves every turn is variable |
13:04:35 | FromDiscord | <Tuatarian> And the first item in that list might change every turn |
13:05:03 | FromDiscord | <Tuatarian> Any ideas? |
13:05:16 | FromDiscord | <@bracketmaster-5a708063d73408ce4> What's the issue? |
13:05:32 | FromDiscord | <Tuatarian> What do I put for the output layer? |
13:05:34 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Have you done an nnet successfully before? |
13:05:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> perhaps in another language? |
13:05:42 | FromDiscord | <Tuatarian> Yes, but simpler one |
13:05:59 | FromDiscord | <Tuatarian> Bog standard mnist recog |
13:06:11 | FromDiscord | <Tuatarian> Didn't use a keras/tf/anything though |
13:06:45 | FromDiscord | <Tuatarian> This is way more complex imo |
13:07:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> are you trying to get help choosing the right data structure for your evonet? |
13:07:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @elegantbeef\:matrix.org \: I feel like this macro should work\: https://play.nim-lang.org/#ix=3tSQ |
13:09:15 | FromDiscord | <Tuatarian> Yeah |
13:09:38 | FromDiscord | <Tuatarian> Or maybe the entire approach is wrong and I should be using something other than an evonet |
13:10:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> you're saying that the order of layers can change? |
13:10:37 | FromDiscord | <Tuatarian> No |
13:10:47 | FromDiscord | <Tuatarian> But I'm really not sure what the output neurons should be |
13:11:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> in nnets, outputs are almost always some n-dimensional array |
13:11:48 | FromDiscord | <Tuatarian> But each output neuron represents something right? |
13:12:00 | FromDiscord | <Tuatarian> With mnist each output neuron was the number the nnet war guessing it was |
13:12:23 | FromDiscord | <Tuatarian> With evonets for other games, each output neuron was a button input |
13:12:30 | FromDiscord | <Tuatarian> But that doesn't really make sense here |
13:12:57 | FromDiscord | <Tuatarian> There are 2 issues with making one neuron for every possible move across the board imo |
13:13:12 | FromDiscord | <Tuatarian> 1. Huge number of possible moves if you ignore the rules of the game |
13:13:24 | FromDiscord | <Tuatarian> 2. Don't know how to ensure a legal one is picked |
13:13:52 | FromDiscord | <Tuatarian> Guess I can just filter through them and choose the legal move it's most confident about?, |
13:13:57 | FromDiscord | <Tuatarian> But there has to be a better way |
13:14:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> There are nets that can play chess - which has a very large space of possible moves |
13:14:59 | FromDiscord | <haxscramper> `const counter = CacheCounter("counterName")` from https://nim-lang.org/docs/macrocache.html#CacheCounter |
13:15:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> You may wish to read papers on chess nnets |
13:15:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> They may provide insight into how they structured the output layers |
13:16:20 | FromDiscord | <Tuatarian> I'll look into that |
13:16:24 | FromDiscord | <Tuatarian> Thanks for the pointer |
13:16:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sure |
13:19:36 | FromDiscord | <Tuatarian> One method seems to be using the net to evaluate moves on a 0-1 scale |
13:19:43 | FromDiscord | <Tuatarian> So one output neuron for eval |
13:19:50 | FromDiscord | <Tuatarian> Then just picking the move with the best eval |
13:20:01 | FromDiscord | <Tuatarian> Which is very clever, I will try that |
13:24:12 | FromDiscord | <Tuatarian> But there are some issues there as well |
13:29:16 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT2 |
13:30:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what is in "./src/game/system/script.nim"? |
13:31:34 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT5 |
13:34:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> So I have a mac and just tried code similar to yours with the compiler package - and I have different errors - not really familiar with nim compiler internals personally though |
13:35:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> maybe @haxscramper\:matrix.org might have some ideas? |
13:36:35 | * | Guest27 joined #nim |
13:36:44 | * | Guest27 quit (Client Quit) |
13:39:30 | FromDiscord | <haxscramper> your code example compiles and runs perfectly fine for me |
13:39:46 | FromDiscord | <haxscramper> and `echo "hello world"` for the script file |
13:39:47 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/4yd |
13:39:54 | FromDiscord | <rb3.nim> Thanks for looking into it @bracketmaster. Ya, I don't understand why I can't get that code to work if it's in a test in a stable branch. I'm trying to do this with the cpp backend, maybe that's unsupported? |
13:40:02 | FromDiscord | <haxscramper> `nim r test.nim` |
13:40:16 | FromDiscord | <rb3.nim> @haxscramper Really? That's the c backend right? |
13:40:38 | FromDiscord | <haxscramper> C++ backend as well |
13:40:53 | FromDiscord | <haxscramper> nim compiler package v1.4.8, compiler version also 1.4.8 |
13:42:01 | * | max22- quit (Ping timeout: 268 seconds) |
13:42:08 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT6 |
13:43:48 | FromDiscord | <rb3.nim> (edit) "https://play.nim-lang.org/#ix=3tT6" => "https://play.nim-lang.org/#ix=3tT8" |
13:44:10 | FromDiscord | <rb3.nim> Thanks @haxscramper. Ill try with some of the switches off, it's gotta be in my config somewhere |
13:45:23 | FromDiscord | <haxscramper> When I try to compile with your switches I get codegen errors |
13:46:21 | FromDiscord | <haxscramper> if I remove `--gc:orc` it runs fine |
13:46:43 | FromDiscord | <haxscramper> I'm not sure if compiler is capable of using ORC and C++ backend at the same time |
13:47:02 | FromDiscord | <haxscramper> IIRC it is bootstrapped with ARC, but I'm pretty sure this is a C backend |
13:49:13 | FromDiscord | <rb3.nim> Ahh. That's wierd though, the project itself runs fine with orc and c++ on (without this code). I've looked at the generated c++ and it seems to be adding the correct RC stuff in... |
13:49:33 | FromDiscord | <rb3.nim> (edit) "this code)." => "the `compiler` import)." |
13:49:52 | FromDiscord | <haxscramper> you use compiler API somewhere else? |
13:50:31 | FromDiscord | <haxscramper> Compiler failing on ORC+C++ is completely unrelated to your project and the fact it runs fine |
13:50:42 | FromDiscord | <haxscramper> Compiler just managed to hit some codegen bug in that combination |
13:51:30 | FromDiscord | <rb3.nim> nowhere else. just trying it tonight so I can start adding hot reloading. at the moment the project is far enough along that if I dont compile it with ORC I get crashes at runtime... |
13:52:04 | FromDiscord | <haxscramper> yeah, I've had this weird "crashes with different GC, don't know why" |
13:52:28 | FromDiscord | <haxscramper> btw, you want to use nimscript for hot code reloating? |
13:52:42 | FromDiscord | <haxscramper> we have native HRC |
13:52:49 | FromDiscord | <haxscramper> HCR\ |
13:53:00 | FromDiscord | <haxscramper> Though I haven't tried it in years |
13:53:16 | FromDiscord | <rb3.nim> Ya it seems to be the best way. I've tried the --hotcodereload (or similar) switch but I get wierd errors at compile time there too |
13:53:32 | FromDiscord | <rb3.nim> If I remove ORC it compiles but the program crashes immediately |
13:55:14 | FromDiscord | <dom96> Oh cool. An email from someone that works at an av company |
13:56:04 | FromDiscord | <rb3.nim> I filed a bug report for it (admittedly not very detailed), let me dig it out in case you notice something |
13:57:55 | FromDiscord | <rb3.nim> @haxscramper this one: https://github.com/nim-lang/Nim/issues/18393. The compile error happened with an empty main.nim file I think |
14:12:32 | FromDiscord | <SirOlaf> How to statically link imgui to a nim project? (Never used imgui, so maybe I'm missing something obvious here) |
14:13:52 | FromDiscord | <Hi02Hi> `--passL:-static` statically links everything |
14:15:29 | FromDiscord | <rb3.nim> @SirOlaf the same way you would with a c++ project; you can pass something like `--passL:"${VULKAN_SDK}/Lib/vulkan-1.lib"` to `nim` and it will forward that switch to your backend. you'll have to convert the imgui c++ headers to nim though |
14:16:23 | FromDiscord | <SirOlaf> In reply to @Hi02Hi "`--passL:-static` statically links everything": That did it, thanks |
14:25:00 | nixfreak_nim[m] | is the re library the only one for regex ? |
14:25:23 | nixfreak_nim[m] | or is there a pure one ? |
14:26:26 | FromDiscord | <Rika> Third party |
14:26:34 | FromDiscord | <Rika> GitHub called โregexโ |
14:43:24 | nixfreak_nim[m] | ok , do you know anything about it? |
14:43:31 | nixfreak_nim[m] | does it work like PCRE ? |
14:52:54 | * | fredrikhr quit (Quit: Disconnecting) |
14:57:09 | FromDiscord | <hamidb80> there is a `nre` module in std lib |
14:57:23 | FromDiscord | <hamidb80> https://nim-lang.org/docs/nre.html |
14:57:37 | FromDiscord | <hamidb80> In reply to @nixfreak_nim "or is there a": what do you mean by "pure" ? |
15:00:58 | federico3 | The Nim developer meeting is starting now at https://meet.jit.si/NimDevMeet |
15:02:50 | fn | <Prestige99> \o/ |
15:08:33 | FromDiscord | <haxscramper> Does anyone use Firefox & nim forum? "Preview" for new messages does not work correctly for me (clicking preview does not actually change anything), and I was wondering if that is something special, or someone else experienced that? |
15:16:39 | * | max22- joined #nim |
15:24:13 | FromDiscord | <dom96> check console, guessing Karax failure |
15:24:18 | FromDiscord | <dom96> but works for me on Firefox |
15:30:17 | FromDiscord | <haxscramper> No errors in console, just dumps some debug info like `<em>12<12>` for `test 12` |
15:30:22 | FromDiscord | <haxscramper> Aaand I accedentally posted it |
15:30:43 | FromDiscord | <haxscramper> Also it seems like I can't delete my post |
15:38:19 | FromDiscord | <Rika> In reply to @nixfreak_nim "does it work like": no, it is not one-to-one with pcre |
15:39:35 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3tU2 |
16:07:14 | FromDiscord | <haxscramper> `CppVirtualInterface` is a C++ type, or nim type? |
16:07:34 | FromDiscord | <haxscramper> `/` did you wrap C++ type or created new one in C++ |
16:08:19 | FromDiscord | <haxscramper> you should use `pointer` mostly for `void payload` scenarios, otherwise it is a good idea to preserve types |
16:32:43 | FromDiscord | <haxscramper> From discussion couple days ago about tree-sitter vs nim parser fork for pretty-printing - I started working in proof-of-concept implementation, so far it seems like this could work out rather well |
16:33:23 | FromDiscord | <haxscramper> I've made a simple proof-of-concept implementation for this, most likely I will add it to hnimast as well |
16:34:21 | FromDiscord | <haxscramper> Right now I just do simple conversion of the CST to layout blocks, maybe with optional layouts for arguments/etc |
16:34:21 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/commit/4925ca25b00a172bab4d946706821780bad7a93f#diff-d94d9112efdf22c30531e2432ce10cbbda17977627c5de7ca2f0b60a93c65910R443-R458 |
16:36:00 | FromDiscord | <haxscramper> Also, does anyone know a good solution for optimizing lots of allocations for a AST nodes/strings? Would it be possible to allocate `seq[Node]` for example, and then use it? |
16:37:26 | FromDiscord | <haxscramper> I create lots of alternative solutions for layouts, so I want to try and optimize it (even though it might be a premature optimization as profiler shows it is not really a bottleneck now) |
16:38:50 | FromDiscord | <saem> How custom a structure you thinking? |
16:40:11 | FromDiscord | <saem> Because if you're willing to go while hog then there are lots of options. |
16:41:02 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/KpR |
16:41:42 | FromDiscord | <saem> Oh, then yes there are ways to optimize it for sure |
16:41:45 | FromDiscord | <haxscramper> And I don't even need to think about reusing memory for othjer allocations |
16:41:56 | FromDiscord | <haxscramper> I create tons of them, then dispose all at once |
16:43:01 | FromDiscord | <haxscramper> I can make it non-ref and use `ptr seq[Block]` and `subnodes: seq[int16]` to store indices of child nodes |
16:43:21 | FromDiscord | <haxscramper> https://www.reddit.com/r/ProgrammingLanguages/comments/79fkpu/representing_asts_as_byte_strings_with_with_small/ |
16:44:04 | FromDiscord | <saem> Doing the associations in big chunks is good. But I'd start with simplifying that core node. It's a bunch of lessons from data oriented designs. |
16:44:41 | FromDiscord | <Ayy Lmao> In reply to @haxscramper "`CppVirtualInterface` is a C++": `CppVirtualInterface` in my case is actually `LICE_IBitmap`, which is exposed to me in an API header as simply `class LICE_IBitmap`, and a bunch of api functions take a pointer to that. |
16:44:56 | FromDiscord | <saem> A good one being opaque indices and more column oriented storage |
16:45:19 | FromDiscord | <saem> Can you link me to you main types? |
16:45:53 | FromDiscord | <haxscramper> https://github.com/haxscramper/hmisc/blob/master/src/hmisc/other/blockfmt.nim#L97 |
16:46:14 | FromDiscord | <saem> It might be easier for me to describe over voice after I get a minute to read over the types. |
16:46:31 | FromDiscord | <saem> But up to you |
16:48:02 | FromDiscord | <haxscramper> I'm not sure if I can do voice right now, and you can just do a brief outline of what can be improved, no need for extra detailed explanation |
16:54:57 | FromDiscord | <saem> Took a quick look, I'm not 100% sure about the cardinality of that data. For the block, just have an id and then if the two variable width pieces of data you can shrink that to two indices, one is start and one is stop. Then the node type and the start stop can tell you which array/seq to look in and what range. This depends upon your data churn, but it would shrink your block node which I think you'd have a ton of. Then it would be using th |
16:55:18 | FromDiscord | <saem> The other fields would move into their own lookup structures. |
16:56:43 | FromDiscord | <saem> If they're super sparse use tables, if they're very sense just use 1 to 1 array/seqs, if they're dense when there is an entry but sparse otherwise, use the two index structure I mentioned. |
17:01:16 | FromDiscord | <saem> It's basically creating a simplified column oriented database in memory. Uses very little storage and you can rapidly allocate broad chunks of the core small data type depending upon your workload. If you know how many or can estimate then allocate that and flag them as valid or not. If you know precisely then it's way easier. |
17:04:53 | FromDiscord | <saem> If you don't know at all then allocate some amount and keep adding chunks as you need them. There total associations will be smaller as the core data type is smaller and you can minimize the overhead of allocating the ancillary structures (specialized data for node type). |
17:06:00 | FromDiscord | <saem> This changes quite a bit based on your workload, the various phases of the workload/what you can rearrange. |
17:06:49 | FromDiscord | <saem> Hope that helps, ping me if you have further questions. |
17:09:38 | FromDiscord | <haxscramper> No, it seems pretty clear, and I know what to look for, so it should be easy to go on with implementation. It seems like packed AST for IC in compiler might have something similar (with regard to subnodes index ranges). I don't exactly know how dense/sparse some lookup fields (as well as data churn (though I know it is non-existent for `LytBlock`, but other elements (like layout cache) might behave differently) |
17:11:00 | FromDiscord | <saem> That's very much inline with data oriented design. |
17:11:27 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tUw |
17:11:34 | FromDiscord | <saem> Packed AST, ECS, data oriented design, column oriented database optimizations, all that stuff. |
17:12:21 | FromDiscord | <saem> Oh yeah, that's begging to be lookups. |
17:12:51 | FromDiscord | <saem> One big string and index into it or whatever. |
17:13:51 | FromDiscord | <haxscramper> I don't exactly know memory access patterns for the layout computation algorithm, but I assume it would not benefit much from column data layout, as it processes one block completely, but underlying data is almost never considered |
17:13:57 | FromDiscord | <haxscramper> Only for string length |
17:14:02 | FromDiscord | <saem> I find Andrew Kelly's write up for how Zig did their packed AST super instructive. Really dug deep into the design decisions. The abstractions in Nim make some of that stuff easier. |
17:15:36 | FromDiscord | <haxscramper> Do you have a link? I can't seem to find it (at least with quick search) |
17:16:18 | FromDiscord | <saem> Well it would benefit from it traversing fewer physical bytes as the data would be denser? Also if more dynamic associations are required is nice as they'd always be in the "forward" direction and you can then reason about recycling previous allociations. |
17:17:58 | FromDiscord | <saem> Here you go\: https://ziglang.org/download/0.8.0/release-notes.html#Reworked-Memory-Layout |
17:20:55 | FromDiscord | <haxscramper> Yeah, now wonder I couldn't find it. Again, thanks for an explanation, I will try to use it when I get to optimizing this whole thing |
17:21:05 | FromDiscord | <saem> Happy to help. |
17:21:20 | FromDiscord | <saem> Good luck, looking forward to it. |
17:30:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> any ideas on why this simple macro doesn't work? https://play.nim-lang.org/#ix=3tSQ |
17:36:00 | FromDiscord | <haxscramper> I don't think `sum1 := "a", "b"` could be implemented as `:=` macro |
17:36:08 | FromDiscord | <haxscramper> First - it would parse `:=` as an infix |
17:36:17 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/eNx |
17:36:25 | FromDiscord | <haxscramper> This could work, but that's not what you are looking for (I assume) |
17:36:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that's fine I think |
17:36:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> thx |
17:40:59 | fn | <ForumUpdaterBot99> New thread by Xioren: Random async exception when downloading, see https://forum.nim-lang.org/t/8261 |
17:45:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tUD |
17:46:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yes, with backticks it appears |
17:59:17 | FromDiscord | <gerwy> is there any comparison Nim with Cython? |
18:03:49 | FromDiscord | <carmysilna> There's a comparison with Python in general, have you seen that? |
18:04:45 | FromDiscord | <gerwy> no, i want Cython not Python |
18:04:54 | FromDiscord | <gerwy> because i need speed difference between those two |
18:05:10 | FromDiscord | <carmysilna> Is there a reason `os.relativePath` doesn't have a `tag:` pragma? Its messing up my effect annotations all over because I have to propagate `RootDirEffect` all over |
18:05:36 | FromDiscord | <carmysilna> In reply to @Life Sucks "because i need speed": Oh, you want just comparison of speed? I'm sure there's some benchmarks you could look at. |
18:06:09 | FromDiscord | <carmysilna> this article seems to address it https://towardsdatascience.com/could-nim-replace-python-547145afcfd5 |
18:06:59 | FromDiscord | <haxscramper> `RootDirEffect`? |
18:07:06 | FromDiscord | <carmysilna> sent a long message, see http://ix.io/3tUI |
18:07:08 | FromDiscord | <haxscramper> Maybe you meant `RootEffect` |
18:07:24 | FromDiscord | <carmysilna> In reply to @haxscramper "`RootDirEffect`?": sorry, `RootEffect` |
18:07:32 | FromDiscord | <haxscramper> And I honestly have no idea why it was inferred this way |
18:07:46 | FromDiscord | <haxscramper> But you can try to copy implementation and cut down parts that cause this effect |
18:07:58 | FromDiscord | <carmysilna> https://media.discordapp.net/attachments/371759389889003532/868192728289275904/Capture_decran_2021-07-23_a_13.07.51.png |
18:08:05 | FromDiscord | <carmysilna> In reply to @haxscramper "But you can try": okay, I might do that |
18:08:26 | FromDiscord | <haxscramper> yeah, I know it has this, but why Root effect |
18:08:26 | FromDiscord | <gerwy> In reply to @carmysilna "this article seems to": okay thanks i will read that |
18:18:55 | FromDiscord | <carmysilna> In reply to @haxscramper "yeah, I know it": when I copied the implementation, it didn't require any effects, so I'm not sure either. maybe missing annotations somewhere? |
18:22:22 | * | tiorock joined #nim |
18:22:22 | * | tiorock quit (Changing host) |
18:22:22 | * | tiorock joined #nim |
18:22:22 | * | rockcavera quit (Killed (osmium.libera.chat (Nickname regained by services))) |
18:22:22 | * | tiorock is now known as rockcavera |
18:26:58 | * | max22- quit (Ping timeout: 250 seconds) |
19:01:51 | arkanoid | would you tell me what is "^it" here, and where is it documented? https://github.com/dimroc/etl-language-comparison/blob/1c82057f148c164e771b5b8ee9413d64a11b5f58/nim/mapper.nim#L28 |
19:03:13 | arkanoid | oh, wait, I think I've found it. It's a FlowVar https://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D |
19:03:33 | FromDiscord | <carmysilna> `mapIt(do stuff with it)` is a template that is effectively equal to `map(it => do stuff with it)` |
19:04:08 | arkanoid | yeah I know that, was the ^it that was puzzling me. I now see that's a flowvar |
19:05:40 | arkanoid | what should I prefer nowadays for parallel programming: threads module, threadpool module (spawn), something else? |
19:08:15 | arkanoid | or https://github.com/mratsim/weave |
19:08:17 | fn | <R2D299> itHub: 7"A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead" |
19:17:03 | * | max22- joined #nim |
19:32:53 | * | xet7 joined #nim |
19:37:47 | * | xet7 quit (Remote host closed the connection) |
19:38:30 | * | xet7 joined #nim |
20:35:46 | * | asd quit (Ping timeout: 252 seconds) |
20:37:44 | * | asd joined #nim |
21:16:45 | * | supakeen quit (Remote host closed the connection) |
21:17:09 | * | supakeen joined #nim |
21:46:43 | * | Vladar quit (Quit: Leaving) |
21:58:34 | FromDiscord | <retkid> hey |
21:58:39 | FromDiscord | <retkid> anyone here good with moe? |
21:59:58 | FromDiscord | <retkid> @willyboar would you like to help me with some stuff? their discord is deaaaaddd |
22:00:49 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/868251327233413231/unknown.png |
22:00:53 | FromDiscord | <retkid> this infuriates me |
22:05:23 | * | max22- quit (Quit: Leaving) |
22:06:36 | FromDiscord | <willyboar> ping fox0430 |
22:07:16 | FromDiscord | <willyboar> i don't use it often |
22:08:35 | * | max22- joined #nim |
22:12:11 | FromDiscord | <retkid> im gonna try a little bit more then I'll start annoying him |
22:23:25 | * | max22- quit (Quit: Leaving) |
22:40:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> nimble is really nice |
22:40:44 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that why i wish all software was written in nim |
22:40:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so I'd only need one package manager |
22:46:42 | FromDiscord | <ElegantBeef> Did you see that the PR that fixed your const issue was merged? ๐ |
22:56:14 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3tVD |
22:56:33 | FromDiscord | <codic> yep, just wrap it with parens |
23:00:05 | * | supakeen quit (Remote host closed the connection) |
23:00:29 | * | supakeen joined #nim |
23:08:05 | FromDiscord | <saem> [timotheecour (Timothee Cour)](https://matrix.to/#/@timotheecour-557c78ad15522ed4b3e1de68:gitter.im)\: hoping you know, I'm having trouble finding an answer, do we test the runnable examples in the rst files for the manual and tutorials? |
23:22:58 | * | beshr quit (Remote host closed the connection) |
23:23:14 | * | beshr joined #nim |