# SI413 Fall 2026 Unit 1 Labs language_name: Prefix notes_from_prof: | Language designed by Honglin Wang, reviewed by Mike Reemts. This is a very creatively designed language, with a few cool features. It looks exotic but I think it will actually be a little more straightforward to implement because of how it's designed. It's a "prefix" language (appropriately enough), meaning the operator always comes before the operands, even for concatenation. This strange syntax choice actually allows you to write any program without using parentheses, just based on the operators ordering. example_program: | ~ [{18}What is your name?] {* Prints What is your name*} ~ + [{6}Hello ] ? {* Prints Hello then asks user for input*} ~ [{30}Enter a noun and an adjective:] {* Prints Enter a noun and an adjective*} ~ + + ! ? [{8} is not ] ? {* Read two inputs, reverse the first one, and concatenate the first input with ' is not ' and the second input.*} language_syntax: | A program consists of a sequence of zero or more Statements. statements: - print statement consists of character '~' followed by an expression expressions: - string literals consist of character '[' then a positive integer 'N' wrapped in {} followed by N ASCII characters ending with character ']' - concatenations are denoted by character '+' followed by two expressions - reverse is denoted by character '!' followed by a single expression A single space must separate operators and literals from each other. comments: - begin with '{*' and end with '*}' language_semantics: | expressions are evaluated from left to right, when evaluating multiple concatenations in a row evaluate them from right to left. statement semantics: - print statement '~ expression' outputs it to the console on its own line. expression semantics: - input '?' reads one line of user input - concatenation '+ expression1 expression2' produces a new string contatning expression1 followed by expression2 with no space in between - reverse '! expression' produces a new string in reverse order