PostsBlogReposAbout
Samuel1 Dec 2023
I can thoroughly recommend making your own programming language
func fib_2(a: int, b: int, max: int) {
  print(str(a))
  if (b <= max) {
    let sum = a + b
    fib_2(b, sum, max)
  }
}

func fib(max: int) {
  fib_2(0, 1, max)
}

func pow(num: int, to: int): int {
  if (to > 0) {
    return num * pow(num, to - 1)
  } else {
    return 1
  }
}func main() {
  let chan = make() :: channel string
  spawn(server, chan)
  spawn(client, chan, "hello")
  spawn(client, chan, "world")
}

func server(chan: channel string) {
  let message: string = recv(chan)
  print(message)
  server(chan)
}

func client(chan: channel string, message: string) {
  send(chan, message)
}
Samuel@samuel.fm· 1 Dec 2023
oh, my own conlang ofc lmao. I would probably have to add lists to it first tho lol github.com/mozzius/lyre
GitHub - mozzius/lyre: a typed, functional, concurrent programming language
a typed, functional, concurrent programming language - GitHub - mozzius/lyre: a typed, functional, concurrent programming language
github.com
2 7
Comfortably Numb1 Dec 2023
I ain't going near ANTLR any time soon.
1 1
Samuel
@samuel.fm
this one was good ol' Yacc
1 2
1 December 2023 at 4:43 pmView on Bluesky