Metaprogramming and Macros in Julia | Stefan Karpinski | Jeff Bezanson

Описание к видео Metaprogramming and Macros in Julia | Stefan Karpinski | Jeff Bezanson

Abstract:
Julia is homoiconic: it represents its own code as a data structure of the language itself. Since code is represented by objects that can be created and manipulated from within the language, it is possible for a program to transform and generate its own code. Metaprogramming (http://docs.julialang.org/en/release-...) is described in detail in the Julia manual.

Visit http://julialang.org/ to download Julia.

For more info on the Julia Programming Language, follow us on Twitter:   / julialanguage   and consider sponsoring us on GitHub: https://github.com/sponsors/JuliaLang

Contents
00:00 Welcome
00:27 Metaprogramming allows you to simplify creating programs that write programs
00:45 Searching for an example of metaprogramming inside Julia code
02:38 Typical problem: how to call LAPACK from inside your code?
03:47 Example: calling function written in C from inside your code
06:17 Example: using for loop and `@eval` to generate code of the functions
10:52 Julia code is represented by Julia data structure
13:06 Question: what symbol can go in between symbols a and b (variables)?
13:58 Refining of last question: what is the default symbol for operator after `+` and `*`.
14:26 `a + b` is just a convenient way of writing `+(a, b)`
15:25 You can construct expressions from the ground up
18:18 Comment on Julia and MATLAB
18:47 Question: what is the relation between Julia's syntax and Abstract Syntax Tree (AST)?
19:42 `@eval` is just shorthand for `eval(quote(...))`
20:40 Macros is a Julia
22:40 Example: `@time` macro
27:07 Question: role of esc in macro hygiene

S/O to https://github.com/KZiemian for the video timestamps!

Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: https://github.com/JuliaCommunity/You...

Interested in improving the auto generated captions? Get involved here: https://github.com/JuliaCommunity/You...

Комментарии

Информация по комментариям в разработке