Potion (programming language)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
potion
Paradigm(s) Functional, stack-oriented, message passing
Designed by Why the lucky stiff
Appeared in 2007
Stable release v0.1.1061 / Oct 16, 2013
Typing discipline dynamic
Influenced by Io, Ruby, Ocaml, Lua, REBOL, Smalltalk and C
OS Linux, BSD, Darwin, Windows
License MIT License
Website perl11.org/potion/

potion is a tiny, fast dynamic, stack-oriented computer programming language with a JIT compiler, closures, continuations and exceptions, a Lua-based VM and an Io-based object model built around message passing, a MOP and mixins. It is technically a lexical-only Lisp-1 with two languages: one for code, one for data and it is written in under 10K lines of C.

History[edit]

potion was created by _why as last project in 2007 before his disappearance from the internet.[1] He started playing with Lua's internals and reading stuff by Ian Piumarta and Nicolas Cannasse.

After _why's disappearance, a developer named Fogus took over maintenance until 2013.

In 2013 a group calling itself perl11 "(5+6=11)" with Reini Urban as lead developer took over potion development [2] to be used as Virtual Machine for "p2", a planned implementation for Perl5 and Perl6.[3] Both languages, potion and p2 are now developed together by perl11 developers. v0.1 was released on Oct 16th, 2013 on the perl11 github account.

Philosophy[edit]

"If you keep it small, fit the VM and the parser and the stdlib all into 10k lines, then it's no sweat." [4]

Examples[edit]

Fibonacci sequence:

fib = (n):
  if (n < 2): n. else: fib (n - 1) + fib (n - 2).
.
n = argv(1) number
if (n<1): n=28.
("fib(",n,")= ", fib(n)) join say
 
# parrot example/fib.pir 40  3m36.447s
# perl   example/fib.pl  40  2m19.752s
# potion example/fib.pn  40  0m3.512s

Features[edit]

External links[edit]

References[edit]

  1. ^ Lowrey, Annie (15 March 2012). "Where’s _why? What happened when one of the world’s most unusual, and beloved, computer programmers disappeared". Slate. Retrieved 15 March 2012. 
  2. ^ fogus (11 August 2013). "_why’s Potion — a new home". Retrieved 21 August 2013. 
  3. ^ Urban, Reini (4 June 2013). "Design Decisions on p2". Retrieved 15 September 2013. 
  4. ^ _why (22 December 2008). "README". Retrieved 15 September 2013.