fCompiler

From Esolang
Jump to navigation Jump to search
fCompiler
Designed by User:I am islptng
Appeared in 2023
Computational class Metalanguage
Reference implementation Python
Influenced by Subleq
File extension(s) .fcma

Try it online!

fCompiler is a meta-language by islptng, where the idea is from 2023 and finally gets implemented in 2025 with a slightly different syntax.

Intro

When you play some games that require you to write large assembly programs, won't you feel bad?
This is what that come to my mind when I was playing the game "Turing Complete" and writting Subleq programs.

However, users must build up an environment by themselves -- There's NOT any predefined functions!
This allows for flexibility -- It, unlike those which can only compile to certain machine code, can compile to anything if you want!

Syntax

Comments

We have only one form of comments: ;.
From the semicolon, to the next line break, is comment.

Keywords

Initially, there's only 5 keywords: "funct","struct","const","key" and "end".

"const"'s usage:

const a 1

Defines a constant named "a" with value "1".

"funct"'s usage:

funct name
   ; some code here
end

Defines a function. You can use %1% to represent the 1st argument, %2% to represent the 2nd argument, and so on.
%u% will be replaced by a unique ID that, on each function call, returns different value.

"struct"'s usage:

struct name
    ; some code for "name" here
key midname
    ; some code for "midname" here
key
    ; some code for "end" here
end

Defines a structure. Like funct, use %n% and %u% for arguments.

Compile to...

It depends on what you write after an exclamation mark. for example, !Hello, world! causes the interpreter to print "Hello, world!".

To call a structure/function

Just write the name and pass in arguments by writing after the name with a space. Nothing will happen when you have passed wrong number of arguments.

Examples

Hello, world!

!Hello, world!

Infinite loop

funct a
    b
end
funct b
    a
end
a

Header for different languages

Here.

Categories