WEBVTT

00:00.000 --> 00:11.000
This is going to be fast.

00:11.000 --> 00:16.000
This is our sort of content that we'll need to explain this.

00:16.000 --> 00:21.000
I condensed that in like a 40-minute stock that I present to a 20-minute thought,

00:21.000 --> 00:23.000
and I end up with a line in talk.

00:23.000 --> 00:26.000
So let's see what it's going to happen.

00:26.000 --> 00:29.000
What I want to explain is what is the sync package and how it's built.

00:29.000 --> 00:31.000
I can just keep things.

00:31.000 --> 00:34.000
The main thing that you have to know is based in two building blocks.

00:34.000 --> 00:36.000
One of them is atomic operations.

00:36.000 --> 00:42.000
Atomic operations are helping for doing things like adding numbers in concurrent way.

00:42.000 --> 00:47.000
What is doing is basically taking the CPU instructions and say,

00:47.000 --> 00:48.000
hey, take care of that.

00:48.000 --> 00:51.000
So the CPU is taking care of serializing that execution,

00:51.000 --> 00:54.000
and ensuring that there's nothing happening at the same time.

00:54.000 --> 00:58.000
There's no other process modifying the value.

00:58.000 --> 01:00.000
The other thing is semaphores.

01:00.000 --> 01:05.000
Semaphores is not exactly the same thing as semaphores in computer programming

01:05.000 --> 01:06.000
than in single.

01:06.000 --> 01:10.000
But well, the idea is when you have a semaphore, you have a set of buildings

01:10.000 --> 01:13.000
that one acquired the semaphore and the rest.

01:13.000 --> 01:16.000
When tried to acquire the semaphore is going to wait.

01:16.000 --> 01:22.000
The semaphores is the way that the goal runtime has to have for blocking

01:22.000 --> 01:23.000
a goal routines.

01:23.000 --> 01:28.000
So whenever the first goal routine leave the semaphore,

01:28.000 --> 01:32.000
another one acquire that and so on.

01:32.000 --> 01:34.000
So that's all the building blocks that we have.

01:34.000 --> 01:39.000
And everything in the same package is built with two building blocks.

01:39.000 --> 01:42.000
So let's start with wind groups.

01:42.000 --> 01:44.000
This isn't some of usage of wind groups.

01:44.000 --> 01:48.000
Everybody knows how wind groups works.

01:48.000 --> 01:49.000
And this is a structure.

01:50.000 --> 01:55.000
The structure has a state that is basically a counter and a waiter counter.

01:55.000 --> 02:01.000
So a counter of the goal routines that you have to wait to finish.

02:01.000 --> 02:04.000
And the wait counter is the number of goal routines that are waiting.

02:04.000 --> 02:06.000
And a semaphore there.

02:06.000 --> 02:12.000
So whenever you run a goal routine, the main goal routine is going to add three

02:12.000 --> 02:13.000
to the counter.

02:13.000 --> 02:15.000
It's going to increase that.

02:15.000 --> 02:18.000
Then other goal routines come.

02:18.000 --> 02:20.000
The main goal routine starts waiting.

02:20.000 --> 02:22.000
Other goal routines can't wait, also.

02:22.000 --> 02:24.000
And start waiting for the semaphore.

02:24.000 --> 02:27.000
So it gets blocked there.

02:27.000 --> 02:30.000
Other goal routines start doing things.

02:30.000 --> 02:33.000
Doing dawn, dawn, dawn, and in the last one,

02:33.000 --> 02:37.000
also free the semaphore and the main goal routine keep going.

02:37.000 --> 02:39.000
So that's how it's worked.

02:39.000 --> 02:42.000
And then you have the music says that is,

02:42.000 --> 02:45.000
the semaphore was, basically, a lot.

02:45.000 --> 02:53.000
And it's for set some boundaries on setting variables.

02:53.000 --> 02:58.000
And internally, it works with atomic operations on the state that have this

02:58.000 --> 03:01.000
look at, walking and starving and waiter.

03:01.000 --> 03:04.000
But the important thing is going to be the look at one.

03:04.000 --> 03:07.000
The look at is what is saying, hey, this music's look or not.

03:07.000 --> 03:11.000
And the semaphore is used to have control over that.

03:11.000 --> 03:14.000
For example, a goal routine look that.

03:14.000 --> 03:19.000
And the rest of the goal routines is going to see the, well,

03:19.000 --> 03:21.000
actually the look is in an atomic.

03:21.000 --> 03:24.000
So it's going to see that the music's look.

03:24.000 --> 03:26.000
So it's going to wait for the semaphore.

03:26.000 --> 03:29.000
And when the goal routine finish is going to wait,

03:29.000 --> 03:31.000
it's going to free the semaphore.

03:31.000 --> 03:34.000
And normal goal routine that is waiting is going to wake up.

03:34.000 --> 03:39.000
So I'm not going to gain to the things because it's not enough.

03:39.000 --> 03:45.000
So once, once is something that executes something only one time.

03:45.000 --> 03:48.000
And it's built again with all the things.

03:48.000 --> 03:51.000
In this case, it's built with a new text and atomic.

03:51.000 --> 03:54.000
But at the end of the day, a new text is built with semaphores and atomic.

03:54.000 --> 04:03.000
So you have the, you have this, don't, don't.

04:03.000 --> 04:06.000
A structure that is the atomic part.

04:06.000 --> 04:08.000
And then you have the music.

04:08.000 --> 04:12.000
What is going to do is the first time it's going to start doing,

04:12.000 --> 04:17.000
it's going to go through this low path that is going to start executing the,

04:17.000 --> 04:20.000
the function is going to take the music,

04:20.000 --> 04:22.000
start executing the function.

04:22.000 --> 04:27.000
And when I finish, it's a store the data in the dome value.

04:27.000 --> 04:32.000
And every subsequent call is going to execute the,

04:32.000 --> 04:35.000
it's going to go through the first path that is going to check.

04:35.000 --> 04:37.000
It's going to check if it's already done.

04:37.000 --> 04:40.000
And we're doing the same value.

04:40.000 --> 04:43.000
Maps.

04:43.000 --> 04:49.000
Okay, a map is a sing map that is an implementation of a map that can be accessible.

04:49.000 --> 04:50.000
Synchronous.

04:50.000 --> 04:54.000
If you try to do the same thing with regular map,

04:54.000 --> 04:59.000
it's going to panic probably depending on, well, it's not necessarily panic,

04:59.000 --> 05:01.000
but it could panic perfectly.

05:01.000 --> 05:04.000
So you shouldn't do that.

05:04.000 --> 05:06.000
Then it has some new decks.

05:06.000 --> 05:09.000
I have a read-only and a duty map.

05:09.000 --> 05:12.000
The idea is that everything in the,

05:12.000 --> 05:14.000
whenever you load something,

05:14.000 --> 05:18.000
it's going to try to check the read map that is the first copy of that.

05:18.000 --> 05:24.000
And then the duty map is just a set of keys that are amended to the read map.

05:24.000 --> 05:29.000
And thanks to time, the duty map gets into the read map.

05:29.000 --> 05:32.000
And basically when there's so many misses,

05:32.000 --> 05:35.000
because every time you try to load something on it,

05:35.000 --> 05:37.000
you have to check in the duty one is a miss.

05:37.000 --> 05:40.000
So whenever there's so many misses,

05:40.000 --> 05:44.000
you can copy over the read map.

05:44.000 --> 05:47.000
Then you have the store operation.

05:47.000 --> 05:49.000
Well, it's kind of related.

05:49.000 --> 05:52.000
It's going to try to read the entry for the,

05:52.000 --> 05:55.000
and then initialize the duty if need.

05:55.000 --> 05:57.000
Do this unsprung thing.

05:57.000 --> 06:00.000
I'm not going to go down that rabbit hole.

06:00.000 --> 06:03.000
So let's talk about pools.

06:03.000 --> 06:06.000
Pools is somebody already talk about them.

06:06.000 --> 06:10.000
It's for storing variables and reducing variables.

