00:00:01 | FromGitter | <jivank> headless |
00:00:45 | FromGitter | <riddl_gitlab> it has its own webkit instance or that webgui starts in your default webbrowser |
00:00:45 | FromGitter | <riddl_gitlab> ? |
00:01:11 | FromGitter | <jivank> yeah webgui starts in your default webbrowser |
00:02:07 | FromGitter | <riddl_gitlab> ok, if one like to write html5/ccs/javascript interface |
00:03:09 | FromGitter | <jivank> haha i certainly dont like writing it but i guess it doesnt have to look pretty |
00:03:31 | FromGitter | <kaushalmodi> @riddl_gitlab https://ptpb.nim supports nim syntax (with minor bugs) |
00:03:31 | FromGitter | <riddl_gitlab> i've got no talent.. or maybe willpower to master that area |
00:03:38 | FromGitter | <kaushalmodi> *ptpb.pw |
00:03:58 | FromGitter | <riddl_gitlab> its overwhelming right one, that anormous number of frameworks for different aspects of web dev |
00:04:00 | FromGitter | <kaushalmodi> e.g.: https://ptpb.pw/TVd8/nim |
00:04:15 | FromGitter | <riddl_gitlab> @kaushalmodi thank you friend |
00:04:30 | FromGitter | <riddl_gitlab> bookmarked |
00:11:40 | FromGitter | <jivank> riddl, yes it seems like a lot to deal with. especially CSS |
00:12:18 | * | abm quit (Ping timeout: 268 seconds) |
00:13:24 | FromGitter | <riddl_gitlab> i've used https://bulma.io/ for css |
00:14:15 | * | MD87 joined #nim |
00:37:36 | FromGitter | <jivank> bulma is great. spectre is interesting too (popovers without js) |
00:38:21 | FromGitter | <jivank> also checkout intercoolerjs, its a pretty simple library if you dont want to type any js |
00:38:27 | FromGitter | <jivank> but i think css is the bigger problem for me |
00:39:32 | FromGitter | <jivank> and mithril.js is very simple version of vue/react and has http requests built in |
00:44:51 | rayman22201 | Use nim all the way! Nim compiles to JS. use Karax :-) |
00:50:05 | FromGitter | <kaushalmodi> Reminds me of that experiment of creating JS Lambda functions using Nim with a lot of help from you, rayman22201 |
00:50:21 | rayman22201 | :-) 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:42 | FromGitter | <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:04 | Zevv | broken gitter bridge? |
08:34:58 | leorize | FromGitter: hi |
08:34:59 | FromGitter | leorize, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
08:35:28 | leorize | still 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:41 | PMunch | Hmm, I have a note in genui examples saying "{.experimental.} # required for now, this will become default later" |
10:00:05 | PMunch | Seems to be related to passing ptr WxObject as a var WxObject |
10:03:19 | leorize | must be for "autoDeref" |
10:04:46 | * | pagnol joined #nim |
10:04:59 | PMunch | Yeah I think so |
10:08:11 | Araq | oh I found a better way to do autoDeref |
10:09:25 | PMunch | leorize, it was indeed "{.experimental: "implicitDeref".}" |
10:09:30 | PMunch | Araq, how? |
10:09:54 | Araq | transform x.f() to f(x[]) but only if there is a dot involved |
10:10:17 | Araq | nobody wants p += 3 to be turned into p[] += 3 |
10:10:33 | PMunch | That would work for my example :) |
10:10:33 | Araq | which is why we had to make it behind the experimental switch |
10:10:51 | PMunch | Hmm, well maybe net |
10:11:04 | PMunch | container.setSizer(sizer) |
10:11:16 | PMunch | Both container and sizer are "ptr WxObject" |
10:11:30 | * | Araq shrugs |
10:11:32 | PMunch | Where WxObject is any object |
10:11:39 | PMunch | Bet it would be better than nothing |
10:12:28 | PMunch | Oh wait, that sizer is actually a ptr WxSizer |
10:12:35 | Araq | we probably need to rethink these rules when smart pointers arrive |
10:13:04 | PMunch | Smart pointers? |
10:13:25 | narimiran | PMunch: yeah, they are currently at university, we're waiting for them to arrive home |
10:13:28 | Araq | https://github.com/nim-lang/Nim/pull/10485 |
10:13:57 | FromGitter | <alehander42> narimiran if they get a phd, we won't even have jobs anymore |
10:14:23 | Araq | what are you talking about? |
10:14:45 | PMunch | Smart pointers |
10:14:48 | narimiran | just making lame jokes |
10:14:56 | Araq | ah ok |
10:15:05 | PMunch | The regular pointers got sent to uni to become smart |
10:16:14 | Araq | interestingly the outlined sharedPtr might be faster than Nim's builtin deferred RC algorithm |
10:16:54 | PMunch | Hmm, that is interesting |
10:18:35 | * | dom96_w joined #nim |
10:19:52 | Araq | so ... on my fast machine bootstrapping takes 4s |
10:20:05 | narimiran | ok, i need a new computer |
10:20:18 | Araq | GC takes about 1s, 25% |
10:20:48 | Araq | the mark&sweep GC, that is, refc is much slower |
10:20:56 | FromGitter | <alehander42> huh, i expected gc to take less |
10:21:33 | Araq | mark phase: 814ms, sweeping phase: 198ms |
10:22:02 | Araq | that means it really spends most of its time trying to figure out what is garbage |
10:22:20 | Araq | and it's pure overhead over manual memory management |
10:22:22 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:23:02 | Araq | well since the compiler essentially builds up an ever-growing graph, that is expected |
10:23:38 | FromGitter | <alehander42> allocation/deallocation are part of the sweep phase? but mostly init objects probably |
10:23:42 | FromGitter | <alehander42> how much does allocation takes |
10:25:43 | Araq | I have no numbers on allocation but it is not included in these numbers |
10:26:35 | Araq | sweep is dealloc, yes, so shouldn't be considered, but the sweeping phase is 200ms |
10:26:51 | Araq | and marking is 800ms |
10:27:07 | FromGitter | <alehander42> without gc (with just leaving the memory to leak) how much time does it take |
10:27:18 | FromGitter | <alehander42> or is it using too much memory to measure |
10:28:56 | Araq | 1.6GB, 3s bootstrapping |
10:29:14 | Araq | so yeah, the full second is saved |
10:30:13 | dom96_w | Nice analysios |
10:30:17 | dom96_w | *analysis |
10:30:19 | FromGitter | <alehander42> so for now i should start passing --gc:none to my temp build :D |
10:31:20 | Araq | we can do a nice trick, record the size for the Nim projects |
10:31:27 | leorize | Araq: what would `ref`s become in --gc:destructor? |
10:31:29 | Araq | and tell the GC is expected heap size |
10:32:42 | Araq | leorize, the jury is still out, I prefer an explicit O(1) dispose call, everybody else prefers atomic refcounting |
10:33:35 | Araq | (= ARC) |
10:34:08 | Araq | ARC works much better with most Nim code out there, except for the Nim compiler which would leak tons of cyclic garbage |
10:34:33 | Araq | on the other hand... it does the same today as we disable the cycle collection with refc |
10:38:42 | Araq | but the compiler can continue to use a GC until forever as far as I'm concerned |
10:39:08 | Araq | 25% 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:00 | FromGitter | <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:14 | Araq | you 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:42 | FromGitter | <bung87> can you make it more longer? looks like make a new proc to a type |
11:14:26 | FromGitter | <bung87> I actually need take all properties and methods from a type |
11:18:51 | Araq | you never know "all methods", they can hide in different modules |
11:18:59 | * | stefanos82 joined #nim |
11:21:33 | FromGitter | <alehander42> and users of your type can always add more methods |
11:21:38 | FromGitter | <alehander42> (procs) |
11:21:46 | FromGitter | <bung87> seems I needs copy paste properties and methods to it |
11:22:00 | * | CcxWrk quit (Ping timeout: 244 seconds) |
11:22:24 | FromGitter | <alehander42> what do you want to do ? |
11:22:28 | FromGitter | <alehander42> to achieve* |
11:24:09 | FromGitter | <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:39 | FromGitter | <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:43 | Araq | you can write a macro that does that |
11:34:57 | * | absolutejam joined #nim |
11:35:39 | FromGitter | <bung87> https://github.com/bung87/cero/blob/master/tests/test1.nim |
11:44:24 | Zevv | Araq: 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:41 | Araq | no. |
11:45:51 | Zevv | ok |
11:48:57 | FromGitter | <bung87> even if I use macro ,I needs put all things to a macro body |
11:53:33 | FromGitter | <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:27 | FromGitter | <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:30 | FromGitter | <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:49 | FromGitter | <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:44 | Araq | no but I don't think it was ever specified :P |
14:08:54 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
14:08:55 | Araq | use unambiguous symbols |
14:10:32 | shashlick | Hello Araq, seeing a random crash in nimterop on windows only in debug mode |
14:11:04 | shashlick | Using segfaults module, it happens during some string operation and stack goes into gc |
14:11:17 | shashlick | No failures on Linux or osx |
14:11:28 | shashlick | Fails on devel and stable |
14:11:41 | shashlick | Any suggestions on how to debug? |
14:14:44 | shashlick | Illegal storage access without segfaults module |
14:15:02 | shashlick | https://ci.appveyor.com/project/genotrance/nimterop/builds/21984553/job/y4de14d7eos9hsyy#L606 |
14:17:53 | * | solitudesf joined #nim |
14:19:34 | shashlick | Here's a stack trace sample but it moves around |
14:19:34 | shashlick | https://gitter.im/nimgen/Lobby?at=5c50c65f1b62f126506decde |
14:23:24 | * | mwbrown quit (Ping timeout: 246 seconds) |
14:26:00 | * | mwbrown joined #nim |
14:30:03 | Araq | compile 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:18 | Araq | c:\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:31 | shashlick | That's where cimport calls the toast binary which crashes |
15:10:40 | shashlick | I'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:54 | manjaro-user-- | hey |
15:58:57 | * | manjaro-user-- is now known as planetis |
16:02:48 | * | manjaro-user- joined #nim |
16:03:20 | manjaro-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:04 | Araq | manjaro-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:46 | manjaro-user- | Thanks, my nick is b3liever in github, you can do whatever you want with my PRs |
16:33:11 | manjaro-user- | sorry $$$$ internet i have to go |
16:33:15 | * | manjaro-user- quit (Client Quit) |
16:36:08 | Araq | ok |
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:32 | shashlick | Araq: --gc:markAndSweep fixed the issue |
17:28:12 | shashlick | do you think it is a gc issue? |
17:30:45 | dom96_w | Time 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:46 | Zevv | Is it worse then ##? |
17:35:30 | Zevv | I guess the problem is that it looks like stropping but it is not stropping |
17:35:48 | dom96_w | You mean doc comments? |
17:36:01 | dom96_w | oh, that's how it's done in C |
17:36:02 | dom96_w | huh |
17:36:23 | dom96_w | We're not relying on a pre-processor, we should be able to make it much nicer |
17:44:34 | * | nsf joined #nim |
17:49:18 | Zevv | definately |
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:22 | smitop | How 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:40 | smitop | `could not load: (freeglut.dll|glut32.dll)` |
18:29:49 | shashlick | is it in your path |
18:29:59 | smitop | how do I do that? |
18:30:02 | shashlick | dlls are not compiled in |
18:30:18 | shashlick | try putting the dll in the same folder as your executable |
18:33:08 | smitop | They are in the same folder |
18:33:24 | smitop | but I still get that error |
18:35:45 | shashlick | how are you loading them? are you linking to them or using LoadLib |
18:36:54 | smitop | I'm using the `opengl` wrapper |
18:40:43 | smitop | which appears to use the `dynlib` pragma |
18:41:12 | shashlick | okay perhaps krux02 has some ideas |
18:43:39 | FromGitter | <Varriount> smitop: Are you running on Windows, or linux? |
18:43:47 | smitop | Windows |
18:44:24 | FromGitter | <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:42 | FromGitter | <Varriount> That is, the DLL and executable aren't the same architecture. |
18:46:58 | smitop | Thanks, 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:08 | FromDiscord_ | <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:46 | FromGitter | <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:27 | Araq | deech: keep up the good work. We are in a need for more formally trained people. |
20:08:24 | FromGitter | <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:53 | manjaro-user-- | hey again, my forum account is EmailUncofirmed, how can it be activeted? |
20:19:06 | * | PMunch_ joined #nim |
20:19:35 | dom96 | by 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:30 | narimiran | manjaro-user--: why did you give up on your github PRs? |
20:20:30 | manjaro-user-- | dom96: it says link expired |
20:20:30 | * | PMunch_ joined #nim |
20:20:47 | dom96 | manjaro-user--: okay, then tell me your nickname and I'll activate it |
20:21:33 | * | manjaro-user__ joined #nim |
20:22:16 | manjaro-user__ | namiran: I dont have a good internet connection for the time being... |
20:22:29 | dom96 | manjaro-user__: what's your forum nick? |
20:22:33 | manjaro-user__ | thanks dom96 its b3liever |
20:22:55 | dom96 | okay, activated |
20:23:07 | dom96 | joined oct '18 hah |
20:23:21 | absolutejam | dom96: can you sort mine please? |
20:23:23 | absolutejam | if you haven't |
20:23:24 | dom96 | No wonder it expired :) |
20:23:26 | manjaro-user__ | nice thanks |
20:23:26 | absolutejam | I haven't checked |
20:23:42 | dom96 | done |
20:24:04 | manjaro-user__ | made a post already :p |
20:24:38 | * | manjaro-user-- quit (Ping timeout: 245 seconds) |
20:24:40 | absolutejam | ty 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:54 | ryukoposting | is 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:56 | ryukoposting | ...anyone :( |
20:59:41 | narimiran | ryukoposting: `array[10, type]`? :) |
21:00:06 | ryukoposting | does that allow for arrays less than a certain length, too? |
21:01:02 | * | solitudesf joined #nim |
21:04:45 | FromGitter | <kaushalmodi> may be you can post a sample of code where you intend to use that array |
21:04:54 | FromGitter | <kaushalmodi> the array will be auto-initialized |
21:05:25 | FromGitter | <kaushalmodi> you can set any number of elements in it, and may be keep a track of how many elements you added |
21:05:25 | ryukoposting | sure, I'll throw together a pastebin real quick |
21:05:46 | FromGitter | <kaushalmodi> *any number of elements as long as they don't exceed the array length |
21:09:41 | Araq | deech: seems appropriate but who knows what the implementation does. :-) |
21:10:21 | * | narimiran quit (Remote host closed the connection) |
21:10:58 | Araq | I'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:24 | ryukoposting | I like the way nim does them, for the most part |
21:11:41 | ryukoposting | much more ergonomic than equivalents in other imperative languages |
21:16:26 | Araq | since 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:45 | Araq | otherwise 'concept' remains a feature not pulling its weight. |
21:19:35 | Araq | a concept is only a fancy generic constraint. But we could turn them into a decent type system for generic code. |
21:20:30 | ryukoposting | I think there's some inspiration to be drawn from haskell and friends, the way it uses "concepts" (though it doesn |
21:20:48 | ryukoposting | 't call them that) |
21:22:44 | * | Tyresc joined #nim |
21:23:40 | ryukoposting | it 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:53 | ryukoposting | kaushalmodi 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:55 | Araq | ryukoposting: there is pure/collections/rtarrays.nim |
21:28:29 | * | mal`` joined #nim |
21:29:57 | Araq | in general you're on your own though, you need an array + your own current len indicator |
21:30:09 | ryukoposting | thanks Araq, this might be helpful |
21:30:28 | * | Tyresc quit (Ping timeout: 240 seconds) |
21:30:58 | ryukoposting | I 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:16 | ryukoposting | I guess I could be lazy and just do array[1, string] | array[2, string] | array[3, string] ... |
21:45:20 | FromGitter | <kaushalmodi> Is run time failure an option? |
21:45:29 | ryukoposting | I'd really prefer it wasn't |
21:45:43 | FromGitter | <kaushalmodi> You can put a doAssert on seq len |
21:45:59 | ryukoposting | yeah, i know |
21:46:44 | ryukoposting | it'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:08 | ryukoposting | it 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:13 | rayman22201 | @ryukoposting, is this not good enough? https://pastebin.com/raw/azcDeVsm |
22:08:16 | ryukoposting | rayman22201 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:19 | rayman22201 | I 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:16 | ryukoposting | there's ways to do it, i.e. a sequence literal could have its length determined at compile time, for example |
22:14:38 | rayman22201 | a sequence literal is not a seq |
22:14:47 | rayman22201 | That is a special case |
22:15:17 | ryukoposting | that'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:40 | ryukoposting | I 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:03 | rayman22201 | yeah, 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:03 | rayman22201 | for 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:47 | ryukoposting | ooookay, 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:57 | rayman22201 | Nim 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:31 | ryukoposting | I 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:37 | ryukoposting | isn't the end of the world |
22:23:38 | rayman22201 | It'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:13 | ryukoposting | here's the solution I put together, as an aside https://dailyprog.org/f/d7te/ |
22:26:30 | ryukoposting | using low(TS) is probably better than using 0 as the index, gonna change that but otherwise this works for my purposes |
22:33:07 | rayman22201 | why use the 0 element? That means you cannot have empty arrays |
22:33:45 | ryukoposting | is there a better way to check the contained type of an array? I'm somewhat new to nim |
22:36:07 | rayman22201 | have to look up the syntax. hold on. |
22:50:41 | * | PMunch quit (Remote host closed the connection) |
22:53:42 | FromGitter | <kaushalmodi> Would $type(var) work? |
22:56:32 | rayman22201 | that gives the string name of the type. I thought you could compare types directly... |
22:57:49 | FromGitter | <kaushalmodi> `is` |
22:58:10 | FromGitter | <kaushalmodi> But that would have the array length in it |
22:58:28 | rayman22201 | so does $type :-P |
22:58:31 | rayman22201 | that's the problem |
22:58:50 | FromGitter | <kaushalmodi> We can parse the $type |
22:59:37 | FromGitter | <kaushalmodi> Like.. look for `array[.*, int]` |
22:59:50 | rayman22201 | NOOOOOOO |
23:00:02 | rayman22201 | string parsing is bad! We have a real type system, we just need to use it |
23:00:05 | FromGitter | <kaushalmodi> Hehe |
23:07:28 | * | abm quit (Ping timeout: 268 seconds) |
23:10:07 | FromGitter | <couven92> You could write a macro! 😂 |
23:12:46 | rayman22201 | lol |
23:13:21 | rayman22201 | That'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:37 | rayman22201 | nvm then I suppose |
23:15:13 | ryukoposting | seems like something macros can probably do |
23:15:23 | rayman22201 | You can do it in a macro easily |
23:15:33 | rayman22201 | I just find it odd that you can't do it in a concept |
23:15:59 | ryukoposting | (are recursive macros on someone's to-do list? seems like they could be pretty powerful) |
23:16:17 | rayman22201 | What do you mean? You can do recursion in macros |
23:16:53 | * | PMunch_ quit (Remote host closed the connection) |
23:16:57 | ryukoposting | I get Error: recursive dependency |
23:17:13 | rayman22201 | post code? |
23:17:20 | rayman22201 | Macros can call regular functions |
23:17:41 | rayman22201 | You most likely want to refactor your code into a Macro + a helper proc that does the recursion |
23:19:13 | ryukoposting | https://dailyprog.org/f/80fe |
23:19:33 | ryukoposting | probably 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:46 | rayman22201 | Lol. Why not use the concept? You are just trying other approaches? |
23:21:59 | ryukoposting | yeah, 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) |