text:
Get as close to pi as you can
Your job is to write a program to find the closest number to PI.
Let me clarify.
You will first choose a number type. Let us say you choose Integer (in an actual answer, you cannot). Your program would then have to generate an integer that is closed to PI. For Integers, this would be 3. Not 4; 3.
For every allowed number type, there will be one and only one closest number, as you will see.

Select your number type. It should only be able to represent rational numbers. You can not make up your own number types. Float or Double is recommended.
Your program will generate a number ctp for "close to PI" (I am just calling it that; you don't have to). 223/71 < ctp < 22/7 must be true (this is why you can't choose Integers). Also, ctp must be the closet number to PI in its number type (although see bonus).
No importing libraries for mathematical functions, operations, etc... (although types are allowed as long, as it obeys #1).
You must somehow output ctp.
You also may not hard code any number (in any type) that uses at least half the precision of your chosen number type.

Bonus: If you use a data type with a precision that depends on machine resources, and it still generates the most accurate approximation possible for any given machine, you can take the pith root of your score.
Note: If you code may actually exhaust machine resources, put a warning in. That way people know to use virtual machines to check it (or just check it with their minds).
This is code golf, so shortest program in bytes wins!
Note: The point of this challenge is not just to be another pi calculation challenge. You have to work at the limits of your number type, where all calculations can have detrimental rounding errors. You are doing maximum-precision computing. This is not the same as just outputting a large number of digits.

Ahem! Floating-point types can represent irrational numbers. Also, this question is almost certainly a duplicate: http://codegolf.stackexchange.com/questions/506/calculate-500-digits-of-pi/  http://codegolf.stackexchange.com/questions/22009/pi-calculation-code-golf

We have had lots of pi calculation programs.

No this is not a duplicate. My question is meant to test the limits of the number type. We don't have the tag pi for one question.

Also "By their nature, all numbers expressed in floating-point format are rational numbers with a terminating expansion in the relevant base (for example, a terminating decimal expansion in base-10, or a terminating binary expansion in base-2)." -https://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding

Pardon me, I should have been more precise, and admittedly it was a nitpick: Floating-point types can "represent" irrational numbers, they just do so inexactly (as rational numbers). My reason for nitpicking is that people will latch on to any loophole and thread their way through it. You might do better to simply state a list of acceptable data types and force people to choose from that.

"For every allowed number type, there will be one and only one closest number, as you will see." I believe this statement is not true for arbitrary precision numbers.

@DavidCarraher It is clarified in the bonus that you just have to get the closet your machine can go. I do know that for some data types its possible to have no closet approximation, but on a given (finite) machine, you will reach a memory limit.

Please add a rule specifically banning the use of numerical constants derived from pi. 3.1415926535897932384626433832795028842, e.g., is the closest possible approximation for a standard IEEE 64-bit floating-point type, it would be silly to print it or use multiples/factors of it.

I think it would be covered under no hard coding it in, wouldn't it?

Oh well. I just said no hard coding overly precise constants.

@JasonC the only thing I would add is that's a lot less than the "mere 500 digits" mentioned by the OP in reference to the older question "calculate PI to 500 digits." As a general point, what is the objective winning criterion? greatest digits of accuracy, or shortest code? I guess "float or double is recommended" so I would pick float as that way I have to calculate less digits.

It is just shortest code, but you get a bonus if it is a arbitrary precision data type. Since you can't hard code it anyway, doing float or double doesn't really matter. The logic will be the same.

So the question isn't "Get as close to PI as you can at all then". It's "(a) Implement an algorthim that would converge to pi on an ideal machine in the shortest code possible, but (b) at least accurate enough to give the best possible representation in a type of your choosing." (a) has been done before, and (b) is ambiguous. You need to specify the type required to give a level playing field. I suggest a 32 bit float because that way it would be possible to use a double for the inevitably higher precision intermediate values required in calculation. See the first answer to this question.

@PyRulez Can you add the following rules to keep this from degenerating into every other question tagged pi: Nothing from here or here (especially Leibniz series) and no Montecarlo simulations. Otherwise you might as well just go through the answers already on the other pi questions and choose one of those as your winner.

There's still nothing stopping me from adding up two doubles, each of which encodes half the necessary precision.

C++ 158 chars
#include<iostream>
#include<iomanip>
int main(){double p=0;for(long long l=1;l>0;l+=2){p+=(double)4/l;l+=2;p-=(double)4/l;}std::cout<<std::setprecision(30)<<p;}

Simply calculates pi by brute force until my computer can't store the number to divide 4 by.
I got to 3.1415926535792384 before I killed it. The highlighted part is what is off; it should have been 3.1415926535897932.  Eventually, it would have got there.

Wait, how exactly does this work? What math is it based on?

@PyRulez It's an expansion of the classic Leibniz series.

"Eventually, it would have got there." - would it? I'm pretty sure it wouldn't; there's far too much rounding error that never gets compensated for.

Java: 352 chars
import java.math.BigDecimal;class B{public static void main(String[]h){BigDecimal y=v(-3);for(int n=1;n<99;n++)y=y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2*n),42,0));System.out.println(y.toPlainString());}static BigDecimal v(int k){return BigDecimal.valueOf(k);}static BigDecimal f(int k){return k<2?v(1):f(k-1).multiply(v(k));}}

This is a simplification of my answer to another question. It uses the formula from Simon Plouffe, 1996. It only uses addition, multiplication, division and exponentiation on the JDK's built-in class java.lang.BigDecimal.
Idented version:
import java.math.BigDecimal;

class B {
    public static void main(String[] h) {
        BigDecimal y = v(-3);
        for (int n = 1; n < 99; n++)
            y = y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2 * n), 42, 0));
        System.out.println(y.toPlainString());
    }

    static BigDecimal v(int k) {
        return BigDecimal.valueOf(k);
    }

    static BigDecimal f(int k) {
        return k < 2 ? v(1) : f(k - 1).multiply(v(k));
    }
}

This is the output:
3.141592653589793238462643377679212002490611

If you change that 99 and that 42, you might adjust the output. The 99 is the number of iterations (more iterations = more precision). The 42 is the number of decimal digits used in the division (so it rounds beyond that in the case of unexact decimal fractions). For example, using 999 and 420 instead, this is the output:
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249120347355734950229986020976256234993050320608823801378401335409091901873689012669359599460964434973644188892882434846280102165

Since it is possible to adjust the precision, but only by changing 2 numbers in the source code, but OTOH those numbers have the exact purpose to define the precision, then I don't know if the bonus do applies or do not.


text:
Determine if an integer is a palindrome in a given radix (base)
Write a program that reads from stdin two integers, each newline terminated, hereafter called "number" and "radix", and:

