@neauoire 😊 The main difference with those languages is I think that I use the type system to create data structures.
Without the algebraic data types, it maps quite directly to Uxntal: the lambda arguments are just memory locations. And the postfix notation makes everything very easy.
Conversation
Notices
-
WimⓂ️ (wim_v12e@merveilles.town)'s status on Friday, 24-Mar-2023 02:38:43 JST WimⓂ️ -
Devine Lu Ator (neauoire@merveilles.town)'s status on Friday, 24-Mar-2023 02:38:44 JST Devine Lu Ator @wim_v12e I'd just like to say that postfix function declaration looks very nice. At a glance it looks like you're building a cocktail of factor and joy, and I'm here for it.
Adrian Cochrane repeated this. -
WimⓂ️ (wim_v12e@merveilles.town)'s status on Friday, 24-Mar-2023 02:38:45 JST WimⓂ️ Currently, there is no type checking. It's all very bare bones, an awful lot is still missing. There isn't even a compiler executable yet. But I think progress should be a bit faster now. #Funktal
-
WimⓂ️ (wim_v12e@merveilles.town)'s status on Friday, 24-Mar-2023 02:38:46 JST WimⓂ️ The second example shows the use of an algebraic data type, a tuple:
types {
Tup = Int Int MkTup
}main {
6 7 MkTup (\ Int <- (x y MkTup): Tup . x y * )
print
}MkTup creates a tuple of two integers. In Haskell this would be
data Tup = MkTup Int Int
The lambda function pattern matches on the type, so x and y bind to the stored values.
-
WimⓂ️ (wim_v12e@merveilles.town)'s status on Friday, 24-Mar-2023 02:38:47 JST WimⓂ️ Finally, my #Funktal compiler can emit correct #Uxntal for some simple examples.
The first one shows named functions, lambda functions and primitive types:
functions {
sq = (\Int <- x:Int. x x *)
}main {
6 7 (\ Int <- x:Int <- y:Int . x y * sq )
print
}Funktal uses postfix notation for expressions and types. In Haskell, the sq function would be
sq :: Int -> Int
sq = \x -> x*xAdrian Cochrane repeated this.
-