metanohi/site/projects/enigma/doc/enigma-0.1-html/Introduction.html

94 lines
3.8 KiB
HTML
Raw Normal View History

<html lang="en">
<head>
<title>Introduction - Enigma</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Enigma">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="index.html#Top" title="Top">
<link rel="next" href="Language.html#Language" title="Language">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is for Enigma, version 0.1.
Copyright (C) 2010 Niels Serup
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts, and
no Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
This document is also available under the terms of the Creative
Commons Attribution-Share Alike 3.0 (or any later version)
Unported license. A copy of the license is available at
`http://creativecommons.org/licenses/by-sa/3.0/legalcode'.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Introduction"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Language.html#Language">Language</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="index.html#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">1 A short introduction</h2>
<p>Today, in the world of programming, the commonly used programming
languages have &mdash; to some extent &mdash; adapted the same basic
syntax. Both C, C++, Java, Python and Ruby (and others) all share
several paradigms, even though they are still very different. Enigma, on
the other hand, is very different from the &ldquo;common&rdquo; languages. See
this small program to get an idea of Enigma:
<pre class="verbatim">{/a,b/
a 2 ! multiply = c;
b c ! add = return;
} = odd-add;
9 4 ! odd-add | stdout temp ! write;
</pre>
<p class="noindent">Here, 9 is first multiplied with 2 and then added to 4. The
program then prints the result (22).
<p>With only a few constructs and built-in variables, Enigma is quite small
and relatively simple. Any logic can be expressed in Enigma. The above
example may seem odd, but its aspects will be dealt with in the next
chapter.
<p>Enigma is <em>not</em> the kind of programming language that likes to
control programmers. When programming in Enigma, one creates functions
that call other functions &mdash; instead of creating functions that are
called by built-in functions.
<p>On the other hand, Enigma is very restrictive. There are limits to
certain things. If these limits were not present, chaos would
ensue. Perhaps.
<p><a name="index-pointers-1"></a>Like many other languages, Enigma is quite fond of pointers. In Enigma,
all variables are pointers. When <code>x</code> is assigned to <code>a</code>, and
<code>b</code> is assigned to <code>a</code>, changing <code>b</code> also changes
<code>a</code>. As a matter of fact, when two pointers points to the same
place, they are <strong>forever</strong> linked together.
<p>Enigma is not recommended for serious use. Use with <strong>caution</strong>!
</body></html>