Skip to content

Hylo

A Systems Programming Language
All in on Value Semantics and Generic Programming

Join the Hylo Community

Connect with developers and contributors

Compiler

  • Compilation using LLVM
  • Novel techniques for compiling generics with coherence
  • Caching and serialization of the compiler’s program state
  • C interop research
Who Owns the Contents of a Doubly-Linked List?PDFDimi Racordon2025-09
High-Fidelity C Interoperability in HyloPDFAmbrus Tóth2025-06
Debugging HyloPDFTudor-Stefan Magirescu2025-06
On the State of Coherence in the Land of Type ClassesPDFDimi Racordon, Eugene Flessele, Cao Nguyen Pham2025-02
Method BundlesDimi Racordon, Dave Abrahams2024-10
Type Checking with Rewriting RulesDimi Racordon2024-10
Use Site Checking Considered HarmfulDimi Racordon, Benjamin Chung2024-10
Borrow checking HyloPDFDimi Racordon, Dave Abrahams2023-10
The Val Object ModelPDFDave Abrahams, Sean Parent, Dimi Racordon, David Sankel2022-10
Existentialize Your GenericsPDFDimi Racordon, Matt Bovel, Hamza Remmal2022-06
Implementation Strategies for Mutable Value SemanticsPDFDimi Racordon, Denys Shabalin, Daniel Zheng, Dave Abrahams, Brennan Saeta2022
Toward a Lingua Franca for Memory SafetyPDFDimi Racordon, Aurélien Coet, Didier Buchs2022
Native Implementation of Mutable Value SemanticsPDFDimi Racordon, Denys Shabalin, Daniel Zheng, Dave Abrahams, Brennan Saeta2021-06
A Formal Definition of Swift's Value SemanticsPDFDimi Racordon2020-11

Are you interested in research collaboration — as a student, professor, or independent contributor? Learn about our open research topics, or suggest a new topic!

 Concurrency HylomorphismLucian Radu TeodorescuACCU2024-07
 Keynote Hylo: The Safe Systems and Generic-programming Language Built on Value SemanticsDave AbrahamsC++ on Sea2024-07
  HyloDoc: A Documentation Compiler for HyloAmbrus TóthC++ on Sea2024-06
 Borrow checking HyloDimi RacordonIWACO2023-05
 Concurrency Approaches: Past, Present, and FutureLucian Radu TeodorescuACCU2023-04
 Val: A Safe Language to Interoperate with C++Dimi RacordonCppCon2022-09
 Value Semantics: Safety, Independence, Projection, & Future of ProgrammingDave AbrahamsCppCon2022-09
  An Object Model for Safety and Efficiency by DefinitionDave AbrahamsCppNorth2022-07
 Keynote A Future of Value Semantics and Generic Programming Part 1Dave AbrahamsC++Now2022-05
 Keynote A Future of Value Semantics and Generic Programming Part 2Dave Abrahams, Dimi RacordonC++Now2022-05
 Structured ConcurrencyLucian Radu TeodorescuACCU2022-04
Rust & Safety at Adobe with Sean ParentSean ParentADSP #1602023-12-15
Sean Parent on Hylo! (Part 2)Sean ParentADSP #1382023-07-14
Sean Parent on Hylo (vs Rust)!Sean ParentADSP #1372023-07-07
Val and Mutable Value SemanticsDimi RacordonCppCast #3522023-01-20

Even though the compiler and standard library are still in their early stages, we can already show some advanced examples of Hylo code that you can try out on Compiler Explorer.

https://godbolt.org/z/Mzz17c5z1

Geometry.hylo
/// The orientation of a 2D vector.
public type Angle: Deinitializable {
/// The value of `self` in radians.
public var radians: Float64
/// Creates an instance with its value in radians.
public memberwise init
/// Creates an instance with its value in degrees.
public init(degrees: Float64) {
&self.radians = degrees * Float64.pi() / 180.0
}
/// The value of `self` in degrees.
public property degrees: Float64 {
let { radians * 180.0 / Float64.pi() }
inout {
var d = radians * 180.0 / Float64.pi()
yield &d
&self.radians = d * Float64.pi() / 180.0
}
}
}
public fun main() {
var a = Angle(radians: .pi())
inout d = &a.degrees
precondition(d == 180.0)
&d = 0.0
precondition(a.radians == 0.0)
}

Sink Methods - Capability for Deinitializing

Section titled “Sink Methods - Capability for Deinitializing”

https://godbolt.org/z/cY7T5jPEc

SinkMethods.hylo
/// A computer that must be explicitly shut down using a sink method.
type Computer {
public var ram: String
public memberwise init
public fun shutdown() sink -> Void {
print("Key received, shutting down... Memory contents was: ")
print(self.ram)
/// Sinking all parts
_ = self.ram
}
}
fun test1() {
var computer = Computer(ram: "Important data")
} Cannot deinit `computer`
fun test2() {
var computer = Computer(ram: "Important data")
if random_bool() {
computer.shutdown()
}
} Cannot deinit `computer` [when `if` not entered]
fun test3() {
var computer = Computer(ram: "Important data")
while random_bool() {
computer.shutdown() Use of consumed object [after first iteration]
}
} Cannot deinit `computer` [when `while` not entered]
fun random_bool() -> Bool {
return false // Generated using a fair dice roll % 2.
}
CustomMove.hylo
type A: Deinitializable {
public var witness: Int
public var x: Int
public init(x: sink Int) {
&self.x = x
&self.witness = 0
}
}
conformance A: Movable {
public fun take_value(from source: sink Self) {
set {
&self.x = source.x
&self.witness = 0
}
inout {
&self.x = source.x
&self.witness += 1
}
}
}
public fun main() {
var s = A(x: 1)
&s = A(x: 2)
&s = A(x: 2)
precondition(s.x == 2)
precondition(s.witness == 2)
}

See more examples in the compiler test suite.