[00:00.000 --> 00:16.760] Okay, please welcome our next speaker, Ivan, to talk about contracts for free. [00:16.760 --> 00:17.760] Hi everyone. [00:17.760 --> 00:25.360] It's a really quick talk about the Akitoi project and some unpopular opinion about [00:25.360 --> 00:29.000] using runtime types. [00:29.000 --> 00:35.040] So the thing is, there is an old issue, maybe you know it, in NICS, which was closed since [00:35.040 --> 00:40.120] because it will never be implemented, which is a bit embarrassing about the fact that [00:40.120 --> 00:50.600] NICS have no any static type system, and the thing is, I changed my mindset relatively [00:50.600 --> 00:57.840] recently about that, but I will talk about it later, because what's the issue about the [00:57.840 --> 00:58.840] type system? [00:58.840 --> 01:04.360] It's the lack of a static type system, it's the error you'll get, you'll get them at [01:04.360 --> 01:05.360] the last moment. [01:05.360 --> 01:11.240] It's really inconsistent regarding where the mistakes were made, and when you read your [01:11.240 --> 01:17.760] stack trace, you get out time to find what was the actual error, and that is really not [01:17.760 --> 01:22.760] helpless for, for example, beginners trying to work on NICS expression or people trying [01:22.760 --> 01:27.080] to debug NICS expression right then by other person. [01:27.080 --> 01:36.600] So I changed my mindset because NICS is a really simple language, and it should be a [01:36.600 --> 01:42.560] simple language, and it invites us to build construct in library space, and if you look [01:42.560 --> 01:47.280] at NICS built-ins, for example, it's really few built-ins, and a lot of things that could [01:47.280 --> 01:52.920] be built-ins are actually implemented as NICS by Quage, LibSync, and there is a NICS by [01:52.920 --> 02:00.760] Quage, LibTypes, maybe without NNES, which is what you use when you define NICS option [02:00.760 --> 02:09.200] to say the option could be that or that and everything, and so I changed my mindset because [02:09.200 --> 02:16.200] NICS is made in two steps, you know, so it's the first step that you evaluate the language [02:16.200 --> 02:23.160] and produce things in NICS to review, symbols in NICS store, and after you build, you made [02:23.160 --> 02:29.400] your Quage, but the instantiate part is guaranteed to terminate, you know, you will, the computation [02:29.400 --> 02:35.400] will always terminate, which is what you expect for a type system actually, and which is not [02:35.400 --> 02:42.240] the case of some type system or most of macro systems that are not expected to terminate, [02:42.240 --> 02:51.720] so actually it's a good guarantee, and that's why we could do a lot of things in NICS, you [02:51.720 --> 02:58.120] can see it as, I changed my mind because I see that NICS is not really about the runtime [02:58.120 --> 03:04.720] and programming language, so we could do a check at runtime, and I wrote a thing while [03:04.720 --> 03:11.320] a vacation and realized later that other folks already did it, which is Tajjin, maybe you [03:11.320 --> 03:18.280] know him, he works on Twix, Twix right now, and he also writes NICS OnePager, one of the [03:18.280 --> 03:25.720] best NICS starting guide at some point, and the thing is, it's really simple, you define [03:25.720 --> 03:32.880] the data you want, just validate your function, so you say, I want something like that, and [03:32.880 --> 03:38.160] you check at this point of your NICS expression what it evaluates, that's its respect to a [03:38.160 --> 03:46.080] contract, a validator function, and that's help actually there to fail early where you [03:46.080 --> 03:54.200] want it to fail, there is differences in implementation, I will not talk really about, but I really [03:54.200 --> 03:59.480] simply didn't rely on NICS package, and it's fully compatible with NICS exception, so you [03:59.480 --> 04:11.720] can define a thing, and the last thing is, those composes, I go back inside, you can [04:11.720 --> 04:17.480] define types, you can define validator, instruct, that became validator, and you can compose [04:17.480 --> 04:23.720] really complex things, because it's really expressive, and also the nice things with [04:23.720 --> 04:30.720] runtime types is you can produce recoverable error, which is the case for types errors that [04:30.720 --> 04:36.920] exist in NICS itself, so for example, this will be unrecoverable, but if you use the [04:36.920 --> 04:44.960] runtime type, you would recover this situation. Last thing is, I try to advertise this kind [04:44.960 --> 04:53.880] of technique, because it helps a lot to debugs your application and to have assertion about [04:53.880 --> 05:02.680] this, respect that and everything, it doesn't really solve the problem, because it's not [05:02.680 --> 05:09.920] a real type system actually, but if you're not starting something from scratch, if you [05:09.920 --> 05:14.600] actually working on an existing NICS expression, NICS expression could be actually really large, [05:14.600 --> 05:19.680] I think personally it helps, if you're starting a new thing from scratch, there's really cool [05:19.680 --> 05:24.960] things like Q, dial, NICL, generate JSON, and you use that live in NICS package, so you [05:24.960 --> 05:31.360] can use it really easily, and there is also, I like personally plural NICS, because it [05:31.360 --> 05:42.320] generates NICS output results and JSON, okay, I think I said most of what I would say, so [05:42.320 --> 05:47.320] don't hesitate if you have a question or want to share it with you. You don't have time? [05:47.320 --> 06:15.340] Thank you, it was really good presentation.