5 ms·
Agreed! I haven't had so much learning a new language in a long time. Lots of cutting-edge stuff going on in Kitten, and all the concatenative goodness you he
by groovy2shoes 10y ago
Agreed! I haven't had so much learning a new language in a long time. Lots of cutting-edge stuff going on in Kitten, and all the concatenative goodness you hear about from Factor fans, but (imo) in a much more palatable package. Part of what makes it so palatable for me is that there have been some syntactic compromises rather than relentless emphasis on RPN. For example, rather than (as in Forth):
0 = IF foo ELSE bar THEN
Kitten allows you to say:
-> x;
if (x = 0):
foo
else:
bar
which I personally find much easier to follow.
So, you get local variables, infix expressions, and some amount of non-RPN syntax, without sacrificing any of the power you'd get from another concatenative language.
I've talked to Jon (the creator) a bit off-and-on, and from what I gather there are some really neat things being planned for Kitten in the near future :)
- snaky 10y agoWhat I found most interesting it's Kitten effects (actually coeffects) system based on the system of extensible records that allow very elegant permission composition. Author of Kitten gives some explanations comparing it with Haskell at https://www.reddit.com/r/programming/comments/4mzlvi/10_lesserknown_programming_languages_worth/d422nyi https://www.reddit.com/r/programming/comments/4mzlvi/10_less...
- groovy2shoes 10y agoAha! I hadn't realized they'd officially landed already. Yeah, the effects are one of those "really neat" things I was referring to :) I've been thinking about how they could be used with a term-rewriting system for certain kinds of optimization. Some rewrite rules only apply under certain conditions that may or may not be lexically apparent in the absence of an effects system. As a simple example: rewrite {f map} {g map} compose => {f} {g} compose map ; This transformation will only work if `f` and `g` are pure functions: if `f` and `g` have side-effects, then the transformation is no longer equivalent. But using the effects system, we can give rewrite rules a sort of context that lets the rewrite system know the extra conditions necessary for a rule to apply.
- tluyben2 10y ago> which I personally find much easier to follow. Think that's right. I've been doing a lot of oK, J, Pyth, Forth (working on my own for Z80) for fun and I find it actually very easy to read terse code after a few months. So much that the way you (and most) prefer actually annoys me. It's so much space taken in my field of vision while with terse code I can read entire, quite full and complex programs on 1 screen without scrolling. Don't worry; I would not say that this is a good idea for programming in teams or maintainable software. I think it is if you have a group of like minded people who prefer this. For me personally however, it makes me very productive and I use the above languages for prototyping now as I get stuff done quicker and with less bugs. I think it's very personal though. Hooray for kitten lang by the way.
- snaky 10y ago> I would not say that this is a good idea for programming in teams or maintainable software Looking at projects like LuaJIT I'd say programming in teams is, to say the least, an overrated idea per se in so many cases.
- groovy2shoes 10y agoFor me, the lack of readability isn't necessarily about the terseness, per se. It's about trying to keep track of the stack in my head at all times, and the "unnatural" order that the "keywords" appear in. <condition> IF <consequent> ELSE <alternative> THEN is something I still struggle with, even after studying forth (via Leo Brodie's "Starting Forth" and "Thinking Forth") for about 3 months. Something like this I have no trouble with: IF <condition> THEN <consequent> ELSE <alternative> but the addition of the (optional) local variables helps me to keep track of the stack more easily (if you could even consider it the stack at that point). In general, I don't have much trouble with RPN, but a few of the constructs in forth have eluded me...
- deleted 10y ago[deleted]
- dragonwriter 10y agoYeah, I think the choice of keywords in that case isn't great for the structural order that they have to appear in <condition> THEN <consequent> ELSE <alternative> IF would probably be a better order, in the same structure, keeping the same keywords.
- al2o3cr 10y agoReminds me of programming my HP-48G back in the day, particularly the local variable syntax: http://www.hpmuseum.org/rpl.htm http://www.hpmuseum.org/rpl.htm Not sure if Kitten is directly inspired by this or if they're both building on a common ancestor I haven't heard of.