<< 15-01-2022 >>

00:04:38*neurocyte091709 joined #nim
00:05:02FromDiscord<that_dude> Can a template do any calculations, or is that reserved entirely to macros?
00:05:39FromDiscord<Elegantbeef> Templates are code substitution, they cannot compute anything
00:05:53FromDiscord<that_dude> ok
00:06:36*neurocyte09170 quit (Ping timeout: 250 seconds)
00:07:36FromDiscord<that_dude> and to follow that up, in general, is there a major performance diff to using a template with a lot of if statements when I could just use the macro to properly generate the one path I need
00:07:59FromDiscord<that_dude> It shouldn't be bad right?
00:08:13FromDiscord<Elegantbeef> Well yea if you have a bunch of if statements you're evaluating them, why not use when if you can do it in a macro?
00:09:32FromDiscord<Rika> Well unless if you need it on runtime of course
00:09:55FromDiscord<that_dude> I'm using it as a helper for another macro I wrote
00:10:01FromDiscord<Elegantbeef> They said they could generate the single path in a macro rika
00:10:29FromDiscord<that_dude> > The statements within a branch do not open a new scope.↵What does this mean?
00:10:40FromDiscord<that_dude> I look up the doc for when statemnt
00:10:42FromDiscord<that_dude> (edit) "statemnt" => "statement"
00:10:51FromDiscord<that_dude> So like no proc call?
00:11:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3McW
00:11:13FromDiscord<Rika> Any statements in a when statement is part of the outer scope only, no branching and local scope variables etc
00:11:44FromDiscord<Rika> You can access things inside a when from the outside
00:12:27FromDiscord<that_dude> ah ok
00:12:41FromDiscord<that_dude> so like a normal if statement
00:12:54FromDiscord<Elegantbeef> No
00:12:59FromDiscord<Elegantbeef> If statements make scope
00:13:03FromDiscord<Elegantbeef> When statements do not make scope
00:13:04FromDiscord<that_dude> wait they do?
00:13:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3McX
00:14:06FromDiscord<that_dude> Damn I never encounted that. I always define the `a` before to avoid accidentally going down a path that doesn't set it
00:14:40FromDiscord<leorize> i take it that you come from python \:p
00:16:38FromDiscord<that_dude> Yeah lol
00:17:03FromDiscord<that_dude> Tbh I assumed most do
00:17:42FromDiscord<Rika> I came from Python and I knew this
00:18:21FromDiscord<leorize> you just have to remember that no matter how much nim resembles python, it's a very different language
00:18:55FromDiscord<Rika> It’s something to be thankful of coming from Python lol
00:19:49FromDiscord<leorize> oh and there's no such thing as global namespace in nim, everything is module-scoped
00:20:28FromDiscord<leorize> that's a knowledge that will help you avoid the from-import trap that newcomers from python frequently fall into
00:34:39FromDiscord<theangryepicbanana> lmao people voted for nim's editor support in the community survey
00:35:04FromDiscord<theangryepicbanana> why tho
00:35:29FromDiscord<Elegantbeef> What do you mean?
00:35:49FromDiscord<theangryepicbanana> nim has very poor editor support compared to similar languages
00:35:58FromDiscord<theangryepicbanana> and uh in general
00:36:01FromDiscord<Elegantbeef> And they want it better
00:36:28FromDiscord<theangryepicbanana> well yeah but this was under the "what do you like about nim?" section
00:36:29FromDiscord<Rika> That’s not what they mean
00:39:29FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Md1
00:39:42FromDiscord<huantian> cast it to an array of Window, not ptr Window
00:39:46FromDiscord<huantian> sigh
00:39:59FromDiscord<Elegantbeef> The fuck it says `Window`
00:42:00FromDiscord<Rika> No I get it
00:42:04FromDiscord<Rika> It’s a pointer to an array
00:42:05FromDiscord<Rika> Var array
00:42:21FromDiscord<Elegantbeef> It's a pointer to an array of pointers to windows
00:42:34FromDiscord<Rika> That would be a triple pointer
00:43:09FromDiscord<Elegantbeef> `WIndow` is a pointer to a window
00:43:19FromDiscord<Rika> Or an array
00:43:19FromDiscord<Elegantbeef> `Window` is a pointer to an array of pointer windows
00:43:39FromDiscord<Elegantbeef> This is why pointer collections should be statically typed
00:43:49FromDiscord<Rika> Beef I think this is where your lack of c knowledge doesn’t help
00:44:11FromDiscord<Elegantbeef> I mean it's ambiguous
00:44:24FromDiscord<Rika> Yes but your meaning is not one of the choices
00:44:34FromDiscord<Rika> It’s either a pointer to an array or an array of pointers
00:44:50FromDiscord<Elegantbeef> And my meaning is the array of pointers
00:45:12FromDiscord<leorize> it could also be pointer to pointer \:p
00:45:17FromDiscord<Rika> Okay I see what you mean now
00:45:25FromDiscord<Rika> In reply to @leorize "it could also be": I guess?
00:45:39FromDiscord<Rika> I don’t think it makes much sense though considering it’s named children
00:45:45FromDiscord<Elegantbeef> It's ambiguous and the reason we cannot have nice things
00:45:47FromDiscord<Rika> Nor does a double array but yes it can
00:47:16FromDiscord<leorize> https://linux.die.net/man/3/xquerytree
00:47:28FromDiscord<Rika> Now I question the meaning and pronunciation of array damn it
00:47:29FromDiscord<leorize> according to the docs it's pointer to array
00:48:38FromDiscord<Elegantbeef> "a ray"
00:59:49FromDiscord<Rika> I mean to me the pronunciation (and context of course) changes the meaning
01:01:40FromDiscord<huantian> oh yeah funnily enough beef you had this convo with someone else previously
01:01:52FromDiscord<Elegantbeef> Probably
01:06:16FromDiscord<Bung> @ElegantBeef hi , after you refactor nimscripter , i dont know how to use it now
01:06:41FromDiscord<Elegantbeef> It's much simpler now
01:06:55FromDiscord<Elegantbeef> What's your issue?
01:07:50FromDiscord<Bung> when call intr.invoke(myMethod) where is myMethod it show compiler cant find it
01:08:09FromDiscord<Elegantbeef> Put an export marker on `myMethod`
01:10:18*kayabaNerve quit (Ping timeout: 250 seconds)
01:11:09FromDiscord<Bung> am confusing your first example on readme contains exporto and loadScript
01:11:36FromDiscord<Bung> dont know which part put into script which put into my main program
01:12:01FromDiscord<Elegantbeef> I mean the first example doesnt require a script
01:12:12FromDiscord<Elegantbeef> `assert doThing() == 42` is the script
01:12:43FromDiscord<Elegantbeef> `exportTo` is how you add stuff to share with the nimscript
01:13:18FromDiscord<Bung> I only need call script from my main program what should I do ?
01:13:47FromDiscord<Elegantbeef> You dont want to call anything in your program?
01:13:51FromDiscord<Elegantbeef> If not you just use loadScript
01:14:23FromDiscord<Elegantbeef> Then in your script you mark your procedures with `` so you can call them from the nim code
01:14:43FromDiscord<Elegantbeef> There is an example btw
01:14:53FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/examples/macrorepl/macrorepl.nim is the main Nim program
01:14:58FromDiscord<Bung> I do it like https://github.com/beef331/nimscripter#calling-code-from-nim but fancyStuff whill be `Error: undeclared identifier`
01:15:20FromDiscord<Elegantbeef> It's certainly not
01:15:47FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/tests/texamples.nim i do test the examples
01:16:46FromDiscord<Elegantbeef> `fancyStuff` is exported from the script so it's accessible from the compiled Nim code
01:17:43FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=3Md6
01:18:02FromDiscord<Elegantbeef> What is your themeFIle?
01:18:47FromDiscord<Bung> it just contains karax render proc like `proc renderLayout(conf: Config; n: VNode = nil): VNode =`
01:19:18FromDiscord<Elegantbeef> Any chance you can share the example?
01:20:37FromDiscord<Bung> https://github.com/bung87/crown_ui/tree/nimscripter you can run `nim c -r src/crown_ui.nim build --cwd ./example/` to check
01:30:16FromDiscord<Elegantbeef> Ah you're passing multiple parameters which might be the issue
01:30:25*LyndsySimon_ joined #nim
01:30:31FromDiscord<Elegantbeef> You may need to do `[a, b, c]` returnTyp = void\`
01:32:10*redj_ joined #nim
01:33:44FromDiscord<Bung> it cant return value now ?
01:33:53*greaser|q joined #nim
01:34:02*cyraxjoe joined #nim
01:34:41FromDiscord<Elegantbeef> Content has `proc`s as fields
01:34:44FromDiscord<Elegantbeef> Those are not serializable
01:35:26FromDiscord<Elegantbeef> You need to convert it to a type that can go across the bridge or again not use nimscripter 😀
01:36:05*zgasma[m]1 joined #nim
01:36:29FromDiscord<Elegantbeef> I mean i suppose i could just Nil procs
01:36:31FromDiscord<Bung> oh , I may choose convert it , as I use dll approach but it cant pass variable.
01:37:21FromDiscord<Bung> I can write macro turn result into string
01:39:01FromDiscord<Bung> could this be improved that support multiple parameters ? it"s boring combine params to single type
01:39:04*LyndsySimon quit (Ping timeout: 240 seconds)
01:39:05*LyndsySimon_ is now known as LyndsySimon
01:39:05*redj quit (Ping timeout: 240 seconds)
01:39:06*zgasma[m] quit (Ping timeout: 240 seconds)
01:39:07*MightyJoe quit (Ping timeout: 240 seconds)
01:39:07*xet7 quit (Ping timeout: 240 seconds)
01:39:07*GreaseMonkey quit (Ping timeout: 240 seconds)
01:40:06FromDiscord<Alea> is there some seq like type with arbitrary indexes?
01:41:42FromDiscord<Elegantbeef> You can just do `libTheme.invoke(renderPost, conf, data, contentNode, returnType = void)`
01:41:42FromDiscord<Elegantbeef> Right now the issue is `ref seq[string]`
01:41:43FromDiscord<Elegantbeef> I dont handle ref semantics apparently
01:41:43FromDiscord<Elegantbeef> Which i guess i'll look at tomorrow
01:41:44FromDiscord<Elegantbeef> Sorry
01:46:52*xet7 joined #nim
01:46:57FromDiscord<Bung> but I need return value
01:47:23FromDiscord<Elegantbeef> I mean you can use return type
01:47:30FromDiscord<Elegantbeef> You just have to explicitly annotate it
01:47:56FromDiscord<Bung> returnType = VNode , like this ?
01:48:21FromDiscord<Elegantbeef> Yea but we presently cannot convert `Vnode`
01:48:39FromDiscord<Elegantbeef> It has `proc` fields and also `ref seq[string]`
01:50:03FromDiscord<Bung> ah move one forward step I get `Error: type mismatch` , I'll use macro turn proc result to string then thing's get simpler
01:50:13FromDiscord<Elegantbeef> the procs can just be converted to `nil` but the `ref T` needs to handled
01:51:22FromDiscord<Bung> the conf fields also contains json so this also be a problem ?
01:51:38FromDiscord<Elegantbeef> Nah i can parse json
01:51:42FromDiscord<Elegantbeef> Well convert json
01:51:58FromDiscord<Elegantbeef> I just forgot about `ref T` existing and `proc` being in fields
01:53:04FromDiscord<Bung> okay, I get it, thanks, Think I can complete my project through nimscripter approach
02:17:27adigitoleoCan I do type unions in the return typedesc of a proc? Couldn't find the syntax
02:19:48adigitoleolooking for something like foo(): seq[a|b]
02:20:58FromDiscord<Elegantbeef> Are you looking for a return type that is heterogenous?
02:21:11adigitoleoyep but could be seq[a] or seq[b]
02:21:26FromDiscord<Elegantbeef> Ok so no hetregenous
02:21:49FromDiscord<Elegantbeef> you can do `seq[a] or seq[b]`
02:22:09FromDiscord<Elegantbeef> If you want unions https://github.com/alaviss/union
02:23:18adigitoleothanks
02:25:44*neurocyte0917099 joined #nim
02:27:37*neurocyte091709 quit (Ping timeout: 240 seconds)
02:27:37*neurocyte0917099 is now known as neurocyte091709
02:45:55*greaser|q quit (Changing host)
02:45:55*greaser|q joined #nim
02:46:58*greaser|q is now known as GreaseMonkey
02:47:20FromDiscord<Elegantbeef> @IsaacPaul\: didnt you make something like this already? https://forum.nim-lang.org/t/8806
02:47:41FromDiscord<Elegantbeef> If so ping geekrelief and send them it 😛
02:55:32FromDiscord<geekrelief> @ElegantBeef does @IsaacPaul have something online?
02:56:04FromDiscord<Elegantbeef> I think he does but i dont remember his github name so aside from stalking all of his messages i cant get it 😛
02:57:07FromDiscord<geekrelief> I'm scrolling through them 🙂
02:57:09FromDiscord<IsaacPaul> Izackp
02:57:18FromDiscord<IsaacPaul> Is the git hub
02:57:22FromDiscord<IsaacPaul> Imma send it in a sec
02:58:13FromDiscord<IsaacPaul> https://github.com/izackp/questionable
02:58:28FromDiscord<geekrelief> cool! thx
02:59:45FromDiscord<geekrelief> In reply to @IsaacPaul "https://github.com/izackp/questionable": Do you think your library can solve my issue with this? https://play.nim-lang.org/#ix=3Md8
03:01:50FromDiscord<geekrelief> My issue with chaining is that it doesn't work if I have a call with args. With no args it works.
03:02:40FromDiscord<IsaacPaul> I’d like to help but I’m indisposed atm
03:02:47FromDiscord<IsaacPaul> Check out the readme
03:02:59FromDiscord<geekrelief> no worries. yeah I looked at the readme. I'm looking through the code now
03:03:11FromDiscord<IsaacPaul> In reply to @geekrelief "Do you think your": Also not really my library. Someone else’s + modifications
03:03:23FromDiscord<geekrelief> oh haha I see
03:28:23*Lord_Nightmare quit (Ping timeout: 256 seconds)
03:39:21*redj_ is now known as redj
03:40:03*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:41:06*redj joined #nim
04:03:07NimEventerNew post on r/nim by distractedbytheworld: Using javascript arguments in a Nim function, see https://reddit.com/r/nim/comments/s4bb5g/using_javascript_arguments_in_a_nim_function/
04:49:11*arkurious quit (Quit: Leaving)
05:18:22adigitoleoplayground is *ahem* playing up for me, but I'm confused why this doesn't work https://x0.at/znQC.txt
05:22:19FromDiscord<Rika> table.mitems
05:22:34FromDiscord<Rika> Iterator values are immutable by default
05:22:56adigitoleoAh
05:45:31NimEventerNew thread by Cantanima: Suppressing non-exported fields in nim doc, see https://forum.nim-lang.org/t/8809
06:49:50*Gustavo6046 joined #nim
06:49:56adigitoleodoes unittest run tests in async? I'm getting barf in my logging that I can't seem to repro in a simple example
06:50:03adigitoleorunning with nimble test
06:52:44nrds<Prestige99> barf?
06:52:46FromDiscord<Elegantbeef> I dont think so
06:52:59FromDiscord<Elegantbeef> I could be wrong, but there is no mention of it and `suite` is just a template
06:53:23adigitoleothere's some {.threadvar.} in unittest source, I'm not savvy enough to now completely what it's about tho
06:53:46adigitoleomaybe I need to mark my logger with that also?
06:55:49adigitoleonrds: I mean like repeated log entries
06:59:35adigitoleoMaybe relevant https://nim-lang.org/docs/logging.html#basic-usage-notes-when-using-multiple-threads
06:59:50adigitoleoNot sure how I'd set the handler in each thread...
07:10:56adigitoleoHmm nevermind must be something else, can't see any thread creation in unittest source
08:47:15*jjido joined #nim
09:08:39FromDiscord<retkid> my latest nim problem is the compiler is either underflowing or overflowing
09:08:46FromDiscord<retkid> whats the general cause of this
09:10:02FromDiscord<mratsim> are you doing compile-time computation?
09:10:17FromDiscord<retkid> no consts
09:10:31FromDiscord<retkid> in the entire project
09:13:07FromDiscord<Elegantbeef> That doesnt answer the question
09:13:33FromDiscord<Rika> Macros count as compile time
09:13:44FromDiscord<Elegantbeef> So does `static:`
09:15:18FromDiscord<Rika> A lot of things too
09:15:43FromDiscord<Rika> So what exactly is the error?
09:15:47FromDiscord<retkid> no macros, templates, statics
09:15:50FromDiscord<retkid> (edit) "statics" => "statics, etc"
09:16:06FromDiscord<retkid> it just raises overflow and sysfatals
09:16:13FromDiscord<Rika> That’s not a compiler error
09:16:15FromDiscord<Rika> That’s a runtime error
09:16:24FromDiscord<retkid> during compile time
09:16:24FromDiscord<Rika> The whole error please
09:18:52FromDiscord<Elegantbeef> There is a non 0 chance they have code that causes a compiler crash, but I'm cautious of that assertion
09:19:21FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/931839964541485056/unknown.png
09:19:23FromDiscord<Rika> We can’t tell of course until error and source
09:19:40FromDiscord<retkid> literally
09:19:42FromDiscord<retkid> thats it
09:19:58FromDiscord<retkid> as you can tell its very imformative
09:19:58FromDiscord<Rika> Okay now that we know it is the compiler what’s the source
09:20:02FromDiscord<Elegantbeef> That's a compiler error
09:20:04FromDiscord<retkid> (edit) "imformative" => "informative"
09:20:11FromDiscord<Elegantbeef> Give me code please
09:20:29FromDiscord<retkid> In reply to @Rika "Okay now that we": yea I have no clue where it is, 53 of the main doesn't contain any math so its kinda like wat
09:20:37FromDiscord<Rika> I mean the source code lol
09:20:43FromDiscord<Elegantbeef> Alternatively build/run with a debug compiler
09:21:10FromDiscord<Rika> In reply to @Elegantbeef "Alternatively build/run with a": Note that things are somewhat slow this way so if the thing is slow building theeeen
09:21:59FromDiscord<retkid> i might just start hacking things out because inim doesn't work
09:22:31FromDiscord<Rika> Well we could help better if we could see the code, of course though it is your choice
09:22:32FromDiscord<Elegantbeef> like i said if you want to see the issue compile with a debug compiler and you'll get a useful stacktrace to see where the overflow happens
09:22:43FromDiscord<Elegantbeef> It wont help you much as you arent a compiler dev but it'll say where
09:23:04FromDiscord<Rika> If you want beef here will guide you with the process of that xddd
09:23:16FromDiscord<enthus1ast> why is a debug compiler needed for this?
09:23:43FromDiscord<Elegantbeef> Cause the compiler strips out stacktrace for performance reasons in release
09:23:45*Gustavo6046 quit (Quit: Leaving)
09:23:54FromDiscord<enthus1ast> knowing where the error is could interest any one imho
09:24:03FromDiscord<Elegantbeef> Sure but it's also costly for all operations
09:24:14FromDiscord<Elegantbeef> Storing stack traces slows compilation down
09:24:19FromDiscord<Rika> I’m assuming a massive performance loss with it in
09:24:21FromDiscord<Rika> On
09:24:23FromDiscord<Elegantbeef> Nim now ships with a debug compiller iirc but i could be wrong
09:24:37FromDiscord<enthus1ast> could it be stripped out on a release build?
09:24:37FromDiscord<Elegantbeef> Indeed
09:24:44FromDiscord<retkid> something to do with another function i wrote but that function compiles file
09:24:49FromDiscord<retkid> so its kindaaaaaaa stupid
09:24:55FromDiscord<Elegantbeef> I mean it's a compiiler error
09:25:05FromDiscord<Elegantbeef> I'd happily look into it if you provide a reproduction
09:25:35FromDiscord<retkid> oh hell no this code isn't code I'd show my therapist
09:25:51FromDiscord<Rika> We’re not your therapist so it’s fine
09:25:56FromDiscord<Elegantbeef> Well then i can only say stupid in stupid out
09:26:14FromDiscord<Rika> Garbage in garbage out you mean?
09:26:15FromDiscord<retkid> its not stupid, just ugly
09:26:17FromDiscord<Elegantbeef> The debug compiler option will also give helpful information though
09:26:32FromDiscord<retkid> how would one do that
09:26:51FromDiscord<Elegantbeef> Clone https://github.com/nim-lang/Nim
09:27:06FromDiscord<Elegantbeef> do `./build_all.sh` or `./build_all.bat`
09:27:17FromDiscord<retkid> how long will building nim from source take...
09:27:21FromDiscord<retkid> wel
09:27:22FromDiscord<Elegantbeef> then do `./koch temp c ./path/to/your/nimFile.nim`
09:27:24FromDiscord<retkid> thats not a good question
09:27:28FromDiscord<Elegantbeef> Takes about 2 minutes from fresh on my machine
09:27:48FromDiscord<enthus1ast> choosenim should have an option to also build/download a nim debug compiler and put it next to the release one, maybe called nimdbg
09:27:50FromDiscord<retkid> alright I'll ``time`` it and see how much faster your machne is
09:28:01FromDiscord<Elegantbeef> I have a xeon1231v3
09:28:07FromDiscord<Elegantbeef> Not an amazing cpu but not a shitty one either
09:28:13FromDiscord<retkid> it-4790S
09:28:17FromDiscord<retkid> (edit) "it-4790S" => "I5-4790S"
09:28:24FromDiscord<Elegantbeef> I mean i think araq wants to ship a debug compiler with the standard one
09:28:28FromDiscord<Elegantbeef> So skips the debug path
09:28:32FromDiscord<Elegantbeef> Yea about the same IPC
09:28:37FromDiscord<Elegantbeef> So going to take about the same time
09:28:55FromDiscord<Elegantbeef> Both haswell cpus
09:29:38FromDiscord<Elegantbeef> But yes enthus having easy access to a debug compiler makes bugs like this easier to resolve/provide min repros
09:30:14FromDiscord<Elegantbeef> Might be a bit biased given my compiler contributions 😀
09:30:32FromDiscord<Elegantbeef> I feel having the source is just better than a debug binary
09:30:47FromDiscord<Elegantbeef> Like sure the debug binary gives a line number, but having the source means you can atleast try to fix it
09:30:53FromDiscord<Elegantbeef> But i also dont mind wasting time
09:31:14FromDiscord<enthus1ast> yeah i mean, its always annoying when eg an assert breaks your code, but you don't know why and where
09:31:36FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/931843047564668928/unknown.png
09:31:39FromDiscord<Elegantbeef> Yea i have compiler cloned so it's more like a puzzle to me than a nuisance 😛
09:31:40FromDiscord<retkid> optimization is to be had
09:31:48FromDiscord<enthus1ast> then it feels stupid because i have the feeling that the compiler COULD tell me where it breaks but does not
09:32:03FromDiscord<Elegantbeef> It's "Aw hell yea, i get to bug hunt and possibly have another PR"
09:32:38FromDiscord<retkid> In reply to @enthus1ast "yeah i mean, its": seems like a solvable problem
09:32:55FromDiscord<Elegantbeef> I mean it is with stack traces, they're heavy though
09:32:58FromDiscord<enthus1ast> sure maybe the debug compiler can do this already
09:33:11FromDiscord<retkid> what if you just print the line and the file as it goes along
09:33:15FromDiscord<Elegantbeef> Even timothee's optimized stack traces were considered too heavy iirc
09:33:15FromDiscord<retkid> so you can see where it stops
09:33:21FromDiscord<Elegantbeef> I mean that's' a stack trace
09:33:26FromDiscord<enthus1ast> i mean, you would just use the debug compiler when you want to debug
09:33:33FromDiscord<Elegantbeef> Exactly
09:33:44FromDiscord<retkid> it took me 4.4 minutes
09:34:00FromDiscord<Elegantbeef> is that a mobile Cpu?
09:34:14FromDiscord<retkid> no lol
09:34:25FromDiscord<Elegantbeef> I couldnt remember what the S stood for
09:34:37FromDiscord<retkid> i had no money this was the cheapest ok-cpu i could find
09:34:41FromDiscord<retkid> I dont know either
09:34:48FromDiscord<Elegantbeef> Yea that's why i have a xeon1231v3
09:35:04FromDiscord<Elegantbeef> I couldnt afford a K series so went with the xeon
09:35:08FromDiscord<enthus1ast> but 4.4 minutes is not bad, i remember the times when arch did not ship with mingw, o my gawd
09:35:23FromDiscord<enthus1ast> 30 - 60 minutes building mingw
09:35:25FromDiscord<retkid> well i had ordered the MB before because i thought my old cpu worked
09:35:43FromDiscord<retkid> I've had data take 8 hours to fully compile and save to a json\
09:35:46FromDiscord<Elegantbeef> Rust from source laughs
09:35:51FromDiscord<Elegantbeef> Anyway
09:35:56FromDiscord<Elegantbeef> Test the code now
09:36:20FromDiscord<retkid> its goin
09:36:21FromDiscord<retkid> slowly
09:36:33FromDiscord<Elegantbeef> Yea debug is slow 😛
09:36:50FromDiscord<Elegantbeef> I tend to run one build find the path/ast that causes the error then minimize it
09:37:02FromDiscord<retkid> its also compiling literally every fil
09:37:37FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/931844562857644053/unknown.png
09:37:41FromDiscord<enthus1ast> wait\: `./koch temp c ./path/to/your/nimFile.nim` is building the debug compiler then compiles the file with the debug compiler?
09:37:53FromDiscord<Elegantbeef> Yes
09:37:53FromDiscord<retkid> In reply to @retkid "": anticlimactic
09:38:22FromDiscord<enthus1ast> maybe you've cloned the #head
09:38:34FromDiscord<enthus1ast> not the version your where useing all the time
09:38:46FromDiscord<enthus1ast> cloned and build i mean
09:38:49FromDiscord<Elegantbeef> Not using 1.6.2... that's a paddling 😀
09:39:13FromDiscord<Elegantbeef> I joke cause i'm presently on devel to play with new features!
09:39:26FromDiscord<Rika> Isnt 1.6.2 the version where a billion regressions reared their heads
09:39:48FromDiscord<Elegantbeef> Perhaps dont recall, I havent had any issues yet
09:39:55FromDiscord<Elegantbeef> Thought it was 1.6.0 that had regressions
09:40:05FromDiscord<Elegantbeef> Surprisingly none have been attributed to my code
09:40:41FromDiscord<Rika> That could mean no one uses what you added
09:40:43FromDiscord<Rika> xd
09:40:47FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/931845359423082526/unknown.png
09:41:07FromDiscord<Elegantbeef> there we go
09:41:11FromDiscord<retkid> this is more insightful?
09:41:21FromDiscord<Rika> Yes
09:41:45FromDiscord<retkid> im not seein it
09:42:13FromDiscord<Rika> I intuit that it’s a syntax issue
09:42:26FromDiscord<Rika> Of course I have no idea because I can’t read the source code
09:42:27FromDiscord<Elegantbeef> We know it's a lexer issue
09:42:42FromDiscord<Elegantbeef> I've not touch the lexer so i dont know how to debug it
09:42:43FromDiscord<retkid> my code is so unreadable that the lexer has given up upon me
09:42:46FromDiscord<Rika> (I don’t have the source handy right now and I’m on mobile lol)
09:42:59FromDiscord<Rika> What does the line where it crashes look like at least
09:43:01FromDiscord<Elegantbeef> Eh the line that's the issue is an `inc` call
09:43:13FromDiscord<retkid> In reply to @Rika "What does the line": wait where does it say that
09:43:20FromDiscord<Rika> It’s a question
09:43:31FromDiscord<retkid> i dont know where it says the line to look at it
09:43:42FromDiscord<Rika> “What does <the line [of your code] where it crashes> look like, at least?”
09:43:54FromDiscord<Rika> Ah was it not there I don’t remember
09:43:56FromDiscord<retkid> ah
09:43:58FromDiscord<retkid> 78,9
09:44:14FromDiscord<Elegantbeef> That line is the last known good line
09:44:27FromDiscord<retkid> ah
09:44:31FromDiscord<retkid> so we dont know the line
09:44:32NimEventerNew thread by Argl: Namespaces for non-enums without customizing the import statement?, see https://forum.nim-lang.org/t/8810
09:45:07FromDiscord<Elegantbeef> Well i know it's a string literal
09:45:16FromDiscord<Elegantbeef> So what string lits do you have after line `78`
09:45:42FromDiscord<Rika> Oh I’m betting it’s an invalid escape code
09:46:11FromDiscord<Elegantbeef> To answer "how do you know it's a strlit"
09:46:33FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3MeL
09:46:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MeM
09:47:03FromDiscord<Rika> That’s strange
09:47:33FromDiscord<retkid> something weird with these strings?
09:47:37FromDiscord<Rika> No
09:47:38FromDiscord<retkid> its not in tohex
09:47:41FromDiscord<Rika> That’s the strange thing
09:47:44FromDiscord<Rika> Nothing looks weird
09:48:11FromDiscord<retkid> theres no other string literals in this funtion
09:48:14FromDiscord<Elegantbeef> If you want to know what causes the error you can go to parser.nim line 731 and put `echo p.tok.literal`
09:48:16FromDiscord<retkid> (edit) "funtion" => "function"
09:48:23FromDiscord<Elegantbeef> It doesnt have to be in that function
09:48:27FromDiscord<Rika> Wouldn’t that mean a recompile of the compiler hahaha
09:48:32FromDiscord<Elegantbeef> It's anywhere after that module and line is processed
09:48:36FromDiscord<Elegantbeef> Recompilation is quick
09:48:37FromDiscord<Rika> Another 4 minutes of waiting for you
09:48:40FromDiscord<Elegantbeef> Nah
09:48:45FromDiscord<Rika> Ah true I forgot c cache
09:48:48FromDiscord<retkid> if not then
09:48:49FromDiscord<Elegantbeef> It's like 30s on hotpath heavy code
09:48:57FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3MeN
09:49:00FromDiscord<retkid> (edit)
09:49:02FromDiscord<retkid> these are also literals
09:49:05FromDiscord<retkid> but its not in quit
09:49:22FromDiscord<Rika> Seems fine too
09:49:23FromDiscord<Elegantbeef> Like i said the easiest thing is to put an echo statement inside that line in parser.nim then rerun the koch command
09:49:32FromDiscord<retkid> ah yea
09:49:55FromDiscord<Elegantbeef> It'll barf to your stdout but the last line before the stack trace will be what you need to know
09:50:52FromDiscord<Elegantbeef> All i can say is i think it's attempting to get a token from a strlit, but I dont know the lexer/parser well
09:51:14FromDiscord<Elegantbeef> Actually it might be a symbol after the strlit
09:51:45FromDiscord<Rika> In reply to @NimEventer "New thread by Argl:": Beef do you think this is possible? I’ve been thinking about it for a while and I’ve concluded it isn’t easy with a macro, and that the original syntax is wholly impossible
09:51:55FromDiscord<Rika> Given the wanted features
09:52:40FromDiscord<retkid> haha
09:52:46FromDiscord<retkid> as it compiles its barfing it out
09:53:16FromDiscord<retkid> so strange how compilers are like dogs chasing their own tails
09:54:39FromDiscord<Elegantbeef> There you go rika
09:54:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MeO
09:54:51FromDiscord<Rika> With the features, that is easy
09:54:53FromDiscord<Elegantbeef> \export `.` of course\`
09:55:00FromDiscord<Rika> He also wants aliasing and explicit optional
09:56:25FromDiscord<Elegantbeef> Nim allows importing symbols with a different prefix
09:56:44FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3MeP
09:56:51FromDiscord<retkid> now i dont know if i messed with something causing a differentt issue
09:57:09FromDiscord<Elegantbeef> `import x as y` is valid so i dont know
09:57:26FromDiscord<Elegantbeef> `Error: cannot open '../../dev/youtube-filehosting/controller.nimc'`
09:57:35FromDiscord<retkid> ha
09:57:46FromDiscord<retkid> my ctrl key is broke
09:57:48FromDiscord<retkid> it happens
09:57:55FromDiscord<retkid> alright
09:57:57FromDiscord<retkid> here we are
09:58:08FromDiscord<Elegantbeef> I dont know what the person wants is not Nim code
09:58:11FromDiscord<Elegantbeef> They want C++ code in Nim
09:58:35FromDiscord<Rika> In reply to @Elegantbeef "Nim allows importing symbols": Well yeah but I think he wants not-file-bound namespaces like in C++
09:58:47FromDiscord<retkid> the last string sent into the lexxxer will surprise you
09:58:47FromDiscord<Rika> I know yeah
09:58:48FromDiscord<Elegantbeef> I mean it's technically possible with the macrocache
09:58:50FromDiscord<Rika> It’s just not possible
09:58:55FromDiscord<Rika> Well
09:58:58FromDiscord<Rika> I guess?
09:59:01FromDiscord<Rika> But that’s a lot of work lmfao
09:59:02FromDiscord<retkid> thats it
09:59:06FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3MeR
09:59:09FromDiscord<Elegantbeef> Idneed
09:59:15FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3MeR" => "https://play.nim-lang.org/#ix=3MeS"
09:59:17FromDiscord<Elegantbeef> You no longer use the normal nim import system
09:59:19FromDiscord<retkid> (edit)
09:59:23FromDiscord<retkid> (edit)
09:59:36FromDiscord<retkid> the last character is non printable
09:59:36FromDiscord<Rika> I keep on forgetting the almighty macro cache exists nowadays
09:59:38FromDiscord<Rika> Hahaha
09:59:45FromDiscord<retkid> or \n or something idk
10:00:07FromDiscord<Elegantbeef> well you can do `.toHex` but i think that's the problem
10:01:02FromDiscord<Elegantbeef> Seems like rika was right
10:01:11FromDiscord<retkid> what was Rika's guess
10:01:13FromDiscord<Elegantbeef> that's a first
10:01:13FromDiscord<retkid> an escape?
10:01:20FromDiscord<Elegantbeef> A character causing the issue
10:01:44FromDiscord<retkid> how now i wish i did expr
10:02:57FromDiscord<Elegantbeef> Anyway there you go you're on the path to becoming a compiler dev now
10:05:44FromDiscord<retkid> now heres the question bef
10:05:48FromDiscord<retkid> everything you know about me
10:05:56FromDiscord<retkid> would you trust me to make a good well thought out PR
10:06:05FromDiscord<retkid> i would not
10:06:18FromDiscord<Elegantbeef> Luckily there are multiple other people working on this project
10:09:01FromDiscord<Elegantbeef> Though it's still odd a str lit causes this, but seems it increments to eternity
10:11:31FromDiscord<Isofruit> In terms of stability, how stable are concepts? LIke, still a lot of kinks to figure out, just some edgecases, basically ready for the next nim version?
10:12:02FromDiscord<Elegantbeef> I mean i use them a lot i know there are issues with them but they're very usable
10:14:10*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:14:59FromDiscord<Elegantbeef> The main issue i think is that Araq doesnt like how cryptic they used to appear
10:15:31FromDiscord<Elegantbeef> The new concepts are nicer but are also more limited
10:15:56FromDiscord<Elegantbeef> I personally go for concepts whenever i touch anything that's not truely generic and not constrainable on types
10:17:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mf3
10:18:41FromDiscord<Elegantbeef> Isofruit asked a question and got nothing but noise
10:42:20FromDiscord<retkid> so
10:42:27FromDiscord<retkid> i figured out what it was i think
10:42:40FromDiscord<retkid> this is the stupidest error I've ever found
10:42:58FromDiscord<retkid> so the last line looked blank
10:43:03FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=
10:43:10FromDiscord<retkid> (edit)
10:43:19FromDiscord<retkid> however it was over 10 thousand spaces
10:43:35FromDiscord<retkid> i somehow just held the spacebar while dazing off at 4 am
10:44:47FromDiscord<retkid> @Rika idk if you were right or not
10:49:14FromDiscord<enthus1ast> Haha↵(@retkid)
10:49:49FromDiscord<enthus1ast> Can recommend the vscode plugin that removes trailing whitespaces on save
10:50:28FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/931862893786460230/unknown.png
10:50:33FromDiscord<retkid> this shall never happen again
10:51:00FromDiscord<enthus1ast> Ah its build in now\: https://stackoverflow.com/questions/30884131/remove-trailing-spaces-automatically-or-with-a-shortcut
10:51:42*Guest44 joined #nim
10:51:56*Guest44 quit (Client Quit)
10:52:27FromDiscord<Rika> Holy shit lmfao
10:52:57FromDiscord<retkid> In reply to @enthus1ast "Ah its build in": i still use bracket colorizor
10:53:09FromDiscord<retkid> cant stop me
10:56:20FromDiscord<Isofruit> In reply to @Elegantbeef "*Isofruit asked a question": I'm curious how they'll end up looking when finalized
10:56:58FromDiscord<Isofruit> On an unrelated note, man I have no idea which code Django is wrapping when encrypting their stuff but it appears to be a pretty well optimized library
11:06:29FromDiscord<Isofruit> O.O↵I take that back, for some reason I expected nimcrypto while compiled in debugmode to beat the performance of django which likely wraps a compiled C library somewhere. Things look a bit different when I stop handicapping nimcrypto and build with -d:release
11:08:30FromDiscord<Isofruit> Crazily enough, the whole thing is still somewhat faster in Django (170ms - 200ms in Django vs. 260ms-290ms in Nim with nimcrypto) but not by enough that I'm too worried
11:13:28*dv2 joined #nim
11:22:30FromDiscord<Rika> Crypto libraries are pretty mature and well optimised
11:28:24FromDiscord<hotdog> In reply to @Isofruit "Crazily enough, the whole": Interesting
11:28:29FromDiscord<hotdog> How are you testing this?
11:30:52*jjido joined #nim
11:32:30FromDiscord<Isofruit> sent a long message, see https://paste.rs/WfO
11:33:17FromDiscord<Isofruit> That's not going to tell me what my timing on my HTTP Server (since that's a potato and my laptop, while old and crappy, is still faster than that) will be in the end, but it gives me an indicator on how fast they are in relation to each other.
11:33:29FromDiscord<Isofruit> (edit) "an" => "a rough"
11:34:43FromDiscord<Isofruit> (edit) "HTTP Server" => "actual server"
11:37:29FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mfi
11:38:15FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3Mfi" => "https://paste.rs/bmt"
11:38:40FromDiscord<Isofruit> So all I can assume that whatever library Django is wrapping is pretty darn good
11:38:49FromDiscord<Isofruit> (edit) "So all I can assume ... that" added "is"
11:39:42FromDiscord<Isofruit> (edit) "good" => "good. Since by all means, it's handicapped by everything else this language does, the encryption bit is, I imagine, the only fast part of that API endpoint."
11:43:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:47:37*neurocyte091709 quit (Ping timeout: 256 seconds)
11:50:26*neurocyte091709 joined #nim
12:00:15FromDiscord<hotdog> @Isofruit cool, I think you are right. I’m interested to see how you get on as I’ve also used Django for backends a lot
12:02:59FromDiscord<Isofruit> The tooling obviously isn't as fleshed out as in Django, but some of the stuff is a dream. I assume you've used Django-REST-Framework at one point? Literally trivial if you also use jsony, you can skip the entire step of setting up serializers, you just directly serialize/deserialize into object types.
12:03:45FromDiscord<Isofruit> And setting up the models if you use norm + elegantBeef's constructor project is pretty close to Django's model-convenience
12:03:59FromDiscord<hotdog> In reply to @Isofruit "The tooling obviously isn't": Yeah I use Django pretty much exclusively as just a combo of Django-orm + DRF + Django-admin
12:05:32FromDiscord<Isofruit> In reply to @hotdog "Yeah I use Django": Once my PR on norm gets through and its next version comes out, norm will also have some helper procs to fetch many-to-one relationships from the model that doesn't have the foreign-key field, as well as many-to-many relationships. Every many to many fetch is still one query though, but at least it tells you at compile time if you're doing sth wrong
12:05:42FromDiscord<Isofruit> (edit) "doing sth" => "using these helper procs"
12:06:35FromDiscord<Isofruit> (edit) "though," => "though (so if you want to fetch many-to-many of 2 different entries, that's 2 db queries),"
12:07:18FromDiscord<Isofruit> But Django admin will be a tough one to say goodbye to, tough enough I might feel tempted to see if I'm competent enough to write a PR for it
12:07:25FromDiscord<Isofruit> Or see if there's a plugin somewhere or sth
12:08:21FromDiscord<Isofruit> More likely the latter rather than the former because django admin recreation is likely craptons of work
12:08:58*neurocyte091709 quit (Ping timeout: 250 seconds)
12:11:01*neurocyte091709 joined #nim
12:12:33FromDiscord<hotdog> In reply to @Isofruit "Once my PR on": I’ve been following your PR on GitHub 😊 it’s good to see Norm coming along
12:12:45FromDiscord<hotdog> I haven’t had time to play with it yet but hopefully soon
12:13:13FromDiscord<hotdog> In reply to @Isofruit "More likely the latter": Yeah this is a tricky one. One of the main things keeping me stuck on Django
12:26:29FromDiscord<Rika> Isn’t hashing one of those things easily vectorisable, I forgot
12:27:56FromDiscord<Isofruit> I'll plead the fifth on that one, I was barely competent enough to comprehend how to use nimcrypto to recreate django's encryption, my knowledge does not go that deeply
12:29:05FromDiscord<Rika> We’re entering “advanced optimisation” levels, I wouldn’t expect most people to know, even I do not know well
12:29:40FromDiscord<Isofruit> Good to know that this is at least actually hard for most people 😄
12:32:50FromDiscord<Rika> It’s the kinda thing you usually need to read a book or take a proper class on I’m led to believe
12:48:31FromDiscord<ajusa> In reply to @Isofruit "Once my PR on": I'm looking forward to this PR
12:53:59*Vladar joined #nim
12:54:38FromDiscord<Isofruit> In reply to @ajusa "I'm looking forward to": Thanks! I'm honestly fairly excited to see what the final version of that PR will look like, since chances are there are a decent amount of bits and bobs to improve that I may have overlooked
13:02:54FromDiscord<ajusa> I'm just excited to have Norm be more powerful, so that it can realistically compete with the Python ecosystem. I plan to combine that with my form library to build web apps
13:11:10*jjido joined #nim
13:17:56adigitoleohow to get bounds of a slice? tried slice[0] and slice.low but no luck
13:21:38adigitoleonvm just have to toSeq first
13:25:27*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:58:16FromDiscord<haxscramper> .a and .b
13:58:45FromDiscord<haxscramper> Slice is an object, HSlice, defined in system.nim
14:12:29FromDiscord<auxym> how do I create an UncheckedArray (of 6 `byte`s) on the stack (ie without casting from `alloc`)? Can I (or should I) cast a nim array?
14:14:38*neurocyte091709 quit (Ping timeout: 250 seconds)
14:15:16FromDiscord<auxym> specifically, to call a C function that takes `uint8_t buf[6]` as an argument
14:17:16adigitoleohaxscramper: thanks
14:19:21*neurocyte091709 joined #nim
14:19:38FromDiscord<haxscramper> In reply to @auxym "specifically, to call a": For this one you can start with taking `addr` of an `array[8, uint8]`
14:20:23FromDiscord<haxscramper> IIRC `UnchekedArray` does not really exist without `ptr` - it is just a wrapper type around C's pointer-can-actually-be-an-array-hack
14:20:51FromDiscord<haxscramper> So in general, you have to take an address of some data and cast it to `ptr UncheckedArray[T]`
14:20:54FromDiscord<auxym> ok! just wasn't sure if nim arrays had the same memory layout as a plain c array
14:22:26FromDiscord<yallxe> how do I convert string to cstring? i've tried doing `cast[cstring](...)` but the output was "".
14:41:38*arkurious joined #nim
14:43:11FromDiscord<yallxe> In reply to @yallxe "how do I convert": tried to figure out wtf is going on and actually, if I pass `var string` to `cast[cstring]()`, the output will `""`
14:43:20FromDiscord<yallxe> but why
14:50:07FromDiscord<auxym> I'm not sure, but nim strings are quite different internally from raw strings, which are a null-terminated array of chars
14:51:50FromDiscord<yallxe> In reply to @auxym "I'm not sure, but": yes, i know
14:52:00FromDiscord<auxym> See this maybe? https://nim-lang.org/docs/system.html#allocCStringArray%2CopenArray%5Bstring%5D
14:52:23FromDiscord<yallxe> but the issue that `var string` is not converting to `cstring` using cast
14:52:34FromDiscord<yallxe> while the `let string` or `const string` does
14:53:20FromDiscord<yallxe> In reply to @auxym "See this maybe? https://nim-lang.org/docs/system.ht": not sure if this is what i need
14:54:00FromDiscord<yallxe> probably not
14:55:44FromDiscord<auxym> probably not indeed. Not sure if there's anything built in for what you want or if you'll have to use `copyMem`
14:58:13FromDiscord<yallxe> In reply to @yallxe "while the `let string`": correction, const string only does.
15:02:21FromDiscord<Bloss> sent a code paste, see https://paste.rs/Uxf
15:03:07FromDiscord<haxscramper> you can do this, partially, having two overloads with different names is possible
15:03:46FromDiscord<haxscramper> so, as usual - "you can probably write a macro for that"
15:18:21*Vladar quit (Quit: Leaving)
15:49:30*krux02 joined #nim
16:04:08*adigitoleo quit (Ping timeout: 260 seconds)
16:12:18FromDiscord<whisperdev> How does one build an app for iOS or Android with Nim?
16:12:46FromDiscord<whisperdev> Maybe it would be better for me to go with something mainstream. I just need a simple form with authentication / user management and upload file functionality
16:13:56*adigitoleo joined #nim
16:28:11*adigitoleo quit (Ping timeout: 250 seconds)
16:32:33*adigitoleo joined #nim
16:56:42*adigitoleo quit (Remote host closed the connection)
16:57:25*adigitoleo joined #nim
17:02:25*adigitoleo quit (Remote host closed the connection)
17:03:08*adigitoleo joined #nim
17:49:41FromDiscord<demotomohiro> In reply to @whisperdev "How does one build": Nim forum post related to android app:
17:49:42FromDiscord<demotomohiro> https://forum.nim-lang.org/t/8491
17:57:53FromDiscord<ajusa> @whisperdev see https://github.com/iffy/wiish for iOS and Android, haven't tested it myself though
17:58:51FromDiscord<ajusa> but if you want a tested, mature way to write an iOS app I can't really recommend Nim unless you're willing to spend lots of time
18:25:39FromDiscord<Tex> What is the best way to profile for bottlenecks in a nim program? Nimprof seems pretty basic compared to something like valgrind.
18:28:40*noeontheend joined #nim
18:31:11FromDiscord<treeform> In reply to @Tex "What is the best": I made this but its also pretty basic: https://github.com/treeform/hottie
18:31:16FromDiscord<treeform> Enough for my use case though.
18:31:51FromDiscord<treeform> I also use Intel vTune and AMD μProf.
18:32:52FromDiscord<treeform> Also I use approach where I factor out the slow bits and use dedicated bench_ files with https://github.com/treeform/benchy
18:33:15FromDiscord<treeform> Kind of like performance unit tests.
18:35:49FromDiscord<Tex> Anything open source that's jus tlike Intel vTune or AMD uProf? I've heard of dr memory.
18:35:57FromDiscord<Tex> (edit) "jus tlike" => "just like"
18:36:13FromDiscord<treeform> I tried open source is it was not good. Don't recommend.
18:36:42FromDiscord<treeform> Both Intel vTune or AMD uProf are free and only target the chipset.
18:37:15FromDiscord<Tex> I don't understand what you're saying with you tried open source is it was not good. Nimlang itself is free software under the MIT license. Are you referring to a specfic program?
18:37:16FromDiscord<treeform> But you need to signup and create account.
18:37:42FromDiscord<treeform> I am referring to open source perf tiles like Intel vTune or AMD uProf.
18:37:59FromDiscord<treeform> There just isn't a clear good one.
18:38:24FromDiscord<treeform> That's why I made my own, after using them.
18:38:36FromDiscord<treeform> (edit) "tiles" => "tools"
18:39:22FromDiscord<Tex> Thanks for the info treeform. I'll have to mix and match some utilties should I come across any issues.
18:40:00FromDiscord<treeform> Closet "Ok" open source one was http://lukestackwalker.sourceforge.net/
18:40:07FromDiscord<treeform> great name pun!
18:40:18FromDiscord<treeform> But it kind of sux.
18:40:43FromDiscord<Tex> I would definitely vouch for valgrind, but it's linux only and I'm currently on my windows machine.
18:40:55FromDiscord<treeform> Yeah I mainly do Windows/Mac.
18:41:13FromDiscord<Tex> If only valgrind didn't make extensive use of linux syscalls.
18:41:25FromDiscord<treeform> yeah no valgrind for me
18:41:48FromDiscord<treeform> I think I have my needs covered with `hottie` + `benchy`
18:41:52FromDiscord<demotomohiro> gprof doesn't work with Nim?
18:42:30FromDiscord<treeform> I think when I tried gprof I could not get it to work.
18:42:35FromDiscord<treeform> On windows.
18:46:45FromDiscord<demotomohiro> When I run `nim c --passC:-pg -d:danger test.nim`, I got many `undefined reference to `fentry'`.
18:49:33FromDiscord<gnu+linux user> seems this that words for if and when doesnt for case:
18:49:52FromDiscord<gnu+linux user> sent a code paste, see https://play.nim-lang.org/#ix=3Mi7
18:50:34FromDiscord<gnu+linux user> sent a code paste, see https://play.nim-lang.org/#ix=3Mi8
18:53:59FromDiscord<demotomohiro> `nim c --passC:-pg --passL:-pg -d:danger test.nim` compiled without error but `gprof test gmon.out` shows empty result.
19:02:07FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Mif
19:05:36FromDiscord<mratsim> In reply to @Tex "What is the best": Intel Vtune or Apple Instrument or perf: https://github.com/status-im/nim-taskpools/issues/5↵and https://forum.nim-lang.org/t/8802
19:55:40*Gustavo6046 joined #nim
20:00:01*vicfred joined #nim
20:42:23*ad-absurdum joined #nim
20:49:56FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3MiX
20:50:09FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3MiX" => "https://play.nim-lang.org/#ix=3MiY"
21:22:23FromDiscord<Isofruit> Does a Data object always contain another data object?
21:23:07FromDiscord<Isofruit> Like, somewhere that thing must stop, when?
21:23:20FromDiscord<haxscramper> `ref object`
21:23:23FromDiscord<haxscramper> `Data = ref object`
21:23:40FromDiscord<Patitotective> its for my parser: when there are nested sequences i need to save the parent to retake it after the nested sequence ends
21:23:43FromDiscord<haxscramper> Or you can get smarter with DOD etc., but that depends on what do you use exactly
21:24:03FromDiscord<haxscramper> In reply to @Patitotective "its for my parser:": so it is an AST basically?
21:24:08FromDiscord<haxscramper> WIth "up" pointer?
21:24:21FromDiscord<Patitotective> In reply to @haxscramper "so it is an": _npeg_, or idk what do you mean
21:24:28FromDiscord<mratsim> In reply to @Patitotective "its for my parser:": make it a ref object
21:24:32FromDiscord<Patitotective> In reply to @Isofruit "Like, somewhere that thing": the first object does not have a parent
21:24:46FromDiscord<Isofruit> Then you should express that with Option[Data]
21:24:55FromDiscord<mratsim> no a ref
21:24:57FromDiscord<Isofruit> (Imo, not too sure hwat you're trying to do)
21:24:58FromDiscord<haxscramper> it would have the same illegal recursion error
21:25:20FromDiscord<haxscramper> make it a reference, because it looks like you can have cycles
21:25:27FromDiscord<mratsim> you have a tree here, with child keeping a reference to their parent, if it exists.
21:26:09FromDiscord<mratsim> you can use Option[Data] if Data is a ref object, but it doesn't solve the underlying problem
21:26:23FromDiscord<mratsim> which is choosing between reference and value types.
21:26:23FromDiscord<Patitotective> what is option?
21:26:31FromDiscord<haxscramper> `std/options.Option`
21:26:34FromDiscord<Isofruit> Option is an alternative representation of nil
21:26:45FromDiscord<Isofruit> Where you can express that a value might be there or not instead of using nil
21:26:59FromDiscord<Patitotective> ooh, thats cool
21:27:04FromDiscord<haxscramper> close but `Option` also allows to do this for non-ref objects
21:27:13FromDiscord<haxscramper> whereas `nil` requires `ref` or `ptr` data
21:27:22FromDiscord<haxscramper> but idea is the same - represent optionality
21:27:35FromDiscord<Isofruit> Yeah, effectively you absolutely positively never want to have to use nil
21:27:51FromDiscord<Isofruit> Because you can never know when a value is supposed to be able to be nil or not
21:28:12FromDiscord<Isofruit> With Option you express that "does not exist" is a possibility right then and there, explicitly.
21:28:31FromDiscord<Isofruit> And force yourself (and others using your code) to at east acknowledge that nil can happen.
21:28:47FromDiscord<Patitotective> In reply to @haxscramper "`std/options.Option`": that looks no nimmy, will use `std/options` only
21:29:06FromDiscord<Isofruit> I'm actually not sure where options come from, functional programming language stuff?
21:29:33FromDiscord<haxscramper> yes
21:29:38FromDiscord<haxscramper> Option/Either/Result
21:29:54FromDiscord<yallxe> how do I get the full windows `%appdata%` path? i tried `expandFilename("%appdata%")` but it does not return what i need
21:30:07FromDiscord<haxscramper> `Option[T]`, `Either[A, B]` and `Result[Err, Ok]`
21:30:08FromDiscord<yallxe> expandFilename uses current directory
21:30:14FromDiscord<haxscramper> stdlib only has `Option`
21:30:25FromDiscord<Isofruit> I was 2 seconds away from being surprised we have Result
21:30:31FromDiscord<Isofruit> (edit) "being" => "writing that I am"
21:32:08FromDiscord<Patitotective> Thank you all guys 🙃
21:32:59FromDiscord<Isofruit> In reply to @yallxe "expandFilename uses current directory": Sadly I haven't written a single line of code for windows in ages. But isn't appdata an environmental variable? If that's the case, shouldn't it possible to access it as such?
21:33:36FromDiscord<yallxe> maybe there is some better solution
21:33:49FromDiscord<yallxe> then getting it throught env vars
21:33:55FromDiscord<yallxe> (edit) "then" => "thnn"
21:33:58FromDiscord<yallxe> (edit) "thnn" => "than"
21:34:28FromDiscord<Isofruit> Fair, but at the very least it provides a base solution which might not be nice but at least means you aren't completely stuck, which is a good first starting point 😄
21:34:32FromDiscord<yallxe> well there is getHomeDir()
21:34:54FromDiscord<yallxe> which will return smth like C:\Users\yallxe\
21:35:28FromDiscord<Isofruit> There's also https://nim-lang.org/docs/os.html#getCacheDir
21:35:43FromDiscord<Isofruit> Which gives you LOCALAPPDATA
21:37:04FromDiscord<Isofruit> Also https://nim-lang.org/docs/os.html#getAppDir, but that gives you the directory of the executable, not the appdata environmental variable
21:37:53FromDiscord<Isofruit> And that's all I could find in the os lib, which is the only place where I'd assume this type of proc to be
21:38:59FromDiscord<yallxe> In reply to @Isofruit "Which gives you LOCALAPPDATA": oh, this one will be great
21:39:01FromDiscord<yallxe> thanks
21:39:22FromDiscord<yallxe> i was thinking that it is path to temp or smth
21:41:50FromDiscord<Isofruit> shrugs, CTRL+F is a powerful tool 😄
21:50:17FromDiscord<C7c3r0> hello, can someone guide me on how to import libraries used in python such as `import json` or `import shutil` ?↵I've been googling since yesterday but can't find anything relevant.
21:50:18FromDiscord<C7c3r0> thank you!
21:51:01FromDiscord<Isofruit> You're trying to use python libraries in nim code?
21:51:03FromDiscord<yallxe> In reply to @C7c3r0 "hello, can someone guide": wdym?
21:51:24FromDiscord<C7c3r0> I am trying to port a python program to nim
21:51:33FromDiscord<yallxe> In reply to @C7c3r0 "I am trying to": 👀
21:51:35FromDiscord<yallxe> but
21:51:36FromDiscord<yallxe> how
21:51:49FromDiscord<yallxe> are you literally using the whole python interpreter in nim
21:51:59FromDiscord<Isofruit> And to do so you want to access python libs and compile them into your nim binary?
21:52:30FromDiscord<C7c3r0> precisely, I have found the opposite for importing nim libraries to python, but can't find the opposite 😦
21:52:41FromDiscord<yallxe> i dont think there is the opposite
21:52:49FromDiscord<yallxe> well you can import the whole interpreter
21:52:54FromDiscord<C7c3r0> me too, thus I am asking the community.
21:52:57FromDiscord<yallxe> like python3.x.dll or smth
21:53:21FromDiscord<Isofruit> The reason python can wrap nim is because you can turn nim into a binary and call that from python. You can't really compile python in a similar manner
21:53:28FromDiscord<Isofruit> Well, you can
21:53:30FromDiscord<Isofruit> Sort of
21:53:37FromDiscord<Isofruit> But that's not generally what you do in pytho
21:53:39FromDiscord<Isofruit> (edit) "pytho" => "python"
21:53:41FromDiscord<C7c3r0> if I code it, which is extensive work as it is....
21:54:04FromDiscord<yallxe> are you from windows?
21:54:05FromDiscord<yallxe> or linux
21:54:09FromDiscord<C7c3r0> linux
21:54:13FromDiscord<yallxe> shit
21:54:18FromDiscord<C7c3r0> I know
21:54:25FromDiscord<C7c3r0> cause you mentioned .dll
21:54:46FromDiscord<yallxe> check it out https://github.com/call-042PE/PyInjector
21:54:53FromDiscord<yallxe> it is not what you need exactly
21:55:11FromDiscord<yallxe> but it is like the external injection of python into python process
21:55:24FromDiscord<yallxe> i dont know how to do this on linux
21:55:28FromDiscord<yallxe> but maybe you know
21:56:03FromDiscord<Isofruit> Curiosity quesiton, what do you have to achieve from wrapping python code that executes as python code in nim?↵Is this a piece of a larger project that is written in nim and re-coding that particular section would be too much of a pain in the keister?
21:56:10FromDiscord<Isofruit> (edit) "have" => "wish"
21:57:02FromDiscord<yallxe> In reply to @yallxe "check it out https://github.com/call-042PE/PyInject": what it actually does it takes python's dll from process and executing python code through it's functions
21:57:12FromDiscord<C7c3r0> it is for my understanding of Nim and it's objects.↵It is from an older project and will help me create better rapture with the language itself.
21:57:36FromDiscord<Isofruit> Ahhh it's something for you to get used to nim, check
21:58:33FromDiscord<C7c3r0> some `imports` I'm using are not present in Nim, and it is really a versatile language from what I read yesterday.↵I was looking to go for `Julia-Lang` but eventually got my eyes here.
21:58:35FromDiscord<yallxe> well i have an idea how to execute python code in nim
21:58:36FromDiscord<yallxe> but on windows
21:59:24FromDiscord<C7c3r0> i really need to make that port for all OS.↵If C is prevalent in an OS Nim will compile and execute as I've come to understand.
21:59:49FromDiscord<Isofruit> Pretty much, the compilation step goes pretty much nim --> C --> binary
22:00:18FromDiscord<Isofruit> (if you want binaries, you can of course also compile to JS and other stuff, there's tons of options)
22:01:10FromDiscord<C7c3r0> C# or CPP?
22:01:28FromDiscord<Isofruit> The mother of em all, just pure C as far as I'm aware
22:02:20FromDiscord<Elegantbeef> C is a rather good language for a IR since there are so many devices with either a C/C++ compiler
22:02:40FromDiscord<Isofruit> By default it uses the C compiler that your OS uses by default, I was taught pretty much the same information on a convo in the offtopic channel not too long ago
22:02:41FromDiscord<Isofruit> one sec
22:02:45FromDiscord<Elegantbeef> But there is also `nlvm` which uses llvm as a backend
22:03:35FromDiscord<Isofruit> https://discord.com/channels/371759389889003530/371759607934353448/931284029939007549↵You can start reading from there and read your way down a lot of the comments from leorize and Yardanico, they are a lot more knowledgeable about this stuff than I
22:03:47FromDiscord<C7c3r0> Thank you Isofruit.
22:05:20FromDiscord<Isofruit> Glad to share what I've been taught, though the thanks belongs more to Yardanico and leorize
22:05:36FromDiscord<leorize> are you looking for this? https://github.com/yglukhov/nimpy↵(@C7c3r0)
22:06:31FromDiscord<C7c3r0> GOD yas!
22:06:48FromDiscord<Isofruit> sports commentator voice↵And out of left field comes leorize, and he comes with a solution!
22:09:14FromDiscord<pmunch> Note, if you're porting a Python library to Nim you should probably use the equivalent Nim modules instead of delegating to Python
22:11:16FromDiscord<C7c3r0> these bots are awesome!
22:11:28FromDiscord<Elegantbeef> Quite possibly not bots
22:11:38FromDiscord<Isofruit> Shush beef, accept your bot life
22:11:44FromDiscord<Elegantbeef> The jury is still out though i hear pmunch occasionally "beep boop"
22:11:46FromDiscord<C7c3r0> is this AI?
22:11:55FromDiscord<C7c3r0> is this convergence ?
22:11:55FromDiscord<Isofruit> Nah, they're using a different client
22:12:01FromDiscord<C7c3r0> ❤️
22:12:03FromDiscord<Isofruit> matrix IIRC
22:12:10FromDiscord<vindaar> @C7c3r0\: as you mentioned julia earlier, there's also https://github.com/Clonkk/nimjl
22:12:18FromDiscord<Elegantbeef> It's emergent intelligence, 4 billion years ago life started and over time brains developed
22:12:34FromDiscord<Elegantbeef> Eventually those brains decided to use matrix/irc instead of discord
22:12:44FromDiscord<vindaar> no, I'm an AGI of course
22:13:05FromDiscord<Isofruit> y'all just GPT3 on a couple ego trips
22:14:46FromDiscord<Elegantbeef> You know it
22:14:55FromDiscord<Elegantbeef> GPT3 constructor comes out tomorrow 😛
22:16:43FromDiscord<Isofruit> Sidenote, constructor did not yet blow up in my face even though I've thrown it at like... 30 different models or sth, am very satisfied, I managed to delete at least 200-300 lines of code thanks to it
22:17:54FromDiscord<Isofruit> 4.5/5, full rating if it also manages to cook breakfast for me
22:21:43FromDiscord<Isofruit> Unrelated sidenote, because I'm wondering whether I should just have these warnings suppressed or not
22:22:41FromDiscord<Isofruit> I've got procs that delete/insert/update entries in a database using norm. The procs norm provides are decidedly not gc-safe
22:23:39FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mjj
22:24:04FromDiscord<Isofruit> What I get in return is repeatedly the compiler warning:↵`'createEntry' is not GC-safe as it calls 'insert' [GcUnsafe2]`
22:24:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mjk
22:24:55FromDiscord<Elegantbeef> But there is the question of "why would you lie" 😛
22:26:17FromDiscord<Elegantbeef> Guess it depends on which gc you want to support
22:26:23FromDiscord<leorize> one of the few case I wished ormin works \:p
22:26:38FromDiscord<Isofruit> I was less wondering how to shut the compiler up and more whether the compiler's warning is like an old grandmother telling me to put a second jacket over the first because it's cold outside at 6°C, or whether the compiler right now is telling me I'm 5 cm away from falling down the abyss
22:26:56FromDiscord<Elegantbeef> It's more about threading + GV
22:27:00FromDiscord<Elegantbeef> ● GC \
22:27:16FromDiscord<leorize> what does generic have to do with gcsafe?
22:27:25FromDiscord<leorize> I suppose you are calling this stuff in async procs?
22:27:57FromDiscord<Isofruit> I recalled that if I didn't have them here I'd have them all over my individual repositories (which do barely more than call procs of the generic repository, but with explicit types)
22:28:16FromDiscord<Isofruit> (edit) "I recalled that if I didn't have them here I'd have them ... all" added "(the warnings)"
22:28:20FromDiscord<Isofruit> let me see what happens if I remove them now
22:29:05FromDiscord<Isofruit> Never mind, my stuff straight up no longer compiles if I remove the "gcsafe" pragma from my generic delete proc
22:29:32FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mjl
22:30:06FromDiscord<Elegantbeef> Well `getDatabaseConnection` is a sure fire way of being gc unsafe 😀
22:30:12FromDiscord<Isofruit> leorize: Pretty much
22:31:02FromDiscord<Isofruit> Would it make things worse if I revealed I haven't yet implemented connection pooling, so "getDatabaseConnection" creates a new database connection to my sqlite file all the time?
22:31:30FromDiscord<leorize> looks like it uses the exact same connection, hence gcsafe warnings
22:32:11FromDiscord<Elegantbeef> Not really, the issue is that `getDatabaseConnection()` i assume uses GC'd memory which means it's unsafe
22:32:19FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mjn
22:32:25FromDiscord<leorize> obviously the way out is to use cps which doesn't care about gcsafe /s
22:32:41FromDiscord<leorize> oh then yea that will open a new database everytime↵(@Isofruit)
22:32:47*vicfred quit (Quit: Leaving)
22:32:48FromDiscord<leorize> your issue is that you are accessing a global
22:33:32FromDiscord<Isofruit> I eventually wanted to move over to connection pools since I recall that being a standard implemented in every web framework I ever used
22:33:57FromDiscord<Isofruit> Just didn't get around to that yet because busy implementing other stuff
22:35:18FromDiscord<Isofruit> In reply to @leorize "oh then yea that": So the gcsafe warnings are the compiler not knowing I have a very silly implementation there?
22:35:54FromDiscord<Elegantbeef> Yea using that global GC'd memory is always going to be an issue
22:36:21FromDiscord<Elegantbeef> The GC warnings are basically saying "This is not thread safe"
22:36:46FromDiscord<Elegantbeef> If you arent multi threading you can use the cast above to hide the errors, which is fine on Orc/Arc
22:37:10FromDiscord<Elegantbeef> If you are using refc + multithreading you'd have to properly share the variable across the threads
22:37:16FromDiscord<Isofruit> Nah, I likely am not multi threading but this is also for learning purposes, so doing it the "right" way there is the way to go for me
22:37:43FromDiscord<Isofruit> Wait, wouldn't a connection pool address exactly that issue?
22:37:47FromDiscord<leorize> it's a stupid warning, you don't have to care too much about it \:p
22:38:01FromDiscord<Elegantbeef> A connection pool would be global GC'd memory still
22:38:06FromDiscord<Elegantbeef> It's the same issue just more sophisticated
22:38:44FromDiscord<Elegantbeef> Comically in the compiler there is a note of "Hey if it's gcsafe it's threadsafe" which tells you everything you need to know about gcsafe 😛
22:39:21FromDiscord<Elegantbeef> Nim's async doesnt use a second thread afaik so you dont need to worry about threadsafe afaiik
22:39:22FromDiscord<Isofruit> Ohh, so effectively it's saying "you're giving this memory back, but I can't guarantee that this memory will be allocated by your program the entire time you're using it" ?
22:39:51FromDiscord<Isofruit> (edit) "giving" => "passing" | "back," => "location from the proc to your caller,"
22:40:06FromDiscord<Isofruit> (edit) "time you're using it"" => "runtime of your program""
22:40:29FromDiscord<Elegantbeef> Eh i dont get gc unsafe procs much, generally just ignore them unless i'm multi threading
22:40:36FromDiscord<Isofruit> In reply to @leorize "it's a stupid warning,": It spams across my terminal every compilation! It annoys me!
22:41:02FromDiscord<Isofruit> ~~Literally the only reason I actually remove unused imports~~
22:41:04FromDiscord<Elegantbeef> Like i said you can {.cast(gcsafe).}\:\`
22:41:50FromDiscord<Isofruit> Yeh but that circumvents my chance to actually learn a bit more what's going on there and how I'd solve it if I wanted to multithread
22:42:05FromDiscord<Elegantbeef> I mean depending on your GC that's a multithread solution
22:42:47FromDiscord<Isofruit> gcsafe just states that it isn't safe for all gcs, but is for some?
22:43:07FromDiscord<Elegantbeef> Well Orc/Arc have a shared heap
22:43:23FromDiscord<Elegantbeef> So as long as you know the variable isnt going to get collected it's gcsafe
22:44:03FromDiscord<Elegantbeef> The one solution you could do is pass a data base connection down i think, but i dont know i generally ignore gcsafe warnings unless i'm doing thread stuff
22:45:19FromDiscord<leorize> atm gcsafe is more noise than helpful, unfortunately
22:45:43arkanoidhow can I call a function on a result of collect without storing it first in a variable?
22:46:09arkanoid(collect(newSeq): for x in y: x).len doesn't work
22:46:12FromDiscord<Isofruit> have the procs first parameter be seq[whatever you were collecting] ?
22:47:33FromDiscord<leorize> https://play.nim-lang.org/#ix=3Mjr
22:47:56FromDiscord<leorize> if you need more than one parameter, you have to store it in a variable
22:49:20arkanoidwhat is happening here? using len as a block?
22:51:23FromDiscord<Isofruit> In reply to @Elegantbeef "So as long as": I think I'm still getting stuck on where the compiler thinks this might be dangerous.↵regardless of the way I'm reference counting, the `DbConn` variable always has a reference in the one proc that it is called in. ↵Is the danger here that I might have 2 DbConns to the same database and the compiler is warning me "if both of these are firing a delete I don't know what'll happen" ?
22:51:38FromDiscord<Isofruit> (edit) "In reply to @Elegantbeef "So as long as": I think I'm still getting stuck on where the compiler thinks this might be dangerous.↵regardless of the way I'm reference counting, the `DbConn` variable always has a reference in the one proc that it is called in. ↵Is the danger here that I might have 2 DbConns to the same database and the compiler is warning me "if both of these are firing a delete ... I" added "in parallel"
22:51:51FromDiscord<leorize> it's the expression-block syntax
22:51:59FromDiscord<leorize> typically used with templates/macros
22:52:07FromDiscord<leorize> but it works with anything
22:53:40FromDiscord<leorize> I think the fault lies in your applicationSettings, which I imagine is a ref↵(@Isofruit)
22:54:10FromDiscord<Isofruit> > const database = "db.sqlite3"
22:55:24arkanoidSo the "block" keyword is used only when assigning variables? Can I use that syntax with any 1 arg function? Sweet
22:55:48FromDiscord<leorize> you can use that syntax for the last parameter of any function
22:56:05FromDiscord<leorize> not necessarily 1 arg, similar to templates/macros
22:56:26arkanoidlast? ok, just like body
22:56:30arkanoidgot it
22:56:49arkanoidnot sure if idiomatic, but I like this with collect
22:57:36FromDiscord<leorize> idiomatic enough \:p I abuse this syntax all the time when writing macros
22:58:17FromDiscord<Isofruit> So the string is heap allocated and thus a reference type. I think my lack of knowledge with closer-to-the-metal languages is showing here, I'm failing to bring that logic chain to the conclusion "and that's why it's potentially problematic under some multithreadng-circumstances"
22:58:17FromDiscord<leorize> the danger is that accessing the same `ref` in two threads is not safe and is undefined behavior↵(@Isofruit)
22:58:32FromDiscord<Isofruit> But it's a const and thus read only, wouldn't the compiler know that?
22:58:35FromDiscord<leorize> this warning strictly act on `ref`
22:58:51FromDiscord<leorize> if it doesn't have `ref` in its definition, it doesn't count
22:59:19FromDiscord<leorize> string is a value type in nim, don't worry
23:00:15arkanoidI'm quite sad that there's no GUI lib/binding for nim on to the same level used for professional looking programs. I've just messed up with nimx and nimqml, but both lacks what the industry expects. Wnim is windows only, maybe I try gintro
23:00:40FromDiscord<leorize> gintro is great for linux, not so much on windows, though
23:01:12arkanoidqt was my best bet, but there's not enough love for it within nim community
23:02:01FromDiscord<Isofruit> Weren't gtk and Qt very wrappable?
23:02:13FromDiscord<leorize> qt is the opposite of wrappable \:p
23:02:38arkanoidnot sure how other large libraries are doint it
23:02:50arkanoid*large languages/communities
23:02:57arkanoidrust/go/etc
23:02:58FromDiscord<Isofruit> My frontend coding consists of HTML CSS and JS, I know of gtk and qt, haven't worked with them (yet)
23:03:54arkanoidIsofruit, but do you do also desktop application? I'm struggling in findind the sweet spot to keep using nim instead of python for a kinda data-analysis desktop app
23:04:44FromDiscord<leorize> they all have specially created generators to wrap those apis
23:05:06FromDiscord<Isofruit> I do not dare call anything related to HTML CSS and JS as desktop application, even though I think I strictly speaking could. As such, I've done mostly CLI stuff on desktop when it wasn't a server
23:05:21FromDiscord<Isofruit> (edit) "a server" => "web stuff"
23:05:57FromDiscord<leorize> qt qml is usable in nim iirc
23:06:23arkanoidyeah but I have to present lot's of tables and also maps, so while doing electron-like desktop app is feasible, I wantes to stick with real native stuff for performance
23:06:40FromDiscord<leorize> https://github.com/status-im/status-desktop \<- this is an app using qml in nim
23:07:36arkanoidleorize, yeah, I'm using it right, here's my toy project https://github.com/arkanoid87/nimmap
23:07:51arkanoidis status-desktop using nimqml?
23:08:35FromDiscord<Isofruit> I assume so https://media.discordapp.net/attachments/371759389889003532/932048650643857408/Screenshot_from_2022-01-16_00-08-21.png
23:08:39arkanoidpoint is that nimqml is one-man project, also is composed of 2 libraries: dotherside (cpp -> c), and nimqml (c -> nim)
23:09:08FromDiscord<Isofruit> Oh you were asking nimqml the lib, not just qml
23:09:10FromDiscord<Isofruit> Nevermind my post
23:09:43FromDiscord<leorize> they use their own fork\: https://github.com/status-im/nimqml
23:09:44arkanoidwell, they apparently do use NimQml
23:10:04arkanoid This branch is 56 commits ahead, 8 commits behind filcuc:master. Interesting
23:11:29arkanoidthanks, this is very interesting. I'm testing nimqml right now but the memory model is not documented, and I'm experiencing leaks
23:11:42arkanoidI have to find out what's the proper use pattern
23:12:53arkanoidthanks leorize for nimqml by status link, I was not aware of it, this boost my confidence
23:15:22FromDiscord<Isofruit> sent a long message, see http://ix.io/3Mjy
23:15:57FromDiscord<Isofruit> (edit) "http://ix.io/3Mjy" => "http://ix.io/3Mjz"
23:15:59FromDiscord<leorize> uh... no
23:16:05FromDiscord<leorize> your bug have nothing to do with that string
23:16:13FromDiscord<leorize> I thought applicationSettings was a ref
23:16:14FromDiscord<Isofruit> (edit) "http://ix.io/3Mjz" => "http://ix.io/3MjA"
23:16:22FromDiscord<leorize> but since it's a const, it's not the issue here
23:17:26FromDiscord<Isofruit> Ahhhh okay, resetting mind and contemplating where else that potential issue might be. And chances are it's not as the warning says something with insert?
23:17:42arkanoidhooray, I've just found that status is dealing with the same object creation/delete of nimqml I was figuring out. Good news!
23:18:02FromDiscord<Isofruit> As the warning goes "since insert/delete/updatre isn't gc-safe, your proc can't be gc-safe either"
23:18:07FromDiscord<Isofruit> (edit) "insert/delete/updatre" => "insert/delete/update"
23:18:21FromDiscord<leorize> I guess you found your issue \:p
23:18:24FromDiscord<ajusa> Anyone know if beef's constructor works with default values?↵`proc initField(label = "", default = "", widget = defaultInput): Field {.constr.} = discard` gives me a segfault, though the manual version where I set each field works fine.
23:18:29FromDiscord<leorize> it's in those insert/delete/etc.
23:18:43FromDiscord<leorize> not sure what is used in there but if the compiler said so it must be due to that
23:19:18FromDiscord<leorize> summon the man is the best way \:P [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)↵(@ajusa)
23:20:42FromDiscord<Isofruit> as someone who also uses beefs constructor, I'm not sure I see your goal, why not use the "newField" proc the call of "implDefaults(Field)" will have created for you?
23:20:56FromDiscord<Elegantbeef> It should work with defaults
23:21:01FromDiscord<Elegantbeef> If it doesnt it needs fixed
23:21:02FromDiscord<Isofruit> (I'll just go ahead and assume you use constructor/defaults)
23:21:20FromDiscord<ajusa> I don't use constructor/defaults, do I need to for this behavior?
23:22:15FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3MjB
23:22:42arkanoidI find object + plain initObject + plain list of getters quite boring to setup (like here https://github.com/status-im/status-desktop/blob/8dace226c549a1e5a357c6c99f51a7b52e226b13/src/app/modules/startup/onboarding/item.nim) do you know if there's an existing widely used macro to handle this?
23:23:12FromDiscord<leorize> constructor solve one part of it
23:23:26FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3MjC
23:25:08FromDiscord<ajusa> Should I open an issue, or did I misunderstand what you meant when you said "It should work with defaults"?
23:26:23FromDiscord<Elegantbeef> open an issue that should work
23:27:53*jjido joined #nim
23:28:22FromDiscord<Elegantbeef> Lol whoops my recent constructor repo has a `echo result.repr` mybad 😀
23:29:41FromDiscord<Isofruit> In reply to @arkanoid "I find object +": https://github.com/beef331/constructor if you're searching for the way to get init functions built for you
23:30:14FromDiscord<ajusa> opened the issue, sorry for lack of MWE. hopefully it's just a simple fix though
23:33:57FromDiscord<Elegantbeef> What nim version are you on?
23:34:13FromDiscord<ajusa> 1.6.0
23:34:50FromDiscord<Elegantbeef> I dont get the segfault but i do get a bug
23:35:49FromDiscord<ajusa> the segfault happens in my own code when it tries accessing and using one of the fields, I assume it's being set to nil
23:35:56FromDiscord<Elegantbeef> Yea it is
23:36:04FromDiscord<Elegantbeef> I dont think i handled exported fields
23:36:28FromDiscord<Elegantbeef> Yea that's iit
23:37:01FromDiscord<Elegantbeef> I was a dumb dumb
23:37:31FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3MjH
23:38:17FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3MjH" => "https://play.nim-lang.org/#ix=3MjI"
23:38:19FromDiscord<Elegantbeef> @ajusa\: `1.0.1` is your golden goose
23:39:01FromDiscord<ajusa> works! thanks you so much 😄
23:39:51FromDiscord<Elegantbeef> No problem
23:45:36FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3MjN
23:46:00FromDiscord<Isofruit> I tend to have types with a lot more fields 😛
23:46:19FromDiscord<Elegantbeef> And now with `1.0.2` you can just do `proc initField(label = "", default = "", widget = defaultInput): Field {.constr.}`
23:46:29FromDiscord<Elegantbeef> We can abuse forward declare syntax to make that work!
23:46:56FromDiscord<ajusa> so you got rid of the discard + =? neato, guess I'm updating
23:48:14FromDiscord<Isofruit> Issues to tackle tomorrow maybe:↵file upload↵basic signal system↵image-conversion signal
23:49:22FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3MjP
23:49:56FromDiscord<Isofruit> ... that counts as abuse?
23:50:04FromDiscord<ajusa> 141 char line vs two lines, the hardest choices require the strongest wills
23:50:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3MjQ
23:51:13FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3MjR
23:51:49FromDiscord<Elegantbeef> ah sorry should be named `opts`
23:51:49FromDiscord<Elegantbeef> or something other than the field name
23:52:32FromDiscord<Elegantbeef> Well i'm off to get some food, so dont abuse constr too much 😛
23:52:53FromDiscord<ajusa> ah gotcha, that works. have a nice meal!
23:59:25FromDiscord<C7c3r0> hi again, I see that I can declare floats in NIM, but I don't see any reference as to how doubles are declared