« first day    last day (16 days later) » 

08:37
Hello
 
2 hours later…
11:02
in The Nineteenth Byte, 6 secs ago, by TùxCräftîñg
i added docs to Logy
11:56
\o/
 
2 hours later…
14:00
r[x,y]->r[x-1,y*x];
r[1,y]->y;
p[x]->r[x-1,1]%x+1==0;
@TùxCräftîñg cant test on mobile
arguments must start with a uppercase letter
and pattern matching take & at the start (so here it's r[&1,Y])
i forget to add it to the docs
Why?
stupid parser
wait i just realised
modulo is % but it's also comments >_<
14:03
Do you have atoms? Is that why variables are uppercase
Kind of like symbols
no it dont have atoms
In Erlang atoms are lowercase (ok) and variables are uppercase (Var)
Then why the uppercase
ok your primality checker discovered a lot of bugs in the interpreter
14:05
excellent
in Logy rule names start with lowercase and variables/constants/arguments start with uppercase
wtf adding a main function make it crash with Unknown rule 'p' and removing it make it crash with a undefined method 'drop' for nil:NilClass (NoMethodError)
Source?
wait the nil error is because it dont have the main method, so the interpreter try to call nil ._.
D:/Logy/interpreter/interpreter.rb:86:in `get_rule': Unknown rule 'puts' (Logy::Error::UnknownRule)
totally not borked lol
 
2 hours later…
15:53
@TùxCräftîñg Rules and facts are causing problems:
wrapper -> f[X] -> X;
Parse error: expected ";" but got "->" on line 1.
It's expecting a fact
> Rules/constants must be loaded from a file ('include["file"];')
in the welcome message of the REPL
Oh, well that's lame
It doesn't really like recursion
/home/quartata/logy/parser/visitor.rb:8: stack level too deep (SystemStackError) for r[4, 1];
the interpreter recurse in the entire ast
That's kind of a problem. Why don't you just traverse it iteratively
use a while loop and an agenda
mainly lazyness
16:05
I don't see why lazy eval would be a problem?
no, programmer lazyness :P
Oh.
Well it isn't very useful if I can't recurse 4 levels :P
i want to compile it but pattern matching is a pain to compile
wrapper -> -begin
        >> f[X]->X/2;
        >> -end
wrapper -> f[3.14];
> 1.57
pushing it
16:29
@TùxCräftîñg Found an environmental variable to increase ruby's stack size
what var?
but anyway even making the stack unbounded would make logy crash on recursion on complex code :/
 
6 hours later…
22:41
@TùxCräftîñg Even with the stack size increased this seems to be running infinitely until it overflows:
r[X,Y]->r[X-1,Y*X];
r[&1,Y]->Y;
What did I do wrong

« first day    last day (16 days later) »