Initial Setup
DFHDL is a domain specific language (DSL) library written in the Scala programming language (Scala 3.5), and as such it lets you utilize the entire Scala ecosystem, including IDEs, various tools, and other libraries.
Is your system already fit for Scala development? Jump to the DFHDL hello-world section
Installing Scala and Other Dependencies
We recommend directly installing Scala 3.5 (no need to install either Coursier, Scala CLI, or sbt):
-
Windows Instructions
Run the following in Windows command or powershell:
choco install scala --version=3.5.0
-
Linux Instructions
Run the following in your shell:
sdk install scala 3.5.0
-
macOS Instructions
Run the following in your shell:
brew update brew install scala
-
Other OS/Instructions
If for some reason the instructions above don't work for you, you can try to install Scala via Coursier using the information below.
Installing Scala via Coursier
We recommend directly installing Scala, as instructed above. However, if you are experiencing issues, you can try installing Scala via Coursier, as follows:
-
Windows Instructions
-
Download the installer zip file.
-
Open the zip.
-
Double click the
cs-x86_64-pc-win32.exe
executable to extract and run Coursier setup.
Run the following in Windows command:
curl -fLo cs-x86_64-pc-win32.zip https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip tar -xf cs-x86_64-pc-win32.zip move cs-x86_64-pc-win32.exe cs.exe .\cs setup
Run the following in Windows Powershell:
Invoke-WebRequest -Uri "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip" -OutFile "cs-x86_64-pc-win32.zip" Expand-Archive -Path "cs-x86_64-pc-win32.zip" Rename-Item -Path "cs-x86_64-pc-win32.exe" -NewName "cs.exe" Remove-Item -Path "cs-x86_64-pc-win32.zip" .\cs setup
-
-
Linux Instructions
Run the following in your shell:
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > cs chmod +x cs ./cs setup
Run the following in your shell:
curl -fL "https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-pc-linux.gz" | gzip -d > cs chmod +x cs ./cs setup
-
macOS Instructions
Run the following in your shell:
brew install coursier/formulas/coursier cs setup
Run the following in your shell:
curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-apple-darwin.gz | gzip -d > cs chmod +x cs ./cs setup
Run the following in your shell:
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-apple-darwin.gz | gzip -d > cs chmod +x cs ./cs setup
-
Other OS/Instructions
For other OS or instructions please consult the Coursier website.
IDE Setup
Many IDEs support Scala development. The most popular are VS Code and IntelliJ IDEA. We recommend VS Code with the Metals plugin.
Here is a summary of relevant IDEs:
-
VS Code (Recommended)
-
IntelliJ IDEA
-
Vim
-
Sublime Text
-
Emacs
-
Other IDE/Instructions
For other OS or instructions please consult the Metals website.