cinera_handmade.network/pervognsen/bitwise/bitwise/bitwise015.hmml

90 lines
7.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[video member=pervognsen stream_platform=twitch project=bitwise title="More Compiler Hacking" vod_platform=youtube id=s5_RV3y4L18 annotator=Miblo]
[0:08][Recap and set the stage for the day][:speech]
[0:51][Review the work performed on arithmetic conversions in unify_arithmetic_operands() from the last stream[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:language :parsing :research]
[6:27][Describe the final operand promotion case under 6.3.1.8 Usual arithmetic conversions[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf] with an example][:language :parsing :speech]
[8:35][Continue to review the work on const expression evaluation, the != operator and resolver :"error handling"][:language :parsing :research]
[12:22][Review the work converting between void pointers and any other pointer type, with some cool tips on C][:language :parsing :research]
[17:21][Demo the new support for variadic functions][:language :parsing :run]
[18:42][Review the variadic function handling code in parse_type_func() and resolve_expr_call(), noting how these work in C[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:language :parsing :research]
[22:51][Review the work supporting empty compound literals in f2()][:language :parsing :research]
[24:43][Q&A][:speech]
[25:04][@irazorx0][@pervognsen You have a redundant "variadic = true" as your error is if(variadic)]
[25:26][@xanatos387][@pervognsen Will we have a bool type?][:language]
[26:05][@pmttavara][Not needing a temporary is amazing. I see a lot of sockets code writing things like "int zero = 0;" just so setsockopt() can take its address]
[26:28][@sci4me][Why do you put void as a parameter?][:"code generation" :language]
[26:49][Determine to add support for annotating foreign function declarations][:"code generation" :language :parsing :speech]
[29:45][Introduce a new "\@" token, Note and NoteList structs and parse_note_list(), for parse_decl_opt() to call][:"code generation" :language :parsing]
[34:50][Test our \@foreign function annotating, to see that it's not quite right][:"code generation" :language :parsing :run]
[35:57][Introduce note_list() and add a Pos pos to the Note struct][:"code generation" :language :parsing]
[38:22][:Run it to see that it looks right][:"code generation" :language :parsing]
[38:52][Introduce get_decl_note() for gen_func_defs() to call][:"code generation" :language :parsing]
[41:36][:Run it, with an explanation of how this works][:"code generation" :language :parsing]
[42:17][Annotate \@foreign functions in test1.ion, and introduce is_decl_foreign() in ast.c][:"code generation" :language :parsing]
[44:27][:Run it to see what this generates][:"code generation" :language :parsing]
[45:53][Introduce resolve_unary_op() to handle unary arithmetic operators, for resolve_expr_unary() to call[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[50:51][Introduce resolve_binary_arithmetic_op() to handle binary arithmetic operators, for resolve_expr_binary() to call[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[59:05][Enable resolve_expr_binary() to handle the bitwise shift operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:07:27][Enable resolve_expr_binary() to handle relational operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:09:20][@nothings2][@pervognsen Because C99 supports complex][:language]
[1:09:28][Introduce resolve_binary_op(), and enable resolve_expr_binary() to handle relational operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:14:34][Enable resolve_expr_binary() to handle equality operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:16:37][Enable resolve_expr_binary() to handle bitwise AND, XOR and OR and logical AND and OR,[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf] introducing is_scalar_type()][:"code generation" :language :parsing]
[1:23:53][Enable resolve_expr_ternary() to handle the ternary conditional operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:27:38][Introduce resolve_stmt_assign() to begin the handling of assignment operators[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing]
[1:29:41][:Run it to test that we didn't break anything][:"code generation" :language :parsing]
[1:30:05][Introduce test_ops() in test1.ion to test resolve_expr_unary()][:"code generation" :language :parsing]
[1:31:34][:Run it to see that it works][:"code generation" :language :parsing]
[1:32:06][Try to test a \~ assignment in test_ops()][:"code generation" :language :parsing]
[1:32:46][Add TOKEN_NEG to token_kind_names][:"code generation" :language :parsing]
[1:33:20][:Run it to find that the \~ assignment works][:"code generation" :language :parsing]
[1:33:30][Add tests of binary operators in test_ops()][:"code generation" :language :parsing :programming :run]
[1:34:00][Fix resolve_expr_binary to handle TOKEN_MOD separately from TOKEN_MUL and TOKEN_DIV][:"code generation" :language :parsing]
[1:34:51][Test that % operator, and further assignments in test_ops()][:"code generation" :language :parsing :programming :run]
[1:37:17][Fix the handling of TOKEN_SUB in resolve_expr_binary()][:"code generation" :language :parsing]
[1:37:53][:Run it to see that it works][:"code generation" :language :parsing]
[1:38:05][Test shifting and comparison in test_ops(), to see that it all works][:"code generation" :language :parsing :programming :run]
[1:40:18][Roll the TOKEN_EQ and TOKEN_NOTEQ cases into the other comparison cases in resolve_expr_binary()][:"code generation" :language :parsing]
[1:40:58][Test bitwise and logical comparison stuff in test_ops()][:"code generation" :language :parsing :programming :run]
[1:42:56][Q&A][:speech]
[1:44:49][Recap the day's work, with a glimpse into the future handling pointer decay[ref
author=ANSI
title="ISO/IEC 9899: Information technology Programming languages C"
url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf]][:"code generation" :language :parsing :speech]
[/video]