<< 30-01-2019 >>

00:00:01FromGitter<jivank> headless
00:00:45FromGitter<riddl_gitlab> it has its own webkit instance or that webgui starts in your default webbrowser
00:00:45FromGitter<riddl_gitlab> ?
00:01:11FromGitter<jivank> yeah webgui starts in your default webbrowser
00:02:07FromGitter<riddl_gitlab> ok, if one like to write html5/ccs/javascript interface
00:03:09FromGitter<jivank> haha i certainly dont like writing it but i guess it doesnt have to look pretty
00:03:31FromGitter<kaushalmodi> @riddl_gitlab https://ptpb.nim supports nim syntax (with minor bugs)
00:03:31FromGitter<riddl_gitlab> i've got no talent.. or maybe willpower to master that area
00:03:38FromGitter<kaushalmodi> *ptpb.pw
00:03:58FromGitter<riddl_gitlab> its overwhelming right one, that anormous number of frameworks for different aspects of web dev
00:04:00FromGitter<kaushalmodi> e.g.: https://ptpb.pw/TVd8/nim
00:04:15FromGitter<riddl_gitlab> @kaushalmodi thank you friend
00:04:30FromGitter<riddl_gitlab> bookmarked
00:11:40FromGitter<jivank> riddl, yes it seems like a lot to deal with. especially CSS
00:12:18*abm quit (Ping timeout: 268 seconds)
00:13:24FromGitter<riddl_gitlab> i've used https://bulma.io/ for css
00:14:15*MD87 joined #nim
00:37:36FromGitter<jivank> bulma is great. spectre is interesting too (popovers without js)
00:38:21FromGitter<jivank> also checkout intercoolerjs, its a pretty simple library if you dont want to type any js
00:38:27FromGitter<jivank> but i think css is the bigger problem for me
00:39:32FromGitter<jivank> and mithril.js is very simple version of vue/react and has http requests built in
00:44:51rayman22201Use nim all the way! Nim compiles to JS. use Karax :-)
00:50:05FromGitter<kaushalmodi> Reminds me of that experiment of creating JS Lambda functions using Nim with a lot of help from you, rayman22201
00:50:21rayman22201:-) That was fun
00:56:20*kapil____ quit (Quit: Connection closed for inactivity)
00:56:24*smitop quit (Quit: Connection closed for inactivity)
00:57:42FromGitter<riddl_gitlab> > and mithril.js is very simple version of vue/react and has http requests built in ⏎ thanks, that's nice one. I was fighting with vue and felt all that time its too complex for my usecase
01:04:49*ng0 quit (Ping timeout: 256 seconds)
01:48:43*zachcarter joined #nim
01:53:18*zachcarter quit (Ping timeout: 250 seconds)
01:54:34*skellock joined #nim
01:56:36*zachk quit (Quit: Leaving)
02:07:36*seni quit (Quit: Leaving)
02:15:24*Tyresc quit (Quit: WeeChat 2.4-dev)
02:21:20*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:24:16*zachcarter joined #nim
02:28:26*zachcarter quit (Ping timeout: 240 seconds)
02:49:54*zachcarter joined #nim
03:02:23*banc quit (Quit: Bye)
03:23:48*banc joined #nim
04:16:28*skellock quit (Ping timeout: 272 seconds)
04:18:05*exothermic[m] left #nim ("User left")
04:33:37*nsf joined #nim
05:22:15*dddddd quit (Remote host closed the connection)
05:41:13*darithorn joined #nim
05:58:12*darithorn quit (Remote host closed the connection)
06:02:09*narimiran joined #nim
06:33:46*kapil____ joined #nim
07:03:10*ryukoposting quit (Quit: WeeChat 1.6)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:53*gmpreussner joined #nim
08:32:04Zevvbroken gitter bridge?
08:34:58leorizeFromGitter: hi
08:34:59FromGitterleorize, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
08:35:28leorizestill working :)
08:37:22*absolutejam joined #nim
08:44:32*PMunch joined #nim
09:04:55*abm joined #nim
09:06:00*floppydh joined #nim
09:15:14*JustASlacker joined #nim
09:21:57*pagnol joined #nim
09:34:17*skellock joined #nim
09:46:33*pagnol quit (Ping timeout: 246 seconds)
09:55:19*Vladar joined #nim
09:59:41PMunchHmm, I have a note in genui examples saying "{.experimental.} # required for now, this will become default later"
10:00:05PMunchSeems to be related to passing ptr WxObject as a var WxObject
10:03:19leorizemust be for "autoDeref"
10:04:46*pagnol joined #nim
10:04:59PMunchYeah I think so
10:08:11Araqoh I found a better way to do autoDeref
10:09:25PMunchleorize, it was indeed "{.experimental: "implicitDeref".}"
10:09:30PMunchAraq, how?
10:09:54Araqtransform x.f() to f(x[]) but only if there is a dot involved
10:10:17Araqnobody wants p += 3 to be turned into p[] += 3
10:10:33PMunchThat would work for my example :)
10:10:33Araqwhich is why we had to make it behind the experimental switch
10:10:51PMunchHmm, well maybe net
10:11:04PMunchcontainer.setSizer(sizer)
10:11:16PMunchBoth container and sizer are "ptr WxObject"
10:11:30*Araq shrugs
10:11:32PMunchWhere WxObject is any object
10:11:39PMunchBet it would be better than nothing
10:12:28PMunchOh wait, that sizer is actually a ptr WxSizer
10:12:35Araqwe probably need to rethink these rules when smart pointers arrive
10:13:04PMunchSmart pointers?
10:13:25narimiranPMunch: yeah, they are currently at university, we're waiting for them to arrive home
10:13:28Araqhttps://github.com/nim-lang/Nim/pull/10485
10:13:57FromGitter<alehander42> narimiran if they get a phd, we won't even have jobs anymore
10:14:23Araqwhat are you talking about?
10:14:45PMunchSmart pointers
10:14:48narimiranjust making lame jokes
10:14:56Araqah ok
10:15:05PMunchThe regular pointers got sent to uni to become smart
10:16:14Araqinterestingly the outlined sharedPtr might be faster than Nim's builtin deferred RC algorithm
10:16:54PMunchHmm, that is interesting
10:18:35*dom96_w joined #nim
10:19:52Araqso ... on my fast machine bootstrapping takes 4s
10:20:05narimiranok, i need a new computer
10:20:18AraqGC takes about 1s, 25%
10:20:48Araqthe mark&sweep GC, that is, refc is much slower
10:20:56FromGitter<alehander42> huh, i expected gc to take less
10:21:33Araqmark phase: 814ms, sweeping phase: 198ms
10:22:02Araqthat means it really spends most of its time trying to figure out what is garbage
10:22:20Araqand it's pure overhead over manual memory management
10:22:22*kapil____ quit (Quit: Connection closed for inactivity)
10:23:02Araqwell since the compiler essentially builds up an ever-growing graph, that is expected
10:23:38FromGitter<alehander42> allocation/deallocation are part of the sweep phase? but mostly init objects probably
10:23:42FromGitter<alehander42> how much does allocation takes
10:25:43AraqI have no numbers on allocation but it is not included in these numbers
10:26:35Araqsweep is dealloc, yes, so shouldn't be considered, but the sweeping phase is 200ms
10:26:51Araqand marking is 800ms
10:27:07FromGitter<alehander42> without gc (with just leaving the memory to leak) how much time does it take
10:27:18FromGitter<alehander42> or is it using too much memory to measure
10:28:56Araq1.6GB, 3s bootstrapping
10:29:14Araqso yeah, the full second is saved
10:30:13dom96_wNice analysios
10:30:17dom96_w*analysis
10:30:19FromGitter<alehander42> so for now i should start passing --gc:none to my temp build :D
10:31:20Araqwe can do a nice trick, record the size for the Nim projects
10:31:27leorizeAraq: what would `ref`s become in --gc:destructor?
10:31:29Araqand tell the GC is expected heap size
10:32:42Araqleorize, the jury is still out, I prefer an explicit O(1) dispose call, everybody else prefers atomic refcounting
10:33:35Araq(= ARC)
10:34:08AraqARC works much better with most Nim code out there, except for the Nim compiler which would leak tons of cyclic garbage
10:34:33Araqon the other hand... it does the same today as we disable the cycle collection with refc
10:38:42Araqbut the compiler can continue to use a GC until forever as far as I'm concerned
10:39:08Araq25% of runtime is acceptable to me, speedups will come from incremental compilation
10:43:46*absolutejam quit (Ping timeout: 268 seconds)
10:47:09*skelett joined #nim
10:49:00FromGitter<bung87> possible create mixin attach to a type like in python?
10:49:26*absolutejam joined #nim
10:49:40*abm quit (Ping timeout: 246 seconds)
11:05:14Araqyou might be able to use proc foo(t: typedesc[MyType]; moreArgs) to "attach" a proc to a type
11:06:15*solitudesf quit (Quit: ZNC - https://znc.in)
11:06:40*solitudesf joined #nim
11:10:41*abm joined #nim
11:12:09*absolutejam quit (Ping timeout: 268 seconds)
11:13:12*abm quit (Client Quit)
11:13:42FromGitter<bung87> can you make it more longer? looks like make a new proc to a type
11:14:26FromGitter<bung87> I actually need take all properties and methods from a type
11:18:51Araqyou never know "all methods", they can hide in different modules
11:18:59*stefanos82 joined #nim
11:21:33FromGitter<alehander42> and users of your type can always add more methods
11:21:38FromGitter<alehander42> (procs)
11:21:46FromGitter<bung87> seems I needs copy paste properties and methods to it
11:22:00*CcxWrk quit (Ping timeout: 244 seconds)
11:22:24FromGitter<alehander42> what do you want to do ?
11:22:28FromGitter<alehander42> to achieve*
11:24:09FromGitter<bung87> that’s fine,but there’s another problem ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c518959f04ef00644ae34c7]
11:25:32*mbomba joined #nim
11:25:39FromGitter<bung87> I want something like `type A = object of MixinA,MixinB` but sounds not possible
11:27:12*CcxWrk joined #nim
11:28:00*mbomba quit (Client Quit)
11:28:43Araqyou can write a macro that does that
11:34:57*absolutejam joined #nim
11:35:39FromGitter<bung87> https://github.com/bung87/cero/blob/master/tests/test1.nim
11:44:24ZevvAraq: is there a robust way to find out in a macro of a node is about to declare a new symbol? I now need to check for 9 different kinds, is there a shortcut?
11:45:41Araqno.
11:45:51Zevvok
11:48:57FromGitter<bung87> even if I use macro ,I needs put all things to a macro body
11:53:33FromGitter<bung87> and does not solve makeConnnection not match the first type even it is a child of BaseProtocol
11:55:38*rockcavera quit (Ping timeout: 250 seconds)
11:55:52*narimiran quit (Remote host closed the connection)
11:56:42*abm joined #nim
12:00:11*narimiran joined #nim
12:00:20*narimiran quit (Remote host closed the connection)
12:00:57*narimiran joined #nim
12:01:30*ng0 joined #nim
12:06:27FromGitter<Vindaar> @bung87 `makeConnection` simply doesn't match because it expects a `transport` parameter, no?
12:08:48*solitudesf quit (Quit: ZNC - https://znc.in)
12:12:30FromGitter<bung87> yeah…my bad misunderstood the hint
12:17:50*solitudesf joined #nim
12:26:10*dddddd joined #nim
12:47:46*pagnol quit (Ping timeout: 244 seconds)
13:01:39*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:05:50*mwbrown quit (Ping timeout: 250 seconds)
13:06:26*kapil____ joined #nim
13:07:33*dddddd quit (Ping timeout: 245 seconds)
13:07:56*mwbrown joined #nim
13:10:11*pagnol joined #nim
13:10:54*Snircle joined #nim
13:13:07*dddddd joined #nim
13:33:14*skellock quit (Ping timeout: 244 seconds)
13:37:30*skellock joined #nim
13:39:29*dom96_w joined #nim
13:47:03*ng0 quit (Remote host closed the connection)
13:48:06*ng0 joined #nim
13:49:27*mwbrown quit (Ping timeout: 240 seconds)
13:58:49FromGitter<mratsim> was their some changes to exportc symbol resolution? now I can't even use a proc identifier in it
14:03:05*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:03:33*mwbrown joined #nim
14:05:37*dom96_w joined #nim
14:06:56*pagnol quit (Ping timeout: 250 seconds)
14:08:44Araqno but I don't think it was ever specified :P
14:08:54*solitudesf quit (Quit: ZNC - https://znc.in)
14:08:55Araquse unambiguous symbols
14:10:32shashlickHello Araq, seeing a random crash in nimterop on windows only in debug mode
14:11:04shashlickUsing segfaults module, it happens during some string operation and stack goes into gc
14:11:17shashlickNo failures on Linux or osx
14:11:28shashlickFails on devel and stable
14:11:41shashlickAny suggestions on how to debug?
14:14:44shashlickIllegal storage access without segfaults module
14:15:02shashlickhttps://ci.appveyor.com/project/genotrance/nimterop/builds/21984553/job/y4de14d7eos9hsyy#L606
14:17:53*solitudesf joined #nim
14:19:34shashlickHere's a stack trace sample but it moves around
14:19:34shashlickhttps://gitter.im/nimgen/Lobby?at=5c50c65f1b62f126506decde
14:23:24*mwbrown quit (Ping timeout: 246 seconds)
14:26:00*mwbrown joined #nim
14:30:03Araqcompile with --gc:markAndSweep ?
14:31:28*solitudesf quit (Quit: ZNC - https://znc.in)
14:34:19*pagnol joined #nim
14:37:40*mwbrown quit (Quit: Exiting)
14:43:38*solitudesf joined #nim
14:55:27*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:59:18Araqc:\binaries\nim-0.19.2\lib\system.nim(2916, 7) Error: unhandled exception: C:\Users\appveyor\.nimble\pkgs\nimterop-0.1.0\nimterop\cimport.nim(123, 12) `ret == 0`
15:06:27*skellock quit (Ping timeout: 240 seconds)
15:10:31shashlickThat's where cimport calls the toast binary which crashes
15:10:40shashlickI'll try the other gc
15:19:04*JustASlacker quit (Remote host closed the connection)
15:26:43*skellock joined #nim
15:28:23*pagnol quit (Ping timeout: 245 seconds)
15:31:29*Perkol joined #nim
15:37:04*skellock quit (Ping timeout: 250 seconds)
15:38:33*pagnol joined #nim
15:49:30*apscomp joined #nim
15:53:36*dom96_w joined #nim
15:56:36*planetis[m] joined #nim
15:56:44*PMunch quit (Remote host closed the connection)
15:57:18*manjaro-user-- joined #nim
15:57:54manjaro-user--hey
15:58:57*manjaro-user-- is now known as planetis
16:02:48*manjaro-user- joined #nim
16:03:20manjaro-user-Is an array[low(MyEnum)+1 .. high(MyEnum)], basically avoiding the None, good practice? Or it may lead to errors?
16:05:56*planetis quit (Ping timeout: 240 seconds)
16:15:17*manjaro-user-- joined #nim
16:15:22*manjaro-user-- quit (Client Quit)
16:17:11*smitop joined #nim
16:18:14*manjaro-user- quit (Ping timeout: 250 seconds)
16:22:13*zachcart1r joined #nim
16:23:04Araqmanjaro-user: it's what I use but array[MyEnum] is safer
16:24:10*zachcarter quit (Ping timeout: 268 seconds)
16:26:04*nsf quit (Quit: WeeChat 2.3)
16:31:57*manjaro-user- joined #nim
16:32:46manjaro-user-Thanks, my nick is b3liever in github, you can do whatever you want with my PRs
16:33:11manjaro-user-sorry $$$$ internet i have to go
16:33:15*manjaro-user- quit (Client Quit)
16:36:08Araqok
16:37:06*absolutejam quit (Ping timeout: 246 seconds)
16:40:22*ng0 quit (Remote host closed the connection)
16:41:24*ng0 joined #nim
16:44:53*Perkol quit (Quit: Leaving)
16:45:16*pagnol quit (Ping timeout: 246 seconds)
16:48:02*pagnol joined #nim
16:49:56*abm quit (Ping timeout: 240 seconds)
16:53:23*floppydh quit (Quit: WeeChat 2.3)
16:54:53*PMunch joined #nim
16:58:24*absolutejam joined #nim
17:11:10*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:12:28*dom96_w joined #nim
17:16:43*absolutejam quit (Ping timeout: 245 seconds)
17:17:10*platoff quit (Ping timeout: 250 seconds)
17:27:32shashlickAraq: --gc:markAndSweep fixed the issue
17:28:12shashlickdo you think it is a gc issue?
17:30:45dom96_wTime running out to change how this works, and I really want it to be changed into something more flexible and intuitive. Anybody agree: https://forum.nim-lang.org/t/4608#28815
17:31:43*pagnol quit (Ping timeout: 245 seconds)
17:33:46ZevvIs it worse then ##?
17:35:30ZevvI guess the problem is that it looks like stropping but it is not stropping
17:35:48dom96_wYou mean doc comments?
17:36:01dom96_woh, that's how it's done in C
17:36:02dom96_whuh
17:36:23dom96_wWe're not relying on a pre-processor, we should be able to make it much nicer
17:44:34*nsf joined #nim
17:49:18Zevvdefinately
18:03:57*Marumoto joined #nim
18:04:40*dantitt_ joined #nim
18:04:56*wildlander quit (Quit: Konversation terminated!)
18:06:36*Jesin quit (Quit: Leaving)
18:07:54*dantitt_ quit (Quit: Page closed)
18:10:38*wildlander joined #nim
18:16:46*zachk joined #nim
18:20:47*zachk quit (Changing host)
18:20:47*zachk joined #nim
18:25:22smitopHow can I make Nim include a DLL while compiling? I want it to include my ``freeglut.dll`` DLL, but I still get this error:
18:25:40smitop`could not load: (freeglut.dll|glut32.dll)`
18:29:49shashlickis it in your path
18:29:59smitophow do I do that?
18:30:02shashlickdlls are not compiled in
18:30:18shashlicktry putting the dll in the same folder as your executable
18:33:08smitopThey are in the same folder
18:33:24smitopbut I still get that error
18:35:45shashlickhow are you loading them? are you linking to them or using LoadLib
18:36:54smitopI'm using the `opengl` wrapper
18:40:43smitopwhich appears to use the `dynlib` pragma
18:41:12shashlickokay perhaps krux02 has some ideas
18:43:39FromGitter<Varriount> smitop: Are you running on Windows, or linux?
18:43:47smitopWindows
18:44:24FromGitter<Varriount> My guess would be then that your freeglut dll is (32-bit|64-bit), but your Nim compiler/program is (64-bit|32-bit).
18:44:42FromGitter<Varriount> That is, the DLL and executable aren't the same architecture.
18:46:58smitopThanks, that fixed it
18:47:56*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:55:05*kapil____ quit (Quit: Connection closed for inactivity)
18:55:08FromDiscord_<exelotl> dom96_w: the backtick identifier interpolation syntax never does what I want it to, it’s very unclear, I agree that it should be changed
19:08:40*rockcavera joined #nim
19:19:26*Vladar quit (Remote host closed the connection)
19:20:27*Jesin joined #nim
19:21:17*nsf quit (Quit: WeeChat 2.3)
19:23:48*ikan-keli_ quit (Ping timeout: 245 seconds)
19:24:36*darithorn joined #nim
19:33:32*ikan-keli_ joined #nim
19:35:36*solitudesf quit (Ping timeout: 252 seconds)
19:41:55*abm joined #nim
19:49:29*skellock joined #nim
19:52:46FromGitter<deech> Apparently Nim almost supports return type polymorphism: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Here `conceptf` can also be parameterized with the return type `string` implying that if the commented out `proc` wasn't rejected doing `echo conceptfint,typeof(foo) (foo)` would print 1. [https://gitter.im/nim-lang/Nim?at=5c52008dceb5a2264f68f0a0]
19:53:48*rockcavera quit (Ping timeout: 245 seconds)
20:05:27Araqdeech: keep up the good work. We are in a need for more formally trained people.
20:08:24FromGitter<deech> @Araq Thanks! Is there documentation explaining the difference between `C[R] = concept s, type T ...` and `C = concept s, type T, type R`? Is it an existential vs. universal type?
20:09:57*absolutejam joined #nim
20:10:44*rockcavera joined #nim
20:14:11*manjaro-user-- joined #nim
20:14:42*aguspiza joined #nim
20:15:53manjaro-user--hey again, my forum account is EmailUncofirmed, how can it be activeted?
20:19:06*PMunch_ joined #nim
20:19:35dom96by clicking the confirmation link in the email the forum should have sent to you
20:20:10*PMunch quit (Disconnected by services)
20:20:18*PMunch_ is now known as PMunch
20:20:30narimiranmanjaro-user--: why did you give up on your github PRs?
20:20:30manjaro-user--dom96: it says link expired
20:20:30*PMunch_ joined #nim
20:20:47dom96manjaro-user--: okay, then tell me your nickname and I'll activate it
20:21:33*manjaro-user__ joined #nim
20:22:16manjaro-user__namiran: I dont have a good internet connection for the time being...
20:22:29dom96manjaro-user__: what's your forum nick?
20:22:33manjaro-user__thanks dom96 its b3liever
20:22:55dom96okay, activated
20:23:07dom96joined oct '18 hah
20:23:21absolutejamdom96: can you sort mine please?
20:23:23absolutejamif you haven't
20:23:24dom96No wonder it expired :)
20:23:26manjaro-user__nice thanks
20:23:26absolutejamI haven't checked
20:23:42dom96done
20:24:04manjaro-user__made a post already :p
20:24:38*manjaro-user-- quit (Ping timeout: 245 seconds)
20:24:40absolutejamty dom96
20:30:07*manjaro-user__ quit (Ping timeout: 240 seconds)
20:30:29*Tyresc joined #nim
20:33:36*ryukoposting joined #nim
20:36:27*Tyresc quit (Ping timeout: 240 seconds)
20:36:54ryukopostingis there a way to specify a seq type with a length less than 10, or should I just use concepts to do that?
20:39:41*Tyresc joined #nim
20:40:07*solitudesf joined #nim
20:47:45*Tyresc quit (Ping timeout: 244 seconds)
20:52:05*apscomp quit (Quit: Page closed)
20:54:51*vlad1777d joined #nim
20:57:49*solitudesf quit (Quit: ZNC - https://znc.in)
20:57:56ryukoposting...anyone :(
20:59:41narimiranryukoposting: `array[10, type]`? :)
21:00:06ryukopostingdoes that allow for arrays less than a certain length, too?
21:01:02*solitudesf joined #nim
21:04:45FromGitter<kaushalmodi> may be you can post a sample of code where you intend to use that array
21:04:54FromGitter<kaushalmodi> the array will be auto-initialized
21:05:25FromGitter<kaushalmodi> you can set any number of elements in it, and may be keep a track of how many elements you added
21:05:25ryukopostingsure, I'll throw together a pastebin real quick
21:05:46FromGitter<kaushalmodi> *any number of elements as long as they don't exceed the array length
21:09:41Araqdeech: seems appropriate but who knows what the implementation does. :-)
21:10:21*narimiran quit (Remote host closed the connection)
21:10:58AraqI'm not happy with concepts but before I complain too much, I should write an article. And explore how to turn them into my vision for them.
21:11:24ryukopostingI like the way nim does them, for the most part
21:11:41ryukopostingmuch more ergonomic than equivalents in other imperative languages
21:16:26Araqsince we have duck-typing for generics the generics+concepts variant should avoid that and we should use them to typecheck *generic* procs, not only their instantiations.
21:16:45Araqotherwise 'concept' remains a feature not pulling its weight.
21:19:35Araqa concept is only a fancy generic constraint. But we could turn them into a decent type system for generic code.
21:20:30ryukopostingI think there's some inspiration to be drawn from haskell and friends, the way it uses "concepts" (though it doesn
21:20:48ryukoposting't call them that)
21:22:44*Tyresc joined #nim
21:23:40ryukopostingit almost kind of ties into how I can only call await inside a function with the right pragmas, for example; annotating a type with "length <= 10" allows for enhanced compile-time verification, which nim is already quite good at
21:24:53ryukopostingkaushalmodi I can't seem to get this to work with concepts either lol, I'll keep digging around. I'm sure there's a way to get the desired behavior with existing features
21:25:26*mal`` quit (Ping timeout: 240 seconds)
21:27:55Araqryukoposting: there is pure/collections/rtarrays.nim
21:28:29*mal`` joined #nim
21:29:57Araqin general you're on your own though, you need an array + your own current len indicator
21:30:09ryukopostingthanks Araq, this might be helpful
21:30:28*Tyresc quit (Ping timeout: 240 seconds)
21:30:58ryukopostingI was thinking I might just implement some kind of special seq from scratch, these might prove to be an easier stepping stone though
21:35:16ryukopostingI guess I could be lazy and just do array[1, string] | array[2, string] | array[3, string] ...
21:45:20FromGitter<kaushalmodi> Is run time failure an option?
21:45:29ryukopostingI'd really prefer it wasn't
21:45:43FromGitter<kaushalmodi> You can put a doAssert on seq len
21:45:59ryukopostingyeah, i know
21:46:44ryukopostingit's just nasty, you know? there's no reason why one couldn't create a type "sequence of length less than or equal to 10"
21:47:08ryukopostingit just requires re-implementing the entire seq type, with that one little addendum thrown in
21:54:36*solitudesf quit (Quit: ZNC - https://znc.in)
21:54:52*solitudesf joined #nim
22:02:09*aguspiza quit (Ping timeout: 244 seconds)
22:03:41*solitudesf quit (Quit: ZNC - https://znc.in)
22:03:59*solitudesf joined #nim
22:06:13rayman22201@ryukoposting, is this not good enough? https://pastebin.com/raw/azcDeVsm
22:08:16ryukopostingrayman22201 it does, I was hoping there would be some kind of way to get a seq of limited length but arrays will do the job
22:11:19rayman22201I see. Kind of hard to do that for seqs. In general a runtime datastructure needs a runtime check.
22:11:52*zachcart1r quit (Ping timeout: 272 seconds)
22:14:16ryukopostingthere's ways to do it, i.e. a sequence literal could have its length determined at compile time, for example
22:14:38rayman22201a sequence literal is not a seq
22:14:47rayman22201That is a special case
22:15:17ryukopostingthat's a particularly contrived example, but you get the idea. if a call to this function was made inside of an if someseq.len < 10, then it's reasonable to say that for lengthedseq[10, T], the call is valid
22:16:40ryukopostingI don't know what the compiler is doing behind the scenes, but it seems to be quite smart in terms of its ability to derive effects from syntax, so it seems to me that it isn't necessarily all that far away from being able to do what I just described
22:17:24*solitudesf quit (Quit: ZNC - https://znc.in)
22:17:38*solitudesf joined #nim
22:20:03rayman22201yeah, but that's not the issue. the len(seq) < 10 is the easy part. The hard part is figuring out len(seq). For an array (which has statically defined length) you can easily do it at compile time. But for a Nim Seq (length determined at runtime. You can add stuff and it will grow to fit), you cannot calculate the length at compile time. That is literally the halting problem in computer science. There are solutions to this,
22:20:03rayman22201for example the Idris language or Ada SPARK, but those are waaaayyyy more complicated than anything Nim does atm. Nim will probably get there one day, but not anytime soon lol.
22:20:47ryukopostingooookay, that's what I was kinda getting at was Idris
22:21:06*solitudesf quit (Client Quit)
22:21:34*solitudesf joined #nim
22:21:57rayman22201Nim has the basics to get there. Araq has toyed with the idea of doing a Nim version of that. But it's a big future project kind of thing.
22:22:31ryukopostingI wanted to provide sequences to make my API a bit more ergonomic for the user, but the array option still works well and the difference isn
22:22:37ryukopostingisn't the end of the world
22:23:38rayman22201It's one of those subtle things that seems so simple, but the actual implementation is the difference between "weekend project" and "PhD thesis" lol
22:24:13ryukopostinghere's the solution I put together, as an aside https://dailyprog.org/f/d7te/
22:26:30ryukopostingusing low(TS) is probably better than using 0 as the index, gonna change that but otherwise this works for my purposes
22:33:07rayman22201why use the 0 element? That means you cannot have empty arrays
22:33:45ryukopostingis there a better way to check the contained type of an array? I'm somewhat new to nim
22:36:07rayman22201have to look up the syntax. hold on.
22:50:41*PMunch quit (Remote host closed the connection)
22:53:42FromGitter<kaushalmodi> Would $type(var) work?
22:56:32rayman22201that gives the string name of the type. I thought you could compare types directly...
22:57:49FromGitter<kaushalmodi> `is`
22:58:10FromGitter<kaushalmodi> But that would have the array length in it
22:58:28rayman22201so does $type :-P
22:58:31rayman22201that's the problem
22:58:50FromGitter<kaushalmodi> We can parse the $type
22:59:37FromGitter<kaushalmodi> Like.. look for `array[.*, int]`
22:59:50rayman22201NOOOOOOO
23:00:02rayman22201string parsing is bad! We have a real type system, we just need to use it
23:00:05FromGitter<kaushalmodi> Hehe
23:07:28*abm quit (Ping timeout: 268 seconds)
23:10:07FromGitter<couven92> You could write a macro! 😂
23:12:46rayman22201lol
23:13:21rayman22201That's nuts to me. You can't pull the type out of an array in a concept.... hrmm... this seems like a useful feature.
23:13:37rayman22201nvm then I suppose
23:15:13ryukopostingseems like something macros can probably do
23:15:23rayman22201You can do it in a macro easily
23:15:33rayman22201I just find it odd that you can't do it in a concept
23:15:59ryukoposting(are recursive macros on someone's to-do list? seems like they could be pretty powerful)
23:16:17rayman22201What do you mean? You can do recursion in macros
23:16:53*PMunch_ quit (Remote host closed the connection)
23:16:57ryukopostingI get Error: recursive dependency
23:17:13rayman22201post code?
23:17:20rayman22201Macros can call regular functions
23:17:41rayman22201You most likely want to refactor your code into a Macro + a helper proc that does the recursion
23:19:13ryukopostinghttps://dailyprog.org/f/80fe
23:19:33ryukopostingprobably abuse of macros, and im not even sure if what I'm trying to do would even work in the first place, but there it is
23:21:46rayman22201Lol. Why not use the concept? You are just trying other approaches?
23:21:59ryukopostingyeah, just wanted to see if it would work
23:37:27*shashlick quit (Ping timeout: 240 seconds)
23:38:33*darithorn quit (Quit: Leaving)
23:41:14*shashlick joined #nim
23:42:55*shashlick quit (Remote host closed the connection)
23:55:28*skellock quit (Ping timeout: 245 seconds)