Skip to content

Latest commit

 

History

History
69 lines (56 loc) · 2.19 KB

notes.md

File metadata and controls

69 lines (56 loc) · 2.19 KB

Notes for contributors

Following is some notes that are intended for potential project contributors, to understand the architecture and design motives of the language and the compiler.

Why go?

Fun is a functional programming language, but why is it compiled to Golang, and embracing the Golang ecosystem?

If Fun is a toy language, it could target at any runtimes, and there are lots of options. But Fun is ambitious to be a real industrial language, then multiple factors need to be considered. Popular options are listed below.

Option Pros Cons Example
Mainstream virtual machine like JVM or .Net
  • Mature ecosystem
  • Easy to implement
Heavy dependency on the VM Scala, F#
Create the language's own runtime Tailored environment is flexible
  • High bar on implementation cost
  • Have to recreate the whole ecosystem
Haskell, Ocaml

Fun wants to have the benefits of VM without writing a VM, so we are experimenting a new way: compiling to Golang. Note that transpiling to another language is not new, the GHC compiler also compiles to C.

Compared to C, Golang has all the tooling and features of a modern programming language, eg.

  • Build system and module manager
  • Garbage collector
  • Green thread (go routine)

That's why we chose Golang as the target platform.

Components

Roadmap