Getting Started with Fer
This document provides instructions on how to build, install, and run the Fer programming language interpreter on your machine.
Fer is just a language I made for the purpose of learning.
Prerequisites
Before building Fer, ensure the following software is installed on your system:
- C Compiler: A compiler supporting C17 or later.
- Windows: MinGW-w64 or Microsoft Visual C++ (part of Visual Studio).
- macOS: Clang (installed via Xcode Command Line Tools:
xcode-select --install).
- Linux: GCC or Clang (
sudo apt install build-essential on Ubuntu/Debian).
- CMake: Version 3.17 or higher.
Building from Source
Fer is distributed as source code and must be compiled. Follow these steps for your operating system.
1. Clone the Repository
Open your terminal or command prompt and run:
git clone https://github.com/Franco030/FERProject
cd fer-language
On macOS and Linux:
mkdir build
cd build
cmake ..
make
On Windows (PowerShell or CMD):
mkdir build
cd build
cmake ..
cmake --build . --config Release
or
gcc *.c -o cfer.exe
Note: If using MinGW on Windows, you may need to run cmake -G "MinGW Makefiles" .. followed by mingw32-make.
3. Verify Installation
After a successful build, an executable file named cfer (or cfer.exe on Windows) will be created in the build directory. Verify it works by running:
./cfer
This should start the interactive Fer REPL. Press Ctrl+C to exit.
System-Wide Installation (Optional)
To run Fer from any directory without typing the full path to the executable, add the binary to your system's PATH.
macOS / Linux
You can create a symbolic link to the executable in a generic binary folder:
sudo ln -s /path/to/fer-language/build/cfer /usr/local/bin/fer
Now you can run fer from anywhere.
Windows
- Search for "Edit the system environment variables" in the Start menu.
- Click "Environment Variables".
- Under "System variables", find the
Path variable and click "Edit".
- Click "New" and paste the full path to your
fer-language\build\Debug (or Release) folder where cfer.exe is located.
- Click OK to save. Restart your terminal.
Running Fer Programs
There are two ways to use the Fer interpreter:
1. Interactive Mode (REPL)
Run the interpreter without arguments to enter interactive mode. This is useful for testing small snippets of code.
fer
> print "Hello";
Hello
2. Script Execution
To run a Fer script file (conventionally ending in .fer), pass the file path as an argument:
fer path/to/script.fer
IDE Support
For the best development experience, use Visual Studio Code.
- Open the
fer-vscode folder included in this repository.
- Press
F5 to launch a new VS Code window with Fer support enabled.
- This extension provides syntax highlighting, snippets, and integrated execution.
To configure the "Run" button in the extension:
- Go to File > Preferences > Settings in VS Code.
- Search for Fer.
- Set the Executable Path to the location of your compiled
cfer binary.