<< 23-09-2022 >>

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