06:10.000 --> 06:16.000
It's a mechanism for improving the garbage collection in certain cases.

06:16.000 --> 06:18.000
And it works in this way.

06:18.000 --> 06:24.000
It has this local cache of variables that have a private,

06:24.000 --> 06:27.000
a private variable that is one entity of the variable that you're saving.

06:27.000 --> 06:32.000
And a share pool chain that is a list of variables that are there.

06:32.000 --> 06:34.000
Then you have the victim pool.

06:34.000 --> 06:37.000
And what it's going to do is whenever you,

06:37.000 --> 06:40.000
whenever you save something, it goes here.

06:40.000 --> 06:42.000
And whenever the garbage collector passes,

06:42.000 --> 06:45.000
it's going to move the pool to the victim pool and clean this up.

06:45.000 --> 06:48.000
And it's going to be used later.

06:48.000 --> 06:51.000
And the next time the victim pool is clean up.

06:51.000 --> 06:53.000
And this one goes here.

06:53.000 --> 06:58.000
And that is going to avoid garbage collection to do a lot of work.

06:58.000 --> 07:01.000
I'm not going to go to all of these.

07:01.000 --> 07:03.000
And then you have the, no, it's solid.

07:03.000 --> 07:05.000
I have 30 seconds.

07:05.000 --> 07:08.000
So.

07:08.000 --> 07:11.000
So then the con is kind of similar to,

07:11.000 --> 07:14.000
oh, it's not similar to here.

07:14.000 --> 07:15.000
We're interface.

07:15.000 --> 07:19.000
So you have to log the thing before you access to the variable.

07:19.000 --> 07:24.000
And then you wait for somebody to signal you that you can check again the value.

07:24.000 --> 07:27.000
And the value is updated by the other side of this.

07:27.000 --> 07:30.000
It's really weird how it works.

07:30.000 --> 07:34.000
And I don't have more time.

07:34.000 --> 07:38.000
So I go into finish here just to say that everything in sync packages

07:38.000 --> 07:39.000
made with add-ons.

07:39.000 --> 07:41.000
And of course, some of course.

07:41.000 --> 07:42.000
And that's it.

07:42.000 --> 07:43.000
Thank you.

07:43.000 --> 07:50.000
Sorry if I'm rude to you during lightning talks,

07:50.000 --> 07:56.000
but this has to move so fast that I do not say please.

07:56.000 --> 08:03.000
If you are talk is go links and go come to here now.

08:03.000 --> 08:05.000
You have less than eight minutes.

08:05.000 --> 08:08.000
And if you're talking to microphone, please do like me.

08:08.000 --> 08:10.000
And almost kiss this thing.

08:10.000 --> 08:12.000
Otherwise sound will not work.

08:12.000 --> 08:13.000
Hi everyone.

08:13.000 --> 08:14.000
My name is Tobias.

08:14.000 --> 08:18.000
And this morning I did not know that I will give a lightning talk this evening.

08:18.000 --> 08:21.000
So I have fourth light.

08:21.000 --> 08:23.000
And we just start.

08:23.000 --> 08:24.000
With some question first.

08:24.000 --> 08:26.000
Who knows what go links are?

08:26.000 --> 08:27.000
Or heard of them before.

08:27.000 --> 08:29.000
Oh, one, two.

08:29.000 --> 08:33.000
So what go links are is I think they came out of Google.

08:33.000 --> 08:36.000
It's like short links, but for co-workers.

08:36.000 --> 08:40.000
So if you have a link which you want to,

08:40.000 --> 08:45.000
or topic you want to know or give for everyone of your co-workers

08:45.000 --> 08:48.000
for example like the Vicki or something,

08:48.000 --> 08:52.000
then you put it on go slash Vicki or something.

08:52.000 --> 08:55.000
Or if there is no go link, then you put a new go link.

08:55.000 --> 08:57.000
And it's a redirect service.

08:57.000 --> 08:59.000
So it's like tiny short nerve.

08:59.000 --> 09:02.000
Part of the difference is that there is a small trick.

09:02.000 --> 09:05.000
Which you are using in such to match.

09:05.000 --> 09:07.000
Which makes it easier.

09:07.000 --> 09:11.000
So maybe we will get back to later.

09:11.000 --> 09:13.000
What is the nice thing about this?

09:13.000 --> 09:15.000
So what go links are?

09:15.000 --> 09:16.000
I told already.

09:16.000 --> 09:20.000
And the basic requirements for go links are that you have a redirect service.

09:20.000 --> 09:24.000
So for example, if someone serves for searches for the Vicki or other things

09:24.000 --> 09:29.000
in your company, then you are redirecting them to the real domain,

09:29.000 --> 09:32.000
which is behind the short link, then you have a simple user interface.

09:32.000 --> 09:35.000
Because one of the principles of go links is that

09:35.000 --> 09:40.000
if there is no go link, the person who thought that the go link has to put it in.

09:40.000 --> 09:43.000
So for example, if someone is searching for a project and it's not in,

09:43.000 --> 09:47.000
put it in so everyone else after you finds it.

09:47.000 --> 09:53.000
And then we have to need to store the data so that we can restart the program

09:53.000 --> 09:56.000
and can redirect afterwards.

09:56.000 --> 09:58.000
And they have the bonus.

09:58.000 --> 10:04.000
And if you do it in your company with DHTP or group policies earlier on

10:04.000 --> 10:09.000
because Windows didn't support this, you can put a search domain on your computers

10:09.000 --> 10:14.000
and the search domain is basically if you have the domain resolution in your browser

10:14.000 --> 10:16.000
for example, you are searching for go.

10:16.000 --> 10:20.000
And it's not finding anything when it's appending of the search domain

10:20.000 --> 10:22.000
and you've got a fully qualified domain name.

10:22.000 --> 10:26.000
And for example, if this is go at Kulboponcom,

10:26.000 --> 10:31.000
for example, and this is where your services located.

10:31.000 --> 10:35.000
And then it's going to do its magic and redirecting everything.

10:35.000 --> 10:39.000
So if you have a look into the source code,

10:39.000 --> 10:43.000
because the fun part about this is that it is an afternoon project

10:43.000 --> 10:47.000
and it helps everyone in your company or in your co-workers

10:47.000 --> 10:50.000
to find everything even for your service good.

10:50.000 --> 10:56.000
So the Vedic part is in my requirements where I need to write it and go

10:56.000 --> 10:58.000
because it's fun and go.

10:58.000 --> 11:02.000
And then the next part was, where do I store the data?

11:02.000 --> 11:07.000
I don't want to have a SQLite and fill with CGO and other stuff.

11:07.000 --> 11:11.000
So there's an amazing project with this called GoBoat,

11:11.000 --> 11:13.000
with this nowadays called BeBoat.

11:13.000 --> 11:18.000
I think the code was for ITCD and ITCD is maintaining this project.

11:18.000 --> 11:22.000
So basically we are having user interface,

11:22.000 --> 11:26.000
it's slept together in a few HTML files.

11:26.000 --> 11:31.000
So there's a basic interface with this is getting served.

11:31.000 --> 11:35.000
We have the HTTP server from the co-site and it's a

11:35.000 --> 11:39.000
some small JavaScript which adds it in the background

11:39.000 --> 11:41.000
to the user has a nice user interface.

11:41.000 --> 11:44.000
So basically I would show it because it's not my computer.

11:44.000 --> 11:49.000
I would have a demo, but it's only a box in the input box

11:49.000 --> 11:51.000
in the middle of the screen and you put in the link

11:51.000 --> 11:53.000
and everything else is not possible.

11:53.000 --> 11:55.000
Because that's the best thing.

11:55.000 --> 11:57.000
It has to be as small as possible.

11:57.000 --> 11:58.000
It has to be easy.

11:58.000 --> 12:02.000
And then in the Vedic part you have some endpoints.

12:02.000 --> 12:05.000
For example, if you want to list something.

12:05.000 --> 12:11.000
So if you ever have the need to see every routes,

12:11.000 --> 12:15.000
you have the possibility for example to have

