nim-lang / edutainment

Tasks related to making Nim more widely known such as video creation.
7 stars 0 forks source link

Metaprogramming in Nim #1 Introduction and Generic Procedures #4

Closed Kiloneie closed 2 years ago

Kiloneie commented 3 years ago

In this video i will introduce the concept of metaprogramming to the viewer, it's 3 metaprogramming constructs/features with the most basic template example for copy pasta and then move to some equally easy to understand Generic Procedures(procs).

Chapters/sub-chapters:

Kiloneie commented 2 years ago

Near finished video, awaiting for feedback, link: https://youtu.be/gkEb5azqkoc

HugoGranstrom commented 2 years ago

Nice video :) One thing I hung up on though, is that you repeatedly said that you can't have generics of different types, which is true when you only use one generic. But it sounds like you say that it isn't possible at all, which could be giving the wrong impression of generics and making them look less useful than they are. Idk how much detail to go into in an intro video to meta-programming, but I would rephrase those parts to at least not be so dismissive of the fact that it is possible.

Eg:

proc hello[T, U](a: T, b: U) =
    ...
Kiloneie commented 2 years ago

That's a good point, i will put that into the video, some other video will then go into finer detail.

Kiloneie commented 2 years ago

Here is a version 2 of this video's script: https://play.nim-lang.org/#ix=3BC5

Araq commented 2 years ago

Here are my corrections: https://play.nim-lang.org/#ix=3Cnx Please diff these two and take care of the details.

Kiloneie commented 2 years ago

Here is the video with all the corrections applied and some extras i added afterwards(mainly the SDL part being demonstrated instead of just code written for it - template part).

Link: https://youtu.be/2EWLE-IFgGM

Kiloneie commented 2 years ago

Video complete, closing.