00:00:27 | FromDiscord | <Elegantbeef> This tuple based gui seems like it might be the most ideal solution |
00:00:33 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4w0J atleast it's extremely easy to declare |
00:14:26 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
00:16:53 | FromDiscord | <Arathanis> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4w0J atleast it's ext": when are you publishing this GUI library? |
00:16:57 | FromDiscord | <Arathanis> 😉 |
00:17:09 | FromDiscord | <Elegantbeef> I mean it'll be apart of truss3D |
00:17:13 | FromDiscord | <Arathanis> is it for your game? |
00:17:20 | FromDiscord | <Elegantbeef> And it's made specifically for my mind + gamedev |
00:17:20 | FromDiscord | <Elegantbeef> Yea |
00:17:35 | FromDiscord | <Elegantbeef> Still uncertain if it'll be nice |
00:17:42 | FromDiscord | <Elegantbeef> But the logic seems fine |
00:17:51 | FromDiscord | <Arathanis> what engine do you use to write it? id be curious to look at game programming in Nim |
00:17:58 | FromDiscord | <Elegantbeef> None |
00:18:06 | FromDiscord | <Elegantbeef> I use my own framework that uses opengl + sdl2 |
00:18:09 | FromDiscord | <Elegantbeef> It's very barebones |
00:18:16 | FromDiscord | <Arathanis> oohhh rolled your own, even cooler |
00:18:29 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/examples/guitest.nim# |
00:18:31 | FromDiscord | <Arathanis> opengl bindings and sdl2 bindings? |
00:19:03 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1108186887044223046/image.png |
00:19:07 | FromDiscord | <Elegantbeef> That code powers that gui |
00:19:51 | FromDiscord | <Elegantbeef> It does have the basic things like layout groups, text input, drop down, sliders |
00:19:52 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1108187092334424074/image.png |
00:20:12 | FromDiscord | <Arathanis> any recommended resources for learning about this stuff? like shaders and everything? |
00:20:21 | FromDiscord | <Elegantbeef> learnopengl.com |
00:20:23 | FromDiscord | <Arathanis> game programming always feels like such an unapproachable monolith |
00:20:40 | FromDiscord | <Elegantbeef> I learned a lot of it from Unity and just had to transition that knowledge |
00:20:54 | FromDiscord | <Elegantbeef> I did a fair bit of technical art in Unity before learning Nim |
00:21:22 | FromDiscord | <Arathanis> oh that is cool, would you recommend starting there? in unity, i mean? |
00:21:48 | FromDiscord | <Elegantbeef> Meh it's all the same wherever you go |
00:21:57 | FromDiscord | <Elegantbeef> Godot, Unity, Opengl, Shadered it's all the same 😄 |
00:22:02 | FromDiscord | <Elegantbeef> Shadered might be nice to learn technical art |
00:22:07 | FromDiscord | <Elegantbeef> Havent used it myself |
00:22:50 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/videos/pointrenderer.mp4 was the most cool thing I did in Unity |
00:23:33 | FromDiscord | <Arathanis> In reply to @Elegantbeef "https://www.jasonbeetham.com/videos/pointrenderer.m": neat drugs |
00:25:19 | FromDiscord | <Elegantbeef> The cool thing about that is it has motion blur |
00:25:28 | FromDiscord | <Elegantbeef> Due to the rays being shot out every so often |
00:26:43 | FromDiscord | <Arathanis> was that hard to implement? |
00:34:00 | FromDiscord | <Elegantbeef> Not really |
00:34:13 | FromDiscord | <Elegantbeef> It's a geometry shader that renders a structured buffer every frame |
00:34:31 | * | jmdaemon quit (Ping timeout: 240 seconds) |
00:34:46 | FromDiscord | <Elegantbeef> It looks nice and fancy when only using geometry colliders, as soon as you add in mesh colliders it explodes though |
00:35:26 | FromDiscord | <Elegantbeef> It did have some interesting look when using different textures, probably could do it in screen space with noise |
00:36:18 | FromDiscord | <Elegantbeef> screenspace with noise would be much much cheaper as you'd just render the world to a small buffer then render your quads to another buffer using noise to dictate whether to draw a quad and what rotation it has |
00:48:55 | FromDiscord | <BoomBang> In reply to @BoomBang "I just meant that": I'll test `parseEval()` |
00:49:41 | FromDiscord | <Elegantbeef> Test what? |
00:57:19 | FromDiscord | <BoomBang> dangit |
00:57:27 | FromDiscord | <BoomBang> Clyde lied |
00:58:04 | FromDiscord | <Elegantbeef> Same |
01:01:10 | FromDiscord | <BoomBang> i guess ai shouldn't be trusted sometimes |
01:01:14 | FromDiscord | <BoomBang> it does guess |
01:01:30 | FromDiscord | <Elegantbeef> Of course it shouldnt be |
01:01:57 | FromDiscord | <Elegantbeef> Compiler contributors probably know more than AI about an obscure programming language |
01:02:02 | FromDiscord | <Elegantbeef> We told you why you cannot do what you want |
01:02:13 | FromDiscord | <Elegantbeef> A Nim binary does not have a procedure it does not use |
01:03:39 | * | jmdaemon joined #nim |
01:12:14 | * | nanxiao joined #nim |
01:32:20 | * | krux02 quit (Remote host closed the connection) |
02:00:43 | * | nanxiao quit (Quit: Client closed) |
02:03:47 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4w0W |
02:05:06 | FromDiscord | <!&luke> im using nim 1.6.4 with nimble 0.13.1 |
02:05:29 | FromDiscord | <!&luke> although the error is still there with nim 1.6.12 |
02:10:04 | FromDiscord | <Elegantbeef> You're parsing a json file somewhere |
02:14:25 | FromDiscord | <!&luke> Nope |
02:14:32 | FromDiscord | <!&luke> Haven’t even imported json |
02:14:45 | FromDiscord | <Elegantbeef> Something is parsing a json |
02:15:04 | FromDiscord | <!&luke> I’ll send my code, give me a second |
02:15:20 | FromDiscord | <!&luke> It compiles fine with nim |
02:15:26 | FromDiscord | <!&luke> Just not with nimble |
02:15:31 | FromDiscord | <Elegantbeef> Probably an issue with json files inside your `.nimble` |
02:15:43 | FromDiscord | <Elegantbeef> delete the json files inside `~/.nimble` |
02:16:21 | * | nanxiao joined #nim |
02:16:41 | FromDiscord | <!&luke> Oh ok |
02:16:45 | FromDiscord | <!&luke> I’ll try that |
02:48:49 | FromDiscord | <!&luke> Yea that worked |
02:48:51 | FromDiscord | <!&luke> Thanks |
03:01:20 | * | cm quit (Ping timeout: 246 seconds) |
03:02:11 | * | cm joined #nim |
03:20:03 | FromDiscord | <voidwalker> hey @ElegantBeef please take a look at: https://play.nim-lang.org/#ix=4w19 - the concept from last night, any idea why it doesn't match up with the bit vectors ? |
03:43:07 | * | nanxiao quit (Quit: Client closed) |
03:47:22 | * | greaser|q is now known as GreaseMonkey |
03:55:05 | FromDiscord | <michaelb.eth> Maybe beef should setup an online tip jar 😄 |
03:58:01 | FromDiscord | <voidwalker> I have a theory he is secretely hired to be here by the Nim guys |
03:58:32 | FromDiscord | <Elegantbeef> You think someone would pay my dumbass? |
03:59:41 | FromDiscord | <voidwalker> I would. It's a worthwhile investment. People are already complaining the community is small. Well, we don't need a big community if we have super helper like beef : D |
03:59:49 | FromDiscord | <voidwalker> (edit) "helper" => "helpers" |
04:00:52 | FromDiscord | <voidwalker> As for the tip jar, I would pay if I could give $1 at a time without much overhead : P |
04:03:51 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "You think someone would": uh, yeah! |
04:04:17 | FromDiscord | <michaelb.eth> it's the ancient art of freelance pay-as-you-go consulting |
04:06:48 | NimEventer | New thread by void09: Help with generics and typeclass problem, see https://forum.nim-lang.org/t/10202 |
04:07:00 | FromDiscord | <voidwalker> Look what you made me do beef :\ |
04:07:21 | FromDiscord | <Rika> you need to parenthesise the array or seq |
04:07:31 | FromDiscord | <Rika> then you get another error, which im looking into |
04:07:40 | FromDiscord | <voidwalker> huh ? |
04:08:01 | FromDiscord | <Rika> so this should be in your concept `abv.Base is (array or seq)` it seems, i'm seeing if this is even correct syntax |
04:08:15 | FromDiscord | <Rika> but it seems like its correct yes |
04:08:48 | FromDiscord | <voidwalker> oh you mean for the concept definition |
04:09:11 | FromDiscord | <Rika> im looking into the next error, it reads really strangely |
04:09:30 | FromDiscord | <Rika> ah |
04:10:45 | FromDiscord | <Rika> so in the `count` proc you need to convert the results of the popcount functions into `uint` without explicit bit count |
04:11:11 | FromDiscord | <Rika> but i have to ask, why the variable size uint? |
04:11:26 | FromDiscord | <Rika> (edit) "so in the `count` proc you need to convert the results of the popcount functions into ... `uint`type," added "the" | "the`uint` ... without" added "type," |
04:11:36 | FromDiscord | <Rika> (edit) "variable" => "variably" |
04:11:48 | FromDiscord | <voidwalker> well, for whatever reason. As the code is now, it seems a bit faster on byte values vs 64bit values, which is surprising |
04:11:54 | FromDiscord | <voidwalker> 32bit ones were the slowest |
04:12:57 | FromDiscord | <Rika> well, you're the one knowledgeable here so, yeah, but yeah |
04:13:26 | FromDiscord | <voidwalker> and why not, flexibility is good |
04:14:12 | FromDiscord | <voidwalker> I also want to make "safe" ones, with bounds checking, and unsafe, for max speed |
04:15:43 | FromDiscord | <voidwalker> Although not really sure how, maybe define a duplicate type "BitVectorSafe", and check in the procs with "when bv is BitVectorSafe": do bounds check before proceeding |
04:16:33 | FromDiscord | <Rika> In reply to @voidwalker "and why not, flexibility": idk its just a common sniff to point out, just in case someone has made an error because they hadnt realised that uint can be 32 bits in 32 bit systems and 64 in 64s |
04:17:02 | FromDiscord | <Rika> but, and i mean this legitimately, only you know what you're really doing, i just meant to point it out in case |
04:17:57 | FromDiscord | <voidwalker> Actually I don't really know that much what I'm doing, it's a learn as you go type of thing : P |
04:18:12 | FromDiscord | <voidwalker> only goal is to join in a single lib as much functionality as possible regarding bitvectors |
04:18:23 | FromDiscord | <voidwalker> and look into simd instructions to optimise in some places |
04:19:20 | FromDiscord | <voidwalker> so it seems the only problem with my concept was the paranthesis.. lol |
04:19:31 | FromDiscord | <Rika> yeah im not knowledgeable in lower level optimisation like that |
04:19:56 | FromDiscord | <voidwalker> well it's a simple and old data structure. The popcount code I copied from wikipedia : D |
04:20:45 | FromDiscord | <voidwalker> Ok i'm going to go with concept for now, until/if nim forum people can figure an alternative way |
04:22:08 | FromDiscord | <voidwalker> Would be nice though if discord had a "virtual" tip jar function, even if just to keep track of tips until a sum large enough to worth transfering accumulates |
04:22:51 | FromDiscord | <Elegantbeef> If i wasnt an idiot i'd have setup github sponsor 😛 |
04:23:36 | FromDiscord | <voidwalker> that's recurring paymnets, for rich people |
04:26:18 | FromDiscord | <sOkam!> In reply to @Arathanis "any recommended resources for": learnopengl takes one step, then ten at once when it shouldn't, and then assumes you understood what you did in all those missing explanations (probably didn't, because most stuff is hardcoded as numbers without labels)↵ogldev is much better, 100% |
04:27:10 | FromDiscord | <sOkam!> after you finish the beginner section of his tuts, you can go ahead an scrap what you need from opengl. but for starting out, ogldev is way more intuitive and assumes nothing about your existing knowledge |
04:27:27 | FromDiscord | <sOkam!> (edit) "opengl." => "learnopengl and any other tuts." |
04:28:51 | * | derpydoo joined #nim |
04:29:13 | FromDiscord | <sOkam!> @ElegantBeef is the rewrite to trussui ever happening? such that it outputs an image that you can render, instead of rendering auto? |
04:29:18 | FromDiscord | <Elegantbeef> To be fair sokam at times you can be a little dense |
04:29:30 | FromDiscord | <Elegantbeef> "outputs an image that you can render"? |
04:29:33 | FromDiscord | <sOkam!> i am definitely dense af, agreed |
04:29:56 | FromDiscord | <sOkam!> slow coder brain issues 😔 |
04:30:03 | FromDiscord | <Elegantbeef> In theory it should be pluggable |
04:30:39 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1l |
04:30:43 | FromDiscord | <sOkam!> In reply to @Elegantbeef "In theory it should": kk. haven't looked into it enough. haven't reached that part yet. but hoping I an soon |
04:30:52 | FromDiscord | <voidwalker> I still have a problem with the len proc, probably the only one that needs the S parameter present only in one of the types |
04:30:53 | FromDiscord | <sOkam!> (edit) "an" => "can" |
04:31:07 | FromDiscord | <voidwalker> Error: undeclared identifier: 'AnyBitVecS' |
04:31:11 | FromDiscord | <voidwalker> ah nvm |
04:31:21 | FromDiscord | <voidwalker> I deleted that type for now |
04:31:31 | FromDiscord | <Rika> `typeof(bv).S` should get you the value of S when bv is AnyBitVecS |
04:31:46 | FromDiscord | <Rika> i mean, BitVecS |
04:32:04 | FromDiscord | <Elegantbeef> Sokam this is the present state of my rewrite, it doesnt function but it's a start https://github.com/beef331/truss3d/blob/guirewrite/src/truss3D/guicomponents/uielements.nim#L34 |
04:32:19 | FromDiscord | <Elegantbeef> Whoops that was the issue i was going to mention |
04:32:25 | FromDiscord | <Elegantbeef> I do presently have `Texture` built in |
04:32:33 | FromDiscord | <voidwalker> Error now is ` Error: undeclared identifier: 'S'` |
04:32:37 | FromDiscord | <Elegantbeef> In theory though I should be able to abstract it all away |
04:32:47 | FromDiscord | <Rika> really? i expected it to work |
04:32:47 | FromDiscord | <sOkam!> oh you started it? nice |
04:32:49 | FromDiscord | <Elegantbeef> `bv.S` |
04:33:09 | FromDiscord | <Rika> In reply to @Elegantbeef "`bv.S`": i thought either would work |
04:33:13 | FromDiscord | <Elegantbeef> The main focus is on making the code better to work with for me |
04:33:21 | FromDiscord | <Elegantbeef> There is no `S` bound in the proc |
04:33:24 | FromDiscord | <sOkam!> In reply to @Elegantbeef "In theory though I": what would be the goal output? just a sequence of color/bytes? |
04:33:30 | FromDiscord | <Rika> i meant what i said `typeof(bv).S` |
04:33:48 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1m |
04:33:56 | FromDiscord | <Elegantbeef> Nah sokam i could make the entire upload stuff procedures |
04:33:57 | FromDiscord | <Rika> yeah, i thought that wouldwork |
04:34:00 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4w1m" => "https://play.nim-lang.org/#ix=4w1n" |
04:34:05 | FromDiscord | <Elegantbeef> That way you could plug in any graphics API you want |
04:34:11 | FromDiscord | <voidwalker> this gives ` Error: undeclared field: 'S'` |
04:34:25 | FromDiscord | <Rika> try what beef said, bv.S |
04:34:27 | FromDiscord | <sOkam!> yeah my concern is because of using it with wgpu |
04:34:34 | FromDiscord | <sOkam!> if you figure out a way to make it pluggable, all good |
04:34:56 | FromDiscord | <Elegantbeef> The main goal is not plugabillity but it might end up plugable due to my love of generics 😄 |
04:35:02 | FromDiscord | <sOkam!> 🙂 |
04:35:20 | FromDiscord | <sOkam!> whats the output format of the ui generation? |
04:35:29 | FromDiscord | <Elegantbeef> There is no output |
04:35:38 | FromDiscord | <sOkam!> every function has an output |
04:35:39 | FromDiscord | <Elegantbeef> Like i said you'd plug a `uploadProc` |
04:35:52 | FromDiscord | <Elegantbeef> Nope |
04:35:59 | FromDiscord | <Arathanis> In reply to @sOkam! "learnopengl takes one step,": nice, thanks for the resource |
04:36:07 | FromDiscord | <Elegantbeef> All I'm defining is going to be the layout/interact logic |
04:36:18 | FromDiscord | <Elegantbeef> Rendering should be done in such away you can use any backend/api |
04:37:11 | FromDiscord | <Elegantbeef> I like retained mode GUI and static typing |
04:37:33 | FromDiscord | <sOkam!> In reply to @Arathanis "nice, thanks for the": if you ever need modern graphics concepts, this tut is invaluable. but definitely not for beginner stuff. you need a couple of months of graphics in your belt to understand it. just bookmark it somewhere↵https://www.youtube.com/watch?v=UVCuWQV_-Es |
04:37:48 | FromDiscord | <Elegantbeef> So all i'm really working on is a group of procedures to work on objects that inherit from `UIElement` and tuples that are made of `UIElement` |
04:38:16 | FromDiscord | <Arathanis> is there a recommended opengl binding library you would all Recommend? |
04:38:20 | FromDiscord | <sOkam!> right, so whats the input to those uploadProc procedures then? |
04:38:28 | FromDiscord | <Elegantbeef> the official Nim are fine |
04:38:32 | FromDiscord | <sOkam!> In reply to @Arathanis "is there a recommended": the official bindings work well |
04:38:36 | FromDiscord | <Elegantbeef> a `UIElement` |
04:38:37 | FromDiscord | <sOkam!> nimgl/opengl is not maintained |
04:39:01 | FromDiscord | <sOkam!> In reply to @Elegantbeef "a `UIElement`": and what data does that have? that's what i meant by output format |
04:39:11 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/guirewrite/src/truss3D/guicomponents/uielements.nim#L28-L35 |
04:39:50 | FromDiscord | <sOkam!> so you would render each element one by one, if i understand correctly? |
04:39:55 | FromDiscord | <Elegantbeef> Nope |
04:40:12 | FromDiscord | <Elegantbeef> `proc upload(ui: UiElement, yourBuffer: var T)` is what i'd do |
04:40:16 | FromDiscord | <Elegantbeef> So if you use instanced rendering go ham |
04:40:21 | FromDiscord | <Elegantbeef> If you use direct rendering same |
04:40:23 | FromDiscord | <Arathanis> In reply to @sOkam! "the official bindings work": do they have docs? or do you just use the opengl docs and the function names and signatures are the same? |
04:40:36 | FromDiscord | <Elegantbeef> You just use opengl docs |
04:40:39 | FromDiscord | <sOkam!> In reply to @Arathanis "do they have docs?": names are the exact same. just follow the usual opengl tuts |
04:40:45 | FromDiscord | <Arathanis> sweet deal |
04:40:47 | FromDiscord | <Elegantbeef> Opengl is the same everywhere |
04:40:48 | FromDiscord | <sOkam!> or official spec |
04:41:03 | FromDiscord | <Arathanis> time to go oscillate between feeling like a genious and an idiot |
04:41:08 | FromDiscord | <Arathanis> i love learning new complex software stuff |
04:41:21 | FromDiscord | <Arathanis> even misspelled genius |
04:41:25 | FromDiscord | <Arathanis> well on my way! |
04:41:27 | FromDiscord | <Elegantbeef> It's all statically typed Sokam so you just write a basic procedure to upload your GUI |
04:41:29 | FromDiscord | <sOkam!> @Arathanis whats your goal? maybe i can recommend something specific if you have specific goals in mind |
04:41:40 | FromDiscord | <sOkam!> opengl is a big api, so its very useful to target just what you want |
04:42:07 | FromDiscord | <Arathanis> In reply to @sOkam! "<@136570191038513152> whats your goal?": ive always wanted to make a roguelike/roguelite |
04:42:29 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1o |
04:42:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4w1p |
04:43:08 | FromDiscord | <sOkam!> ah the uploadproc doesn't work on the element, thats very different |
04:43:26 | FromDiscord | <Elegantbeef> I mean it does work on the element 😛 |
04:43:38 | FromDiscord | <Elegantbeef> For each element inside a tree it runs |
04:43:39 | FromDiscord | <sOkam!> but it can be a tuple. that changes things completely |
04:44:32 | FromDiscord | <Elegantbeef> A tuple in my world is just another way to represent a UI tree |
04:44:33 | FromDiscord | <sOkam!> so you take care of the layout and interact procs, and then let the user implement the upload one, right? |
04:44:41 | FromDiscord | <Elegantbeef> They can implement all three |
04:44:50 | FromDiscord | <Elegantbeef> But i have a default one for all UI elements |
04:45:01 | FromDiscord | <sOkam!> In reply to @Elegantbeef "A tuple in my": correct. but an element is not a ui tree. so... not knowing that they can be both... changes a lot |
04:45:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4w1r |
04:45:21 | FromDiscord | <Arathanis> but also it just seems like it would be something to knpw |
04:45:22 | FromDiscord | <Arathanis> (edit) "knpw" => "know" |
04:45:33 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4w1s |
04:45:48 | FromDiscord | <sOkam!> In reply to @Arathanis "ive always wanted to": 2d or 3d? i assume 2d, right? |
04:45:51 | FromDiscord | <Rika> did bv.S on its own work without the S generic in the function? |
04:46:08 | FromDiscord | <Arathanis> In reply to @sOkam! "2d or 3d? i": id probably start 2d, yeah |
04:46:18 | FromDiscord | <sOkam!> then you can stick to gl3 |
04:46:22 | FromDiscord | <Arathanis> maybe go to 3d eventually, i cant imagine its that much different right? |
04:46:31 | FromDiscord | <sOkam!> aka 99% of tutorials out there use opengl3 |
04:46:33 | FromDiscord | <voidwalker> Hm it seems I can ommit them, strange |
04:46:56 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1t |
04:47:12 | FromDiscord | <sOkam!> In reply to @Arathanis "maybe go to 3d": slightly, if you want really modern tech. but leave that for future you. if you have a 2d goal, you can learn the api in 2d just fine. all of it is the same, just simpler |
04:47:24 | FromDiscord | <sOkam!> (edit) "tech." => "tech is a bit different." |
04:47:33 | FromDiscord | <Arathanis> is it not linear algebra all the way down? |
04:47:35 | FromDiscord | <Arathanis> :P |
04:47:51 | FromDiscord | <sOkam!> ye, but the api for modern 3D is very lacking |
04:48:02 | FromDiscord | <sOkam!> for not-so-modern 3d its fine |
04:48:19 | FromDiscord | <Elegantbeef> A 2D opengl renderer is very simpler to write |
04:48:22 | FromDiscord | <Elegantbeef> simple even |
04:48:31 | FromDiscord | <sOkam!> and by lacking i just mean in usability. you can do rendering perfectly fine with it |
04:48:39 | FromDiscord | <Elegantbeef> Anyway sokam hopefully you can understand that basically the entire API is plugable and static |
04:48:58 | FromDiscord | <Elegantbeef> Did you look at my small impl example? |
04:49:16 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Anyway sokam hopefully you": yeah! i was just not understanding how the thing connects to the entire ui and not just one element. but if elements can be tuples, then understood ✍️ |
04:49:18 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4w0J this thing |
04:49:20 | FromDiscord | <Arathanis> well ill start with the tutorial you recommended and get back to you on my goals I think, if you have any recommendations based on what i already said feel free to send them over |
04:49:58 | FromDiscord | <sOkam!> In reply to @Arathanis "well ill start with": feel free to @ me here or in #gamedev if you have any questions. been doing ogl stuff for a few months, so its fresh in my mind |
04:50:12 | FromDiscord | <Arathanis> In reply to @sOkam! "feel free to @": appreciate it |
04:50:53 | FromDiscord | <sOkam!> @Arathanis https://github.com/heysokam/ngl might be useful as a reference, since its all opengl and nim (but uses DSA only, which is the part i mentioned is a bit different) |
04:51:35 | FromDiscord | <sOkam!> its overly complex though. so don't let that take away from the motivation. i overengineered the crap out of that thing by my lack of knowledge |
04:51:45 | FromDiscord | <Elegantbeef> I did sorta want to do something like sdl2-gpu after trying to help prestige with his problems |
04:51:48 | FromDiscord | <sOkam!> (edit) "knowledge" => "knowledge. it should be much simpler" |
04:52:31 | FromDiscord | <sOkam!> In reply to @Elegantbeef "I did sorta want": sdl2-gpu? whats that? |
04:52:51 | FromDiscord | <Elegantbeef> It's a library that makes a 2d rendering api ontop of sdl |
04:52:53 | FromDiscord | <Elegantbeef> It's awful ime |
04:53:10 | FromDiscord | <sOkam!> oh just 2d stuffs? didn't know about it |
04:53:23 | FromDiscord | <Elegantbeef> Prestige built his game on it and it was convoluted to even try to get a framebuffer to work |
04:53:24 | FromDiscord | <Arathanis> In reply to @Elegantbeef "It's awful ime": is "ime" mean "in my estimation"? |
04:53:30 | FromDiscord | <Arathanis> (edit) "is" => "does" |
04:53:37 | FromDiscord | <Elegantbeef> experience |
04:53:43 | FromDiscord | <Arathanis> got it |
04:53:45 | FromDiscord | <Elegantbeef> One day i'll actually stop using abbreviations |
04:54:07 | FromDiscord | <Rika> input method editor |
04:54:13 | FromDiscord | <Arathanis> In reply to @Elegantbeef "One day i'll actually": isnt that technically an initialism? |
04:54:47 | FromDiscord | <sOkam!> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4w0J this thing": looks handy. i like it |
04:55:07 | FromDiscord | <Elegantbeef> > An abbreviation consisting of the first letter or letters of words in a phrase |
04:55:08 | FromDiscord | <Rika> In reply to @Arathanis "isnt that technically an": "same difference" |
04:56:12 | FromDiscord | <Elegantbeef> Obviously sokam something like `Grid` would require implementing your own `layout` and likely `interact` |
04:59:46 | FromDiscord | <Elegantbeef> Though these may need to be `ref object` .... hmph |
04:59:51 | FromDiscord | <sOkam!> by grid you mean like html bootstrap? |
05:00:08 | FromDiscord | <sOkam!> https://getbootstrap.com |
05:00:16 | FromDiscord | <Elegantbeef> No clue |
05:00:17 | FromDiscord | <Elegantbeef> I mean a grid layout |
05:00:21 | FromDiscord | <Elegantbeef> Where you have elements in a screen like a video game inventory |
05:00:32 | FromDiscord | <sOkam!> oh ic |
05:00:50 | FromDiscord | <sOkam!> i thought you meant a responsive grid, not a fixed sized one |
05:01:20 | FromDiscord | <Elegantbeef> Meh this is game UI, not like you really need it that responsive in my view |
05:01:58 | FromDiscord | <sOkam!> more like slightly adaptive than responsive i guess |
05:02:14 | FromDiscord | <sOkam!> just to accomodate for different window sizes a bit |
05:02:34 | FromDiscord | <sOkam!> but nothing like web or phone, where literally everything needs to resize well |
05:02:44 | FromDiscord | <Elegantbeef> The only layout i'm really concerned with is vertical/horizontal |
05:04:16 | FromDiscord | <sOkam!> i guess if its abstracted in a way that you can code your own layout, like you said, it really should be no probl |
05:07:27 | FromDiscord | <Elegantbeef> Well you'd be able to write your own elements completely, is the hope |
05:09:56 | FromDiscord | <sOkam!> that would be epic |
05:12:00 | FromDiscord | <voidwalker> concept can affect runtime performance vs using normal type class ? |
05:12:16 | FromDiscord | <Elegantbeef> concepts are generic constraints that is it |
05:12:17 | FromDiscord | <Elegantbeef> They do not exist at runtime |
05:12:34 | FromDiscord | <voidwalker> welp, then why do I get 10s runtime instead of 10 ms |
05:12:47 | FromDiscord | <Rika> try disassembling it first in godbolt or similar |
05:12:53 | FromDiscord | <Elegantbeef> You did it wrong |
05:13:04 | FromDiscord | <Rika> are you sure you're measuring runtime |
05:13:09 | FromDiscord | <Rika> and not compile+run time |
05:13:29 | FromDiscord | <Rika> concepts do have a relatively significant impact on compile time |
05:13:49 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1x |
05:14:09 | FromDiscord | <voidwalker> simply switching between these two (and adjusting S,B generic params on procs so they compile), gets me from 10 to 10.000ms ;\ |
05:14:28 | FromDiscord | <Elegantbeef> You're doing something wrong |
05:14:42 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1y |
05:14:58 | FromDiscord | <voidwalker> interestingly, setting values is not affected |
05:15:16 | FromDiscord | <Rika> that honestly makes no sense, it shouldnt really affect run time that much |
05:15:25 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1z |
05:15:25 | FromDiscord | <Rika> how are you measuring? |
05:15:28 | * | rockcavera quit (Remote host closed the connection) |
05:15:49 | FromDiscord | <voidwalker> well, with timeIt, and also my internal clock that tells me that's not 10ms, but more like 10s |
05:16:13 | FromDiscord | <Rika> yes but i mean |
05:16:18 | FromDiscord | <Rika> what commands are you running |
05:16:26 | FromDiscord | <Rika> that you are timing |
05:16:34 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1A |
05:16:39 | FromDiscord | <voidwalker> first two loops with setting values are not affected |
05:17:00 | FromDiscord | <Rika> are you measuring the time iwthin the code? |
05:17:14 | FromDiscord | <voidwalker> huh ? |
05:17:21 | FromDiscord | <Rika> ah waittimeit |
05:17:24 | FromDiscord | <Rika> (edit) "waittimeit" => "wait timeit yeah you are" |
05:17:30 | FromDiscord | <Rika> nevermind i was thinking in python somehow |
05:17:42 | FromDiscord | <voidwalker> I measured for each loop as well, and it is ~10 us, instead of <=1 us |
05:17:58 | FromDiscord | <Rika> i can only really recommend disassembly... |
05:18:31 | FromDiscord | <hdbg> Or vieweing generated code |
05:31:21 | FromDiscord | <voidwalker> https://godbolt.org/z/5P7Wv7sza |
05:32:10 | FromDiscord | <voidwalker> can't figure out how to find the code generated for the last line |
05:32:41 | FromDiscord | <that_dude> You are compiling in release right? |
05:33:12 | FromDiscord | <voidwalker> hm no, but I was compiling with debug before and it was fast |
05:33:35 | FromDiscord | <that_dude> iirc gcc optimizations don't get applied with debug |
05:34:05 | FromDiscord | <voidwalker> hm okay it is fast again with release |
05:34:35 | FromDiscord | <voidwalker> but why does this happen when using concept, and why 1000x slowdown |
05:35:03 | FromDiscord | <Elegantbeef> It's not the concept |
05:35:06 | FromDiscord | <Elegantbeef> It's what the code is doing |
05:35:24 | FromDiscord | <that_dude> No clue about that tbh. I just know that measurements are better done in release or danger |
05:35:48 | FromDiscord | <voidwalker> oh wait, maybe with release it optimizes a for i in 0..1_000_000 discard value to.. nothing ? |
05:36:05 | FromDiscord | <voidwalker> cause it runs in 979 ns for 20 million iterations lol |
05:36:21 | FromDiscord | <Rika> its possible, yes |
05:36:21 | FromDiscord | <voidwalker> (edit) "20" => "2" |
05:36:59 | FromDiscord | <that_dude> https://github.com/treeform/benchy has a keep proc. May help avoid some things getting removed |
05:40:37 | NimEventer | New thread by domogled: Std/paths and $ proc, see https://forum.nim-lang.org/t/10203 |
05:40:57 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1D |
05:41:12 | FromDiscord | <voidwalker> first one takes forever, (10+ seconds idk), while second form is instant. what happens ? |
05:41:54 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4w1D" => "https://play.nim-lang.org/#ix=4w1E" |
05:45:05 | FromDiscord | <Arathanis> @sOkam! do you need to install the official bindings for opengl? |
05:46:27 | FromDiscord | <Arathanis> looks like that is a yes |
05:49:47 | * | junaid_ joined #nim |
05:53:25 | * | junaid_ quit (Remote host closed the connection) |
05:54:05 | FromDiscord | <sOkam!> In reply to @Arathanis "<@186489007247589376> do you need": yep. `nimble install opengl`↵or just add `requires "opengl"` in your nimble file |
05:58:44 | FromDiscord | <Arathanis> In reply to @sOkam! "yep. `nimble install opengl`": sweet. |
05:59:06 | FromDiscord | <Arathanis> whats the best way to coerce argc and argv into the ptr cint and pointer that glutInit expect? |
05:59:32 | FromDiscord | <sOkam!> i would recommend glfw instead of glut |
05:59:54 | FromDiscord | <Arathanis> ah, the tutorial you sent me opened with glut haha, should i skip that one? |
05:59:56 | FromDiscord | <sOkam!> or even `windy`, which might be simpler to start with (although a bit more lacking in tuts) |
06:00:06 | FromDiscord | <Elegantbeef> sdl2, windy, gflw, anything but glut |
06:00:09 | FromDiscord | <Elegantbeef> Or even glew |
06:00:12 | FromDiscord | <sOkam!> pretty much |
06:00:32 | FromDiscord | <Elegantbeef> I think glew is better i cannot remember |
06:00:35 | FromDiscord | <sOkam!> In reply to @Arathanis "ah, the tutorial you": yeah, just take a `hello window` from glfw or windy, and fuck glut |
06:00:44 | FromDiscord | <sOkam!> its outdated af |
06:01:03 | FromDiscord | <Arathanis> got it, are sdl2, windy, gflw, etc all other libraries i should install? |
06:01:08 | FromDiscord | <Arathanis> well, pick 1 and install |
06:01:40 | FromDiscord | <sOkam!> yeah just one of them |
06:01:51 | FromDiscord | <sOkam!> windy is like the glut of nim |
06:02:16 | FromDiscord | <Arathanis> would either of you recommend one over the others? |
06:02:17 | FromDiscord | <sOkam!> glfw gives more freedom/control, but also less abstraction. not much though |
06:02:22 | FromDiscord | <Elegantbeef> I use sdl2 |
06:02:27 | FromDiscord | <Elegantbeef> I'm lazy and it works well |
06:03:15 | FromDiscord | <sOkam!> In reply to @Arathanis "would either of you": i like glfw the most, i don't like the idea behind sdl2/glut/windy and similars. i would rather have the extra control↵but its either glfw/windy for me as a recommendation. just choose what you find more comfy |
06:03:55 | FromDiscord | <Arathanis> recommended library for the bindings for those two options? |
06:04:01 | FromDiscord | <Arathanis> ill take a look at both and pick one |
06:04:07 | FromDiscord | <sOkam!> most up to date glfw bindings I know of: https://github.com/heysokam/nglfw↵windy is @https://github.com/treeform/windy |
06:04:29 | FromDiscord | <sOkam!> nimgl/glfw was popular a while back, but its very much abandoned for 2y |
06:04:58 | FromDiscord | <Arathanis> a lot of otherwise cool looking nim libraries are abandonware :/ |
06:04:59 | FromDiscord | <sOkam!> both of those repos have a hello window example in the `examples` folder, so you can compare |
06:09:51 | FromDiscord | <JJ> anything treeform is unlikely to be abandonware |
06:10:12 | FromDiscord | <JJ> reminds me i really need to actually get my project with windy and pixie working again though |
06:22:40 | * | nanxiao joined #nim |
06:39:52 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1J |
06:41:48 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4w1J" => "https://play.nim-lang.org/#ix=4w1O" |
06:59:15 | FromDiscord | <Rika> Wow that’s slow, but, 105 seconds? |
07:03:23 | FromDiscord | <voidwalker> yeah idk timeit bugs, I will try to switch to benchy |
07:04:09 | FromDiscord | <voidwalker> Ok so the C code is indeed very hairy and a total spaghetti monster, no chance of me figuring out what goes on there |
07:05:04 | FromDiscord | <Rika> There are a set of compiler options you can activate to make it easier to read the C code but I don’t know them, gotta ask beef for that hahaha |
07:05:21 | FromDiscord | <Rika> I know that using danger, and using ARC will make it cleaner in C code |
07:05:31 | FromDiscord | <voidwalker> already switched to danger |
07:05:32 | FromDiscord | <Elegantbeef> `-d:danger --mm:arc` is all I do |
07:05:49 | FromDiscord | <Rika> I was under the impression that there were more options |
07:05:55 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=4w1S |
07:06:18 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w1T |
07:07:42 | FromDiscord | <voidwalker> and yeah I checked, it actually does the job of setting the bits |
07:07:49 | FromDiscord | <Rika> Yeah benchmarking is a bit finicky because of the optimisations, maybe use the tree form library because of the keep template |
07:07:53 | FromDiscord | <Rika> Oh really |
07:08:43 | FromDiscord | <voidwalker> oh wait |
07:09:06 | FromDiscord | <voidwalker> i'm blind, not enough coffee, i had i mod 2, instead of bv2[i] mod 2 |
07:10:06 | FromDiscord | <voidwalker> so the getter `[]` proc is fcked somehow |
07:10:18 | FromDiscord | <voidwalker> writing values = fast, reading them = super slow |
07:11:28 | FromDiscord | <voidwalker> but only if using concept, if I use the normal typeclass it's okay |
07:22:27 | * | Notxor joined #nim |
07:24:28 | FromDiscord | <voidwalker> well, copied some clean code in another file where I had the concept version, and it runs fast there.. now to diff it |
07:32:07 | FromDiscord | <voidwalker> ah nvm it doesn't |
07:36:20 | FromDiscord | <voidwalker> concept code: https://play.nim-lang.org/#ix=4w1X typeclass code: https://play.nim-lang.org/#ix=4w1Y |
07:38:56 | * | azimut quit (Ping timeout: 240 seconds) |
07:41:27 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4w20 |
07:41:47 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4w20" => "https://play.nim-lang.org/#ix=4w21" |
07:42:58 | FromDiscord | <voidwalker> var numbers = (0..16).toSeq |
07:43:23 | FromDiscord | <Rika> 0u8..16u8 |
07:43:30 | FromDiscord | <voidwalker> (edit) "(0..16).toSeq" => "(0'u8..16'u8).toSeq" |
07:43:33 | FromDiscord | <Rika> Need to put suffix for type |
07:43:33 | FromDiscord | <voidwalker> forgot : P |
07:44:05 | FromDiscord | <voidwalker> oh it works without the ` |
07:44:29 | FromDiscord | <voidwalker> (edit) "`" => "'" |
07:44:58 | FromDiscord | <voidwalker> would it be very rude if I asked about my problem in #internals ? : P |
07:45:47 | FromDiscord | <Rika> Which one |
07:45:55 | FromDiscord | <Rika> Oh the performance |
07:46:17 | FromDiscord | <voidwalker> well, the current one is why tf does it take 19 minutes to access values in a bit array if using a concept type |
07:46:18 | FromDiscord | <Rika> We can always ping the optimisation pros here |
07:46:32 | FromDiscord | <Rika> In reply to @voidwalker "well, the current one": Okay then I’d say sure post it |
07:46:51 | FromDiscord | <voidwalker> I just hope I am not blind again and make a fool of myself |
07:47:20 | FromDiscord | <voidwalker> who can we ping ? |
07:49:35 | * | lucasta quit (Remote host closed the connection) |
07:58:41 | FromDiscord | <Rika> In reply to @voidwalker "concept code: https://play.nim-lang.org/#ix=4w1X ty": @mratsim sorry but we’re at a loss in terms of figuring out the performance issues from this |
07:59:56 | * | nanxiao quit (Quit: Client closed) |
08:09:08 | * | nanxiao joined #nim |
08:39:55 | FromDiscord | <sOkam!> easy enough, thanks. didn't know ranges have a toSeq proc |
08:47:04 | FromDiscord | <least antisemitic pole> nimsuggest memory improvements when? 😔 |
08:49:45 | FromDiscord | <least antisemitic pole> In reply to @sOkam! "easy enough, thanks. didn't": you can use `toSeq` on anything that can be iterated over tbh |
08:50:58 | FromDiscord | <sOkam!> true that. never thought about it that way |
08:51:42 | FromDiscord | <Elegantbeef> So it has started to be pluggable https://github.com/beef331/truss3d/blob/guirewrite/src/truss3D/guiimpl.nim 😄 |
08:53:10 | FromDiscord | <Elegantbeef> Only the base system can be pluggable though, so might not be worth the trouble 😄 |
09:18:12 | FromDiscord | <jmgomez> The API looks good beef, I dont like the `i` in `UiX`though |
09:23:18 | * | Guest74 joined #nim |
09:25:46 | FromDiscord | <Elegantbeef> What should it be a `W`? |
09:26:56 | FromDiscord | <Elegantbeef> I personally do not like any prefixing so I do agree though ax the entire `Ui` prefix |
09:28:01 | FromDiscord | <jmgomez> I would rather make it capital, get rid of it or get rid of the whole prefix |
09:28:41 | FromDiscord | <jmgomez> (edit) "capital," => "upper case," |
09:30:00 | FromDiscord | <Elegantbeef> Oh yay pointless uppercasing |
09:30:31 | * | Guest74 quit (Quit: Client closed) |
09:30:34 | FromDiscord | <Elegantbeef> This is Nim afterall you can use the incorrect spelling and be wrong in silence |
09:31:00 | FromDiscord | <Elegantbeef> Plus it's not like one actually needs to write `UiElement` more than once |
09:31:50 | FromDiscord | <Elegantbeef> I might be too sassy given that it's too late, so buh bye |
09:56:37 | * | nanxiao quit (Quit: Client closed) |
10:00:03 | FromDiscord | <jmgomez> Oh virtual just got merged into devel 😁 |
10:02:24 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4w2v |
10:03:22 | FromDiscord | <demotomohiro> Consts in NimNode tree returned from `macros.getImpl` |
10:04:11 | * | derpydoo quit (Read error: Connection reset by peer) |
10:05:43 | FromDiscord | <jmgomez> I’m on the phone but maybe by not using a literal works? |
10:21:34 | FromDiscord | <demotomohiro> In reply to @jmgomez "I’m on the phone": Declaring `let SomeConst = 1` instead of `const SomeConst = 1` works.↵But I cannot do that because I want to get proc body from modules in other libraries. |
10:24:54 | FromDiscord | <jmgomez> I meant calling a function to get 1 instead of assigning it. The replacement sounds to be done before the NimNodes are created. But if you don’t control the body probably there is no way around it |
10:24:55 | FromDiscord | <voidwalker> @demotomohiro thank you for the forum reply, you saved my sanity. I wonder if there is any other way to do it though |
10:31:22 | FromDiscord | <demotomohiro> In reply to @jmgomez "I meant calling a": Maybe this is impossible. I need to use `typed` parameter to use `getImpl` but that means symbol lookup are performed to the proc body.↵Anyway, thank you for your help! |
10:35:52 | FromDiscord | <demotomohiro> In reply to @voidwalker "<@288750616510201856> thank you for": You can implement `proc []()` for `BitVecS` and `BitVec` separately but they will have almost same code.↵I don't know any better other way. |
10:36:17 | FromDiscord | <voidwalker> well, the whole point was to not have separate implementations |
10:37:25 | FromDiscord | <voidwalker> Well, I can continue my work now, I will maybe submit it to some experts for code review further on : ) |
11:07:18 | * | Notxor quit (Remote host closed the connection) |
11:30:59 | * | dza quit (Quit: ) |
11:32:22 | * | dza joined #nim |
11:33:23 | * | dza quit (Client Quit) |
11:34:45 | * | dza joined #nim |
12:02:01 | * | dza quit (Quit: ) |
12:03:24 | * | dza joined #nim |
12:21:07 | FromDiscord | <voidwalker> Is there some syntax limitation with generics so that I can do `toBitVector[uint32]("lol")` but not `"lol".toBitVector[uint32]` ? it tells me it cannot instantiate the generic param |
12:23:41 | FromDiscord | <Rika> Add a colon before the generic type |
12:23:46 | FromDiscord | <Rika> Yes it’s a syntax limitation |
12:27:42 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w2U |
12:29:25 | FromDiscord | <voidwalker> does this look good ? It's suggested to use openArray[byte] for lowest level implementation and use other procs to convert to openArray byte ? |
12:30:18 | FromDiscord | <Rika> Seems fine to me, what are your concerns exactly |
12:30:26 | FromDiscord | <voidwalker> that I'm doing it wrong : P |
12:32:35 | FromDiscord | <voidwalker> can I define 2+ type names to share the same definition, on the same line ? like you do with vars |
12:32:45 | FromDiscord | <voidwalker> (edit) removed "like you do with vars" |
12:33:00 | FromDiscord | <Rika> No I don’t think so |
12:33:36 | FromDiscord | <voidwalker> then type alias it is |
12:34:50 | FromDiscord | <mratsim> In reply to @Rika "<@570268431522201601> sorry but we’re": Will have a look |
12:41:57 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w32 |
12:42:18 | FromDiscord | <voidwalker> this causes no compile errors but I get `execution of an external program failed:` |
12:42:47 | FromDiscord | <voidwalker> `./bitvec' terminated by signal SIGSEGV (Address boundary error)` |
12:52:23 | FromDiscord | <voidwalker> well, this is very strange indeed |
12:52:34 | FromDiscord | <gcao> hi, in asyncdispatch we have this proc:↵proc addTimer(timeout: int; oneshot: bool; cb: Callback)↵if oneshot is false, the timer will run periodically, how do we stop the timer?↵The Callback returns a boolean, if it returns false, will it stop the timer to run further? |
12:52:39 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4w33 |
12:53:36 | FromDiscord | <voidwalker> if I have i from `0..32` or larger, it causes sigsegv. ; o |
12:53:40 | FromDiscord | <gcao> In reply to @gcao "hi, in asyncdispatch we": By reading the source code, it doesn't look like so. However there should be a way to stop the timer I suppose |
12:53:41 | FromDiscord | <Piko> what's the simplest way to pass an object literal to a JS function from nim? suppose I want to execute `something({foo: true, bar: 42})` |
12:53:43 | FromDiscord | <albassort> is there any wholeistic portable mingw + nim |
12:53:46 | FromDiscord | <albassort> (edit) "is there any wholeistic portable mingw + nim ... " added "thing" |
12:54:18 | FromDiscord | <albassort> i wanna develop nim but i cant do that because my employer will notice so much shit on my work computer |
12:54:41 | FromDiscord | <albassort> maybe I'll buy a second laptop for dev work |
12:55:00 | FromDiscord | <albassort> (edit) "maybe I'll buy a second laptop for ... dev" added "personal" |
13:01:05 | FromDiscord | <Piko> In reply to @albassort "is there any wholeistic": have you tried choosenim? it downloads the compiler automatically and puts everything in $HOME/.choosenim and $HOME/.nimble, then you can use windows' cmd as console |
13:02:02 | FromDiscord | <Piko> not exactly portable, but it wouldn't be hard to make it portable either, I think... maybe with a .bat script that sets the PATH of those |
13:02:32 | FromDiscord | <voidwalker> you want to develop at work ? or you don't have your own computer ? |
13:12:20 | FromDiscord | <albassort> In reply to @Piko "have you tried choosenim?": for windows |
13:13:01 | FromDiscord | <Piko> yeah by $HOME I mean C:\Users\your_username\ |
13:13:05 | FromDiscord | <albassort> In reply to @voidwalker "you want to develop": i dont want my boss to yell at me for installing things on my pc that might compromise security even though nim certainly wont |
13:13:17 | FromDiscord | <least antisemitic pole> recursive imports always lead to some very confusing errors in my experience |
13:13:23 | FromDiscord | <least antisemitic pole> they should probably be disabled until they're ready tbh |
13:14:05 | FromDiscord | <Piko> choosenim doesn't generate any start menu icon or entry in add/remove programs |
13:16:37 | FromDiscord | <albassort> In reply to @least antisemitic pole "recursive imports always lead": no they're pretty simplw |
13:16:43 | FromDiscord | <albassort> everything just stops working |
13:20:08 | FromDiscord | <Rika> In reply to @albassort "i dont want my": ? do you know it certainly wont |
13:20:58 | FromDiscord | <voidwalker> omfg bosses can yell at you ? |
13:22:06 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=4w37 - can anyone figure why this SIGSEGVS, unless line #5 is commented ? Which is just a type alias that never gets used in the code .. |
13:22:40 | FromDiscord | <voidwalker> the last lines in the code with the for i 0..32, if i<32 it doesn't crash |
13:57:04 | * | rockcavera joined #nim |
13:58:39 | FromDiscord | <@theperfectcomputer-628303036da0> in Python, you can convert a string to a Path |
13:58:42 | FromDiscord | <@theperfectcomputer-628303036da0> Is there a similar concept for Nim? |
14:02:19 | * | progranner joined #nim |
14:03:39 | FromDiscord | <Nerve> If I'm remembering correctly, paths in Nim are always handled as strings. What `std/os` provides is a number of procs which can interpret and manipulate path strings so you can be sure they're valid and platform-appropriate. |
14:03:42 | * | progranner quit (Client Quit) |
14:04:01 | FromDiscord | <Nerve> In addition there's the `/` macros as a path constructor. |
14:04:05 | FromDiscord | <Nerve> (edit) "macros" => "macro" |
14:04:11 | FromDiscord | <@theperfectcomputer-628303036da0> ok - makes sense |
14:04:43 | Amun-Ra | there are a few 3rd party pathliblike modules, https://github.com/achesak/nim-pythonpathlib |
14:04:46 | FromDiscord | <Rika> Nim has a library that uses distinct types for paths |
14:04:57 | FromDiscord | <Rika> But it is in the development version of Nim |
14:05:12 | Amun-Ra | well, that one is pretty old |
14:13:00 | * | progranner joined #nim |
14:14:20 | NimEventer | New post on r/nim by MetaMindWanderer: Purpose of NimScript vs nim, see https://reddit.com/r/nim/comments/13k2z3d/purpose_of_nimscript_vs_nim/ |
14:14:24 | FromDiscord | <@theperfectcomputer-628303036da0> when should I define a ref object type as opposed to just an object? |
14:22:00 | * | xet7 joined #nim |
14:23:08 | FromDiscord | <Nerve> In reply to @@theperfectcomputer-628303036da0 "when should I define": It's required for variant types, and that's the only thing I've needed it for so far. Since non-ref objects are basically just structs allocated on the stack, I would think that for other cases, that you might want a managed reference to an object on the heap if the calling scope is going to close but the object needs to stick around due to references in other places. |
14:23:22 | FromDiscord | <Nerve> (edit) removed "that" |
14:27:29 | FromDiscord | <demotomohiro> In reply to @voidwalker "https://play.nim-lang.org/#ix=4w37 - can anyone": It seems your code works on Nim playground when the length of bv1 and bv2 are reduced. |
14:29:45 | FromDiscord | <demotomohiro> @theperfectcomputer↵It is a question people frequently ask:↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark |
14:36:13 | FromDiscord | <voidwalker> @demotomohiro I had a feeling it's related to stack size being consumed or something like that. So maybe that type definition makes it overflow or something ? weird coincidence |
14:37:02 | * | jmdaemon quit (Ping timeout: 265 seconds) |
14:38:26 | FromDiscord | <Rika> In reply to @Nerve "It's required for variant": it is not required for variant types. it is (kinda) required for inheritance though |
14:39:20 | FromDiscord | <demotomohiro> In reply to @voidwalker "<@288750616510201856> I had a": Variables outside of procedures don't use stack. They are stored on static storage. |
14:39:41 | * | Notxor joined #nim |
14:41:49 | FromDiscord | <demotomohiro> And why dont you use bitops or math module? |
14:43:16 | FromDiscord | <voidwalker> bitops is for integer bit manipulation, not for arrays of bits |
14:49:14 | FromDiscord | <demotomohiro> So `count` in your code count set bits different way? |
14:49:41 | FromDiscord | <mratsim> In reply to @voidwalker "omg, what side effects": You should use ceil division for the capacity of your bitvector.↵↵i.e. ceildiv(a, b) = (a+b-1) div b |
14:49:44 | FromDiscord | <voidwalker> count is for counting how many 1 bits are i n the structure |
14:50:12 | FromDiscord | <voidwalker> I implemented code I found on wikipedia for that : D, for bytes and 64bit for now |
14:50:44 | FromDiscord | <voidwalker> @mratsim thanks but I don't want to import a module for 1 line of code.. |
14:51:15 | FromDiscord | <mratsim> Why a module? Just put it in your code |
14:51:31 | * | xet7 quit (Ping timeout: 240 seconds) |
14:51:50 | FromDiscord | <mratsim> Using div and mod at compile time will make compilation slow. Those are 55 times slower than addition. |
14:51:52 | FromDiscord | <voidwalker> that could be a good idea |
14:52:36 | FromDiscord | <voidwalker> @mratsim while you're here, I have some code dillemas, similar to the one Rika pinged you earlier (the huge slowdown when using concept) |
14:53:19 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=4w37 - this SIGSEGVS after I added line 5 with the type alias. It is fixed if I reduce the size of the bitarrays in the code (which are very large) |
14:53:25 | FromDiscord | <voidwalker> any idea what's going on ? |
14:54:28 | FromDiscord | <voidwalker> Also, if I reduce the size of those arrays and keep the type alias, I get a huge slowdown again, 6 seconds vs 86ms without it |
14:55:10 | FromDiscord | <demotomohiro> In reply to @voidwalker "count is for counting": Is your `count` faster than Nim's stdlib countSetbits?↵https://github.com/nim-lang/Nim/blob/version-1-6/lib/system/countbits_impl.nim |
14:55:14 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=4w3C |
14:55:59 | FromDiscord | <voidwalker> looks to the be the same algorithm for 64bit int. I don't have one for 32bit, maybe I will copy that one, thanks |
14:56:29 | FromDiscord | <mratsim> In reply to @Rika "<@570268431522201601> sorry but we’re": Use getMonotime for benchmarking and create benches for individual proc.↵↵Then disassemble either through Intel VTune or Apple Instruments or by using Ghidra. |
14:57:32 | FromDiscord | <mratsim> In reply to @voidwalker "Also, if I reduce": Slowdown for compilation or something else? |
14:57:39 | FromDiscord | <voidwalker> for running |
14:57:57 | FromDiscord | <mratsim> In reply to @voidwalker "https://play.nim-lang.org/#ix=4w37 - this SIGSEGVS": Your fastLog2 is using 63 instead of 31 for uint32 btw |
14:58:45 | FromDiscord | <voidwalker> I haven't yet gotten to verifying that part, it's stolen from another bitvector lib |
14:58:54 | FromDiscord | <mratsim> Mmmmh in the past concept had a parameter passing issue. Maybe it's back? |
14:59:24 | FromDiscord | <voidwalker> you sure it must be 31 ? |
14:59:51 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues/16897 |
15:00:46 | FromDiscord | <mratsim> In reply to @voidwalker "you sure it must": Compare with bitops or stew bitops2 |
15:01:33 | * | azimut joined #nim |
15:04:01 | FromDiscord | <voidwalker> https://github.com/nim-lang/Nim/blob/f222625b17f90238cf7a31fec2d1b31447b6cd22/lib/pure/bitops.nim#LL381C1-L381C46 - this looks to be a different method ? |
15:06:51 | FromDiscord | <mratsim> In reply to @voidwalker "https://github.com/nim-lang/Nim/blob/f222625b17f902": Line 585 |
15:09:21 | FromDiscord | <voidwalker> ok, I changed it, will test that part eventually. It is used to turn int to bit array.. I wonder if it's not simpler just to copy the memory |
15:09:48 | om3ga | dear all, maybe I don't understand something, but how it is possible that GC reports .[Heap] total number of bytes: 876156054, while in top I see the process utilizes 1.8GB? |
15:10:52 | Amun-Ra | do you allocate any non-gc memory? |
15:10:57 | om3ga | the info I got using dumpNumberOfInstances(), and gc is refc |
15:11:13 | * | xet7 joined #nim |
15:11:22 | om3ga | Amun-Ra: no, it's wsl, maybe because of that? |
15:11:27 | FromDiscord | <voidwalker> @mratsim about the super slowdown, here is the code sample: https://play.nim-lang.org/#ix=4w3R - comment line #7 and it goes from 6seconds to 60ms or something |
15:11:34 | FromDiscord | <voidwalker> 100x slowdown |
15:11:40 | FromDiscord | <TuxTheArchUser> Is it possible to use Nim on microcontrollers? |
15:11:41 | Amun-Ra | om3ga: ah, I'm not familiar wih wsl |
15:11:43 | FromDiscord | <voidwalker> for the operation on line 132 |
15:12:05 | FromDiscord | <Rika> In reply to @TuxTheArchUser "Is it possible to": yes |
15:12:05 | om3ga | Amun-Ra: it shoul be "like linux" |
15:12:12 | FromDiscord | <Rika> plenty of people do |
15:12:18 | FromDiscord | <jmgomez> Is the manual and experimental manual published somewhere for devel? |
15:12:20 | FromDiscord | <Rika> see #embedded |
15:12:25 | Amun-Ra | om3ga: yes, "like" ;) |
15:12:32 | om3ga | Amun-Ra: I will check on normal os then, to exclude possible side effects |
15:12:40 | FromDiscord | <TuxTheArchUser> In reply to @Rika "yes": Is CH32V203C8T6 supported? |
15:13:05 | FromDiscord | <TuxTheArchUser> It's RISC-V cheap chinese microcontroller |
15:13:13 | FromDiscord | <Rika> In reply to @jmgomez "Is the manual and": https://nim-lang.github.io/Nim/manual.html https://nim-lang.github.io/Nim/manual_experimental.html |
15:13:37 | FromDiscord | <Rika> In reply to @TuxTheArchUser "Is CH32V203C8T6 supported?": does it have a C compiler? then technically it is, might need a lot of setup work though |
15:14:01 | FromDiscord | <TuxTheArchUser> In reply to @Rika "does it have a": It supports C |
15:14:40 | FromDiscord | <jmgomez> In reply to @Rika "https://nim-lang.github.io/Nim/manual.html https://": nice, thanks Rika! |
15:15:22 | FromDiscord | <albassort> In reply to @TuxTheArchUser "It's RISC-V cheap chinese": Risc-V isn't cheap and chinese, wasn't it designed in western academia? |
15:15:41 | Amun-Ra | CH32 is cheap |
15:15:46 | FromDiscord | <TuxTheArchUser> I mean MCU itself is chinese |
15:16:00 | FromDiscord | <TuxTheArchUser> RISC-V is just instruction set |
15:16:40 | FromDiscord | <albassort> from Berkley |
15:16:51 | FromDiscord | <Rika> lol |
15:16:51 | FromDiscord | <TuxTheArchUser> What- |
15:17:01 | FromDiscord | <TuxTheArchUser> Isn't WCH chinese company? |
15:17:21 | FromDiscord | <albassort> cheap things are good because computing should be cheap, and power efficient. |
15:17:28 | FromDiscord | <Rika> they just misunderstood |
15:17:29 | FromDiscord | <TuxTheArchUser> Yeah |
15:17:38 | FromDiscord | <TuxTheArchUser> In reply to @Rika "they just misunderstood": Okayy |
15:17:44 | FromDiscord | <Rika> how expensive is the chip btw |
15:17:51 | FromDiscord | <TuxTheArchUser> 10 cents |
15:17:56 | FromDiscord | <Rika> daaaaaaaamn |
15:18:27 | FromDiscord | <TuxTheArchUser> And it has 144MHz RV32GC core XD |
15:18:39 | FromDiscord | <Rika> single? |
15:18:43 | FromDiscord | <TuxTheArchUser> Yeah |
15:18:49 | FromDiscord | <TuxTheArchUser> But it costs only 10 cents XD |
15:18:56 | FromDiscord | <Rika> built in ram? |
15:18:59 | FromDiscord | <TuxTheArchUser> Yeah |
15:19:05 | FromDiscord | <Rika> wait ig its an mcu ofc it does |
15:19:15 | FromDiscord | <Rika> flash? |
15:19:19 | FromDiscord | <TuxTheArchUser> Yeah |
15:19:41 | FromDiscord | <Rika> 20k sram for ten cents a pop wow |
15:19:46 | FromDiscord | <TuxTheArchUser> Yeah |
15:19:57 | FromDiscord | <Rika> two usb interfaces??? |
15:20:02 | FromDiscord | <TuxTheArchUser> Yeah |
15:20:19 | FromDiscord | <Rika> idk wow this is cheap as heck |
15:20:21 | FromDiscord | <TuxTheArchUser> WCH makes cheap and crazy stuff |
15:22:00 | FromDiscord | <TuxTheArchUser> That's the only MCU that I can buy XD |
15:25:00 | om3ga | but is is slow |
15:25:19 | om3ga | arm socs are faster |
15:26:10 | FromDiscord | <mratsim> In reply to @voidwalker "<@570268431522201601> about the super": Strange, compare the C files, there must be a glaring issue there. Have to fetch my kid and then entertain her so no time until she sleeps.↵↵Open an issue in the Nim repo. |
15:26:51 | FromDiscord | <voidwalker> I'd wanted for someone to check it first before opening an issue, as I have no idea what's going on there |
15:27:15 | FromDiscord | <voidwalker> No rush, I was just holding it in case there's an unknown compiler bug related to this.. what are the odds |
15:32:04 | FromDiscord | <@theperfectcomputer-628303036da0> I'm running Nim on windows, and seem to get stuck waiting for process to exit - code below\:↵↵let myProc = startProcess("git", args = ["diff", "HEAD\~1"], options = {poUsePath})↵discard myProc.waitForExit() |
15:32:48 | FromDiscord | <@theperfectcomputer-628303036da0> If I replace that wait with sleep 300 for example, things work fine |
15:33:01 | FromDiscord | <@theperfectcomputer-628303036da0> On Linux, things work fine |
15:33:12 | FromDiscord | <Arathanis> In reply to @@theperfectcomputer-628303036da0 "I'm running Nim on": try running `git --no-pager diff` |
15:33:44 | FromDiscord | <Prestige> Using karax, is there a way to change the generated files? Like everything is app.html, app.js, the generated title of the page is `app`. I don't see anything in the docs about being able to change this |
15:35:21 | FromDiscord | <@theperfectcomputer-628303036da0> Still no go↵(@Arathanis) |
15:38:45 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:46:46 | * | Notxor quit (Remote host closed the connection) |
15:51:53 | FromDiscord | <demotomohiro> @theperfectcomputer if you want git diff takes input from terminal use `poParentStreams` option. |
15:54:53 | * | progranner joined #nim |
16:22:44 | * | Notxor joined #nim |
16:24:17 | FromDiscord | <Bung> what's the correct way import `compiler` on devel, my project works fine before, now `Error: cannot open file: compiler/ast` |
16:25:17 | * | xet7 quit (Quit: Leaving) |
16:28:55 | * | cnx quit (Remote host closed the connection) |
16:29:44 | * | cnx joined #nim |
16:30:41 | FromDiscord | <Bung> nvm |
16:42:57 | * | krux02_ joined #nim |
16:56:54 | * | xet7 joined #nim |
17:09:04 | FromDiscord | <auxym> In reply to @Bung "what's the correct way": https://forum.nim-lang.org/t/10191 |
17:11:59 | FromDiscord | <Bung> oh, thanks! |
17:20:22 | * | xet7 quit (Remote host closed the connection) |
17:21:25 | * | GreaseMonkey quit (Quit: No Ping reply in 180 seconds.) |
17:22:42 | * | greaser|q joined #nim |
17:30:03 | * | dza quit (Quit: ) |
17:31:27 | * | dza joined #nim |
17:32:22 | * | Notxor quit (Quit: Leaving) |
17:58:37 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4w4k |
17:58:56 | FromDiscord | <Dudugz> First I used get it returned an empty seq, then I used .sqlString and it was empty :v |
18:04:39 | FromDiscord | <Dudugz> I mean, there is data in the database but I am getting an empty seq |
18:10:53 | FromDiscord | <Dudugz> I activated debug, surprisingly it is not able to identify that the field name is a text and tries to parseFloat https://media.discordapp.net/attachments/371759389889003532/1108456620524048504/image.png https://media.discordapp.net/attachments/371759389889003532/1108456620784103444/image.png |
18:16:37 | FromDiscord | <Dudugz> -.- so that's why i had to install maria even setting MySQL as driver https://media.discordapp.net/attachments/371759389889003532/1108458066124492892/image.png |
18:17:10 | FromDiscord | <jmgomez> I only used it like once but IIRC it should accept a schema/type def |
18:19:52 | FromDiscord | <Dudugz> yea no, it doesn't work |
18:20:33 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4w4p |
18:20:41 | FromDiscord | <Dudugz> (edit) |
18:21:46 | FromDiscord | <Dudugz> the problem is that looking at the allographer code all mysql methods were replaced by mariadb as if they were the same. That's probably what's causing the conflict, it thinks it's a float when it's actually text. |
18:22:37 | FromDiscord | <jmgomez> I mean did you setup the scheme like this: https://github.com/itsumura-h/nim-allographer/blob/main/example/setup.nim |
18:24:40 | FromDiscord | <Dudugz> well no? why i would create a table that already exists |
18:24:42 | FromDiscord | <Dudugz> https://media.discordapp.net/attachments/371759389889003532/1108460098415755284/image.png |
18:26:48 | FromDiscord | <jmgomez> I dont know ask the persons who wrote the library but if that's their examples and you dont follow them dont expect it to work magically |
18:27:24 | FromDiscord | <Dudugz> But this example you showed is to create a table lol, the example in the readme is a simple select, which doesn't work. |
18:27:44 | FromDiscord | <Dudugz> https://media.discordapp.net/attachments/371759389889003532/1108460864526373016/image.png |
18:29:42 | FromDiscord | <jmgomez> I dont know were the mapping is done but obviously some mapping has to be done if it does it automatically for you it means it uses an intermediate type. Is that the case? |
18:30:32 | FromDiscord | <Dudugz> hm, i'll try |
18:30:46 | FromDiscord | <Dudugz> it just feels weird, you already had the table mapped in the db |
18:31:55 | FromDiscord | <Dudugz> i mean, for NoSQL you would really need a mapping, for SQL not since all columns are typed. |
18:33:19 | FromDiscord | <jmgomez> Again, you either have an intermediate type created by the library for you or you have to specify it at compile time |
18:35:44 | * | Notxor joined #nim |
18:36:31 | * | rockcavera quit (Remote host closed the connection) |
18:39:21 | FromDiscord | <Dudugz> Easier to look for a MySQL-oriented library. |
18:39:39 | FromDiscord | <jmgomez> And you will face the same issue |
18:39:53 | FromDiscord | <Dudugz> nope, because db_mysql work out of box |
18:40:24 | FromDiscord | <jmgomez> then for the third and last time, it creates an intermediate type for you |
18:40:30 | FromDiscord | <Dudugz> I mean, what you want me to do doesn't exist, and I've tried using rdb.create but obviously it's a procedure for creating a table, which didn't work because I already have an existing table with data. |
18:40:45 | FromDiscord | <Dudugz> In reply to @Dudugz "i tried to pass": i made one tho |
18:41:41 | FromDiscord | <Dudugz> my issue is that it's trying to parse "name" as float, but it's text in the db https://media.discordapp.net/attachments/371759389889003532/1108464371530739793/image.png |
18:41:43 | FromDiscord | <jmgomez> Again, I used the library once last year and it worked as expected for what I wanted to test. If you feel like what you are doing is right, just open an issue the developer is active |
18:56:55 | FromDiscord | <jmgomez> Did you try to run that in a fresh db for the sake of debugging? I looked briefly at the code an where it fails seems like the returned type from the driver is wrong |
18:57:58 | FromDiscord | <Dudugz> No, that's because as I said I already have a database ready for testing, I was just switching from db_mysql to an asynchronous version. |
18:58:11 | FromDiscord | <Dudugz> and yes, in db_mysql i didn't have any issue with my db |
18:59:07 | FromDiscord | <Dudugz> The strangest part of allographer is because it gives the option to choose the MySQL driver and forcefully use MariaDB |
18:59:27 | FromDiscord | <Dudugz> Every operation with mysql.Xproc has been replaced in the library code by mariadb.Xproc |
19:00:20 | FromDiscord | <Dudugz> I mean, the two are similar but not the same, I even had to install the mariadb driver even though I chose mysql. |
19:00:39 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:01:22 | FromDiscord | <jmgomez> In reply to @Dudugz "No, that's because as": so start there if you want to use it |
19:01:54 | FromDiscord | <Dudugz> i did, nothing changed, like i said, it should be using mysql driver, not maria one |
19:02:01 | FromDiscord | <Dudugz> type ids may be diff |
19:02:27 | FromDiscord | <Dudugz> new db with nothing inside, same error, players table created by code https://media.discordapp.net/attachments/371759389889003532/1108469598782754898/image.png |
19:03:55 | FromDiscord | <jmgomez> create the inserts from Nim. Debug rule number one, go towards the minimal repro with as much fixed moving pieces as possible |
19:05:16 | FromDiscord | <jmgomez> btw if you dont care about allowgrapher you could just borrow the async parts that are useful to you and call it a day |
19:10:32 | FromDiscord | <Dudugz> very interesting that you drop mysql, you seemed to lean towards PostgreSQL, it seems well implemented, MySQL doesn't. https://media.discordapp.net/attachments/371759389889003532/1108471633804537897/image.png |
19:10:42 | * | rockcavera joined #nim |
19:10:44 | FromDiscord | <Dudugz> (edit) "you drop" => "it discards" |
19:13:01 | FromDiscord | <Chronos [She/Her]> Would code like `await unpackVarargs(listener, args)` work? |
19:13:19 | FromDiscord | <Chronos [She/Her]> It looks like it will, but wanna check |
19:19:23 | * | lucasta joined #nim |
19:22:51 | * | progranner joined #nim |
19:22:51 | * | rockcavera quit (Remote host closed the connection) |
19:23:16 | * | progranner quit (Client Quit) |
19:25:58 | FromDiscord | <Chronos [She/Her]> `/home/horizon/.choosenim/toolchains/nim-1.6.12/lib/pure/asyncmacro.nim(126, 11) Error: await expects Future[T], got void` not sure how the hell this is happening |
19:30:12 | FromDiscord | <Chronos [She/Her]> https://paste.ecorous.org/raw/wuwepuhusa this is my code |
19:30:25 | FromDiscord | <Chronos [She/Her]> Seems to be line 69 that's the issue? |
19:30:58 | FromDiscord | <Chronos [She/Her]> https://paste.ecorous.org/raw/kuxihaceki this is the test code |
19:33:13 | * | progranner joined #nim |
19:36:47 | * | progranner quit (Client Quit) |
19:37:28 | * | progranner joined #nim |
19:37:33 | FromDiscord | <Chronos [She/Her]> This is pain |
19:40:09 | * | progranner quit (Client Quit) |
19:41:07 | * | lucasta quit (Quit: Leaving) |
19:41:52 | * | progranner joined #nim |
19:46:35 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4w4D |
19:48:22 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4w4E |
19:48:29 | FromDiscord | <Chronos [She/Her]> Changing it to what it wants literally makes zero sense |
20:21:14 | NimEventer | New Nimble package! chat_openai - A CLI for the Chat series of models provided by OpenAI, see https://github.com/joshuajohncohen/chat_openai-nim |
20:36:14 | FromDiscord | <@theperfectcomputer-628303036da0> sent a code paste, see https://paste.rs/2odV3 |
20:37:33 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:38:57 | * | progranner joined #nim |
20:41:11 | FromDiscord | <auxym> In reply to @@theperfectcomputer-628303036da0 "I want to export": pretty sure you have to use asterisks. `export` is used to export symbols you have `import`ed from external modules |
20:41:48 | FromDiscord | <@theperfectcomputer-628303036da0> well, `export MovedFile` works |
20:41:58 | FromDiscord | <@theperfectcomputer-628303036da0> but yeah, not `export fromPath` |
20:43:38 | FromDiscord | <Elegantbeef> You have to export fields specifically |
20:44:09 | FromDiscord | <@theperfectcomputer-628303036da0> so you can't export fields using the `export` keyword? |
20:44:57 | FromDiscord | <Elegantbeef> You can only use `export` on top level symbols |
20:45:02 | FromDiscord | <Elegantbeef> A field is not a top level symbol |
20:45:09 | FromDiscord | <@theperfectcomputer-628303036da0> ok - I'm not fond of that |
20:45:47 | FromDiscord | <Elegantbeef> Well it is what it is and it's better than having fields exported randomly inside a module |
20:45:59 | FromDiscord | <Elegantbeef> You can always write a property and use `export` like a heathen if you really dislike it |
20:47:02 | FromDiscord | <@theperfectcomputer-628303036da0> Well, my issue with the astericks is it always trips me up - I keep thinking C pointer |
20:47:03 | FromDiscord | <@theperfectcomputer-628303036da0> and this is clearly not that |
20:47:03 | FromDiscord | <Elegantbeef> Well this is not C, so stop it get some help 😛 |
20:48:49 | FromDiscord | <@theperfectcomputer-628303036da0> Haskell's syntax is really nice for this IMO\:https://github.com/BracketMaster/learn-clash/blob/main/src/RS232/State.hs#L1 |
20:50:10 | FromDiscord | <@theperfectcomputer-628303036da0> I used to think Haskell was jibberish - but the more I used it - the more i fell in love |
20:50:10 | FromDiscord | <Elegantbeef> We should really be up in arms about C using `` for pointer, when the superior `^` is more pointy! |
20:50:10 | FromDiscord | <@theperfectcomputer-628303036da0> Now it makes total sense! |
20:50:11 | FromDiscord | <Elegantbeef> I hear Stockholm is nice this time of the year |
20:51:48 | FromDiscord | <Elegantbeef> Hopefully you do not take offence to my jokes 😄 |
21:01:37 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
21:03:22 | * | progranner joined #nim |
21:11:31 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "We should really be": Why did they use astricks anyway instead of anything else |
21:12:01 | * | lucasta joined #nim |
21:12:19 | FromDiscord | <Elegantbeef> Does C really seem like a language that has it's syntax designed well |
21:17:37 | FromDiscord | <Chronos [She/Her]> Nope lol |
21:17:52 | FromDiscord | <Chronos [She/Her]> People say C is a protocol rather than a language now because of how people use it |
21:18:52 | * | rockcavera joined #nim |
21:25:30 | FromDiscord | <demotomohiro> C was designed long time ago. Maybe there are some reason in its design that young people don't know. |
21:26:07 | FromDiscord | <Elegantbeef> Pascal was also designed a long time ago and does not have as many worts |
21:26:07 | FromDiscord | <Elegantbeef> 😛 |
21:26:13 | FromDiscord | <Elegantbeef> It uses `^` for pointer! |
21:26:37 | FromDiscord | <Elegantbeef> warts even |
21:27:42 | FromDiscord | <0ffh> In reply to @Elegantbeef "It uses `^` for": The different pointer syntax was what took me longest to get used to when switching from (Turbo) Pascal to C. Everything else was super easy as the languages are so similar in many respects. |
21:28:04 | FromDiscord | <Elegantbeef> I assume also the fact that C doesnt have a construct of an array was a bit annoying |
21:28:17 | FromDiscord | <Elegantbeef> C just has pointers, all pointers arr arrays and all arrays are pointers |
21:28:41 | FromDiscord | <Elegantbeef> Yes yes static arrays exist, but they're closer to pointers than other languages do it |
21:29:02 | FromDiscord | <0ffh> Yeah, it's different but curiously it didn't bother me very much at all. |
21:29:39 | FromDiscord | <0ffh> Though I was a bit surprised when I learned that a[b] == b[a] |
21:30:42 | FromDiscord | <0ffh> Apart from that I just think of a[b] = (a+b) so that bridges the pointer and array world. |
21:31:20 | FromDiscord | <0ffh> Funnily that also explains the curious first fact, when you think a bit. |
21:33:36 | FromDiscord | <JJ> so with unqualified enums now as the default: how can i tell nim to qualify them? |
21:34:40 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4w4V |
21:37:09 | FromDiscord | <inv> Any ideas who freed ...0050 ptr here? https://media.discordapp.net/attachments/371759389889003532/1108508530576736377/image.png |
21:41:02 | FromDiscord | <Elegantbeef> For good reason you cannot↵(@JJ) |
21:42:11 | FromDiscord | <Elegantbeef> put it inside a `main` proc inv |
21:42:23 | FromDiscord | <Elegantbeef> Move semantics is hard to follow at top level cause it doesnt work there |
21:42:59 | FromDiscord | <inv> does it mean it leaks? Or its ok because it knows prog terminates? |
21:43:15 | FromDiscord | <Elegantbeef> It will not leak if you properly manage the memory |
21:43:44 | FromDiscord | <inv> yep, from main it looks ok. |
21:43:58 | FromDiscord | <inv> Can you please explain what is going without main ? |
21:44:15 | FromDiscord | <inv> I mean - not in details, but what happened there? |
21:44:36 | FromDiscord | <Elegantbeef> A copy is made at line 10 I assume |
21:44:42 | FromDiscord | <Elegantbeef> Then freed |
21:45:15 | FromDiscord | <inv> but where is destructor for it ? why in main only? |
21:45:30 | FromDiscord | <inv> Is it possible that it is some gcc optimization? |
21:47:19 | FromDiscord | <inv> So, without main it is freed without calling destructor - how |
21:47:42 | FromDiscord | <demotomohiro> Variables outside of procs exists as long as process alive.↵Variables inside proc are freed when exit the proc. |
21:47:45 | FromDiscord | <Elegantbeef> It's destructed at the end of the program |
21:49:21 | FromDiscord | <inv> Sorry, did not get. the last line of the screenshot calls the destructor, but data = nil there |
21:50:01 | FromDiscord | <Elegantbeef> So it doesnt dealloc |
21:50:17 | FromDiscord | <inv> during echo - it was ok, then the first "d" it is already nil |
21:50:43 | FromDiscord | <Elegantbeef> Testing this outside a proc is a fools errand imo |
21:51:25 | FromDiscord | <JJ> wait, i think i'm loosing it and completely misremembered enum semantics |
21:51:33 | FromDiscord | <Elegantbeef> Lol |
21:51:36 | FromDiscord | <inv> Yep, I agree, just wanted to understand how the free happened |
21:52:03 | FromDiscord | <JJ> sent a code paste, see https://play.nim-lang.org/#ix=4w4Y |
21:52:13 | FromDiscord | <Elegantbeef> Are you on `#devel`? |
21:52:17 | FromDiscord | <Elegantbeef> Are you using `overloadableEnum` |
21:52:43 | FromDiscord | <JJ> looks like 1.6.12 |
21:52:51 | FromDiscord | <Elegantbeef> Arc/Orc use scope based destruction so at the end of scope the destructor is called. Uncertain the problem, to focused on my GUI 😄↵(@inv) |
21:53:02 | FromDiscord | <Elegantbeef> With 1.6.12 you need to use the experimental flag |
21:53:14 | FromDiscord | <inv> it is refc at the moment |
21:53:28 | FromDiscord | <Elegantbeef> Well there's your first problem |
21:53:37 | FromDiscord | <Elegantbeef> Refc doesnt abide by destructors as you expect |
21:53:39 | FromDiscord | <Elegantbeef> So stop using refc |
21:53:59 | FromDiscord | <inv> ok, I thought it will call it anyway |
21:54:07 | FromDiscord | <JJ> nice, yeah, that was it |
21:54:22 | FromDiscord | <inv> with --mm:arc I see exatctly the same picture |
21:54:38 | FromDiscord | <Elegantbeef> Give the code |
21:54:56 | FromDiscord | <JJ> i guess it's been a while since i actually had to use overloadable enums or something, i thought that was stabilized |
21:55:06 | FromDiscord | <Elegantbeef> It's default in devel |
21:55:21 | FromDiscord | <inv> @ElegantBeef code from me or JJ ? |
21:55:28 | FromDiscord | <Elegantbeef> You |
21:55:53 | * | greaser|q quit (Changing host) |
21:55:53 | * | greaser|q joined #nim |
21:55:57 | * | greaser|q is now known as GreaseMonkey |
21:56:49 | FromDiscord | <inv> sent a long message, see http://ix.io/4w50 |
21:56:52 | FromDiscord | <inv> oh, long link |
21:57:05 | FromDiscord | <Elegantbeef> Also in a VM runtime 😄 |
21:58:36 | FromDiscord | <inv> https://gist.github.com/inv2004/208eb994d2a05ca890dac582e44a071f |
21:59:21 | FromDiscord | <JJ> oh cool, didn't know others were hosting nim playgrounds |
21:59:25 | FromDiscord | <inv> did not know playground is restored |
21:59:41 | FromDiscord | <Elegantbeef> Jaes that isnt another playground |
21:59:44 | FromDiscord | <Elegantbeef> james\ |
21:59:48 | FromDiscord | <Elegantbeef> That's a VM based playground |
21:59:50 | FromDiscord | <Elegantbeef> It runs locally |
21:59:58 | FromDiscord | <inv> https://play.nim-lang.org/#ix=4w51 |
22:00:01 | FromDiscord | <Elegantbeef> It's faaaast |
22:00:09 | FromDiscord | <JJ> wait, that's sick |
22:00:24 | FromDiscord | <JJ> nimscript? |
22:00:39 | FromDiscord | <Elegantbeef> Inv you're deallocating the pointer to x |
22:00:58 | FromDiscord | <Elegantbeef> That's what you want |
22:00:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/7Kk6U |
22:01:04 | FromDiscord | <Elegantbeef> Nimscripter no less↵(@JJ) |
22:01:25 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:02:12 | FromDiscord | <inv> last 3 lines:↵ptr 0x55ddb3c1c5e0 --> [data = ptr 0x7f3002b94050 --> [...]]↵d ptr 0x55ddb3c1c5e8 --> [data = ptr 0x7f3002b941d0 --> [...]]↵d ptr 0x55ddb3c1c5e0 --> [data = nil] |
22:02:49 | FromDiscord | <inv> yep, the last one tries to deallocate it, but it has nil already |
22:03:07 | FromDiscord | <JJ> wait, what is this beef |
22:03:16 | FromDiscord | <JJ> i thought nimscript was the vm-compatible subset of nim |
22:03:16 | FromDiscord | <Elegantbeef> What is what? |
22:03:27 | FromDiscord | <JJ> your nimscripter |
22:03:30 | FromDiscord | <inv> sent a long message, see http://ix.io/4w52 |
22:03:30 | FromDiscord | <Elegantbeef> Nimscript is the vm subset of Nim |
22:03:39 | FromDiscord | <Elegantbeef> Nimscripter takes it an makes it easy to embed |
22:03:40 | FromDiscord | <inv> there is only one d for 0x55ddb3c1c5e0 |
22:04:21 | FromDiscord | <Elegantbeef> https://github.com/gabbhack/nimplay/blob/master/src/nimscript.nim quite respectable 😛 |
22:04:29 | FromDiscord | <inv> (edit) "http://ix.io/4w52" => "http://ix.io/4w53" |
22:04:45 | FromDiscord | <Elegantbeef> Stop using refc for move semantics |
22:04:48 | FromDiscord | <Elegantbeef> Like really stop it |
22:05:13 | FromDiscord | <inv> But with --mm:arc I see the same (if not in main) |
22:05:38 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4w54 |
22:05:42 | FromDiscord | <Elegantbeef> Run that with arc |
22:05:55 | FromDiscord | <inv> Cannot sleep until I understans who stole my pointer before my destructor |
22:06:09 | FromDiscord | <Elegantbeef> Refc probably did |
22:06:12 | FromDiscord | <Elegantbeef> It works fine with arc |
22:09:59 | FromDiscord | <inv> You are right. Thank you |
22:10:19 | FromDiscord | <inv> Now cannot sleep witout undertanding why refc stole it 🙂 |
22:10:33 | FromDiscord | <inv> because I thought refc is just refs without magic |
22:10:50 | FromDiscord | <inv> it should call destructor anyway I thought |
22:11:04 | FromDiscord | <Elegantbeef> I mean refc is broken with destructors imo |
22:11:10 | FromDiscord | <Elegantbeef> It's awful and do not expect them to work there |
22:11:17 | FromDiscord | <inv> ok, thx |
22:11:39 | FromDiscord | <inv> it calls destructor, but somehow ptr is stolen or freed already |
22:11:52 | FromDiscord | <inv> (edit) "it calls destructor, but somehow ptr is stolen or freed already ... " added "with refc" |
22:12:42 | * | Notxor quit (Quit: Leaving) |
22:12:46 | FromDiscord | <Elegantbeef> refc probably zeros after destructors and has an odd ordering for how they're used since it doesnt do scope based destructing |
22:13:06 | FromDiscord | <inv> hah, it fails with -d:debug, release is ok |
22:13:37 | FromDiscord | <inv> (edit) "hah, it fails with -d:debug, ... release" added "but" |
22:15:00 | FromDiscord | <inv> Thank you. Can go to the next =sink from now 🙂 |
22:15:39 | * | progranner joined #nim |
22:44:24 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
23:48:34 | * | jmdaemon joined #nim |