12:15.000 --> 12:18.000
the registry something like the risk is free then you can edit it

12:18.000 --> 12:22.000
because if something is broken or has changed the redirect

12:22.000 --> 12:24.000
or else then you have a need to change it.

12:24.000 --> 12:29.000
And basically you can save it to a CSV file for

12:29.000 --> 12:31.000
exporting or analyzing.

12:31.000 --> 12:35.000
So the most important part of this part where you say everything

12:35.000 --> 12:40.000
is catch and everything is getting redirected to the start link

12:40.000 --> 12:47.000
and the redirect is basically stored in a key value store

12:47.000 --> 12:49.000
from bold as I told before.

12:49.000 --> 12:50.000
It's a single file.

12:50.000 --> 12:55.000
So no server endpoint is needed.

12:55.000 --> 12:57.000
Bold stores byte to bytes.

12:57.000 --> 12:58.000
So key value.

12:58.000 --> 13:00.000
You search for a key.

13:00.000 --> 13:02.000
If you find the key, you redirect.

13:02.000 --> 13:05.000
If you don't find the key, you show the webpage where the user can input

13:05.000 --> 13:06.000
the goal link.

13:06.000 --> 13:09.000
And afterwards the next user can directly get them.

13:09.000 --> 13:13.000
Well, I think there's no more.

13:13.000 --> 13:15.000
Think to say about it.

13:15.000 --> 13:16.000
Thank you.

13:24.000 --> 13:28.000
If you see your talk being open, I think it's yours.

13:28.000 --> 13:30.000
Just how to mic closely just like I am.

13:30.000 --> 13:32.000
You almost have to kiss it.

13:32.000 --> 13:33.000
It doesn't bite.

13:33.000 --> 13:34.000
Go.

13:35.000 --> 13:38.000
Hello, everyone.

13:38.000 --> 13:41.000
Yeah, I would like to talk about PGX,

13:41.000 --> 13:45.000
Outbox library and transaction outbox pattern.

13:45.000 --> 13:47.000
I'm Nikolai.

13:47.000 --> 13:50.000
I'm based in Helsinki, Finland.

13:50.000 --> 13:54.000
And work for the lander for pre-owned project.

13:54.000 --> 13:59.000
And at the bottom, it's how I ended up doing go.

13:59.000 --> 14:01.000
Started the job.

14:01.000 --> 14:04.000
I see Java Kotlin and now doing go.

14:04.000 --> 14:08.000
So why we need this talk?

14:08.000 --> 14:10.000
Because there is no right problem.

14:10.000 --> 14:12.000
It's not something new.

14:12.000 --> 14:15.000
But imagine you have a service,

14:15.000 --> 14:18.000
deployed somewhere in Kubernetes service A,

14:18.000 --> 14:21.000
which talks to its own database.

14:21.000 --> 14:24.000
Postgres or my SQL.

14:24.000 --> 14:26.000
And then there is service B,

14:26.000 --> 14:30.000
which you need to send once you commit.

14:30.000 --> 14:31.000
Insert update.

14:31.000 --> 14:34.000
Then you need to send the message.

14:34.000 --> 14:36.000
And this is called the door right problem.

14:36.000 --> 14:40.000
Because you need to do two rights at the same time

14:40.000 --> 14:43.000
to the database and to the message broker.

14:43.000 --> 14:47.000
And sometimes it can get problematic.

14:47.000 --> 14:50.000
For example, you commit to database.

14:50.000 --> 14:53.000
But then Kafka, your message broker is down.

14:53.000 --> 14:55.000
I guess every company worked.

14:55.000 --> 14:58.000
They had this incidents where the Kafka was down.

14:58.000 --> 15:01.000
And the message couldn't be sent.

15:01.000 --> 15:07.000
And sometimes it's required for the legal perspective.

15:07.000 --> 15:12.000
And if you place an order in the e-commerce system,

15:12.000 --> 15:16.000
then service B is responsible for sending email.

15:16.000 --> 15:18.000
And if that email is not sent,

15:18.000 --> 15:22.000
then it's a problem for a company and a legal problem.

15:22.000 --> 15:25.000
Okay, sorry for that.

15:26.000 --> 15:28.000
So yeah, basically a transaction.

15:28.000 --> 15:31.000
Outbox button is it's done.

15:31.000 --> 15:34.000
It's introduced this Outbox relay.

15:34.000 --> 15:36.000
It's a kind of additional service.

15:36.000 --> 15:39.000
And the service A, it will try it.

15:39.000 --> 15:44.000
So the posgres it will try the domain entities.

15:44.000 --> 15:47.000
It's responsible for and it will try the Outbox messages

15:47.000 --> 15:50.000
in the separate table in the posgres.

15:50.000 --> 15:54.000
And then Outbox relay would independently read those messages.

15:54.000 --> 15:59.000
It might suggest acknowledge them and publish to message broker.

15:59.000 --> 16:04.000
So this is how the issues of the right problems can be solved.

16:04.000 --> 16:11.000
So this was my kind of weekend project to make this a PGX Outbox library.

16:11.000 --> 16:14.000
Even though it can be done by other solutions.

16:14.000 --> 16:19.000
For example, what a mute provides information.

16:19.000 --> 16:21.000
Provides a opportunity.

16:21.000 --> 16:25.000
So out of the box is library implements.

16:25.000 --> 16:27.000
It has a message.

16:27.000 --> 16:31.000
You have to follow the format and there is a writer,

16:31.000 --> 16:34.000
which can join a transaction to write the posgres.

16:34.000 --> 16:39.000
There is three there forwarder and a publisher to SNS for now.

16:39.000 --> 16:42.000
So the message looks like this.

16:42.000 --> 16:46.000
So you have basically payload is what you want to send.

16:46.000 --> 16:50.000
You can indicate the broker and the topic.

16:50.000 --> 16:53.000
And then some optional metadata.

16:53.000 --> 16:58.000
And then there is a writer, which you can use in your code.

16:58.000 --> 17:03.000
So for the first method, it can support both.

17:03.000 --> 17:11.000
It can support PGX because basically PGX driver is the most famous most popular driver

17:11.000 --> 17:15.000
for the work with posgres from Go.

17:15.000 --> 17:19.000
And the second method, it can do button.

17:19.000 --> 17:22.000
So you can send multiple messages.

17:22.000 --> 17:25.000
And here are some demo screenshots.

17:25.000 --> 17:27.000
So this is how it looks.

17:27.000 --> 17:32.000
So I can impose the first images outbox table.

17:32.000 --> 17:34.000
So it has messages.

17:34.000 --> 17:36.000
Prepare to be sent.

17:36.000 --> 17:41.000
And the second image is tracing of PGX.

17:41.000 --> 17:48.000
So basically, if you want to commit in this example,

17:48.000 --> 17:50.000
the main entity is users.

17:50.000 --> 17:56.000
So then there is a second query which would write to outbox messages in the same transaction.

17:56.000 --> 17:59.000
And then it size it happens atomically.

17:59.000 --> 18:01.000
All it all backs both of them.

18:02.000 --> 18:09.000
And then as you remember, there is our box three way, which would forward the messages.

18:09.000 --> 18:16.000
So basically, I added support for some name.

18:16.000 --> 18:21.000
Now if I approach like polling of the messages and then acknowledge them.

18:21.000 --> 18:26.000
But now I'm working more about this logical replication.

18:26.000 --> 18:33.000
And right ahead of posgres, which is also known change data capture.

18:33.000 --> 18:44.000
And using this library, this is the same person who maintains PGX driver of written and go for posgres.

18:44.000 --> 18:47.000
Yeah, that's basically it for me.

18:47.000 --> 18:49.000
Thank you very much.

18:49.000 --> 18:52.000
Thank you very much.

18:53.000 --> 19:00.000
Well, my amazing, this assistant is currently trying to exit these slides and open the next slide.

19:00.000 --> 19:05.000
If this link looks like yours, you can come here and you can grab my microphone.

19:05.000 --> 19:08.000
Thank you.

