Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Functional Jargon

Functional Jargon

Daerax
Journal · · 3 min read
1,234 2
So this is an interim post. Although Ive added strings and "blocks" to the logic program this post is about a new project.

So implementing that last project I got bit by the language bug. It was fun comparing things with Epoch and Tangent although what I made was certainly not intended as a real language. But Ive decided to embark on writing a proper language from first principles. For me it is motivating to see what the others have done, every time I implement a feature I refresh the journal page to see if the others have made any new posts. Hopefully it is motivating and also provides friendly competition for the others so the languages dont simply die (e.g. Epochs current road block with lexical scoping might otherwise prove too daunting to be worth bothering about). Although each language is not related or part of the same domain since each addresses a different niche (Tangent: a beginner friendly OOP language that addresses much of the problems of OOP - collisons, dispatch , inheritance; Epoch a performant scripting language for games?).

So my language is called Functional Jargon. As its title implies it is intended to be a functional language. The language is written in F#. It is intended to fill the following niche

(1) Run on a PDA.
(2) A simple language to learn functional programming in
(3) A fairly efficient scripting functional language for games on the .NET platform.

(1) is by far the most important since it is often that I find myself wishing I had a language to test some algorithims on my PDA in a lightweight functional language. There is Scheme for PDAs but it is impossibly obtuse on a such a small screen. Thus the syntax will be fairly terse to enable quick scribbling. The PC version will have a more verbose pascal like script to make it friendlier.

Two and 3 imply that the language will be interpreted. Indeed the language will be exposed as a library with an eval method. Although it will be interpreted the abstract machine will be statically typed. I have no intention of making it a first class citizen on the .NET platform - the languages F# and Nemerle already fill this niche. Thus it will not produce IL. I will have to see how interop with say objects in a game will work. I may have to rely on reflection. I do not intend to support .NET classes since I intend to have a richer type system than it allows.
------

Because it is a functional language it makes sense to start out with the lambda calculus and then extend it. So rite now FJ is the untyped lambda calculus, it is already turing complete with support for recursion (via the fixed point combinator), higher order functions (everything is a function) and proper scoping (via nature of the calculus). But it is currently useless. Here are the kinda programs you can currently write in it:
x#; /*bind a variable to the context*/y#;x (y x); /* everything is a function */fun z.z y; /* apply y to fun z -> z */fun x.x; /* identity function */fun t. fun f . f; /* boolean false */(fun x.x) (fun x. x x) y;

Discussion

Loading comments...