Toi (programming language): Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Add: title, date, website. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | Linked from User:BrownHairedGirl/Articles_with_bare_links | #UCB_webform_linked 1551/2171
m Reverted edits by Elahemood (talk) (HG) (3.4.13)
 
(6 intermediate revisions by 4 users not shown)
Line 1:
'''Toi''' is an imperative, type-sensitive language that provides the basic functionality of a [[programming language]]. The language was designed and developed from the ground-up by Paul Longtine.<ref>{{cite web|url=https://github.com/bannana/language/blob/master/doc/OVERVIEW|title=bannana/language|website=[[GitHub]]|date=17 February 2021|publisher=}}</ref> Written in C, Toi was created with the intent to be an educational experience and serves as a learning tool (or toy, hence the name) for those looking to familiarize themselves with the inner-workings of a programming language.<ref>{{cite web|url=https://banna.tech/projects/post/toy_language/|title=banna - useless things|publisher=|access-date=2016-10-23|archive-date=2016-10-24|archive-url=https://web.archive.org/web/20161024151620/https://banna.tech/projects/post/toy_language/|url-status=dead}}</ref>{{dead link|date=December 2020}}
 
== Specification<ref>{{cite web|url=https://github.com/bannana/language/blob/master/doc/SPECIFICATION|title=bannana/language|website=[[GitHub]]|date=17 February 2021|publisher=}}</ref><ref>{{Cite web|url=http://dev.nanner.co/language/file/doc/SPECIFICATION.html|title=SPECIFICATION - language - some fools attempt at an interpreted language}}</ref> ==
Line 161:
D<nowiki><[variable]></nowiki> - Dynamic bytecode argument.
----
Hex | MemnonicMnemonic | arguments - description
 
==== Stack manipulation ====
 
Line 170 ⟶ 171:
12 DUP - duplicates the top of the stack
13 ROT_THREE - rotates top three elements of stack
 
==== Variable management ====
20 DEC S<nowiki><scope></nowiki> S<nowiki><type></nowiki> N - declare variable of type
Line 176 ⟶ 178:
23 CTV S<nowiki><scope></nowiki> N D<nowiki><data></nowiki> - loads constant into variable
24 CTS D<nowiki><data></nowiki> - loads constant into stack
 
==== Type management ====
 
Line 183 ⟶ 186:
30 [[typeof|TYPEOF]] - pushes type of TOS on to the stack TBI
31 CAST S<nowiki><type></nowiki> - Tries to cast TOS to <nowiki><type></nowiki> TBI
 
==== Binary Ops ====
 
Line 203 ⟶ 207:
4D OR - or's TBI
4E XOR - xor's TBI
4F NAND - and's TBI
 
==== [[Conditional (computer programming)|Conditional Expressions]] ====
 
Line 219 ⟶ 224:
57 OR - Boolean OR
58 AND - Boolean AND
 
==== Loops ====
60 STARTL - Start of loop
Line 224 ⟶ 230:
6E BREAK - Breaks out of loop
6F ENDL - End of loop
 
==== Code flow ====
 
Line 238 ⟶ 245:
7E DONE - End of block
7F CALL N - Calls function, pushes return value on to STACK.
 
==== Generic object interface. Expects object on TOS ====
80 GETN N<nowiki><name></nowiki> - Returns variable associated with name in object
Line 257 ⟶ 265:
F1 NEW S<scope> N - Instantiates class
F0 RETURN - Returns from function
 
==== Special Bytes ====
00 [[Null character|NULL]] - No-op