19:08.000 --> 19:10.000
Yeah.

19:10.000 --> 19:11.000
Okay.

19:11.000 --> 19:15.000
So I have a story that happens on one of our PR.

19:15.000 --> 19:19.000
And I decided to show it to you because it was really mystery story.

19:19.000 --> 19:21.000
It's very cool that it's much simpler than this PR.

19:21.000 --> 19:24.000
If you are interested, you can always go to the root cause.

19:24.000 --> 19:26.000
So let's start what is nil.

19:26.000 --> 19:29.000
So nil is typed empty point pointer.

19:29.000 --> 19:32.000
It's my definition, nothing from the documentation.

19:32.000 --> 19:34.000
And how do we check for a nil nest?

19:34.000 --> 19:36.000
Typically something like this.

19:36.000 --> 19:38.000
X is a variable name.

19:38.000 --> 19:44.000
And we do something alternatively you can compare to not equal.

19:44.000 --> 19:47.000
So how does it work on each check on an interface?

19:47.000 --> 19:50.000
Here is some dummy example where we have a is nil function.

19:50.000 --> 19:54.000
If whatever we pass there is nil or not.

19:54.000 --> 19:57.000
And how we can define the variable.

19:57.000 --> 20:00.000
So the first one is of course it's not nil.

20:00.000 --> 20:05.000
It's a pointer for an implementation for interface that we have here.

20:05.000 --> 20:06.000
Super simple.

20:06.000 --> 20:11.000
Second one is actually nil pointer to in interface.

20:11.000 --> 20:17.000
And the third one is a nil pointer for an implementation of an interface.

20:17.000 --> 20:21.000
And that would be important because let's see here.

20:21.000 --> 20:25.000
First line maybe I will run to save some time.

20:25.000 --> 20:30.000
And oh, okay.

20:30.000 --> 20:33.000
So first line returns false.

20:33.000 --> 20:37.000
If you remember A was just a pointer to a variable.

20:37.000 --> 20:39.000
So it's not nil.

20:40.000 --> 20:43.000
Second one is nil because we pass nil.

20:43.000 --> 20:45.000
So not a problem.

20:45.000 --> 20:50.000
And the second one is true because it's nil.

20:50.000 --> 20:52.000
And the third one is nil.

20:52.000 --> 20:54.000
Although we pass a nil.

20:54.000 --> 20:56.000
So that's something contrary intuitive.

20:56.000 --> 20:59.000
Not sure if you ever experienced something like this.

20:59.000 --> 21:01.000
And why this happened?

21:01.000 --> 21:06.000
So when we compare nil nest in go and when we compare anything in go.

21:06.000 --> 21:08.000
We need to compare apples to apples.

21:08.000 --> 21:12.000
So if you compare interface with some direct implementation,

21:12.000 --> 21:15.000
it will not work because the type are mismatched.

21:15.000 --> 21:18.000
So that's why it's not nil.

21:18.000 --> 21:21.000
And what are the solutions?

21:21.000 --> 21:23.000
We can go with reflection.

21:23.000 --> 21:25.000
This is something that we do.

21:25.000 --> 21:29.000
If you go for it, I think that's something like this.

21:29.000 --> 21:33.000
You can find in many repositories or I think I'll stack overflow.

21:33.000 --> 21:37.000
So we go reflection, get value, compare the value, compare the pointer.

21:37.000 --> 21:40.000
Yeah, kind of magic.

21:40.000 --> 21:44.000
But clear is better than clever and reflection is never clever.

21:44.000 --> 21:47.000
So we do not want to have a reflection error code.

21:47.000 --> 21:51.000
So what we can have, we can use generics.

21:51.000 --> 21:57.000
And to use them, we need to have a type that is any.

21:57.000 --> 21:59.000
But we want to compare pointers.

21:59.000 --> 22:02.000
So we need to give a compiler another type hint.

22:02.000 --> 22:07.000
So in my case it's a pt, which is a pointer to this type that we pass previously.

22:07.000 --> 22:12.000
So then we can create that is generic pointer with this varmptpt.

22:12.000 --> 22:15.000
That will be empty, but it has a proper type that we expect.

22:15.000 --> 22:19.000
And then compare it to a pointer that we pass to a function.

22:19.000 --> 22:23.000
A bit complicated, but it's working.

22:23.000 --> 22:25.000
Except when it's not.

22:25.000 --> 22:31.000
So it prevents us from explicitly passing a nil pointer of an interface

22:31.000 --> 22:33.000
without an implementation.

22:33.000 --> 22:40.000
So this var, I, I, is a nil value, nil pointer to an interface

22:40.000 --> 22:44.000
without an underlying implementation.

22:44.000 --> 22:49.000
But in our case, it was not a problem and we prefer to not have this in our source code.

22:49.000 --> 22:56.000
So this gave us another part of security because at the compile time,

22:56.000 --> 23:04.000
we get a check if somehow we pass a nil unimplemented interface.

23:04.000 --> 23:09.000
So that's it.

23:09.000 --> 23:17.000
Thank you.

23:18.000 --> 23:35.000
I promise you could use your laptop if you slice for up in five seconds and he made it.

23:35.000 --> 23:40.000
Yeah, it was your microphone.

23:40.000 --> 23:45.000
Let's go.

23:46.000 --> 23:49.000
Sorry about that.

23:49.000 --> 23:50.000
Okay.

23:50.000 --> 23:56.000
So I'm talking about a project called RIP that I presented last year.

23:56.000 --> 24:05.000
So what it is actually RIP is a project to reduce boilerplate of HTTP

24:05.000 --> 24:11.000
and LERS to get kind of the same behavior between the post-demand implementation

24:11.000 --> 24:14.000
and then to get implementation when the project gets big.

24:14.000 --> 24:18.000
Then everybody does a little bit and not everything and so that it gets in coherent

24:18.000 --> 24:23.000
and it's hard to work with those code based at some point.

24:23.000 --> 24:25.000
So a quick show of hands.

24:25.000 --> 24:28.000
Who was at the my talk yesterday last year?

24:28.000 --> 24:30.000
Okay.

24:30.000 --> 24:33.000
Okay, so my jokes will maybe still hit.

24:34.000 --> 24:37.000
So I'm Tongi, I'm from France.

24:37.000 --> 24:39.000
I worked 18 years in IT.

24:39.000 --> 24:42.000
I was for eight years in Paris.

24:42.000 --> 24:44.000
I worked in different domain in consulting.

24:44.000 --> 24:45.000
Very interesting.

24:45.000 --> 24:46.000
I worked in finance.

24:46.000 --> 24:50.000
I worked in in health health care.

24:50.000 --> 24:52.000
So there were like different stuff.

24:52.000 --> 24:53.000
Very interesting to learn.

24:53.000 --> 24:56.000
I'm also a CEO of HTML.

24:56.000 --> 24:57.000
Okay.

24:57.000 --> 24:59.000
One person got it.

24:59.000 --> 25:02.000
But that was before.

25:02.000 --> 25:04.000
So will it work?

25:04.000 --> 25:05.000
Yes.

25:05.000 --> 25:12.000
So as you can see from this video I'm ready to do anything for money or attention.

25:12.000 --> 25:17.000
And so I'm a freelancer.

25:17.000 --> 25:21.000
So that was my yesterday.

25:21.000 --> 25:24.000
That's why my voice is totally broken and I'm completely wasted.

25:24.000 --> 25:28.000
And this is my first crowd surfing from my life.

25:28.000 --> 25:30.000
So I guess my.

25:30.000 --> 25:32.000
Thank you.

25:32.000 --> 25:36.000
My middle life crisis is hitting hard.

25:36.000 --> 25:38.000
So I was I wanted to life code.

25:38.000 --> 25:42.000
But then March had told me that I couldn't use my or it was written.

25:42.000 --> 25:44.000
It couldn't use my computer.

25:44.000 --> 25:45.000
So I prepared slide.

25:45.000 --> 25:47.000
And then she told me I could use my computer.

25:47.000 --> 25:49.000
But I hate losing hard work.

