GPU based Electron on a diet

Overview

gnet

GitHub code size in bytes


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

  • Full JS to Go interop
  • GPU based rendering
  • Cross-platform
  • Hot-reloading
  • Superior disk size + memory & cpu usage

Comparison with a "Hello, World!" React App

Muon Electron
CPU 0.0% 1.2%
MEM 26.0 MB 201.7 MB
DISK 42 MB 136 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?

  • JS: Boolean Go: bool
  • JS: Number Go: float64
  • JS: String Go: string
  • JS: Object Go: struct via JSON

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?

  • Add -ldflags -H=windowsgui to either your go build or go run to get rid of the window.

Q: I get exit status 3221225781

  • Your program likely can't find the Ultralight libraries. Ensure they're either installed on the system, or, in the same folder as your program. Currently, Muon uses the 1.1 Ultralight pre-release that hasn't yet propagated to their main site and can only be downloaded from the Ultralight github repo.

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

  • If you're attempting to load the libraries out of the same directory as your program add -ldflags "-r ." to your go build to set rpath to the local directory for library resolution.

Q: I get symbol not found: ulCreateSettings

  • This likely means you're not using the 1.1 Ultralight pre-release which can be downloaded only from their GitHub Repo for now

Q: How do I compile for x86?

  • Currently, Ultralight only supports Windows for x86. Ensure you have a 32-bit gcc in your path, and ensure you have CGO_ENABLED=1 and GOARCH=386 environment variables set.

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.

