Re:Luna – Visual and textual functional programming language
by thecity2 on Thursday June 22, 2017 @11:41AM
(#14613009)
I like the idea of category-oriented programming. Would be interested to see a white paper on what that means.
[ Parent
| on HN ]
Re:Luna – Visual and textual functional programming language
by gramstrong on Thursday June 22, 2017 @11:51AM
(#14613082)
I'm not sure what the idea even means, or if it really warrants a separate paradigm than OOP. Is it related to category theory? Frustrated that a 'new' paradigm got dropped on me with only a couple sentences of explanation.
Re:Luna – Visual and textual functional programming language
by tree_of_item on Thursday June 22, 2017 @12:11PM
(#14613238)
It's bogus, they just wanted to use the word "category" to try and lure in FP enthusiasts.
Re:Luna – Visual and textual functional programming language
by wdanilo on Thursday June 22, 2017 @01:19PM
(#14613769)
It's not a bogus! We are FP enthusiasts and the word "category" has really strong connections to our type system. However, the name might be a little misleading so we've already changed it. Anyway, we treat our types as categories. For example 1 belongs to a singleton category 1 (thus you can write 1 :: 1) but it also belongs to category of positive numbers or all numbers in general, thus again you can write (1 :: 1 :: Nat :: Int :: Num :: *). I hope you see now connections to category theory. However the name itself, as I noted above, could be misleading so we need to change it.
Re:Luna – Visual and textual functional programming language
by tentaTherapist on Monday June 26, 2017 @12:31PM
(#14638017)
That's just plain-old dependent typing, isn't it? What's in this and not in, say, Idris, such that you can say that it's a whole new paradigm?
Re:Luna – Visual and textual functional programming language
by shalabhc on Thursday June 22, 2017 @04:37PM
(#14615149)
1 also belongs to 'all integers from 1 through 10'. Is this also a category? (I assume yes). How is this category expressed in Luna?
Re:Luna – Visual and textual functional programming language
by wdanilo on Thursday June 22, 2017 @05:36PM
(#14615533)
Yes it is, `1 :: 1 | .. | 10`. The pipe combines categories, so you can as well write `1 :: 1|2|3|4|5|6|7|8|9|10`. Both of the forms are however not yet supported in the main branch of official compiler and will not be supported during the first release yet.
Re:Luna – Visual and textual functional programming language
by kustosz on Thursday June 22, 2017 @01:53PM
(#14614010)
I wouldn’t say it’s bogus, and there definitely wasn’t any malicious intention behind it, it’s just that finding a name for such a property is super difficult. As I’ve written above, it’s about having fine-grained control over the data (object) constructors. It turns out most words synonymous to “type”, “kind”, “category” etc. (as understood in the wide sense) are already taken by mathematical / programming concepts. We will, however, change the name, as it causes way too much confusion :).
Re:Luna – Visual and textual functional programming language
by coldtea on Thursday June 22, 2017 @02:03PM
(#14614080)
And you know that because?
Re:Luna – Visual and textual functional programming language
by kustosz on Thursday June 22, 2017 @01:11PM
(#14613702)
This feature is a bit of a misnomer, as it immediately brings up discussions about category theory. That being said, the idea behind it is pretty simple, yet powerful. Our typechecker will be able to track the shape of data on a deeper level than usual types. Basically will be tracking the exact constructors used to construct data, not just types – something that is a huge pain in most existing typed languages. If you for example take Haskell, you can have a data type with multiple different constructors, and even though you may be certain that some of those are impossible to occur at some points in your program, it is difficult to express that certainty on typelevel – other than repacking to a different datatype, with less constructors, which then need to be named differently and need repacking even if you're just calling a function that expects a wider range of constructors, and thus is definitely safe.
However, due to the amount of work with more foundational layers of the language, we've had to postpone implementing this feature until further down the line. It is coming at some point for sure, though :)
Re:Luna – Visual and textual functional programming language
by tentaTherapist on Monday June 26, 2017 @12:35PM
(#14638069)
That sounds like a horribly leaky abstraction if you mean that you're literally going to statically track the call stack to attempt to verify invariants. Hopefully it's just a misunderstanding on my part.