{"id":13871882,"url":"https://github.com/hylo-lang/hylo","last_synced_at":"2025-05-14T15:09:00.070Z","repository":{"id":40519629,"uuid":"332354429","full_name":"hylo-lang/hylo","owner":"hylo-lang","description":"The Hylo programming language","archived":false,"fork":false,"pushed_at":"2025-05-08T18:34:14.000Z","size":11848,"stargazers_count":1341,"open_issues_count":209,"forks_count":58,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-05-08T19:39:49.754Z","etag":null,"topics":["programming-language"],"latest_commit_sha":null,"homepage":"https://www.hylo-lang.org","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hylo-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-24T02:53:28.000Z","updated_at":"2025-05-06T23:33:21.000Z","dependencies_parsed_at":"2024-02-26T22:31:35.311Z","dependency_job_id":"5d11d662-4cbd-4541-9958-910dd5c023e1","html_url":"https://github.com/hylo-lang/hylo","commit_stats":{"total_commits":5421,"total_committers":27,"mean_commits":"200.77777777777777","dds":"0.19535141117874932","last_synced_commit":"f88d5ac17f372e99972df7f175a937268845ed8d"},"previous_names":["hylo-lang/hylo"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fhylo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fhylo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fhylo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hylo-lang%2Fhylo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hylo-lang","download_url":"https://codeload.github.com/hylo-lang/hylo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169856,"owners_count":22026215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["programming-language"],"created_at":"2024-08-05T23:00:29.312Z","updated_at":"2025-05-14T15:09:00.029Z","avatar_url":"https://github.com/hylo-lang.png","language":"Swift","funding_links":[],"categories":["By Language","Swift"],"sub_categories":["Swift"],"readme":"# Hylo (formerly Val)\n\n\n[![codecov](https://codecov.io/gh/hylo-lang/hylo/graph/badge.svg?token=YF1Q8W88VN)](https://codecov.io/gh/hylo-lang/hylo)\n\nHylo is a programming language that leverages [mutable value semantics](Docs/ImplementationStrategiesForMutableValueSemantics.pdf) and [generic programming](https://fm2gp.com) for high-level systems programming.\n\nThis repository contains the sources of the reference implementation of Hylo.\nPlease visit our **[website](https://hylo-lang.org)** to get more information about the language itself.\n\n## Developement/Use Requirements\n\nThis project is written in [Swift](https://swift.org) and distributed in the form of a package, built with [Swift Package Manager](https://swift.org/package-manager/).\nYou will need Swift 5.9 or higher to build the compiler from sources.\n\n**This repository contains\n[submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules)**,\nso after cloning, issue `git submodule update --init` to populate\nthem.\n\n**Windows users:** this repository contains symbolic links, so you'll\nneed to [enable support](https://stackoverflow.com/a/59761201/125349)\nfor them before checking it out.\n\n### LLVM\n\nThis package requires LLVM 17.  Major versions of LLVM are not\ninterchangeable or backward-compatible.\n\nIf you are using this package for development we strongly recommend\nthe use of an LLVM with assertions enabled such as\n[these](https://github.com/hylo-lang/llvm-build); otherwise it's much\ntoo easy to violate LLVM's preconditions without knowing it.  This\npackage's devcontainer (in the `.devcontainer` subdirectory) has an\nassert-enabled LLVM build preinstalled in\n`/opt/llvm-MinSizeRel`. Instructions to install a debug build are in a\ncomment in `.devcontainer/Dockerfile`.\n\n*If* you want to build with the Swift Package Manager and you choose\nto get LLVM some other way, you'll need an installation with an\n`llvm-config` executable, which we will use to create a `pkg-config`\nfile for LLVM.\n\n## Building with CMake and Ninja\n\n1. **Configure**: choose a *build-directory* and a CMake *build type*\n   (usually `Debug` or `Release`) and then, where `\u003cLLVM\u003e` is the path\n   to the root directory of your LLVM installation,\n\n\t```\n\tcmake -D CMAKE_BUILD_TYPE=\u003cbuild-type\u003e \\\n\t  -D LLVM_DIR=\u003cLLVM\u003e/lib/cmake/llvm   \\\n      -G Ninja -S . -B \u003cbuild-directory\u003e\n    ```\n\n    (on Windows substitute your shell's line continuation character\n    for `\\` or just remove the line breaks and backslashes).\n    \n    If you want to run tests, add `-DBUILD_TESTING=1`.\n    \n    **Note:** on macOS, if you are not using your Xcode's default\n    toolchain, [you may need `-D\n    CMAKE_Swift_COMPILER=swiftc`](https://gitlab.kitware.com/cmake/cmake/-/issues/25750)\n    to prevent CMake from using Xcode's default `swift`.\n    \n    If this command fails it could be because you have an LLVM without\n    CMake support installed; we suggest you try one of\n    [these](https://github.com/hylo-lang/llvm-build) packages instead.\n\n2.  **Build**: \n\n    ```\n    cmake --build \u003cbuild-directory\u003e\n    ```\n\n3. **Test** (requires `-DBUILD_TESTING=1` in step 1):\n\n   ```\n   ctest --parallel --test-dir \u003cbuild-directory\u003e\n   ```\n\n## Building with CMake and Xcode\n\nYou will need CMake 3.3.0-rc1 or newer.\n\n1. **Generate Xcode project**: choose a *build-directory* and then,\n   where `\u003cLLVM\u003e` is the path to the root directory of your LLVM\n   installation,\n\n    ```\n    cmake -D LLVM_DIR=\u003cLLVM\u003e/lib/cmake/llvm \\\n      -G Xcode -S . -B \u003cbuild-directory\u003e\n    ```\n\n    If you want to run tests, add `-DBUILD_TESTING=1`.\n\n2. **Profit**: open the `.xcodeproj` file in the *build-directory* and\n   use Xcode's UI to build and test.\n\n## Building with Swift Package Manager\n\n**Windows Users:** Swift Package Manager is poorly supported on\nWindows and we've been seeing a number of tests act flaky on Windows\nonly when run under Swift Package Manager.  We strongly recommend\n[using CMake](#building-with-cmake-and-ninja) instead.\n\n**Everyone:** Swift Package Manager is poorly supported in general and\nwe're considering dropping our use of it, so think about [using CMake\nwith ninja](#building-with-cmake-and-ninja) or [with\nXcode](#building-with-cmake-and-xcode) instead.\n\nFirst, you need to create a `pkgconfig` file specific to your\ninstallation and make it visible to your build tools.  We use a `bash`\nscript as follows in the top-level directory of this project:\n\n```bash\n./Tools/make-pkgconfig.sh ./llvm.pc\n``` \n\nif you are on Windows, your `git` installation (which is required for\nSwift) contains a `bash` executable so you can do something like:\n\n```bash\nC:\\Program Files\\Git\\bin\\bash ./Tools/make-pkgconfig.sh ./llvm.pc\n``` \n\nThe command above generates `llvm.pc` in the current directory and\nprints its contents to the terminal.  You can either add its directory\nto your `PKG_CONFIG_PATH` environment variable for use with\ncommand-line tools:\n\n```bash\nexport PKG_CONFIG_PATH=$PWD\n```\n\nor you can put it somewhere that `pkg_config` already searches (needed\nfor use with Xcode):\n\n```bash\nsudo mkdir -p /usr/local/lib/pkgconfig \u0026\u0026 sudo mv llvm.pc /usr/local/lib/pkgconfig/\n```\n\nOnce `llvm.pc` is set up, you should be able to **build this project**\nusing Swift package manager:\n\n```bash\nswift build -c release\n```\n\nThat command will create an executable named `hc` in `.build/release`.\nThat's Hylo's compiler!\n\nTo test your compiler,\n\n```bash\nswift test -c release --parallel\n```\n\n#### Notes to macOS users:\n\n1. Add `platforms: [.macOS(\"xxx\")]` to `Package.swift` where `xxx` is\n   your macOS version to address the warning complaining that an\n   \"object file was built for newer macOS version than being linked\".\n2. You may need to add the path to `zstd` library in `llvm.pc`.\n\n### Building a Hylo Devcontainer with VSCode\n\nWhile Hylo supports Linux natively, it also provides a [Devcontainer](https://containers.dev/) specification to develop for Linux on other platforms through a Docker container. Our [Linux CI](.github/workflows/build-and-test.yml) uses this specification; this makes it possible to run Linux CI locally on other operating systems like macOS. While this specification should work for any IDE that supports devcontainers, keep in mind this team only uses VSCode.\n\nWhen opening the Hylo project in VSCode for the first time, you should be prompted to install the extension `recommendations` in `.vscode/extensions.json`. If you are not prompted, manually install the extensions by searching for the extension identifiers in the Extensions Marketplace.\n\nThen, build the Devcontainer with the VSCode command: `\u003e Dev Containers: Rebuild and Reopen in Container`.\n\nFinally, open a new integrated terminal in VSCode and confirm that the shell user is `vscode`. You can run `whoami` to check this.\n\nThat integrated terminal is connected to the Devcontainer, as if by ssh.  \nYou can now follow the instructions for Building and testing [with CMake and Ninja](#building_with_ cmake_and_ninja) or [with Swift Package Manager](#building_with_swift_package_manager).\nAll prerequisites, including the `llvm.pc` file in the default `PKG_CONFIG_PATH`, are preinstalled.\n\nThe Hylo repository files are mounted into the container, so any changes made locally (in VSCode or in other editors) will be automatically propagated into the Devcontainer. However, if you need to modify any of the files in the `.devcontainer` directory, you will need to rebuild the container with `\u003e Dev Containers: Rebuild and Reopen in Container`.\n\n### Submitting issues\n\nFor submitting issue reports you need to manually update the Hylo version.\nWithout this step, ``hc --version`` returns ``unknown``.\n\n```bash\n./Tools/set-hc-version.sh\n```\n\n## Implementation status\n\nThis project is under active development; expect things to break and APIs to change.\n\nThe compiler pipeline is organized as below.\nYou can select how deep the compiler should go through the pipeline with the following options:\n- `--emit raw-ast`: Only parse the input files and output an untyped AST as a JSON file.\n- `--typecheck`: Run the type checker on the input.\n- `--emit raw-ir`: Lower the typed AST into Hylo IR and output the result in a file.\n- `--emit ir`: Run mandatory IR passes and output the result in a file.\n- `--emit llvm`: Transpile the program to LLVM and output LLVM IR.\n- `--emit intel-asm`: Output Intel assembly for all user module(s).\n- `--emit binary` (default): Produce an executable.\n\nFor example, `hc --emit raw-ast -o main.json main.hylo` will parse `main.hylo`, write the untyped AST in `main.json`, and exit the pipeline.\n\nA more detailed description of the current implementation status is available on our [roadmap page](https://www.hylo-lang.org/pages/implementation-status.html).\n\n## Contributing\n\nWe welcome contributions to Hylo.\nPlease read through [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to get started.\n\nYou can also get in touch with the community by joining our [Slack][join-slack] or one of our [Zoom Meetings][join-zoom]\n(ID: 633 2146 3694, Passcode: 409180) on Tuesdays and Thursdays, 13:00-13:30 Pacific time or 22:00-22:30 Central\nEuropean time.\n\n[join-slack]: https://join.slack.com/t/val-qs97696/shared_invite/zt-1z3dsblrq-y4qXfEE6wr6uMEJSN9uFyg\n[join-zoom]: https://unige.zoom.us/j/63321463694?pwd=L0VuY3QwUEx5K3BaRWIyMjArdkhEQT09\n\n## License\n\nHylo is distributed under the terms of the Apache-2.0 license.\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhylo-lang%2Fhylo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhylo-lang%2Fhylo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhylo-lang%2Fhylo/lists"}