Live data from Hacker News

Show HN: KatLang – Language for Calculations

katlang.org

1–10 of 46 posts

Re: Show HN: KatLang – Language for Calculations

#2
The author here. I am ready to answer any questions about KatLang. The future plan is to create android app and I hope that it will become the future calculator. I have been postponing android app creation for years, but now KatLang is in good shape and I can continue with tool development.

Re: Show HN: KatLang – Language for Calculations

#3
Looks good.

Curious about the syntax of function declaration - i.e.:

   A = x * y + x
And then I invoke it by:

   A(2, 3)
Implicitly using the order of which the parameters were used in the function declaration.

Rather than having it explict either via:

   A = (x, y) => x * y + x
Or via named parameters:

   A(x = 2, y = 3)
Why this design?

Re: Show HN: KatLang – Language for Calculations

#4

Looks good. Curious about the syntax of function declaration - i.e.: A = x * y + x And then I invoke it by: A(2, 3) Implicitly using the order of which the parameters were used in the function declaration. Rather than having it explict either via: A = (x, y) => x * y + x Or via named parameters: A(x = 2, y = 3) Why this design?

I was obsessed with the perfect syntax. Declaring method parameters in method parameters list is redundant, because the parameters appear in the method body anyway. This approach is not the best in all situations, but for short expressions, like lambda expressions, it is perfect (in my opinion). Check my paper on comparing lambda expression implementation: https://www.bjmc.lu.lv/fileadmin/user_upload/lu_portal/proje...

Re: Show HN: KatLang – Language for Calculations

#7

Looks good. Curious about the syntax of function declaration - i.e.: A = x * y + x And then I invoke it by: A(2, 3) Implicitly using the order of which the parameters were used in the function declaration. Rather than having it explict either via: A = (x, y) => x * y + x Or via named parameters: A(x = 2, y = 3) Why this design?

I expected `A(x, y) = x * y + x`, in line with standard mathematical function notation.

Re: Show HN: KatLang – Language for Calculations

#8
post #5

I wonder why no (proper) https?

KatLang parser is executed as Blazor webassembly app on client side, therefore your entered KatLang code is not sent to the server. But I agree, it needs https, especially when KatLang supports operators like 'load' which can load KatLang code from other sources. Loading part is inspired from Prolog predicate consult.

Re: Show HN: KatLang – Language for Calculations

#9

Looks good. Curious about the syntax of function declaration - i.e.: A = x * y + x And then I invoke it by: A(2, 3) Implicitly using the order of which the parameters were used in the function declaration. Rather than having it explict either via: A = (x, y) => x * y + x Or via named parameters: A(x = 2, y = 3) Why this design?

I was obsessed with the perfect syntax. Declaring method parameters in method parameters list is redundant, because the parameters appear in the method body anyway. This approach is not the best in all situations, but for short expressions, like lambda expressions, it is perfect (in my opinion). Check my paper on comparing lambda expression implementation: https://www.bjmc.lu.lv/fileadmin/user_upload/lu_portal/proje.…

It creates the situation where these two functions appear to be identical but they are not:

   A = x * y + x

   A = y * x + x
It is an interesting subject, and in general you would want to balance usability, people's expectations, and succinctness.

Re: Show HN: KatLang – Language for Calculations

#10

Looks good. Curious about the syntax of function declaration - i.e.: A = x * y + x And then I invoke it by: A(2, 3) Implicitly using the order of which the parameters were used in the function declaration. Rather than having it explict either via: A = (x, y) => x * y + x Or via named parameters: A(x = 2, y = 3) Why this design?

I expected `A(x, y) = x * y + x`, in line with standard mathematical function notation.

When you have A=xy+x from math perspective it looks like assigning a value to a variable. When You use A(x,y)=xy+x it looks like math function definition. You can look at it as if used variable assignment syntax and changed underlying semantics to the function definition syntax. I suppose, people are familiar with classic math syntax and it will be difficult to change their beliefs. But I also believe, that smartphone usage can change people habits. When function body defines the function signature, it is much easier to move around the function definition on small screen devices, define function, edit, and so on... I advice to watch promotional video for KatLang predecessor - https://www.youtube.com/watch?v=ya8beSCx1IA It is still available on Windows Phone marketplace as IlCalculus app. Next goal is to develop Android app and I believe then it will be much easier to convince you, that implicit parameter declaration is the future feature of the clalculator.
Post reply on HN