DEV Community

Ryan Bae
Ryan Bae

Posted on

My New Language That’s Almost Done

I’ve been building a programming language for the past 3 months. Although it’s written in Swift, I’m planning to convert my Swift project to Rust. Here are the current specs:

  • Can declare variables, constants, and functions
  • Has type safety (no type inference)
  • Has a “pointer” system for references, but is still broken. This is NOT pointers from C, just pointers pointing to variables
  • Can declare structs

Sample code:

struct Foo {
  var x: number = 5
  fn test() => void {
    *self.x = 6
  }
  fn printIt() => void {
    print(*self.x)
  }
}

var foo: Foo = create Foo()
foo.test()
foo.printIt() // prints 6
Enter fullscreen mode Exit fullscreen mode

GitHub link (don’t mind the username): https://github.com/Promiuns/Helix

Top comments (0)