Fi
(Redirected from Fi (Archived))
- This is still a work in progress. It may be changed in the future.
Fi is a conceptual programming language by User:Rdococ. This page was going to waste, but I decided to turn it into an intentional 'kitchen sink' language, in an attempt to make it convenient to use, but esoteric to implement.
Semantics
Fi is statically typed and object-oriented ('interface-oriented'?) with an extensive type system.
- Interface types: All types in Fi are interface types with bells and whistles.
- Structs = interfaces: Fields are valid interface members and equated with 'getter' and 'setter' method pairs.
- Methods = classes: You can instantiate an object with zero or more members at any point.
- Classes then become design patterns whereby methods construct instances with similar behaviors. (This may be supported with syntax sugar -- TODO)
- Structural typing: You can define interfaces, but they are compatible if they share the same method names and structure.
- Type parameters: Type parameters define an unbounded family of interface types with a particular type substituted.
- Existential types: Type parameters can be introduced by the callee as well as the caller.
- Recursive generics: You can define types required to be equivalent to their parameters, e.g.
Interface[T = This]
, to model abstract data types and typeclasses.
- Delimited continuations: Delimited continuations are implemented in the form of cloneable coroutines.
- Object ownership & copying: Types can be considered 'owned' or 'non-owned'.
- Instead of memory management, ownership informs the object copying operator, as well as coroutine cloning.
- Sealed type: An interface type can be 'sealed'. Sealed types take values that implement that interface and no other -- subtypes are not allowed.
- This theoretically permits an optimization where types that can be proven not to escape their scope are stack-allocated.
Syntax
Naturally, for a language to be complex to implement, the syntax itself should be Turing-complete. TODO