oh sorry I mixed them with builders, which are related but not the same.
Cation is not a bracket-based language, but it has a similar concept with indentation. Basically, you can put your last argument to the next string and make it an expression, like
someMethod arg1, arg2, (
-- multi-line statement goes here, like
one |>
two |>
andResult
)
annotations (their subtype named attributes) are the way to metaprogram. They start with @ and look like annotations in Swift. They are the same as proc macros in rust (and will work in similar way)
over next weeks I will work on trying different cases in Cation; it could be that it would actually need some form of lambda syntax with \( ... ) - similar to Haskel way, such that the above becomes
someMethod arg1, arg2, \(
statement1
statement2
statement3
)
I took a simple map function for an optional/maybe type which maps its value to another type via a provided closure, and asked ChatGPT to show how it looks like in Haskell, Scala, Idris, Rust, Swift, Python and C++.
Than I gave it the same function written in Cation and asked to analyse it. The results are here: https://chatgpt.com/share/6724d4d8-b9c0-8013-8645-463ae6864836
At least, according to ChatGPT, the Cation has the highest conciseness of all these languages :) (see table at the end of chat)
I did some work classifying main existing programming languages, in order to demonstrate the actual gap Cation language is intendent to close. This is becoming even more important giving the raise of AI-driven hacks and the need for a formally-verifiable system programming languages
The problems of provable (formally-verifiable) program safety and determinism became crucial in the age of modern LLMs.
I am developing AluVM and Cation as a constructionist and ultrafinitist tool: in each type is a finite set of constructable objects; so there is type N8 made of all natural numbers (0 is not natural!) in range 1-256 included, N16, N32 and N64. There are integers of the same sort (0 included), I8, I16, I32 etc. There are no floating-point numbers, only rationals (in the Norman Wildberger style), no sine/cosine - only rational trigonometry. Integers are pairs of numbers, not just “unsigned with a sign bit”, rationals are pairs of integers (i.e. quadruples of numbers). It uses dependent types (calculus of constructs), but restricts to finite types only. All functions are total, the termination analysis proves that. There is no recursion which can’t be reduced to a provable-terminating computation at compile-time.
This gives a language and computational system which is formally analyzable at compile-time, by its structure. Additionally to that, a binary compiled code is also formally analyzable and has a verifiable properties.