crly-lang

Crly Programming Language

Not wanting to write a full-blown compiler, I decided to use the Crystal Language as my implementation language. I also, at the time of creating this, did not want to write a bunch of code editor syntax hilighting for Crly, so it looks a lot like Swift (which I do like a lot).

class Person {

    static var population = 0

    var name : String

    func initialize(name : String) {
        self.name = name
        Person.population++
    }

    func greet() {
        print("Hello! My name is #{self.name}")
    }
}

let people = [] of Person
let names = [
    "Matthias",
    "Drew",
    "Remington",
    "Michaela",
    "Iain",
    "Sophi"
    ]

for name in names {
    people << Person.new(name)
}

for person in people {
    person.greet()
}

print(Person.population)

Owner
github statistic
  • 0
  • 0
  • 0
  • 0
  • 8 months ago
  • October 27, 2019
License

MIT License

Links
Synced at

Tue, 07 Jul 2020 13:53:39 GMT