00:01:20*Hideki_ joined #nim
00:01:22*Hideki_ quit (Remote host closed the connection)
00:01:55*Hideki_ joined #nim
00:04:25*adeohluwa joined #nim
00:08:35*Hideki_ quit (Ping timeout: 265 seconds)
00:12:38*abm quit (Read error: Connection reset by peer)
00:15:05*adeohluwa quit (Remote host closed the connection)
00:21:36*kungtotte quit (Ping timeout: 240 seconds)
00:38:38*Hideki_ joined #nim
00:50:47*laaron joined #nim
00:51:47*laaron quit (Client Quit)
00:52:16*laaron joined #nim
00:53:40*Hideki_ quit (Ping timeout: 268 seconds)
01:04:54*laaron quit (Remote host closed the connection)
01:09:10*kungtotte joined #nim
01:38:16*laaron joined #nim
01:39:39*laaron quit (Client Quit)
01:40:01*laaron joined #nim
01:44:21*laaron quit (Remote host closed the connection)
01:45:41FromGitter<iffy> I'm getting a "Bad file descriptor" error with an asyncnet server. The error is raised during a `poll()` invocation. It happens just after I close an AsyncSocket client socket (but not right at the point that I close it). Full traceback and some relevant code here: https://gist.github.com/iffy/4cd33aaa7af421fe37759570178c10ec
01:47:21disruptekiffy: most likely because an exception is raised and the server pukes on it.
01:47:50disrupteknothing you can do about it but nag dom96, who maintains that this is desirable behavior. see my pr.
01:47:58FromGitter<iffy> How can I find where the exception is being raised?
01:48:11disruptekit doesn't matter, there's nothing you can do but catch it.
01:48:23FromGitter<iffy> so it's not my code that's causing the error?
01:48:42FromGitter<iffy> in that case: dom96: nag, nag, nag
01:49:23FromGitter<iffy> disruptek: have a link to your PR?
01:50:10disruptekunlikely to be the same code, but likely to be the same problem.
01:51:30FromGitter<iffy> okay, yeah, that PR is for http specifically, and I'm using AsyncSocket directly
01:51:39FromGitter<iffy> and NOT doing HTTP
01:51:39disruptekunlikely to be the same code, but likely to be the same problem.
02:16:46FromGitter<iffy> On further testing, the error is only raised if I call AsyncSocket.close() myself
02:17:22disruptekbut it's raised in the server loop, yes?
02:19:59FromGitter<iffy> It's raised in my call to `poll()`
02:20:01FromGitter<iffy> yes
02:20:22disruptekso, this is the same problem.
02:21:33disruptekanyway, you are encouraged to submit a pr. i actually don't use this code; my pr was just to help out zedeus.
02:21:36FromGitter<iffy> But I don't think the solution is to catch "Bad file descriptor" in my code... I think `poll()` or maybe `AsyncSocket` needs to change
02:21:41FromGitter<iffy> okay
02:22:00disruptekyes, the problem is that an exception shouldn't crash the main loop of the server.
02:22:21disruptekunfortunately, there is likely no way to write such a server due to private procs.
02:22:50FromGitter<iffy> I think there are two problems: 1. an exception shouldn't crash the main loop of the server and 2. AsyncSocket or whatever is causing this particular exception, should stop causing this exception
02:23:55FromGitter<gogolxdong> Is there a benchmark proc in Nim?
02:24:05disrupteki agree, but it's going to be a much harder sell to change the API to merely report an error versus raising an exception.
02:24:50disruptekgogolxdong: not yet, but you can add one to this: https://github.com/disruptek/golden
02:25:59FromGitter<iffy> I think I'm saying, I want to fix this particular error so it doesn't even happen. There will be no report and no exception. In python "bad file descriptor" happens when you `os.close(somefd)` twice. I suspect that's what's happening here
02:26:52disruptekcould be, but the thing is, async can yield exceptions for myriad reasons.
02:27:35disruptekhere's the example zedeus created: https://github.com/zedeus/jester-example
02:28:26*theelous3 quit (Ping timeout: 240 seconds)
02:28:34FromGitter<iffy> okay, maybe I can make a sscce that uses only asyncnet
02:50:21*Hideki_ joined #nim
02:54:51*Hideki_ quit (Ping timeout: 265 seconds)
02:55:09FromGitter<iffy> disruptek: up for verifying that this fails for you? https://gist.github.com/iffy/cb7b01c15990cf34433e821bb21c49d1
03:02:33*lritter quit (Ping timeout: 268 seconds)
03:02:59*lritter joined #nim
03:06:20FromGitter<iffy> disruptek: thanks for being a sounding board. I filed a minimal reproducing example here: https://github.com/nim-lang/Nim/issues/12382
03:27:55*dddddd quit (Remote host closed the connection)
03:28:59zedeusdisruptek: when I ran my project behind nginx with asynchttpserver, every single request triggered that error, not just cancelled ones
03:29:08zedeusso I kinda gave up, haven't had time to look into it
03:29:33zedeusdecided to patch httpbeast to fix the issue I was having instead
03:43:22FromGitter<gogolxdong> Anyone knows which concepts are borrowed accordingly from ⏎ `It combines successful concepts from mature languages like Python, Ada and Modula.`?
03:44:03leorizeindent from python
03:44:09*chemist69 quit (Ping timeout: 250 seconds)
03:44:11leorize`distinct` from ada iirc
03:46:07*chemist69 joined #nim
04:11:05*rockcavera quit (Remote host closed the connection)
04:33:32*narimiran joined #nim
04:36:29*skoude joined #nim
04:46:41*nsf joined #nim
05:12:59*skoude quit (Ping timeout: 276 seconds)
05:33:29*krux02 joined #nim
05:51:16*whaletechno quit (Ping timeout: 240 seconds)
06:01:06*absolutejam4 joined #nim
06:02:38*skoude joined #nim
06:22:52*absolutejam4 quit (Ping timeout: 264 seconds)
06:30:26*solitudesf- joined #nim
06:40:16*PMunch joined #nim
06:49:16*fanta1 joined #nim
06:52:11*Hideki_ joined #nim
06:56:33*Hideki_ quit (Ping timeout: 250 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:27FromGitter<gogolxdong> Which standard version does Nim interoperate with C and C++ accordingly, is it C89 and ANSI C++ or ISO C++ 98?
07:03:49AraqC89 but mostly "The C that GCC/Clang and Visual C++ support"
07:04:22Araqthe standards are unusable when you read them carefully enough
07:05:05*gmpreussner joined #nim
07:06:31FromGitter<gogolxdong> and C++?
07:09:11AraqC++98, but the same really, whatever works with the common C++ compilers
07:11:46FromGitter<gogolxdong> sure.
07:14:38*absolutejam4 joined #nim
07:16:29*onionhammer quit (Ping timeout: 276 seconds)
07:19:41FromDiscord<juan_carlos> On `db_postgres.prepare()` whats `stmtName` used for?, just debug, because other proc that take `SqlPrepared` dont need that same string.
07:22:08FromGitter<gogolxdong> By default the Nim compiler generates a large amount of runtime checks ⏎ aiming for your debugging pleasure. With ``-d:release`` some checks are ⏎ `turned off and optimizations are turned on` , iirc, -d:release changes.
07:23:34FromGitter<gogolxdong> turns on all runtime checks?
07:25:27PMunchI think the disabling of most runtime checks have now moved to -d:danger
07:25:37*Vladar joined #nim
07:26:28*gampolt joined #nim
07:26:49FromGitter<gogolxdong> what does -d:release do then? turns on all runtime checks and optimizations?
07:27:28FromDiscord<Rika> Runtime checks are on by default AFAIK, release only adds optimizations I think
07:31:04*floppydh joined #nim
07:32:06*thomasross_ joined #nim
07:32:06*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
07:32:06*thomasross_ is now known as thomasross
07:33:18*solitudesf- quit (Quit: Leaving)
07:33:32*solitudesf joined #nim
07:34:28*gampolt quit (Remote host closed the connection)
07:34:49*me7 joined #nim
07:45:37FromGitter<gogolxdong> Is there a game in Nim?
07:45:46PMunchYes, multiple
07:49:38narimiran@gogolxdong see https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L54 for what is done in `danger` and `release`
07:50:30FromGitter<gogolxdong> I'm doing a video to introduce what can Nim do, we have our production as server dev and web frontend dev and a working Vulkan demo as demostration, lacking of embedded dev , AI and games. Any good ideas?
07:51:24FromGitter<gogolxdong> @narimiran thanks, it's helpful.
07:52:24PMunchHmm, I don't know any large games written in Nim. But you can always use one of the recent Game Jam games :)
07:52:40PMunchAt least it shows off how quickly and easily you can make games in Nim
07:53:58PMunchhttps://github.com/liquid600pgm/memrecall https://www.reddit.com/r/nim/comments/de04ld/live_nim_programming_succulentia_day_2_ludum_dare/
07:57:39*theelous3_ quit (Ping timeout: 240 seconds)
08:00:27*fredrik92 joined #nim
08:00:48*couven92 quit (Disconnected by services)
08:00:53*fredrik92 is now known as couven92
08:01:16*fredrik92 joined #nim
08:01:57*actuallybatman quit (Ping timeout: 246 seconds)
08:03:41PMunchOoh, fun! I was enrolled into the GitHub sponsorship beta :P
08:08:54AraqPMunch, thew new neverwinter nights backend is written in Nim
08:10:15planetis[m]omg he is using Windows (TM) theme in xfce (or something) linux
08:10:24planetis[m]...I am having flashbacks
08:11:08PMunchAraq, oh the back-end is actually written in Nim? Cool
08:11:16PMunchI thought they were just using it for internal tools
08:11:26PMunchplanetis[m], yeah it appears so..
08:11:49PMunchI was first wondering why he was still using Windows 98 :P
08:12:17PMunchHmm, would you be able to run Nim on Win98? I don't see why not, but potentially something has broken
08:14:15Araqwe try to support Windows XP but no promises about that
08:14:50Araqnobody should run Win98 IMO
08:16:06livcdWhat If I want to run Nim on an ATM ?
08:16:09planetis[m]Win98 was my first computer, the horrors!
08:17:15*thomasross quit (Ping timeout: 240 seconds)
08:17:46livcdbtw I think Windows XP is still used in China a lot
08:18:01PMunchYeah apparently
08:18:28PMunchDo they do some sort of 3rd party updates to it? Or is it just a horrible insecure mess?
08:18:38livcdhorrible insecure mess
08:19:02PMunchDidn't the NHS (UKs National Health Services or something like that) also get hit pretty hard by that ransomware that targeted WinXP?
08:19:06PMunchlivcd, great..
08:20:09livcdjesus it's really hard to find things when you are in a different country and want to search for specific things :/
08:21:51*onionhammer joined #nim
08:21:55*thomasross joined #nim
08:22:04livcdBTW in China most of the major apps are native apps
08:25:08planetis[m]gogolxdong: there was a repo for a russian Ai competition
08:25:39livcdbut I am actually not sure whether they use platform specific APIs or QT or something else
08:26:20livcdgogolxdong: what chinese native apps do you use ?
08:27:08FromGitter<gogolxdong> windows or mobile?
08:29:01planetis[m]also a toy neural net with a web demo: http://bontavlad.com/blog/2017/06/15/simple-neural-network-written-in-nim-running-on-the-web/
08:29:52*droid joined #nim
08:30:03livcdgogolxdong: windows
08:32:25FromGitter<gogolxdong> you mean something like Office?
08:34:40FromDiscord<Kiloneie> Guys, which package is the best so far for GUI in Nim ? There seems to be quite a few, one wxNim by Araq, one by PMunch, then there is wNim... Which one works best etc ?
08:35:05*sagax quit (Remote host closed the connection)
08:35:32FromDiscord<juan_carlos> On `db_postgres.prepare()` whats `stmtName` used for?, just debug?, because other proc that take `SqlPrepared` dont need that string.
08:35:58Araqjuan_carlos: that might exist for compat with the other db_* modules
08:36:11FromGitter<gogolxdong> We have WPS Office comparable Microsoft Office, but most people uses Microsoft Office. There isn't much difference on Windows but on Web.
08:36:57FromGitter<gogolxdong> We have every comparable to Google, Facebook, youtube, Twitter
08:37:08FromDiscord<juan_carlos> Thanks <Araq>
08:37:41FromGitter<gogolxdong> even github.com, github.com is limited.
08:38:21AraqKiloneie: it mostly depends on your app, many apps are built around a single "widget" that decides for you, for example an audio player needs a "play audio" component
08:38:35*ng0 joined #nim
08:39:11*me7 quit (Remote host closed the connection)
08:39:43Araqthere are few UI libs that support almost everything, I think wxWidgets and Qt can do it. Maybe GTK too.
08:39:46PMunchKiloneie, depends on what you mean by "best"
08:40:47FromDiscord<Kiloneie> let's say most documented and tested ?...
08:41:03livcdgogolxdong: I meant desktop apps that you use. Like Wechat Work etc
08:41:09FromGitter<gogolxdong> yeah, we have QQ for instant messaging.
08:41:28PMunchWell my wxNim fork wraps wxWidgets, which has been used for many years and is thoroughly tested and documented
08:41:46PMunchAs far as the wrapping goes however it's not been tested that rigourously
08:41:47FromDiscord<Kiloneie> the one by you or Araq ?, i see 2
08:42:10PMunchThe one by me, I forked it to add some stuff, and essentially just took over maintaining it
08:42:22PMunchNot sure if Araqs version can even run on modern Nim
08:42:52FromDiscord<Kiloneie> aha okay, thanks
08:43:04*sagax joined #nim
08:43:34livcdwe can all try to write some example app and compare
08:43:39livcdre GUI
08:44:06FromGitter<gogolxdong> most personal and office computer uses windows 10 now, only some embedded and supermarket cashier system uses XP.
08:44:26FromDiscord<Kiloneie> Well some people asked me to make some for tutorial, so i guess imma do some GUI stuff, which should go outside my current video series.
08:45:01PMunchlivcd, certainly a possibility
08:45:40FromDiscord<Kiloneie> Imma try a few and see which one i find the easiest that also works as it should etc.
08:45:54livcdKiloneie: i dunno desktop apps can be very different
08:46:59FromGitter<gogolxdong> @Kiloneie are you the one who is doing youtube tutorial series, it's great and helpful, can we share them to our youtube?
08:47:00FromGitter<alehander42> so now with ffi support for the vm
08:47:03FromGitter<alehander42> when its enabled
08:47:14FromGitter<alehander42> should it be able to import all kinds of system stuff like `os`
08:48:03FromGitter<alehander42> i guess it enables calling importc functions etc, so this is all that is needed in theory right
08:48:07FromDiscord<Kiloneie> Yeah i am, and yes you can.
08:48:36FromGitter<gogolxdong> We have followed to the lastest, is it 10?
08:48:39livcdKilonie: PMunch: the question is. Do you want to have a nice looking desktop app or are you making an ugly looking desktop form ?
08:48:46FromDiscord<juan_carlos> Theres also a GUIBuilder thing on Nimble.
08:48:49FromDiscord<Kiloneie> the version in tutorials is 1.0
08:49:04FromGitter<alehander42> @timotheecour maybe i ping you
08:49:19FromGitter<gogolxdong> the 10th tutorial
08:49:21FromDiscord<Kiloneie> I guess nice looking ?
08:49:48livcdThen you are stuck with a very few frameworks that are all commercial AFAIK
08:50:14FromDiscord<Kiloneie> you can share my videos however you want, what you can't do is take a video and post it on your channel.
08:50:22PMunchDepends on your definition of ugly..
08:50:40PMunchI personally prefer most of my apps to use Gtk so that they will stick to the theme off my machine..
08:51:02FromDiscord<Kiloneie> So far wNim seems pretty decent.
08:51:14livcdwell gtk is ugly...are there any nice looking gtk apps ?
08:51:25PMunchwNim is pretty nice if you want to only make Windows apps
08:51:39PMunchlivcd, Gtk isn't ugly, but there are plenty of ugly Gtk themes..
08:51:39livcdPMunch: my definition of nice: https://www.glasswire.com/
08:51:59FromDiscord<Kiloneie> Oh yeah... didn't think about cross platform
08:52:02Araqyou can use wNim + Wine :P
08:52:09livcdvisually appealing
08:52:11PMunchAraq, hooray..
08:52:38livcdglasswire is using QT as far as I know
08:52:39Araqhey, it's only fair, they also try to trick me into Cygwin crap all the time
08:53:05FromGitter<gogolxdong> youtube is banned, I shared your series and marked as repost and the original links.
08:53:55FromGitter<alehander42> what do people use instead of youtube
08:53:57FromGitter<alehander42> in china
08:54:03PMunchlivcd, yeah it appears like it's Qt, but the graphs are probably a custom widget
08:54:28FromGitter<gogolxdong> previously it's Youku and Tudou
08:54:46Araqsure, I want some bullshit "posix emulation" on Windows with its misdesigned fork() and memory overcommit
08:54:50FromGitter<alehander42> it has nice ui
08:54:56FromGitter<gogolxdong> now bilibili is more popular.
08:55:09FromGitter<alehander42> its time for unikernels os-es are so 1999
08:55:18livcdoh did not know that gogolxdong
08:55:46FromGitter<alehander42> hm, bilibili looks more anime-focused
08:55:57FromGitter<alehander42> but maybe thats what i am seeing in my feed in europe
08:56:00livcdPMunch: minus the graphs the UI is good looking as it should be
08:56:17PMunchOh cool, krux02 wrapper AntTweakBar
08:57:45FromDiscord<Kiloneie> That's good
08:57:57FromGitter<gogolxdong> I feel the same but it's just popular, I don't understand. It even doesn't support markdown.
08:58:02FromDiscord<Kiloneie> China is the VPN country now
08:58:31PMunchOh interesting: https://nimble.directory/pkg/uibuilder Glade -> Nim compile-time
09:00:52livcdcan anyone make Nim bindings for JUCE ? :X
09:01:30FromGitter<gogolxdong> have to post picture of code snippet, bilibili has technique category among many furry,cute, animation thing.
09:02:58*ball1 joined #nim
09:05:03*shomodj joined #nim
09:05:49FromDiscord<juan_carlos> Wow Flutter thinks RAM is free real state. :P
09:07:55livcdflutter builds are all debug builds that's why
09:15:53*droid quit ()
09:16:36*absolutejam4 quit (Ping timeout: 240 seconds)
09:24:08*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:29:07*shomodj joined #nim
09:36:15*absolutejam4 joined #nim
09:39:17*dddddd joined #nim
09:39:35*couven92 quit (Quit: Disconnecting)
09:42:03*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:58:18*shomodj joined #nim
10:05:29*narimiran quit (Ping timeout: 276 seconds)
10:11:53*abm joined #nim
10:18:36*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:24:51*thomasross is now known as Guest61544
10:24:51*thomasross_ joined #nim
10:24:51*Guest61544 quit (Killed (adams.freenode.net (Nickname regained by services)))
10:24:51*thomasross_ is now known as thomasross
10:29:35*shomodj joined #nim
10:39:16FromGitter<gogolxdong> @Kiloneie How many times will you try to produce a video?
10:39:57FromGitter<gogolxdong> I'm always stuck today.
10:42:18FromDiscord<Kiloneie> What do you mean how many times ? If you mean if i will keep doing them, then yes i will. Right now i am just making one a day for Nim for Beginners series, but i am planning on other series as well, as well as one of videos that don't belong anywhere else.
10:42:55FromDiscord<Kiloneie> i am not working not even close to what i could be, 1 a day is pretty easy, but i can do more and will try to.
10:43:45*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:50:54FromGitter<gogolxdong> How many times of trying to make a fluent video?
10:51:22FromGitter<xflywind> how many hours
10:53:54FromGitter<gogolxdong> How many times of NG(Not Good?)?
10:54:13lqdev[m]@Kiloneie I honestly think 1 per day is way too many. remember, quality > quantity
10:54:35livcdKilonie: just dont mentione Winnie The Pooh in your videos
10:54:59lqdev[m]if you upload 1 video per day, your viewers will quickly get bored
10:55:07lqdev[m]1 per week is much better
10:55:23lqdev[m]it also gives you more time to polish the videos
11:01:39*shomodj joined #nim
11:03:15*shomodj quit (Client Quit)
11:14:37*Vladar quit (Ping timeout: 265 seconds)
11:16:20*puri joined #nim
11:16:43*puri quit (Remote host closed the connection)
11:16:53FromDiscord<Rika> is it possible to partially unpack seqs? ex: var (a, b, rest) = {a seq of length 5} would make rest have the remaining 3 elements
11:18:02lqdev[m]is it even possible to unpack seqs at all?
11:18:23lqdev[m]I'm seeing this for the first time
11:18:56*thomasross quit (Ping timeout: 276 seconds)
11:19:18*asymptotically joined #nim
11:19:50lqdev[m]anyways, you can do (a, b, rest) = (x[0], x[1], x[2..^1])
11:20:28*skoude quit (Ping timeout: 264 seconds)
11:22:10*skoude joined #nim
11:23:09FromDiscord<Rika> is it only for tuples?
11:23:12FromDiscord<Rika> if so, damn
11:23:42krux02Rika: sorry, unpacking is only for tuples.
11:23:50lqdev[m]I don't recall seeing this in the manual
11:24:07FromDiscord<Rika> hmm prolly can make a macro for this
11:24:12lqdev[m]so you'll have to either unpack a tuple or directly assign variables
11:24:21krux02I wrote a macro once, where I could do pattern matching for ast nodes as well, because that was my most important use case for pattern matching.
11:24:43FromDiscord<Rika> im not that good at macros just yet lmao
11:25:46*thomasross joined #nim
11:28:12*thomasross_ joined #nim
11:28:12*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
11:28:12*thomasross_ is now known as thomasross
11:28:38*absolutejam4 quit (Ping timeout: 265 seconds)
11:29:14*skoude quit (Ping timeout: 240 seconds)
11:29:42*absolutejam4 joined #nim
11:32:00*Vladar joined #nim
11:40:24PMunchWhy? https://github.com/nim-lang/website/commit/358b30beb86ff7d33362392ab806180a086aad19
11:41:28*fanta1 quit (Ping timeout: 264 seconds)
11:41:54lqdev[m]PMunch: it's quite an interesting story https://github.com/nim-lang/website/issues/169
11:45:05*clyybber joined #nim
11:45:09PMunchEh, I guess that's fair..
11:45:20PMunchWhat about the #nim channel though :P
11:45:26PMunchDo we have to stop swearing?
11:46:46clyybberNo, why?
11:47:57clyybberI saw that. But it only applies to the website.
11:49:43clyybberAraq: Why do we say that discriminators of case objects must be constant?
11:49:51PMunchHaha, yeah I was just making a joke
11:50:00clyybberAh, ok. I was worried
11:50:42PMunchProbably because you can't discriminate on something that's only available at runtime
11:51:02clyybberBut you actually can.
11:51:10clyybberI mean the field checks are done at runtime
11:51:26PMunchOh yeah
11:51:39PMunchBut the range of possible cases must be known at compile-time
11:52:12clyybberI'm asking because I'm implementing default object values and I could rely on the fact that those discriminators are constant and eliminate runtime overhead or I could initialize based on the runtime discriminator value.
11:52:17PMunchLike you can discriminate on an enum, since you know all the values an enum can take on compile-time
11:52:52clyybberBut does the discriminator itself have to be constant? Like the value, not the range/type?
11:53:01clyybberAFAICT from the manual it has to.
11:56:15*navinmistry joined #nim
11:56:15*rockcavera joined #nim
12:01:59clyybberWth, where does that invalid indentation error come from: https://play.nim-lang.org/#ix=1Y0N
12:02:22FromGitter<alehander42> I think they're should be constant
12:03:00FromGitter<alehander42> Wait do you mean the variable in case
12:03:54clyybberOf course the type/range should be constant.
12:04:25clyybberalehander42: I mean the variable that determines which "branch" to take
12:05:15clyybberFeels so weird still stumbling over indentation errors after using the language so much
12:05:34clyybberEspecially if I can't figure it out.
12:06:01FromGitter<alehander42> You mean of a
12:06:10FromGitter<alehander42> A should be constants imo
12:06:32FromGitter<alehander42> I expect static dispatch
12:06:33clyybberYeah, the of branch things must be constants
12:06:45clyybberBut I mean the case d: Discriminator
12:06:47FromGitter<alehander42> Ah well the other one not
12:07:09FromGitter<alehander42> It couldn't work if only const
12:07:20FromGitter<alehander42> Maybe the manual defines discriminator
12:07:23FromGitter<alehander42> Differently
12:07:43clyybberCan you figure out what the error in my snippet is?
12:07:48clyybberMaybe its a bug
12:07:52clyybberBut I really can't tell
12:09:28FromGitter<xflywind> indent error in 14 line, delete one space
12:09:49PMunchYeah, there is a space before the proc..
12:09:56clyybberoh damn
12:11:05*asymptotically quit (Remote host closed the connection)
12:11:27clyybberalehander42: Yeah, I was confused by the manual. It refers to the of branch conditions. Those must be constant
12:11:27*asymptotically joined #nim
12:12:31*fredrik92 is now known as couven92
12:19:10FromGitter<alehander42> Good
12:19:21*Hideki_ joined #nim
12:19:29FromGitter<alehander42> I want to ask
12:19:41FromGitter<alehander42> Your default fields can't depends on other defaults
12:19:47FromGitter<alehander42> Or can they
12:24:12clyybberSo far not. But it could be possible to implement
12:24:31clyybberThe question is if it should be possible.
12:24:41clyybberIt still has to be determinable at compile time.
12:24:46FromGitter<alehander42> But can i access default values from macros
12:25:02FromGitter<alehander42> It is determinable indeed
12:25:11clyybberYou mean with a macro on a type section?
12:26:04FromGitter<alehander42> With eg type impl
12:26:29clyybberI'm not sure. I haven't looked into that yet
12:26:59clyybberBut I think it should be possible. So if not I'm gonna patch it.
12:27:59clyybberBut when default field values can depend on other default field values and we want to fully support that, we are gonna have to use some reordering algorithm
12:29:02clyybberBut maybe its better to just support depending on previously defined default field values
12:29:43FromGitter<alehander42> Yeah i guess the default values can come later not sure if theyw
12:30:04FromGitter<alehander42> Are important, maybe you can just depend on types which are defined
12:31:29clyybberI think the gitter bot cur you off
12:33:48FromGitter<Clyybber> Ah, nevermind
12:34:29FromGitter<alehander42> Just writing from phone sorry
12:40:27Araqclyybber, it's a tough problem, I'm thinking
12:43:05clyybberOn second thought I think IF we want to support depending on other default field values we should only depend on already defined ones.
12:44:14FromGitter<alehander42> Yes, thr same way you only depend on already defined types
12:44:40FromGitter<alehander42> Also one can aways offloaded shared defaults to consts
12:45:17FromGitter<alehander42> But what about eg
12:45:45FromGitter<alehander42> Having any defaulted value that depends on on a generics argument is this possible
12:45:59FromGitter<alehander42> And overall can we have generic field defaults
12:46:26clyybberShould be possible
12:46:34clyybberI have to test that though.
12:49:35*navinmistry quit (Remote host closed the connection)
12:58:01FromDiscord<Rika> oh man the macro i just made for the seq unpacking is so dirty...
12:58:16*fichtl quit (Ping timeout: 240 seconds)
12:59:54*adeohluwa joined #nim
13:00:11FromDiscord<juan_carlos> I need a Templatacro or a Macroplate. 🤔
13:00:13FromGitter<mratsim> {.dirty.} is not a valid pragma for macros AFAIK
13:00:45FromDiscord<Rika> mratsim, pls xd
13:00:59FromDiscord<Rika> i cant actually tell if you're sarcastic
13:01:09FromGitter<mratsim> I am
13:01:16*navinmistry joined #nim
13:01:18FromGitter<mratsim> More joking than sarcastic
13:08:22*navinmistry quit (Remote host closed the connection)
13:09:49*navinmistry joined #nim
13:10:03*navinmistry quit (Remote host closed the connection)
13:10:55*navinmis_ joined #nim
13:19:13*Hideki_ quit (Ping timeout: 268 seconds)
13:26:42*navinmis_ quit (Remote host closed the connection)
13:29:56*Vladar quit (Ping timeout: 240 seconds)
13:30:04clyybberAraq: Which problem are you thinking about?
13:34:46*narimiran joined #nim
13:34:54*navinmistry joined #nim
13:37:33lqdev[m]hey @Rika have you heard about `macros.quote`?
13:40:24*Vladar joined #nim
13:43:15narimiran@Rika see this package for `unpack` various stuff: https://github.com/technicallyagd/unpack
13:45:14*okcy joined #nim
13:45:37*Vladar quit (Ping timeout: 250 seconds)
13:45:44*okcy quit (Client Quit)
13:49:38FromGitter<alehander42> clyybber
13:50:17FromGitter<alehander42> what i mean is e.g. if i have Node[T] and name: $T.name or something like that
13:50:27FromGitter<alehander42> should this work (not very important if it does now)
13:50:49FromGitter<alehander42> name: string = $T.name
13:50:50FromGitter<alehander42> sorry
13:50:59clyybberSo you mean stuff like Node[N: static int]
13:51:05FromGitter<alehander42> for example yeah
13:51:06*adeohluwa left #nim (#nim)
13:51:08clyybberWhere a field can do f: int = N
13:51:11*adeohluwa joined #nim
13:51:13clyybberYeah that should work IMO
13:51:13*adeohluwa quit (Remote host closed the connection)
13:51:17FromGitter<alehander42> yeah thats a better eample
13:51:22clyybberI don't know if it does thou
13:51:28clyybberBut if not
13:51:33clyybberI'll try to make it work
13:51:37FromGitter<alehander42> the important thing is the spec
13:51:45FromGitter<alehander42> implementation is always possible i guess
13:51:59FromGitter<alehander42> (i doubt there are blockers for that in particular)
13:52:14clyybberspec is boring :D
13:52:17Araqalehander42: the spec seems good enough, yes
13:52:37Araqand I think 'nil ref T' is the winning syntax (sorry, disruptek)
13:52:49FromGitter<alehander42> clyybber its not :P
13:52:56FromGitter<alehander42> Araq, and for `not nil` ?
13:53:17Araq'not nil' stays as it is, it's readable and already exists
13:53:29FromGitter<alehander42> ok
13:53:56Araqand it's consistent too, 'not' being a binary operator in this case
13:53:58FromGitter<alehander42> clyybber so overally if i have Node[T] = .. field: string = myOwnConstFunction(T)
13:54:04FromGitter<alehander42> this should work in theory?
13:54:22clyybberbtw, case objects work now
13:54:32FromGitter<alehander42> Araq yeah the only thing is that one is prefix and one postfix
13:54:32Araqclyybber, your PR forgot about vmgen and jsgen
13:54:48clyybberI know
13:54:57clyybberIts in my TODO list
13:58:08FromDiscord<Kiloneie> @gogolxdong It takes me about 4 hours per video, about 40-60 min of recording, then i edit for 5-70 minutes, cutting any stumbles in my speech etc.
13:58:08FromDiscord<Kiloneie> Also if i were to make 1 video per week, i would get freaking bored and dissapointed with myself. And i would never get to my goal at that rate.
13:58:51narimiran@Kiloneie so i'm not the only one telling you to slow down ;)
13:59:36FromDiscord<Kiloneie> I have to ask, is the quality not good or getting worse since you guys keep asking me that 1 is 1 too many or something D: ?
13:59:46shashlickis devel broken? https://travis-ci.org/nimterop/nimterop/jobs/595112441#L735
14:00:37narimiran@Kiloneie as i told you: it is very heard too keep up with you. i stopped watching probably 4-5 videos ago
14:01:00FromDiscord<Kiloneie> Not my problem 😛
14:01:07FromDiscord<Kiloneie> Some people are begging for more
14:01:38narimiranand some people are begging for less
14:01:50narimiranand you only want to hear ones that align with your view ;)
14:01:55FromDiscord<Kiloneie> xD
14:02:00FromDiscord<Rika> lqdev[m], i used that in the macro so yes i do
14:02:01FromDiscord<Kiloneie> that is kinda true
14:02:24FromDiscord<Rika> narimiran, thanks but i already made the macro. will consider moving to that though
14:02:53clyybbernarimiran: I don't think we are his target audience
14:02:56FromDiscord<Rika> (prolly should, because it's prolly by a more seasoned dev)
14:03:14clyybberIf I were to learn from video tutorials it would piss me off big to wait a week tho
14:03:24FromDiscord<Kiloneie> yeh that is my point...
14:03:25clyybberI would learn from something elsewhere then
14:04:01narimiranclyybber: there is something in between 1/day (or 2/day as @Kiloneie wants) and 1/week ;)
14:04:28Araqshashlick, clyybber broke it
14:04:35FromDiscord<Kiloneie> there kinda has to be no less than 1 per 2 days, otherwise people just might forget about you.
14:04:46clyybbershashlick: dammnit
14:04:53clyybberThe tests were green
14:05:01FromDiscord<Rika> Araq, did you mean they clyybbered it 😛
14:05:06narimiranand, as people already told @Kiloneie, if he has extra time to do more videos, he can record them 10 in one day if he wants, but then release them one by one
14:05:23*Vladar joined #nim
14:05:27clyybbershashlick: Could it be that you are not using cligen head but nim devel?
14:06:02FromDiscord<Kiloneie> which i will have to do this week and the next, birthday party and next week to hang with a sister for a weekend... 2 times imma get drunk, so i need to prep.
14:06:33FromDiscord<Kiloneie> and i gotta learn SDL2, some GUI stuff etc, to be able to make THOSE videos, people want that too...
14:06:47FromDiscord<Kiloneie> and nim for beginners, ain't gonna be done anytime soon yet.
14:07:39clyybberAraq, shashlick: We just have to ask cblake to release a new version. Or we advise people using #devel to use packages #head too
14:09:46*Hideki_ joined #nim
14:10:31*PMunch quit (Read error: Connection reset by peer)
14:12:12shashlickSo Nim devel change is going to break packages now?
14:12:18shashlickSame thing works on 1.0
14:13:30clyybbershashlick: Well I did make a PR to cligen
14:13:36clyybberUse [email protected]#head
14:13:40shashlickSee the full build job, same cligen works on other versions
14:13:52clyybberUse [email protected]#head
14:14:02shashlickSo was this a bug in cligen or Nim
14:14:17shashlickCouldn't this potentially break others too
14:14:32clyybbershashlick: I sent out PRs to all important_packages affected
14:15:00shashlickStill breaking change then
14:15:07clyybberYeah, and?
14:15:41clyybberdevel isn't stable
14:16:17clyybbershashlick: It was a "bug" in Nim. Nim defined csize as int, while it is actually uint. So I changed that.
14:16:26clyybberYou should be happy about that, as a wrapper guru
14:20:56FromGitter<mratsim> @Rika seasoned dev is probably a bad argument. I'm seasoned in Nim but that doesn't mean my stuff from 2 years ago is an example of good Nim code
14:23:37*navinmistry quit (Remote host closed the connection)
14:25:06*navinmistry joined #nim
14:27:00*navinmistry quit (Remote host closed the connection)
14:27:36Araqclyybber, nevertheless this change was poor
14:27:48Araqwe should have deprecated system.csize instead
14:28:00Araqand introduced system.csize_t or something
14:28:44clyybberWhy? Nothing has been broken
14:29:00clyybberIt's just that shashlick was on an outdated cligen version
14:29:25clyybberAraq: I have also added a few mirror procs for backwards compatibility.
14:29:40clyybberWhich have a deprecated: csize is now uint message attached
14:29:49clyybberI don't see how we can do better.
14:30:07clyybberWith introducing new types over new types evertime we change something we just make a mess
14:30:16Araqas I said, don't change csize and it's a better experience
14:30:40*leorize quit (Ping timeout: 260 seconds)
14:30:41Araqand "I'm on an outdated cligen" is a valid situation to be in
14:31:10Araqnot everybody enjoys random changes just because some fool tried to mmap a file over 2GB in size on a 32 bit machine
14:31:38Araqhint: it doesn't work too well no matter your definition of 'size'.
14:32:30*PMunch joined #nim
14:32:34*leorize joined #nim
14:33:11*skoude joined #nim
14:34:00Araqclyybber, plus the overloads you added are an admission that 'csize' as unsigned doesn't work too well and they repeat the original "mistake"
14:34:23FromDiscord<Rika> mratsim, i kinda meant "seasoned dev at the time it was written"
14:34:26Araqso instead of a "wrong" csize we know have "wrong" overloads in ansi_c.nim
14:34:35clyybberWhich are deprecated
14:34:41clyybberSo they can be removed at some point
14:34:57Araqok, I missed that
14:35:21Araqsucks though, I prefer the signed versions, I have little need for "sizes" that wrap around
14:36:27clyybberFor the general unsigned wrap around problem
14:36:56clyybberYou could actually have unsigned integers that don't wrap around
14:37:57clyybberIt's just that C never had that afaik
14:38:06*skoude quit (Ping timeout: 265 seconds)
14:39:31Araqyeah I'm happy with another integer family, intX, uintX, uintX_without_shit
14:39:42clyybberI would love that too.
14:40:28clyybberIts so weird that C never included that in the standard. Its so easy to implement too.
14:41:40clyybberArguably wrapping around is still more correct than going negative half way through
14:42:23Araqno. it's worse
14:42:31Araqat least negative values are not valid sizes
14:42:39Araqnor indexes.
14:42:59FromDiscord<Rika> you'd catch bugs earlier with not-wrapping
14:43:04FromDiscord<Rika> *certain bugs
14:43:41clyybberYeah, fair enough
14:43:51clyybberThe ideal would be uint without wrap
14:44:03Araqthe ideal is 'Natural'
14:44:23clyybberWould be a cool feature for nim to have
14:44:31Araqwe have it
14:44:35clyybberI wonder how we'd implement it though
14:44:42clyybberAraq: Isn't our natural just int?
14:44:52AraqNatural = range[0..high(int)]
14:44:58*theelous3 joined #nim
14:45:14clyybberYeah. I mean it would be cool if our Natural would be a safe uint
14:45:56Araq x < len - 3 <==> x + 3 < len
14:46:06Araqyou want to be able to do this transformation reliably
14:46:21Araqour Natural allows for this, Natural as 'uint' doesn't.
14:47:00Araqtranformations cry for "symmetry" and symmetry cried for negative numbers.
14:47:56clyybberHmm, good point. Do you mean transformations in the compiler or by the user?
14:48:16Araqeven if your "length can never be negative" negative numbers help a great deal. it's like trying to do quantum mechanics without complex numbers.
14:48:43Araqyeah, we know, you cannot take the sqrt of -1, complex numbers rule though.
14:49:18clyybberAraq: But arent those transformations if done by the user in todays Nim invalid anyways?
14:50:02Araqhow so? because stuff gets weird approaching high(int)? (overflow)
14:50:41clyybberNo because natural is defined as range[0..hight(int)]. The compiler checks that it doesn't go below zero, right?
14:50:42*navinmistry joined #nim
14:51:16Araqbut '-' is not defined on Natural, it's defined on 'int'
14:51:28Araqso the conversions then make it ok
14:51:40Araqand the conversion is lossless
14:51:57clyybberAh, ok. Yeah that makes sense.
14:53:22clyybberThough it kind of goes against the point of Natural IMO.
14:53:36*actuallybatman joined #nim
14:54:41clyybberI mean you could have Natural be uintsafe and have a `-` for Natural. Users wouldn't be able to do x < len - 3 in some cases. But arguably they shouldn't be able to anyways.
14:54:57Araqyeah there is quite some sophistry involved here, in the end C# uses 'int' and works and C++/C uses 'uint' and doesn't work.
14:55:21clyybberBecause C++ and C are using their wrap around uints.
14:55:56Araqnot only that, because uint loses symmetry in its basic math operations
14:55:59*navinmistry quit (Remote host closed the connection)
14:56:18clyybberYeah, which is kind of the point of it, I guess.
14:56:20Araqalternatively you can disallow '-' for unsigned, it would work too, I did the analysis
14:56:31Araqbut I like '-'
14:56:53clyybberI do too.
14:57:20*navinmistry joined #nim
14:57:35Araqthe one thing that 'int' really does wrong is that -low(int) doesn't exist
14:57:50Araqso 'abs' is not sound
14:58:00Araqand all hell breaks lose
14:58:20AraqI would have mapped 'low(int)' to a NaN
14:58:39clyybberSaturated arithmetic isn't commutative either right?
14:59:17clyybberAraq: Whats a NaN for integer though?
14:59:17Araqhmm I think "sticky" saturated arithmetic is
14:59:29Araqwhat's a NaN for floating point?
15:00:34clyybberfamiliar properties like associativity and distributivity may fail in saturation arithmetic. This makes it unpleasant to deal with in abstract mathematics
15:00:45clyybberthats what wikipedia says about saturated arithmetic
15:01:05clyybberI couldn't find the "sticky" variant
15:01:21AraqI invented it, I guess...
15:01:35clyybberBut I assume it just uses the negative half for integers for counting the overflow
15:01:35*navinmistry quit (Remote host closed the connection)
15:02:08Araqno, "sticky" means that high(int) is like Inf and Inf - 1 is still Inf
15:02:16*navinmistry joined #nim
15:02:45Araqthere is an "error mode" and you cannot really perform any arithmetic on it after that
15:03:23clyybberOk. So it's also not really symmetric
15:04:05clyybberIn that way it is similar to a uintsafe. Except that it will be in error mode and uintsafe will fail early
15:05:39Araqit's "symmetric" enough in my experience. the only problem is that there are preferable groupings
15:06:01Araqx + (1 - 1) is better than (x + 1) - 1
15:06:24Araqbut that's actually quite common in math already
15:06:33clyybberYeah so the same as x < len - 3 vs x + 3 < len
15:06:39Araqthink about infinite sums and what you're allowed to do with them
15:06:57clyybberMath would "error" at compile time :P
15:08:28Araqwell probably you need some leeway in the spec
15:09:01Araqbut with clear rules that try to preserve symmetry it works much better than "oh and btw, x + 1 can turn back into 0"
15:09:32Araq"and of course the Linux kernel now relies on this, everywhere, good luck proving stuff correct"
15:09:46clyybberBut even better x + 1 errors when too big
15:10:13clyybberI think that Natural as a uintsafe wouldn't be so bad
15:10:43clyybberAfter all you probably use Natural because you want Natural
15:11:35Araqwell I also want minus to work as reliably as the other arithmetic operations
15:11:53Araqand that rules out 'uint'.
15:12:04Araqhttps://en.wikipedia.org/wiki/Unum_(number_format) related but for floating point
15:12:11clyybberExcept when Natural would be a generic
15:12:44clyybberLike Natural = range[0..high(int)] | range[0..high(uintsafe)]
15:12:58clyybberwhere the first range is an int range and the second an uintsafe range
15:13:55*absolutejam4 quit (Ping timeout: 268 seconds)
15:15:01clyybberAraq: Actually you can have `-` working on uintsafe and keep the symmetry. Just make `-` return an int :p
15:15:45clyybberNot a lossless conversion..
15:17:02clyybberUnum are posits right?
15:17:58clyybberI heard they are more performant too. Though most hardware still lacks their implementation.
15:20:05Araqhttps://youtu.be/rHIkrotSwcc?t=1187 unique_ptr sucks
15:20:09*xace quit (Ping timeout: 265 seconds)
15:21:46Araqgood thing we're doing a better job at this
15:21:52clyybberAnother case for quirky exceptions
15:22:11clyybberBecause traditional exceptions destroy every abstraction or guarantee
15:22:52clyybberOh, its bad without exceptions too...
15:23:06AraqC++ has no 'sink' parameters
15:23:40FromGitter<alehander42> ok
15:24:36FromGitter<alehander42> so i'll push in a PR first a test file for the nil feature to make sure it tests the spec
15:25:10clyybberalehander42: Did you implement it?
15:25:24FromGitter<alehander42> no, i waited for the spec to be accepted
15:25:30clyybberAh, ok
15:25:37FromGitter<alehander42> i already have an older implementation, but its ast-based
15:26:01Araqand it might be fine
15:26:09Araqast-based can be integrated into sempass2 easily
15:26:22Araqin fact, sempass2 already tries to do this analysis
15:26:29FromGitter<alehander42> but it seems to me the cfg stuff already runs in sempass2
15:26:33*PMunch quit (Remote host closed the connection)
15:26:37Araqnot really
15:26:50Araqit's delayed until code generation
15:27:16Araqwhich is a problem on its own, if you misuse '=' in a proc that you don't call, the error is not reported
15:28:08FromGitter<alehander42> at least in my experiments i used `dfa` to define a nilCheck function
15:28:16FromGitter<alehander42> and just called it in the end of trackProc
15:29:44FromGitter<alehander42> my understanding was that one has to construct the cfg from certain ast and then analyze it, so i am not sure why the current cfg stuff is ran in codegen
15:30:25Araqbecause only the codegen currently needs it
15:31:06FromGitter<alehander42> ok, well, codegen should codegen
15:31:36*Hideki_ quit (Remote host closed the connection)
15:31:52*navinmistry quit (Ping timeout: 264 seconds)
15:31:57*couven92 quit (Quit: Client disconnecting)
15:33:15FromGitter<alehander42> well, i think we should what is correct, not what is easier
15:33:57FromGitter<alehander42> if cfg would be generally useful for more analysis, probably better to put it where it should be
15:34:22FromGitter<alehander42> if it would be an overkill for notnil, then notnil can just use ast indeed
15:35:06*Trustable joined #nim
15:35:50AraqI think for 'not nil' it's overkill unless we seek to support:
15:35:57Araqif x == nil: return
15:36:42FromGitter<alehander42> well, we should support that
15:36:52FromGitter<alehander42> but i supported it
15:36:57FromGitter<alehander42> with the ast approach as well .. iirc
15:37:52FromGitter<alehander42> yep https://github.com/alehander42/Nim/blob/ref-nilcheck/compiler/nilcheck.nim#L53
15:37:59disrupteki had to watch carruth on 2x speed and it was still too slow.
15:38:56clyybberI mean we can use dfa two times too. Its not that bad, right?
15:39:23clyybberOr we reorder it so that dead code elimination comes after injectdestructors
16:02:27*theelous3 quit (Ping timeout: 240 seconds)
16:12:51shashlickWhat do c++ namespaces map to in Nim
16:19:57narimiranshashlick: i've sent you PM, so this is just a ping in the case you don't see it....
16:25:59shashlickCan you ping on #shashlick
16:26:23shashlickElse I don't get it
16:36:03*thomasross quit (Ping timeout: 240 seconds)
16:36:25shashlickUsing matterbridge to slack so am only kind of on irc
16:36:55disruptekdo you get irc pms?
16:37:02disruptekor PMs?
16:37:29shashlickNope I don't think matterbridge supports that yet
16:37:43*floppydh quit (Quit: WeeChat 2.6)
16:38:50disrupteki want branch #134?
16:38:58shashlickI used to use matrix but it is so unstable
16:39:12shashlickI'll merge it in a couple hours
16:39:16FromDiscord<Kiloneie> If i have a text file with 3 lines of text and then readLine and echo that line 3x times, why does readAll show empty string... if i readAll first it shows all 3 lines, is there some kind of voodoo that if something was read already it can't be read again or something ?
16:39:23disruptekokay, no hurry.
16:39:33shashlickNimgit2 is still failing so needs more cleanup
16:40:39narimiranKiloneie you have the final newline in your file
16:41:13*thomasross joined #nim
16:41:31narimiranif you do `splitlines` you will notice something like `@["abc", "def", "ghi", "\n"]`
16:41:41narimiranfor stuff like that, i use `strip`
16:42:26narimiran(or the last element is `""`, not sure)
16:44:23FromDiscord<Kiloneie> So basically what i said ? i added a 4th line of text, and readAll will output that AFTER reading a line 3x times
16:44:30FromDiscord<Kiloneie> so position in file moves
16:53:06*NimBot joined #nim
16:53:16Yardanico@Kiloneie as narimiran said, that's not a nim issue, it's just that you have an extra empty line in your file
16:59:26*adeohluwa joined #nim
17:00:56*ng0 quit (Ping timeout: 260 seconds)
17:01:11FromDiscord<Kiloneie> But i don't... i have the file open in VS Code, it shows only 3 lines, and it ends after the third line.
17:01:11FromDiscord<Kiloneie> https://cdn.discordapp.com/attachments/371759389889003532/631174246768443422/pic.PNG
17:01:36FromDiscord<Kiloneie> https://cdn.discordapp.com/attachments/371759389889003532/631174352565567498/p2.PNG
17:03:58FromGitter<alehander42> kiloneie typically readX
17:04:21FromGitter<alehander42> exactly yeah
17:04:33FromGitter<alehander42> all the readX move into the stream
17:04:44FromGitter<alehander42> so if you readLine, your position is now after it
17:05:11FromDiscord<Kiloneie> Okay thanks.
17:06:01FromGitter<alehander42> if you want this to not happen
17:06:07FromGitter<alehander42> it seems peekX
17:06:10FromGitter<alehander42> does it
17:06:24FromGitter<alehander42> e.g. peekLine
17:08:41*doesntgolf joined #nim
17:12:37*rockcavera quit (Remote host closed the connection)
17:13:19FromDiscord<Kiloneie> Okay
17:15:30*whaletechno joined #nim
17:22:39*shomodj joined #nim
17:23:26*shomodj quit (Client Quit)
17:29:05*nsf quit (Quit: WeeChat 2.5)
17:30:13*sealmove joined #nim
17:36:25*rockcavera joined #nim
17:37:47leorizeAraq: is there any plan for migrating stdlib to destructors?
17:44:26Araqleorize, hell yes, no more "uhm, who needs to close this socket" mess
17:44:54leorizedoes that also means less `ref` will be used? since copy blocking is now a thing
17:55:24FromDiscord<jeffutter> Is there a way to specify a type for an empty array (or openArray?) I’m trying to write something like algorithm.binarySearch but it blows up when I pass binarySearch([],1). I would want it to return -1 for [] always
17:56:26disruptekjust check the len() of the array?
17:56:49FromDiscord<jeffutter> I get a compiler warning when I try to pass [] in a test
17:57:24disruptekopenArray is like a typeclass that includes seq and array.
17:57:29disruptekwhat's the compiler's complaint?
18:00:00FromDiscord<jeffutter> This is the test:
18:00:01FromDiscord<jeffutter> ```
18:00:01FromDiscord<jeffutter> proc binarySearch[T](a: openArray[T], key: T): int =
18:00:01FromDiscord<jeffutter> var b = len(a)
18:00:01FromDiscord<jeffutter> while result < b:
18:00:01FromDiscord<jeffutter> var mid = (result + b) div 2
18:00:03FromDiscord<jeffutter> if a[mid] < key: result = mid + 1
18:00:03FromDiscord<jeffutter> else: b = mid
18:00:05FromDiscord<jeffutter> if result >= len(a) or a[result] != key: result = -1
18:00:06FromDiscord<jeffutter> ```
18:00:08FromDiscord<jeffutter> Error is:
18:00:09FromDiscord<jeffutter> ```
18:00:12FromDiscord<jeffutter> /usr/local/Cellar/nim/1.0.0/nim/lib/pure/unittest.nim(631, 43) Error: type mismatch: got <array[0..-1, empty], int literal(1)>
18:00:13FromDiscord<jeffutter> but expected one of:
18:00:15FromDiscord<jeffutter> proc binarySearch[T, K](a: openArray[T]; key: K;
18:00:17FromDiscord<jeffutter> cmp: proc (x: T; y: K): int {.closure.}): int
18:00:17disruptekit's best to use a pastebin in these scenarios.
18:00:18FromDiscord<jeffutter> first type mismatch at position: 3
18:00:20FromDiscord<jeffutter> missing parameter: cmp
18:00:22FromDiscord<jeffutter> proc binarySearch[T](a: openArray[T]; key: T): int
18:00:23FromDiscord<jeffutter> first type mismatch at position: 2
18:00:25FromDiscord<jeffutter> required type for key: T
18:00:25disruptekpeople get grumpy when you paste to irc.
18:00:26FromDiscord<jeffutter> but expression '1' is of type: int literal(1)
18:00:29FromDiscord<jeffutter> expression: binarySearch([], 1)
18:00:31FromDiscord<jeffutter> ```
18:00:32FromDiscord<jeffutter> Yeah, sorry I pasted the wrong code anyway 😄
18:00:34*FromGitter quit (Read error: Connection reset by peer)
18:00:37ZevvWell, that's quite a complaint. I expected it would be just loud neighbors, too high taxes and bad weather
18:00:38FromDiscord<jeffutter> I forgot this discord was linked to IRC
18:00:52*FromGitter joined #nim
18:01:29FromDiscord<jeffutter> https://gist.github.com/jeffutter/ebe4f1c6efb94cf57eabffa5d2fd9e42
18:01:43FromDiscord<jeffutter> That has my code and the error
18:02:01disruptekgive the array a type so it matches the signature.
18:03:10shashlick@disruptek - merged #134
18:04:55*shomodj joined #nim
18:06:58FromDiscord<jeffutter> disruptek: that worked, thanks.
18:10:48disruptekshashlick: thanks, i'll try building in a few. 👍
18:12:35*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:13:12*crem quit (Read error: Connection reset by peer)
18:16:21*crem joined #nim
18:16:43*asymptotically quit (Quit: Leaving)
18:28:05*nsf joined #nim
18:28:58*xace joined #nim
18:37:50*adeohluwa quit (Ping timeout: 265 seconds)
18:41:04FromGitter<alehander42> disruptek what you building
18:41:12disruptekpork tenderloin.
18:41:25*skoude joined #nim
18:41:32disruptekalso this benchmark thing.
18:42:43FromGitter<alehander42> this is the second time
18:42:46FromGitter<alehander42> i hear of tender loins
18:42:47FromGitter<alehander42> today
18:43:02FromGitter<alehander42> wow that's a single word, amazing
18:45:55*skoude quit (Ping timeout: 250 seconds)
19:22:08*absolutejam4 joined #nim
19:23:56shashlick@disruptek - how important is ssh support for nimgit2
19:24:51Zevvhow important is beer for zevv
19:38:41FromGitter<alehander42> how important is holland for netherlenads
19:39:46*theelous3 joined #nim
19:40:52FromDiscord<kodkuce> isnted writing if x > 5 and x < 10 is there a shorter way like if x in (5..10) or soemthing?
19:41:36FromDiscord<kodkuce> lol x in (5..10) works 🙂
19:41:49FromDiscord<kodkuce> solved my problem myself while writing
19:45:39lqdev[m]you can get rid of the parens, actually
19:46:26FromDiscord<kodkuce> bonus 🙂
19:59:23*nsf quit (Quit: WeeChat 2.5)
20:01:38*shomodj joined #nim
20:01:38*doesntgolf quit (Ping timeout: 240 seconds)
20:02:21shashlickneovim just blew off an entire file
20:03:17shashlicklost an hour of work
20:07:15shashlicknimsuggest leak issue
20:07:56disruptekthat sucks. no swpfile? no writes?
20:09:18shashlickwrites fail and if you exit, all bets are off
20:11:29disruptekah, that happened to me. i think i piped it to something to save it.
20:11:38disruptekhaven't had an issue recently, though.
20:16:57disruptekwhich neovim?
20:17:44disrupteki'm upgraded to that from 0.3.3 now. we'll see. 🤪
20:21:52Zevvshashlick: happened to me a few times. I still would run back to vim8 if I could take nim.nvim withe me.
20:22:18disruptekwith 0.4.2?
20:23:19Zevv0.3.8 I think
20:27:11*narimiran quit (Ping timeout: 268 seconds)
20:33:16FromDiscord<kodkuce> [FAILED] encode numbers
20:33:16FromDiscord<kodkuce> /home/me/Apps/Exercism/Work/nim/atbash-cipher/atbash_cipher_test.nim(44, 25): Check failed: encode(phrase) == expected
20:33:16FromDiscord<kodkuce> encode(phrase) was gifgs rhurx grlm
20:33:16FromDiscord<kodkuce> expected was gifgs rhurx grlm
20:33:58FromDiscord<kodkuce> hmm i tryed removing trailing whitespace but still got error hmm duno what magic is heppening
20:34:25shashlickWell I think it was nimsuggest leaking that caused writes to fail
20:34:43shashlickHave to be careful since I have many Nim versions
20:39:33FromDiscord<kodkuce> sorry pasted bot insted up form FAILED but basicly its the same
20:39:35FromDiscord<kodkuce> /home/me/Apps/Exercism/Work/nim/atbash-cipher/atbash_cipher_test.nim(39, 25): Check failed: encode(phrase) == expected
20:39:35FromDiscord<kodkuce> encode(phrase) was gvhgr mt123 gvhgr mt
20:39:35FromDiscord<kodkuce> expected was gvhgr mt123 gvhgr mt
20:39:35FromDiscord<kodkuce> [FAILED] encode numbers
20:40:16FromDiscord<kodkuce> and i did check if whitespace on end, what else could it be?
20:40:26FromDiscord<kodkuce> that invisible char?
20:40:40FromDiscord<kodkuce> that makes this giving me FAILED
20:41:46FromDiscord<kodkuce> duno what it was but i solve issue other way
20:51:22*clyybber quit (Quit: WeeChat 2.6)
20:55:03*Vladar quit (Remote host closed the connection)
21:05:56*whaletechno quit (Ping timeout: 240 seconds)
21:07:10*whaletechno joined #nim
21:15:58FromDiscord<kodkuce> 23/66 exercis 2 more years and will finish 🙂
21:22:57shashlick@disruptek - https://travis-ci.org/genotrance/nimgit2/builds/595317306 <= finally nimgit2 is working on linux and windows
21:23:01shashlickosx still holds out per usual
21:24:01*Trustable quit (Remote host closed the connection)
21:27:44disrupteknice, you badass!
21:28:12shashlickthere's still a general issue though
21:28:24shashlickright now, getHeader just links directly to the path where the .so file is
21:28:42shashlickso once the binary is created, it always looks for the .so in the same location
21:28:56shashlicki'm wondering how to dynamically link without hard-coding the path like that
21:29:00Zevvship it with nimble!
21:29:02*absolutejam4 quit (Ping timeout: 246 seconds)
21:29:41disruptekwhat would occasion a relocation of the binary?
21:29:48*whaletechno quit (Remote host closed the connection)
21:29:56shashlickif the binary is moved to another system?
21:30:00*whaletechho joined #nim
21:30:31Zevvthe usual meaning is that the loading addres of the binary is changed
21:30:55disruptekoh, you mean the path is encoded inside the binary.
21:31:30disruptekseems like a linking option should strip it.
21:31:40Zevvah that's a different relocation, I'll just shut up now
21:31:49shashlickbasically i'm setting dynlib = full path
21:32:04shashlicki'll just strip the path and update LD_LIBRARY_PATH
21:32:09disruptekwithout the path, the user will need to set LD_LIBRARY_PATH though.
21:34:01*whaletechho quit (Read error: Connection reset by peer)
21:34:46*whaletechno joined #nim
21:39:06disruptekyou didn't push that yet, right?
21:39:42disrupteki mean, nimterop changes?
21:41:22disruptekoh, just need a new release.
21:43:19*rockcavera quit (Remote host closed the connection)
21:47:58*rockcavera joined #nim
21:48:52disruptekman, shashlick, linking is way, way, way faster now.
21:51:23*solitudesf quit (Ping timeout: 250 seconds)
21:54:11*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:10:12*skoude joined #nim
22:15:20*skoude quit (Ping timeout: 265 seconds)
22:22:15*whaletechno quit (Quit: ha det bra)
22:45:19*lritter quit (Ping timeout: 268 seconds)
22:50:44*lritter joined #nim
22:52:51FromDiscord<treeform> oh we got windows ci?
22:52:58FromDiscord<treeform> thats good news
23:00:07FromDiscord<treeform> VC++ breaks all the time on windows
23:00:14FromDiscord<treeform> looks like that Ci uses gcc, still a good start
23:02:03shashlick@disruptek yep libgit2 made it immensely obvious
23:02:24FromGitter<zetashift> @treeform I was wondering why I had troubles with random crashes with godot-nim and vcc, with switching to gcc fixing it
23:02:35shashlick@treeform I've not added support for vc++ as of yet to nimterop
23:04:15shashlick@disruptek if you have a better way for dynamic linking, let me know
23:04:59disruptekthe problem is, if you strip the path how will the user find the lib?
23:05:30disrupteknimble doesn't install binary libs into a .nimble/lib or something, right? so...
23:08:24shashlickCould copy the dll somewhere
23:08:24shashlickBut ya it isn't perfect
23:08:50disrupteki think it's better to leave it as-is and let nimble sort it out in the future.
23:09:46*abm quit (Quit: Leaving)
23:11:38*tiorock joined #nim
23:11:46*tiorock quit (Changing host)
23:11:46*tiorock joined #nim
23:11:46*rockcavera quit (Killed (adams.freenode.net (Nickname regained by services)))
23:11:46*tiorock is now known as rockcavera
23:15:41sealmove!eval max(int)
23:15:42NimBotCompile failed: /usercode/in.nim(1, 4) Error: type mismatch: got <type int>
23:15:55sealmove!eval 50*1000
23:15:57NimBotCompile failed: /usercode/in.nim(1, 3) Error: expression '50000' is of type 'int literal(50000)' and has to be discarded
23:16:05sealmove!eval echo 50*1000
23:17:44*skoude joined #nim
23:21:56*skoude quit (Ping timeout: 240 seconds)
23:22:54shashlickRight now nimgit2 and other such wrappers downloads the upstream source code and resultant binaries into the nimble pkg directly
23:23:19shashlickMakes it hard to uninstall since nimble gets upset about these untracked files
23:23:29shashlickNeed to move these into some other location
23:23:38shashlickAny suggestions? Cross platform
23:23:41*rockcavera quit (Ping timeout: 276 seconds)
23:23:57*rockcavera joined #nim
23:23:57*rockcavera quit (Changing host)
23:23:57*rockcavera joined #nim
23:24:11disruptekneeds an RFC so lotsa people can agree that it's silly. 🙁
23:24:44disruptekit would be nice to have a place we can safely blow away to freshen a build/install, for one thing.
23:25:23disruptekbasically, it's hard to manage in a naive way right now, which is my personal complaint.
23:26:53shashlickInitially I was using temp
23:26:59shashlickBut that's a security issue
23:27:34shashlickCould use AppData and .cache like nimcache
23:28:20disrupteki don't think .cache makes sense because i want to assume i can remove it to _fix_ things, not to break things.
23:28:42shashlickMaybe just use nimcache
23:28:51shashlickWherever it is
23:28:56disrupteksame problem.
23:29:44disruptekfact is, there aren't many assumptions you can make about this stuff. probably the best you can do is to store retrieved assets separately and reconstitute the binaries on demand to yet another directory.
23:36:41*krux02_ joined #nim
23:39:17*krux02 quit (Ping timeout: 250 seconds)
23:50:59dv^_^Can I set the length of a seq to 0 without changing its capacity?
23:55:26dv^_^Ok, I'll try that. Thanks.
23:57:49dv^_^Is there a function to copy part of a seq into another seq? like memcpy