Prints any fixed message you want if the number is a palindrome in that radix (e.g. true, t, 1)
Prints any different fixed message you want if the number is not a palindrome in that radix (e.g. false, f, 0, etc.)
These messages must be the same per each run, but there are no rules about what they must be (whatever's best for golfing).
You may assume the input is valid, two positive integers. "number" will not exceed 2147483647, "radix" will not exceed 32767.
You may not use external resources, but you may use any math function included by default in your language.

Note: a radix is just the base of the number.
Sample runs:
16
10
false

16
3
true

16
20
true

121
10
true

5
5
false

12346
12345
true

16781313
64
true

16781313
16
true

Note: a radix is just the base of the number.

Looks good now.  You may want to ban external resources though.

@user2509848 hmmm, for instance?

If a person can find a calculator on the web that converts numbers between bases, it will almost certainly be used.  We have been having a rash of trolly answers lately.

Can one of the fixed messages be the empty string (assuming that the other is a non-empty string)?

J (23 char) and K (19) double feature
The two languages are very similar, both in general and in this specific golf. Here is the J:
(-:|.)#.^:_1~/".1!:1,~1

,~1 - Append the number 1 to itself, making the array 1 1.
1!:1 - Read in two strings from keyboard (1!:1 is to read, and 1 is the file handle/number for keyboard input).
". - Convert each string to a number.
#.^:_1~/ - F~/ x,y means to find y F x. Our F is #.^:_1, which performs the base expansion.
(-:|.) - Does the argument match (-:) its reverse (|.)? 1 for yes, 0 for no.

And here is the K:
a~|a:_vs/|.:'0::'``

0::'`` - Read in (0::) a string for each (') line from console (` is the file handle for this).
.:' - Convert (.:) each (') string to a number.
_vs/| - Reverse the pair of numbers, so that the radix is in front of the number, and then insert (/) the base expansion function _vs ("vector from scalar") between them.
a~|a: - Assign this resulting expansion to a, and then check if a matches (~) its reverse (|). Again, 1 for yes, 0 for no.

@ak82 I believe it's more interesting this ways

GolfScript, 10 characters
~base.-1%=

That is an easy one for GolfScript if we do it the straightforward way. The output is 0/1 for false/true.
~       # Take input and evaluate it (stack: num rdx)
base    # Fortunately the stack is in the correct order for
        # a base transformation (stack: b[])
.       # Duplicate top of stack (stack: b[] b[])
-1%     # Reverse array (stack: b[] brev[])
=       # Compare the elements

APL (20)
⎕{≡∘⌽⍨⍵⊤⍨⍺/⍨⌊1+⍺⍟⍵}⎕

Outputs 0 or 1, e.g:
      ⎕{≡∘⌽⍨⍵⊤⍨⍺/⍨⌊1+⍺⍟⍵}⎕
⎕:
      5
⎕:
      5
0
      ⎕{≡∘⌽⍨⍵⊤⍨⍺/⍨⌊1+⍺⍟⍵}⎕
⎕:
      16781313
⎕:
      64
1

Explanation:

⎕{...}⎕: read two numbers, pass them to the function. ⍵ is the first number and ⍺ is the second number.
⌊1+⍺⍟⍵: floor(1+⍺ log ⍵), number of digits necessary to represent ⍵ in base ⍺.
⍺/⍨: the base for each digit, so ⍺ replicated by the number we just calculated.
⍵⊤⍨: represent ⍵ in the given base (using numbers, so it works for all values of ⍺).
≡∘⌽⍨: see if the result is equal to its reverse.

Perl, 82 77 73 69 bytes
$==<>;$.=<>;push(@a,$=%$.),$=/=$.while$=;@b=reverse@a;print@a~~@b?1:0

The input numbers are expected as input lines of STDIN and the result is written as 1 or 0, the former meaning the first number is a palindrome in its representation of the given base.
Edit 1: Using $= saves some bytes, because of its internal conversion to int.
Edit 2: The smartmatch operator ~~ compares the array elements directly, thus the conversion to a string is not needed.
Edit 3: Optimization by removing of an unnecessary variable.
65 bytes: If the empty string is allowed as output for false, the last four bytes can be removed.
Ungolfed version
$= = <>;
$. = <>;
while ($=) {
    push(@a, $= % $.);
    $= /= $.; # implicit int conversion by $=
}
@b = reverse @a;
print (@a ~~ @b) ? 1 : 0

The algorithm stores the digits of the converted number in an array @a.
Then the string representation of this array is compared with the array in reverse order. Spaces separates the digits.

Sorry, my answer is really same aproach, but using $= let you whipe int step... And question stand for anything you want so nothing could be what you want ;-)

@F.Hauri: Thanks, I will update. $= is also given as tip in this answer to the question "Tips for golfing in Perl". Returning 0 costs 6 extra bytes, but it was my impression that a fixed message is not intended to be empty.

Hem,, Return 0 cost 4 extra bytes, not 6. But I maintain: silence is anything!

@F.Hauri: Yes, 4 is correct, the extra two bytes were the parentheses of the ungolfed version.

Sage, 45
Runs in the interactive prompt
A=Integer(input()).digits(input())
A==A[::-1]

Prints True when it is a palindrome, prints False otherwise

Javascript 87
function f(n,b){for(a=[];n;n=(n-r)/b)a.push(r=n%b);return a.join()==a.reverse().join()}

n argument is the number, b argument is the radix.

Perl 54 56 62
$==<>;$-=<>;while($=){$_.=$/.chr$=%$-+50;$=/=$-}say$_==reverse

To be tested:
for a in $'16\n3' $'16\n10' $'12346\n12345' $'12346\n12346' $'21\n11' $'170\n16';do
    perl -E <<<"$a" '
        $==<>;$-=<>;while($=){$_.=$/.chr$=%$-+50;$=/=$-}say$_==reverse
    '
  done

will give:
1

1

1

So this output 1 for true when a palindrome is found and nothing if else.
Ungolfing:
$==<>;                            # Stdin to `$=`  (value)
$-=<>;                            # Stdin to `$-`  (radix)
while ( $= ) {
    $_.= $/. chr ( $= % $- +50 ); # Add *separator*+ chr from next modulo to radix to `$_`
    $=/= $-                       # Divide value by radix
}
say $_ == reverse                 # Return test result

Nota:

$_ is the current line buffer and is empty at begin.
$= is a reserved variable, originaly used for line printing, this is a line counter. So this variable is an integer, any calcul on this would result in a truncated integer like if int() was used.
$- was used for fun, just to not use traditional letters... (some more obfuscation)...

to clarify, this says nothing when it's not a palindrome, and 1 when it is?

Nice tricks. However wrong positive: 21 with base 11. The digits need a separator in the string comparison.

Aaaarg +3! @HeikoOberdiek You're right f...

@F.Hauri: Also the digits get reversed. Thus 170 with base 16 is 0xAA, a palindrome, but the result is false.

Aaarg +6! converting to chars...

Mathematica 77 43
IntegerDigits[n,b] represents n as a list of digits in base b.  Each base-b digit is expressed decimally.
For example, 16781313 is not a palindrome in base 17:
IntegerDigits[16781313, 17]

{11, 13, 15, 11, 14, 1}

However, it is a palindrome in base 16:
IntegerDigits[16781313, 16]

{1, 0, 0, 1, 0, 0, 1}

If the ordered pairs in the above examples were entered,
(x=Input[]~IntegerDigits~Input[])==Reverse@x

would return

False (* (because {11, 13, 15, 11, 14, 1} != {1, 14, 11, 15, 13, 11} ) *)
True  (* (because {1, 0, 0, 1, 0, 0, 1} is equal to {1, 0, 0, 1, 0, 0, 1} ) *)

Weird, not necessary for the answer but I'm curious, how does it render them?

I hate it when I lose because of a stupid typecast...

Kindly explain "typecast".

My sage solution is longer than yours by 2 characters because I have to cast the input to type Integer

Now I understand what you mean. Thanks.

durron597 I provided examples of the rendering, above.

Ruby - 76 chars
f=->(n,b){n==0?[]:[n%b,*f.(n/b,b)]};d=f.(gets.to_i,gets.to_i);p d==d.reverse

Haskell (80 chars)
tb 0 _=[]
tb x b=(tb(div x b)b)++[mod x b]
pali n r=(\x->(x==reverse x))(tb n r)

Call it with pali $number $radix. True, when number is a palindrome, False if not.

Perl 6, 27 bytes (22 without stdin/out)
say (+get).base(get)~~.flip

Try it online!
  get()                     # pulls a line of stdin
 +                          # numerificate
(      ).base(get())        # pull the radix and call base to
                            #  convert to string with that base
                    ~~      # alias LHS to $_ and smartmatch to
                      .flip # reverse of the string in $_

Perl6, king of readable golfs (golves?) (and also some not so readable).
Perl 6 function (not stdin/stdout), 22 bytes
{$^a.base($^b)~~.flip}

Try it online!

The reason I didn't use base in my answer is that base only supports up to base 36, and the question asks to support radixes up to 32767

Ooh, did not know that. Hmm.

C, 140 132
int x,r,d[32],i=0,j=0,m=1;main(){scanf("%d %d",&x,&r);for(;x;i++)d[i]=x%r,x/=r;i--;for(j=i;j;j--)if(d[j]-d[i-j])m=0;printf("%d",m);}

radix 1 is not supported:)

Just puts(m) would work right?

printf("%d",m); will be by 8 characters shorter.

Haskell - 59
Few changes to Max Ried's answer.
0%_=[]
x%b=x`mod`b:((x`div`b)%b)
p=((reverse>>=(==)).).(%)

dg - 97 bytes
Trying out dg:
n,r=map int$input!.split!
a=list!
while n=>
 a.append$chr(n%r)
 n//=r
print$a==(list$reversed a)

Explained:
n, r=map int $ input!.split!      # convert to int the string from input
a = list!                         # ! calls a function without args
while n =>
 a.append $ chr (n % r)           # append the modulus
 n //= r                          # integer division
print $ a == (list $ reversed a)  # check for palindrome list

LaTeX, 165 bytes
Example at desmos.com
k, the radix, is an adjustable input
b=\floor \left(\log _k\left(\floor \left(x\right)\right)\right)
f\left(x\right)=k^bx-x-\left(k^2-1\right)\sum _{n=1}^bk^{\left(b-n\right)}\floor \left(xk^{-n}\right)

If f(x)=0, x is a palindrome in base k.

Pyth, 4 bytes
_IjF

Try it here or check out a test suite (Takes ~10-15 seconds).

05AB1E,  4  3 bytes
вÂQ

Try it online or verify all test cases.
Explanation:
в      # The first (implicit) input converted to base second (implicit) input
       #  i.e. 12345 and 12346 → [1,1]
       #  i.e. 10 and 16 → [1,6]
 Â     # Bifurcate the value (short for duplicate & reverse)
       #  i.e. [1,1] → [1,1] and [1,1]
       #  i.e. [1,6] → [1,6] and [6,1]
  Q    # Check if they are still the same, and thus a palindrome
       #  i.e. [1,1] and [1,1] → 1
       #  i.e. [1,6] and [6,1] → 0

C (gcc), 79 bytes
n,r,m;main(o){for(scanf("%d %d",&n,&r),o=n;n;n/=r)m=m*r+n%r;printf("%d",m==o);}

Try it online!
Rundown
n,r,m;main(o){
for(scanf("%d %d",&n,&r),       Read the number and the radix.
o=n;                            ...and save the number in o
n;                              Loop while n is non-zero
n/=r)                           Divide by radix to remove right-most digit.
m=m*r+n%r;                      Multiply m by radix to make room for a digit
                                and add the digit.
printf("%d",m==o);}             Print whether we have a palindrome or not.

Based on the fact that for a palindrome, the reverse of the number must equal the number itself.
Suppose you have the three-digit number ABC in some base. Multiplying it by base will always result in ABC0, and dividing it by base in AB with C as remainder. So to reverse the number we pick off the right-most digit from the original number and insert it to the right on the reversed number. To make room for that digit, we multiply the reverse by base before-hand.
Basically:
n       rev
ABC     0
AB      C
AB      C0
A       CB
A       CB0
0       CBA

This is cool, can u explain the math behind this?

@durron597 Sure! Added an explanation to the post.

dc, 39 bytes
The length is a palindrome, of course (33₁₂).
[[t]pq]sgod[O~laO*+sad0<r]dsrx+la=g[f]p

The number and radix should be on the top of the stack (in the current number base); number must be at least 0, and radix must be at least 2.  Output is t if it's a palindrome and f if not.  As it's not specified in the challenge, I've assumed that numbers never have leading zeros (so any number ending in 0 cannot be a palindrome).
Explanation
As a full program:
#!/usr/bin/dc

# read input
??

# success message
[[t]pq]sg

# set output radix
o

# keep a copy unmodified
d

# reverse the digits into register a
[O~ laO*+sa d0<r]dsrx

# eat the zero left on stack, and compare stored copy to a
+ la=g

# failure message
[f]p

Perl 6, 34 bytes
-4 bytes thanks to PhilH
{@(polymod $^a: $^b xx*)~~[R,] $_}

Try it online!

You can use $_ instead of @r to save 2

@PhilH Nope. (assigns a Seq, not a List)

Ahh, sorry didn't see the error

@PhilH Your second tip still helped save bytes though!

Always annoying that there's no shorter way to call reduce meta on $_ or @_.

Jelly, 3 bytes
bŒḂ

Try it online!
How it works
bŒḂ - Main link. Takes a number n on the left and a radix r on the right
b   - Convert n to base r
 ŒḂ - Is palindrome?

Python 3.8 (pre-release), 167 162 65 63 bytes
a,b=map(int,open(s:=0))
o=a
while a:s=s*b+a%b;a//=b
print(s==o)

Try it online!
Massive -99 thx to @Steffan

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Create a programming language interpreter
Task:
You must create an interpreter that can parse snippets of a programming language. The language does not need to be complex, but it must include the following syntactical elements:

Ability to assign and read variables (could be as simple as a-z being premade variables)
If statements (elseif and else are not required)
Loops (counting to an arbitrary number, user access to counter is not required)
Simple math with variables (addition, subtraction, multiplication, division, greater/less than, equals)
Print statements

Rules:

You may not copy the syntax of another popular language.
You need to write your own interpreter, not modification of another interpreter.
You can write your interpreter in any language.
Write a 99-bottles-of-beer example program in your language (see here)
This is a popularity-contest, so the most upvoted answer wins.

What are the requirements of the parser? Does it need to output some kind of syntax tree?

Request for clarification: Does the programming language have to have a special syntax for loops counting to an arbitrary number or does it just have to support those loops?

Is being able to push and pop from a stack enough to satisfy the variable requirement?

@tecywiz121 - yep

@Dennis - it must be able to loop a given number of times, defined at runtime

Kendall Frey's question about a massively important missimg part of the spec still needs an answer.

@KendallFrey - it must execute the code, no syntax tree or bootleg compilers are needed.

I believe that makes it an interpreter, no?

Kinda want to see Guido submit CPython.

DogeScript
The 99 bottles of beer program:
many amaze 99 time

such scare bottles-of-beer
such scream on-the-wall
many despair 13 time

such fail take-one-down-pass-it-around

wow

so amaze
so scare
so scream
so despair!

so amaze
so scare
so despair!

much amaze

so fail
so despair!

so amaze
so scare
so scream

so despair!
so despair!

very amaze

wow

The PHP interpreter:
<?php
$input=fopen('php://stdin', 'r');

//pre-process input
$input=preg_replace("/ +/", " ", $input); //replace any multiple spaces by a single space

//split into instructions by newlines
$instructions=explode("\n", $input);

$loopstartpoint= -1;
$variables=array();
$activevariable="";
for($instrpointer=0; $instrpointer<count($instructions); $instrpointer++)
{
    $tokens=explode(" ", $instructions[$instrpointer]);
    switch($tokens[0])
    {
        case "wow":
            if($loopstartpoint<0)
            {
                $loopstartpoint=$instrpointer+1;
            }
            else
            {
                if($variables[ $activevariable ])
                {
                    $instrpointer=$loopstartpoint;
                }
                else
                {
                    $loopstartpoint= -1;
                }
            }
            break;
        case "so":
            if(substr($tokens[1], -1)=="!")
            {
                echo chr($variables[ substr($tokens[1], 0, -1) ]);
            }
            else
            {
                echo $variables[ $tokens[1] ];
                echo " ";
            }
            break;
        case "very":
            $activevariable=$tokens[1];
            break;
        case "much":
            if(!isset($variables[ $tokens[1] ]))
                $variables[ $tokens[1] ]=0;
            if(count($tokens)==2)
            {
                $variables[ $tokens[1] ]--;
            }
            else
            {
                for($loop=0;$loop<$tokens[2];$loop++)
                {
                    $variables[ $tokens[1] ]--;
                }
            }
            $activevariable=$tokens[1];
            break;
        case "many":
            if(!isset($variables[ $tokens[1] ]))
                $variables[ $tokens[1] ]=0;
            if(count($tokens)==2)
            {
                $variables[ $tokens[1] ]++;
            }
            else
            {
                for($loop=0;$loop<$tokens[2];$loop++)
                {
                    $variables[ $tokens[1] ]++;
                }
            }
            $activevariable=$tokens[1];
            break;
        case "such":
            $variables[ $tokens[1] ]=$tokens[2];
            $activevariable=$tokens[1];
            break;
    }
}
?>

The syntax as it currently stands:
wow - start and end loops, end of loop checks if active variable is 0 and loops if not
so without ! - print variable's value
so with ! - print variable's ASCII character
much - decrement this variable
many - increment this variable
such - set variable
very - make variable active
x time - does previous statement x times

Variables are initially 0.

Try it here.
Any suggestions for improvement are welcome.

prgramming lvl = 100

Do you know that it already exists?

No, I'd never seen that. Bummer, I thought I was being original. :-(

BrainBack : A stack based compiled language running on BrainFuck
NB: Spec was changed from "creating a parser" to "create an interpreter" after i posted this answer. This answer is a compiler which also parses source code.
The name is a pun on Back being the opposite of a well known stack based language and Brain indicating it's esoteric nature. It looks a little like BrainFuck (though isn't), but it's compiler runs on BrainFuck and it's compiled object code ends up as BrainFuck binaries.
The language: *==destroys it's arguments

"constant" prints constant
#          prints top of stack as number
>          duplicates the top of stack
<num>      push constant number <num> as a value to top of stack
<          remove top of stack
-          substract topmost from the second topmost*
+          add topmost to second topmost*
!          not toggles positive / zero*
[ ... ]    does a while top of stack not zero, very similar to BrainFuck

99 bottles of beer with correct lyrics in BrainBack:
100
[
 1 -
 > ! [ < 0 0 "No more" ] < [ # 0 ] <
 " bottle"
 > 1 - [ < 0 "s" ] <
 " of beer on the wall, "
 > ! [ < 0 0 "no more" ] < [ # 0 ] <
 " bottle"
 > 1 - [ < 0 "s" ] <
 " of beer.
"
 > ! [ < 0 0 "Go to the store and buy some more, " ] <
     [ "Take one down and pass it around, " 0 ] <

 > ! [ < 1 0 0 "99" ] < [ > 1 - > !  [ < < 1 0 0 "no more" ] < [ # 1 - 0 ] ] <
 " bottle"
 [ < 0 "s" ] <
 " of beer on the wall.

"
]

The BrainBack compiler, written in Extended BrainFuck
;;; Macros

;; utility function that substracts
;; ^2 from ^0 without reduceing ^2
;; below zero. ^1 needs to be zero
{substract
  (<<[->]>[<]>-)
}

;; Main macro is the main  program and
;; has the overal structure of the program.
;; every macro here is define in order below.
{main
  :i
  :wrk
  :tmp
  :else
  :sub
  $i+(
  ; switch ( $wrk ) cases '"#><-+![]9;' using $tmp,$else
  $tmp+++++(-$wrk------)+$wrk---; !
  ($wrk-; "
    ($wrk-; #
      ($wrk--------; +
        ($wrk--; -
          ($wrk--- $tmp- $else 9+ &substract $tmp+ $wrk; 0-9
            ($wrk--; ;
              ($wrk-; <
                ($wrk--; >
                  ($tmp++++(-$wrk------)+$wrk+; [
                    ($wrk--; ]
                      (#(-) $tmp(-)  no matches)
                        $tmp (- #match 'cl'  &close        )
                    ) $tmp (- #match 'op'    &open         )
                  ) $tmp (- #match 'gt'      &dup          )
                ) $tmp (- #match 'lt'        &slash        )
              ) $tmp (  #match 'c'           &comment      )
            ) $tmp (- #match 0 to 9          &read_number  )
          ) $tmp (- #match 'minus'           &sub          )
        ) $tmp (- #match 'plus'              &add          )
      ) $tmp (- #match '#'                   &print_number )
    ) $tmp (- #match '"'                     &print_string )
  ) $tmp (- #match 'not'                     &not          )

  $i(-)$tmp#,+(-(-$wrk+$i+)))
  10+.
}

;; implements close bracket
{close
    |" close"(-)
    $i.
}

;; implements open bracket
{open
    |" open"(-)
    $i.
}

;; implements dup/>
{dup
    |"dup [->>+<<]>>[-<+<+>>]<
"
     (-)
}

;; implements slash/<
{slash
     |"slash [-]<
"
     (-)
}

;; implements comment
{comment
  [,10-]
}

;; implements read_number/<number>
;; makes code that if run makes
;; the constant
{read_number
  ;TODO: compiler_read_constant_number
   $wrk|"number"(-)
#  $wrk 6+ (- $i 8-)
  ~"+>"<.(-)
  $i+(-(-$wrk.)
     #$else, $tmp 6+ (- $else 8-)
     $else(-$tmp+$i+)
     $sub 9+ &substract
     $else+
     $tmp((-) $i(-) $else-)
     $else(-|"[->++++++++++<]>[-<+>]<"(-)$i+)
     )
   $wrk(-)
   |"
"(-)
}

;; implements sub/-
{sub
     |"sub [-<->]<
"
     (-)
}

;; implements add/+
{add
     |"#add [-<+>]<
"
     (-)
}

;; implements print_number/#
{print_number
  |"print [->+<]>[-<+>>+<]>
    [>++++++++++<
    [->-[>+>>]>[+[-<+>]>+>>]<<<<<]
    +>[-]>[-<<+>>]>[-<<+>>]<<]
    +<[>-<[<]]>[>]
    <[>++++++[-<++++++++>]<-.[-]<]<
"(-)

}

;; implements print_string/"..."
;; this outputs EBF code making the
;; object code EBF
{print_string
  |"print >|"(-)
  $i(-$wrk+$else+)
  $wrk($tmp(-$wrk+)$wrk.,$else(-$tmp+$wrk-$i+)$i(-$else+))
  $tmp(-)$else.(-)|"[-]<
"(-)
}

;; implements not/!
;; creates code that negates top of stack
{not
  |"not >+<[[-]>-]>[<+>->]<<
"(-)
}

&main

To compile BrainBack:
bf ebf.bf < BrainBack.ebf > BrainBack.bf

To compile a BrainBack program:
bf BrainBack.bf < 99.bb > 99.ebf # compile from bb to ebf
bf ebf.bf < 99.ebf > 99.bf       # compile from ebf to bf

Run the binary:
bf 99.bf

Here i use bf which is available in most debian distros. beef and others can be used as well. Both EBF compiler, BrainBack and its object code becomes quite compatible BrainFuck binaries.
It probably should be extended to print a cell as ascii ., be able to read a byte in , and to have various swap operations to be more useful. It's absolutely needed in order to make a BrainBack compiler or interpreter in BrainBack.

Wow! You're at 1337 rep points right now ... almost don't want to upvote and spoil the number! :)

€
I spend most of my time on PHP scripts and it brought me a question: why am I forced to use $ for my variables names? € is my local currency, so let's use it! Since € is used in many countries, I used some words from EU languages as keywords.
€beers gleich 99
€bottles gleich bottles of beer
€bottles_on_the_wall gleich bottles of beer on the wall

mientras €beers topogleich 3
    afficher €beers €bottles_on_the_wall
    afficher , €beers €bottles
    afficher . NETHERLANDS
    odejmowanie €beers

    afficher Take one down and pass it around, €beers
    afficher €bottles_on_the_wall
    afficher . NETHERLANDS NETHERLANDS
sartneim

afficher 2 bottles of beer on the wall, 2 bottles of beer. NETHERLANDS
afficher Take one down and pass it around, 1 bottle of beer on the wall.
afficher NETHERLANDS NETHERLANDS

afficher 1 bottle of beer on the wall, 1 bottle of beer. NETHERLANDS
afficher Take one down and pass it around, no more bottles of beer on the wall.
afficher NETHERLANDS NETHERLANDS

afficher No more bottles of beer on the wall, no more bottles of beer. NETHERLANDS
afficher Go to the store and buy some more, 99 bottles of beer on the wall.
afficher NETHERLANDS NETHERLANDS

Keywords:

gleich is equal in German
mientras is while in Spanish
topo is greater in Portuguese (update: it should be maior instead, thanks to daHugLenny for the tip)
odejmowanie is subtract in Polish
afficher is print in French
newlines are called nl sometimes, and the TLD of NETHERLANDS is nl, so I defined a constant NETHERLANDS to display newlines

I cheated a little bit since there is no if keyword, I chose to directly print the last two lines.
Interpreter in Python
The interpreter won't do more than execute the script to display 99 bottles of beers.
# -*- coding: utf-8 -*-
# @see http://stackoverflow.com/questions/12655836/writing-an-xml-file-that-contains-a-euro-symbol-in-python-using-xml-etree/12655861#12655861

# =             gleich (german)
# while         mientras (spanish)
# >             topo (portuguese) (it should be "maior" instead)
# subtract      odejmowanie (polish
# print         afficher (french)
# newline       NETHERLANDS

import sys, codecs

class euro:
    symbols = {}
    sign = u'€'

    def executeLine(self, line):
        s = line.split(' ')

        if s[0] == 'afficher':
            buffer = []

            for a in s[1:]:
                if (a == ''):
                    continue
                elif (a[0] == self.sign):
                    buffer.append(str(self.getSymbol(a)))
                elif (a == 'NETHERLANDS'):
                    buffer.append("\n")
                else :
                    buffer.append(a)

            sys.stdout.write(' '.join(buffer))
            # @see http://stackoverflow.com/questions/4499073/printing-without-newline-print-a-prints-a-space-how-to-remove/4499172#4499172
        elif s[0] == 'odejmowanie':
            self.setSymbol(s[1], (int(self.getSymbol(s[1])) - 1))
        elif (len(s) >= 3) and (s[1] == 'gleich'):
            self.setSymbol(s[0], (' ').join(s[2:]))

    def executeBlock(self, lines, statement):
        while (self.getStatement(statement)):
            for line in lines:
                self.executeLine(line)

    def getStatement(self, statement):
        if (statement[1] == 'topogleich'):
            return self.getSymbol(statement[0]) >= int(statement[2])

    def setSymbol(self, name, value):
        name = self.withoutEuro(name)
        self.symbols[name] = value

    def getSymbol(self, name):
        #~ print symbols, withoutEuro(name)
        name = self.withoutEuro(name)
        if name in self.symbols:
            value = self.symbols[name]

            return value
        else :
            print "\n-----\n",'Error: "', name, '"is not in', self.symbols, '-----'

            #~ sys.exit()

    def withoutEuro(self, string):
        return(string.replace(self.sign, ''))

    def parseFile(self, f):
        linesStack = []

        for line in codecs.open(f, 'r', 'utf-8'):
            line = line.replace('\n', '').replace('\t', '')
            s = line.split(' ')

            if (len(s) == 1) & (s[0] == '') :
                continue

            if (s[0] == 'mientras'):
                statement = s[1:]

                linesStack.append(line)
            elif (s[0] == 'sartneim'):
                linesStack.append(line)

                self.executeBlock(linesStack, statement)

                linesStack = []
                statement = ''
            elif (len(linesStack) > 0):
                linesStack.append(line)
            else:
                self.executeLine(line)

euro = euro()
euro.parseFile(sys.argv[1])

To run it, save both files then run the Python file with the .eu script as an argument:
python euro.py euro.eu

+1! Reminds me of 'If PHP Were British': https://www.addedbytes.com/blog/if-php-were-british/

This language has been documented on Esolang.

topo is top in Portuguese

@daHugLenny I'm sorry for the mistake. Is maior the correct translation of greater?

@A.L yes. (comments need to be at least 15 chars)

1Lang
1Lang is a functional prefix language like LISP or Scheme but without parentheses that makes it a bit harder to read when all unnecessary white-space is removed. Parentheses can be removed since all functions and operators take a known number of parameters.
Braces are required to delimit function body and conditional consequence and alternate code blocks which can consist of a list of statements.
In LISP, Factorial might be defined like this:
(defun fact (x) (if (< x 2) 1 (* x (fact (- x 1))) ) )

in 1Lang this would be
@Fx{ ? < x 2 {1} {* x F -x1} }

which can be reduced to
@Fx{?<x2{1}{*xF-x1}}

1Lang currently supports no side-effects.
1Lang is written in bash so it currently shares some bash limitations such as integer range.
a-z are variables. Variable are either integers, strings, or lists.

NB: Lists are not fully implemented.
A-Z are functions

Integers are bash integers (up to -2^32 to 2^31-1 I think). Negative numbers can not be directly used. To enter a negative, subtract it from zero. eg. -5 would be entered as -0 5. This limitation is because 1Lang is a work in progress and negative numbers were not needed for this application. I am considering using ~ as a unary negative operator which would allow -5 to be input as ~5.
White-space is required to delineate integers. eg. +2 3
: means assign                                    eg. :c34 to assign 34 to c
+-*/% are binary integer operators                eg. +12 34
&|^ are binary bit-wise operators
! is unary boolean not
~ is unary one's complement
? is a if-then-else function-like operator.       eg. ?=x3{*xx}{0} is x=3 return x*x else 0
+ is also a binary string concatenation operator  eg. +99" bottles"
* is also a string repetition operator            eg. *5" hello" or *" hello"5
@ defines a function                              eg. @Fx{?<x1{1}{*xF-x1}}

Function parameter names may overload callers variables.
All variables assigned within a function are local.
Printing is not necessary (although it could be useful) because like LISP every statement returns a value, and last value returned is printed.
eg. +2 3 prints 5

An unexpected behaviour of prefix notation without parentheses is that string concatenation can actually be easy to write. Say you want to concatenate "a" " quick" " brown" " fox", one might write:
+++"a"" quick"" brown"" fox"

But a more readable and less error prone method is this:
+"a"+" quick"+" brown"" fox" (Note missing + between last terms)

or
+"a"+" quick"+" brown"+" fox"""

99 Bottles of beer code:
:b" of beer"
:w" on the wall"
:t"Take one down and pass it around, "
:s"Go to the store and buy some more, "
:c", "
:n".\n"
@Bx{?=x0{+"No more bottles"b}{+x+" bottle"+?=x1{""}{"s"}b}}
@Fx{?=x0{+B0+w+c+B0+n+s+B99+wn}{+Bx+w+c+Bx+n+t+B-x1+w+n+"\n"F-x1}}
F99

Function B returns "No more bottles" or "1 bottle" or " bottles" depending on x.
Function F returns normal verses or final verse. A normal verse is concatenated with following verse by recursively calling F with -x1. When x is 0, F returns final verse.
This generates (for F5 meaning start at 5 bottles of beer...):
> F5
5 bottles of beer on the wall, 5 bottles of beer.
Take one down and pass it around, 4 bottles of beer on the wall.

4 bottles of beer on the wall, 4 bottles of beer.
Take one down and pass it around, 3 bottles of beer on the wall.

3 bottles of beer on the wall, 3 bottles of beer.
Take one down and pass it around, 2 bottles of beer on the wall.

2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, No more bottles of beer on the wall.

No more bottles of beer on the wall, No more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
<End>

1Lang interpreter (written in bash) in under 500 lines.
#!/bin/bash

LC_ALL=C  # else [a-z] and [A-Z] misbehave

# functions return result on stdout
# functions have an environment

# Requirements:
# * minimise size
#   -> eliminate delimiters
#   -> single letter variables and functions
#   -> no precidence
#   -> no overloading
# *

# string "text with \characters as per printf"
# numbers 123
# functions F3
# Built-ins +-*/%^ &|~ ! etc.
# assignment :v12 :v"string"

log(){  local m="${l:p}" m="${m//[$NL]/\n}" v="${FUNCNAME[1]}"; echo "$v: l=[${l//[$NL]/\n}] ch=[${ch/[$NL]/\n}] next=[$m]" >&2; }
logr(){ local m="${l:p}" m="${m//[$NL]/\n}" v="${FUNCNAME[1]}"; echo "$v: l=[${l//[$NL]/\n}] ch=[${ch/[$NL]/\n}] next=[$m] ret=[${ret//[$NL]/\n}]" >&2; }
logv(){ local        v="${FUNCNAME[1]}"; echo "$v: ret=[${ret//[$NL]/\n}]" >&2; }
logm(){ local m="$1" v="${FUNCNAME[1]}"; echo "$v: ${m//[$NL]/\n} in [${read//[$NL]/\n}]." >&2; }

msg(){ echo -En "$1" >&2; }
msn(){ echo -E  "$1" >&2; }

# ==========
# Line layer
# ==========

declare l
readline(){ read -rp"1lang> " l; }

#==================
# Environment Layer
#==================

declare -A v t  # variables and variable type
declare ret typ  # all bash function return these values

# assign = : var expression
assign(){
  local var
  readch
  var && var=$ret || { logm "ERROR: variable name expected"      ; return 1; }
  exp             || { logm "ERROR: value or expression expected"; return 1; }
  v["$var"]="$ret"
  t["$var"]="$typ"
}

# get variable value
get(){
  local var
  var && var=$ret || { logm "ERROR: variable name expected"; return 1; }
  ret=${v["$var"]}
  typ=${t["$var"]}
}

declare -A func fpar
declare -iA fnum                 # functions
# define = @ F param* { body }
define(){
  local fn par body
  readch
  fn && fn=$ret || { logm "ERROR: function name expected"; return 1; }
  fpar[$fn]=                     # zero parameters
  fnum[$fn]=                     # zero parameter counter
  while var;do                   # read parameters
    fpar[$fn]+=$ret
    fnum[$fn]+=1                 # cound parameters
  done
  # get body but remove block delimiters
  skip "{" "}" && body="${ret:1: -1}" || { logm "ERROR: function body expected"; return 1; }
  readch                         # skip }
  func[$fn]="$body"              # store function body
  ret="@$fn${fpar[$fn]}{$body}"
  typ='f'
}

apply(){
  local fn=$ch n c s; local -i N q
  readch
  N=${fnum[$fn]}   # number of parameters
  n=${fpar[$fn]}   # parameters
  s=${func[$fn]}   # function body
  c=
  for((q=0; q<N; q++)){
    exp || { logm "ERROR: value expected"; return 1; }
    c+="v[${n:q:1}]=\"$ret\"; "  # add value to script
    c+="t[${n:q:1}]=\"$typ\"; "  # add type to script
  }
  # parse function in a subshell and echo result and type back
  # subshell means all variable changes in function are local
  c+="parse <<<'$s'; echo -E \"\$typ\$ret\""  # combine type and value
  ret=
  typ=
  ret="$( eval "$c" )" || { logm "ERROR: function application failed"; return 1; }
  typ="${ret::1}"  # extract type
  ret="${ret:1}"   # get actual return value
}

# bash oddities:

# [[ 1 -eq 1 ]] -> 0 or success
# [[ 1 -eq 2 ]] -> 1 or failed

# x=1\<2 -> a=1 (true)
# x=1\<1 -> a=0 (false)

# ((1==1)) -> 0 or success
# ((1==2)) -> 1 or failed

# declare -i a; a=1==1 -> a=1 (true)
# declare -i a; a=1==2 -> a=0  (false)

binary(){
  local -i iret; local op=$ch a b at bt
  readch
  exp && { a="$ret"; at=$typ; } || { logm "ERROR: initial expression expected"; return 1; }
  exp && { b="$ret"; bt=$typ; } || { logm "ERROR: second expression expected"  ; return 1; }
  ret=
  typ=
  case "$at$bt" in
    nn)  # num op num
      case "$op" in
        [\*]) iret=a*b;;
        [\^]) iret=a**b;;
        [\+]) iret=a+b;;
        [\-]) iret=a-b;;
        [\/]) [[ b -ne 0 ]] && { iret=a/b; } || { logm "ERROR: division by 0"       ; return 1; };;
        [\%]) [[ b -ne 0 ]] && { iret=a%b; } || { logm "ERROR: modulo division by 0"; return 1; };;
        [\&]) iret=a\&b;;
        [\|]) iret=a\|b;;
        [\#]) iret=a\^b;;
        [\=]) iret=a==b;;
        [\<]) iret=a\<b;;
        [\>]) iret=a\>b;;
      esac
      ret=$iret
      typ='n';;  # result is always a decimal number
    ss)  # string op string
      case "$op" in
#        [\*]) arith=a*b;;  # combine?
#        [\#]) arith=${}a**b; type='s';;
        [\+]) ret="$a$b"; typ='s';;  # concatenate
        [\-]) ret="${a//$b}"; typ='s';;  # remove substrings
        [\=]) [[ $a = $b ]]; ret=$?; typ='n';;
        [\<]) [[ $a < $b ]]; ret=$?; typ='n';;
        [\>]) [[ $a > $b ]]; ret=$?; typ='n';;
      esac;;
    ns)  # num op string  =3"hello"  ="hello"3  ="3"3  =3"4"
      case "$op" in
        [\+]) ret="$a$b"; typ='s';;  # concatenate
        [\*]) ret=$(eval echo \"\${b[0]\"{1..$a}\"}\"); typ='s';;  # repeat b a times
        [\=]) ((${#b}==a)); ret=$?; typ='n';;  # length b is a
#        [\<]) [[ $a < $b ]]; arith=$?; typ='n';;
#        [\>]) [[ $a > $b ]]; arith=$?; typ='n';;
      esac;;
    sn)  # string op num  *"hello"3  ="3"3  =3"4"
      case "$op" in
        [\+]) ret="$a$b"; typ='s';;  # concatenate
        [\*]) ret=$(eval echo \"\${a[0]\"{1..$b}\"}\"); typ='s';;  # repeat a b times
        [\=]) ((${#a}==b)); ret=$?; typ='n';;  # length a is b
#        [\<]) [[ $a < $b ]]; arith=$?; typ='n';;
#        [\>]) [[ $a > $b ]]; arith=$?; typ='n';;
      esac;;
    *) logm "ERROR: undefined operation [$op] for [$a] [$at] and [$b] [$bt]"; return 1;
  esac
  return 0
}

# FIXME: string ops?
unary(){
  local -i iret; local op="$ch"
  readch
  exp || { logm "ERROR: expression expected"; return 1; }
  case "$op" in
    [\!]) iret=\!ret;;
    [\~]) iret=\~ret;;
  esac
  ret=$iret
  typ='n'  # result is always a decimal number
}

#==============
# Control Layer
#==============

# iff = ? boolean { consequence block } { alternative block }
# ?<1 2{+4 5}{+1 2}
iff(){
  local -i c; local iff ift
  readch
  exp && c=$ret || { logm "ERROR: value or expression expected"; return 1; }
  [[ c -eq 1 ]] && {  # true so do consequence
    ws
    block && { iff="$ret"; ift="$typ"; } || { logm "ERROR: consequence block error"; return 1; }
    ws
    skip "{" "}" || { logm "ERROR: alternate block expected"; return 1; }
    ret="$iff"
    typ="$ift"
  } || {
    ws
    skip "{" "}" || { logm "ERROR: consequence block expected"; return 1; }
    ws
    block || { logm "ERROR: alternate block error"; return 1; }
  }
}

#==============
# Symbols Layer
#==============

# fn = [A-Z]
fn(){
# FIXME: make evalu?
  [[ $ch = [A-Z] ]] || return 1
  ret=$ch
  typ='c'
  readch
}

# var = [a-z]
var(){
# FIXME: make evalu?
  [[ $ch = [a-z] ]] || return 1
  ret=$ch
  typ='c'
  readch
}

# list = ( token* )
# FIXME: not finished and no operators support lists
list(){
  local list=$ch prev
  readch
  while [[ $ch != ')' ]];do
    exp || { logm "ERROR: expression expected"; return 1; }
    case $typ in
      [n]) list+=" $ret";;
      [s]) list+="$ret";;
      [l]) list+="$ret";;
    esac
    ws
  done
  ret="$list$ch"
  readch
  typ='l'
  return 0
}

#============
# Token Layer
#============

# char = ' echoch
#echoch = \ {special echo escape character} | {char}
char(){
  readch
  case "$ch" in
    [\\]) escch || { logm "ERROR: escape character expected"; return 1; };;
       ?) ret="$ch"; readch
  esac
  typ='c'
}

# escaped characters are a pain
# use read with -r to read in verbatim - no escaping
# use echo -E to write out verbatim (except \\ may be processed)

declare escchS
declare ECHO='abefnrtv'
# double \\ for a \
escch(){
  local ESC="$ch"
  readch    # skip \
  case "$ch" in
    [$ECHO])                   printf -v ret "%b" "$ESC$ch"; readch;;
       [\\]) ret="\\"; readch;;
       [\"]) ret="\""; readch;;
      [0-7])         onum && { printf -v ret "%b" "$ESC$ret"   ; } || { logm "ERROR: octal number expected"; return 1; };;
       [xU]) readch; hnum && { printf -v ret "%b" "${ESC}x$ret"; } || { logm "ERROR: hex number expected"  ; return 1; };;
          ?) ret="$ch"
             [[ $escchS ]] || {
               tidyReadCh
               logm "WARNING: only octal, hex, unicode, and [$ECHO\\\"] characters need to be escaped with '$ESC'"
               logm "WARNING: [$ch] in [$l] does not need to be escaped"
               escchS="OFF"
             }
             readch
  esac
  typ='c'
}

#  num =  digit  digit*
# onum = odigit odigit*
# onum = hdigit hdigit*

num(){  local num; num=$ch; readch; while  digit;do num+=$ret; done; ret=$num; typ='n'; }
onum(){ local num; num=$ch; readch; while odigit;do num+=$ret; done; ret=$num; typ='n'; }
hnum(){ local num; num=$ch; readch; while hdigit;do num+=$ret; done; ret=$num; typ='n'; }

#  digit = [0-9]
# odigit = [0-7]
# odigit = [0-9a-fA-F]
digit(){  [[ $ch == [0-9]       ]] || { ret=-1; return 1; }; ret=$ch; typ='s'; readch; }
odigit(){ [[ $ch == [0-7]       ]] || { ret=-1; return 1; }; ret=$ch; typ='s'; readch; }
hdigit(){ [[ $ch == [0-9a-fA-F] ]] || { ret=-1; return 1; }; ret=$ch; typ='s'; readch; }

# string = " char* "
# char = escch | {any character}
string(){
  skip "\"" "\"" || { logm "ERROR: quoted string expected"; return 1; }
  ret="${ret:1: -1}"
  typ='s'
  return 0
}

# ==========
# Char layer
# ==========

declare ch read
declare -i p L COUNT
readch(){
  if [[ p -eq L ]]; then  # need more code
    readline || { ch=; p=L=0; l="EOF"; return 1; }
    l+=$NL;
    p=0
    L=${#l}
  fi
# FIXME: remove once eady - prevents bash consuming all memory
  COUNT+=1
  ((COUNT>100000)) && { logm "FAILSAFE: too many charcters read"; return 1; }
  ch="${l:p:1}"
  read+="$ch"
  p+=1  # queue next character
}

# skip = SS content* ES
# content = ch | escch | skip(SS ES)
# string = " ch* "
skip(){
  local s="$1" e="$2" b="$ch"
  typ='z'                    # code fragment
  [[ $ch != $s ]] && return  # nothing to skip
  readch
  while [[ -n $ch ]];do
    case "$ch" in
        $e)                 b+="$e"  ; readch; ret="$b"; return 0;;
        $s) skip "$s" "$e"; b+="$ret";;
      [\\]) escch         ; b+="$ret";;
      [\"]) skip "\"" "\""; b+="$ret";;
         ?)                 b+="$ch" ; readch
    esac
  done
  ret="$b"
  logm "ERROR: unexpected EOF"
  exit 1
}

# FIXME: still required?
shopt -s extglob
shopt -u nocasematch

declare NL; printf -v NL "%b" "\n"                 # echo $NL | hexdump -C
declare WS; printf -v WS "%b" " \n\t\r"            # define whitespace

# FIXME: should it set ret and typ?
ws(){ while [[ $ch == [$WS] ]];do readch; done; }  # skip any WS

#=====
# eval
#=====

# exp = [0-9] num
#       | " string "
#       | : assignment
#       | @ function definition
#       | [-+*/%^] binary operation
#       | [&|#<>=] boolean operation
#       | [!~] unary operation
#       | [A-Z] function application
#       | [a-z] variable
#       | ? if expression
#       | { expression* } block expression
#       | ( expression* ) list of expressions

# spare prefix characters [ '$[]_\;, ]
# [v  head of list
# ]v tail of list

exp(){
  ws
  case "$ch" in
              [0-9]) num    || { logm "ERROR: number expected"               ; return 1; };;
#               [\']) char   || { logm "ERROR: char expected"                 ; return 1; };;
               [\"]) string || { logm "ERROR: string expected"               ; return 1; };;
               [\:]) assign || { logm "ERROR: assignment expected"           ; return 1; };;
               [\@]) define || { logm "ERROR: function definition expected"  ; return 1; };;
           [-+*/%^]) binary || { logm "ERROR: binary expression expected"    ; return 1; };;
       [\&\|#\<\>=]) binary || { logm "ERROR: binary expression expected"    ; return 1; };;
              [\!~]) unary  || { logm "ERROR: unary expression expected"     ; return 1; };;
              [A-Z]) apply  || { logm "ERROR: function failed"               ; return 1; };;
              [a-z]) get    || { logm "ERROR: variable name expected"        ; return 1; };;
               [\?]) iff    || { logm "ERROR: boolean expression expected"   ; return 1; };;
               [\{]) block  || { logm "ERROR: code block expected"           ; return 1; };;
               [\(]) list   || { logm "ERROR: list expected"                 ; return 1; };;
                 '') ret=;       logm "ERROR: unexpected EOF"                ; return 1;;
                  *) ret="$ch"                                               ; return 1;;
  esac
  return 0
}

# block = { code }
block(){
  readch                         # skip {
  while [[ $ch != "}" ]];do
    exp || {
      tidyReadCh
      logm "WARNING: ignoring previous error or unknown symbol [$ch]"
      [[ errors+=1 -gt 5 ]] && { logm "ERROR: exiting due to too many warnings"; exit 1; }
    }
    ws
  done
  readch    # skip }
  return 0
}

#=====
# repl
#=====

# pass an expression on stdin- not used withing same ebvironment - called by apply
parse(){
  p=L  # force readline
  ch=
  read=
  readch  # clears ch
  while [[ $ch && $ch != '.' ]];do
    exp || { logm "ERROR: expression expected"; return 1; }
    read=$ch
    ws
  done
# last expression is returned as result
}

tidyReadCh(){
  tidyRead
  ch="${ch//[$NL]/\n}"
}
tidyRead(){
  read="${read//[$NL]}"
}

# repl = eval* EOF
# eval = evalu | readch
repl(){
  readch
  while [[ $ch && $ch != '.' ]];do
    exp && {
      tidyRead
      msn "> $read"  # echo line except for WS
#      echo -E "$ret [$typ]"
      echo -E "$ret"
      read=$ch
    } || {
      tidyReadCh
      msn "> $read"
      logm "WARNING: ignoring previous error or unknown symbol [$ch]"
      read=
      readch
      [[ errors+=1 -gt 5 ]] && { logm "ERROR: exiting due to too many warnings"; exit 1; }
    }
    ws
  done
  msn "<End>"
}

#=====
# test
#=====
# FIXME: negative numbers

msn "1Lang"

repl <<<'
:b" of beer"
:w" on the wall"
:t"Take one down and pass it around, "
:s"Go to the store and buy some more, "
:c", "
:n".\n"
@Bx{?=x0{+"No more bottles"b}{+x+" bottle"+?=x1{""}{"s"}b}}
@Fx{?=x0{+B0+w+c+B0+n+s+B99+wn}{+Bx+w+c+Bx+n+t+B-x1+w+n+"\n"F-x1}}
F99
'

I would have loved it even more if @Mfxy{fxy}M+3 4 worked but then you need to join the function and variable namespace. It took a while to compute 99 beers :p

@Sylwester, thanks for your interest. I'm glad your tried it and also that it worked. Yes, bash is slow, and using bash to interpret another language (especially using subshells) is just interesting, but not useful. M+3 4 would not be correct as +3 4 would be evaluated first in apply. M\xy{+xy}3 4 might be a syntax that would work.

hmmm. seems my description has triggered markup language rules and bits are missing.

Yes, so that when it has cons you can map M\x{*x2}C1C2C3C4/ => (2 4 6 8)

Half (interpreter/translator in Windows Batch)
I don't know why I'm answering so many puzzles in windows batch, for some sick reason I think I'm enjoying it :P Anyways, this is similar to something I worked on for fun a while ago, a basic language that's translated to windows batch by a script that is also written in windows batch. It's not particularly amazing, but it works.
99 Bottles of Beer
# Initialize variables
bottles ~ 99
# You can't directly compare a literal value
zero ~ 0

# This makes a point 'loop' that can be jumped to or used as a subroutine
mark loop
    write $ bottles
# You only need quotes when you have leading or trailing spaces
    print ~ " bottles of beer on the wall,"
    write $ bottles
    print ~ " bottles of beer."
    print ~ Take one down and pass it around,
    bottles @ bottles-1
    if
    bottles equ zero
        jump none
    endif
    write $ bottles
    print ~ " bottles of beer on the wall."
    print ~
jump loop

mark none
    print ~ no more bottles of beer on the wall.
    print ~
    print ~ No more bottles of beer on the wall,
    print ~ No more bottles of beer.
    print ~ Go to the store and buy some more,
    print ~ 99 bottles of beer on the wall.

Syntax
Only three tokens are recognized on each line, separated by spaces.
# is a comment.
In most cases where a value is needed, a $ in the second token signifies that the third should be treated as a variable name, whereas a ~ denotes a literal value.
General instructions take the form <instruction> [$~] <name>. Setting a variable takes the same form, but is implemented whenever  is not recognized.
Defined commands:

print and write both write output, but write does not add a newline. Needs $ or ~.
mark creates a point that can be jumped to or called as a subroutine.
jump equivalent of goto in batch (or any language for that matter).
proc calls a subroutine. Equivalent of call :label.
return returns from a subroutine. Will exit the program when not inside one.
if conditional instruction. Takes comparison from the next line, in the form <var1> <operator> <var2>. Operators are the same as if's in batch, ie. EQU, NEQ, LSS, LEQ, GTR, GEQ. Will execute instructions after it only if the comparison is true.
endif ends an if statement.
cat concatenates two variables. cat a b will store the value of ab in a.

When none of these commands are found, the expression is treated as a variable assignment, using the first token as the variable name. $ and ~ behave the same as in print, but there is also a @ identifier. This treats the last token as a mathematical expression, passed to set /a. It includes most operators. If none of the three identifiers are found, this is a syntax error and the interpreter exits.
Interpreter (Windows Batch)
The interpreter actually translates the code into windows batch, places it in a temporary file and executes it. While it recognizes syntax errors in the Half language, the resulting batch script may cause issues, especially with special characters like parentheses, vertical bars etc.
@echo off

REM Half Interpreter / Translator

if exist ~~.bat del ~~.bat
if not exist "%1" call :error "File not found: '%1'"
set error=
setlocal enabledelayedexpansion
call :parse "%1" 1>~~.bat
if exist ~~.bat if not "error"=="" ~~.bat 2>nul
goto :eof

:parse
set ifstate=0
echo @echo off
echo setlocal
echo setlocal enabledelayedexpansion
for /f "eol=# tokens=1,2* delims= " %%a in (%~1) do  (
    if "!ifstate!"=="1" (
        if /i not "%%b"=="equ" if /i not "%%b"=="neq" if /i not "%%b"=="lss" if /i not "%%b"=="leq" if /i not "%%b"=="gtr" if /i not "%%b"=="geq" call :error "Unknown comparator: '%%b'"
        echo if "^!%%a^!" %%b "^!%%c^!" ^(
        set ifstate=0
    ) else (
        if "%%a"=="print" (
            if "%%b"=="$" (
                echo echo.^^!%%c^^!
            ) else if "%%b"=="~" (
                echo echo.%%~c
            ) else call :error "Unknown identifier for print: '%%b'"
        ) else if "%%a"=="write" (
            if "%%b"=="$" (
                echo echo^|set/p="^!%%c^!"
            ) else if "%%b"=="~" (
                echo echo^|set/p="%%~c"
            ) else call :error "Unknown identifier for write: '%%b'"
        ) else if "%%a"=="mark" (
            if not "%%c"=="" call :error "Unexpected token: %%c"
            echo :%%b
        ) else if "%%a"=="jump" (
            if not "%%c"=="" call :error "Unexpected token: %%c"
            echo goto :%%b
        ) else if "%%a"=="proc" (
            if not "%%c"=="" call :error "Unexpected token: %%c"
            echo call :%%b
        ) else if "%%a"=="return" (
            if not "%%c"=="" call :error "Unexpected tokens: %%b %%c"
            if not "%%b"=="" call :error "Unexpected token: %%b"
            echo goto :eof
        ) else if "%%a"=="if" (
            if not "%%c"=="" call :error "Unexpected tokens: %%b %%c"
            if not "%%b"=="" call :error "Unexpected token: %%b"
            set ifstate=1
        ) else if "%%a"=="endif" (
            if not "%%c"=="" call :error "Unexpected tokens: %%b %%c"
            if not "%%b"=="" call :error "Unexpected token: %%b"
            echo ^)
        ) else if "%%a"=="cat" (
            echo set "%%b=^!%%b^!^!%%c^!"
        ) else (
            if "%%b"=="$" (
                echo set "%%a=!%%c!"
            ) else if "%%b"=="~" (
                echo set "%%a=%%~c"
            ) else if "%%b"=="@" (
                echo set/a"%%a=%%c"
            ) else call :error "Unknown tokens '%%a %%b %%c'"
        )
    )
)
echo endlocal
goto :eof

:error
echo.Parse Error: %~1 1>&2
set error=1
goto :eof

I'm stealing your idea (and crediting your (public domain) post)

Flex Bison
Assign variable, if else condition block and some other addition, subtraction operation.
Laxical file lex.l
%{
 #include <stdio.h>
 #include <stdlib.h>
%}

 var [A-Za-z][A-Za-z0-9]*
 digit [0-9]+
 comment \*\*[A-Za-z0-9\*\/\+\-\(\)\"\' \t;:=]*\n

 %%
 print {return(PRINT);}
 save {return(SAVE);}
 {digit} {yylval=atoi(yytext);return(DIGIT);}
 {var} {yylval=strdup(yytext);return(VAR);}
 \* {return(M_SIGN);}
 \/ {return(D_SIGN);}
 \+ {return(A_SIGN);}
 \- {return(S_SIGN);}
 \( {return(L_BRACE);}
 \) {return(R_BRACE);}
 = {return(E_SIGN);}
 ; {return(S_COLON);}
 : {return(COMMA);}
 \n {return (NW_LINE);}
 [ \t] /*skip*/;
 {comment} /*skip*/;
 %%

Parser file com.y
  %{
    #include <ctype.h>
    #include <stdio.h>
    FILE *save_p;
    int new_line=1,stack_top=0,trigger=1;
    void value_store(int);
    int check_srore(char name_var[],int);
    void error(int);

    struct store
    {
     int var_value;
     char var_name[10];
     }info[10];

    %}

      %token PRINT SAVE S_COLON L_BRACE R_BRACE DIGIT VAR COMMA NW_LINE
      %left A_SIGN S_SIGN
      %left D_SIGN M_SIGN
      %right E_SIGN

      %%
      commands :
         | commands command
          ;
      command : expers
        | print
        | save
        | NW_LINE{new_line++;}
          ;

           save : SAVE expr etest {fprintf(save_p,"%d\n",$2);}
            ;

           expers  : store_val equal expr etest{value_store($3);}
        ;

           print    : PRINT expr etest {printf("%d\n",$2);}
              ;

           etest    : S_COLON
        | DIGIT {error(0);}|PRINT{error(0);}|SAVE{error(0);}
         | VAR{error(0);}|COMMA{error(0);}
         ;

           store_val : VAR {check_store($1,0);}
          ;

           expr    : expr A_SIGN expr      { $$ = $1 + $3; }
                | expr S_SIGN expr      { $$ = $1 - $3; }
                | expr M_SIGN expr      { $$ = $1 * $3; }
                    | expr D_SIGN expr      { $$ = $1 / $3; }
                | L_BRACE expr R_BRACE  { $$ = $2; }
                | DIGIT
                | retriv_var
                ;

             equal   : E_SIGN
             ;

             retriv_var : VAR { $$=check_store($1,1); }
           ;

        %%

        #include "lex.yy.c"

        void error(int temp)
         {
                char *err[]={
                     "Statement Missing\n",
                 "Compund Statement Missing\n",
                     "Variable need a value\n",
                     "Invalid Argument\n"
          };
             printf("In line no.%d:\t%s",new_line,err[temp]);
         exit(1);
        }

      void value_store(int store_val)
      {
       stack_top--;
      info[stack_top++].var_value = store_val;
      }

   int check_store(char name_var[],int status)
   {
     int temp = 0;
   do{
    if(strcmp(info[temp].var_name,name_var)==0)
    {
   trigger=0;
       if(status)
   {
          trigger=1;
      return (info[temp].var_value);
   }
     }
    temp++;
   } while(temp<stack_top);

    if(trigger)
    {
if(status)
{
  trigger=1;
      error(2);
}
    else
strcpy(info[stack_top++].var_name,name_var);
   }
      else trigger=1;

  }

  int yyerror(const char *str)
  {
    fprintf(stderr,"error: %s\n",str);
  }

  main(int argc, char *argv[])
  {

if(argc != 3)
{
     error(3);
}
   yyin = fopen(argv[1],"r");
   save_p = fopen(argv[2],"w");
   yyparse();
   fclose(yyin);
   fclose(yyout);
  }

Compile

List item
flex lex.l
bison com.y
gcc -o compiler com.tab.c -lfl

Run
compiler in.txt ou.txt
Input file
a = 3 + (4 *7) -9;
print a;
c = a+45;
print c;
**This is comment
save c;
** save c in the file
print c*(a+32);
Output file
67

I give you:
Small Instruction Set Interpreter (SISI)
The syntax draws on BASIC and assembly. It has four statements: set, print, jump (unconditional goto), and jumpif (conditional goto). Every statement must be preceded by a line number. Supported data types are integers and strings.
The interpreter itself can be found in Python 3 on Github (sisi.py). The 99 Bottles of Beer program is there as well, but I'll reproduce it here:
10 set x 99
20 set bottles " bottles "

100 set line x + bottles
110 set line line + "of beer on the wall, "
120 set line line + x
130 set line line + bottles
135 set line line + "of beer."
140 print line

200 set x x - 1
210 set none x = 0
220 jumpif none 400
230 set multiple x > 1
240 jumpif multiple 300
250 set bottles " bottle "

300 set line "Take one down and pass it around, " + x
310 set line line + bottles
320 set line line + "of beer on the wall."
330 print line
340 print ""
350 jump 100

400 print "Take one down and pass it around, no more bottles of beer on the wall."
410 print ""
420 print "No more bottles of beer on the wall, no more bottles of beer."
430 print "Go to the store and buy some more, 99 bottles of beer on the wall."

99ISC
99ISC uses an arbitrarily-sized integer-oriented memory. Memory is indexed by a non-negative integer. All values in memory are initialized with their address. Eg. At runtime, address 0 contains value 0 and address 9 contains value 9.
99ISC has two instructions. The first prints out the 99 Bottles of Beer on the Wall routine. Its syntax is a single line, as below. Execution continues with the next line in the program.
.

The second instruction is a "subtract and branch if not equal to zero" instruction. Its syntax is a single line, as below.
x y z

x is the address of the number to be operated on, y is the address of the number being subtracted, and z is the next line to execute if the result of the subtraction is not zero. Otherwise, execution proceeds with the next line.
The presence of the "subtract-and-branch-if-not-zero" instruction makes 99ISC an OISC (One Instruction Set Computer) and therefore Turing complete.
Here is a program that erases the first 10 values in memory and then prints the 99 Bottles of Beer on the Wall routine.
1 1 0
2 2 0
3 3 0
4 4 0
5 5 0
6 6 0
7 7 0
8 8 0
9 9 0
.

And here is a 99ISC interpreter, in Python.
def interpret(filename):
    mem = range(0, 10)
    print mem

    with open(filename) as f:
            lines = f.readlines()

    ptr = 0
    while ptr < len(lines):
            line = lines[ptr]

            if line.strip() == ".":
                    for i in range(99,0,-1):
                            text = str(i) + " bottles of beer on the wall, " + str(i) + " bottles of beer.\nTake one down and pass it around, " + str(i-1) + " bottles of beer on the wall.\n\n"
                            print text.replace("0", "No more")
            else:
                    toks = map(int, line.split())
                    mem[toks[0]] = (mem[toks[0]] - mem[toks[1]]) & 0xFF
                    if mem[toks[0]] != 0:
                            ptr = toks[2]
                    else:
                            ptr += 1

I guess this breaks the "best practices" rules for golf questions. With a generic print statement in place of "." it would still work, but I'll be damned if I'm going to write the 99BOB program!

Last 2 verses need a bit more work.

Interpreter
For instructions on how to run this code, take a look at my other answer: https://codegolf.stackexchange.com/a/19935/13186
99 Bottles of Beer
The Program
 bottles of beer on the wall, @ bottles of beer.
Take one down and pass it around, @ bottles of beer on the wall.

@ bottle of beer on the wall.

1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.
@@@@@@@@@@@@@@

#9.{
    !#48.+

    !<#57.<#0.^<!<#57.<#1.^<!<#56.<#64.^<
    !<#56.<#0.^<!<#56.<#1.^<!<#55.<#64.^<
    !<#55.<#0.^<!<#55.<#1.^<!<#54.<#64.^<
    !<#54.<#0.^<!<#54.<#1.^<!<#53.<#64.^<
    !<#53.<#0.^<!<#53.<#1.^<!<#52.<#64.^<
    !<#52.<#0.^<!<#52.<#1.^<!<#51.<#64.^<
    !<#51.<#0.^<!<#51.<#1.^<!<#50.<#64.^<
    !<#50.<#0.^<!<#50.<#1.^<!<#49.<#64.^<
    !<#49.<#0.^<!<#49.<#1.^<!<#48.<#64.^<
    !<#48.<#0.^<!<#48.<#1.^<!#1.-<#57.<#64.^<
    _
?}

#57.<#0.^<#57.<#1.^<!<#56.<#64.^<
#56.<#0.^<#56.<#1.^<!<#55.<#64.^<
#55.<#0.^<#55.<#1.^<!<#54.<#64.^<
#54.<#0.^<#54.<#1.^<!<#53.<#64.^<
#53.<#0.^<#53.<#1.^<!<#52.<#64.^<
#52.<#0.^<#52.<#1.^<!<#51.<#64.^<
#51.<#0.^<#51.<#1.^<!<#50.<#64.^<
#50.<#0.^<#50.<#1.^<!<#49.<
#94.^<

$

Pogo
https://github.com/nrubin29/Pogo
method main:void
    declare(integer,i,99)
    while i > 0
        print(i "bottles of beer on the wall")
        math(i - 1) i
    end
end main

I'm having problems seeing that this prints the 99 bottles lyrics.

First, I declare an integer named i and set it equal to 99. Then, while i is greater than 0, I print i bottles of beer on the wall and subtract one from i. If the problem is that I'm lacking some of the lyrics, I can add more.

A link to lyrics was (or now is) provided. Last few verses are a bit more complicated.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/