MAGALANG
Magalang is a new language I am have been developing for righting mathematic algorithms and equations.
Here is a line of code so far:
x = 3 + 3 * (10 - 6) / 2;
print x;
y = x * 2;
print y;
z = x * y;
print z;
w = z + x / y;
print w;
sum = x + y + z + w;
print sum;
12 Replies
So far this isn't very different from Python apart from the lack of parenthesis
if the main purpose is to ease the process of algorithm implementation I'd add features such as easy function composition, recursion, numerical methods for integrals, etc.
But for now I'm guessing it is just a prototype and it seems to be going in the right direction for me 👍
yeah its still a prototype but it will have these adustments soon!
Sounds good
thanks!
The code you posted is literally valid Python2 code lol
(just verfied it in the interpreter)
didn't remember that versions prior to 3.0 supported functions without parenthesis
only print
such a weird thing that Python had ngl
If the purpose is to design a language oriented to developing mathmetical algorithms, you might as well add implicit variable multiplication:
y = 2*x
--> y = 2x
y = 5*var
--> y = 5var
it's pretty standard imo. But I might have a different view on this as I learned programming with languages like batch and ruby that can do this ^^
php as well
agreed, I like the idea
batch doesn't have a syntax where functions are defined this way. For example I learnt to code in C after batch and also did a bit of JS so seeing a different syntax is weird
and if you could define a matrix type
would perform the matrix multiplication
Just giving ideas and inspiration for future features your MAGALANG could have (I wonder from where this name comes, is it what I think xD)
yeah the code so far is from a tutorial right now but I am planning on making changes to it!