Live data from Hacker News

Kamby – A programming language based on Lisp that doesn't seem like Lisp

kamby.org

21–30 of 53 posts

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#21
post #9

Browsing the source code, I came across something completely unexpected. I didn't know you could put code in structs like this sample from kamby/kamby.c struct KaNode *ka_add(struct KaNode *node, struct KaNode **env) { if (node->type == KA_STR && node->next->type == KA_STR) { struct KaNode *output = ka_str(node->str); strcat(output->str, node->next->str); return output; } return ka_num(node->num + node->next->num); }…

I don't do a lot of C, but isn't this just a global function returning a pointer to a KaNode? If I remember correctly this is just Cs way of specifying a type is a struct same thing with the line in your example "struct KaNode *output = ..." someone feel free to correct me if I am wrong though.

Would be easier to read if KaNode was a typedef

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#22
> Variables are not unique. You can declare multiple values for the same variable name using ":=" and append in the stack. If you want to edit the last declaration, just user simple "=" operator. To remove the last variable with specific name in stack, use "del varname"

Isn't this very confusing in almost all instances?

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#26
post #22

> Variables are not unique. You can declare multiple values for the same variable name using ":=" and append in the stack. If you want to edit the last declaration, just user simple "=" operator. To remove the last variable with specific name in stack, use "del varname" Isn't this very confusing in almost all instances?

Seems like an explicit/less confusing way to do variable shadowing, though imho that's not a feature worth implementing in a 400LOC language.

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#27
post #22

> Variables are not unique. You can declare multiple values for the same variable name using ":=" and append in the stack. If you want to edit the last declaration, just user simple "=" operator. To remove the last variable with specific name in stack, use "del varname" Isn't this very confusing in almost all instances?

So this language is based on dynamic scope? I'm not sure about confusing, but why wouldn't I want to just use LOGO then?

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#28
post #17
post #3

And yet its still filled with unncessary parentheses like an involuntary tic.

Lisp code tends to have fewer delimiting punctuation characters than most algol style current languages. I think people tend to dislike languages that have only the minimum necessary, because it's easy to misread code then and redundancy helps compilers catch mistakes as inconsistent syntax. But there's always Forth for the the lighter taste in delimiters: https://github.com/TexTerry/forth-examples/blob/master/pasca.…

I never understand these complaints about parenthesis, my editor takes care of them. Interestingly people never complain about the inconsequences in mathematical notation, i.e. infix operators like plus or minus (e.g. 3+5), postfix operators like faculty (i.e. 9!) and last but not least prefixed user defined funtions like f(x).

But as Lisp was my first real language, I might be a bit biased. And besides Lisp I like languages like Forth or Postscript, and even Perl ;-)

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#29
post #22

> Variables are not unique. You can declare multiple values for the same variable name using ":=" and append in the stack. If you want to edit the last declaration, just user simple "=" operator. To remove the last variable with specific name in stack, use "del varname" Isn't this very confusing in almost all instances?

Seems like an explicit/less confusing way to do variable shadowing, though imho that's not a feature worth implementing in a 400LOC language.

It being explicit/arbitrary makes it more confusing, not less. At least most languages with variable shadowing, there's a block of some sort that defines the scope. Here it'd just be anywhere that it can change meaning.

Re: Kamby – A programming language based on Lisp that doesn't seem like Lisp

#30
post #17
post #3

And yet its still filled with unncessary parentheses like an involuntary tic.

Lisp code tends to have fewer delimiting punctuation characters than most algol style current languages. I think people tend to dislike languages that have only the minimum necessary, because it's easy to misread code then and redundancy helps compilers catch mistakes as inconsistent syntax. But there's always Forth for the the lighter taste in delimiters: https://github.com/TexTerry/forth-examples/blob/master/pasca.…

It’s not about writing but about readability. Clojure is easier to read than Scheme because it uses more punctuation (brackets and braces instead of only parens.

There’s a point in using different signs that mean different things.

Post reply on HN