====== Picotalk ====== Picotalk is a simple Smalltalk-like programming language and environment implemented in ECMAScript (JavaScript), mainly intended (but not limited) to teaching basic concepts of programming. Project page at berliOS: [[https://developer.berlios.de/projects/picotalk/]] ===== Picotalk Isn't Smalltalk ===== Picotalk * **Case is important**: Picotalk distinguishes between identifiers starting with an uppercase letter and those starting with a lowercase letter. A beginning uppercase letter denotes a global name, e.g. a class name. * **Brace array literals**: Picotalk only supports the brace array notation for array literals. * **Declaration of temporaries is a statement**: ===== Data Structures ===== All data structures (AST, runtime objects) are now pure JSON data structures. This allows easier transport ove ==== AST Nodes ==== Each AST node is represented by a plain JavaScript object. The type of an AST node is determined by its ''type'' property. Legal values are the ^ Type ^ Properties ^ | (all) | ''loc'' | | **Code** || | Script | ''args'', ''stmts'' | | Block | ''args'', ''stmts'' | | Method | ''kind'', ''selector'', ''args'', ''stmts'' | | **Misc Statements** || | Temporaries | ''temps'' | | Return | ''expr '' | | **Expressions** || | Assignment | ''name'', ''expr '' | | MessageSend | ''kind'', ''selector'', ''receiver'', ''args'' | | Name | ''name'' | | GlobalName | ''name'' | | Literal | ''literal'' | | Self | - | | Super | - | | BraceArray | ''exprs'' | | Primitive | ''module'', ''method'' | ===== Bytecode ===== Picotalk code is compiled to bytecode. In the current version the generated "bytecode" is just a simple JavaScript array. ^ Opcode ^ Parameters ^ Description ^ | NOP | - | Does nothing | | PUSH_NIL | - | Pushes the ''nil'' object onto the stack | ===== History ====== * Nov 2006: All AST node objects are now pure JSON data structures.