00:04:51 | FromDiscord | <proton> sent a code paste, see https://play.nim-lang.org/#ix=4bb0 |
00:05:19 | FromDiscord | <proton> `Error: '=copy' is not available for type <Task>; requires a copy because it's not the last read of 'task'; routine: test` |
00:05:47 | FromDiscord | <proton> sent a long message, see http://ix.io/4bb1 |
00:09:37 | FromDiscord | <Elegantbeef> Move semantics are fun, what line? |
00:11:27 | FromDiscord | <flywind> what's your Nim version? |
00:11:48 | FromDiscord | <Elegantbeef> 1.6.6 and devel both error there |
00:15:08 | FromDiscord | <Elegantbeef> https://hatebin.com/gczjtdqfom perhaps line 26 requires a copy? |
00:15:17 | FromDiscord | <Elegantbeef> expanded `spawn` macro |
00:21:42 | FromDiscord | <proton> sent a long message, see http://ix.io/4bb3 |
00:23:37 | FromDiscord | <Elegantbeef> Well you have a min repo so make an issue with that |
00:36:29 | FromDiscord | <proton> ok, thanks! |
00:37:32 | * | derpydoo joined #nim |
01:03:08 | FromDiscord | <proton> I found out task have to be put in a proc (because of stack?) and doesn't work with async macro |
01:49:49 | FromDiscord | <Elegantbeef> Ah it's cause global variables arent fun |
01:50:03 | FromDiscord | <Elegantbeef> I always forget about global variables with the RCs |
02:20:39 | FromDiscord | <retkid> ladies and gentlemen |
02:20:58 | FromDiscord | <retkid> and everything inbetween |
02:21:06 | FromDiscord | <retkid> i present to you the most garbage code I've written in a while |
02:21:07 | FromDiscord | <Elegantbeef> What about the gerbils? |
02:21:22 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=4bbl |
02:22:33 | FromDiscord | <retkid> i wonder how many times slower it is than sort |
02:22:53 | FromDiscord | <Elegantbeef> Is this a count table for characters? |
02:23:01 | FromDiscord | <retkid> yea |
02:23:11 | FromDiscord | <Elegantbeef> was `array[char, int]` too much? |
02:23:23 | FromDiscord | <retkid> it was too memory efficient |
02:23:39 | FromDiscord | <Elegantbeef> And to performance efficient? |
02:23:48 | FromDiscord | <retkid> yea |
02:24:21 | FromDiscord | <retkid> i would have done more like seq[int(char,int)] |
02:24:28 | FromDiscord | <retkid> (edit) removed "seq[int(char,int)]" |
02:24:42 | FromDiscord | <retkid> seq[(char,int)] tho |
02:24:54 | FromDiscord | <Elegantbeef> Awful |
02:25:12 | FromDiscord | <Elegantbeef> There is also `CountTable` that does what you've done but 'proper' |
02:26:29 | FromDiscord | <retkid> i didn't even need to do this properly and counttable annoyed me for 2 seconds |
02:26:55 | FromDiscord | <retkid> a cs student was like "oh our teacher wants us to sort a string without sort()) |
02:27:07 | FromDiscord | <retkid> "i could do this in like 5 minutes" |
02:27:11 | FromDiscord | <retkid> "no you cant" |
02:27:33 | FromDiscord | <Elegantbeef> Also you know there is a `repeat` procedure? |
02:27:54 | FromDiscord | <retkid> couldn't figure out how to get the int to a char |
02:28:02 | FromDiscord | <retkid> for repeat |
02:28:06 | * | derpydoo quit (Quit: derpydoo) |
02:31:45 | FromDiscord | <Elegantbeef> `char(myInt)` or `ord(myChar)` |
02:33:47 | FromDiscord | <retkid> no but if you do char(myInt) it returns the value |
02:33:48 | FromDiscord | <Rika> You need to take your time and relax reading the documentation |
02:33:59 | FromDiscord | <Rika> In reply to @retkid "no but if you": ??? |
02:34:17 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/1022697381524951090/unknown.png |
02:34:41 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/1022697481471012974/unknown.png |
02:34:45 | FromDiscord | <retkid> see |
02:34:54 | FromDiscord | <Rika> That’s correct |
02:34:56 | FromDiscord | <Rika> What’s wrong |
02:35:12 | FromDiscord | <Rika> Oh you want the integer |
02:35:15 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=4bbo |
02:35:26 | FromDiscord | <Rika> Then you have to offset by some number I forgot |
02:35:48 | FromDiscord | <Elegantbeef> `ord '0'` |
02:37:06 | FromDiscord | <retkid> ord returns int not char |
02:37:10 | FromDiscord | <Rika> Yes |
02:37:13 | FromDiscord | <Rika> That’s the offset |
02:37:34 | FromDiscord | <Rika> The digit you have + that number then convert it to char |
02:41:11 | FromDiscord | <retkid> i feel mildly stupid but i didn't know about ord until now |
02:43:07 | FromDiscord | <Bung> does anonymous proc implicitly convert to closure ? could be other callconv ? |
02:44:29 | FromDiscord | <Bung> am debugging into this https://github.com/nim-lang/Nim/issues/16736 found the problem , not sure how to fix |
02:45:41 | FromDiscord | <Bung> the lvalue and rvalue checked seperately cause this |
02:47:14 | FromDiscord | <Elegantbeef> The bug here is that you can use `Proctype` on `const` |
02:47:26 | FromDiscord | <Elegantbeef> typedefs procs are implicitly closures |
02:48:13 | FromDiscord | <Bung> yeah, but it can be used as type annotation |
02:48:54 | FromDiscord | <Elegantbeef> It should be an error on const |
02:49:23 | FromDiscord | <Bung> no, it actually runs after my fix |
02:50:38 | FromDiscord | <Bung> my thought was when let a variable with anonymous proc without explict callconv , it is closure right ? |
02:50:42 | FromDiscord | <Elegantbeef> It's not a nimcall though |
02:51:04 | FromDiscord | <Elegantbeef> `const a: proc()` is a closure |
02:52:02 | FromDiscord | <Elegantbeef> A const closure isnt correct so it errors |
02:52:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bbr |
02:54:25 | FromDiscord | <Bung> so why Proctype besides with something doesn't work , Proctype is closure right ? |
02:54:59 | FromDiscord | <Elegantbeef> Nim raises nimcall procs to closure |
02:55:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ySF |
02:56:35 | FromDiscord | <Elegantbeef> By annotating `ProcType` you're saying it's a closure procedure, but the issue is that you cannot have a const closure |
02:56:41 | FromDiscord | <Elegantbeef> `type ProcType = proc(){.nimcall.}` makes the code compiler |
02:56:44 | FromDiscord | <Elegantbeef> compile\ |
02:57:51 | FromDiscord | <Elegantbeef> Cooldome is 100% correct it shouldnt compile but assumes the reader knows why |
02:59:17 | FromDiscord | <Elegantbeef> The issue is basically down to the fact that closure has that refcounted environment, which is quite difficult to get any of those semantics to work in a constant |
02:59:18 | FromDiscord | <Bung> I changed the callConv in semProcAux make it works |
02:59:28 | FromDiscord | <Elegantbeef> Sure you can make it work but it shouldnt work |
02:59:31 | FromDiscord | <Elegantbeef> It should be an error |
03:01:43 | FromDiscord | <Elegantbeef> "Closure cannot be used with a constant as its semantics cannot be respected" 😄 |
03:02:21 | FromDiscord | <Elegantbeef> If it's a nimcall you now made a type change type |
03:02:22 | FromDiscord | <Elegantbeef> Is it still a `closure` or is it a `nimcall` |
03:02:22 | FromDiscord | <Elegantbeef> What is the `typeof` your variable when you make it compile? |
03:03:43 | FromDiscord | <Elegantbeef> It's practically the same as `const myVal = new int` |
03:04:18 | FromDiscord | <Bung> yeah, I consider that , it's like const ref type |
03:05:55 | FromDiscord | <Bung> but https://github.com/nim-lang/Nim/issues/16737 in the comments, cooldome change it to closure make it works , that should be error still ? as you said |
03:06:36 | FromDiscord | <Elegantbeef> I dont think he's right there |
03:07:36 | FromDiscord | <Bung> I runs that modification version it runs , and results as expected .. |
03:10:30 | FromDiscord | <Elegantbeef> Sure but I still dont think it's proper |
03:10:45 | FromDiscord | <Elegantbeef> Make it a closure that depends on a compile time value and see what happens |
03:12:51 | FromDiscord | <Elegantbeef> I dont know if closures should be capable of being const so no clue what's correct here |
03:12:54 | FromDiscord | <Elegantbeef> I'll shush now 😄 |
03:15:41 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bbA |
03:17:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bbB |
03:18:28 | FromDiscord | <Elegantbeef> Actually that should be `new int` and `myVal[]` |
03:21:50 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bbC |
03:21:59 | FromDiscord | <Bung> this ? it print all 0 |
03:22:26 | FromDiscord | <Elegantbeef> `static: myVal[] = 100` |
03:23:01 | FromDiscord | <Elegantbeef> Also what GC are you using? |
03:23:14 | FromDiscord | <Bung> same results, refc; |
03:23:22 | FromDiscord | <Elegantbeef> If using refc add `GCFullCollect` |
03:23:37 | FromDiscord | <Elegantbeef> In orc/arc do this in a procedure |
03:25:07 | FromDiscord | <Bung> GCFullCollect() at end ? same result |
03:25:18 | FromDiscord | <Elegantbeef> I'm surprised |
03:28:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bbF |
03:28:37 | FromDiscord | <Elegantbeef> That doesnt compile 😄 |
03:29:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bbG |
03:30:26 | FromDiscord | <Bung> oh, I see the error `VM problem: dest register is not set` |
03:30:46 | FromDiscord | <Bung> it's same as when u assign const proc to a variable |
03:30:49 | FromDiscord | <Elegantbeef> like i said i dont know if const closures should work, they dont make sense to me personally, but yea |
03:31:21 | FromDiscord | <Elegantbeef> Like you dont get any benefit from having a const closure |
03:31:26 | FromDiscord | <Bung> btw, what's const proc {.noconv.} means |
03:31:38 | FromDiscord | <Elegantbeef> no calling convention |
03:31:46 | FromDiscord | <Bung> I see it from CI fails in my PR |
03:31:56 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#types-procedural-type |
03:32:43 | FromDiscord | <Elegantbeef> Conventions are mentioned in the manual there |
03:33:13 | FromDiscord | <Bung> I saw that , but dont understand const function meaning |
03:33:42 | FromDiscord | <Elegantbeef> a const procedure is really just the name of the procedure for all the other calling conventions |
03:33:45 | FromDiscord | <Bung> or what's the difference, if const closure make no sense |
03:33:51 | FromDiscord | <Elegantbeef> So it's a pointer proc that can be inlined |
03:34:37 | FromDiscord | <Elegantbeef> closures have an environment which is heap allocated and the pointer to the procedure, as such it doesnt make sense that you can have a constant closure that can be used by the backend, as the environment has to be static |
03:35:05 | FromDiscord | <Elegantbeef> So a constant closure would be equivlent to a normal procedure with variables inserted |
03:35:20 | FromDiscord | <Elegantbeef> The closest approximation would be a procedure that takes a static value |
03:36:47 | FromDiscord | <Bung> what about const proc noconv |
03:37:04 | FromDiscord | <Elegantbeef> proc with calling conventions |
03:37:10 | FromDiscord | <Elegantbeef> It's no different to nim call |
03:37:34 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4bbH |
03:37:38 | FromDiscord | <Elegantbeef> It's just the proc name in the end |
03:38:04 | FromDiscord | <Bung> so const nimcall make sense ? |
03:38:29 | FromDiscord | <Elegantbeef> of course |
03:38:29 | FromDiscord | <Elegantbeef> `const myProc = someProc` just stores the name of the proc |
03:38:37 | FromDiscord | <Elegantbeef> So when you call it just emits `someProc(args)` |
03:39:06 | FromDiscord | <Elegantbeef> static procedures also are the same |
03:39:23 | FromDiscord | <Elegantbeef> This is actually nice cause it allows you to have pointer proc like behaviour but actually get inline |
03:39:57 | FromDiscord | <!&luke> In reply to @ripluke "why do i get": does anyone know how to fix this |
03:40:05 | FromDiscord | <Elegantbeef> Manually publish it |
03:40:50 | FromDiscord | <!&luke> oh so is the cli broken or something? |
03:40:58 | FromDiscord | <Elegantbeef> No clue |
03:42:27 | FromDiscord | <!&luke> lmao ok, its quite a large file, i have a lot of scrolling to do |
03:45:42 | FromDiscord | <Rika> Maybe your repository has no tags |
03:45:52 | FromDiscord | <Rika> Not sure if nimble cares about that that much though |
03:47:38 | FromDiscord | <Bung> am gonna make it a CT error |
03:48:12 | * | sagax joined #nim |
03:48:54 | FromDiscord | <Bung> ` calling convention of the procedure` `expects a proc of the calling convention closure` from the manual, am confusing, which belongs which ? |
03:50:05 | FromDiscord | <Bung> (edit) "` calling convention of the procedure` ... `expects" added " ... " |
03:58:04 | FromDiscord | <Bung> `const 'something' cannot be assigned to proc of calling convention 'closure'` how about error like this ? |
03:58:40 | FromDiscord | <Elegantbeef> I'm terrible at good error messages so i'll say "sure" |
04:48:51 | FromDiscord | <Bung> hmm, it affect `vm/tvmmisc.nim(358, 11) Error: const 'EnvelopeCalcSin0' cannot be assigned to proc of calling convention 'closure'` |
05:02:53 | FromDiscord | <ravinder387> In reply to @Elegantbeef "proc with calling conventions": what does 'export' keyword do |
05:04:16 | FromDiscord | <ravinder387> In reply to @Rika "Maybe your repository has": what does export do |
05:12:10 | FromDiscord | <Prestige> https://nim-lang.org/docs/manual.html#modules-export-statement @ravinder387 |
05:16:01 | FromDiscord | <Elegantbeef> I love that the manual is so hard to use |
05:17:07 | FromDiscord | <Bung> so memoried the manual : ) |
06:05:01 | FromDiscord | <xTrayambak> Hello! |
06:07:45 | FromDiscord | <Rika> Hi |
06:11:22 | FromDiscord | <xTrayambak> Wasn't me who spent 2 days trying to figure out a problem, only for it to be fixed by using templates. |
06:12:04 | FromDiscord | <Elegantbeef> If templates solve the problem you have a weird problem |
06:12:22 | FromDiscord | <xTrayambak> Oh not this again https://media.discordapp.net/attachments/371759389889003532/1022752261857882182/unknown.png |
06:12:26 | FromDiscord | <xTrayambak> This error is the bane of my existence. |
06:13:03 | FromDiscord | <Elegantbeef> In a clippy prompt↵"It seems you're having issues with generics, would you like help with that?" |
06:13:40 | FromDiscord | <xTrayambak> What am I even doing wrong here? (ignore `initMultiLVM`, it is not where the error occurs. the error occurs at `createExtensionManager`) https://media.discordapp.net/attachments/371759389889003532/1022752588191506432/unknown.png |
06:13:53 | FromDiscord | <Elegantbeef> `: array` |
06:13:54 | FromDiscord | <Elegantbeef> That's a generic |
06:14:06 | FromDiscord | <xTrayambak> That's causing the problem....? |
06:14:07 | FromDiscord | <Elegantbeef> There is a bug that bung fixed that'd have been helpful here |
06:14:11 | FromDiscord | <Elegantbeef> Yes |
06:14:22 | FromDiscord | <Elegantbeef> It should be `: seq[MyType]` |
06:14:26 | FromDiscord | <xTrayambak> Oh. |
06:14:35 | FromDiscord | <Elegantbeef> Or `array[index, MyType]` |
06:14:43 | FromDiscord | <Elegantbeef> `array` alone is a typeclass which means "all arrays" |
06:14:46 | FromDiscord | <xTrayambak> I'm still learning Nim, so this is slightly difficult to wrap my head around since I'm coming from Python. |
06:15:02 | FromDiscord | <xTrayambak> Python lets you apply flex tape on basically any and every problem. |
06:15:03 | FromDiscord | <Elegantbeef> There is a bug in stable and before that the error didnt fire |
06:15:21 | FromDiscord | <xTrayambak> Atleast I'm learning to not be lazy, haha. |
06:15:58 | FromDiscord | <Bung> simple rule is your container type in the result should be concrete type or can be inferred. |
06:16:06 | FromDiscord | <xTrayambak> When would you suggest me to dip my feet into the world of pointers? Like, as in what should I do before I attempt learning pointers? |
06:16:14 | FromDiscord | <Bung> if it can't your code is wrong |
06:16:39 | FromDiscord | <xTrayambak> My experience with pointers right now has been.... well, weird. I deallocated a pointer twice and it segfaulted with no warning. I had a good laugh at that. |
06:16:40 | FromDiscord | <Elegantbeef> I dont recall with all your nice fixes recently |
06:16:40 | FromDiscord | <Elegantbeef> You did fix this right bung? |
06:16:53 | FromDiscord | <Elegantbeef> I mean you can touch pointers whenever you want, they're just fancy integers |
06:17:06 | FromDiscord | <Elegantbeef> Nim generally doesnt use them directly and uses `ref` instead |
06:17:25 | FromDiscord | <Elegantbeef> references are pointers that cannot be dangling, and are managed automatically so it's just better |
06:17:41 | FromDiscord | <Elegantbeef> Sometimes you need pointers for low level operations or C interop, so it's helpful to learn though |
06:17:43 | FromDiscord | <Bung> I dont recall, from my eye it should error when type decared. |
06:18:04 | FromDiscord | <Elegantbeef> Yea it should, i know someone had the issue on the forum recently and i pointed where the issue was, but i didnt fix it |
06:19:00 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9436 this post |
06:19:22 | FromDiscord | <xTrayambak> God darn it, i3 is glitching out again. |
06:19:23 | FromDiscord | <xTrayambak> This is what I get now. https://media.discordapp.net/attachments/371759389889003532/1022754027836035132/unknown.png https://media.discordapp.net/attachments/371759389889003532/1022754028129619988/unknown.png |
06:20:25 | FromDiscord | <Bung> oh , found that https://github.com/nim-lang/Nim/pull/20356/files this one maybe |
06:22:15 | FromDiscord | <Bung> well, my fix issue when it construct. |
06:22:44 | FromDiscord | <xTrayambak> (for context, my array consists of `PyObject`s since I am using a Python library alongside Nim) |
06:23:49 | FromDiscord | <Bung> yeah, that's in dynamic type, nim is static typed language |
06:24:02 | FromDiscord | <xTrayambak> So, no fix? |
06:24:24 | FromDiscord | <xTrayambak> Because the problem is that, I cannot just swap out the library. |
06:24:36 | FromDiscord | <Elegantbeef> You just need to do`@[]` |
06:24:41 | FromDiscord | <Elegantbeef> In Nim `array` and `seq` are different |
06:24:58 | FromDiscord | <xTrayambak> Can I have a small explanation? Like a reaaaallly small one. |
06:25:00 | FromDiscord | <Bung> it's your code problem, the fix will not help you |
06:25:06 | FromDiscord | <xTrayambak> Like "long story short: blah blah blah" |
06:25:18 | FromDiscord | <Elegantbeef> `array` are fixed size and the length is known at compile time. Seqs are dynamic sized and can grow |
06:25:51 | FromDiscord | <xTrayambak> Yeah, my array needs to be of just `3` in size (excluding 0) |
06:26:11 | FromDiscord | <Elegantbeef> So then you need to do `array[3, PyObject]` |
06:26:19 | FromDiscord | <xTrayambak> Alrighty. |
06:26:29 | FromDiscord | <Elegantbeef> That will give you a static collection(it can never grow, unless you recompile) |
06:26:35 | FromDiscord | <xTrayambak> Wait, won't that throw the same error I got earlier? |
06:26:36 | FromDiscord | <Bung> the only issue here related to compiler should be error array has no size and element type happened when you declare type |
06:26:44 | FromDiscord | <Elegantbeef> No the issue with before was lacking generic arguments |
06:27:13 | FromDiscord | <Elegantbeef> `: array` is a generic lacking generic parameters so is just invalid code |
06:27:49 | FromDiscord | <Elegantbeef> There is a bug in the compiler that didnt error when you declared it, so it errored on first usage(generics are instantiated) |
06:27:55 | FromDiscord | <xTrayambak> Oh. |
06:28:57 | FromDiscord | <xTrayambak> Do I need to provide an array with atleast 1 item inside it to the constructor when I'm initializing it? |
06:29:22 | FromDiscord | <Bung> I dont know that array can be called "generic", maybe because it handled specially in compiler. |
06:29:31 | FromDiscord | <xTrayambak> In reply to @xTrayambak "Do I need to": Like this https://media.discordapp.net/attachments/371759389889003532/1022756577314340874/unknown.png |
06:29:45 | FromDiscord | <xTrayambak> Or this https://media.discordapp.net/attachments/371759389889003532/1022756639834636328/unknown.png |
06:31:02 | FromDiscord | <Elegantbeef> Nim 0's memory so you can just do `ExtensionManager` |
06:31:04 | FromDiscord | <Elegantbeef> Whoops |
06:31:07 | FromDiscord | <Elegantbeef> `ExtensionManager()` |
06:31:08 | FromDiscord | <Bung> you specified it as seq[PyObject] , I think no need |
06:31:35 | FromDiscord | <xTrayambak> Yeeep, my program compiles now. |
06:31:39 | FromDiscord | <xTrayambak> Thank you so much. |
06:31:40 | FromDiscord | <Elegantbeef> But if you want to manually zero it you can do `ExtensionManager(lvmStates: [default(PyObject), default(PyObject), default(PyObject)])` |
06:31:48 | FromDiscord | <xTrayambak> I've been pulling my hair at this for the past 3 days. |
06:32:09 | FromDiscord | <Elegantbeef> Like i said arrays are statically type, so you have to supply 3 entries in `[]` when you use an array |
06:32:31 | FromDiscord | <xTrayambak> Oh my lord. I almost had a heart attack when it told me that the program crashed, but in reality it was that I forgot to compile the program with `-d:ssl`. |
06:32:34 | FromDiscord | <Elegantbeef> If it was a seq you could do `@[]` or `@[createLvm()]` or `@[createLvm(), createLvm(), createLvm()]` |
06:32:38 | FromDiscord | <Bung> when we call generic it means Container[T] , where T is known after instantiated |
06:32:55 | FromDiscord | <Elegantbeef> Generics are really just sneaky templates for types |
06:34:31 | FromDiscord | <Bung> I prefer call it container as other language does |
06:34:37 | FromDiscord | <xTrayambak> Yeahh, I think I need to get adjusted to all the things that come with compiled langs. |
06:35:03 | FromDiscord | <xTrayambak> Do you think SDL is ok for rendering 2D stuff? |
06:35:48 | * | kenran joined #nim |
06:36:40 | FromDiscord | <Elegantbeef> SDL is fine |
06:36:48 | FromDiscord | <Bung> I think it's ok , as there are wrapper packages |
06:37:07 | FromDiscord | <Elegantbeef> If you want to be a bit less annoyed you can use https://github.com/ftsf/nico or https://github.com/GabrielLasso/drawim |
06:37:28 | FromDiscord | <Elegantbeef> Nico is a nice wrapper over SDL2 and you can still use raw access if you need |
06:37:47 | FromDiscord | <Elegantbeef> https://streamable.com/5antvr like this is using nico |
06:38:23 | FromDiscord | <xTrayambak> Streamable doesn't work, haha. |
06:38:28 | FromDiscord | <xTrayambak> Atleast not with LibreWolf. |
06:39:27 | FromDiscord | <xTrayambak> I don't intend to make a game in Nim, if I wanted to, I'd use Panda3D. I am actually writing a small program that can parse and show HTML documents. |
06:43:05 | FromDiscord | <Bung> like a small browser ? |
06:43:14 | FromDiscord | <xTrayambak> Almost. |
06:43:21 | FromDiscord | <Bung> cool ! |
06:43:29 | FromDiscord | <xTrayambak> I successfully wrote one in Python but I think we all know where that went. |
06:43:39 | FromDiscord | <xTrayambak> It performed worse than Google Chrome. And that says something. |
06:44:18 | FromDiscord | <xTrayambak> It allocated memory at approx 400 mb/sec and ended up causing a kernel panic even though I had a considerable amount of RAM (16 GB) |
06:44:43 | FromDiscord | <xTrayambak> And I don't know if this was the cause but one of the RAM sticks died out afterwards and I had to remove them otherwise my PC wouldn't even boot, haha. |
06:45:14 | FromDiscord | <xTrayambak> So, in the end:↵-> I lost 50 braincells↵-> I lost 4 gigs of RAM↵-> I lost my self-esteem |
06:45:29 | FromDiscord | <xTrayambak> xd |
06:45:45 | FromDiscord | <xTrayambak> Thankfully my program is working nicely. |
06:46:33 | FromDiscord | <Elegantbeef> https://github.com/treeform/pixie might be of service aswell then 😄 |
06:48:02 | FromDiscord | <xTrayambak> It looks like it will! |
06:48:11 | FromDiscord | <xTrayambak> I was just configuring my logger to my liking right now. |
06:48:18 | FromDiscord | <xTrayambak> It's surprisingly easier than Python! |
06:48:20 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "So, in the end:": Python did that? Damn |
06:48:23 | FromDiscord | <Elegantbeef> They do also have https://github.com/treeform/boxy which would could help aswell |
06:48:35 | FromDiscord | <Elegantbeef> of course python did, python doesnt like you |
06:49:09 | FromDiscord | <Forest [She/Her]> Fair enough haha |
06:49:19 | FromDiscord | <xTrayambak> (not me writing a game in Python, uh-huh) |
06:49:34 | FromDiscord | <xTrayambak> BTW, beef, you needed Panda3D-Nim bindings, right? |
06:49:43 | FromDiscord | <xTrayambak> The maintainer of Panda3D has released some experimental ones. |
06:50:21 | FromDiscord | <xTrayambak> <https://github.com/rdb/nim-panda3d> |
06:50:46 | FromDiscord | <Elegantbeef> I needed? |
06:51:41 | FromDiscord | <xTrayambak> https://media.discordapp.net/attachments/371759389889003532/1022762160524382238/unknown.png |
06:51:48 | FromDiscord | <xTrayambak> Don't ask me why I dug up 2 year old messages. |
06:52:15 | FromDiscord | <Elegantbeef> Yea that was me really wanting to look for game related stuff near when i first started |
06:52:20 | FromDiscord | <Elegantbeef> Now i just have my own framework |
06:53:05 | FromDiscord | <xTrayambak> Nice. |
06:53:54 | FromDiscord | <Elegantbeef> Not that it's really usable for anyone but me, but alas |
06:55:35 | FromDiscord | <xTrayambak> I also am writing an extensions API for my HTML reader. |
06:55:48 | FromDiscord | <xTrayambak> It's not gonna use Manifest standards, instead, it'll use LUA. |
06:56:01 | FromDiscord | <Elegantbeef> I hate you and everything you stand for |
06:56:06 | FromDiscord | <xTrayambak> True. |
06:56:11 | FromDiscord | <xTrayambak> I hate myself as well. |
06:56:30 | FromDiscord | <Elegantbeef> Excuse my outburst, wasm is clearly the better way to script, source that guy |
06:57:10 | FromDiscord | <xTrayambak> No no -- the engine will (hopefully) support JS/WASM scripting but I mean that the extensions on client-side will not use JS like traditional Manifest. |
06:57:25 | FromDiscord | <xTrayambak> I am not a huge fan of JS and it's community either. |
06:57:51 | FromDiscord | <Elegantbeef> Sure use wasm! |
06:57:58 | FromDiscord | <xTrayambak> I'm using a `ring-privilege` system for managing what an extension can or cannot do. https://media.discordapp.net/attachments/371759389889003532/1022763736555061269/unknown.png |
06:58:27 | FromDiscord | <Rika> Why rings and not individual permissions |
06:59:07 | FromDiscord | <xTrayambak> Ring four can only show notifications, ring three can show notifs, change the UI theming, ring two can intercept, read and cancel requests along with all of the things below and ring one interacts closely with the web engine itself and has all the privileges with write privilege to requests, and also, it can do ✨I/O✨ |
06:59:24 | FromDiscord | <xTrayambak> I wrote a better and more readable documentation for it, but I'm scared it will be too spammy. |
06:59:38 | FromDiscord | <xTrayambak> In reply to @Rika "Why rings and not": Does it look to you like I am a hard working person? |
07:00:47 | FromDiscord | <xTrayambak> Ring four is for.... eh... calendars?↵Ring three is for theming stuff and mostly aesthetics↵Ring two is for ad-blocking and privacy protection↵Ring one is for... I don't know... maybe some hardcore privacy protection? |
07:01:32 | FromDiscord | <Elegantbeef> Oh shit your array was for this, we can do better hten |
07:01:34 | FromDiscord | <Elegantbeef> then even |
07:02:11 | FromDiscord | <xTrayambak> Yeep. |
07:02:26 | FromDiscord | <xTrayambak> I'm storing the different privileged LVMs in an array. |
07:02:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bc3 |
07:03:01 | FromDiscord | <xTrayambak> Oh damn. |
07:03:03 | FromDiscord | <Elegantbeef> Then you can do `instanceOfYourType.lvmStates[rlOne]` |
07:03:09 | FromDiscord | <xTrayambak> Alrighty. |
07:05:45 | FromDiscord | <xTrayambak> Let's hope this time, my PC doesn't have an aneurysm again and doesn't deplete my memory to 8 GB. |
07:05:55 | FromDiscord | <Elegantbeef> If it does it's on you |
07:06:03 | FromDiscord | <Elegantbeef> You can write very memory efficient Nim |
07:06:25 | FromDiscord | <xTrayambak> So I won't have Nim to blame for my mistakes? 🥹 |
07:06:41 | FromDiscord | <Elegantbeef> Only the compiler bugs really |
07:06:57 | FromDiscord | <xTrayambak> I will call your manager instead! 😡 |
07:07:18 | FromDiscord | <Elegantbeef> Well luckily i dont work here |
07:07:25 | FromDiscord | <xTrayambak> My code unintentionally segfaulted again. https://media.discordapp.net/attachments/371759389889003532/1022766119410479124/unknown.png |
07:07:26 | FromDiscord | <Elegantbeef> So i can just tell you to sod off and walk away |
07:08:07 | FromDiscord | <xTrayambak> This is what I am doing. https://media.discordapp.net/attachments/371759389889003532/1022766296070365204/unknown.png |
07:08:11 | * | jjido joined #nim |
07:08:37 | FromDiscord | <Elegantbeef> why not just `extMgr = [ringOneLvm, ringTwoLvm, ringThreLvm, ringFourLvm]` |
07:08:47 | FromDiscord | <Elegantbeef> But that's line 26? |
07:08:53 | FromDiscord | <xTrayambak> Yeahh. |
07:09:02 | FromDiscord | <Elegantbeef> sorry `extMgr.lvmStates = ...` |
07:09:36 | FromDiscord | <Elegantbeef> Nothing there calls any nimpy code so i question it |
07:10:16 | FromDiscord | <xTrayambak> HAH, mortal. I can make Python crash with native code! |
07:11:36 | FromDiscord | <xTrayambak> sent a code paste, see https://play.nim-lang.org/#ix=4bc5 |
07:12:32 | FromDiscord | <xTrayambak> Something's going wrong here. https://media.discordapp.net/attachments/371759389889003532/1022767402573901824/unknown.png |
07:13:15 | FromDiscord | <xTrayambak> `ringFourLVM` is a `lupa.LuaRuntime` object (see <https://github.com/scoder/lupa>) which in turn in a PyObject. |
07:13:28 | FromDiscord | <xTrayambak> In theory, it should have a `globals()` function. |
07:13:47 | FromDiscord | <xTrayambak> Is it because I'm setting it to nil? |
07:14:01 | FromDiscord | <xTrayambak> Does it being nil mean it's deallocated? |
07:14:19 | FromDiscord | <Elegantbeef> It means it's nil, which means it has no data |
07:14:35 | FromDiscord | <xTrayambak> There's currently three languages in the mix right now -- Nim, Python and LUA. We can't be sure whether what's the culprit it seems. |
07:15:00 | FromDiscord | <xTrayambak> Could it be that the GC is sweeping the value away? |
07:15:35 | FromDiscord | <Elegantbeef> Unlikely |
07:16:00 | FromDiscord | <xTrayambak> This error occured to me whilst I was playing around with Nim -- it happens when you try to deallocate something that is already deallocated. |
07:16:47 | FromDiscord | <xTrayambak> Nope, still happens when the GC is disabled. |
07:17:11 | FromDiscord | <Mrcool> Hello, can I configure the lsp to use js backend ? |
07:17:13 | FromDiscord | <xTrayambak> Let me try `std/segfaults` |
07:17:46 | FromDiscord | <Elegantbeef> Make a config file that has `-d:js` i think↵(@Mrcool) |
07:17:53 | FromDiscord | <Mrcool> thanks |
07:17:54 | FromDiscord | <Elegantbeef> It's not Nim causing the segfault so fix your other stuff |
07:18:09 | FromDiscord | <xTrayambak> Let me try doing some stuff. |
07:18:57 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bc7 |
07:19:31 | FromDiscord | <Elegantbeef> use `cstring` |
07:20:17 | FromDiscord | <Mrcool> nice |
07:20:22 | FromDiscord | <Mrcool> but that feels weird |
07:20:25 | FromDiscord | <Mrcool> why a cstring for js |
07:20:50 | FromDiscord | <Elegantbeef> compatible string |
07:21:08 | FromDiscord | <Mrcool> ah ok I see, I thought its like rust cstring xD |
07:21:22 | FromDiscord | <xTrayambak> This is the `setAttr` method in Nimpy. https://media.discordapp.net/attachments/371759389889003532/1022769630948892702/unknown.png |
07:21:37 | FromDiscord | <Elegantbeef> It technically is when you use the C/C++ backend |
07:21:47 | FromDiscord | <Bung> @ElegantBeef https://github.com/nim-lang/Nim/issues/19546 this one reported same issue |
07:22:14 | FromDiscord | <Mrcool> can you link me the config docs? |
07:23:03 | FromDiscord | <Elegantbeef> Well ti's a slightly different issue |
07:23:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bc8 |
07:24:12 | FromDiscord | <Elegantbeef> I honestly dont there there is any explicit config file docs |
07:24:45 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files you got this |
07:28:14 | FromDiscord | <Mrcool> the config is picked up by the lsp since it keeps exiting now because of syntax error |
07:28:21 | FromDiscord | <Mrcool> I put `nim c --backend=js myproject.nim` there |
07:28:49 | FromDiscord | <Elegantbeef> you just need `--backend:js` |
07:29:31 | FromDiscord | <Mrcool> thanks |
07:30:10 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=4bca |
07:31:02 | FromDiscord | <Mrcool> anyone have a workflow with neovim? I'm using lspconfig for the lsp, I found that there is not curretly uptodate treesitter parser (I might add or fork one) |
07:31:19 | FromDiscord | <xTrayambak> Me. |
07:31:25 | FromDiscord | <xTrayambak> I use NeoVim. |
07:31:50 | FromDiscord | <Elegantbeef> leorize had been working on one https://github.com/alaviss/tree-sitter-nim |
07:32:05 | FromDiscord | <Elegantbeef> It's not completed afaik, but it's a in progress grammar |
07:32:40 | FromDiscord | <xTrayambak> Do you need dotfiles or just a list of plugins that make Nim development tolerable in NVim? |
07:33:39 | FromDiscord | <Mrcool> both maybe I want to know whats avalable |
07:33:43 | FromDiscord | <Mrcool> (edit) "avalable" => "available" |
07:34:09 | FromDiscord | <Mrcool> crrently I have to use `set filetype=nim` each time do you have an autocmd for that |
07:34:14 | FromDiscord | <Mrcool> (edit) "crrently" => "currently" |
07:35:15 | FromDiscord | <Mrcool> is the lsp similar to the old rls in rust as in it has to compile stuff to work? because it feels slow |
07:35:47 | FromDiscord | <Elegantbeef> Yes |
07:36:11 | FromDiscord | <Elegantbeef> Nim does not have incremental compilation, so you get the pleasure of recompilation |
07:36:25 | FromDiscord | <Elegantbeef> Though nimsuggest v3 does have a cache iirc so should reduce that |
07:36:43 | FromDiscord | <Mrcool> hopefully in the future we have nimanalayzer xD |
07:36:59 | FromDiscord | <Mrcool> or copilot becomes free, because I used to feel that I don't need an lsp with it |
07:37:06 | FromDiscord | <Elegantbeef> Eh when we get IC life will be great |
07:37:31 | FromDiscord | <Mrcool> cool |
07:37:43 | FromDiscord | <Elegantbeef> But who knows when that will be done |
07:37:58 | FromDiscord | <xTrayambak> Nimsuggest is a bit clunky. |
07:38:05 | FromDiscord | <xTrayambak> It freezes NeoVim when suggesting sometimes. |
07:39:31 | FromDiscord | <Elegantbeef> Yea tooling is a thing |
07:40:37 | FromDiscord | <xTrayambak> OH. MY. LORD. |
07:40:49 | FromDiscord | <xTrayambak> I was copy pasting something here and almost revealed my GitHub token. |
07:41:57 | FromDiscord | <Mrcool> glad it didn't happen, in the bright side you have immunity for the next year against such things |
07:44:15 | FromDiscord | <xTrayambak> Btw, here are all the VimPlug plugins. https://media.discordapp.net/attachments/371759389889003532/1022775388251885568/unknown.png |
07:45:05 | FromDiscord | <Mrcool> thanks I'll check those out |
07:45:38 | FromDiscord | <xTrayambak> You also need `nvim-tree.nvim` by kyazdani42 for a file tree |
07:46:17 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bcb |
07:46:36 | * | jmdaemon quit (Ping timeout: 268 seconds) |
07:46:41 | FromDiscord | <xTrayambak> You also need patched "Nerd" fonts for the tree to show the icon of the files. |
07:49:53 | * | rockcavera quit (Remote host closed the connection) |
07:51:55 | * | arkurious joined #nim |
07:52:34 | FromDiscord | <xTrayambak> "Mom, can we have BSPWM at home?"↵"We already have BSPWM at home."↵BSPWM at home: https://media.discordapp.net/attachments/371759389889003532/1022777482816016444/unknown.png |
07:57:36 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "`ringFourLVM` is a `lupa.LuaRuntime`": Are you... Using Nimpy so you can use Lupa to use Lua for your manifest? |
07:57:54 | FromDiscord | <Forest [She/Her]> What the hell :p |
07:58:30 | FromDiscord | <Elegantbeef> I though forest here had the patent on wacky ideas |
07:58:35 | FromDiscord | <Elegantbeef> thought\ |
07:59:35 | FromDiscord | <Forest [She/Her]> Exactly, my job has been stolen lmao |
08:00:18 | FromDiscord | <Forest [She/Her]> Oh yeah that reminds me, i should work on making it so Futhark doesn't export the numbered identifiers so it has better autocompletion |
08:07:29 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:10:32 | * | vicecea quit (Remote host closed the connection) |
09:11:30 | * | vicecea joined #nim |
09:12:51 | * | dnh joined #nim |
09:40:14 | * | wallabra_ joined #nim |
09:40:51 | * | wallabra quit (Ping timeout: 244 seconds) |
09:42:01 | * | wallabra_ is now known as wallabra |
09:59:32 | FromDiscord | <qb> Anyone an Idea how to use nimraylib's textBox? `text` argument takes a normal cstring and I get a SIGSEGV whenever I try to edit the box. Also tried `text[0].addr` https://github.com/greenfork/nimraylib_now/blob/master/src/nimraylib_now/mangled/raygui.nim#L463 |
10:01:17 | * | jjido joined #nim |
10:08:39 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:25:50 | FromDiscord | <Bung> @ElegantBeef https://github.com/bung87/Nim/commit/9f76d09f3259296851a70dc2e145454e153c6d17 I've fix that, it will help new comer hopefully. |
10:40:48 | FromDiscord | <Forest [She/Her]> "Nim comes preinstalled with a module called nimpy"↵https://medium.com/statch/speeding-up-python-code-with-nim-ec205a8a5d9c ↵Huh? |
10:46:58 | FromDiscord | <ChocolettePalette> Ah, medium, medium. I was once pondering on how to make a seamless noise abd stumbled upon an article on this site.Basically, the idea was to somehow map a 2D noise square map to a sphere, then simply copy some space to the left from a conjunction and mirror it, copying it to the right of the conjunction |
10:47:26 | FromDiscord | <ChocolettePalette> Since then if I ever see a link to medium, I skip it |
10:48:53 | FromDiscord | <ChocolettePalette> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1022821371643961354): Ah, medium, medium. I was once pondering on how to make a seamless noise and stumbled upon an article on this site.Basically, the idea was to somehow map a 2D noise square map to a sphere, then simply copy some space to the left from a conjunction and mirror it, copying it to the right of the conjunction |
10:57:38 | FromDiscord | <Cobalt> What music player do you use? This doesn't look like spotify but appears to have a good layout↵(@xTrayambak) |
11:05:16 | FromDiscord | <Rika> That looks like Spotify to me |
11:05:34 | FromDiscord | <Rika> The thing covering it is a notification |
11:07:39 | FromDiscord | <flywind> Now the devel branch defaults to ORC. |
11:23:49 | * | jjido joined #nim |
11:30:48 | FromDiscord | <xTrayambak> In reply to @Dreamer (Previously Forest) "Are you... Using Nimpy": Yep. |
11:30:59 | FromDiscord | <xTrayambak> The Nim LUA bridges are extremely janky. |
11:31:18 | FromDiscord | <xTrayambak> In reply to @Cobalt "What music player do": That's Spotify, it somehow does some weird stuff when you resize it. |
11:31:33 | FromDiscord | <xTrayambak> The thing covering it is a `dunst` notification. |
11:32:00 | FromDiscord | <Rika> In reply to @xTrayambak "The Nim LUA bridges": I was planning on doing some work on it but I stalled :inatehe: |
11:32:06 | FromDiscord | <xTrayambak> Just distro-hopped to EndeavourOS. |
11:32:14 | FromDiscord | <xTrayambak> Fedora's memory chomping was unbearable. |
11:32:40 | * | wallabra_ joined #nim |
11:32:42 | FromDiscord | <Rika> Why would it devour memory? |
11:32:57 | FromDiscord | <xTrayambak> Dunno. GNOME consumes 1500 mb but i3 does only 500. |
11:33:12 | FromDiscord | <xTrayambak> And KDE, whilst using 800 mb, messes up the entire system. |
11:33:19 | FromDiscord | <Rika> Really, weird |
11:33:25 | * | wallabra quit (Ping timeout: 246 seconds) |
11:33:38 | FromDiscord | <xTrayambak> Pretty sure Fedora is rewriting some stuff in Rust, that will probably make things way worse. |
11:33:57 | FromDiscord | <xTrayambak> What is your distro of choice? |
11:34:32 | FromDiscord | <Rika> I don’t know right now I’m just using Manjaro because of a bad choice years ago and no shits given to switch to another |
11:34:33 | * | wallabra_ is now known as wallabra |
11:34:52 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "The Nim LUA bridges": Could use Futhark to wrap the API? |
11:34:59 | FromDiscord | <Rika> I’d probably use Arch for other systems and NixOS for headless |
11:35:19 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "Yep.": Honestly you might as well just use Python instead of Lua for the metadata format |
11:35:27 | FromDiscord | <Rika> In reply to @Dreamer (Previously Forest) "Could use Futhark to": Doesn’t help the issue, I think the programmer facing side is the issue for the library |
11:35:32 | FromDiscord | <Forest [She/Her]> In reply to @Rika "I don’t know right": Same here lmao |
11:35:41 | FromDiscord | <Forest [She/Her]> In reply to @Rika "Doesn’t help the issue,": Ah fair |
11:35:48 | FromDiscord | <Rika> In reply to @Dreamer (Previously Forest) "Honestly you might as": Same, if you’re already going through so much trouble with the bridging |
11:36:01 | FromDiscord | <Rika> There’s deffo prolly some sort of easy exploit because of the double bridge |
11:36:11 | FromDiscord | <Forest [She/Her]> Yeahhh |
11:36:31 | FromDiscord | <Forest [She/Her]> Python also is arguably just as simple as Lua on the core level |
11:36:40 | FromDiscord | <Forest [She/Her]> Only thing really lacking isolation |
11:36:43 | FromDiscord | <Rika> Not really |
11:36:51 | FromDiscord | <Rika> CPython is a beast |
11:36:59 | FromDiscord | <Forest [She/Her]> In reply to @Rika "Not really": Oh? How is it not? |
11:37:16 | FromDiscord | <Forest [She/Her]> The basic structures like maps and tables are essentially the same and imo cleaner |
11:37:19 | FromDiscord | <Rika> The implementations don’t really help for integration and embedding I believe |
11:37:29 | FromDiscord | <Rika> I guess we’re thinking of two different things |
11:37:39 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "Yep.": Also, why not use NimScript instead? |
11:37:48 | FromDiscord | <Rika> That’s another good point lol |
11:37:59 | FromDiscord | <Forest [She/Her]> In reply to @Rika "I guess we’re thinking": Ah yeah, i don't mean the implementation lmao, absolutely not |
11:38:18 | FromDiscord | <Forest [She/Her]> I mean when making Lua and Python code, most code can easily be ported |
11:40:38 | FromDiscord | <xTrayambak> In reply to @Dreamer (Previously Forest) "Same here lmao": As a former Manjaro user I understand your pain |
11:40:46 | FromDiscord | <Rika> The languages are similar but Lua has the simpler core while Python doesn’t give you a massive headache more often |
11:40:58 | FromDiscord | <Forest [She/Her]> I also installed Bedrock Linux on top of Manjaro too |
11:41:03 | FromDiscord | <Rika> (edit) "more" => "as" |
11:41:10 | FromDiscord | <Forest [She/Her]> I need a fresh Arch installation lmao |
11:41:19 | FromDiscord | <Forest [She/Her]> In reply to @Rika "The languages are similar": Fair enough haha |
11:41:20 | FromDiscord | <xTrayambak> I didn't leave Manjaro, Manjaro left me. Literally. After a quick `pacman -Syu` my bootloader went BOOM. |
11:41:35 | FromDiscord | <Forest [She/Her]> That happened to me once too! |
11:41:57 | FromDiscord | <Rika> In reply to @xTrayambak "I didn't leave Manjaro,": :rip: |
11:41:59 | FromDiscord | <xTrayambak> I got pissed off and went to Fedora. |
11:42:06 | FromDiscord | <Forest [She/Her]> I just used the boot menu instead of Grub from then on lmao |
11:42:09 | FromDiscord | <xTrayambak> Pop was my first OS, Fedora second and Manjaro third. |
11:42:14 | FromDiscord | <Rika> Hasn’t happened to me yet |
11:42:30 | FromDiscord | <Forest [She/Her]> Mine was Ubuntu (via WUBI, it was my first experience with linux and was great) |
11:42:48 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "Pop was my first": Pop OS was great ngl, haven't used Fedora |
11:43:03 | FromDiscord | <xTrayambak> Pop is the best distro for newbies |
11:43:19 | FromDiscord | <Forest [She/Her]> But yeah, try Nimscript instead if ya want a nicer format for metadata files |
11:43:21 | FromDiscord | <xTrayambak> mostly windows normies who go "bUt mUh gAemIng!!?!?!/1/11" |
11:43:45 | FromDiscord | <Forest [She/Her]> You can even make macros to make it even simpler then it already is |
11:43:46 | FromDiscord | <xTrayambak> From Manjaro I went to endeavour, got mad that I couldn't run Minecraft (it was my fault) and went to vanilla Arch. Got pissed off that I bloated it so much that it was extremely slow and went back to Fedora. |
11:44:12 | FromDiscord | <Forest [She/Her]> https://github.com/beef331/nimscripter provides a nice api for embedding Nimscript |
11:44:30 | FromDiscord | <Forest [She/Her]> In reply to @xTrayambak "From Manjaro I went": Fair, i bloat mine too much lmao |
12:42:23 | FromDiscord | <Goel> Does nim by default uses all available system Cores when running an app build with -d:release? |
12:52:14 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4bcS |
12:52:25 | FromDiscord | <ravinder387> Event data type error |
12:58:03 | FromDiscord | <Rika> In reply to @Goel "Does nim by default": The compiler is single threaded, C compiler isn’t usually |
12:58:45 | FromDiscord | <Bung> In reply to @Goel "Does nim by default": I dont think it specific to language level. |
13:00:14 | FromDiscord | <ravinder387> multithreading only work on linux |
13:00:24 | FromDiscord | <ravinder387> threads:on |
13:00:47 | FromDiscord | <ravinder387> by default every program is single thrreading |
13:11:37 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:28:24 | FromDiscord | <coin_ex_exchange> sent a long message, see http://ix.io/49IZ |
13:41:15 | FromDiscord | <flywind> <@&371760044473319454> |
13:48:46 | FromDiscord | <Forest [She/Her]> I've finally perfected my script for setting up Nim on Linux |
13:49:13 | FromDiscord | <Forest [She/Her]> It's a bash script but it works well :) |
13:49:17 | FromDiscord | <Forest [She/Her]> Uses choosenim tho |
13:53:31 | * | LuxuryMode joined #nim |
13:53:42 | FromDiscord | <Forest [She/Her]> Question, why are you supposed to inherit from base lexer? To avoid conflicts with other packages and stuff? |
14:01:33 | * | Freneticks left #nim (WeeChat 3.0) |
14:16:38 | FromDiscord | <Kiloneie> Oh man, i had test code in several files and it all worked fine, put it in documentation, now i used nimib to format it, and SIGSEGV error that i cannot find D: |
14:16:53 | FromDiscord | <Kiloneie> how do you find this even ? |
14:24:15 | FromDiscord | <Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4bdf |
14:24:37 | FromDiscord | <Forest [She/Her]> My file is a big file (so i can test how the buffer works), but idk how i'm supposed to refresh the buffer? |
14:24:46 | FromDiscord | <Forest [She/Her]> I've just been staring at std/lexbase rn :p |
14:27:26 | * | rockcavera joined #nim |
14:51:02 | FromDiscord | <Kiloneie> does gdb that comes with gcc with Nim not put itself into path ? Mine wasn't there and i was too lazy to set it, just installed gdb via pacman even though i already have it. |
15:09:47 | * | pech joined #nim |
15:11:51 | * | disso_peach quit (Ping timeout: 252 seconds) |
15:14:37 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:17:56 | * | kenran quit (Quit: WeeChat info:version) |
15:42:27 | FromDiscord | <Kiloneie> Where can i find documentation on nimib's hlMd and hlMdf ? HlMdf was erroring pragmas in text all over the place, i can't seem to find information... |
15:43:19 | FromDiscord | <Kiloneie> And somehow im gertting SIGSEGV from nbSection template's last line, even though my other file has no such problems... |
15:44:32 | FromDiscord | <Kiloneie> Can putting """ to end nbText in the wrong place cause errors ? or just not put it in text for html ? |
15:45:27 | FromDiscord | <Phil> Where can I find again which libs are unavailable in nimscript? |
15:45:45 | FromDiscord | <Kiloneie> nimscript page no ? |
15:46:14 | FromDiscord | <Kiloneie> maybe CTFE page instead |
15:47:01 | FromDiscord | <Patitotective> In reply to @Kiloneie "Where can i find": nimib doesnt have documentation, you have to look at the source code |
15:47:10 | FromDiscord | <Patitotective> (edit) "In reply to @Kiloneie "Where can i find": nimib doesnt have ... documentation," added "(api)" |
15:47:19 | FromDiscord | <Phil> Shit, that means I can't interact with an sqlite db via nimscript |
15:48:06 | FromDiscord | <Kiloneie> sent a code paste, see https://play.nim-lang.org/#ix=4bdV |
15:48:07 | FromDiscord | <Kiloneie> why would last line error ? |
15:48:48 | FromDiscord | <Kiloneie> can weird text inputted into nbSection cause an error ? |
15:50:58 | FromDiscord | <Kiloneie> okay i think i just found the problem |
15:51:13 | FromDiscord | <Kiloneie> be wary of spaces with nimib code |
15:53:27 | FromDiscord | <Kiloneie> Between hlMdf and """ -> 0 spaces, and """ HAS to be in it's own line, unless you see proper coloring, it's erroring |
16:00:16 | FromDiscord | <Kiloneie> Well i got all of that stuff fixed, but... still SIGSEGV... |
16:15:27 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "Where can i find": They are described in nimiBoost's readme. They are implemented here: https://github.com/pietroppeter/nimib/blob/831c7dea5a3c81bf959031eeec6b357f76157197/src/nimib/boost.nim#L13 |
16:15:34 | FromDiscord | <hugogranstrom> Not much going on there though |
16:16:05 | FromDiscord | <hugogranstrom> They are basically only there to allow VSCode to find which strings should be formatted |
16:16:27 | FromDiscord | <Kiloneie> hmm okay |
16:16:43 | FromDiscord | <Kiloneie> do you maybe know why i am getting a sigsegv error ? |
16:17:03 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "Between hlMdf and """": No idea without a reproducible piece of code |
16:17:14 | FromDiscord | <hugogranstrom> or does the nbSection template fail on its own? |
16:17:55 | FromDiscord | <Kiloneie> Sectinos work just fine, it's the table of contents that's the problem |
16:18:18 | FromDiscord | <Kiloneie> sent a code paste, see https://play.nim-lang.org/#ix=4be8 |
16:18:19 | FromDiscord | <Kiloneie> but ToC does not show |
16:18:45 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "Between hlMdf and """": The weirdness of the ending `"""` having to be on its own line is purely because VSCode's builtin markdown syntax eats the entire document if you have it on the same line. It's not an error in the code itself, just in the syntax highlighting |
16:19:03 | FromDiscord | <Kiloneie> ah okay |
16:19:18 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "if i remove this": What is `nbToc` in this case? |
16:19:54 | FromDiscord | <Kiloneie> var↵ nbToc: NbBlock |
16:20:05 | FromDiscord | <Kiloneie> this is straight from cheatsheet page |
16:20:07 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "ah okay": I think the other highlightings `hlPy`, `hlHtml`, `hlNim` don't have this limitation though |
16:20:21 | FromDiscord | <Kiloneie> i only added one # to make titles smaller |
16:20:38 | FromDiscord | <Kiloneie> https://pietroppeter.github.io/nimib/cheatsheet.html |
16:21:01 | FromDiscord | <Kiloneie> i took that from here, in my smaller file which i use as a base for writing scritps it's working fine |
16:21:22 | FromDiscord | <hugogranstrom> Ok, then it's weird that it doesn't work :/ |
16:21:22 | FromDiscord | <Kiloneie> now that i modified my close to finished script file, it's crashing |
16:21:38 | FromDiscord | <Kiloneie> i've been comparing the 2 files for like 2 hours now |
16:21:46 | FromDiscord | <hugogranstrom> If you try to compile the original cheatsheet, does it work? |
16:21:53 | FromDiscord | <Kiloneie> le me see |
16:22:37 | FromDiscord | <Kiloneie> it also does |
16:23:32 | FromDiscord | <hugogranstrom> It fails? |
16:23:53 | FromDiscord | <hugogranstrom> just to check, which version of nimib are you runnning? |
16:25:13 | FromDiscord | <Kiloneie> where do i check that ? using nimble it only shows nimislides oO ? |
16:25:41 | FromDiscord | <hugogranstrom> nimble list ---installed or something like that I think |
16:26:06 | FromDiscord | <Kiloneie> nimib [0.3.1] |
16:26:22 | FromDiscord | <hugogranstrom> Ok that's the latest version, good |
16:26:29 | FromDiscord | <Kiloneie> like i just copy pasted that whole starting code till my first section again and nothing changed |
16:26:39 | FromDiscord | <hugogranstrom> I'm not able to reproduce this locally, cheatsheet runs fine |
16:26:40 | FromDiscord | <Kiloneie> must be some kind of really tiny thing |
16:26:56 | FromDiscord | <Patitotective> In reply to @hugogranstrom.nim "nimble list ---installed or": `nimble dump nimib` also works ;] |
16:27:30 | FromDiscord | <Kiloneie> compiler points me to that exact line |
16:27:38 | FromDiscord | <hugogranstrom> In reply to @Patitotective "`nimble dump nimib` also": wonderful `desc: "nimib \xF0\x9F\x90\xB3 - nim \xF0\x9F\x91\x91 driven \xE2\x9B\xB5 publishing \xE2\x9C\x8D"` |
16:27:41 | FromDiscord | <hugogranstrom> 🤣 |
16:27:50 | FromDiscord | <Kiloneie> i checked every nbSection in case somehow a weird character could affect it, checked every """ nbText and it's hlMdf |
16:27:54 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "compiler points me to": Could you send the error message? |
16:28:32 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "i checked every nbSection": If the original cheatsheet document doesn't work for you, something really odd is going on |
16:28:47 | FromDiscord | <Patitotective> In reply to @hugogranstrom.nim "wonderful `desc: "nimib \xF0\x9F\x90\xB3": they shouldnt have escaped it :p |
16:28:52 | FromDiscord | <Kiloneie> https://wtools.io/paste-code/bFna |
16:29:15 | * | dnh joined #nim |
16:29:18 | FromDiscord | <Kiloneie> the original works, and my smaller conversion |
16:29:22 | FromDiscord | <Kiloneie> this bigger one ain't |
16:29:22 | FromDiscord | <hugogranstrom> In reply to @Patitotective "they shouldnt have escaped": it's emojis I realized now... |
16:29:50 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "the original works, and": Ok, then we have something to work with at least |
16:31:19 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "if i remove this": Ok, so line 35 in the file is this line of code? |
16:32:30 | FromDiscord | <Kiloneie> yep |
16:32:41 | FromDiscord | <Kiloneie> i can give you the entire file if you want |
16:33:04 | FromDiscord | <Kiloneie> as soon as i remember the website that supports nim highlight |
16:33:51 | FromDiscord | <Kiloneie> wandbox.com is the one |
16:33:56 | FromDiscord | <Kiloneie> you want the file ? |
16:34:05 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4beg |
16:34:15 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "you want the file": Yes that would help a lot 🙂 |
16:34:57 | FromDiscord | <hugogranstrom> I just can't see what could be nil on that line. Unless you forgot to run `addToc()` first |
16:35:11 | FromDiscord | <Patitotective> In reply to @auxym "hm what's up with": you should use std/unicode |
16:35:30 | FromDiscord | <Kiloneie> https://wandbox.org/permlink/w1w1dHQKEG06DalG |
16:35:32 | FromDiscord | <hugogranstrom> Then `nbToc` (ref object) would still be nil |
16:35:36 | FromDiscord | <Kiloneie> no i checked that |
16:35:41 | FromDiscord | <Kiloneie> let me recheck though |
16:36:28 | FromDiscord | <auxym> In reply to @Patitotective "you should use std/unicode": it's just a bag of bytes though, not any sort of valid unicode. I suspect that search stops on the null byte, but this behavior is not documented. |
16:36:31 | FromDiscord | <Kiloneie> dammit |
16:36:34 | FromDiscord | <Kiloneie> i fixed it |
16:36:52 | FromDiscord | <Kiloneie> 2x nbSections were above #TABLE OF CONTENTS↵addToc() |
16:37:01 | FromDiscord | <hugogranstrom> Ahhh |
16:37:46 | FromDiscord | <Kiloneie> like i said earlier, such a small thing |
16:37:50 | FromDiscord | <Kiloneie> xD... |
16:38:05 | FromDiscord | <hugogranstrom> Haha yes, the small bugs are the worst ones to deal with 😅 |
16:38:27 | FromDiscord | <auxym> ah aparenly it's a known bug (severe), hopefully it gets fixed soon https://github.com/nim-lang/Nim/issues/19500 |
16:38:39 | FromDiscord | <hugogranstrom> Glad it works now at least 🙂 |
16:38:52 | FromDiscord | <Kiloneie> yeah, thanks for the help though 🙂 |
16:39:22 | FromDiscord | <Kiloneie> gonna be sharing these scripts with nimib now, i shared my messes of scripts made by comments before |
16:39:37 | FromDiscord | <Kiloneie> now it's gonna look like a half decent written tutorial 😛 |
16:41:26 | FromDiscord | <hugogranstrom> No problem, glad that you appreciate nimib |
16:42:56 | FromDiscord | <Kiloneie> I might use nimiSlides in the actual videos as well, but still thinking about it. |
16:44:33 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "I might use nimiSlides": Please let me know if you try it out, what you think about it and how it can improve. I'm writing my own first real presentation with it now and I'm noticing things that need a bit of polishing. The more the merrier |
16:44:58 | FromDiscord | <Kiloneie> Sure will ! |
16:45:12 | FromDiscord | <hugogranstrom> The `animateCode` feature is pretty neat for going through codes, like by line |
16:45:34 | FromDiscord | <Kiloneie> yeah i was about to mention |
16:45:46 | FromDiscord | <Kiloneie> might actually ease my recordings |
16:46:05 | FromDiscord | <Kiloneie> writing code and explaining it at the same time is the worst |
16:46:21 | FromDiscord | <Kiloneie> especially if english is not your primary language, you can get lost |
16:47:20 | FromDiscord | <hugogranstrom> Indeed, I've thought about adding something like the typewriter effect, but it writes a piece of code instead. So it looks like you are typing it out, but I haven't felt the motivation yet. Maybe some day 🤣 |
16:47:55 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "Shit, that means I": Could use Nimscripter to expose it maybe? |
16:48:01 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "writing code and explaining": Indeed, and knowing that the code actually works is really nice as well |
16:48:57 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "especially if english is": Definitely, did a take of one of my videos for NimConf today in VSCode and I was struggling to type and talk at the same time 🙃 |
16:49:28 | FromDiscord | <Kiloneie> i've had times where i said something but wrote something else... and i only figured that out like an hour later , when i finished recording |
16:49:43 | FromDiscord | <Kiloneie> then comes the screenshot gluing ... |
16:49:56 | FromDiscord | <Phil> In reply to @Dreamer (Previously Forest) "Could use Nimscripter to": I kinda don't want to make that entire thing too complicated. The idea was mostly to add an "initial setup" nimble task to my project that would allow somebody else to just run it and get a completely capable server project with pre-defined admin etc. |
16:50:05 | FromDiscord | <pietroppeter> hi @Kiloneie, I saw the ask or help on nimib, from a quick glance it seems that @Phil and @hugogranstrom already got you covered with all the answers you needed, not sure if there is more left |
16:50:05 | FromDiscord | <Phil> Though I guess I should write an admin UI for that first |
16:50:15 | FromDiscord | <Forest [She/Her]> Ah fair |
16:50:33 | FromDiscord | <Forest [She/Her]> Couldn't you just make something to call back into Nim functions you've defined? |
16:51:19 | FromDiscord | <Phil> Not if I'm going to use nimble tasks, which was the original intent.↵If it comes down to it I can just make a sub-project which contains all these commands and do a nimble task that first compiles that binary, then executes it |
16:51:26 | FromDiscord | <Phil> (edit) "Not if I'm going to use nimble tasks, which was the original intent.↵If it comes down to it I can just make a sub-project which contains all these commands and do a nimble task that first compiles that binary, then executes it ... " added "to do the setup" |
16:51:29 | FromDiscord | <Forest [She/Her]> Also according to beef in his GitHub on one of the issues, it may be possible to cast a ptr of a proc to a distinct integer and then cast it back into a ptr? Can't remember iirc |
16:51:31 | FromDiscord | <Kiloneie> In reply to @pietroppeter "hi <@398205119583485964>, I saw": At the moment probably not, though is there a way, i don't know markup that much, if you can enforce that a line is in it's own line without making it a list item like "- list item" =? |
16:51:32 | FromDiscord | <Forest [She/Her]> In reply to @Isofruit "Not if I'm going": Aah fair |
16:51:45 | FromDiscord | <Patitotective> In reply to @Isofruit "Not if I'm going": just use nake ;] |
16:51:57 | FromDiscord | <Phil> In reply to @Patitotective "just use nake ;]": wasn't nake some webview thingy? |
16:52:25 | FromDiscord | <Patitotective> its like nimble tasks but it actually uses nim and its compiled |
16:52:38 | FromDiscord | <Patitotective> so you can `nake task` |
16:52:59 | FromDiscord | <Patitotective> https://github.com/fowlmouth/nake |
16:52:59 | FromDiscord | <Phil> hmmm but that'd mean somebody would need to install nake first before using the project |
16:53:11 | FromDiscord | <Phil> Minimizing dependencies and so on |
16:53:25 | FromDiscord | <pietroppeter> In reply to @Kiloneie "At the moment probably": I would say add an empty line before and one after so that the line becomes a single paragraph, but not sure if this is what you are asking |
16:54:19 | FromDiscord | <Patitotective> In reply to @Isofruit "hmmm but that'd mean": `nimble install` ? |
16:54:29 | FromDiscord | <Patitotective> you anyways have to install dependencies |
16:54:36 | FromDiscord | <Patitotective> (edit) "dependencies" => "dependencies, i think" |
16:57:31 | FromDiscord | <Kiloneie> In reply to @pietroppeter "I would say add": https://media.discordapp.net/attachments/371759389889003532/1022914622170333205/unknown.png |
16:57:38 | FromDiscord | <Kiloneie> This is what i meant |
16:57:47 | FromDiscord | <Kiloneie> i said the wrong thing, sorry D:. |
16:58:36 | FromDiscord | <Kiloneie> the goal is the above 2 lines, TITLE and ALT TITLE, but without making them both a list item via "- 1 empty space", they will go into the same line |
16:58:51 | FromDiscord | <Kiloneie> if there is no solution, it's fine, i will just make such lines into list items |
17:00:20 | FromDiscord | <Kiloneie> Also where would i have to go to change the size of the background ? |
17:00:43 | FromDiscord | <Kiloneie> no... the entire nimib page ? |
17:01:04 | FromDiscord | <Kiloneie> some text may peak trough or be hidden in a ... quote box ? |
17:01:17 | FromDiscord | <Kiloneie> The thing you make with 4 spaces |
17:03:01 | * | pech quit (Remote host closed the connection) |
17:03:16 | * | pech joined #nim |
17:04:39 | FromDiscord | <Phil> In reply to @Patitotective "`nimble install` ?": Yeh, but I can delay that dependency install for the moment they need to actually compile the binary, so it can go ↵`nimble initial_setup` ↵`nimble deploy` |
17:11:13 | FromDiscord | <pietroppeter> In reply to @Kiloneie "the goal is the": maybe you could add a <br> element in your markdown? this is an issue I think about markdown itself and when you those limits usually you need to use html (which indeed is allowed in markdown. it would be something like "- TITLE: bla<br>ALT TITLE: blo" (this would be on a single line in your source file, but you can probably put this in 2 lines indenting before <br>) |
17:12:36 | FromDiscord | <pietroppeter> In reply to @Kiloneie "no... the entire nimib": size of the page is defined by water.css (I guess a width in the body element but I would have to check), probably adding a style element in the html will override that, but not sure |
17:13:08 | FromDiscord | <pietroppeter> have to go now, might be able to answer more later |
17:13:27 | FromDiscord | <Kiloneie> Okay, thanks! |
17:18:12 | FromDiscord | <CircArgs> sent a code paste, see https://play.nim-lang.org/#ix=4bex |
17:28:59 | FromDiscord | <Kiloneie> Umm is there a VS Code extension that works like a browser's inspector, mouse over some HTML code and it highlights it in code ? |
17:29:34 | FromDiscord | <Kiloneie> If there isn't i will open up an issue for nimib, this would be extremely useful if nothing exists |
17:34:09 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "Umm is there a": For nimib specifically? I highly doubt it. Not sure how one would implement such a thing either. But if it's possible it's more feasible that you link the code in the "Show source" section to their generated parts in the code. |
17:35:04 | * | jmdaemon joined #nim |
17:35:06 | FromDiscord | <hugogranstrom> If you mean for inspecting the generated HTML file, then you might find something out there. Haven't looked though |
17:35:37 | FromDiscord | <Kiloneie> im looking now, i think i just found a better "live server" |
17:35:49 | FromDiscord | <Kiloneie> live server for me seems to stop working quite often |
17:35:58 | FromDiscord | <Kiloneie> especially if you move the browser |
17:36:19 | FromDiscord | <Kiloneie> HTML preview opens the html file inside vs code |
17:36:28 | FromDiscord | <Kiloneie> and updates as you compile the nim file |
17:37:27 | * | xet7 quit (Ping timeout: 250 seconds) |
17:41:48 | FromDiscord | <hugogranstrom> Weird, I've never had any problems with live server. ↵Ok that's nice 👍 |
17:42:16 | FromDiscord | <Kiloneie> it might be an issue with... automatic grid tiling i have |
17:43:36 | FromDiscord | <Kiloneie> btw what did you mean by linking the code in the show source section ? Where do you mean that ? browser ?... |
17:43:44 | FromDiscord | <hugogranstrom> I don't see how the window would change anything about a server 😅 but stranger things have happened. |
17:44:12 | FromDiscord | <Kiloneie> don't ask me about weird linux problems, solved by reseating a gpu... lol... |
17:46:22 | FromDiscord | <hugogranstrom> In reply to @Kiloneie "btw what did you": If you want to have a link from the nim code to the html it generated. My idea is that you would be able to click on a line of code in the "Show code" section, and then it would take you to the part of the document generated by it. It would be implemented in the document itself so would work wherever you run it. But I'm not sure if it's possible |
17:47:36 | FromDiscord | <hugogranstrom> Not sure how useful it would be either |
17:47:53 | FromDiscord | <hugogranstrom> It's not what you request though, rather the other way around |
17:48:31 | FromDiscord | <Kiloneie> ah, maybe someone with really big brain can solve this one 😛 |
17:50:12 | * | xet7 joined #nim |
17:50:20 | FromDiscord | <hugogranstrom> Yep, I gladly hand it over to them B) |
17:53:08 | FromDiscord | <Kiloneie> uhm how can i make it so that text of cast[] goes with square brackets ? |
17:53:19 | FromDiscord | <Kiloneie> it's not showing them |
17:55:58 | FromDiscord | <Kiloneie> https://media.discordapp.net/attachments/371759389889003532/1022929333012144268/unknown.png |
17:56:21 | FromDiscord | <Kiloneie> (w) also got eaten |
17:56:38 | FromDiscord | <Elegantbeef> use backticks |
17:56:57 | FromDiscord | <Elegantbeef> `[a](text)` is markdown for embedded link |
17:56:59 | FromDiscord | <hugogranstrom> `[link](www.website.com)` is a link in markdown |
17:57:29 | FromDiscord | <Kiloneie> haha lol i didn't even realise |
17:57:32 | FromDiscord | <Kiloneie> thanks |
18:25:40 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:27:08 | * | dnh joined #nim |
18:37:46 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4beH |
18:38:42 | FromDiscord | <demotomohiro> Create `a.nim` and define `proc b() = discard`. |
18:40:50 | FromDiscord | <Mrcool> and then I can do something like import "./a.nim" as A ? |
18:41:46 | FromDiscord | <demotomohiro> You can do `import a` and `b()` or `a.b()`. |
18:43:31 | FromDiscord | <Mrcool> thanks |
19:01:35 | * | dnh quit (Quit: Textual IRC Client: www.textualapp.com) |
19:04:59 | * | xet7 quit (Ping timeout: 250 seconds) |
19:08:30 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4beN |
19:08:46 | FromDiscord | <Mrcool> (edit) "https://play.nim-lang.org/#ix=4beN" => "https://play.nim-lang.org/#ix=4beO" |
19:14:51 | FromDiscord | <Generic> https://github.com/nim-lang/Nim/blob/version-1-6/lib/js/dom.nim#L1693 |
19:46:40 | FromDiscord | <Patitotective> is there a better way to `parseHex` to an unsigned integer than parsing it to a `uint64`, converting it back to `int64` and catching any `RangeDefect` errors?↵i.e.: `0xabcdef1234567890` as a signed integer is `-6066930261531658096` but i want `12379813812177893520` (still `int64`) |
19:47:17 | * | FromDiscord quit (Remote host closed the connection) |
19:47:30 | * | FromDiscord joined #nim |
19:54:52 | FromDiscord | <auxym> I dont think you'd ever get a range defect when casting? how could that happen? You're just reinterpreting bits, 64 bits is guaranteed to fit into a 64 bit int, signed or not |
19:55:29 | FromDiscord | <auxym> parseHex produces an int, which you should be able to cast to uint without rangedefect |
19:57:51 | FromDiscord | <Patitotective> In reply to @auxym "I dont think you'd": `0xabcdef1234567890` is in-range if the msb represents the sign, otherwise it is too big |
19:58:32 | FromDiscord | <Patitotective> In reply to @auxym "parseHex produces an int,": `strutils.parseHexInt` produces an int, im using `parseutils.parseHex` which expects SomeInteger as input |
19:59:56 | FromDiscord | <Patitotective> !eval import std/parseutils; var temp: uint64; discard parseHex("0xabcdef1234567890", temp); echo int64 temp |
20:00:19 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4beU |
20:00:56 | NimBot | Compile failed: <no output> |
20:01:20 | FromDiscord | <Elegantbeef> You're converting a uint64 to int64 |
20:01:59 | FromDiscord | <Elegantbeef> Why you dont just do `temp: int64` is beyond me |
20:04:07 | FromDiscord | <Patitotective> i want `12379813812177893520` but i'm getting `-6066930261531658096`↵i thought doing `int64 uint64 "0xabcdef1234567890"` would work but it gives me `1311768467294899695`↵:/ https://media.discordapp.net/attachments/371759389889003532/1022961579597246585/unknown.png |
20:04:26 | FromDiscord | <Elegantbeef> You want `cast[int64](myUint64)` |
20:04:45 | * | kenran joined #nim |
20:04:55 | FromDiscord | <Elegantbeef> Also might be a LE vs. BE issue |
20:06:42 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4beV |
20:08:05 | FromDiscord | <Elegantbeef> `12379813812177893520` is out of a int64 range |
20:08:16 | FromDiscord | <Elegantbeef> ` 1.2379813812178E+19` \> `9.22337203685e+18` |
20:08:22 | FromDiscord | <auxym> I meant parseHexInt, sorry, not parseHex |
20:08:48 | FromDiscord | <auxym> so `cast[uint](parseHexInt someString)` |
20:09:05 | FromDiscord | <Elegantbeef> Or just use parsehex |
20:10:06 | FromDiscord | <auxym> In reply to @Elegantbeef "Or just use parsehex": one will fail at the cast, other will fail during parsing, in out of range case (I think). pick your poison |
20:10:30 | FromDiscord | <Elegantbeef> I mean you read as unsigned check if it's in range then convert |
20:10:39 | FromDiscord | <Elegantbeef> Or you just read it as signed |
20:11:06 | FromDiscord | <Elegantbeef> I dont get why one would read the hex as unsigned then convert to signed thouhg |
20:11:20 | FromDiscord | <auxym> wait does parsehex even exist? its not in strutils |
20:11:28 | FromDiscord | <Elegantbeef> parseutils |
20:11:32 | FromDiscord | <auxym> oh |
20:11:36 | FromDiscord | <Patitotective> In reply to @Elegantbeef "I mean you read": im actually just catching the range-defect and reraising it through the parser |
20:11:37 | FromDiscord | <Patitotective> (edit) "the" => "my" |
20:11:49 | FromDiscord | <auxym> strutils.parseHexInt returns an int, wasn't aware of parseutils.parseHex |
20:11:56 | FromDiscord | <Patitotective> In reply to @Elegantbeef "I dont get why": kdl ¯\_(ツ)_/¯ |
20:15:22 | FromDiscord | <Patitotective> `int64 uint64 parseHexInt("0xabcdef1234567890")` |
20:19:12 | FromDiscord | <auxym> I agree with beef (now) though: just use `parseHex` if you are expecting uint,` parseHexInt` if you're expecting signed, and skip any casting or conversion. |
20:20:48 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4beZ |
20:28:05 | FromDiscord | <hotdog> In reply to @Mrcool "I have an enum": Nim code to reproduce? |
20:35:08 | FromDiscord | <Mrcool> sent a code paste, see https://play.nim-lang.org/#ix=4bf1 |
20:40:34 | FromDiscord | <Mrcool> where does jsRoot come from ? it compiles but seems to confuse the lsp |
20:41:22 | FromDiscord | <hotdog> @Mrcool I'd guess that object is not wrapped correctly |
20:42:47 | FromDiscord | <hotdog> `arch` should just be cstring |
20:43:02 | FromDiscord | <hotdog> Enums are not represented as strings on the js backend |
20:43:17 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
20:43:31 | FromDiscord | <hotdog> In reply to @Mrcool "where does jsRoot come": You can add --backend:js to config.nims and the lsp should pick it up |
20:43:51 | FromDiscord | <Mrcool> In reply to @hotdog "You can add --backend:js": I did and it fixed importjs pragma but not jsRoot |
20:44:18 | FromDiscord | <Mrcool> Ok using a string works |
20:44:22 | FromDiscord | <Mrcool> but that feels kind of bad |
20:44:29 | FromDiscord | <Patitotective> kdl-nim is almost ready, all tests except from the float formatting ones pass https://github.com/Patitotective/kdl-nim/actions/runs/3115493452/jobs/5052442871↵(btw using `formatFloat` makes 17 tests fail while using the default `$float` only makes 8 tests fail) |
20:44:36 | FromDiscord | <Mrcool> (edit) "bad" => "bad, I'm loosing info" |
20:44:41 | FromDiscord | <hotdog> @Mrcool https://nim-lang.org/docs/system.html#JsRoot |
20:44:52 | FromDiscord | <hotdog> In reply to @Mrcool "but that feels kind": Well that's the data that's there |
20:45:12 | FromDiscord | <hotdog> You can parse it to another type, or add some kind of handler proc |
20:45:18 | FromDiscord | <Mrcool> arch is just "aarch64" | "x86_64" |
20:46:07 | FromDiscord | <hotdog> something like `proc archKind(deno: Deno): DenoBuildArch = parseEnum(deno.build.arch)` |
20:46:20 | FromDiscord | <hotdog> And don't export arch field |
20:46:41 | FromDiscord | <Mrcool> I see |
20:47:50 | FromDiscord | <Mrcool> do you think in the future enums could be transpiled correctly if feels like it almost can work jst instead of node.sons[arg] it should be in this case node.sons.findByName(arg) |
20:48:15 | FromDiscord | <Mrcool> (edit) "jst" => "just" | "node.sons[arg]" => "`node.sons[arg]`" | "node.sons.findByName(arg)" => "`node.sons.findByName(arg)`" |
20:48:44 | FromDiscord | <Elegantbeef> I think they are properly compiled |
20:48:53 | FromDiscord | <hotdog> In reply to @Mrcool "do you think in": Unlikely to change |
20:48:53 | FromDiscord | <Mrcool> also <https://github.com/juancarlospaco/nodejs> is using enum's everywhere thats why I thoght they should work |
20:48:56 | FromDiscord | <Elegantbeef> if you arent already do `choosenim devel` |
20:48:56 | FromDiscord | <Elegantbeef> See if that behaves differently |
20:49:04 | FromDiscord | <Mrcool> (edit) "thoght" => "thaught" |
20:49:13 | FromDiscord | <Mrcool> ok |
20:49:29 | FromDiscord | <hotdog> In reply to @Mrcool "also <https://github.com/juancarlospaco/nodejs> is ": Have you got a good example of a similar situation there? |
20:50:58 | FromDiscord | <Mrcool> nope I'll have to compile it and search how are enums being used first |
20:52:13 | FromDiscord | <hotdog> In reply to @Mrcool "nope I'll have to": Had a quick look through but can't see anywhere he's wrapping js strings as enums |
20:53:20 | FromDiscord | <hotdog> He has some enums that are there for convenience but they are converted to cstrings for the js side, e.g. https://github.com/juancarlospaco/nodejs/blob/1c8175c162ebcbac5d6e08eea8a57a851cc3c6ce/src/nodejs/jsfetch.nim#L93 ( `cstring($mode),`) |
20:55:21 | FromDiscord | <Mrcool> ok that makes sense actually thanks |
21:00:51 | FromDiscord | <Patitotective> damn, my kdl parser takes 60 seconds to parse a 376 lines long file :/↵time to profile |
21:05:50 | FromDiscord | <Elegantbeef> inb4 you were profiling with -d\:debug |
21:10:38 | FromDiscord | <Mrcool> Are there any obvious improvement I can do here? https://media.discordapp.net/attachments/371759389889003532/1022978319727206430/unknown.png |
21:11:09 | FromDiscord | <Mrcool> Its kind of sad that I loose the type info, it means that the switch is not provably exhaustive anymore |
21:13:45 | FromDiscord | <Patitotective> In reply to @Elegantbeef "inb4 you were profiling": release |
21:13:58 | FromDiscord | <Patitotective> and `--debugger:native` |
21:19:12 | FromDiscord | <qb> Could I get the length of characters in a uninitialized string created with newString? |
21:19:48 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=4bfa |
21:19:49 | FromDiscord | <qb> without having to loop over that string |
21:20:30 | FromDiscord | <Patitotective> well, you need to get rid of the `\0` characters in some way to get the "actual" length |
21:21:57 | FromDiscord | <Patitotective> `a.find('\0')` should work |
21:23:09 | FromDiscord | <qb> That works. Thank you |
21:24:29 | FromDiscord | <Patitotective> In reply to @Patitotective "damn, my kdl parser": found that i was copying the `Lexer` object unnecessarily, now it takes 10 seconds |
21:27:52 | * | kenran quit (Quit: WeeChat info:version) |
21:32:02 | FromDiscord | <Patitotective> now its splitLines and substr that are slowing down 🤔 https://media.discordapp.net/attachments/371759389889003532/1022983705997881404/unknown.png |
21:32:48 | FromDiscord | <Patitotective> what does nsu mean? 🤨 |
21:32:49 | FromDiscord | <Elegantbeef> Dont use splitline and substr |
21:33:23 | FromDiscord | <Patitotective> oh, im using splitLines to get the coord of a character |
21:33:42 | FromDiscord | <Elegantbeef> You're needlessly allocating, stop it get some help |
21:35:13 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4bfd |
21:35:31 | FromDiscord | <Elegantbeef> Not if they're costly |
21:35:45 | FromDiscord | <Patitotective> i think ill index all characters first so i dont have to call splitLines more than once |
21:36:12 | FromDiscord | <Elegantbeef> Alternatively just add `index` to the KdlParserError\` then let the user render the error |
21:38:30 | FromDiscord | <Patitotective> wdym by let the user render the error? |
21:38:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bfe |
21:39:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bff |
21:39:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4bfg |
21:40:19 | FromDiscord | <Elegantbeef> You should aim for your exceptions to be as cheap as possible whilst providing information |
21:40:23 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4bfh |
21:40:38 | FromDiscord | <Elegantbeef> Yea if you need to split lines you're doing it wrong |
21:41:02 | FromDiscord | <Elegantbeef> You should be able to do this entire thing without splitting for anything but identifiers really |
21:42:10 | FromDiscord | <Elegantbeef> And even then you technically could do something like packedjson where you use integers for start/end of an object |
21:42:18 | FromDiscord | <Elegantbeef> If you want to be fast you want to allocate sparsely and not cause exceptions to be big allocators |
21:43:35 | FromDiscord | <Patitotective> In reply to @Elegantbeef "And even then you": i'm just going to use start, since end is start+lexeme.len |
21:45:43 | FromDiscord | <Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4bfi |
21:46:13 | FromDiscord | <Elegantbeef> I mean you could, but now you have to maintain 2 dialects 😛 |
21:48:11 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4bfm |
21:48:37 | FromDiscord | <Patitotective> damn now just 2 seconds and still nice errors :]↵lets see how it goes without nice errors |
21:48:40 | FromDiscord | <hotdog> In reply to @Mrcool "Its kind of sad": Well you can parse it to an enum, but that's about it |
21:49:28 | FromDiscord | <Mrcool> new question I have this , but using proc main async seems to make it not be peresent at all in the transpiled code https://media.discordapp.net/attachments/371759389889003532/1022988092589748294/unknown.png |
21:49:49 | FromDiscord | <Mrcool> Also I'm sing proc main async because it seems the only way to be able to use await |
21:49:54 | FromDiscord | <Mrcool> (edit) "sing" => "using" |
21:49:55 | FromDiscord | <hotdog> p.s. the #webdev channel is good for js questions if you haven't seen it. Sometimes it gets busy on main |
21:50:13 | FromDiscord | <Mrcool> noted |
21:50:36 | FromDiscord | <hotdog> In reply to @Mrcool "new question I have": Which async package are you using? |
21:50:42 | FromDiscord | <Mrcool> import std/asyncjs |
21:50:53 | FromDiscord | <hotdog> And what is not present, the proc or the async part? |
21:52:00 | FromDiscord | <Mrcool> the whole main function with its inside is not present |
21:52:01 | FromDiscord | <Patitotective> now what takes the most is genericAssignAux https://media.discordapp.net/attachments/371759389889003532/1022988734024646767/unknown.png |
21:52:27 | FromDiscord | <hotdog> In reply to @Mrcool "the whole main function": Are you calling the main function somewhere? Nim does dead code elimination by default |
21:52:57 | FromDiscord | <Mrcool> nice works |
21:53:02 | FromDiscord | <Mrcool> discard main() |
21:55:55 | FromDiscord | <auxym> you can also tag it `{.exportc.}` to prevent it getting DCE'd |
22:00:33 | FromDiscord | <Mrcool> what the correct way to do expr.$ |
22:01:08 | FromDiscord | <Mrcool> instead of $(expr) |
22:03:04 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4bfr |
22:03:19 | FromDiscord | <hotdog> also `$expr` |
22:07:43 | FromDiscord | <Mrcool> `Deno.readTextFile(binaryPathFromName(name)).await.$`↵I want to write this like↵`name.binaryPathFromName.(Deno.readTextFile).await.` |
22:07:45 | FromDiscord | <Mrcool> (edit) "like↵`name.binaryPathFromName.(Deno.readTextFile).await.`" => "like↵`name.binaryPathFromName.(Deno.readTextFile).await.$`" |
22:08:11 | FromDiscord | <Mrcool> the problem is `Deno.readTextFile` fn, can it be chained like that? |
22:09:43 | FromDiscord | <Patitotective> i dont know, beef↵i dont see any notable difference between using splitLines on errors and not using it |
22:11:34 | FromDiscord | <hotdog> In reply to @Mrcool "`Deno.readTextFile(binaryPathFromName(name)).await.": How is readTextFile defined? |
22:11:53 | FromDiscord | <Mrcool> https://media.discordapp.net/attachments/371759389889003532/1022993736378089482/unknown.png |
22:13:52 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4bft |
22:14:44 | FromDiscord | <Mrcool> I guess another idea is to create a generic pipe function for these sort of things |
22:15:38 | FromDiscord | <Mrcool> this is in typescript https://media.discordapp.net/attachments/371759389889003532/1022994676443271220/unknown.png |
22:15:52 | FromDiscord | <Mrcool> do you think I can have something like this in nim |
22:18:03 | FromDiscord | <hotdog> In reply to @Mrcool "do you think I": https://nimble.directory/pkg/pipe |
22:23:01 | * | wallabra quit (Ping timeout: 246 seconds) |
22:23:05 | * | wallabra_ joined #nim |
22:25:18 | * | wallabra_ is now known as wallabra |
22:27:58 | FromDiscord | <Mrcool> seems to not be powerful enough? https://media.discordapp.net/attachments/371759389889003532/1022997773697679370/unknown.png |
22:28:29 | FromDiscord | <Mrcool> It looks super awesome though hopefully I can make it work |
22:31:10 | FromDiscord | <Elegantbeef> `$ name.binaryPathFromName.readtextFile.await` 😛 |
22:31:43 | FromDiscord | <Mrcool> the problem is readtextFile under Deno so its Deno.readtextFile |
22:31:48 | FromDiscord | <hotdog> In reply to @Mrcool "seems to not be": Haven't used it I'm afraid, just did a quick search on nimble |
22:31:52 | FromDiscord | <Elegantbeef> So dont pretend Nim is python |
22:32:19 | FromDiscord | <hotdog> Probably something in the async macro interfering |
22:33:38 | FromDiscord | <Mrcool> its probably the Deno namespacing again because if I simplify it , it work https://media.discordapp.net/attachments/371759389889003532/1022999209667993640/unknown.png |
22:34:15 | FromDiscord | <Mrcool> ah wait its that maco that is wrong |
22:34:39 | FromDiscord | <Mrcool> because just adding one more pipe fail |
22:36:40 | FromDiscord | <Mrcool> In reply to @Elegantbeef "So dont pretend Nim": python doesn't have pipes ? |
22:36:47 | FromDiscord | <Mrcool> I'm just exploring what nim can do |
22:36:49 | FromDiscord | <Elegantbeef> You're using namespaces |
22:37:18 | FromDiscord | <Mrcool> Ah ok I'm copying some typescript code |
22:37:18 | FromDiscord | <Elegantbeef> Using modules like namespaces is the downfall of society |
22:39:20 | FromDiscord | <Mrcool> Actually I didn't follow with the namespace idea, I'm just using a struct that has methods which is Deno global https://media.discordapp.net/attachments/371759389889003532/1023000645097234502/unknown.png |
22:40:10 | FromDiscord | <Rainbow Asteroids> In reply to @Elegantbeef "Using modules like namespaces": prove it |
22:40:16 | FromDiscord | <Elegantbeef> Yea the better thing to do is to do `proc readTextFile(s: cstring) {.importJs:"Deno.readTextFile($#).}` |
22:40:23 | FromDiscord | <Elegantbeef> It's more idiomatic this way |
22:40:55 | FromDiscord | <Elegantbeef> C++ has namespaces and look where it got us, is that proof?! |
22:41:25 | FromDiscord | <Elegantbeef> Atleast i imagine that's better |
22:41:33 | FromDiscord | <Elegantbeef> I dont know the API requirements so i guess smoke bomb |
22:42:03 | FromDiscord | <Mrcool> Its easier to jst keep close to the code I'm porting |
22:42:21 | FromDiscord | <Mrcool> well the code is working I4m just fightig for sugar xD |
22:42:26 | FromDiscord | <hotdog> In reply to @Elegantbeef "Yea the better thing": This is what I wrote above 🙂 |
22:42:36 | FromDiscord | <Mrcool> I only need this function https://media.discordapp.net/attachments/371759389889003532/1023001462218948678/unknown.png |
22:42:41 | FromDiscord | <hotdog> @Mrcool beef is just messing around don't take it to heart 😉 |
22:43:11 | FromDiscord | <Elegantbeef> Ah sorry dogwalk made me lose context |
22:46:08 | FromDiscord | <Mrcool> this works! https://media.discordapp.net/attachments/371759389889003532/1023002354146091150/unknown.png |
22:47:02 | FromDiscord | <Mrcool> https://media.discordapp.net/attachments/371759389889003532/1023002578134499338/unknown.png |
22:49:18 | FromDiscord | <hotdog> What language(s) are you coming from out of curiosity? @Mrcool |
22:49:40 | FromDiscord | <Mrcool> rust typescript mainly |
22:50:10 | * | carce joined #nim |
22:50:27 | FromDiscord | <hotdog> Cool |
22:50:35 | FromDiscord | <hotdog> Is deno any good? I've never used it |
22:53:59 | FromDiscord | <Mrcool> I personally like it a lot |
22:56:40 | FromDiscord | <Mrcool> it seems like using await in an anonymous functions makes you obliged to use return keyword |
22:57:34 | FromDiscord | <Mrcool> and using sugar fn from import sugar doesn't accept return keyword in the fn body |
22:58:32 | * | carce quit () |
22:59:26 | FromDiscord | <Mrcool> I've been wrapping anonymous fns with () because I read it was needed but it seems I can just remove them |
23:00:30 | FromDiscord | <hotdog> In reply to @Mrcool "it seems like using": Can you give an example? I know someone else had a problem with the asyncjs async macro recently |
23:00:47 | FromDiscord | <hotdog> Also related to returning but I don't remember exactly what it was |
23:04:05 | FromDiscord | <Mrcool> if you remove the return keyword here <https://github.com/sigmaSd/deno-nim/blob/master/example.nim#L18> it will complain ↵↵usually it doesn't but if there is an await it starts to require it |
23:05:02 | FromDiscord | <Mrcool> or maybe its because of the async pragma |
23:05:03 | FromDiscord | <hotdog> In reply to @Mrcool "if you remove the": Ah yeah it is related https://discord.com/channels/371759389889003530/764946138109050893/1012349660750422267 |
23:06:18 | FromDiscord | <hotdog> Compile with `--expandMacro:async` and see what it's doing |
23:09:20 | FromDiscord | <Mrcool> I think its enough messing around for the day, thanks for answering my questions! |
23:09:29 | FromDiscord | <hotdog> No problem 🙂 |
23:39:42 | NimEventer | New thread by CircArgs: Nimcuda , see https://forum.nim-lang.org/t/9489 |