File: el_techinformation.html

package info (click to toggle)
basic256 1.1.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 24,460 kB
  • sloc: cpp: 10,148; yacc: 3,023; java: 1,091; lex: 1,051; sh: 117; xml: 33; makefile: 15
file content (95 lines) | stat: -rw-r--r-- 6,114 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en" dir="ltr" class="no-js">
<head>
    <meta charset="utf-8" />
    <title>el:techinformation [BASIC 256 - Language Documentation]</title>
<link rel="stylesheet" type="text/css" href="lib/exe/cssc171c1dfe8519125bb40a349172b001a.css"/>
    </head>
<body>
    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki     ">
<div id="dokuwiki__header"><div class="pad group">
    <div class="headings group">
        <h1><a href="start.html"  accesskey="h" title="[H]"><img src="lib/tpl/dokuwiki/images/logo.png" width="64" height="64" alt="" /> <span>BASIC 256 - Language Documentation</span></a></h1>
            </div>
    </div>
            <div class="breadcrumbs">
                            <div class="youarehere"><span class="bchead">You are here: </span><span class="home"><bdi><a href="start.html" class="wikilink1" title="start">start</a></bdi></span> » <bdi><a href="el_start.html" class="wikilink1" title="el:start">el</a></bdi> » <bdi><span class="curid"><a href="el_techinformation.html" class="wikilink1" title="el:techinformation">techinformation</a></span></bdi></div>
                    </div>
    <hr class="a11y" />
</div></div>
        <div class="wrapper group">
            <div id="dokuwiki__content"><div class="pad group">
                <div class="pageId"><span>el:techinformation</span></div>
                <div class="page group">
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>
<ul class="toc">
<li class="level2"><div class="li"><a href="el_techinformation.html#developer_and_technical">Developer and Technical</a></div>
<ul class="toc">
<li class="level3"><div class="li"><a href="el_techinformation.html#overview">Overview</a></div></li>
<li class="level3"><div class="li"><a href="el_techinformation.html#to_do">To do</a></div></li>
<li class="level3"><div class="li"><a href="el_techinformation.html#the_life_of_a_basic-256_program">The life of a BASIC-256 program</a></div></li>
<li class="level3"><div class="li"><a href="el_techinformation.html#graphical_output">Graphical Output</a></div></li>
</ul></li>
</ul>
</div>
</div>
<h2 class="sectionedit1" id="developer_and_technical">Developer and Technical</h2>
<div class="level2">
</div>
<h3 class="sectionedit2" id="overview">Overview</h3>
<div class="level3">
<p>
BASIC-256 programs are first compiled to byte code using LEX and YACC, and then run by interpreting the byte code in a stack machine. Adding functions is a simple matter of adding a byte code, letting LEX and YACC know how to parse the syntax, and coding the appropriate instruction in the interpreter. If you&#039;ve never written a compiler or interpreter, the BASIC-256 internals would provide an excellent introduction to the basics of that.
</p>
<p>
Please keep in mind that BASIC-256 is a teaching language for children (target ages 7-9), so we&#039;d like to stay away from advanced concepts as much as possible. While it would be fun to make BASIC-256 a powerful high-level language, there are already much better languages that exist to fill that need: Python, Scheme.
</p>
</div>
<h3 class="sectionedit3" id="to_do">To do</h3>
<div class="level3">
<ol>
<li class="level1"><div class="li"> Real-time error checking in the editor (parse each line just after it&#039;s typed)</div>
</li>
</ol>
</div>
<h3 class="sectionedit4" id="the_life_of_a_basic-256_program">The life of a BASIC-256 program</h3>
<div class="level3">
<ol>
<li class="level1"><div class="li"> BASIC program parsed into tokens by LEX</div>
</li>
<li class="level1"><div class="li"> LEX feeds tokens to YACC</div>
</li>
<li class="level1"><div class="li"> YACC determines if line is valid syntax. If so, it adds the appropriate byte codes to the byte-coded program</div>
</li>
<li class="level1"><div class="li"> If no syntax errors occur, the C++ portion of the program interprets the byte code one instruction at a time, using a stack machine</div>
</li>
<li class="level1"><div class="li"> Run time errors halt program execution and display an error message on the screen</div>
</li>
</ol>
</div>
<h3 class="sectionedit5" id="graphical_output">Graphical Output</h3>
<div class="level3">
<p>
All graphing functions are performed on a buffer, which is subsequently written to the screen immediately after each operation. This is intentionally inefficient. The “fast” way to do this would be to have a separate rendering thread that calls a display routine when it&#039;s done, or to do all the rendering in the display routine.
</p>
<p>
This is an ideal illustration of concessions made in BASIC-256 to keep things simple. We&#039;re interested in kids being able to see their dots move across the screen without having to explain double-buffering and multi-threading. We also want to allow them to write games like Pong that test for collisions using basic geometric formulas and draw the ball and paddles in a single loop. The current approach allows for this.
</p>
<p>
Note: To speed things up for children doing more advanced programs, the <a href="el_fastgraphics.html" class="wikilink1" title="el:fastgraphics">FASTGRAPHICS</a> mode has been added. When in this mode, the display will only be updated when the BASIC program uses the <a href="el_refresh.html" class="wikilink1" title="el:refresh">REFRESH</a> command. This allows kids to benefit from double-buffering without having to understand it completely.
</p>
</div>
                                    </div>
                <div class="docInfo"><bdi>el/techinformation.txt</bdi> · Last modified: 2014/01/11 23:26 (external edit)</div>
                            </div></div>
            <hr class="a11y" />
        </div>
<div id="dokuwiki__footer"><div class="pad">
    <div class="license">Except where otherwise noted, content on this wiki is licensed under the following license: <bdi><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license" class="urlextern">CC Attribution-Share Alike 3.0 Unported</a></bdi></div>
</div></div>
    </div></div>
    <div id="screen__mode" class="no"></div>
</body>
</html>