<< 23-07-2021 >>

00:56:09fn<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:35FromDiscord<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:33FromDiscord<ElegantBeef> What vulkan bindings are you using?
01:21:41*arkurious quit (Quit: Leaving)
01:24:14FromDiscord<creonico> https://github.com/nimgl/vulkan
01:24:15fn<R2D299> itHub: 7"Vulkan bindings for Nim"
01:25:21FromDiscord<ElegantBeef> Ok so what you should be able to do is `queueFlags.uint32 and 1u32`
01:25:40FromDiscord<creonico> Thats what I though I would need
01:25:51FromDiscord<creonico> But why won't it work like iin C
01:25:59FromDiscord<creonico> (edit) "iin" => "in"
01:26:03FromDiscord<ElegantBeef> Cause there is no and operator for enums
01:26:16FromDiscord<creonico> oh
01:26:46FromDiscord<checkersai> you could overload the operator for that enum type
01:26:51FromDiscord<ElegantBeef> well more accurately no and operator for `type(queueFlags), VkQueueFlagBits`
01:27:12FromDiscord<ElegantBeef> Yea that's a solution
01:27:27FromDiscord<ElegantBeef> Personally i try to holeless enums as much as possible
01:27:43FromDiscord<ElegantBeef> Might be a bit of an overhead but makes life easier imo
01:28:39FromDiscord<checkersai> holeless?
01:29:00FromDiscord<ElegantBeef> Enum's without any gaps inbetween values that can be used in an array or a bitset safely
01:30:13FromDiscord<checkersai> ah yeah makes perfect sense
01:30:34FromDiscord<checkersai> personally I'd probably just use a bitfield and consts
01:30:36FromDiscord<creonico> In reply to @ElegantBeef "Enum's without any gaps": How make?
01:30:56FromDiscord<creonico> I never heard that concept
01:30:59FromDiscord<checkersai> (edit) "bitfield" => "bitset"
01:31:35FromDiscord<ElegantBeef> Well i'm probably one of the few that's odd enough to do it ๐Ÿ˜„
01:32:05FromDiscord<ElegantBeef> He's my example with assimp i did today https://github.com/beef331/nimassimp/blob/master/src/assimp.nim#L232-L290
01:32:46FromDiscord<ElegantBeef> Which is a replacement for https://github.com/awr1/nimassimp/blob/master/assimp.nim#L235-L276
01:33:22FromDiscord<ElegantBeef> there is an overhead of going from the bitset to the original int ofc, but i'm a silly bastard
01:33:50FromDiscord<ElegantBeef> I did a similar thing for SDL2
01:34:33FromDiscord<checkersai> What is assimp lol
01:35:06FromDiscord<checkersai> is it as-simp like "as a simp, I ..." or ass-imp like "an imp's ass"
01:35:09FromDiscord<ElegantBeef> An asset importing library
01:35:50FromDiscord<@bracketmaster-5a708063d73408ce4> obviously
01:36:15FromDiscord<@bracketmaster-5a708063d73408ce4> jk - I didn't know what assimp meant at all either
01:36:49FromDiscord<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:17FromDiscord<ElegantBeef> I do silly shit all the time, only worthwhile to copy me if you like it ๐Ÿ˜›
01:49:49FromDiscord<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:04FromDiscord<@bracketmaster-5a708063d73408ce4> Shouldn't static in the macro work here? https://play.nim-lang.org/#ix=3tMa
01:53:33FromDiscord<Elegantbeef> No `let` is a runtime value
01:53:41FromDiscord<@bracketmaster-5a708063d73408ce4> oh
01:53:46FromDiscord<@bracketmaster-5a708063d73408ce4> How do I get around that?
01:53:51FromDiscord<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:05FromDiscord<checkersai> Is it worth compiling with -d:danger instead of -d:release?
02:16:19FromDiscord<Rika> Your call
02:16:27FromDiscord<Rika> You lose runtime checks that way
02:16:32FromDiscord<Elegantbeef> If you want speed
02:16:50FromDiscord<Elegantbeef> It's a lot like "is it worth going down hill on a bicycle without a helmet"
02:17:05FromDiscord<Rika> Donโ€™t out me like that beef what the hell
02:17:26FromDiscord<Elegantbeef> Rika doesnt wear protection confirmed
02:17:48FromDiscord<Rika> I like doing it without, feels much better
02:17:51FromDiscord<Rika> Feels open
02:18:04FromDiscord<Elegantbeef> The wind in your hair eh?
02:19:20FromDiscord<Rika> Yeah especially with the length of it
02:19:29FromDiscord<Rika> My hairโ€™s very long
02:22:36FromDiscord<@bracketmaster-5a708063d73408ce4> COVID hair?
02:22:48FromDiscord<@bracketmaster-5a708063d73408ce4> also - templates don't seem to like `consts`
02:22:49FromDiscord<@bracketmaster-5a708063d73408ce4> https://play.nim-lang.org/#ix=3tMo
02:22:58FromDiscord<Elegantbeef> If your covid has hair it's not covid, but mould
02:23:23FromDiscord<@bracketmaster-5a708063d73408ce4> well - during covid - it was hard to find brave barbers for some
02:23:28FromDiscord<@bracketmaster-5a708063d73408ce4> so they just didn't cut their hair
02:23:51FromDiscord<Elegantbeef> I'm not stupid i make jokes
02:24:02FromDiscord<@bracketmaster-5a708063d73408ce4> where I live though, many people pretended like covid wasn't a thing
02:24:04FromDiscord<Rika> No more of โ€œI was planning on growing it out and COVID hit so I had an actual excuse nowโ€
02:24:20FromDiscord<Elegantbeef> So consts dont seem to support tuple unpacking?
02:24:30FromDiscord<@bracketmaster-5a708063d73408ce4> they do, just not in templates
02:24:37FromDiscord<Rika> Why?
02:24:44FromDiscord<Rika> I mean the template part
02:24:45FromDiscord<@bracketmaster-5a708063d73408ce4> i have no idea
02:24:58FromDiscord<@bracketmaster-5a708063d73408ce4> so I've been doing some really weird AST manipulations in Nim
02:25:10FromDiscord<@bracketmaster-5a708063d73408ce4> And let me tell you, nim macros have some really dark corners
02:25:13FromDiscord<@bracketmaster-5a708063d73408ce4> where things just break
02:25:22FromDiscord<Rika> Yes
02:25:35FromDiscord<@bracketmaster-5a708063d73408ce4> maybe nim should learn from lisp
02:25:45FromDiscord<@bracketmaster-5a708063d73408ce4> lisp is know for being a little more robust in the AST department
02:26:36FromDiscord<Rika> I believe that lisp is a bit too different in terms of AST to learn from?
02:28:26FromDiscord<Elegantbeef> This seems like a simple fix, but we'll see
02:33:20FromDiscord<Elegantbeef> Doesnt seem like there is an existing issue related to this
02:33:38FromDiscord<@bracketmaster-5a708063d73408ce4> oh?
02:33:39FromDiscord<@bracketmaster-5a708063d73408ce4> huh...
02:33:50FromDiscord<@bracketmaster-5a708063d73408ce4> maybe is a feature?
02:33:55FromDiscord<@bracketmaster-5a708063d73408ce4> it -\> its
02:34:17FromDiscord<Elegantbeef> Well it's useless code presently
02:34:29FromDiscord<@bracketmaster-5a708063d73408ce4> i actually make good use of that
02:34:31FromDiscord<Elegantbeef> Since those cannot be accessed outside the template ๐Ÿ˜€
02:34:59FromDiscord<@bracketmaster-5a708063d73408ce4> i'm currently writing a hardware virtual machine
02:35:28FromDiscord<@bracketmaster-5a708063d73408ce4> its a virtual machine where you can instantiate adders, subtractors, multipliers, nand gates, or gates, etc.
02:35:33FromDiscord<@bracketmaster-5a708063d73408ce4> and connect them up and simulate
02:35:55FromDiscord<Elegantbeef> Anywho i'm looking fixing it, though idk if i can
02:36:04FromDiscord<@bracketmaster-5a708063d73408ce4> a higher level RTL would emit hardware VM code which is valid nim
02:36:29FromDiscord<@bracketmaster-5a708063d73408ce4> the reason I use so many macros is I require the all the connections to be frozen by runtime
02:36:49FromDiscord<@bracketmaster-5a708063d73408ce4> which means I need to traverse and build parts of the netlist during compiletime
02:37:21FromDiscord<@bracketmaster-5a708063d73408ce4> I say this to justify me using const - in that weird way
02:37:42FromDiscord<Elegantbeef> Yea yea i get it
02:38:44FromDiscord<@bracketmaster-5a708063d73408ce4> oh?
02:38:47FromDiscord<@bracketmaster-5a708063d73408ce4> ok cool
02:38:55FromDiscord<@bracketmaster-5a708063d73408ce4> I'm glad I don't have to explain more
02:39:31FromDiscord<@bracketmaster-5a708063d73408ce4> Although I do provide a higher level overview here\: https://yehowshuaimmanuel.com/posts/polish_new_rtl/
02:43:19FromDiscord<@bracketmaster-5a708063d73408ce4> actually it seems it works if you don't use tuples
02:43:27FromDiscord<@bracketmaster-5a708063d73408ce4> sent a long message, see http://ix.io/3tMA
02:44:05FromDiscord<Elegantbeef> Yea i'm looking at the compiler and i see why it fails, now to just fix it \:P
02:44:31FromDiscord<@bracketmaster-5a708063d73408ce4> sounds very advanced
02:45:06FromDiscord<@bracketmaster-5a708063d73408ce4> One of my friends works at Google and he knows a compiler engineer there that gets paid 1M/yr.
02:45:11FromDiscord<@bracketmaster-5a708063d73408ce4> Maybe you should work at Google
02:45:15FromDiscord<@bracketmaster-5a708063d73408ce4> Probably won't be on nim
02:45:21FromDiscord<Elegantbeef> I'm not a compiler dev though
02:45:43FromDiscord<Elegantbeef> I just like fixing issues if I can
02:45:57FromDiscord<@bracketmaster-5a708063d73408ce4> that's how it starts
02:52:18FromDiscord<Elegantbeef> ehh
02:52:18FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/867962298503933972/image.png
03:03:01FromDiscord<Jakraes> Does anyone have a tutorial for the net library?
03:03:27FromDiscord<Jakraes> Kinda struggling here trying to find out how to do certain things
03:06:01FromDiscord<Elegantbeef> What's the problem?
03:07:14FromDiscord<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:34FromDiscord<Jakraes> I get that you can use trySend() in the client, but how could I read that message in the server?
03:09:40FromDiscord<Elegantbeef> one of the recv functions if i get the question
03:10:04FromDiscord<Jakraes> Gotcha, I'll see if it works
03:10:09FromDiscord<Jakraes> Thank you in advance!
03:30:46FromDiscord<Bung> @treeform do you have todo list of fidget? I might contribute some code
03:33:58FromDiscord<Elegantbeef> Well bracketmaster watch this PR for me, thanks ๐Ÿ˜› https://github.com/nim-lang/Nim/pull/18562
03:34:50FromDiscord<Elegantbeef> Back to opengl
03:39:35FromDiscord<Bung> nice catch
03:40:01FromDiscord<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:58FromDiscord<Bung> okay
03:51:34FromDiscord<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:52FromDiscord<i_right_i> How do you 'echo i' and i be printed in hexadecimal?
05:05:04FromDiscord<ElegantBeef> !eval import std/strutils; echo 100.toHex
05:05:08NimBot0000000000000064
05:05:25FromDiscord<i_right_i> okay thanks
05:16:05FromDiscord<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:19FromDiscord<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:29FromDiscord<treeform> you would use `$i`
05:30:39FromDiscord<Elegantbeef> `$` is the nim stringify operator
05:30:47FromDiscord<Jakraes> Oh nice, thank you
05:32:09FromDiscord<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:43FromDiscord<Elegantbeef> I say runtime errors, but it's more just wrong runtime logic
05:33:11FromDiscord<treeform> so you would have to cast to Degree or Radians?
05:33:17FromDiscord<treeform> Naa I don't think I like that
05:33:35FromDiscord<treeform> all math should be done in radians
05:33:45FromDiscord<Elegantbeef> Tell that to `perspective`
05:33:50FromDiscord<treeform> Degree should be display only
05:34:43FromDiscord<treeform> fovy should probably be in radians you are right
05:35:59FromDiscord<treeform> On the other hand fovy is more of a user preference
05:36:31FromDiscord<treeform> when you set fov 90 you don't take out a ruler to measure how far your eyes from the screen
05:36:39FromDiscord<treeform> you just adjust the number till it feels good
05:38:04FromDiscord<treeform> https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml
05:38:10FromDiscord<treeform> "Specifies the field of view angle, in degrees, in the y direction."
05:38:17FromDiscord<treeform> even openGL did it in degrees
05:38:21FromDiscord<treeform> I don't know
05:39:12*max22- joined #nim
05:39:30*max22- quit (Remote host closed the connection)
05:39:42FromDiscord<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:43FromDiscord<treeform> GLM also uses perspective: https://knowww.eu/nodes/59b8e93cd54a862e9d7e40e3 in degrees
05:43:03FromDiscord<Elegantbeef> Yea it might be common
05:43:04FromDiscord<treeform> but it uses 45 when I use 90 so there is that
05:43:57FromDiscord<treeform> I don't like the distinct Radian and Degree because it almost never comes up
05:44:12FromDiscord<treeform> and there is ton of angle math everywhere
06:09:11fn<ForumUpdaterBot99> New Nimble package! mycouch - a couchDB client written in Nim, see https://github.com/hamidb80/mycouch
06:09:11fn<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:33FromDiscord<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:31FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3tQ7
09:02:03FromDiscord<haxscramper> If you guarantee `x: var T` would outlive closure you can just capture pointer to it instead
09:03:01FromDiscord<haxscramper> `var ptrX = addr x` and `fieldPairs(ptrX[])`
09:03:28FromDiscord<impbox [ftsf]> thanks! that works
09:03:45FromDiscord<haxscramper> But be aware of use-after-free in that case
09:17:25*Vladar joined #nim
09:49:59FromDiscord<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:41FromDiscord<@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:54FromDiscord<Tuatarian> Hello
13:03:22FromDiscord<Tuatarian> I'm trying to implement an ML agent for a risk-like strategy game
13:03:58FromDiscord<Tuatarian> Was thinking of using neuroevolution (nnet + genetic selection for weights and biases)
13:04:10FromDiscord<Tuatarian> The issue being... What is the output layer?
13:04:25FromDiscord<Tuatarian> The set of possible moves every turn is variable
13:04:35FromDiscord<Tuatarian> And the first item in that list might change every turn
13:05:03FromDiscord<Tuatarian> Any ideas?
13:05:16FromDiscord<@bracketmaster-5a708063d73408ce4> What's the issue?
13:05:32FromDiscord<Tuatarian> What do I put for the output layer?
13:05:34FromDiscord<@bracketmaster-5a708063d73408ce4> Have you done an nnet successfully before?
13:05:39FromDiscord<@bracketmaster-5a708063d73408ce4> perhaps in another language?
13:05:42FromDiscord<Tuatarian> Yes, but simpler one
13:05:59FromDiscord<Tuatarian> Bog standard mnist recog
13:06:11FromDiscord<Tuatarian> Didn't use a keras/tf/anything though
13:06:45FromDiscord<Tuatarian> This is way more complex imo
13:07:36FromDiscord<@bracketmaster-5a708063d73408ce4> are you trying to get help choosing the right data structure for your evonet?
13:07:59FromDiscord<@bracketmaster-5a708063d73408ce4> @elegantbeef\:matrix.org \: I feel like this macro should work\: https://play.nim-lang.org/#ix=3tSQ
13:09:15FromDiscord<Tuatarian> Yeah
13:09:38FromDiscord<Tuatarian> Or maybe the entire approach is wrong and I should be using something other than an evonet
13:10:19FromDiscord<@bracketmaster-5a708063d73408ce4> you're saying that the order of layers can change?
13:10:37FromDiscord<Tuatarian> No
13:10:47FromDiscord<Tuatarian> But I'm really not sure what the output neurons should be
13:11:22FromDiscord<@bracketmaster-5a708063d73408ce4> in nnets, outputs are almost always some n-dimensional array
13:11:48FromDiscord<Tuatarian> But each output neuron represents something right?
13:12:00FromDiscord<Tuatarian> With mnist each output neuron was the number the nnet war guessing it was
13:12:23FromDiscord<Tuatarian> With evonets for other games, each output neuron was a button input
13:12:30FromDiscord<Tuatarian> But that doesn't really make sense here
13:12:57FromDiscord<Tuatarian> There are 2 issues with making one neuron for every possible move across the board imo
13:13:12FromDiscord<Tuatarian> 1. Huge number of possible moves if you ignore the rules of the game
13:13:24FromDiscord<Tuatarian> 2. Don't know how to ensure a legal one is picked
13:13:52FromDiscord<Tuatarian> Guess I can just filter through them and choose the legal move it's most confident about?,
13:13:57FromDiscord<Tuatarian> But there has to be a better way
13:14:58FromDiscord<@bracketmaster-5a708063d73408ce4> There are nets that can play chess - which has a very large space of possible moves
13:14:59FromDiscord<haxscramper> `const counter = CacheCounter("counterName")` from https://nim-lang.org/docs/macrocache.html#CacheCounter
13:15:09FromDiscord<@bracketmaster-5a708063d73408ce4> You may wish to read papers on chess nnets
13:15:36FromDiscord<@bracketmaster-5a708063d73408ce4> They may provide insight into how they structured the output layers
13:16:20FromDiscord<Tuatarian> I'll look into that
13:16:24FromDiscord<Tuatarian> Thanks for the pointer
13:16:39FromDiscord<@bracketmaster-5a708063d73408ce4> sure
13:19:36FromDiscord<Tuatarian> One method seems to be using the net to evaluate moves on a 0-1 scale
13:19:43FromDiscord<Tuatarian> So one output neuron for eval
13:19:50FromDiscord<Tuatarian> Then just picking the move with the best eval
13:20:01FromDiscord<Tuatarian> Which is very clever, I will try that
13:24:12FromDiscord<Tuatarian> But there are some issues there as well
13:29:16FromDiscord<rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT2
13:30:58FromDiscord<@bracketmaster-5a708063d73408ce4> what is in "./src/game/system/script.nim"?
13:31:34FromDiscord<rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT5
13:34:55FromDiscord<@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:36FromDiscord<@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:30FromDiscord<haxscramper> your code example compiles and runs perfectly fine for me
13:39:46FromDiscord<haxscramper> and `echo "hello world"` for the script file
13:39:47FromDiscord<haxscramper> sent a code paste, see https://paste.rs/4yd
13:39:54FromDiscord<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:02FromDiscord<haxscramper> `nim r test.nim`
13:40:16FromDiscord<rb3.nim> @haxscramper Really? That's the c backend right?
13:40:38FromDiscord<haxscramper> C++ backend as well
13:40:53FromDiscord<haxscramper> nim compiler package v1.4.8, compiler version also 1.4.8
13:42:01*max22- quit (Ping timeout: 268 seconds)
13:42:08FromDiscord<rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=3tT6
13:43:48FromDiscord<rb3.nim> (edit) "https://play.nim-lang.org/#ix=3tT6" => "https://play.nim-lang.org/#ix=3tT8"
13:44:10FromDiscord<rb3.nim> Thanks @haxscramper. Ill try with some of the switches off, it's gotta be in my config somewhere
13:45:23FromDiscord<haxscramper> When I try to compile with your switches I get codegen errors
13:46:21FromDiscord<haxscramper> if I remove `--gc:orc` it runs fine
13:46:43FromDiscord<haxscramper> I'm not sure if compiler is capable of using ORC and C++ backend at the same time
13:47:02FromDiscord<haxscramper> IIRC it is bootstrapped with ARC, but I'm pretty sure this is a C backend
13:49:13FromDiscord<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:33FromDiscord<rb3.nim> (edit) "this code)." => "the `compiler` import)."
13:49:52FromDiscord<haxscramper> you use compiler API somewhere else?
13:50:31FromDiscord<haxscramper> Compiler failing on ORC+C++ is completely unrelated to your project and the fact it runs fine
13:50:42FromDiscord<haxscramper> Compiler just managed to hit some codegen bug in that combination
13:51:30FromDiscord<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:04FromDiscord<haxscramper> yeah, I've had this weird "crashes with different GC, don't know why"
13:52:28FromDiscord<haxscramper> btw, you want to use nimscript for hot code reloating?
13:52:42FromDiscord<haxscramper> we have native HRC
13:52:49FromDiscord<haxscramper> HCR\
13:53:00FromDiscord<haxscramper> Though I haven't tried it in years
13:53:16FromDiscord<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:32FromDiscord<rb3.nim> If I remove ORC it compiles but the program crashes immediately
13:55:14FromDiscord<dom96> Oh cool. An email from someone that works at an av company
13:56:04FromDiscord<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:55FromDiscord<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:32FromDiscord<SirOlaf> How to statically link imgui to a nim project? (Never used imgui, so maybe I'm missing something obvious here)
14:13:52FromDiscord<Hi02Hi> `--passL:-static` statically links everything
14:15:29FromDiscord<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:23FromDiscord<SirOlaf> In reply to @Hi02Hi "`--passL:-static` statically links everything": That did it, thanks
14:25:00nixfreak_nim[m]is the re library the only one for regex ?
14:25:23nixfreak_nim[m]or is there a pure one ?
14:26:26FromDiscord<Rika> Third party
14:26:34FromDiscord<Rika> GitHub called โ€œregexโ€
14:43:24nixfreak_nim[m]ok , do you know anything about it?
14:43:31nixfreak_nim[m]does it work like PCRE ?
14:52:54*fredrikhr quit (Quit: Disconnecting)
14:57:09FromDiscord<hamidb80> there is a `nre` module in std lib
14:57:23FromDiscord<hamidb80> https://nim-lang.org/docs/nre.html
14:57:37FromDiscord<hamidb80> In reply to @nixfreak_nim "or is there a": what do you mean by "pure" ?
15:00:58federico3The Nim developer meeting is starting now at https://meet.jit.si/NimDevMeet
15:02:50fn<Prestige99> \o/
15:08:33FromDiscord<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:13FromDiscord<dom96> check console, guessing Karax failure
15:24:18FromDiscord<dom96> but works for me on Firefox
15:30:17FromDiscord<haxscramper> No errors in console, just dumps some debug info like `<em>12<12>` for `test 12`
15:30:22FromDiscord<haxscramper> Aaand I accedentally posted it
15:30:43FromDiscord<haxscramper> Also it seems like I can't delete my post
15:38:19FromDiscord<Rika> In reply to @nixfreak_nim "does it work like": no, it is not one-to-one with pcre
15:39:35FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3tU2
16:07:14FromDiscord<haxscramper> `CppVirtualInterface` is a C++ type, or nim type?
16:07:34FromDiscord<haxscramper> `/` did you wrap C++ type or created new one in C++
16:08:19FromDiscord<haxscramper> you should use `pointer` mostly for `void payload` scenarios, otherwise it is a good idea to preserve types
16:32:43FromDiscord<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:23FromDiscord<haxscramper> I've made a simple proof-of-concept implementation for this, most likely I will add it to hnimast as well
16:34:21FromDiscord<haxscramper> Right now I just do simple conversion of the CST to layout blocks, maybe with optional layouts for arguments/etc
16:34:21FromDiscord<haxscramper> https://github.com/haxscramper/hack/commit/4925ca25b00a172bab4d946706821780bad7a93f#diff-d94d9112efdf22c30531e2432ce10cbbda17977627c5de7ca2f0b60a93c65910R443-R458
16:36:00FromDiscord<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:26FromDiscord<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:50FromDiscord<saem> How custom a structure you thinking?
16:40:11FromDiscord<saem> Because if you're willing to go while hog then there are lots of options.
16:41:02FromDiscord<haxscramper> sent a code paste, see https://paste.rs/KpR
16:41:42FromDiscord<saem> Oh, then yes there are ways to optimize it for sure
16:41:45FromDiscord<haxscramper> And I don't even need to think about reusing memory for othjer allocations
16:41:56FromDiscord<haxscramper> I create tons of them, then dispose all at once
16:43:01FromDiscord<haxscramper> I can make it non-ref and use `ptr seq[Block]` and `subnodes: seq[int16]` to store indices of child nodes
16:43:21FromDiscord<haxscramper> https://www.reddit.com/r/ProgrammingLanguages/comments/79fkpu/representing_asts_as_byte_strings_with_with_small/
16:44:04FromDiscord<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:41FromDiscord<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:56FromDiscord<saem> A good one being opaque indices and more column oriented storage
16:45:19FromDiscord<saem> Can you link me to you main types?
16:45:53FromDiscord<haxscramper> https://github.com/haxscramper/hmisc/blob/master/src/hmisc/other/blockfmt.nim#L97
16:46:14FromDiscord<saem> It might be easier for me to describe over voice after I get a minute to read over the types.
16:46:31FromDiscord<saem> But up to you
16:48:02FromDiscord<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:57FromDiscord<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:18FromDiscord<saem> The other fields would move into their own lookup structures.
16:56:43FromDiscord<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:16FromDiscord<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:53FromDiscord<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:00FromDiscord<saem> This changes quite a bit based on your workload, the various phases of the workload/what you can rearrange.
17:06:49FromDiscord<saem> Hope that helps, ping me if you have further questions.
17:09:38FromDiscord<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:00FromDiscord<saem> That's very much inline with data oriented design.
17:11:27FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tUw
17:11:34FromDiscord<saem> Packed AST, ECS, data oriented design, column oriented database optimizations, all that stuff.
17:12:21FromDiscord<saem> Oh yeah, that's begging to be lookups.
17:12:51FromDiscord<saem> One big string and index into it or whatever.
17:13:51FromDiscord<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:57FromDiscord<haxscramper> Only for string length
17:14:02FromDiscord<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:36FromDiscord<haxscramper> Do you have a link? I can't seem to find it (at least with quick search)
17:16:18FromDiscord<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:58FromDiscord<saem> Here you go\: https://ziglang.org/download/0.8.0/release-notes.html#Reworked-Memory-Layout
17:20:55FromDiscord<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:05FromDiscord<saem> Happy to help.
17:21:20FromDiscord<saem> Good luck, looking forward to it.
17:30:58FromDiscord<@bracketmaster-5a708063d73408ce4> any ideas on why this simple macro doesn't work? https://play.nim-lang.org/#ix=3tSQ
17:36:00FromDiscord<haxscramper> I don't think `sum1 := "a", "b"` could be implemented as `:=` macro
17:36:08FromDiscord<haxscramper> First - it would parse `:=` as an infix
17:36:17FromDiscord<haxscramper> sent a code paste, see https://paste.rs/eNx
17:36:25FromDiscord<haxscramper> This could work, but that's not what you are looking for (I assume)
17:36:41FromDiscord<@bracketmaster-5a708063d73408ce4> that's fine I think
17:36:43FromDiscord<@bracketmaster-5a708063d73408ce4> thx
17:40:59fn<ForumUpdaterBot99> New thread by Xioren: Random async exception when downloading, see https://forum.nim-lang.org/t/8261
17:45:49FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3tUD
17:46:09FromDiscord<@bracketmaster-5a708063d73408ce4> yes, with backticks it appears
17:59:17FromDiscord<gerwy> is there any comparison Nim with Cython?
18:03:49FromDiscord<carmysilna> There's a comparison with Python in general, have you seen that?
18:04:45FromDiscord<gerwy> no, i want Cython not Python
18:04:54FromDiscord<gerwy> because i need speed difference between those two
18:05:10FromDiscord<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:36FromDiscord<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:09FromDiscord<carmysilna> this article seems to address it https://towardsdatascience.com/could-nim-replace-python-547145afcfd5
18:06:59FromDiscord<haxscramper> `RootDirEffect`?
18:07:06FromDiscord<carmysilna> sent a long message, see http://ix.io/3tUI
18:07:08FromDiscord<haxscramper> Maybe you meant `RootEffect`
18:07:24FromDiscord<carmysilna> In reply to @haxscramper "`RootDirEffect`?": sorry, `RootEffect`
18:07:32FromDiscord<haxscramper> And I honestly have no idea why it was inferred this way
18:07:46FromDiscord<haxscramper> But you can try to copy implementation and cut down parts that cause this effect
18:07:58FromDiscord<carmysilna> https://media.discordapp.net/attachments/371759389889003532/868192728289275904/Capture_decran_2021-07-23_a_13.07.51.png
18:08:05FromDiscord<carmysilna> In reply to @haxscramper "But you can try": okay, I might do that
18:08:26FromDiscord<haxscramper> yeah, I know it has this, but why Root effect
18:08:26FromDiscord<gerwy> In reply to @carmysilna "this article seems to": okay thanks i will read that
18:18:55FromDiscord<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:51arkanoidwould 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:13arkanoidoh, wait, I think I've found it. It's a FlowVar https://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D
19:03:33FromDiscord<carmysilna> `mapIt(do stuff with it)` is a template that is effectively equal to `map(it => do stuff with it)`
19:04:08arkanoidyeah I know that, was the ^it that was puzzling me. I now see that's a flowvar
19:05:40arkanoidwhat should I prefer nowadays for parallel programming: threads module, threadpool module (spawn), something else?
19:08:15arkanoidor https://github.com/mratsim/weave
19:08:17fn<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:34FromDiscord<retkid> hey
21:58:39FromDiscord<retkid> anyone here good with moe?
21:59:58FromDiscord<retkid> @willyboar would you like to help me with some stuff? their discord is deaaaaddd
22:00:49FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/868251327233413231/unknown.png
22:00:53FromDiscord<retkid> this infuriates me
22:05:23*max22- quit (Quit: Leaving)
22:06:36FromDiscord<willyboar> ping fox0430
22:07:16FromDiscord<willyboar> i don't use it often
22:08:35*max22- joined #nim
22:12:11FromDiscord<retkid> im gonna try a little bit more then I'll start annoying him
22:23:25*max22- quit (Quit: Leaving)
22:40:33FromDiscord<@bracketmaster-5a708063d73408ce4> nimble is really nice
22:40:44FromDiscord<@bracketmaster-5a708063d73408ce4> that why i wish all software was written in nim
22:40:50FromDiscord<@bracketmaster-5a708063d73408ce4> so I'd only need one package manager
22:46:42FromDiscord<ElegantBeef> Did you see that the PR that fixed your const issue was merged? ๐Ÿ˜„
22:56:14FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3tVD
22:56:33FromDiscord<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:05FromDiscord<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