www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

index.html (3160B)


      1 <!DOCTYPE html>
      2 <html>
      3 	<head>
      4 		<title>banna - ramblings</title>
      5 		<meta name="viewport" content="width=device-width, initial-scale=1">
      6 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      7 		<link rel="stylesheet" href="/styles/style.css" />
      8 		<link rel="stylesheet" href="/styles/look.css" />
      9 		<link rel="stylesheet" href="/styles/codetheme.css" />
     10 		<script src="/scripts/highlight.js"></script>
     11 		<script>hljs.initHighlightingOnLoad();</script>
     12 	</head>
     13 
     14 	<body>
     15 		<div id="sidebar">
     16 			<div id="logo">
     17 				<a href="/">
     18 					<img src="/banna.png" alt="banna.tech" height="45" width="201" />
     19 				</a>
     20 			</div>
     21 			<div id="nav">
     22 				<a class="current" href="/post">blog</a>
     23 				<a class="" href="/things">things</a>
     24 				<a class="" href="/about">about</a>
     25 			</div>
     26 		</div>
     27 
     28 		<div id="wrapper">
     29 			<div id="content">
     30 <div class="post">
     31     <a href="/post/ramblings_on_the_toy_language_part_2" class="link"><h1 class="header">Ramblings on the Toy Language Part 2</h1></a>
     32     <span class="date">Posted on March, 24 2016</span>
     33     <div class="content">
     34 <blockquote>
     35 <p>In the last installment of <a href="https://banna.tech/post/ramblings_on_the_toy_language_part_1/">Ramblings on the Toy Language</a>, I talked about the definition of an instruction interpreter. Beyond interpreting instructions, providing an environment where instruction subroutines can manipulate various components of the runtime is a key factor in providing a turing-complete architecture. In this installment, I will be going over the basic components of a runtime context.</p>
     36 </blockquote>
     37 <h2>Runtime Context</h2>
     38 <p>Much like how various components are connected together on a main bus inside a CPU, the runtime context provides references to various objects (along with their interfaces) that need to be exposed for a runtime to function. Refer to the diagram below:</p>
     39 <p><img alt="runtime" src="//i.banna.tech/190blog.svg" /></p>
     40 <p>In this diagram, the entry point initiates the runtime which, in turn, initiates a series of objects such as a Namespace instance, a Runtime stack, an Argument stack, and a Program counter. When a program is run, a Runtime context is then passed as the context to any instruction subroutine. Referring to the instruction <a href="http://dev.nanner.co/language/file/doc/SPECIFICATION.html#l159">specifications</a>, an instruction like <code>POP S&lt;n&gt;</code> would manipulate the Runtime stack, while an instruction like <code>GOTO A&lt;addr&gt;</code> would manipulate the program counter.</p>
     41 <p>Each one of these objects under the runtime context have a specific interface where they are manipulated through. The idea of having opcodes as subroutines is to provide abstract wrappers around these interfaces. For example, if there were no runtime context, <a href="http://dev.nanner.co/language/file/doc/SPECIFICATION.html#l196">binary operators</a> wouldn't have a stack to push/pop to. The interface would exist, but the contextual data of specific instances of stacks are needed for a chain of instructions to properly achieve turing-completeness.</p>
     42     </div>
     43 </div>
     44 
     45 
     46 			</div>
     47 		</div>
     48 	</body>
     49 </html>