Note, the Hylo compiler is in an early phase of development, so expect things to break. If you noitce issues, please submit either for the Hylo compiler or for the VSCode extension. if it's a known issue by searching for it.
If you want to get involved with developing Hylo, please reach out via Slack.
Setting Up Your Environment
First-Time Setup
- Install the Hylo Compiler
- Install the Extension
- Install this extension. If you are working inside the Hylo devcontainer, it should be installed automatically.
- Set Up Compilation Using Command Template (Recommended):
- Open VSCode Settings (
Ctrl+,
or File > Preferences > Settings
)
- Search for "Hylo"
- Enable hylo.useCommandTemplate
- Configure hylo.commandTemplate
to match your setup. For example:
- Default:
hc ${ARGS}
(assumes the compiler is in your PATH)
- Example with Swift:
swift run hc ${ARGS}
- Alternative: Configure the Compiler Path:
- If you have built the compiler and prefer direct usage:
- Open VSCode Settings (
Ctrl+,
or File > Preferences > Settings
)
- Search for "Hylo"
- Set
hylo.compilerPath
to the path of your Hylo compiler
- Example with absolute path:
C:\hylo\bin\hc
or /usr/local/bin/hc
Project Configuration
Create a .vscode/launch.json
or add it using the Debug: Add configuration
action.
{
"version": "0.2.0",
"configurations": [
{
"type": "hylo",
"request": "launch",
"name": "Run Hylo Module",
"program": "${workspaceFolder}/MyHyloModule",
"isFolder": true
},
{
"type": "hylo",
"request": "launch",
"name": "Run Hylo File",
"program": "${workspaceFolder}/main.hylo"
}
]
}
Common Workflows
Single-File Development
Perfect for learning Hylo or creating small examples:
- Create a new file with
.hylo
extension
- Write your Hylo code
- Run it directly with:
- The play button in the editor title area
- Right-click → "Hylo: Run Current File"
Ctrl+Shift+P
→ "Hylo: Run Current File"
Example workflow for a "Hello World" program:
- Create
hello.hylo
:
fun main() {
print("Hello, Hylo!")
}
- Click the play button in the editor title
- See output in the "Hylo" output panel
Multi-File Projects
For more complex projects with multiple Hylo files:
- Organize your files into folders
- Right-click on a folder → "Hylo: Compile and Run Folder"
- Or set up a launch configuration for consistent debugging:
{
"type": "hylo",
"request": "launch",
"name": "Run Project",
"program": "${workspaceFolder}/src",
"isFolder": true
}
Custom Compiler Path
{
"type": "hylo",
"request": "launch",
"name": "Debug with Development Compiler",
"program": "${file}",
"compilerPath": "${workspaceFolder}/dev-tools/hc"
}
Further Help
The language and this extension are in very early in their development. If you encounter any issues:
- Check the GitHub repository for updates
- File issues for bugs or feature requests
- Consult the Hylo language documentation for language-specific questions