Giter Site home page Giter Site logo

indoorvivants / sn-bindgen-web Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 182 KB

(WIP) web interface to sn-bindgen (https://sn-bindgen.indoorvivants.com/) to generate Scala 3 Native bindings to C header files

Home Page: https://sn-bindgen-web.fly.dev/

Scala 89.61% Smithy 3.22% C 0.36% Dockerfile 5.37% JavaScript 0.52% HTML 0.87% CSS 0.05%
bindings c scala-native scala3 smithy smithy4s sn-bindgen

sn-bindgen-web's Introduction

Web app to generate Scala 3 Native bindings for C

Warning: this is currently not working and really should be a private repo, but I've run out of private GHA minutes so... here we are

2023-05-29 12 01 15

Quick start (Docker)

Warning: this will take some time, as we need to build NGINX Unit from scratch, and install LLVM. Sit back, have a beverage

  • Build a docker container

    Release version (slow):

    $ docker build . --build-arg scalanative_mode=debug --build-arg scalanative_lto=none -t sn-bindgen-web
    

    Debug version (slightly faster):

    $ docker build . --build-arg scalanative_mode=debug --build-arg scalanative_lto=none -t sn-bindgen-web
    
  • Run it

    docker run -p 9999:9999 sn-bindgen-web:latest
    
  • Open http://localhost:9999 and enjoy.

Local development (backend)

  1. Install NGINX Unit: https://unit.nginx.org/installation/

  2. Install LLVM: https://releases.llvm.org/

  3. Set LLVM_BIN env variable to the location of bin folder in LLVM installation

  4. Run sbt devServer/run

    Warning: first run will be very slow. Subsequent ones will be somewhat slow.

    Alternatively, you can keep launch SBT and run devServer/reStart in there - this will make sure that your SBT shell remains usable, and the server will be run in the background.

  5. Open http://localhost:9999 and enjoy.

Local development (frontend)

The frontend module is set up using Vite.js.

  • cd modules/frontend
  • npm install
  • Run the backend (see above), it has to be running on port 9999 (default) as Vite is configured to proxy the /api/* requests to http://localhost:9999/api/*
  • In a separate SBT shell, run ~frontend/fastLinkJS - this continuously rebuilds the Scala.js frontend
  • npm run dev - will run the Vite server
  • Open http://localhost:5173 and you can now edit frontend without restarting the backend, with live reload

sn-bindgen-web's People

Contributors

keynmol avatar lolgab avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

lolgab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.