25:49.000 --> 25:53.000
So you're going to have to deal with my lousy slides.

25:54.000 --> 25:59.000
So let's say we have a project and we just want to do something quick.

25:59.000 --> 26:02.000
We just want a collection of albums.

26:02.000 --> 26:03.000
For example.

26:03.000 --> 26:05.000
So we create our own type.

26:05.000 --> 26:06.000
It's going to be an album.

26:06.000 --> 26:07.000
It has an ID.

26:07.000 --> 26:08.000
Has a name.

26:08.000 --> 26:09.000
The artist of the album.

26:09.000 --> 26:11.000
A really state.

26:11.000 --> 26:12.000
Yeah.

26:12.000 --> 26:13.000
I put a QR code everywhere.

26:13.000 --> 26:15.000
I'm I'm I'm doing marketing.

26:15.000 --> 26:18.000
And so.

26:18.000 --> 26:20.000
The we have our type.

26:20.000 --> 26:23.000
Then we need a database to save that.

26:23.000 --> 26:24.000
I use an ORM.

26:24.000 --> 26:25.000
Okay.

26:25.000 --> 26:26.000
Stop booing.

26:26.000 --> 26:28.000
I know I know some of you would do.

26:28.000 --> 26:30.000
But I'm trying to go fast.

26:30.000 --> 26:31.000
You know.

26:31.000 --> 26:33.000
Time is a.

26:33.000 --> 26:35.000
So I'm using a go.

26:35.000 --> 26:37.000
I'm doing a on escalate.

26:37.000 --> 26:40.000
I do it in memory because I'm metal.

26:40.000 --> 26:43.000
And then we auto migrate.

26:43.000 --> 26:47.000
So then it creates all the tables and stuff that we need.

26:48.000 --> 26:55.000
I use the structure logging from the default from the standard library.

26:55.000 --> 26:59.000
Then this is where I did the improvement in my library.

26:59.000 --> 27:02.000
I created like some already defined provider.

27:02.000 --> 27:04.000
And here I use a go on provider.

27:04.000 --> 27:05.000
So it needs like the type.

27:05.000 --> 27:08.000
We want to create which is an album.

27:08.000 --> 27:12.000
We pass the DB in the the go on database inside.

27:12.000 --> 27:16.000
But you can implement your own providers with your own.

27:17.000 --> 27:18.000
Library that you want.

27:18.000 --> 27:21.000
You can use like database slash SQL and extra.

27:21.000 --> 27:26.000
And I inject also the logger because this is what I use in it.

27:26.000 --> 27:29.000
This is the code that was from last year.

27:29.000 --> 27:31.000
Let me check the time.

27:31.000 --> 27:32.000
Okay.

27:32.000 --> 27:34.000
I'm going to go fast.

27:34.000 --> 27:39.000
So I create a route options where we decide which kind of code I want.

27:39.000 --> 27:44.000
So I want Jason and I also want to generate HTML pages and HTML forms.

27:44.000 --> 27:47.000
So I can dynamically modify it.

27:47.000 --> 27:52.000
Then I pass my function which is RIP and all entities.

27:52.000 --> 27:55.000
My method to actually function.

27:55.000 --> 28:00.000
But anyway to the HTTP and all function from net slash HTTP.

28:00.000 --> 28:06.000
And based on that everything everything will be generated automatically.

28:06.000 --> 28:07.000
That's it.

28:07.000 --> 28:10.000
You listen and serve and it works.

28:10.000 --> 28:13.000
So I guess the full code is that.

28:13.000 --> 28:16.000
It's like 30 lines of code.

28:16.000 --> 28:19.000
And so it's time for a demo.

28:19.000 --> 28:24.000
Okay.

28:24.000 --> 28:26.000
Can you see?

28:26.000 --> 28:27.000
Yeah.

28:27.000 --> 28:29.000
Oh sorry sorry.

28:29.000 --> 28:31.000
No I am your mic stands.

28:31.000 --> 28:32.000
I am praying for this.

28:32.000 --> 28:34.000
Thank you very much.

28:34.000 --> 28:37.000
No I don't see stuff but I don't need it.

28:37.000 --> 28:38.000
Okay.

28:39.000 --> 28:41.000
It's just going to do this.

28:41.000 --> 28:43.000
You could sorry there.

28:43.000 --> 28:44.000
Okay.

28:44.000 --> 28:48.000
So this is my Lousy HTML form generation.

28:48.000 --> 28:50.000
I'm not a form and developer.

28:50.000 --> 28:53.000
So this is my form for a new entity.

28:53.000 --> 28:56.000
I'm going to put well the band that I crout served on.

28:56.000 --> 28:58.000
Which was.

28:58.000 --> 29:00.000
Encepheroom.

29:00.000 --> 29:03.000
Great band by the way.

29:03.000 --> 29:04.000
All right.

29:04.000 --> 29:06.000
And I think they really disalbum 2001.

29:07.000 --> 29:11.000
Let's say we generate it automatically.

29:11.000 --> 29:14.000
An idea.

29:14.000 --> 29:19.000
And I'm going to just copy paste to show the Jason.

29:19.000 --> 29:22.000
That Jason works as well.

29:22.000 --> 29:25.000
So let's see if it exists, which a little bit big.

29:25.000 --> 29:30.000
So here we have the entity that is available.

29:30.000 --> 29:33.000
Let's say now I just want to delete it.

29:33.000 --> 29:38.000
So I need to pass as well the entity.

29:38.000 --> 29:41.000
And I'm going to delete it here by Jason.

29:41.000 --> 29:47.000
And normally if my math is right, it disappeared from the app.

29:47.000 --> 29:48.000
And that's it.

29:48.000 --> 29:51.000
Like 35 lines of code and you can start prototyping.

29:51.000 --> 29:55.000
And so I started using it for real.

29:55.000 --> 29:58.000
And so I'm working on a mobile app.

29:58.000 --> 30:01.000
And I'm starting prototyping like the back end with that.

30:01.000 --> 30:04.000
And as the back end will get more complicated,

30:04.000 --> 30:09.000
I will just remove my provider and create a real provider and change things

30:09.000 --> 30:12.000
so then it's more adapted to the domain.

30:12.000 --> 30:15.000
So here it is.

30:15.000 --> 30:17.000
Thank you.

30:32.000 --> 30:39.000
If you're talking about overtaking APIs, you can come here.

30:39.000 --> 30:40.000
Hi.

30:40.000 --> 30:41.000
Hi, everyone.

30:41.000 --> 30:43.000
Let's complain about APIs.

30:43.000 --> 30:46.000
It's a super minus in, but let's overthink it.

30:46.000 --> 30:49.000
If you pay attention to the previous presentations, you

30:49.000 --> 30:52.000
saw this interface at least two times, maybe more.

30:52.000 --> 30:54.000
But basically, let's imagine you have, like,

30:54.000 --> 30:57.000
HTTP server or whatever, you need to create it,

30:57.000 --> 31:00.000
you need to start it, you need to stop it.

31:00.000 --> 31:01.000
It's simple interface.

31:01.000 --> 31:03.000
Like three methods allows you to do a lot of things.

31:03.000 --> 31:05.000
It allows you to create something to,

31:05.000 --> 31:08.000
initially, some things before you start everything,

31:08.000 --> 31:10.000
then to stop it.

31:10.000 --> 31:13.000
But sometimes, I mean, oftentimes, you also need to do

31:13.000 --> 31:15.000
some visual tribination.

31:15.000 --> 31:18.000
And then you're forced to do even another method.

31:18.000 --> 31:23.000
Or create some ugly things, like, stop and wait.

31:23.000 --> 31:25.000
That's totally fine.

31:25.000 --> 31:29.000
But can we do better?

31:29.000 --> 31:33.000
What if we could use some very modern things that go as

31:33.000 --> 31:38.000
since forever called context is and just use a context?

31:38.000 --> 31:41.000
Then, just with one simple methods,

31:41.000 --> 31:44.000
we can do everything we could do before.

