Home

Awesome

<p align="center"> <img width="200" height="200" src="./logo.svg" alt="gnet"> <br /> <br /> <a title="Go Report Card" target="_blank" href="https://goreportcard.com/report/github.com/ImVexed/muon"><img src="https://goreportcard.com/badge/github.com/ImVexed/muon?style=flat-square"></a> <img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/ImVexed/muon?style=flat-square"> <br/> <a target="_blank" href="https://gowalker.org/github.com/ImVexed/muon"><img src="https://img.shields.io/badge/api-reference-blue.svg?style=flat-square"></a> </p>

Muon is a lightweight alternative to Electron written in Golang in about ~300 LoC, using Ultralight instead of Chromium. Ultralight is a cross-platform WebKit rewrite using the GPU to target embedded desktop applications that resulted in a fast, lightweight, and low-memory HTML UI solution that blends the power of Chromium with the small footprint of Native UI.

Features

Comparison with a "Hello, World!" React App

MuonElectron
CPU0.0%1.2%
MEM26.0 MB201.7 MB
DISK42 MB136 MB

Example

From examples/create-react-app/main.go:

package main

import (
  "github.com/ImVexed/muon"

  "cra-go/webfiles"
  "net/http"
)

func main() {
  // Any static asset packer of your liking (ex. fileb0x)
  fileHandler := http.FileServer(webfiles.HTTP)

  cfg := &muon.Config{
    Title:      "Hello, World!",
    Height:     500,
    Width:      500,
    Titled:     true,
    Resizeable: true,
  }

  m := muon.New(cfg, fileHandler)

  // Expose our `add` function to the JS runtime
  m.Bind("add", add)

  // Show the Window and start the Runtime
  if err := m.Start(); err != nil {
    panic(err)
  }
}

// Muon automatically handles interop to and from the JS runtime
func add(a float64, b float64) float64 {
  return a + b
}

FAQ

Q: How are JS types translated to Go types?

Q: How do I setup Ultralight?

Q: Is there perfect Chrome or Firefox feature parity?

Q: How do I get rid of the Console on Windows?

Q: I get exit status 3221225781

Q: I get libWebCore.so: cannot open shared object file

Q: I get symbol not found: ulCreateSettings

Q: How do I compile for x86?

Licensing

While muon itself is MIT licensed, Ultralight is not.

Ultralight is free for non-commercial use, educational use, 
and also free for commercial use by small indie developers making
less than US$100,000 a year. You can find full terms in the SDK. 
Pricing plans for larger commercial projects will be announced later.

Their specific license terms can be found here.