Submit

Top crypto stories of week 52, 2022

Mon 26 December 2022 to Sun 1 January 2023

The top story on Kiwi News from Mon 26 December 2022 to Sun 1 January 2023, ranked by upvotes, comments and clicks, with 0 comments in total.

Text under a title is an AI summary of the linked article.

  1. Let's make a Teeny Tiny compiler (austinhenley.com)
    1 upvote · 0 comments · by cypherr.eth

    Austin Z. Henley presents a tutorial for building a compiler in Python for Teeny Tiny, a BASIC-like teaching language that compiles to C, in about 500 lines of code. The language supports numerical variables, basic arithmetic, if statements, while loops, printing and input of numbers, labels and goto, and comments, but no functions, arrays, file I/O, or else. The compiler follows three steps: a lexer that breaks source code into tokens, a parser that checks token order, and an emitter that outputs C code. The post walks through writing the lexer, starting with a Lexer class in lex.py, character handling through nextChar and peek, and a TokenType enum for keywords and operators. The tutorial is the first of a three-part series, and the full source is in a GitHub repo.