31:44.000 --> 31:48.000
So, we can have some code,

31:48.000 --> 31:50.000
which we run when we want to stop it,

31:50.000 --> 31:52.000
and we adjust the console context.

31:52.000 --> 31:56.000
We can do some methods, which do one running things.

31:56.000 --> 31:57.000
We can do clean up.

31:57.000 --> 32:00.000
And we also can do some things we couldn't do before.

32:00.000 --> 32:04.000
For example, this function that you see can indicate

32:04.000 --> 32:10.000
the color that the whole application can stop.

32:10.000 --> 32:14.000
And because you now have not a fusion interface with

32:14.000 --> 32:17.000
a lot of methods, it's super easy to combine the things together.

32:17.000 --> 32:19.000
So, that's just copy and paste code.

32:19.000 --> 32:23.000
But basically, you just use error group,

32:23.000 --> 32:27.000
which is in the experimental package in Golang.

32:27.000 --> 32:30.000
And you can just shuffle them together and then combine them together.

32:30.000 --> 32:33.000
So, now, not only you have a simple interface,

32:33.000 --> 32:37.000
you have easy ways to combine the things and run them together.

32:37.000 --> 32:42.000
And another advantage is if you don't care about the execution order

32:42.000 --> 32:46.000
or a combination order, you can also create some kind of trees

32:46.000 --> 32:48.000
of those routines.

32:48.000 --> 32:52.000
So, if your application is like 20 of those things, it's super handy.

32:53.000 --> 32:57.000
And yeah, and raiseful termination is also super simple and

32:57.000 --> 32:58.000
pluggable.

32:58.000 --> 33:02.000
So, if you standardize the things and you have a lot of apps,

33:02.000 --> 33:04.000
you can just use that.

33:04.000 --> 33:07.000
And that's it.

33:07.000 --> 33:09.000
Thank you.

33:09.000 --> 33:13.000
I have two more to go.

33:13.000 --> 33:20.000
If you can make it fast, that will be amazing.

33:21.000 --> 33:23.000
And let's go.

33:23.000 --> 33:25.000
Hi.

33:25.000 --> 33:28.000
So, quickly, I am a go-far for 10 years,

33:28.000 --> 33:30.000
and I built a scale where I met March,

33:30.000 --> 33:33.000
Bertie, we have some people in the room and no Gno.

33:33.000 --> 33:36.000
And as you can imagine, Gno is rated with Go.

33:36.000 --> 33:39.000
What is Gno? Gno is basically a variation of Go,

33:39.000 --> 33:42.000
which is built for the strizer applications.

33:42.000 --> 33:45.000
So, it looks like Go, but it won't run the same way.

33:45.000 --> 33:47.000
While Go is a compiled language,

33:47.000 --> 33:49.000
that you will run on several servers.

33:49.000 --> 33:52.000
Gno is an ecosystem, including the runtime,

33:52.000 --> 33:55.000
the long-range and racing.

33:55.000 --> 34:00.000
So, in one sentence, Gno is a transactional VM.

34:00.000 --> 34:02.000
So, virtual machine, it's not compiled.

34:02.000 --> 34:04.000
It will execute interpreted code.

34:04.000 --> 34:07.000
Transactional, because you don't find a demon for your applications,

34:07.000 --> 34:12.000
but you can make transactions against the set of applications in the VM.

34:12.000 --> 34:14.000
It allows to write decentralized application,

34:14.000 --> 34:17.000
which is not possible in Go, because Go is not deterministic,

34:17.000 --> 34:22.000
and it's not safe enough for what we expect to run on this ecosystem.

34:22.000 --> 34:25.000
And it has some built-in features that are not possible in Go,

34:25.000 --> 34:29.000
such as state persistence and safe execution.

34:29.000 --> 34:32.000
So, this is a simple Gno code.

34:32.000 --> 34:34.000
It looks like Go.

34:34.000 --> 34:36.000
The thing you can see is that basically it's not package main,

34:36.000 --> 34:39.000
but package LO, and it does not have a function main,

34:39.000 --> 34:41.000
but a fake LO, which is exported.

34:42.000 --> 34:45.000
So, basically, this application is something,

34:45.000 --> 34:51.000
allowing anyone to query the LO function against this contract.

34:51.000 --> 34:55.000
Basically, you run Gno code on GnoLand.

34:55.000 --> 34:57.000
So, GnoLand is the equivalent of AWS,

34:57.000 --> 34:59.000
instead of publishing your binary on AWS,

34:59.000 --> 35:01.000
you publish the source code on GnoLand.

35:01.000 --> 35:03.000
Instead of writing in Go, it's in Gno,

35:03.000 --> 35:07.000
and it's not an application, but to decentralize application.

35:08.000 --> 35:11.000
We have several changes.

35:11.000 --> 35:13.000
At the end, it looks like Go, but, for instance,

35:13.000 --> 35:17.000
we won't interact using JSON, GRPC, and everything.

35:17.000 --> 35:20.000
Instead, we expect people to call Go.

35:20.000 --> 35:22.000
So, the API is not JSON.

35:22.000 --> 35:23.000
The API is Go.

35:23.000 --> 35:25.000
You call a function with parameters.

35:25.000 --> 35:27.000
We don't have microsialices.

35:27.000 --> 35:30.000
You don't open a connection to another Google program.

35:30.000 --> 35:31.000
You import it.

35:31.000 --> 35:34.000
So, once you import something, you don't once again use GRPC or whatever.

35:34.000 --> 35:36.000
You import something.

35:36.000 --> 35:39.000
You use the structure, the functions, the method, and everything.

35:39.000 --> 35:41.000
We don't have RNs or DB.

35:41.000 --> 35:44.000
But instead, we just use automatic persistence,

35:44.000 --> 35:48.000
that you will see after is basically using global variables.

35:48.000 --> 35:50.000
We don't have dependencies,

35:50.000 --> 35:52.000
basically you need to upload the resting on the same VM.

35:52.000 --> 35:55.000
There is no way for the VM to fetch something from the external world.

35:55.000 --> 35:57.000
You need to upload all your dependencies.

35:57.000 --> 35:59.000
All the dependencies are persistent.

35:59.000 --> 36:03.000
So, if you build something and deploy it on Gno, it's air forever.

36:03.000 --> 36:06.000
There is no byte code, because we upload the source code.

36:06.000 --> 36:10.000
And by uploading the source code, you have automatic source code viewing.

36:10.000 --> 36:11.000
So, it's very transparent.

36:11.000 --> 36:14.000
But it's also allow you to interact with the contract,

36:14.000 --> 36:15.000
but also import them.

36:15.000 --> 36:19.000
So, when you write an app, it's an app and a library.

36:19.000 --> 36:23.000
An advanced example showing is the automatic persistence.

36:23.000 --> 36:26.000
So, here you have a container, which is a global variable.

36:26.000 --> 36:28.000
It is a transactional VM.

36:28.000 --> 36:32.000
Each time someone will call increment, it will increment the container.

36:32.000 --> 36:35.000
Save the container.

36:35.000 --> 36:37.000
Save the state.

36:37.000 --> 36:40.000
And each time someone calls it again, it will load the product state.

36:40.000 --> 36:42.000
Apply the change and save it.

36:42.000 --> 36:45.000
And that the same for the render, which is a redundant function,

36:45.000 --> 36:49.000
that will fetch the state from the automatically.

36:49.000 --> 36:52.000
So, here's another advanced example that I will deep dive.

36:52.000 --> 36:55.000
Basically, this is a mini social network applications.

36:55.000 --> 36:57.000
So, this is a decentralized one.

36:57.000 --> 37:00.000
You have first something which is very similar to go.

37:00.000 --> 37:04.000
I think this is called, except for the STD import, which is specific to go.

37:04.000 --> 37:06.000
This code is basically purely go.

37:06.000 --> 37:08.000
You declare a new track share.

37:08.000 --> 37:09.000
It has a time dot time.

37:09.000 --> 37:10.000
So, not to primitive type.

37:10.000 --> 37:16.000
STD address is something internal to basically give you run time environments

