p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
start.html
Go to the documentation of this file.
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3 <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <style type="text/css">@import 'doc.css';</style>
5 </head><body>
6 <pre style="background:#AE6;width:25em;float:right;padding-right:2em">
7  .ooo
8  'OOOo
9  ~ p ooOOOo 2 ~
10  .OOO
11  oO %% a fast perl5
12  Oo
13  'O
14  `
15  (o)
16  ___/ /
17  /` \
18  /v^ ` ,
19  (...v/v^/
20  \../::/
21  \/::/
22 </pre>
23 <div id='central'>
24 <h1 class="kana">ポーション</h1>
25 <h1>A Short Pamphlet</h1>
26 <h4>by why the lucky stiff</h4>
27 <p>Well, here we go. You want to learn Potion<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>? Sure, okay. But first, bear in mind that Potion isn&#8217;t done yet. And it does very little. It&#8217;s completely esoteric. So long as we&#8217;ve got that straight.</p>
28 <p>So why exactly are you learning this nascent do-nothing probably-broken language? For fun, right? I&#8217;m giving you till the end of sentence to come up with a good reason.</p>
29 <p>This pamphlet probably isn&#8217;t for beginners to computer programming. Just for those curious about what Potion is like.</p>
30 <h2>An Understanding</h2>
31 <p>Potion&#8217;s mantra is: <em>Everything is an object. But objects aren&#8217;t everything.</em></p>
32 <p>Etched beneath that in faint pencil: <em>Oh, and everything is a function.</em></p>
33 <h2>Special Things?</h2>
34 <p>So is there anything unusual about Potion? Anything of particular interest?</p>
35 <ul>
36  <li>Potion compiles programs down to machine code.</li>
37  <li>It includes a small generational near-exact garbage collector,<br />
38  spending on avg 4ms on medium sized heaps.</li>
39  <li>It is two languages: one for code, one for data.</li>
40  <li>It&#8217;s written in under 10,000 lines of C.</li>
41 </ul>
42 <p>Potion is inspired by fellow languages Io, Ruby, OCaml, Lua, <span class="caps">REBOL</span> and C. In that order. (Also influenced by the works of Ian Piumarta, Nicolas Cannasse and Basile Starynkevitch.)</p>
43 <h2>A Sip</h2>
44 <p>Let&#8217;s start with some code.</p>
45 <h3>Ad Nauseam</h3>
46 <pre>
47 <code>
48  loop: 'quaff' print.
49 </code>
50 </pre>
51 <p>I know this isn&#8217;t terribly useful, but it&#8217;s an infinite printing of the string <code>'quaff'</code>.</p>
52 <p>A colon starts a <strong>code block</strong>. And the period ends it. The <code>loop</code> command then runs the code block endlessly. You will see the colon and period combination reused throughout Potion.</p>
53 <p>The <code>print</code> message is sent to the string <code>'quaff'</code>. Strings are an object, like everything. They receive messages. Messages are separated from objects by a space. (In most languages, you use a dot to separate messages. But, like English, the period signifies the end of something rather than a separation.)</p>
54 <h3>A List</h3>
55 <pre>
56 <code>
57  ('cheese', 'bread', 'mayo') at (1) print
58 </code>
59 </pre>
60 <p>This one prints the message &#8216;bread&#8217;. The stuff in parentheses is a <strong>list</strong>. We have a list of foodstuffs. And it&#8217;s being sent a message named <code>at</code>. Every list has an <code>at</code> message that looks up an item by its position in the list.</p>
61 <p>Notice that after the <code>at</code> message is another list. The <code>1</code> is an argument to <code>at</code>. It&#8217;s the position we want to look up. It looks like a list (and it <em>is</em> a list,) but we call it an argument because it comes after a message.</p>
62 <h3>A Table</h3>
63 <pre>
64 <code>
65  (language='Potion', pointless=true) at (key='language') print
66 </code>
67 </pre>
68 <p>Okay, this one looks similar to the list, but it&#8217;s not. Here we have a <strong>table</strong>. The table pairs up things. The string <code>'language'</code> is paired up with the string <code>'Potion'</code>.</p>
69 <p>Notice the arguments are also a table. Lists and tables are sort of interchangeable. You can use a table or a list as arguments.</p>
70 <h2>The Functional Side</h2>
71 <p>Functions are throughout Potion. Whether it be anonymous lambdas, blocks or type functions.</p>
72 <h3>A Function</h3>
73 <pre>
74 <code>
75  minus = (x, y): x - y.
76  minus (y=10, x=6)
77 </code>
78 </pre>
79 <p>This one illustrates a bit better how tables get used as argument lists. We have the <code>minus</code> variable which contains a <strong>function</strong>. The function subtracts <code>y</code> from <code>x</code>. In this case, it&#8217;ll return <code>-4</code>.</p>
80 <p>(This is similar to keyword arguments in Lua and Python, yes. However, it&#8217;s important to see that lists and tables and arguments in Potion all share the same syntax. Less to remember.)</p>
81 <h3>A List as a Function</h3>
82 <pre>
83 <code>
84  foods = ('cheese', 'bread', 'mayo')
85  foods (2)
86 </code>
87 </pre>
88 <p>Here&#8217;s a case where a list is being called as a function. Yes, everything is a function! We could also have called: <code>foods (index=2)</code>.</p>
89 <p>Strings, tables, numbers are also functions. The following returns the 3rd character of the string.</p>
90 <pre>
91 <code>
92  "ヘ(^_^ヘ)(ノ^_^)ノ" (2)
93 </code>
94 </pre>
95 <p>Even functions are functions! I invented this concept. Just like Steve Jobs will one day.</p>
96 <h3>A Block</h3>
97 <pre>
98 <code>
99  (dog='canine', cat='feline', fox='vulpine') each (key, val):
100  (key, ' is a ', val) join print.
101 </code>
102 </pre>
103 <p>Functions can also be attached to methods, for use as anonymous blocks (as in Ruby.)</p>
104 <p>These blocks are merely the last argument. This also works: <code>each ((key, val): key print.)</code>.</p>
105 <h2>The Object-Oriented Side</h2>
106 <pre>
107 <code>
108  Person = class: /name, /age, /sex.
109  Person print = ():
110  ('My name is ', /name, '.') join print.
111 </code>
112 </pre>
113 <p>The above describes a <strong>class</strong> in Potion. Objects are very memory-efficient. Each Person object will store three properties: the name, age and sex. (These are not kept in a hashtable. They are kept in memory, immediately following the object&#8217;s header.)</p>
114 <p>Properties use a slash before their name. This comes from the computer filesystem, where slashes are used before the names of folders in which to store files.</p>
115 <p>However, if you are desperate to use an object as a hashtable, you can store anything you like in an object&#8217;s method table. Not just methods can go there. Anything can be wrapped in a closure.</p>
116 <h3>Making Objects</h3>
117 <pre>
118 <code>
119  p = Person ()
120  p /name string print
121 </code>
122 </pre>
123 <p>Yep, classes are functions, too! They create objects.</p>
124 <p>In this case, the name of <code>p</code> hasn&#8217;t been set, so the code will print <code>nil</code>.</p>
125 <p>But how does subclassing work?</p>
126 <h3>A Subclass</h3>
127 <pre>
128 <code>
129  Policeman = Person class (rank): /rank = rank.
130  Policeman print = ():
131  ('My name is ', /name, ' and I''m a ', /rank, '.') join print.
132 
133  Policeman ('Constable') print
134 </code>
135 </pre>
136 <p>The <code>class</code> message just gets sent to the parent class. And that&#8217;s it.</p>
137 <p>A Policeman now has four properties: <code>/name</code>, <code>/age</code>, <code>/sex</code> and <code>/rank</code>.</p>
138 <p>Notice the first line of the code. The end of the statement is a block. That block is the object&#8217;s constructor. So, in the last line, we&#8217;re passing in the string &#8216;Constable&#8217; as the <code>rank</code> argument.</p>
139 <h2>Licks</h2>
140 <pre>
141 <code>
142  app = [window (width=200, height=400)
143  [para 'Welcome.', button 'OK']]
144  app first name
145 </code>
146 </pre>
147 <p>Lastly, here we have a <strong>lick</strong>. This is the data language brought up earlier in the section about Special Things. This code will print <code>'window'</code> since that&#8217;s the name of the first item in the lick.</p>
148 <p>Two languages in one? What for? I mean you can do anything you want from code, right?</p>
149 <p>There can be problems with expressing data in code. Say the above example was written in Potion code. Some thing like this:</p>
150 <pre>
151 <code>
152  app = window(width=200, height=400):
153  para 'Welcome.'
154  button 'OK'.
155 </code>
156 </pre>
157 <p>In order to get this to work, you need methods for <code>window</code>, <code>para</code> and <code>button</code>. This could clutter the namespace. Also, under what context are those messages available? Are they methods of the created window? Or do they go through some kind of proxy object? We don&#8217;t know what&#8217;s going on behind this code. (Which isn&#8217;t bad at all, if it works.)</p>
158 <p>By having a separate little data language, you can build tree structures of arbitrary elements (akin to <span class="caps">HTML</span>) which act as a kind of common structure between Potion libraries. (You can also think of it as code which has been parsed, but not executed.)</p>
159 <h3>The Flexibility Of&#8230;</h3>
160 <p>Licks generally follow the look of Potion. Strings can be quoted. Tables are curved on the edges.</p>
161 <pre>
162 <code>
163  [name (attr1='string', attr2=10) 'TEXT HERE']
164 </code>
165 </pre>
166 <p>Every lick can have a name, a table of attributes, and a list of children. The list of children can, instead, be a Potion data type, such as a number or string or something. (No, this isn&#8217;t a new idea. It&#8217;s very much like E4X<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup>, but without <span class="caps">XML</span>.)</p>
167 <p>However, licks also allow unquoted strings, to give you some added flexibility.</p>
168 <pre>
169 <code>
170  math = Grammar [
171  digit &lt;- n:[0-9] { n number }
172  value &lt;- d:digit+ | '(' e:expr ')' { d or e }
173  expr &lt;- l:value op:[*/] r:value
174  {
175  if (op == '*'): l * r. else: l / r.
176  }
177  main &lt;- expr
178  ]
179 </code>
180 </pre>
181 <p>Here we have four entries in a lick, getting passed to the <code>Grammar</code> method. The entries are: <code>digit</code>, <code>value</code>, <code>expr</code> and <code>main</code>. (So, for example, the <code>digit</code> entry will be paired with the string <code>"&lt;- n:[0-9] { n number }"</code>.</p>
182 <p>The lick syntax keeps track of nested groups of parentheses, square brackets and curly braces. The unquoted mode merely needs to start with a letter, number or non-token character.</p>
183 <p>Be careful of commas in unquoted strings. This won&#8217;t work:</p>
184 <pre>
185 <code>
186  [dollars $10,000]
187 </code>
188 </pre>
189 <p>You&#8217;ll end up with two entries in the lick: a <code>dollars</code> entry and a <code>000</code> entry.</p>
190 <p>Commas are okay inside of nested groups, though. So, this would be okay:</p>
191 <pre>
192 <code>
193  [dollars $(10,000)]
194 </code>
195 </pre>
196 <h2>Pause For Effect</h2>
197 <p>Okay, let&#8217;s stop. So you&#8217;ve basically seen everything in the language already. Sorry about that. It kind of blows that there&#8217;s no surprises left. :( But, hey, I said it&#8217;s little, right?</p>
198 <p>Are you starting to see some patterns in this code?</p>
199 <ul>
200  <li>Methods, blocks and functions all use the colon-dot syntax.</li>
201  <li>Tables and lists are reused as function and block arguments. And as attributes in licks.</li>
202  <li>Generally, lowercase is used. Except in the case of class names. (But it&#8217;s nothing special, you can use lowercase for classes if you want.)</li>
203 </ul>
204 <h2>Potion Syntax</h2>
205 <p>Now that you have a feel for what Potion can do, let&#8217;s talk about every one of Potion&#8217;s tokens in detail.</p>
206 <h3>Encoding</h3>
207 <p>Potion source code is always in <span class="caps">UTF</span>-8. Likewise, all Potion strings are <span class="caps">UTF</span>-8. Potion is too small to include other encodings in its core <span class="caps">API</span>.</p>
208 <h3>Lines</h3>
209 <p>Potion code lines are separate by a newline. (Or a CR-LF works as well.)</p>
210 <pre>
211 <code>
212  x = 1
213  y = 2
214 </code>
215 </pre>
216 <p>Throughout Potion, a comma is equivalent to a newline.</p>
217 <pre>
218 <code>
219  x = 1, y = 2
220 </code>
221 </pre>
222 <p>This also means that tables can be written using newlines as separators:</p>
223 <pre>
224 <code>
225  (language='Potion'
226  pointless=true)
227 </code>
228 </pre>
229 <h3>Spaces</h3>
230 <p>Spaces are used to separate messages and objects and operators, but they usually are only used for clarity&#8217;s sake.</p>
231 <p>To borrow an earlier example, it turns out the following is legit.</p>
232 <pre>
233 <code>
234  ('cheese','bread','mayo')at(1)print
235 </code>
236 </pre>
237 <p>There is some flexibility, in order to avoid senseless syntax errors.</p>
238 <h3>Comments</h3>
239 <p>Lines preceded by the octothorpe are ignored by Potion.</p>
240 <pre>
241 <code>
242  # this foul business...
243  String length = (): 10.
244 </code>
245 </pre>
246 <h3>Code Blocks</h3>
247 <p>Lines can be grouped together into blocks. Think of it as a collection of code you&#8217;ve group together to run later. Blocks start with a colon and end with a dot.</p>
248 <pre>
249 <code>
250  block = :
251  'potion' print.
252 </code>
253 </pre>
254 <h2>Built-in Types</h2>
255 <p>Potion has a rather small set of built-in types and libraries. This is to keep the language core small for folks who want to embed Potion and to constraint its memory footprint.</p>
256 <h3>True, False, Nil.</h3>
257 <p>Potion has three keywords for these built-in types.</p>
258 <p><code>nil</code> indicates that a variable is empty: it has no value and no type. (This isn&#8217;t exactly true, though. Its class is <code>NilKind</code>.)</p>
259 <p><code>true</code> and <code>false</code> are boolean values belonging to the <code>Boolean</code> class.</p>
260 <p>Anything which is not <code>nil</code> or <code>false</code> is considered a positive value. (Which means that the number zero and empty strings are considered <code>true</code> in if statements.)</p>
261 <h3>Numbers</h3>
262 <p>Basic numbers take up no memory and are passed as plain (32-bit or<br />
263 64-bit, depending on your processor) integers, but we loose one bit of<br />
264 precision for a tag bit. Arithmetic methods accept the type Number,<br />
265 which is Integer or Double and converts them as it fits.</p>
266 <pre>
267 <code>
268  5
269  47
270  -25
271  0xFF
272 </code>
273 </pre>
274 <p>Double numbers use a boxed double-precision floating point number.</p>
275 <pre>
276 <code>
277  999.9
278  2.00001
279  2e+2
280  2.4e-8
281 </code>
282 </pre>
283 <p>Seemless arbitrary-precision math is planned for the 1.0 release.</p>
284 <h3>Strings</h3>
285 <p>Strings begin with a single quote, followed by a series of <span class="caps">UTF</span>-8 characters, then a final single quote. There is only one escape code: <code>''</code> for an embedded single quote.</p>
286 <pre>
287 <code>
288  'Cornelius'
289  'Tuesday
290  Jun 29th, 2009'
291  'C:\Program Files\Potion'
292 </code>
293 </pre>
294 <p>Double-quoted strings allow a number of escape codes.</p>
295 <ul>
296  <li><code>"\n"</code> for a newline.</li>
297  <li><code>"\r"</code> for a carriage return.</li>
298  <li><code>"\t"</code> for a tab.</li>
299  <li><code>"\uXXXX"</code> for a Unicode character.</li>
300 </ul>
301 <h2>Expressions</h2>
302 <p>In my opinion, a language can be called &#8220;functional&#8221; if every statement and expression returns a value. Even <code>if</code> statements or class definitions. This is just how Potion is designed. Every statement is a function, since it takes arguments and returns results. There is no <code>void</code>.</p>
303 <h3>if, elsif, else</h3>
304 <p>The <code>if</code> keyword tests its arguments for truth. Its block is then executed if they pass.</p>
305 <pre>
306 <code>
307  if (age &gt; 100): 'ancient'.
308 </code>
309 </pre>
310 <p>Like any function, <code>if</code> returns a result. If the condition fails, you get <code>nil</code>. Otherwise, you get the result of the code executed inside the block.</p>
311 <p>Beyond <code>if</code>, you can chain <code>elsif</code> and <code>else</code> to catch other conditions.</p>
312 <pre>
313 <code>
314  author =
315  if (title == 'Jonathan Strange &amp; Mr. Norrell'):
316  'Susanna Clarke'.
317  elsif (title == 'The Star Diaries'):
318  'Stanislaw Lem'.
319  elsif (title == 'The Slynx'):
320  'Tatyana Tolstaya'.
321  else:
322  '... probably Philip K. Dick'.
323 </code>
324 </pre>
325 <p>These three keywords can all be executed like functions, even though they are compiled into basic instructions.</p>
326 <h3>loop</h3>
327 <p>The <code>loop</code> keyword executes its block endlessly.</p>
328 <pre>
329 <code>
330  loop: 'quaff' print.
331 </code>
332 </pre>
333 <h3>while</h3>
334 <p>The <code>while</code> keyword will execute its block endlessly, as long as its arguments stay true.</p>
335 <pre>
336 <code>
337  count = 8
338  while (count &gt; 0):
339  'quaff' print
340  count--.
341 </code>
342 </pre>
343 <h3>to</h3>
344 <p>Potion has no <code>for</code> keyword. One alternative is the <code>to</code> keyword.</p>
345 <pre>
346 <code>
347  1 to 5 (a):
348  a string print.
349 
350  num = argv(1) number
351  1 to (num, (a):
352  a print.)
353 </code>
354 </pre>
355 <p>The <code>to</code> keyword will loop from the first number, up to the last.</p>
356 <p>Another option is the <code>times</code> method, which starts at zero.</p>
357 <pre>
358 <code>
359  5 times: 'Odelay' print.
360 </code>
361 </pre>
362 <p>Notice how the block doesn&#8217;t need parentheses if we don&#8217;t want the block arguments coming in.</p>
363 <h3>return</h3>
364 <p>Returns a value from the function. You only need to use the <code>return</code> keyword explicitly if you&#8217;re looking to quit in the middle of the function.</p>
365 <h2>Names and Objects</h2>
366 <p>The most expressive parts of a program are the naming and creation of unique objects.</p>
367 <h3>Variables</h3>
368 <p>Generally, any <span class="caps">UTF</span>-8 set of characters which isn&#8217;t seen as a built-in type or operator can be used as a variable. Variables are assigned with a plain equals sign.</p>
369 <pre>
370 <code>
371  t = true
372  $$ = [dollars 100]
373  HTTP = 'Hypertext Transfer Protocol'
374  わが身 = self
375 </code>
376 </pre>
377 <p>You must set a variable before using it (even if just to <code>nil</code>.) Otherwise, Potion sees a message, sent to <code>self</code>.</p>
378 <h3>Messages</h3>
379 <p>Messages follow the same rules as variables. A message name can be any <span class="caps">UTF</span>-8 character which isn&#8217;t a built-in type or operator.</p>
380 <pre>
381 <code>
382  Number $ = ():
383  [dollars (amount=self)].
384  100 $
385 </code>
386 </pre>
387 <p>In this example, the <code>$</code> message converts the number into a kind of currency lick.</p>
388 <h3>Queries</h3>
389 <p>Objects can be asked if they respond to a message, by prefixing the message with a question mark.</p>
390 <pre>
391 <code>
392  if (3 ?gender):
393  "Huh? Numbers are sexed? That's amazing." print.
394 </code>
395 </pre>
396 <p>You can also optionally execute the message by send it arguments. And you can space out the quiz mark, if you want.</p>
397 <pre>
398 <code>
399  3 ? gender ()
400 </code>
401 </pre>
402 <p>Since numbers don&#8217;t have a <code>gender</code> method, this&#8217;ll give <code>nil</code> rather than an error.</p>
403 <p>A better example of this would be if you are in a web application and you wanted to see if the query string contained a <code>session</code> entry.</p>
404 <pre>
405 <code>
406  HomePage get = (url):
407  session = url query ? at ('session').
408 </code>
409 </pre>
410 <p>That way if <code>query</code> is empty, you won&#8217;t get an error, you&#8217;ll just get nil. Assuming that <code>query</code> is a table, though &#8212; you&#8217;ll get back the value filed under the <code>'session'</code> key.</p>
411 <h3>Paths</h3>
412 <p>A path is any set of non-whitespace <span class="caps">UTF</span>-8 characters preceded by a slash. A path is also called an &#8220;instance variable&#8221; in programming jargon.</p>
413 <pre>
414 <code>
415  BTree = class: /left, /right.
416  b = BTree ()
417  b /left = BTree ()
418  b /right = BTree ()
419 </code>
420 </pre>
421 <p>Paths cannot be randomly added to the object after the object is created. Each object has a strict set of paths. Every path which is used in the constructor is added to the object upon creation.</p>
422 <h3>Path Queries</h3>
423 <p>As with methods, you can query an object to see if it has a given path.</p>
424 <pre>
425 <code>
426  BTree = class: /left, /right.
427  b = BTree ()
428 
429  if (b ? /left):
430  'left path found!' print.
431 </code>
432 </pre>
433 <h2>And That&#8217;s It?</h2>
434 <p>Yes, that&#8217;s the important stuff for now. But a number of new features are coming to Potion soon<sup class="footnote" id="fnr3"><a href="#fn3">3</a></sup>.</p>
435 <ul>
436  <li>Assignment extended to match and bind, for expressing conditions on object layout.</li>
437  <li><span class="caps">FFI</span> (<code>extern</code>), debuggers (-d), external compilers (-c) (<em>to c and native executable for the start</em>).</li>
438  <li>Types and symbol tables. Types to be faster, and symtabs to be slower and more like a <span class="caps">LISP</span> and perl/ruby.</li>
439  <li>Compiler macros and compiler optimizations, like tailcall, constant folding, strength reduction.</li>
440  <li>Bignums, marshalling.</li>
441  <li>More libraries for os, ui, db, &#8230;</li>
442  <li>And also: Native threading. This is a biggie. It requires lock-free bags and some new native<br />
443  atomic insns and parallelizing loops. The work-stealing sister language sol<sup class="footnote" id="fnr4"><a href="#fn4">4</a></sup> looks good,<br />
444  it can yield to other threads. But if or if not to steal work, and if or not share data.</li>
445  <li>Channels and blocking recv for typed task communications al la Go. On top of <code>aio</code>.</li>
446  <li>Eventually lists, implemented via licks, but with a LISPy feeling.</li>
447 </ul>
448 <p>This are already in, but documented elsewhere<sup class="footnote" id="fnr5"><a href="#fn5">5</a></sup>:</p>
449 <ul>
450  <li>Mixins, a syntax for blending methods into classes.</li>
451  <li><span class="caps">MOP</span>, changing metaclasses, the behavior of classes.</li>
452  <li>Coroutines, a technique for inprocess threading.</li>
453  <li>Continuations, for saving and resuming the stack, <code>here</code> and <code>yield</code>.</li>
454  <li>Exceptions for graceful error handling.</li>
455  <li>Asynchronous non-blocking IO in the <code>aio</code> module.</li>
456  <li>Buffered stream FILE* IO in the <code>buffile</code> module.</li>
457  <li><code>readline</code> module providing a little repl if called without script</li>
458  <li>Optional, named and default signature arguments.</li>
459 </ul>
460 <p>Thankyou for reading along. I hope this was only a brief interruption to an otherwise lush and exotic life. I&#8217;m sorry to disappoint with so little. Perhaps one day I can make things right?</p>
461 <h2>Footnotes</h2>
462 <p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> Potion the <a href="http://github.com/perl11/potion">programming language</a>. Not the drink of fables.</p>
463 <p class="footnote" id="fn2"><a href="#fnr2"><sup>2</sup></a> <a href="http://en.wikipedia.org/wiki/ECMAScript_for_XML">ECMAScript for <span class="caps">XML</span></a>. (See also: <a href="http://en.wikipedia.org/wiki/S-Expression">s-expression</a>.)</p>
464 <p class="footnote" id="fn3"><a href="#fnr3"><sup>3</sup></a> <a href="https://github.com/perl11/potion/wiki/_pages">Potion wiki</a>.</p>
465 <p class="footnote" id="fn4"><a href="#fnr4"><sup>4</sup></a> <a href="http://github.com/rsms/sol">sol</a>.</p>
466 <p class="footnote" id="fn5"><a href="#fnr5"><sup>5</sup></a> <a href="http://perl11.org/potion/html/">Potion Documentation</a>.</p>
467 <h2>Potion&#8217;s and p2 license</h2>
468 <p>p2 is free software, released under an <span class="caps">MIT</span> and <span class="caps">ARTISTIC</span> 2 license &#8212;<br />
469 the very brief paragraphs below. There is satisfaction simply in<br />
470 having created this. Please use this how you may, even in commercial<br />
471 or academic software. I&#8217;ve had a good time and am want for nothing.</p>
472 <hr />
473 <p>potion is copyright &#169; 2009 why the lucky stiff, <span class="caps">MIT</span> licensed.</p>
474 <p>p2 and maintainance code by perl11 http://perl11.org/p2/<br />
475  &#169; 2013 perl11 org, licensed under the <span class="caps">ARTISTIC</span> 2.</p>
476 <p>HOWEVER. The follow <span class="caps">MIT</span> licensed codes have also been employed:</p>
477 <p>Be it known, parts of the object model taken from <a href="http://www.piumarta.com/software/id-objmodel/">obj.c</a>.<br />
478  &#169; 2007 Ian Piumarta</p>
479 <p>And, also, the design of the VM bytecode is from <a href="http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf">Lua</a>.<br />
480  &#169; 1994-2006 Lua.org, <span class="caps">PUC</span>-Rio</p>
481 <p>The Mersenne Twister (<a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">MT19937</a>)<br />
482  &#169; 1997-2002, Makoto Matsumoto and Takuji Nishimura</p>
483 <p>Lastly, <a href="http://attractivechaos.awardspace.com/khash.h.html">khash.h</a>.<br />
484  &#169; 2008, by Attractive Chaos</p>
485 <p>Permission is hereby granted, free of charge, to any person obtaining<br />
486 a copy of this software and associated documentation files (the<br />
487 &#8220;Software&#8221;), to deal in the Software without restriction, including<br />
488 without limitation the rights to use, copy, modify, merge, publish,<br />
489 distribute, sublicense, and/or sell copies of the Software, and to<br />
490 permit persons to whom the Software is furnished to do so, subject to<br />
491 the following conditions:</p>
492 <p>The above copyright notice and this permission notice shall be<br />
493 included in all copies or substantial portions of the Software.</p>
494 <p><span class="caps">THE</span> <span class="caps">SOFTWARE</span> IS <span class="caps">PROVIDED</span> &#8220;AS IS&#8221;, <span class="caps">WITHOUT</span> <span class="caps">WARRANTY</span> OF <span class="caps">ANY</span> <span class="caps">KIND</span>,<br />
495 <span class="caps">EXPRESS</span> OR <span class="caps">IMPLIED</span>, <span class="caps">INCLUDING</span> <span class="caps">BUT</span> <span class="caps">NOT</span> <span class="caps">LIMITED</span> TO <span class="caps">THE</span> <span class="caps">WARRANTIES</span> OF<br />
496 <span class="caps">MERCHANTABILITY</span>, <span class="caps">FITNESS</span> <span class="caps">FOR</span> A <span class="caps">PARTICULAR</span> <span class="caps">PURPOSE</span> <span class="caps">AND</span><br />
497 <span class="caps">NONINFRINGEMENT</span>. IN NO <span class="caps">EVENT</span> <span class="caps">SHALL</span> <span class="caps">THE</span> <span class="caps">AUTHORS</span> BE <span class="caps">LIABLE</span> <span class="caps">FOR</span> <span class="caps">ANY</span><br />
498 <span class="caps">CLAIM</span>, <span class="caps">DAMAGES</span> OR <span class="caps">OTHER</span> <span class="caps">LIABILITY</span>, <span class="caps">WHETHER</span> IN AN <span class="caps">ACTION</span> OF <span class="caps">CONTRACT</span>,<br />
499 <span class="caps">TORT</span> OR <span class="caps">OTHERWISE</span>, <span class="caps">ARISING</span> <span class="caps">FROM</span>, <span class="caps">OUT</span> OF OR IN <span class="caps">CONNECTION</span> <span class="caps">WITH</span> <span class="caps">THE</span><br />
500 <span class="caps">SOFTWARE</span> OR <span class="caps">THE</span> <span class="caps">USE</span> OR <span class="caps">OTHER</span> <span class="caps">DEALINGS</span> IN <span class="caps">THE</span> <span class="caps">SOFTWARE</span>.</p>
501 </div></body></html>
static int left
Definition: mt19937ar.c:61
char data[]
Definition: potion.h:329
int main(int argc, char *argv[])
Definition: potion.c:263
struct Potion_State Potion
Definition: potion.h:80
the global interpreter state P. currently singleton (not threads yet)
Definition: potion.h:653
const char * name
Definition: compile.c:30