<< 21-06-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:03:20*junland joined #nim
00:04:14*lritter quit (Ping timeout: 240 seconds)
00:05:11*lritter joined #nim
00:08:34*lritter quit (Client Quit)
00:09:20*vsantana_ quit (Quit: leaving)
00:13:45*synshroud joined #nim
00:14:13*synshroud quit (Client Quit)
00:15:31PrestigeWhat's the license of the nim logo?
00:15:35*synshroud_ quit (Ping timeout: 258 seconds)
00:20:43*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:20:58bungchild proccess stdin hangs, anything should noticed ? not specify to nim.
00:21:10*dsrw joined #nim
00:21:24bungit randomly hangs , sometime works
00:21:37zedeusare you using startProcess?
00:21:58bungnot in nim
00:22:14zedeuscan't help you then
00:22:30bungam wondering something in theory I should knew
00:23:36zedeusI had a Windows-specific problem where launching mpv using startProcess would hang the child process till the parent got killed, and adding poParentStreams to options fixed it. Not sure if this is related to your problem
00:25:04*dsrw quit (Client Quit)
00:29:10bungnot like that,hmm
00:33:20*dsrw joined #nim
01:11:49*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:14:18*Tyresc quit (Quit: WeeChat 2.9-dev)
01:18:16FromGitter<Knaque> Hey, there was some full-stack web framework written in Nim that I'm looking for, but I can't remember it's name/creator for the life of me. Anyone know what I'm talking about?
01:19:06leorize!repo prologue
01:19:07disbothttps://github.com/planety/prologue -- 9prologue: 11Full-Stack Web Framework written in Nim. 15 363⭐ 8🍴 7& 1 more...
01:19:54FromGitter<Knaque> That's the one! Thanks.
01:33:08*dsrw joined #nim
01:45:17*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:49:02*aenesidemus quit (Read error: Connection reset by peer)
01:52:51*chemist69 quit (Ping timeout: 272 seconds)
01:54:09*chemist69 joined #nim
02:02:41*aenesidemus joined #nim
02:07:36FromGitter<deech> Araq, awesome talk!
02:13:08shashlickanyone has a windows machine for a test?
02:15:37*Romanson joined #nim
02:24:55FromDiscord<impbox> @shashlick yep
02:27:33shashlickdo you have Nim 1.0.6 or can get it installed
02:37:53*waleee-cl quit (Quit: Connection closed for inactivity)
02:47:44FromDiscord<Balu> ello whats the state of nim and parallelism?
02:48:40shashlickcheck out weave and threadpool
02:48:53FromDiscord<Balu> i have looked at it maybe a year ago or so and it had some issues and what not
02:49:22*muffindrake quit (Ping timeout: 260 seconds)
02:49:35shashlickwhat exactly are you trying to do
02:50:37*theelous3 joined #nim
02:50:40FromDiscord<Balu> mainly consuming websockets and or rest apis and responding
02:50:49FromDiscord<flywind> https://onlinetechinfo.com/concurrency-and-parallelism-in-nim/
02:51:25*muffindrake joined #nim
02:52:24FromDiscord<Balu> on 1-10 how stable is all that?
02:54:40shashlickwhat's 1-10?
02:54:49FromDiscord<Balu> from 1 to 10
02:55:08FromDiscord<Balu> 10 being super stable and no worries
02:55:46shashlickah okay - i've used threads with zero issues for the last three years
02:56:05shashlicki've messed up with passing memory around and crashing that way
02:56:12shashlickbut if you use channels, it's very good
02:56:22shashlickyou should check out weave which is the current state of the art
02:56:26FromDiscord<Balu> hows the speed with all that do you kno?
02:56:38FromDiscord<Balu> in comparison maybe to go or rust
02:56:45*dashed joined #nim
02:57:40*dsrw joined #nim
02:57:41shashlicki've not tried rust - compared to what little Go I wrote, performance has never been a problem for me with Nim
02:57:51shashlicki know Go made me feel very restricted in expression
02:58:02FromDiscord<Balu> but you would not know if something was faster?
02:58:14FromDiscord<Balu> speed is the main issue for me right now
02:58:18FromDiscord<flywind> some benchmark games https://github.com/kostya/benchmarks
02:58:26shashlickspeed wise, Nim is hard to beat cause you can open the hood and tweak to the n'th level
02:58:39shashlickyou can get C'ish preformance
02:58:43FromDiscord<Balu> and from what i understand it compiles to c but idk how well that handles the threading stuff
02:59:09shashlickI think it will be best if you try yourself but you won't be disappointed by the performance and the power
02:59:25FromDiscord<Balu> so the the threading translates well to c?
02:59:57FromDiscord<Balu> ye i am probably going to just wanted to test the waters first
03:01:26leorizewhat is C-ish performance anyway :P
03:02:03*dsrw quit (Client Quit)
03:05:01*dashed left #nim (#nim)
03:06:45shashlick@Balu - see https://github.com/mratsim/weave
03:07:16FromDiscord<Balu> ty looking at it right now
03:08:08FromDiscord<Balu> but still a bit hesitant tbh this all seems still pretty bleeding edge
03:09:50FromDiscord<Rika> good morning
03:10:01FromDiscord<Balu> 👋
03:12:46FromDiscord<Elegant Beef> Hello rika
03:14:45shashlickNim's been around for 12 years now
03:15:18shashlickWeave is new yes but it's based on the latest research
03:15:39shashlickIf you want plain threading, that's been stable for years
03:16:06Prestigedidn't it start in 2005?
03:17:18FromDiscord<Rika> 2004ish afaik
03:17:29FromDiscord<Rika> think the git repo started 2006?
03:19:09FromGitter<raydf> Hello
03:20:15FromGitter<raydf> I'm importing segfaults but my code generates a "SIGABRT: Abnormal termination" from the duktape library
03:20:33FromGitter<raydf> How can i catch SIGABRT exceptions?
03:22:01*casaca joined #nim
03:39:21*theelous3 quit (Read error: Connection reset by peer)
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:41*supakeen joined #nim
04:12:11FromGitter<jeberly> complete newbie to nim, but i am trying to create a hello world test api service. I am struggling to understand how to read from mysql db table and output json. I am using jester in case it matters. Here is what i have so far, but it just outputs each row as json. ```for x in theDb.fastRows(sql"select * from myTestTbl"): ⏎ echo($$x)```
04:15:54*dddddd quit (Ping timeout: 260 seconds)
04:20:13FromDiscord<SeanOMik> How would I get the current unix time?
04:21:52FromDiscord<Elegant Beef> `import times; echo epochTime()`
04:22:01FromDiscord<Elegant Beef> Now imagine the bot ran that and i remembed the eval command
04:22:16FromDiscord<Elegant Beef> !eval import times; echo epochTime()
04:22:19NimBot1592713338.954584
04:22:21FromDiscord<Elegant Beef> 😄
04:22:43FromDiscord<SeanOMik> Well thats epoch
04:22:48FromDiscord<SeanOMik> Isn't epoch different from unix?
04:22:55FromDiscord<Elegant Beef> `gets time after the UNIX epoch (1970) in seconds.`
04:23:03FromDiscord<SeanOMik> Oh okay
04:23:09FromDiscord<SeanOMik> Why does it have decimals though
04:23:13FromDiscord<Elegant Beef> in seconds
04:23:16FromDiscord<SeanOMik> I guess I could just floor
04:23:27FromDiscord<Elegant Beef> there is also getTime
04:23:39FromDiscord<SeanOMik> Okay
04:23:44FromDiscord<SeanOMik> I'll test them both out
04:23:45FromDiscord<SeanOMik> Thanks
04:23:50FromDiscord<Elegant Beef> no problem
04:31:46*a_chou joined #nim
04:37:46leorizeuse getTime
04:48:44FromDiscord<impbox> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724123613883662426
04:51:31*a_chou quit (Remote host closed the connection)
05:02:51*solitudesf joined #nim
05:12:09FromDiscord<Elegant Beef> `choosenim stable`
05:12:23FromDiscord<Elegant Beef> @impbox
05:12:44FromDiscord<Elegant Beef> Atleast i think i recall that
05:13:07FromDiscord<impbox> no change
05:23:50FromDiscord<impbox> building manually worked
05:24:04FromDiscord<impbox> (edit) 'building ... manually' => 'buildingnim + nimble'
05:29:06FromDiscord<Zed> is there a way to check for multiple values instead of chaining together or statements?
05:29:19FromDiscord<Zed> `if currLine.strip.startswith("if") and currLine.endsWith(syntax.if_open):`
05:29:35FromDiscord<Zed> like i want to also check for "else" and "elif"
05:31:13FromDiscord<Rika> what
05:31:16FromDiscord<Rika> nest themn
05:31:27FromDiscord<Rika> if x:↵ if x:↵ else:↵else:
05:31:28FromDiscord<Rika> etc
05:31:57FromDiscord<Zed> so theres no way for it to like check them all at once?
05:32:44FromDiscord<Rika> it doesnt do that even if you use an `and`
05:33:14FromDiscord<Rika> an `and` is just a nested if statement if you think hard about it
05:35:30FromDiscord<Zed> yeah, nesting works but it's not exactly pretty
05:35:40FromDiscord<Zed> ah well
05:36:24FromDiscord<Rika> neither is a convoluted way to specify what portion of the `if` statement the `else` statement refers to
05:37:04FromDiscord<Rika> you can use a "quick return" style if statement instead
05:37:48FromDiscord<Rika> `if not currLine.strip.startswith("if"): do else stuff and return` then another line with `if not currLine.endsWith(syntax.if_open): do else stuff and return`
05:38:01FromDiscord<Rika> then the total if contents go below these two statements
05:38:34FromDiscord<Rika> sent a code paste, see http://ix.io/2pKa
05:39:11FromDiscord<Rika> sent a code paste, see http://ix.io/2pKb
05:39:27FromDiscord<Rika> can look cleaner kinda
05:39:34FromDiscord<Rika> this only applies if the else stuff returns
05:39:46FromDiscord<Rika> or stops or something
05:44:10FromDiscord<Zed> i ended up just implementing a proc that will loop through an openarray and returns true is there is a match else false
05:44:27FromDiscord<Zed> i always forget about the not and do keywords
05:45:19FromDiscord<Rika> i dont mean the do keyword on the thing btwe
05:45:35FromDiscord<Zed> yeah i know
05:46:00FromDiscord<Zed> but i read code on github and just see the do keyword and im like "oh yeah that exists"
05:46:22*solitudesf- joined #nim
05:49:07FromGitter<Knaque> Is https://github.com/GaryM-exkage/vscode-nim-alt worth switching to from the standard Nim extension?
05:49:14*solitudesf quit (Ping timeout: 260 seconds)
05:49:26FromGitter<Knaque> In its current state, at least.
05:52:22FromDiscord<Rika> its pretty ok
05:53:24FromDiscord<Elegant Beef> I use it, but im also gary's friend so
05:54:06FromGitter<Knaque> Is it at all meaningfully better?
05:54:19FromDiscord<Elegant Beef> If you like better highlighted code
05:55:27FromDiscord<Elegant Beef> It only changes the highlighting regex
05:56:28FromGitter<Knaque> I'll take that. Does it seem like it's being improved more frequently?
05:58:36FromDiscord<Rika> kindabutnotrly
05:58:43FromDiscord<Elegant Beef> Weirdly i cant even install the official atm
05:59:03FromDiscord<Elegant Beef> But it's just better syntax, i assume gary will update if any meaningful update comes out of the official
05:59:08FromDiscord<Elegant Beef> Since it's just regex differences
05:59:28FromGitter<Knaque> I mean, it does seem to have more and more recent commits.
06:02:03FromGitter<Knaque> I'll use the alt and just keep an eye on the two of them.
06:02:13FromDiscord<Elegant Beef> It's literally just regex changes so if you like it and the modern one changes you can always easily bring the changes over
06:20:28*solitudesf- quit (Remote host closed the connection)
06:20:56*solitudesf- joined #nim
06:25:40*NimBot joined #nim
06:42:10*solitudesf- is now known as solitudesf
06:47:07FromDiscord<Zed> hey PMunch, any chance you can test nim_braces on some actual code?
06:48:50FromDiscord<Zed> has anyone used the prologue web framework?
06:52:02FromDiscord<Zed> sorry I mean Prestige ^
06:55:27PrestigeSorry, trying to learn a new keyboard layout atm so I haven't been programming
06:58:06FromDiscord<Zed> No Problem, just when you get a chance, just trying to get some speed tests on larger files
06:58:16FromDiscord<Rika> whys everyone moving to dvorak/coleman lmao
06:58:33FromDiscord<Zed> it's meant to be better for programmers
06:58:38FromDiscord<Zed> i dont know
06:58:53FromDiscord<Zed> easier then qwerty
06:59:26FromDiscord<Rika> i dont really have an issue with qwerty tho
07:00:24FromDiscord<Zed> neither
07:00:35FromDiscord<Varriount> @Zed Your name is going to make all the IRC users mad
07:01:10PrestigeI started having really bad finger pain so I switched
07:01:13FromDiscord<Zed> why?
07:01:25FromDiscord<Rika> its not
07:01:28FromDiscord<Rika> nickname is not used
07:01:39FromDiscord<Varriount> Ah, ok
07:02:21FromDiscord<Varriount> Anyone looked at the recent PR for first class symbols?
07:05:51ZevvPrestige: keep at it dude, be strong
07:05:58Zevvi tried 4 times and i failed
07:06:15Zevvthen my wife decided she might as well give it a try
07:06:24Zevvand switched in under two weeks to over her old typing speed
07:06:32ZevvI'm not mad at all
07:08:01PrestigeI'm extremely hard headed, I'll stick to it
07:08:21*narimiran joined #nim
07:09:53Zevvcool!
07:11:50*oprypin quit (Quit: Bye)
07:11:58*oprypin joined #nim
07:12:28*tefter joined #nim
07:12:41*vicfred quit (Quit: Leaving)
07:16:46narimiranNim discussion on HN: https://news.ycombinator.com/item?id=23585006
07:32:20*clemens3 quit (Quit: reboot)
07:35:05*Romanson quit (Quit: Connection closed for inactivity)
07:40:54*brainbomb joined #nim
07:48:36*Vladar joined #nim
07:51:28*oddp quit (Ping timeout: 246 seconds)
08:00:09*kaletaa quit (Read error: Connection reset by peer)
08:00:34AraqZevv: https://github.com/zevv/nimcsp is this the latest repo?
08:10:41*clemens3 joined #nim
08:34:25*waleee-cl joined #nim
08:34:41FromDiscord<Shucks> any cool one liner to get every second item from a array into a new array?
08:34:55FromDiscord<Shucks> could be a seq aswell
08:35:27FromDiscord<Rika> what do you mean
08:35:51FromDiscord<Shucks> [1, 0, 2, 0, 3] == [1, 2, 3]
08:36:01FromDiscord<Rika> oh every odd item
08:36:05FromDiscord<Rika> *even index
08:37:00FromDiscord<Rika> `toSeq(theSeq.pairs).filterIt(it[0] % 2 == 0)`
08:37:12FromDiscord<Rika> needs `import sequtils
08:37:13FromDiscord<Rika> (edit) 'sequtils' => 'sequtils`'
08:37:14FromDiscord<Rika> i think
08:37:22FromDiscord<Rika> not sure if that works actually but it should be easy to fix
08:37:37FromDiscord<Rika> oh oh oh i see whats wrong
08:37:49FromDiscord<Rika> `toSeq(theSeq.pairs).filterIt(it[0] % 2 == 0).mapIt(it[1])` i think
08:37:57FromDiscord<Rika> well, this isnt as efficient as you could be
08:39:54FromDiscord<Shucks> looks good, i guess `%` should be `mod` right
08:40:04FromDiscord<Rika> oops lmao
08:40:25FromDiscord<Rika> i dont use mod often enough to remember that it is no longer % but mod
08:40:32FromDiscord<Shucks> ^.^
08:41:44*nsf joined #nim
08:59:12*chemist69 quit (Ping timeout: 260 seconds)
09:00:12*chemist69 joined #nim
09:03:52*drewr quit (Ping timeout: 260 seconds)
09:04:09*neceve_ joined #nim
09:05:53*drewr joined #nim
09:06:06Araqok, time to try https://github.com/GaryM-exkage/vscode-nim-alt
09:09:04Araqyay! finally 'case of' is highlighted correctly
09:09:20FromDiscord<Gary M> Hello Araq 🙂
09:09:43Araqthanks for the plugin! you gave an old man hope
09:10:23FromDiscord<Elegant Beef> Love that you
09:10:32FromDiscord<Elegant Beef> 're only a few months off
09:10:37FromDiscord<Elegant Beef> That hope must've been fading
09:10:56FromDiscord<Gary M> Sure thing, let me know if you find anything out of place
09:11:46FromDiscord<Gary M> When I have abundant spare time I'll try to rewrite the nimsuggest side of it too
09:12:48Araqoh yeah please ... could make it a bounty if that helps
09:18:20*qn68h joined #nim
09:18:53FromDiscord<Gary M> I wouldn't oppose that offer.
09:18:56qn68hhi again
09:19:02FromDiscord<Elegant Beef> Hello
09:19:14qn68hsince the yesterday discussion about OOP:
09:19:31*l1pz joined #nim
09:20:09qn68hnim transpiles (or compiles i don't know the right wording) to c / c++. So wouldn't it be straightforward to have c++/python-style classes with classic __init__ ?
09:20:24PrestigeZevv: are you still interested in learning it?
09:20:41qn68hwouldn't it be a feature nearly out-of-the-box?
09:20:56qn68hto add to nim? (c++/python style OOP)
09:21:17FromDiscord<Elegant Beef> What's the benefit of init in python?
09:21:45*l1pz quit (Client Quit)
09:22:30*l1pz joined #nim
09:24:21qn68hElegantBeef, beauty / clarity / structure of code. Even if you don't read the code precisely, you see the structure by analyzing the layout of code: https://paste.ee/p/Hw4EF
09:24:29*l1pz quit (Client Quit)
09:24:37FromDiscord<Elegant Beef> But nim doesnt have that layout
09:24:49FromDiscord<Elegant Beef> Nim doesnt have procedures defined inside objects
09:25:03FromDiscord<Elegant Beef> They're defined in the module at indent level 0
09:25:07qn68hElegantBeef, everything is contained in its class, there is nothing flying out of the classes
09:25:33narimiranone day i'll make my mission to go to other languages and try to convince them they should be more like some other language
09:25:34FromDiscord<Elegant Beef> Nim doesnt have that, you could make a macro that adds a parameter to the start of `self` to emulate that
09:25:37FromDiscord<Elegant Beef> but it's quite moot
09:25:42narimiranhey Guido, add { and }, pronto!!
09:25:47FromDiscord<Elegant Beef> Python is not nim an nim isnt python
09:26:13qn68hnarimiran, sorry for sounding like this
09:26:32qn68hbut coming from Python or coming from C++, many people expect this
09:26:36narimiranqn68h: the thing is: we hear it very very often
09:26:48narimiranqn68h: i'm coming from python and i don't expect it
09:26:48qn68hnarimiran, then probably it's what people want
09:27:08qn68hit's not only python, it's also c++ and many other lang who do the same
09:27:10narimiranqn68h: nah, it is just people who haven't used nim long enough
09:27:13*clemens3 quit (Read error: Connection reset by peer)
09:27:20FromDiscord<Elegant Beef> I mean nim doesnt even have classes
09:27:31narimiraninb4 cHanGe imPorTs!!!!1!1!
09:27:34qn68hElegantBeef, would it be a problem to add them?
09:27:36FromDiscord<Elegant Beef> Im fairly certain the `ref object` is still a struct, even in C++
09:27:47FromDiscord<Elegant Beef> Well cause it doesnt need them, yes
09:28:09FromDiscord<Elegant Beef> But im not a contributor or core member so idk
09:28:12narimirano_h bTw s_tyL_e_InseNsiTivitY
09:28:20FromDiscord<Elegant Beef> We have UFCS and methods
09:28:23FromDiscord<Elegant Beef> OOP is in here
09:28:29FromDiscord<Elegant Beef> Just not a way you are used to
09:28:41FromDiscord<Elegant Beef> You're used to a java/C#/python/C++ OOP
09:28:45FromDiscord<Elegant Beef> Different isnt worse
09:28:46qn68hnarimiran, I've used many lang in the past decades, and what people want when starting a new lang is to *not* have a difficult learning curve; when something is good in lang a+b+c+d+e why not reusing it?
09:29:01FromDiscord<Elegant Beef> Cause this isnt ABCDE
09:29:10FromDiscord<mratsim> I can't believe no one talked about Rust or imports or significant whitespaces or the lenient-case of Nim identifier in the Hacker News thread.
09:29:14FromDiscord<Elegant Beef> This is a different language, it doesnt suite this languages syntax
09:29:17narimiranqn68h: why would anybody use a new language if it is the same as old ones?
09:29:25*l1pz joined #nim
09:29:30FromDiscord<Elegant Beef> That's suprising mratsim
09:29:32narimiran@mratsim: ...yet :D
09:29:37FromDiscord<Elegant Beef> Any qualified imports?
09:29:43FromDiscord<mratsim> no
09:29:53FromDiscord<mratsim> it's about, use in production, not nil, performance
09:30:00qn68hnarimiran, it's good to invent new things at useful places, but for classes, is it really needed?
09:30:04*dddddd joined #nim
09:30:09qn68hi quote the Nim home page: "It combines successful concepts from mature languages like Python, Ada and Modula."
09:30:30narimiranqn68h: and i quote myself: "it is just people who haven't used nim long enough"
09:30:31qn68hC++/java+/Python/many-other-land OOP is really one major successful concept,
09:30:37FromDiscord<mratsim> Classes? just use variants :p
09:31:00FromDiscord<Elegant Beef> Yea
09:31:17FromDiscord<Elegant Beef> We have OOP/inheritance but it's typically avoided by most profcient nim users
09:31:20FromDiscord<mratsim> OOP is not compatible with multithreading
09:31:20narimiranqn68h: i also didn't like some nim things when i was fresh from python, but when you start seriously using nim you see why the things are the way they are
09:31:21qn68hnarimiran, this is the point. probably lots of people "won't use nim long enough" because they will think "it takes too much time to learn it, they reinvented OOp in a different manner and i don't have time for that"
09:31:23FromDiscord<Elegant Beef> Not that im proficient
09:31:29qn68hand they will give up
09:31:31FromDiscord<Elegant Beef> Ok cool
09:31:42FromDiscord<Elegant Beef> People stop using languages all the time for whatever reason
09:31:42qn68hfor traction/adoption of the lang, it's sad the classic OOP isn't there
09:31:46FromDiscord<mratsim> Give up OOP, it's not compatible with multithreading
09:31:47narimiranqn68h: yesterday i heard in NimConf "nim is for everything, but maybe not for everybody"
09:31:49FromDiscord<Elegant Beef> if the language isnt for you dont attempt to make it for oyu
09:31:50*l1pz quit (Client Quit)
09:32:02FromDiscord<Elegant Beef> Cause all you're going to do is make a language you already have
09:32:19FromDiscord<Elegant Beef> Take features that improve the language and implement it, but dont expect it to be 1:1 to anything else
09:32:27qn68hI don't except 1:1
09:32:36FromDiscord<Elegant Beef> As i said you can use a macro to add that self parameter
09:32:39FromDiscord<Elegant Beef> So then it's like it's there
09:33:03FromDiscord<mratsim> and you can reimplement OOP has macros on top of variants: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/support/emulate_classes_with_ADTs.nim
09:33:09qn68hbut my point is: i've looked at a lots of things in nim already, and I was really amazed and happy. I sent mails to friends saying it seems the cool new language to start to use!
09:33:28qn68huntil one exception: "why reinvent the OOP wheel in a different uncommon manner?"
09:33:36FromDiscord<Elegant Beef> You can do that
09:33:36FromDiscord<Elegant Beef> sent a code paste, see http://ix.io/2pLe
09:33:51qn68hi'm not saying everything should be different, and so far, nim looks great on every point
09:33:54FromDiscord<Elegant Beef> Make a macro that does that to all of it's passed parameters
09:33:55qn68hexcept this,
09:33:57FromDiscord<mratsim> Explicit is better than implicit
09:34:07FromDiscord<mratsim> implicit self/this is error prone
09:34:10FromDiscord<Elegant Beef> I agree there but if they must
09:34:16narimiranhttps://nim-lang.github.io/Nim/tut2.html#object-oriented-programming
09:34:31narimiranqn68h: ^
09:34:43FromDiscord<Elegant Beef> Im basically just stating the macro system makes it possible so if you want it so badly you can make a system that mirrors it
09:34:44FromDiscord<mratsim> Rust also doesn't have those OOP implicit things in their functions
09:34:48qn68hnarimiran, yes i read that and followed the tutorial yesterday
09:36:14qn68hwell it's just my 2 cents
09:36:25FromDiscord<Elegant Beef> I mean it can be done in many ways
09:36:30FromDiscord<Elegant Beef> You can use a `block:`
09:36:34FromDiscord<Elegant Beef> or whatever
09:36:41qn68hand maybe I'll just be another who gives up because the balance benefit/time spent is not enough
09:36:50FromDiscord<Elegant Beef> Well buh bye
09:36:54qn68hand this would confirm your "nim is for everything, but maybe not for everybody"
09:37:01FromDiscord<Elegant Beef> Well it's a weird issue
09:37:08FromDiscord<Elegant Beef> *I want muh format*
09:37:14FromDiscord<Elegant Beef> But we have UFCS so that doesnt matter
09:37:34FromDiscord<Elegant Beef> You can literally make a proc anywhere and it's treated as if it was a class member in any other language
09:38:46qn68hreally sorry to sound like this, i really wish the best for the lang, and am still very enthusiastic and will start using it a few weeks to see if it fits my needs
09:39:01qn68hbut you said it before:
09:39:03qn68h<narimiran> qn68h: the thing is: we hear it very very often
09:39:25qn68hthis might be a signal that people expect a cool language like nim BUT with classic-style OOP
09:39:53qn68honce again i don't want to be the guy "hello i'm new please change this and that in your lang"
09:40:09narimiranqn68h: this might be a signal that people expect nim to be python/c++/whatever
09:40:18qn68hi just give my feeling since i've used many lang in the past decades and i read a lot about new languages and what people expect
09:40:38*Zectbumo quit (Remote host closed the connection)
09:40:41narimirandid python change whitespace to braces because people "expect a cool language"?
09:40:56FromDiscord<mratsim> But what you're talking about is only the syntax of OOP, it's just a look-and-feel not familiar thing
09:41:27qn68hmratsim look-and-feel really matters
09:41:53FromDiscord<mratsim> Well, I absolutely hate C++ implicit field access in classes, and same thing for python implicit self
09:41:54FromDiscord<Elegant Beef> But whose look and feel is objectively better
09:42:14qn68hyears after years i notice that it's important to see structure in the code even by layout at the layout, and here it's good, it would be the same on C++: https://paste.ee/p/Hw4EF
09:42:15FromDiscord<mratsim> in particular the C++ way leads to symbol conflict and bugs
09:42:56*clemens3 joined #nim
09:43:06qn68hthe fact that everything is grouped nicely/nested is what people expect, the layout already tells something about the code
09:43:09FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2pLh
09:43:20FromDiscord<Elegant Beef> Without changing anything
09:43:22FromDiscord<mratsim> https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/physics/hittables/hittables_lists.nim#L14-L55
09:43:27FromDiscord<Shucks> Correct me if im wrong. But isn't go just doing the same with their structs? There are no real classes.
09:43:37FromDiscord<Elegant Beef> No clue
09:43:54FromDiscord<mratsim> My code is clear about mutable/dangerous proc and the rest
09:43:58ZevvPrestige: no, I don't think so. My wife is a translator, and for her it makes perfect sense; I was able to type regular language after a week or two as well. But my muscle memory is hard to defat. Tens of passwords I don't even know anymore but type often, all these shortcuts. And when I'm panicing during accidental `rm -rf` I'm sitting there hysterically hitting ^K ^K ^K ^K and nothing happens...
09:44:57Zevvoh, ^J ^J ^J it is
09:45:02Prestigeah
09:45:23PrestigeWhat language btw?
09:45:56FromDiscord<mratsim> also when Nim was created it had multiple dispatch, you can't structure code that way if it's used from 2 classes
09:45:59*nikita` joined #nim
09:47:04ZevvPrestige: nl -> en, mostly
09:47:50PrestigeCool stuff
09:48:21qn68hElegantBeef, has there been pull requests / github issues / proposals on the contributors website about different OOP?
09:48:32qn68hI'm probably not the first one to ask this question ;)
09:48:56FromDiscord<mratsim> well yes, multidispatch was removed and there are discussion to use VTable
09:49:09FromDiscord<mratsim> also implicit self was removed
09:49:23FromDiscord<mratsim> and "use" was introduce so that people don't have to put the types every single time
09:49:39FromDiscord<mratsim> or using sorry
09:49:54qn68hand (maybe rejected) pull requests about classic-style OOP?
09:50:03FromDiscord<mratsim> See: https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement
09:50:15FromDiscord<mratsim> no, those go to RFC
09:50:42qn68hoh ok
09:50:46FromDiscord<mratsim> Nim has a strong preference of explicit over implicit
09:50:48FromDiscord<Shucks> `https://golangbot.com/structs-instead-of-classes/`
09:51:01qn68hhas there been a RFC about that (differnt style oop)?
09:51:12FromDiscord<mratsim> implicit arguments (self/this/field access) would be quite strange in the language
09:51:52FromDiscord<mratsim> only newcomers care about OOP in Nim, most people don't use it except in their first few projects
09:52:02FromDiscord<mratsim> (or functional programming)
09:52:36FromDiscord<mratsim> In terms of philosophy, Nim is nearer to C (structured programming) than Python or C++
09:53:01FromDiscord<lqdev> qn68h: fyi this simple object model can be turned into classes by using macros: https://nim-by-example.github.io/macros/
09:54:03FromDiscord<lqdev> also I agree with mratsim, explicit > implicit
09:54:26*krux02 joined #nim
09:54:34qn68hthanks lqdev for this link, seems interesting with a macro
09:55:04qn68hso you can nearly "customize" your use of the lang with macros?
09:55:22*suchasurge joined #nim
09:55:26FromDiscord<lqdev> yes, pretty much
09:55:41qn68hnice, i'll read this deeply
09:56:16FromDiscord<lqdev> they're really flexible because you can turn some AST into some other AST, so anything that Nim can parse can be read by a macro
09:56:19qn68hlast thing: is this macro that "transforms" classic-OOP into nim-oop available out of the box by importing something?
09:56:35FromDiscord<lqdev> no, I don't think so
09:56:41FromDiscord<lqdev> there may be a package
09:56:47FromDiscord<lqdev> on Nimble
09:57:00qn68hthen it would be interesting to have an import with the code after "To get that nice notation, we can use a macro:
09:57:00qn68h", ready to use
09:57:17qn68hso then, when annoying people like me come and whine "why is there no classic OOP", you can just link to that :)
09:57:35qn68h!python-oop-to-nim-oop-converter
09:57:42qn68hor even trigger this ^ ;)
09:59:01qn68hI think most people who ask this question like me would be happy with the code written in https://nim-by-example.github.io/macros/ after "Something like this would be nice:"
09:59:51qn68hif we could write like this and do "import oop" that would automatically run this macro, I'm sold :)
10:01:00narimiranqn68h: this can be your first nim project
10:01:29narimiranand by the time you finish writing it, you'll realize "classic OOP" is really not that important in nim as you initally thought ;)
10:01:40narimiranwin-win
10:01:47*l1pz joined #nim
10:01:51*l1pz quit (Client Quit)
10:03:20*l1pz joined #nim
10:03:22*l1pz quit (Client Quit)
10:04:07*aeverr quit (Remote host closed the connection)
10:04:33*aeverr joined #nim
10:05:19FromDiscord<Vindaar> there's https://github.com/bluenote10/oop_utils 🙂
10:06:30*narimiran_ joined #nim
10:07:10*l1pz joined #nim
10:07:19*l1pz quit (Client Quit)
10:09:13*l1pz joined #nim
10:09:13*l1pz quit (Client Quit)
10:09:39*l1pz joined #nim
10:09:39*l1pz quit (Client Quit)
10:09:43*narimiran quit (Ping timeout: 246 seconds)
10:10:29*l1pz joined #nim
10:10:41*l1pz quit (Client Quit)
10:13:36*narimiran_ is now known as narimiran
10:14:06*l1pz joined #nim
10:14:30*l1pz quit (Client Quit)
10:15:30*l1pz joined #nim
10:18:55*vegai joined #nim
10:21:05*lritter joined #nim
10:28:03*Trustable joined #nim
10:36:05*l1pz quit (Quit: Lost terminal)
10:36:29qn68hnarimiran, good idea :)
10:39:21*qn68h quit (Quit: Leaving)
10:39:44*nsf quit (Quit: WeeChat 2.8)
10:53:28*NimBot joined #nim
11:02:54FromDiscord<kodkuce> @treeform nice talk, i too hate how UI are done this days, it tryed glade but it suxed
11:06:17*nsf joined #nim
11:09:33*NimBot joined #nim
11:14:05*waleee-cl quit (Quit: Connection closed for inactivity)
11:21:58*NimBot joined #nim
11:28:33FromDiscord<Skaruts> what does `^1` do in something like `foo[^1]`?
11:28:49FromDiscord<Skaruts> saw it here: <https://github.com/treeform/fidget/blob/master/src/fidget.nim#L70>
11:28:59narimiranindex from the back
11:29:06narimiranlike python's -1
11:29:09FromDiscord<Skaruts> ah
11:29:18FromDiscord<Skaruts> so in that case it's the last item?
11:29:23FromDiscord<Rika> yes
11:29:45FromDiscord<Skaruts> so I guess I could also do ^2, ^3, etc
11:30:00FromDiscord<lqdev> indeed
11:30:02FromDiscord<Skaruts> nice, thanks
11:32:16FromDiscord<Skaruts> btw, I've been meaning to ask this, is there a difference between using spaces in `0 .. 10` instead of `0..10`?
11:32:33narimiranno difference
11:32:43FromDiscord<Rika> preference
11:32:44FromDiscord<Skaruts> I saw Araq mentioning something like this one time, I think it was about ranges, but it could be something else...
11:32:52narimiranbut just beware when you use `..<` to not put space between `..` and `<`
11:33:47FromDiscord<Rika> `0 ..< 2` is preferred but `0 .. ^1` is preferred, kinda confusing imo but it makes some sense
11:34:09FromDiscord<Skaruts> hmm..
11:34:22FromDiscord<Skaruts> it does make sense yea
11:35:15FromDiscord<Skaruts> maybe I got the wrong impression then, from what Araq said
11:35:18FromDiscord<Skaruts> thanks
11:35:46*synthmeat joined #nim
11:36:26*synthmeat quit (Quit: WeeChat 2.8)
11:36:50*synthmeat joined #nim
11:42:08*oddp joined #nim
11:55:34*silvernode joined #nim
12:00:49*bung quit (Ping timeout: 264 seconds)
12:00:57FromDiscord<Shucks> Would love if some of you experienced nim coders would take a look into https://github.com/Sann0/Nimem and let me know if im doing something terrible wrong 🙂
12:03:26FromDiscord<Rika> that demo though hahaha
12:04:04FromDiscord<Shucks> ^.^
12:04:35FromDiscord<Shucks> your oneliner was needed in that example btw
12:05:06FromDiscord<Rika> its not terribly efficient
12:05:18FromDiscord<Rika> there are >1 liners that are more efficient
12:05:33FromDiscord<Shucks> well it works, its fine. Noone will ever use it lol
12:05:48FromDiscord<Rika> makes me think of an idea
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:08FromDiscord<Rika> new iterutils lib it is i guess....
12:06:37*supakeen joined #nim
12:08:04*bung joined #nim
12:10:02FromDiscord<Shucks> sounds fancy
12:13:14narimirannew iterutils?
12:13:38*dsrw joined #nim
12:13:56*neceve_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
12:14:08narimirani feel personally offended! https://github.com/narimiran/itertools
12:14:10FromDiscord<Rika> dunno
12:14:13FromDiscord<Rika> i mean
12:14:20FromDiscord<Rika> instead of operating on seqs...
12:14:28FromDiscord<Rika> maybe operate on closure iters
12:14:30FromDiscord<Rika> no clue tbh
12:14:36FromDiscord<Rika> i'm still thinking if its a good idea
12:16:05*Trustable quit (Remote host closed the connection)
12:19:32*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:21:34*dsrw joined #nim
12:21:37chemist69Rika: there is also: https://github.com/zero-functional/zero-functional
12:23:03FromDiscord<Rika> yeah but i kinda dont want a dsl for my iterator tools
12:24:45FromDiscord<InventorMatt> I am trying to create a template for starting and connecting to a server so that I can easily wrap the proc I need with some boiler plate.
12:24:53FromDiscord<InventorMatt> however I am having problems because the template needs the async pragma for the awaits to work but when I attach it to the template
12:25:00FromDiscord<InventorMatt> I get an error saying I cannot attach a custom template to the pragma I made
12:25:07FromDiscord<InventorMatt> here is the code for it https://play.nim-lang.org/#ix=2pLS
12:25:23FromDiscord<Rika> you cant use await within a template so yeah
12:25:32FromDiscord<Rika> basically outta luck there, gotta be a proc
12:26:47FromDiscord<InventorMatt> I would have thought there would have been another way. thanks anyways
12:27:07*vikfret joined #nim
12:27:51FromDiscord<Rika> theres an rfc? i think
12:27:53FromDiscord<Rika> for fixing this
12:28:19FromDiscord<Rika> basically making await a template instead of dsl in async or something
12:28:32FromDiscord<Rika> @InventorMatt oh idea
12:28:44FromDiscord<Rika> but you need to tell me if pubsub encapsulates the whole proc first
12:28:50*krux02 quit (Quit: Leaving)
12:29:03FromDiscord<Rika> if it does, you can make pubsub a macro instead i think
12:30:00FromDiscord<InventorMatt> yes, it should
12:30:12FromDiscord<Rika> ok gimme a moment
12:34:47FromDiscord<Rika> @InventorMatt https://play.nim-lang.org/#ix=2pLY
12:34:50FromDiscord<Rika> this should work
12:36:45*brainbomb1 joined #nim
12:38:48FromDiscord<InventorMatt> that is working so far. thanks so much
12:38:51*brainbomb quit (Ping timeout: 272 seconds)
12:53:26*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:25:23*MTRNord[m] joined #nim
13:38:36FromDiscord<Rika> hm, just rewatched the erlang video in computerphile, wonder if it is a good idea implementing some sort of pragma-macro for similar (runtime) checks that arent limited to just `range[M, N]`s
13:40:58*testnimnoob quit (Remote host closed the connection)
14:22:08*tane joined #nim
14:45:01*brainbomb1 quit (Quit: Leaving.)
14:46:41FromDiscord<Rika> eh, decided it was pretty dumb
14:47:16FromDiscord<demotomohiro> I tried to use Nim's Embedded Stack Trace Profiler but I got no result.↵There is only 1 line of text in profile_results.txt.↵https://play.nim-lang.org/#ix=2pMz
14:48:16FromDiscord<Synth> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724274490548420618
14:50:09FromDiscord<demotomohiro> You can do forward declaration.
14:50:10FromDiscord<demotomohiro> forward declaration
14:50:15FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#procedures
14:50:40FromDiscord<Synth> Thank you!
14:50:42FromDiscord<demotomohiro> Just dont write `=` and proc body
14:51:22FromDiscord<Synth> Thank you!
14:52:01FromDiscord<Rika> @demotomohiro because most procs arent run enough to be counted as "worth profiling" i assume
14:52:36FromDiscord<Rika> tested with a for loop 0..9999 instead of 0..9 and there are now lines in the profiler output
14:54:43FromDiscord<Rika> no clue how to force it to log more
14:54:47FromDiscord<demotomohiro> @Rika Thank you! you are right, I can get result with 1000 loop count.
15:01:31FromDiscord<demotomohiro> I wanted to profiling code that call few C functions but one of them takes few seconds.
15:03:20FromDiscord<demotomohiro> Maybe ESTP doesn't work well in that case.
15:04:22FromGitter<Julioevm> Hi everyone
15:05:14FromDiscord<Rika> @demotomohiro then i would recommend using Intel VTune or AMD uProf depending on your CPU
15:05:19FromGitter<Julioevm> this might be a silly question, but I'm trying to do varY = varX =+1 and Im getting has no type or is ambiguous
15:05:21FromGitter<Julioevm> both vars are ints
15:05:24FromDiscord<Rika> that might give more information
15:05:27FromGitter<Julioevm> what am I missing?
15:05:39*vsantana joined #nim
15:05:45FromGitter<Julioevm> sorry += 1
15:05:53FromDiscord<Rika> afaik you must do that separately
15:06:11narimiranthink about what `varx += 1` really does, and what is its return value
15:06:46FromDiscord<Rika> also yeah that's vague
15:06:51FromDiscord<Rika> are you adding 1 to each var
15:06:56narimiranno, it is not vague
15:07:00FromGitter<Julioevm> it doesnt return anything I guess
15:07:01FromDiscord<Rika> or only to varX and setting the result to varY
15:07:04narimiranit is quite straight forward
15:07:05FromDiscord<Rika> if it were to work, i mean
15:07:18narimiranyep, you guessed correctly
15:07:21FromDiscord<demotomohiro> @Rika Thank you! I wrote few code that measure time as my code is not long.
15:07:22*vsantana quit (Client Quit)
15:08:05FromGitter<Julioevm> gotcha
15:08:05FromDiscord<Rika> though personally, i havent understood how amd uprof worked
15:08:12FromDiscord<Rika> you might have more luck than me
15:09:17FromDiscord<Shucks> sent a code paste, see http://ix.io/2pMG
15:09:27FromDiscord<demotomohiro> Long time ago, I used some AMD's profiler on Intel CPU and it worked.
15:09:36FromDiscord<Shucks> im surprised that this works. How lol
15:09:38FromDiscord<Rika> @Shucks that's scary stuff you're doing
15:10:00FromGitter<machineko> Hello guys did i need to install openssl on windows to use https requests in httpclient? (I wanna to ship executable for clients and cant test it right now)
15:10:23FromDiscord<Rika> no
15:10:33FromDiscord<Rika> i dont think you need to
15:12:25FromDiscord<demotomohiro> machineko, you get dlls you needs from https://nim-lang.org/install_windows.html
15:13:15FromGitter<machineko> @demotomohiro ye it'll be working on my machine but what if i wanna send compiled executable for another users and they didnt have nim installed?
15:13:16FromDiscord<demotomohiro> There is a link to dll.zip in `Other dependencies` section.
15:13:47FromDiscord<Rika> maybe try out bearssl or something if you want a static binary
15:14:07FromDiscord<Rika> or you can package the dll with the binary
15:14:57FromDiscord<demotomohiro> I think just put dll files in dll.zip in the same directory that containing your executable will be fine.
15:15:14FromGitter<machineko> K thanks guys ill try it :)
15:15:51FromDiscord<Rika> yeah i'd recommend packaging the dll with the binary instead of using bearssl since this is crypto stuff and being weird with crypto is very risky i think
15:16:56*Senny joined #nim
15:18:01FromGitter<machineko> Kk thanks ill try pack it like that first :P
15:18:14FromGitter<machineko> Never done stuff like this thats why i'm asking :)
15:21:12*drdee joined #nim
15:21:46FromDiscord<juan_carlos> https://github.com/juancarlospaco/nimscript4python#nimscript4python
15:24:37*dr-dd joined #nim
15:24:40*dr-dd quit (Remote host closed the connection)
15:27:42FromDiscord<j$> is explicit type casting any more expensive than implicit?
15:29:33FromDiscord<j$> actually, I mean is type casting more expensive than type conversion
15:29:46FromDiscord<Generic> no
15:30:05FromDiscord<Generic> the cost of casting can vary extremely
15:30:46FromDiscord<Generic> for example on cpu's getting the raw value of a float can be expensive
15:30:58FromDiscord<Generic> while on other's it's a moderate cost
15:31:21FromDiscord<j$> but that is the same for conversions, right?
15:32:02FromDiscord<Generic> it just does sometimes different things, which can have different costs
15:32:15FromDiscord<Generic> though in Nim you can be sure that atleast all conversions done implicitely
15:32:17FromDiscord<Generic> are cheap
15:32:26FromDiscord<Generic> like conversions from a small integer to a larger integer
15:34:30FromDiscord<Generic> do you have any concrete problem?
15:35:49FromDiscord<j$> not a really a problem, I'm doing opengl stuff using distinct types and am casting and I was curious
15:36:26FromDiscord<Generic> casting a distinct type to it's underlying type is always free
15:36:56FromDiscord<Generic> because the "distinctness" exists only for us humans
15:37:26FromDiscord<j$> right, I assumed so,
15:37:34FromDiscord<j$> just wanted to dbl check
15:38:23*NimBot joined #nim
15:38:24FromDiscord<j$> and the same for ptrs, right?
15:38:44FromDiscord<Generic> yes
15:39:23FromDiscord<j$> thanks
15:40:42FromDiscord<KrispPurg> Is there a reason why when I make an async http request when I await for the body and the data is like super huge like 1010 lines in pretty json format, it does not respond with any data? I haven't upgraded my Nim version yet which is Nim v1.2.0
15:57:31*waleee-cl joined #nim
15:59:25*narimiran quit (Quit: leaving)
15:59:56federico3Araq: can I suggest clarifying if defer is part of 1.0 or not in your initial comment on https://github.com/nim-lang/RFCs/issues/236 ?
15:59:57disbotDeprecate the 'defer' statement ; snippet at 12https://play.nim-lang.org/#ix=2pwd
17:04:51FromDiscord<Balu> is the nim package for the atom editor broken? or is anyone using that successfully?
17:13:01*drdee quit (Remote host closed the connection)
17:14:05*hzx joined #nim
17:15:50hzxHey! I ran into this bug today: https://github.com/nim-lang/zip/issues/45 How long does it usually take to repair a bug like this at Nim? This one was reported a year ago.
17:15:52disbotaddFile StringStream fails on Windows ; snippet at 12https://play.nim-lang.org/#ix=2pNk
17:17:54*silvernode quit (Ping timeout: 240 seconds)
17:18:01*silvernode joined #nim
17:19:44FromDiscord<KrispPurg> Update: There was an ssl nil access error and I used segfaults without noticing
17:19:59*silvernode quit (Client Quit)
17:35:47*vicfred joined #nim
17:38:00zedeushey @treeform
17:40:01FromDiscord<treeform> hey @Zedeus
17:40:15FromDiscord<treeform> (edit) '@Zedeus' => 'zedeus'
17:40:47zedeusI'm having trouble running the fidget examples on Linux
17:40:51zedeushttp://ix.io/2pNq
17:41:15zedeuscompiled with nim devel and fidget #head, the window flashes for a split second then this error is printed
17:41:29zedeustried on two linux installs, both running up to date graphical drivers etc
17:41:37FromDiscord<treeform> So its not my error. Looks like Linux internal stuff.
17:41:46FromDiscord<treeform> What max openGL version do you get with glxinfo ?
17:42:12zedeus4.6.0
17:42:40zedeusfails both with nvidia and intel igpu
17:43:41FromDiscord<treeform> Can you open a window with just static glfw? https://github.com/treeform/staticglfw
17:44:09zedeussame error
17:44:16zedeusred window flashes quickly
17:45:17FromDiscord<treeform> here are some people talking about the error: https://github.com/openframeworks/openFrameworks/issues/2334
17:45:20disbotX error of failed request (openbox based) ; snippet at 12https://play.nim-lang.org/#ix=2pNt
17:47:21FromDiscord<treeform> It looks like this thing might fix it: https://github.com/glfw/glfw/commit/e65de2941c056ee5833b4dab3db36b297b53aa14
17:47:40FromDiscord<treeform> But its not part of staticglfw, will update staticglfw and lets see if it works then.
17:47:48zedeuscool, thank you
17:54:31Zevvp
17:55:31*bolti[m] left #nim ("User left")
18:00:36FromDiscord<treeform> hey so, zedeus I just pushed an update to the https://github.com/treeform/staticglfw . Could you clone the repo down then go into the tests folder and run nim c -r redwindow.nim ?
18:01:23zedeusworks!
18:01:32FromDiscord<treeform> wow really? great
18:01:51FromDiscord<treeform> can you run `nimble develop` in the main folder (cd ..) where the .nimble file is.
18:02:11FromDiscord<treeform> then after that run a fidget sample?
18:02:21zedeusyep works correctly now
18:02:54Araqfederico3, I can add it
18:02:59FromDiscord<treeform> Cool so it was a glfw but "A handle race condition could cause a `BadWindow`"... now fixed!
18:03:18FromDiscord<treeform> I will cut new releases of staticglfw and fidget
18:03:18*hecanjog quit (Ping timeout: 260 seconds)
18:04:25*krux02 joined #nim
18:05:02*hecanjog joined #nim
18:05:17zedeusthanks!
18:12:47*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
18:14:42FromGitter<raydf> Hello everyone, how can i handle signals from my app so it does not crash. I'm receiving a ``` ⏎ "SIGABRT: Abnormal termination." ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5eefa392e6668d35db11da36]
18:15:10FromDiscord<treeform> zedeus, I tagged a new release of fidget (0.4.2) ... no need for `nimble develop` any more.
18:16:56leorize@raydf just override the signal handler as usual
18:17:00leorizebut why do you have to do that?
18:17:22leorizeit's usually discouraged due to how signal-based programming is pretty flawed
18:18:04leorizeI'm actually not even sure if SIGABRT can be handled...
18:21:11FromGitter<raydf> I'm using this wrapper https://github.com/manguluka/duktape-nim
18:21:16leorizelooks like it can but you shouldn't due to what the signal is supposed to do
18:21:40FromGitter<raydf> and when the javascript runtime find an error it crash the main app. Even if i use try catch
18:22:00leorizeSIGABRT is usually used for fatal error
18:22:05leorizeread: you should never handle it
18:22:54FromGitter<raydf> Any ideas on how to create a sandbox for that c library wrapper so the main thread never fails?
18:23:01leorizehttps://duktape.org/guide.html#error-handling
18:23:12leorize^ it details how to handle errors so that it won't crash with SIGABRT
18:23:44leorizeyou can create a sandbox, but you shouldn't
18:25:46leorize> It is strongly recommended to provide a custom fatal error handler.
18:25:50leorizequote from their manual
18:27:33leorizefrom what I can see, if you caught errors early on you should be fine
18:27:44leorizeas for fatal errors, you will need to write a custom handler for those
18:28:21FromGitter<raydf> @leorize thx for the orientation, let me see how can i learn the FFI of nim and nimgen
18:28:59leorizenp :)
18:29:07leorizethat wrapper seems to be pretty old
18:29:16leorizenow the next gen of nimgen is nimterop
18:29:19leorize!repo nimterop
18:29:21disbothttps://github.com/nimterop/nimterop -- 9nimterop: 11Nimterop is a Nim package that aims to make C/C++ interop seamless 15 189⭐ 14🍴 7& 11 more...
18:29:48FromGitter<raydf> nice
18:30:03FromGitter<raydf> let me try to create a new wrapper based on nimterop
18:30:23FromGitter<raydf> is this the correct way to handle signals? https://gist.github.com/dom96/908782
18:31:17leorizesigaction should be used instead as in the comments
18:31:37*hecanjog quit (Quit: WeeChat 2.8)
18:31:40leorizethough I'd recommend not doing signal handling unless it's really necessary
18:32:32leorizefor duktape you can install a simple default handler that's basically: `raise newException(DuktapeError, "message here")` and you should be set for catching fatal errors via try-except
18:33:04leorizeat least that's what I get from reading their manual
18:33:47*hecanjog joined #nim
18:34:28*hecanjog left #nim (#nim)
18:34:41*hecanjog joined #nim
18:35:15FromGitter<raydf> ok, nice, nimterop is amazing :). Let me keep grinding with learning c and nim, this kind of concepts are a little hard for web developers.
18:35:23FromGitter<raydf> thx again
18:36:49leorizeyw :)
18:37:12leorizenimterop's author hang around here as well, so if you have any trouble just ask away :)
18:38:02*bung quit (Ping timeout: 256 seconds)
18:44:08FromDiscord<demotomohiro> If nimgl/imgui's author hang around here, please review this PR.↵https://github.com/nimgl/imgui/pull/3
18:44:09disbotFix compile error when igSetNextWindowPos is called
18:48:21*nsf quit (Quit: WeeChat 2.8)
18:57:05*bung joined #nim
19:01:38*bung quit (Ping timeout: 260 seconds)
19:08:13*drdee joined #nim
19:30:33*bung joined #nim
19:34:28*casaca quit (Remote host closed the connection)
19:35:16*bung quit (Ping timeout: 256 seconds)
19:38:48*casaca joined #nim
20:08:21FromGitter<antonkatz> Hello again! I came around a couple of weeks ago saying that I'd love to give NIM a try, and hey, I just did. Finally found a little project to try it out on.
20:08:38FromGitter<antonkatz> So far I like it, the thing I'm looking for now is reactive programming support and streams
20:08:50FromGitter<antonkatz> And google is not being a very good friend here
20:09:15FromGitter<antonkatz> Almost seems like there isn't much interest in reactive programming from the NIM community
20:10:41FromDiscord<Shucks> could i declare "invisibile" object variables? Not just non public rather not accessible at all?
20:11:12*Senny quit (Ping timeout: 260 seconds)
20:13:35leorizeif it doesn't have a `*` next to it, it's not accessible from other modules
20:14:06leorize@antonkatz yea the interest on reactive programming isn't huge here
20:14:16leorizefor streams we do have a streams module
20:14:48leorizethough I'm not even sure what "reactive programming" is
20:15:43FromDiscord<Shucks> Yea I know. Since I'm messing around with memories I got pad arrays in my objects which don't have any function. So I wan't to make them truly hidden
20:15:56FromDiscord<Shucks> (edit) 'memories' => 'process memory'
20:16:52leorizeshouldn't the `{.align.}` pragma works better for data structure alignment?
20:17:32FromGitter<antonkatz> @leorize Reactive programming is pretty big in UI world. The basic idea is that you have some variables that depend on the value of other variables, so that when the other variable changes all dependents change.
20:18:21leorizethe closet thing that I know of is:
20:18:23leorize!repo karax
20:18:24disbothttps://github.com/pragmagic/karax -- 9karax: 11Karax. Single page applications for Nim. 15 563⭐ 47🍴 7& 13 more...
20:18:48leorizeand maybe
20:18:55leorize!repo figma
20:18:56disbothttps://github.com/treeform/fidget -- 9fidget: 11Figma based UI library for nim, with HTML and OpenGL backends. 15 193⭐ 8🍴
20:19:19FromGitter<antonkatz> I really like the fidget concept
20:19:32FromGitter<antonkatz> i just saw it on nimble today. it was featured
20:19:57leorizeyep, the author recently gave a talk on NimConf
20:21:52leorize@Shucks we don't have anything built in to automagically hide an identifier, but you can easily make a type section macro for this
20:23:39FromGitter<antonkatz> Did you get to listen to it? I'm coming from a JS background and I understand how let's say React works under the hood and how it knows when to refresh the dom. How does the fidget know when to refresh the dom if a value changes? I'm looking at this example https://github.com/treeform/fidget/blob/master/examples/todo/todo.nim and it just directly changes the mutable set.
20:23:46FromDiscord<Shucks> Thank you. The align pragma looks interesting. Just not sure how to use it in my case. https://play.nim-lang.org/#ix=2pOl
20:25:40*kungtotte quit (Read error: Connection reset by peer)
20:25:54*bung joined #nim
20:26:20leorize@antonkatz I think fidget uses a vdom approach
20:26:31*Jesin quit (Quit: Leaving)
20:26:32leorizethe talk can be found on conf.nim-lang.org if you're interested
20:26:55*kungtotte joined #nim
20:27:09leorizefully reactive similar to svelete is still in development afaik
20:27:48leorizethere was a post on the forum about a library that can do something like svelete (not sure if correct spelling)
20:28:02zedeussvelte
20:28:13leorizethanks :)
20:28:16leorize!repo svelte
20:28:17disbothttps://github.com/awseward/hello_nim_svelte -- 9hello_nim_svelte: 11An exploration of getting svelte up and running with a nim backend 15 0⭐ 0🍴
20:29:30FromGitter<antonkatz> @leorize you're awesome. thank you.
20:30:07*Jesin joined #nim
20:30:13FromDiscord<willyboar> There is a nice new project
20:30:23FromDiscord<willyboar> !repo clear
20:30:24disbothttps://github.com/thoughtbot/clearance -- 9clearance: 11Rails authentication with email & password. 15 3276⭐ 444🍴 7& 29 more...
20:31:38leorize@Shucks: I think I can hack something up for you, but I gtg now
20:32:18FromDiscord<Shucks> awesome. Sure have a good one
20:34:08FromDiscord<willyboar> !repo nclearseam
20:34:09disbothttps://github.com/mildred/nclearseam -- 9nclearseam: 11front-end templating for Nim with direct DOM modification and no specific syntax 15 10⭐ 0🍴
20:37:07FromDiscord<willyboar> mratsim you put in HN a link of my fork of awesome nim and people staring it.
20:41:40FromDiscord<Technisha Circuit> In python, i can do `" ".join(list)` to get a list joined with the space as a separator, how would i do this in Nim?
20:41:59FromDiscord<Technisha Circuit> I don't want to use the for loop
20:42:07*leorize quit (Quit: WeeChat 2.8)
20:42:43FromDiscord<😬🤣> `strutils.join(list, " ")`
20:43:08FromDiscord<Technisha Circuit> Thankz!
20:43:34FromDiscord<Technisha Circuit> So `sequence.join(" ")` should work, right?
20:43:49FromDiscord<Technisha Circuit> After importing strutils
20:43:51FromDiscord<😬🤣> yes, I just made it clear what module it's from
20:43:57FromDiscord<Technisha Circuit> Thanks!
20:44:01FromDiscord<😬🤣> np
20:46:57FromDiscord<Technisha Circuit> If i have a custom type, how do i assign values to the fields? `newType = Type(fields=values)`?
20:47:04FromDiscord<Technisha Circuit> (edit) '`newType' => '`var newType'
20:47:55FromDiscord<😬🤣> https://nim-lang.org/docs/manual.html Ctrl+F "object constr"
20:49:34*Senny joined #nim
20:50:16FromDiscord<Recruit_main707> ayyyman, no forwards declaration is killing me
20:53:18*krux02 quit (Remote host closed the connection)
20:54:03FromDiscord<Elegant Beef> What do you mean?
20:54:39AraqRecruit_main707: there is {.experimental: "codeReordering".}
20:54:56Araqand it will become non-experimental
20:56:21*clemens3 quit (Read error: No route to host)
20:56:31FromDiscord<djazz> codeReordering works across modules?
20:56:32FromDiscord<Recruit_main707> it might work in this situation
20:56:47*drdee quit (Quit: Leaving)
20:57:43FromDiscord<Recruit_main707> i apreciate all the work you put into the lang, i cannot even imagine how hard it should be to create and maintain nim
20:58:36FromDiscord<Technisha Circuit> Thanks :p
21:03:34*Senny quit (Ping timeout: 240 seconds)
21:03:40*tefter quit (Quit: WeeChat 2.8)
21:16:03FromDiscord<Technisha Circuit> I just realized I haven't wished for classes in Nim for ages now
21:16:17FromDiscord<Technisha Circuit> Classes are completely redundant because of Nim's power-
21:16:39FromDiscord<Recruit_main707> see, if you survive the first weeks, you see you dont really need them
21:17:18FromDiscord<Technisha Circuit> That's true
21:17:49FromDiscord<Recruit_main707> add this to the nim for the python programmer wiki :P
21:17:54*solitudesf quit (Ping timeout: 260 seconds)
21:18:01FromDiscord<Technisha Circuit> That should actually be added hahaha
21:21:24FromDiscord<Technisha Circuit> Is it `myTable.keys` to get all keys as a sequence?
21:21:40FromDiscord<Technisha Circuit> I'm looking at docs tryna figure out my issue
21:21:46FromDiscord<Technisha Circuit> Nvm
21:21:52FromDiscord<Technisha Circuit> That's an undeclared field
21:22:34FromDiscord<Technisha Circuit> Yeah, i can't figure out how to get all Keys in a table T^T
21:32:27FromDiscord<Shucks> tables.keys is a iterator `for key in myTable.keys: echo key`
21:33:31*lritter quit (Quit: Leaving)
21:34:29FromDiscord<😬🤣> you can do `sequtils.toSeq(myTable.keys)` if you need to make it a seq
21:35:21*Vladar quit (Quit: Leaving)
21:35:55FromDiscord<Technisha Circuit> Oh thanks!
21:39:30FromDiscord<Technisha Circuit> sent a code paste, see http://ix.io/2pOK
21:40:13FromDiscord<Recruit_main707> that could have killed irc
21:40:17FromDiscord<Technisha Circuit> I'm definitely doing something wrong :p
21:40:27FromDiscord<Technisha Circuit> Isn't there the new message handler now?
21:40:42FromDiscord<Recruit_main707> i think so
21:40:47FromDiscord<Technisha Circuit> That's why i sent it :p
21:40:53FromDiscord<Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/724378323282821130/Screenshot_20200621_223950_com.discord.jpg
21:40:56FromDiscord<Technisha Circuit> If they can't see the message
21:41:50*drdee joined #nim
21:42:06FromDiscord<😬🤣> commands isn't a table
21:42:07FromDiscord<Recruit_main707> Command is not a table
21:42:55FromDiscord<Technisha Circuit> `commands` is a table
21:43:02FromDiscord<Technisha Circuit> And `Command` is a custom type
21:43:30FromDiscord<Technisha Circuit> Wait
21:44:07FromDiscord<Technisha Circuit> Nearly fixed
21:44:13FromDiscord<Recruit_main707> you have to do .toTable iirc
21:44:25FromDiscord<Shucks> sent a code paste, see http://ix.io/2pOL
21:44:33FromDiscord<Shucks> i suggest installing inim. Awesome tool ;D
21:45:04FromDiscord<Recruit_main707> was that your talk?
21:45:20FromDiscord<Shucks> naw im a nim newbie lol
21:45:28FromDiscord<Shucks> but i was missing something like that
21:45:31FromDiscord<Recruit_main707> ah, ok
21:46:46FromDiscord<Technisha Circuit> I already have Inim! :3
21:48:02FromDiscord<Technisha Circuit> It works! Thanks Recruit_main!
21:54:30FromDiscord<Recruit_main707> np
21:54:40FromDiscord<Recruit_main707> @djazz it doesnt btw
21:55:05FromDiscord<Recruit_main707> but you know, something is better than nothing
22:00:46*Senny joined #nim
22:08:23FromDiscord<djazz> Alright
22:09:31*tane quit (Quit: Leaving)
22:11:48FromDiscord<Recruit_main707> also, method arguments cannot change names, (they should have the same ones as the base method), is that intended?
22:12:44*clemens3 joined #nim
22:15:16FromDiscord<Recruit_main707> hmm, maybe im doing something wrong, ill ask tomorrow gtg now
22:30:14*dddddd quit (Ping timeout: 240 seconds)
22:39:58FromDiscord<😬🤣> what does `createShared` actually do that `create` doesn't?
22:40:09FromDiscord<😬🤣> can't you share normal pointers between threads?
22:48:46*drdee quit (Remote host closed the connection)
22:50:42FromDiscord<Elegant Beef> > The allocated memory belongs to its allocating thread! Use createShared to allocate from a shared heap.
23:02:53FromDiscord<Shucks> What exactly happens if I use `0.bool`? I dont want to be petty but would `if var == 0` or `if var.bool` better?
23:06:32FromDiscord<Elegant Beef> It converts 0 to a bool which is false, i'd say the comparison is better
23:06:41FromDiscord<Elegant Beef> Since it's more explicit
23:10:12FromGitter<Vindaar> yes, please treat ints as ints. If you actually need bools, use them. Until right now I wasn't even aware that `0.bool` is allowed (and even e.g. `2.bool` works). Don't introduce one of the worst C features into Nim :)
23:10:57FromDiscord<Elegant Beef> well if you so want you could make a `proc hasValue(a : int):bool= a !=0`
23:11:04FromDiscord<Elegant Beef> Just something clear 😄
23:11:27FromDiscord<Shucks> Alright. Just asking because the winapi returns "Winbools" which is 0 or 1.
23:12:11*dddddd joined #nim
23:12:42FromGitter<Vindaar> that would at least signify to me as a reader of the code that the variable that there is a certain, well defined `hasValue`. ⏎ For such a case (if you are certain that it's really effectively a bool), feel free to write a `toBool` proc for those `Winbools`. Would be better though if `Winbool` was a distinct int \
23:13:34FromGitter<Vindaar> as in to avoid misuse of the `toBool` for normal `int` which have values outside of {0, 1}
23:14:09FromGitter<Vindaar> can you give a link to the winapi lib?
23:14:19FromDiscord<Shucks> !repo winim
23:14:20disbothttps://github.com/khchen/winim -- 9winim: 11Nim's Windows API and COM Library 15 118⭐ 10🍴
23:15:02FromDiscord<Shucks> https://github.com/khchen/winim/blob/master/winim/inc/windef.nim#L57
23:16:58FromGitter<Vindaar> ok, I see. Since introducing `distint int` is a little out of scope here, I'd go with the `toBool` convention and manually call that on the winbools, where I use them
23:19:54FromGitter<Vindaar> in any case, gotta go to bed. Have a good evening (or whatever ;))
23:20:08FromDiscord<Shucks> gn8 😉 thanks btw
23:20:24FromDiscord<Vindaar> no worries
23:33:21*dsrw joined #nim
23:38:03*dsrw quit (Client Quit)
23:38:11FromDiscord<kaletaa> what's the easiest way to write unit tests for something like a discord bot?
23:38:15FromDiscord<kaletaa> without going insane
23:46:34FromGitter<antonkatz> @kaletaa I'm interested too
23:48:10FromDiscord<kaletaa> i guess on discord making another bot to test the first one wouldn't be too hard
23:48:18FromDiscord<kaletaa> since a bot can do most things a human can
23:49:04FromDiscord<kaletaa> making such a bot for telegram would be quite hard though
23:57:59*iwq joined #nim