37:16.000 --> 37:21.000
such as the caller, the author, or the UAD in the web2world.

37:21.000 --> 37:24.000
And as you can see, we can extend the track shares as in go

37:24.000 --> 37:27.000
to, for instance, return an advanced string.

37:28.000 --> 37:30.000
And this is the rest of the contract.

37:30.000 --> 37:34.000
So, here we have a collection of posts, which is perceived systematically.

37:34.000 --> 37:37.000
We have a create post, which is the first function that anyone can call

37:37.000 --> 37:41.000
to append a new post of the type post with a text,

37:41.000 --> 37:43.000
which is provided as an argument.

37:43.000 --> 37:47.000
Also, which is automatically get from the runtime environment.

37:47.000 --> 37:51.000
And create the add, which is with the current time at the time of the transaction.

37:51.000 --> 37:53.000
And then the render function is a randomly part.

37:53.000 --> 37:55.000
You call it, actually render something special,

37:55.000 --> 37:59.000
ignore that will automatically provide a web interface,

37:59.000 --> 38:00.000
compatible with Macdon.

38:00.000 --> 38:03.000
And here you just list the post, and for each other then you

38:03.000 --> 38:07.000
display the post ID, and the post stringer.

38:07.000 --> 38:11.000
So, these two files together, you upload them and you have this social

38:11.000 --> 38:12.000
application.

38:12.000 --> 38:15.000
So, first screenshot is when you just deploy it.

38:15.000 --> 38:17.000
Then we make a transaction.

38:17.000 --> 38:22.000
So, we are using like CLI wallet to call the track post with an argument.

38:22.000 --> 38:28.000
And when we refer to the contract, you have the new post that was dressed

38:28.000 --> 38:30.000
at it.

38:30.000 --> 38:34.000
Something interesting when you have an interpreted code instead of a

38:34.000 --> 38:36.000
compiled one is that you can import the contract.

38:36.000 --> 38:40.000
So, Alice is a persistent code with just a geter and a seter,

38:40.000 --> 38:42.000
and Bob can import Alice.

38:42.000 --> 38:46.000
And as you can see, Bob can get the value, increment it,

38:46.000 --> 38:47.000
and it's saved.

38:47.000 --> 38:50.000
So, you have like libraries, but each library has its own state,

38:50.000 --> 38:52.000
which is also automatically persisted.

38:52.000 --> 38:55.000
So, you can imagine having a post, which is imported,

38:55.000 --> 39:00.000
and the other contract will compose or extend the micropost.

39:00.000 --> 39:05.000
And to conclude, what we tried and what actually succeeded to do

39:05.000 --> 39:08.000
as to make goals and language we all know here,

39:08.000 --> 39:11.000
the good language to write this under the application,

39:11.000 --> 39:15.000
without changing your habit, without having to understand all the

39:15.000 --> 39:17.000
blockchain states will work.

39:17.000 --> 39:19.000
Instead, you write your code with pure Gology,

39:19.000 --> 39:22.000
with actually less non- Gology because you don't have

39:22.000 --> 39:24.000
JSON or my SQL or whatever.

39:24.000 --> 39:27.000
You write your code and you have a decentralized application.

39:27.000 --> 39:30.000
And if you want to contribute, it's an ecosystem of

39:30.000 --> 39:31.000
contributors.

39:31.000 --> 39:33.000
So, please contribute.

39:33.000 --> 39:34.000
Thank you.

39:34.000 --> 39:36.000
Thank you.

39:36.000 --> 39:39.000
We have two more talks to go.

39:39.000 --> 39:41.000
I just are one last minute.

39:47.000 --> 39:52.000
Okay.

39:52.000 --> 39:55.000
I added myself as a lot one.

39:55.000 --> 39:57.000
I can do so.

39:57.000 --> 40:00.000
Great. Hello, hello.

40:00.000 --> 40:02.000
My name is Leandro.

40:02.000 --> 40:05.000
I'm not German, but I live in Germany.

40:05.000 --> 40:07.000
Anyways, it doesn't matter.

40:07.000 --> 40:09.000
That's my talk.

40:09.000 --> 40:10.000
I made it like leisurely.

40:10.000 --> 40:11.000
Two hours ago.

40:11.000 --> 40:12.000
So, it's really improvised.

40:12.000 --> 40:14.000
It types directly called Gology.

40:14.000 --> 40:15.000
So, there's loads.

40:15.000 --> 40:17.000
So, probably doesn't even compile.

40:17.000 --> 40:18.000
But let's see.

40:18.000 --> 40:23.000
So, next call is called self.

40:23.000 --> 40:24.000
It's a pattern.

40:24.000 --> 40:29.000
I don't know if there's a name.

40:29.000 --> 40:33.000
So, I want people to let me know how this thing is called.

40:33.000 --> 40:34.000
If there's a name.

40:34.000 --> 40:35.000
Anyways.

40:35.000 --> 40:36.000
Yeah.

40:36.000 --> 40:38.000
It's not really a good topic.

40:38.000 --> 40:40.000
It's more related to programming.

40:41.000 --> 40:45.000
I'm not on Gology basis, so that's why I'm here.

40:45.000 --> 40:47.000
So, a really bad example.

40:47.000 --> 40:51.000
Because I was really not really creative for writing examples.

40:51.000 --> 40:53.000
So, I have like here function.

40:53.000 --> 40:54.000
It's really bad to see.

40:54.000 --> 40:55.000
Anyways.

40:55.000 --> 40:56.000
Can you see?

40:56.000 --> 40:57.000
Well, is it fun?

40:57.000 --> 40:58.000
No.

40:58.000 --> 40:59.000
It's not.

40:59.000 --> 41:01.000
Yeah.

41:01.000 --> 41:02.000
Okay.

41:02.000 --> 41:05.000
No, it's just like HTML.

41:05.000 --> 41:08.000
Can I make it like black or dark mode?

41:08.000 --> 41:09.000
Maybe can convert it to colors?

41:09.000 --> 41:10.000
Also, it's explain.

41:10.000 --> 41:13.000
So, there's like function here called fool.

41:13.000 --> 41:17.000
And it has like some helper functions instead of it.

41:17.000 --> 41:19.000
So, we have like two variables here.

41:19.000 --> 41:21.000
Local variables.

41:21.000 --> 41:25.000
And those functions here.

41:25.000 --> 41:29.000
Inside my, my fool, they basically handle those variables.

41:29.000 --> 41:31.000
And like.

41:31.000 --> 41:34.000
Okay. Yeah. That will help.

41:34.000 --> 41:38.000
Okay.

41:38.000 --> 41:39.000
This is better.

41:39.000 --> 41:40.000
Okay.

41:40.000 --> 41:45.000
You can see here some some variables here on my function.

41:45.000 --> 41:46.000
Some helper functions.

41:46.000 --> 41:48.000
Don't care about the constant of the functions.

41:48.000 --> 41:51.000
It's really like doesn't matter.

41:51.000 --> 41:56.000
But you see that those functions they use those variables here.

41:56.000 --> 41:58.000
So, I have something being done here.

41:58.000 --> 42:03.000
And some actual code that uses those two inner functions.

42:03.000 --> 42:11.000
So, in a traditional clean code object oriented way, what you would do is,

42:11.000 --> 42:16.000
like to create a helper class or in our case, a struct.

42:16.000 --> 42:19.000
Put like the state and some of it.

42:19.000 --> 42:22.000
Instead of like having this free variables.

42:22.000 --> 42:25.000
And you have would have some private methods.

42:25.000 --> 42:28.000
So, my helper functions would become.

42:28.000 --> 42:32.000
So, called like private methods.

42:32.000 --> 42:36.000
And my behavior would be on a public.

42:36.000 --> 42:38.000
I will highlight again.

42:38.000 --> 42:42.000
My public behavior would be on a public method.

42:42.000 --> 42:43.000
So, called.

42:43.000 --> 42:45.000
So, yay.

42:45.000 --> 42:47.000
It's object oriented.