Issues
  • Error while loading Ultralight libraries

    Error while loading Ultralight libraries

    Hi,

    I've been following the steps in your "Getting Started with Muon" guide but cannot run the binary at the end. I get the following error:

    $ ./cra-go
    ./cra-go: error while loading shared libraries: libWebCore.so: cannot open shared object file: No such file or directory
    

    I assume this means it cannot find the Ultralight libraries in the current directory. However, they are present.

    $ pwd
    /home/me/muon/examples/create-react-app
    
    $ ls
    b0x.yml  cra-go  go.mod  go.sum  libAppCore.so  libUltralightCore.so  libUltralight.so  libWebCore.so  main.go  public  README.md  webfiles
    

    Any help would be greatly appreciated. Thanks!

    opened by izolate 11
  • Building the example app fails

    Building the example app fails

    Please see this dockerfile i am using to try and build the example app:

    FROM ubuntu:18.04
    
    WORKDIR /build
    
    RUN apt update && \
    apt install -y \
      git \
      npm \
      yarn \
      curl \
      tree \
      p7zip-full \
      && \
    curl -fsL https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz |\
      tar xz -C /usr/local && \
    ln -sf /usr/local/go/bin/* /usr/local/bin/ && \
    npm install --global yarn && \
    go get -v github.com/UnnoTed/fileb0x && \
    ln -s /root/go/bin/fileb0x /usr/local/bin/
    
    RUN cd /build && \
    mkdir ultralight && \
    cd ultralight && \
    curl -fsL https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-latest-linux-x64.7z > ultralight.7z && \
    7z x ultralight.7z && \
    pwd && \
    ls -lsha
    
    RUN git clone https://github.com/ImVexed/muon /build/muon && \
    cd /build/muon/examples/create-react-app/public && \
    yarn && \
    yarn build
    
    RUN cd /build/muon/examples/create-react-app/ && \
    fileb0x b0x.yml && \
    go mod download && \
    go build
    

    ^ the last RUN step here fails.

    here is the error:

    Step 8/8 : RUN cd /build/muon/examples/create-react-app/ && go build
     ---> Running in 5dad7c9d5bc7
    # github.com/ImVexed/muon/ultralight
    /usr/bin/ld: warning: libfontconfig.so.1, needed by /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so, not found (try using -rpath or -rpath-link)
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcDefaultSubstitute'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcConfigCreate'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternDestroy'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcLangSetHasLang'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternAddLangSet'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcLangSetDestroy'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternRemove'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcConfigDestroy'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternCreate'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcFontSetAdd'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcFontSetCreate'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternAddString'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcFontSetMatch'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcFontMatch'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternGet'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternAddBool'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternFilter'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcObjectSetBuild'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternGetLangSet'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcObjectSetDestroy'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternAddInteger'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcInit'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternFormat'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcLangSetAdd'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcConfigSubstitute'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcLangSetCreate'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternGetString'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternDuplicate'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcFontSetDestroy'
    /root/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/libs/linux/x64/libUltralightCore.so: undefined reference to `FcPatternAddDouble'
    collect2: error: ld returned 1 exit status
    The command '/bin/sh -c cd /build/muon/examples/create-react-app/ && go build' returned a non-zero code: 2
    

    am i doing something wrong?

    opened by cbluth 7
  • failed to compile x86

    failed to compile x86

    My OS is win10 x64, want to build x86 app.

    Is that cross-compile issue?

    github.com/ImVexed/muon

    C:\Users\admin\go\pkg\mod\github.com!im!vexed\[email protected]\muon.go:11:2: imported and not used: "github.com/ImVexed/muon/ultralight" C:\Users\admin\go\pkg\mod\github.com!im!vexed\[email protected]\muon.go:16:12: undefined: ULWindow C:\Users\admin\go\pkg\mod\github.com!im!vexed\[email protected]\muon.go:17:12: undefined: ULOverlay C:\Users\admin\go\pkg\mod\github.com!im!vexed\[email protected]\muon.go:18:12: undefined: ULView C:\Users\admin\go\pkg\mod\github.com!im!vexed\[email protected]\muon.go:19:12: undefined: ULApp

    opened by lulucas 5
  • Install instructions for Ultralight are very vague.

    Install instructions for Ultralight are very vague.

    Hi,

    It would really benefit myself and others I believe if the instructions for installing and then building with ultralight for this project were more clear.

    A link to installation instructions for installing ultralight at the system level and instructions for just including the libraries as you mentioned, for example which files and where for the example app you have included.

    I am just trying to figure this out at the moment but not at all clear what I should be doing with Ultralight.

    Thanks

    opened by reefbarman 5
  • build cra-go: cannot load cra-go/webfiles: cannot find module providing package cra-go/webfiles

    build cra-go: cannot load cra-go/webfiles: cannot find module providing package cra-go/webfiles

    From following "getting started":

    $ git clone https://github.com/ImVexed/muon.git
    $ cd muon/examples/create-react-app/
    $ cd public/
    $ yarn
    $ yarn build
    $ cd ..
    $ go generate
    go: finding github.com/ImVexed/muon v0.0.0-20191009145610-caeea31ca3eb
    go: finding golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3
    go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
    go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
    go: finding golang.org/x/text v0.3.0
    go: downloading github.com/ImVexed/muon v0.0.0-20191009145610-caeea31ca3eb
    go: extracting github.com/ImVexed/muon v0.0.0-20191009145610-caeea31ca3eb
    main.go:1: running "fileb0x": exec: "fileb0x": executable file not found in $PATH
    $ go build
    build cra-go: cannot load cra-go/webfiles: cannot find module providing package cra-go/webfiles
    
    opened by brandonros 4
  • Licensing for Ultralight

    Licensing for Ultralight

    Ultralight says in it's readme that

    Ultralight is free for non-commercial use, and free for commercial use by small indies (<$100K annual revenue). For info regarding pricing/terms for larger commercial projects please email [email protected]

    That is not compatible with the MIT license chosen for this project as far as I can tell (IANAL), so this is probably something you should look at.

    opened by jcgruenhage 3
  • Window fails to draw when resizing

    Window fails to draw when resizing

    Your local environment?

    OS: Windows 10 Pro 64-bit Version 1903 (OS Build 18362.388) Muon: https://github.com/ImVexed/muon/commit/eb6e92adf177c6eaf7cd48842bc61fe7136196fa

    What is happening?

    Resizing the window causes the window to turn white until you stop resizing the window as show in the gif below

    What should happen?

    Resizing the window should smoothly scale the contents of the window

    Any logs, errors or screenshots?

    lml4l14cGL

    upstream 
    opened by puckzxz 3
  • dyld: lazy symbol binding failed: Symbol not found: _ulCreateSettings

    dyld: lazy symbol binding failed: Symbol not found: _ulCreateSettings

    running macos 10.14.5. I downloaded ultralight-sdk-1.0-mac-v2 and copied the dylibs in the example dir.

    then I built the example with:

    go generate && go build -ldflags "-r ."
    

    when running the binary, I get:

    dyld: lazy symbol binding failed: Symbol not found: _ulCreateSettings
      Referenced from: /Users/mkm/tmp/muon/examples/create-react-app/./cra-go
      Expected in: ./libAppCore.dylib
    
    dyld: Symbol not found: _ulCreateSettings
      Referenced from: /Users/mkm/tmp/muon/examples/create-react-app/./cra-go
      Expected in: ./libAppCore.dylib
    
    SIGABRT: abort
    PC=0xfafd38e m=0 sigcode=0
    
    goroutine 0 [idle]:
    
    opened by mkmik 2
  • Warning in order over proprietary Ultralight license

    Warning in order over proprietary Ultralight license

    I don't think it's wise to advertise an MIT license without clearly warning people that this wraps a a project with a proprietary license that is not compatible with open source. Making a mistake here could get a company in a lot of trouble and might feel dishonest, though I'm certain your intentions are great. I appreciate that you made the wrapper and hope to experiment with it myself!

    opened by PaluMacil 2
  • Copy paste

    Copy paste

    hi! is it possible to copy paste inside of the ultralight window? it seems like it's possible in ultralight, but i can't figure out a way to do it with muon (ctrl+c doesn't work). thanks!

    opened by spiralw 1
  • Failed to create pipeline state

    Failed to create pipeline state

    $ ./cra-go 
    2019-10-10 21:13:52.000 cra-go[45036:2667974] Failed to create pipeline state, error Error Domain=CompilerError Code=1 "Function fragmentShader is using language version 2.1 which is incompatible with this OS." UserInfo={NSLocalizedDescription=Function fragmentShader is using language version 2.1 which is incompatible with this OS.}
    
    $ uname -a
    Darwin Brandon-Ross-MacBook-Pro.local 17.7.0 Darwin Kernel Version 17.7.0: Sun Jun  2 20:31:42 PDT 2019; root:xnu-4570.71.46~1/RELEASE_X86_64 x86_64
    

    Mac 10.13.6

    Not sure if this is a you bug or the underlying library.

    opened by brandonros 1
  • Entrypoint

    Entrypoint "ulAppGetWindow" not found in cra-go.exe

    I'm trying to get create-react-app working on windows 11 by running build.bat script from the provided archive in the following directory structure:

    │   build.bat
    │   package.json
    └───lib
            AppCore.dll
            gio-2.0-0.dll
            glib-2.0-0.dll
            gmodule-2.0-0.dll
            gobject-2.0-0.dll
            gstreamer-full-1.0.dll
            gthread-2.0-0.dll
            Ultralight.dll
            UltralightCore.dll
            WebCore.dl
    

    Provided archive: UL_go_build_script.zip

    Building the sample is going fine, but sadly, the generated cra-go.exe generates an error: Entrypoint "ulAppGetWindow" not found in cra-go.exe

    opened by mzaiprog 0
  • Crash when using new 1.2.beta.2

    Crash when using new 1.2.beta.2

    I'm using muon and upgraded it to the new 1.2 dlls but it's crashing when calling ULCreateApp.

    Stacktrace:

    Exception 0x406d1388 0x1000 0x7ffbfa2294f8 0x7ffc558d3e49
    PC=0x7ffc558d3e49
    
    runtime: unknown pc 0x7ffc558d3e49
    stack: frame={sp:0x15bed40, fp:0x0} stack=[0x0,0x15bfdc0)
    00000000015bec40:  0000000000000000  0000000000000000 
    00000000015bec50:  00007ffbfa5e14b0  00007ffbfa5e15e8 
    00000000015bec60:  00000000015bee10  00007ffbf8db32d2 
    00000000015bec70:  00000000000007d0  0000000000000007 
    00000000015bec80:  00000000000007d0  00007ffbfa5e15e8 
    00000000015bec90:  0000000000000000  00007ffbf8dba023 
    00000000015beca0:  0000000000000001  41d7e5523262f2b4 
    00000000015becb0:  00007ffbfa5e15e8  00007ffbf8e66251 
    00000000015becc0:  000000000000000d  00007ffbf8dba001 
    00000000015becd0:  00007ffbfa23b830  00007ffc5770f5a3 
    00000000015bece0:  00007ffbfa23b830  00000000015bedf0 
    00000000015becf0:  0000000000170120  00002008bca2043e 
    00000000015bed00:  0000000000000000  00007ffc57bfac16 
    00000000015bed10:  0000f84fc77b1203  0000000000100000 
    00000000015bed20:  0000000000000001  00000000015befe0 
    00000000015bed30:  00007ffbf8db5ee0  00007ffc558d3e49 
    00000000015bed40: <00000000015bee10  0000000000000000 
    00000000015bed50:  00007ffbfa5e14f0  0000000000000000 
    00000000015bed60:  00000000406d1388  0000000000000000 
    00000000015bed70:  00007ffc558d3e49  00007ffc00000003 
    00000000015bed80:  0000000000001000  00007ffbfa2294f8 
    00000000015bed90:  00000000000025c8  00007ffc3c62f530 
    00000000015beda0:  0000000000000000  00000000001715c0 
    00000000015bedb0:  00007ffbf8db5ee0  0000000000000001 
    00000000015bedc0:  00007ffbfa5e15e8  00007ffbf8dba143 
    00000000015bedd0:  00000000015bee70  00007ffbf8dbb0dd 
    00000000015bede0:  00007ffbfa5e14f0  00007ffbfa5e15e8 
    00000000015bedf0:  0000000000000000  0000000000000040 
    00000000015bee00:  0000bb7244610403  000000010000000b 
    00000000015bee10:  00007ffbf8db5ee0  00007ffbf8db59ea 
    00000000015bee20:  0000000000000000  00007ffc57c06e2c 
    00000000015bee30:  00000000015befe0  00007ffbf8dbae5a 
    runtime: unknown pc 0x7ffc558d3e49
    stack: frame={sp:0x15bed40, fp:0x0} stack=[0x0,0x15bfdc0)
    00000000015bec40:  0000000000000000  0000000000000000 
    00000000015bec50:  00007ffbfa5e14b0  00007ffbfa5e15e8 
    00000000015bec60:  00000000015bee10  00007ffbf8db32d2 
    00000000015bec70:  00000000000007d0  0000000000000007 
    00000000015bec80:  00000000000007d0  00007ffbfa5e15e8 
    00000000015bec90:  0000000000000000  00007ffbf8dba023 
    00000000015beca0:  0000000000000001  41d7e5523262f2b4 
    00000000015becb0:  00007ffbfa5e15e8  00007ffbf8e66251 
    00000000015becc0:  000000000000000d  00007ffbf8dba001 
    00000000015becd0:  00007ffbfa23b830  00007ffc5770f5a3 
    00000000015bece0:  00007ffbfa23b830  00000000015bedf0 
    00000000015becf0:  0000000000170120  00002008bca2043e 
    00000000015bed00:  0000000000000000  00007ffc57bfac16 
    00000000015bed10:  0000f84fc77b1203  0000000000100000 
    00000000015bed20:  0000000000000001  00000000015befe0 
    00000000015bed30:  00007ffbf8db5ee0  00007ffc558d3e49 
    00000000015bed40: <00000000015bee10  0000000000000000 
    00000000015bed50:  00007ffbfa5e14f0  0000000000000000 
    00000000015bed60:  00000000406d1388  0000000000000000 
    00000000015bed70:  00007ffc558d3e49  00007ffc00000003 
    00000000015bed80:  0000000000001000  00007ffbfa2294f8 
    00000000015bed90:  00000000000025c8  00007ffc3c62f530 
    00000000015beda0:  0000000000000000  00000000001715c0 
    00000000015bedb0:  00007ffbf8db5ee0  0000000000000001 
    00000000015bedc0:  00007ffbfa5e15e8  00007ffbf8dba143 
    00000000015bedd0:  00000000015bee70  00007ffbf8dbb0dd 
    00000000015bede0:  00007ffbfa5e14f0  00007ffbfa5e15e8 
    00000000015bedf0:  0000000000000000  0000000000000040 
    00000000015bee00:  0000bb7244610403  000000010000000b 
    00000000015bee10:  00007ffbf8db5ee0  00007ffbf8db59ea 
    00000000015bee20:  0000000000000000  00007ffc57c06e2c 
    00000000015bee30:  00000000015befe0  00007ffbf8dbae5a 
    
    goroutine 1 [syscall]:
    github.com/Jonatino/muon/ultralight._Cfunc_ulCreateApp(0x174c2a0, 0x1724cd0, 0x0)
    	_cgo_gotypes.go:3437 +0x55
    github.com/Jonatino/muon/ultralight.UlCreateApp.func1(0x174c2a0, 0x1724cd0, 0xc0000c7ea0)
    	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/ultralight/ultralight.go:84 +0x80
    github.com/Jonatino/muon/ultralight.UlCreateApp(0x174c2a0, 0x1724cd0, 0x0)
    	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/ultralight/ultralight.go:84 +0x48
    github.com/Jonatino/muon.New(0xc0000b4f30, 0x90e260, 0xc000088c80, 0xc0000b4f00)
    	C:/Users/Jonathan/go/pkg/mod/github.com/!jonatino/[email protected]/muon.go:74 +0xdb
    main.main()
    	E:/Sync/Insignia/launcher/Launcher.go:33 +0x134
    rax     0x0
    rbx     0x0
    rcx     0x0
    rdi     0x15befe0
    rsi     0x7ffbfa5e14f0
    rbp     0x7ffbf8db5ee0
    rsp     0x15bed40
    r8      0x0
    r9      0x0
    r10     0x0
    r11     0x0
    r12     0x174c1e0
    r13     0x0
    r14     0x1
    r15     0x7ffbf8db5ee0
    rip     0x7ffc558d3e49
    rflags  0x202
    cs      0x33
    fs      0x53
    gs      0x2b
    

    Main method

    // New creates a Ultralight Window
    func New(cfg *Config, handler http.Handler) *Window {
    	w := &Window{
    		cfg:       cfg,
    		handler:   handler,
    		callbacks: make(map[string]*ipf),
    	}
    
    	ufg := UlCreateConfig()
    
    	log := func(log_level ULLogLevel, message ULString) {
    		fmt.Println(message)
    	}
    
    	logger := ULLogger{
    		Log_message: log,
    	}
    
    	UlPlatformSetLogger(logger)
    	
    	resourcePath := UlCreateString("./resources/")
    	defer UlDestroyString(resourcePath)
    	UlConfigSetResourcePath(ufg, resourcePath)
    
    	cachePath := UlCreateString("./cache/")
    	defer UlDestroyString(cachePath)
    	UlConfigSetCachePath(ufg, cachePath)
    
    	std := UlCreateSettings()
    	w.app = UlCreateApp(std, ufg)
    	mm := UlAppGetMainMonitor(w.app)
    
    	var hint uint32
    
    	if cfg.Resizeable {
    		hint |= 4
    	}
    
    	if cfg.Borderless {
    		hint |= 1
    	}
    
    	if cfg.Titled {
    		hint |= 2
    	} else {
    		w.cfg.Title = ""
    	}
    
    	if cfg.Maximizable {
    		hint |= 8
    	}
    
    	w.wnd = UlCreateWindow(mm, w.cfg.Width, w.cfg.Height, false, hint)
    
    	UlWindowSetTitle(w.wnd, w.cfg.Title)
    	UlAppSetWindow(w.app, w.wnd)
    
    	w.ov = UlCreateOverlay(w.wnd, w.cfg.Width, w.cfg.Height, w.cfg.X, w.cfg.Y)
    
    	UlWindowSetResizeCallback(w.wnd, resizeCallback(w.ov), nil)
    
    	w.view = UlOverlayGetView(w.ov)
    
    	return w
    }
    
    opened by jonatino 3
  • undefined symbol: ulViewGetJSContext

    undefined symbol: ulViewGetJSContext

     ~/Dev/muon/examples/create-react-app git:master / 247d 23h 50m
     ❯ go build -ldflags="-r ." -o example-app
    
     ❯ ./example-app
    Writing log to: /home/ryan/.cache/MyCompany-MyApp/ultralight.log
    ./example-app: symbol lookup error: ./example-app: undefined symbol: ulViewGetJSContext
    

    I believe the .so libraries are being found, because when I move them to a different directory I get:

     ~/Dev/muon/examples/create-react-app git:master / 247d 23h 50m
     ❯ ./example-app
    ./example-app: error while loading shared libraries: libWebCore.so: cannot open shared object file: No such file or directory
    

    Not sure if this is a version difference in ultralight, or if I've just got something configured incorrectly.

    opened by ryanerwin 1
  • Not working

    Not working

    macOS catalina

    game-center go build -ldflags "-r ." -o test                                  
    ➜  game-center ./test 
    dyld: lazy symbol binding failed: Symbol not found: _ulViewGetJSContext
      Referenced from: /Users/lucasloffel/go/src/github.com/loeffel-io/game-center/./test
      Expected in: /Users/lucasloffel/go/src/github.com/loeffel-io/game-center/libUltralight.dylib
    
    dyld: Symbol not found: _ulViewGetJSContext
      Referenced from: /Users/lucasloffel/go/src/github.com/loeffel-io/game-center/./test
      Expected in: /Users/lucasloffel/go/src/github.com/loeffel-io/game-center/libUltralight.dylib
    
    SIGABRT: abort
    PC=0x1324fede m=0 sigcode=0
    
    goroutine 0 [idle]:
    runtime: unknown pc 0x1324fede
    stack: frame={sp:0x7ffeefbfe608, fp:0x0} stack=[0x7ffeefb80748,0x7ffeefbff7b0)
    00007ffeefbfe508:  000000005f14434a  000000000418a520 <crypto/elliptic.initP224+528> 
    00007ffeefbfe518:  0000000000000000  0000000000000000 
    00007ffeefbfe528:  0000000000000000  0000000000000000 
    00007ffeefbfe538:  0000000000020000  0000000000000000 
    00007ffeefbfe548:  0000000000000000  0000000000000000 
    00007ffeefbfe558:  f29dee7eb9c500da  0000000011165d70 
    00007ffeefbfe568:  00000000000000ff  0000000000001e78 
    00007ffeefbfe578:  0000000000000000  00007ffeefbfe660 
    00007ffeefbfe588:  00000000131fb928  00000000131febd7 
    00007ffeefbfe598:  0000000011165d70  0000000000000000 
    00007ffeefbfe5a8:  000000001325065a  00007fff912f2e30 
    00007ffeefbfe5b8:  00000000000036da  0000000000000000 
    00007ffeefbfe5c8:  00000000131fa000  00007ffeefbff2a0 
    00007ffeefbfe5d8:  0000000000000000  00007ffeefbfea18 
    00007ffeefbfe5e8:  0000000000000005  0000000011165470 
    00007ffeefbfe5f8:  00007ffeefbfee78  00007ffeefbfeef0 
    00007ffeefbfe608: <000000001327955d  0000000000000021 
    00007ffeefbfe618:  000000201324578e  00007ffeefbfe670 
    00007ffeefbfe628:  00000000000000bb  00000000000000ff 
    00007ffeefbfe638:  0000000000000000  00007ffeefbfe670 
    00007ffeefbfe648:  00000000132917f8  00007ffeefbfe660 
    00007ffeefbfe658:  000000001327958f  00007ffeefbff290 
    00007ffeefbfe668:  0000000013276bf4  6e206c6f626d7953 
    00007ffeefbfe678:  646e756f6620746f  6569566c755f203a 
    00007ffeefbfe688:  6f43534a74654777  20200a747865746e 
    00007ffeefbfe698:  636e657265666552  3a6d6f7266206465 
    00007ffeefbfe6a8:  2f73726573552f20  666f6c736163756c 
    00007ffeefbfe6b8:  732f6f672f6c6566  75687469672f6372 
    00007ffeefbfe6c8:  6f6c2f6d6f632e62  6f692d6c65666665 
    00007ffeefbfe6d8:  65632d656d61672f  742f2e2f7265746e 
    00007ffeefbfe6e8:  784520200a747365  6920646574636570 
    00007ffeefbfe6f8:  726573552f203a6e  6c736163756c2f73 
    runtime: unknown pc 0x1324fede
    stack: frame={sp:0x7ffeefbfe608, fp:0x0} stack=[0x7ffeefb80748,0x7ffeefbff7b0)
    00007ffeefbfe508:  000000005f14434a  000000000418a520 <crypto/elliptic.initP224+528> 
    00007ffeefbfe518:  0000000000000000  0000000000000000 
    00007ffeefbfe528:  0000000000000000  0000000000000000 
    00007ffeefbfe538:  0000000000020000  0000000000000000 
    00007ffeefbfe548:  0000000000000000  0000000000000000 
    00007ffeefbfe558:  f29dee7eb9c500da  0000000011165d70 
    00007ffeefbfe568:  00000000000000ff  0000000000001e78 
    00007ffeefbfe578:  0000000000000000  00007ffeefbfe660 
    00007ffeefbfe588:  00000000131fb928  00000000131febd7 
    00007ffeefbfe598:  0000000011165d70  0000000000000000 
    00007ffeefbfe5a8:  000000001325065a  00007fff912f2e30 
    00007ffeefbfe5b8:  00000000000036da  0000000000000000 
    00007ffeefbfe5c8:  00000000131fa000  00007ffeefbff2a0 
    00007ffeefbfe5d8:  0000000000000000  00007ffeefbfea18 
    00007ffeefbfe5e8:  0000000000000005  0000000011165470 
    00007ffeefbfe5f8:  00007ffeefbfee78  00007ffeefbfeef0 
    00007ffeefbfe608: <000000001327955d  0000000000000021 
    00007ffeefbfe618:  000000201324578e  00007ffeefbfe670 
    00007ffeefbfe628:  00000000000000bb  00000000000000ff 
    00007ffeefbfe638:  0000000000000000  00007ffeefbfe670 
    00007ffeefbfe648:  00000000132917f8  00007ffeefbfe660 
    00007ffeefbfe658:  000000001327958f  00007ffeefbff290 
    00007ffeefbfe668:  0000000013276bf4  6e206c6f626d7953 
    00007ffeefbfe678:  646e756f6620746f  6569566c755f203a 
    00007ffeefbfe688:  6f43534a74654777  20200a747865746e 
    00007ffeefbfe698:  636e657265666552  3a6d6f7266206465 
    00007ffeefbfe6a8:  2f73726573552f20  666f6c736163756c 
    00007ffeefbfe6b8:  732f6f672f6c6566  75687469672f6372 
    00007ffeefbfe6c8:  6f6c2f6d6f632e62  6f692d6c65666665 
    00007ffeefbfe6d8:  65632d656d61672f  742f2e2f7265746e 
    00007ffeefbfe6e8:  784520200a747365  6920646574636570 
    00007ffeefbfe6f8:  726573552f203a6e  6c736163756c2f73 
    
    goroutine 1 [syscall]:
    runtime.cgocall(0x430b260, 0xc000042db8, 0x400e766)
            /usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/cgocall.go:133 +0x5b fp=0xc000042d88 sp=0xc000042d50 pc=0x400561b
    github.com/ImVexed/muon/ultralight._Cfunc_ulViewGetJSContext(0x11165c30, 0x0)
            _cgo_gotypes.go:3188 +0x4a fp=0xc000042db8 sp=0xc000042d88 pc=0x42fc7ba
    github.com/ImVexed/muon/ultralight.UlViewGetJSContext.func1(0x11165c30, 0x43a86a0)
            /Users/lucasloffel/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/ultralight.go:589 +0x4d fp=0xc000042de8 sp=0xc000042db8 pc=0x430265d
    github.com/ImVexed/muon/ultralight.UlViewGetJSContext(0x11165c30, 0x20)
            /Users/lucasloffel/go/pkg/mod/github.com/!im!vexed/[email protected]/ultralight/ultralight.go:589 +0x2b fp=0xc000042e08 sp=0xc000042de8 pc=0x430135b
    github.com/ImVexed/muon.(*Window).addFunction(0xc0000cc280, 0x43bdcc7, 0x3)
            /Users/lucasloffel/go/pkg/mod/github.com/!im!vexed/[email protected]/muon.go:315 +0x59 fp=0xc000042ea8 sp=0xc000042e08 pc=0x4307629
    github.com/ImVexed/muon.(*Window).Bind(0xc0000cc280, 0x43bdcc7, 0x3, 0x4353be0, 0x43d7f30)
            /Users/lucasloffel/go/pkg/mod/github.com/!im!vexed/[email protected]/muon.go:132 +0x2b0 fp=0xc000042f30 sp=0xc000042ea8 pc=0x4305d00
    main.main()
            /Users/lucasloffel/go/src/github.com/loeffel-io/game-center/main.go:23 +0xec fp=0xc000042f88 sp=0xc000042f30 pc=0x4307dac
    runtime.main()
            /usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/proc.go:203 +0x212 fp=0xc000042fe0 sp=0xc000042f88 pc=0x4037122
    runtime.goexit()
            /usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc000042fe8 sp=0xc000042fe0 pc=0x4063c11
    
    rax    0x2000209
    rbx    0x0
    rcx    0x7ffeefbfe608
    rdx    0x7ffeefbfea70
    rdi    0x6
    rsi    0x4
    rbp    0x7ffeefbfe650
    rsp    0x7ffeefbfe608
    r8     0x7ffeefbfe670
    r9     0x0
    r10    0xbb
    r11    0x246
    r12    0xbb
    r13    0x7ffeefbfea70
    r14    0x4
    r15    0x6
    rip    0x1324fede
    rflags 0x246
    cs     0x7
    fs     0x0
    gs     0x0
    
    opened by loeffel-io 0
  • exit status 3221225785

    exit status 3221225785

    When i follow the instructions on the getting_started page, I got "exit status 3221225785" error message when i ran the "go run main.go" command.

    opened by furkangkhsn 5
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Fyne.io 17.8k Aug 4, 2022
Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.

go-flutter - A package that brings Flutter to the desktop Purpose Flutter allows you to build beautiful native apps on iOS and Android from a single c

null 5.4k Jul 31, 2022
Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Allen Dang 1.5k Aug 8, 2022
GTK3-based dock for sway

nwg-dock Fully configurable (w/ command line arguments and css) dock, written in Go, aimed exclusively at sway Wayland compositor. It features pinned

Piotr Miller 76 Jul 28, 2022
A minimal material design based UI toolkit for Tiny Go projects

A minimal material design based UI toolkit for Tiny Go projects.

null 26 May 20, 2022
nano-gpu-agent is a Kubernetes device plugin for GPU resources allocation on node.

Nano GPU Agent About this Project Nano GPU Agent is a Kubernetes device plugin implement for gpu allocation and use in container. It runs as a Daemons

Nano GPU 40 Jun 10, 2022
nano-gpu-scheduler is a Kubernetes scheduler extender for GPU resources scheduling.

Nano GPU Scheduler About This Project With the continuous evolution of cloud native AI scenarios, more and more users run AI tasks on Kubernetes, whic

Nano GPU 86 Jul 28, 2022
gpu-memory-monitor is a metrics server for collecting GPU memory usage of kubernetes pods.

gpu-memory-monitor is a metrics server for collecting GPU memory usage of kubernetes pods. If you have a GPU machine, and some pods are using the GPU device, you can run the container by docker or kubernetes when your GPU device belongs to nvidia. The gpu-memory-monitor will collect the GPU memory usage of pods, you can get those metrics by API of gpu-memory-monitor

null 2 Jul 27, 2022
Based on the electron Cross-platform Mini browser

Based on the electron Cross-platform Mini browser

池边树下 1 May 1, 2022
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Quentin Renard 4.5k Aug 3, 2022
A kubernetes plugin which enables dynamically add or remove GPU resources for a running Pod

GPU Mounter GPU Mounter is a kubernetes plugin which enables add or remove GPU resources for running Pods. This Introduction(In Chinese) is recommende

XinYuan 72 Jul 18, 2022
Live on-demand transcoding in go using ffmpeg. Also with NVIDIA GPU hardware acceleration.

Go live HTTP on-demand transcoding Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of custo

Miroslav Šedivý 94 Jul 31, 2022
GPU Sharing Scheduler for Kubernetes Cluster

GPU Sharing Scheduler Extender in Kubernetes Overview More and more data scientists run their Nvidia GPU based inference tasks on Kubernetes. Some of

Aliyun (Alibaba Cloud) Container Service 936 Aug 4, 2022
A GPU-powered real-time analytics storage and query engine.

AresDB AresDB is a GPU-powered real-time analytics storage and query engine. It features low query latency, high data freshness and highly efficient i

Uber Open Source 2.9k Jul 30, 2022
Nvidia GPU exporter for prometheus using nvidia-smi binary

nvidia_gpu_exporter Nvidia GPU exporter for prometheus, using nvidia-smi binary to gather metrics. Introduction There are many Nvidia GPU exporters ou

Utku Özdemir 118 Jul 27, 2022
Darktile is a GPU rendered terminal emulator designed for tiling window managers.

Darktile is a GPU rendered terminal emulator designed for tiling window managers.

Liam Galvin 2.8k Aug 8, 2022
NVIDIA GPU metrics exporter for Prometheus leveraging DCGM

DCGM-Exporter This repository contains the DCGM-Exporter project. It exposes GPU metrics exporter for Prometheus leveraging NVIDIA DCGM. Documentation

NVIDIA Corporation 156 Jul 31, 2022
OpenAIOS vGPU scheduler for Kubernetes is originated from the OpenAIOS project to virtualize GPU device memory.

OpenAIOS vGPU scheduler for Kubernetes English version|中文版 Introduction 4paradigm k8s vGPU scheduler is an "all in one" chart to manage your GPU in k8

4Paradigm 65 Jul 29, 2022
Wirewold cellular automata simulator, running entirely on GPU.

Wireworld-gpu Wireworld implements the data and rules for the Wireworld cellular automata. This particular version is an experiment whereby the simula

null 0 Nov 26, 2021
gpupod is a tool to list and watch GPU pod in the kubernetes cluster.

gpupod gpupod is simple tool to list and watch GPU pod in kubernetes cluster. usage Usage: gpupod [flags] Flags: -t, --createdTime with pod c

null 0 Dec 8, 2021
Planet Scale Robotics - Offload computation-heavy robotic operations to GPU powered world's first cloud-native robotics platform.

robolaunch ?? Planet Scale Robotics - Offload computation-heavy robotic operations to GPU powered world's first cloud-native robotics platform. robola

robolaunch 5 Jul 20, 2022
AutoGpuAffinity - Auto Gpu Affinity with golang

AutoGpuAffinity The idea and concept is from AMIT (repository) Formulas for calc

spddl 17 Jun 28, 2022
kubernetes Display Resource (CPU/Memory/Gpu/PodCount) Usage and Request and Limit.

kubectl resource-view A plugin to access Kubernetes resource requests, limits, and usage. Display Resource (CPU/Memory/Gpu/PodCount) Usage and Request

bryant-rh 8 Apr 22, 2022
Time-Based One-Time Password (TOTP) and HMAC-Based One-Time Password (HOTP) library for Go.

otpgo HMAC-Based and Time-Based One-Time Password (HOTP and TOTP) library for Go. Implements RFC 4226 and RFC 6238. Contents Supported Operations Read

Jose Torres 39 Jul 25, 2022
goworker is a Go-based background worker that runs 10 to 100,000* times faster than Ruby-based workers.

goworker goworker is a Resque-compatible, Go-based background worker. It allows you to push jobs into a queue using an expressive language like Ruby w

Benjamin Manns 2.7k Aug 3, 2022
A phoenix Chain client based on the go-ethereum fork,the new PoA consensus engine is based on the VRF algorithm.

Phoenix Official Golang implementation of the Phoenix protocol. !!!The current version is for testing and developing purposes only!!! Building the sou

g_master 14 Apr 28, 2022
A phoenix Chain client based on the go-ethereum fork,the new PoS consensus engine is based on the VRF algorithm.

Phoenix Official Golang implementation of the Phoenix protocol. !!!The current version is for testing and developing purposes only!!! Building the sou

null 8 Jan 7, 2022
Go-based search engine URL collector , support Google, Bing, can be based on Google syntax batch collection URL

Go-based search engine URL collector , support Google, Bing, can be based on Google syntax batch collection URL

Re 52 Jul 20, 2022
Small CLI based programs for solving structural engineering design problems based on the book 'Structural Concrete'

Small CLI based programs for solving structural engineering design problems based on the book 'Structural Concrete' written by M. Nadim Hassoun and Akhtem Al-Manaseer (edition-6)

Muhammad Usman Shamsi 1 Nov 26, 2021