Prerequisites
Before installing Elara, ensure you have the following:Java Runtime Environment (JRE)
Elara compiles to JVM bytecode, so you’ll need a Java runtime to execute compiled programs.- Java 8 or higher is required
- You can verify your Java installation by running:
Build tools
To build Elara from source, you’ll need:- GHC (Glasgow Haskell Compiler) - Version 9.4 or higher recommended
- Cabal - Haskell’s build tool (version 3.0 or higher)
- Git - For cloning the repository
Building from source
Elara is currently distributed as source code. Follow these steps to build the compiler:Build the compiler
Use Cabal to build the Elara compiler:This will download dependencies and compile the Elara compiler. The first build may take several minutes.
Build the Java standard library
Elara requires a Java standard library to be compiled before running programs:
You’ll need to rebuild the standard library whenever you pull updates that modify these files.
Verify installation
To verify your installation is working correctly:build- Compile an Elara programrun- Compile and run an Elara program
Optional: Install globally
For convenience, you can install the Elara executable globally:elara binary to ~/.cabal/bin/. Make sure this directory is in your PATH:
~/.bashrc, ~/.zshrc, etc.) to make it permanent.
Once installed globally, you can run:
Troubleshooting
Build fails with dependency errors
If the build fails due to missing dependencies, try updating your package index:Java standard library errors
If you encounter errors about missing Java classes at runtime:- Ensure you’ve compiled the Java standard library (Step 3 above)
- Check that you’re running programs from the root directory of the Elara repository
- Verify the
jvm-stdlibdirectory contains.classfiles
GHC version issues
Elara requires GHC 9.4 or higher. If you have an older version:Next steps
Now that you have Elara installed, you’re ready to write your first program!Quickstart guide
Learn how to create and run your first Elara program