42:47.000 --> 42:49.000
And it's much cleaner, it's better.

42:49.000 --> 42:50.000
Not really.

42:50.000 --> 42:52.000
But.

42:52.000 --> 42:57.000
So, this is how it would look like.

42:57.000 --> 43:01.000
The so-called like clean code version of it.

43:01.000 --> 43:03.000
And I'm not saying that I agree.

43:03.000 --> 43:05.000
I'm basically saying that you know.

43:05.000 --> 43:07.000
That's what it would be said.

43:07.000 --> 43:09.000
So, it's still at some time.

43:09.000 --> 43:11.000
So, yeah.

43:11.000 --> 43:13.000
Great.

43:13.000 --> 43:21.000
So, my point is that I saw like some kind of equivalence between the two different approaches.

43:21.000 --> 43:30.000
They weren't using like an extra class or struct to encapsulate the, you know, private and public behavior.

43:30.000 --> 43:32.000
But here we don't have this.

43:32.000 --> 43:34.000
We have, you know.

43:34.000 --> 43:39.000
My scope is being used as self in my class.

43:39.000 --> 43:47.000
So, there's like this implicit self which is the scope itself where those two variables here, which are the state where they are.

43:47.000 --> 43:55.000
And we create like this behavior of private and someone by capturing them into the two functions.

43:55.000 --> 43:57.000
That's something.

43:58.000 --> 44:02.000
Which I have seen like multiple times, but I don't know how this thing is called.

44:02.000 --> 44:05.000
So, that's why I'm asking you all to name it.

44:05.000 --> 44:08.000
So, bottom line.

44:08.000 --> 44:12.000
The two approaches of their equivalence, they behave the same way.

44:12.000 --> 44:14.000
Okay.

44:14.000 --> 44:22.000
So, as I said, my scope is the self or these depends on the programming language that you're using.

44:22.000 --> 44:29.000
I guess, of course, the receiver of the methods of the, of the, the message call.

44:29.000 --> 44:36.000
Yeah, and we can use the, um, those like three variables in the function as the state.

44:36.000 --> 44:39.000
Um, I don't know how this thing is called if there's a name.

44:39.000 --> 44:41.000
So, that's again.

44:41.000 --> 44:44.000
Please, the elephant, you know, this thing has a name.

44:44.000 --> 44:46.000
I don't know, I don't know whether it's a good practice.

44:46.000 --> 44:49.000
I know that it's being very useful for me.

44:50.000 --> 44:57.000
There is no official name, but there is a sentence under which this is known.

44:57.000 --> 45:03.000
It is called closures are poor, poor, cement objects and vice versa.

45:03.000 --> 45:04.000
Okay.

45:04.000 --> 45:07.000
So, that's a good name. Thank you a lot.

45:07.000 --> 45:12.000
So, um, yeah, so probably not good practice, but it's being useful for me.

45:12.000 --> 45:15.000
Um, so one of the issues.

45:15.000 --> 45:28.000
I, I don't know much about the go home pilot, but, um, will the go home pilot just like move things to the heap, just because the work captures captured captured by those, um, those functions.

45:28.000 --> 45:32.000
I don't know really. I haven't really banked my benchmarked anything.

45:32.000 --> 45:39.000
Um, so it also like leads to very long functions, um, which might be good or not.

45:39.000 --> 45:40.000
I don't know.

45:40.000 --> 45:45.000
I don't know, um, long official rather than smaller ones because it prevents me of jumping around.

45:45.000 --> 45:55.000
But, yeah, just as one example, which I have here from, and how do I open this, it's a link, okay.

45:55.000 --> 45:59.000
Um, some code based from sometime ago.

45:59.000 --> 46:06.000
So, I have like this function here, which is quite long as you can see, but it's, I'm almost finished.

46:07.000 --> 46:15.000
Um, I have like some some stage here, and I have a lot of like, so called like my private methods, which are just like free functions here.

46:15.000 --> 46:20.000
And, um, I just have them inside of like the outer function.

46:20.000 --> 46:24.000
And I essentially use them in different places.

46:24.000 --> 46:33.000
So, it's a very long function that, you know, is doing, I think, a lot of bugs here, but no, I don't care about the bugs that much.

46:33.000 --> 46:43.000
So, yeah, basically, um, that's the thing I wanted to, to show that this, this kind of approach has been useful for me on some code basis.

46:43.000 --> 46:47.000
It kind of emerged that I didn't really plan, but it was there.

46:47.000 --> 46:54.000
And yeah, so the question has been answered already, so that's it. Thank you a lot.

46:54.000 --> 46:57.000
Thank you.

46:57.000 --> 47:02.000
I don't know how to actually hear us all just do it like this.

47:02.000 --> 47:08.000
I got one last minute submission for the Lightning Talks, which was from a girl called Marcha.

47:08.000 --> 47:13.000
I know her well, so I decided to give her accept her talk.

47:13.000 --> 47:16.000
This morning I gave it to all the states of Go.

47:16.000 --> 47:23.000
Today I'm now the end-giving, the last talk, this state of Marcha.

47:23.000 --> 47:27.000
Thank you for starting the timer for your own boss, Nessim.

47:27.000 --> 47:29.000
I want to thank you.

47:29.000 --> 47:35.000
I want to thank for them specifically for making sure we have this room, for making sure we get to be here,

47:35.000 --> 47:37.000
for making sure that everything works.

47:37.000 --> 47:39.000
Thanks a lot.

47:39.000 --> 47:42.000
I'd like to talk all my volunteers over there.

47:42.000 --> 47:45.000
The first row, the ones who already have our going for dinner.

47:45.000 --> 47:47.000
The ones who are helping us stay in the cleanup.

47:47.000 --> 47:50.000
Thank you. Thank you very much.

47:50.000 --> 47:59.000
I'd like to talk to you. Thank you for attending.

47:59.000 --> 48:02.000
You have might have been attending for all 11 years.

48:02.000 --> 48:04.000
You might have been attending for the first time.

48:04.000 --> 48:07.000
You are what keeps me going.

48:07.000 --> 48:10.000
If you weren't here, I wouldn't have done this.

48:10.000 --> 48:12.000
Please keep that in mind.

48:12.000 --> 48:17.000
And now in my actual state, I am tired.

48:17.000 --> 48:19.000
Noticeable?

48:19.000 --> 48:21.000
Really, really tired.

48:21.000 --> 48:27.000
My personal life, simply said, complete mess.

48:27.000 --> 48:34.000
I worked on this dev room, for ever since the CFE came online, September something.

48:34.000 --> 48:38.000
I worked on it from multiple hospitals.

48:38.000 --> 48:42.000
In multiple stages, I had my laptop, my phone.

48:42.000 --> 48:44.000
I was like, okay, I need to send out emails.

48:44.000 --> 48:46.000
I need to get phone, please going.

48:46.000 --> 48:48.000
I need to advertise CFP's.

48:48.000 --> 48:51.000
In whatever mental physical state I that time was,

48:51.000 --> 48:57.000
be sure it's not normal, but I kept going.

48:57.000 --> 49:01.000
I might even have been standing here today.

49:01.000 --> 49:03.000
So I want to thank everyone.

49:03.000 --> 49:09.000
I really hope you appreciate my work as a volunteer here.

49:09.000 --> 49:19.000
Thank you.

49:35.000 --> 49:36.000
I'm not being paid.

49:36.000 --> 49:39.000
I don't have any sponsors like for them.

49:39.000 --> 49:43.000
I don't even have a free hamburger to go home on.

49:43.000 --> 49:47.000
I have to pay my bus to go to the Lair.

49:47.000 --> 49:50.000
So I really hope to see you all next year.

49:50.000 --> 49:54.000
And this is a general notice to everyone in this room.

49:54.000 --> 49:57.000
If you can, volunteer.

49:57.000 --> 50:00.000
Here, everywhere somewhere else.

50:00.000 --> 50:02.000
The world is miserable.

50:02.000 --> 50:08.000
And we all need some volunteers to make the classical Silicon Valley dilemma of.

