Simple Janet web development platform in Go, à la PHP

Related tags

go web janet
Overview

Spinnerette

Simple Janet web development platform in Go, à la PHP

Building

make

This will handle pulling submodules, building Janet, and then building and linking Spinnerette

If you are hacking on Spinnerette, once make has been called once switch to using go build.

Issues
  • Added detailed usage + example link to readme

    Added detailed usage + example link to readme

    Covers running the spinnerette binary, port, and a link to an example. May need to be updated later when those settings become configurable.

    opened by eccentric-j 4
  • Added logo to README.org

    Added logo to README.org

    null

    opened by eccentric-j 2
  • Remove -lrt build flag

    Remove -lrt build flag

    Currently when trying to run go build on OS X it fails due to the -lrt flag. Removing it allows the build to run, not sure how this will affect other linux OSs but preliminary research suggests it's more of a legacy thing?

    opened by eccentric-j 1
  • JSON response function

    JSON response function

    Nothing too fancy yet. Supports setting a custom status code with an optional keyword arg.

    Example:

    (import spin)
    
    (spin/json
     {:status :ok
      :messsage "JSON responses are also simple"}
     # Supports some optional parameters like http-response status
     :status 201)
    

    One issue though is that if I change libs/spin/init.janet, the changes will not take affect until I run the following:

    go build
    

    It does not rebuild if I run:

    make run
    

    If I use an absolute import path, it works without requiring a build:

    (import /libs/spin)
    
    (spin/json
     {:status :ok
      :messsage "JSON responses are also simple"}
     # Supports some optional parameters like http-response status
     :status 201)
    

    Can make changes to libs/spin/init.janet, then can refresh the JSON example without restarting the server or running go build.

    opened by eccentric-j 1
  • Use a single VM insteance

    Use a single VM insteance

    Refactors the way the Janet VM is started so that only one is started for the whole process, instead of one-per-request. This should simplify the code and be substantially more performance (no benchmarks though)

    The previous design was in response to the fact that the Janet C bindings are NOT thread-safe. This new design ensures thread-safety by using runtime.LockOSThread() to give the VM it's own thread and keep it there, thus solving the thread-safety issue. Code is sent over channels to the VM and responses sent back. The Go runtime is then free to use as many threads as it wants and to schedule itself.

    There are also some other misc improvements in here that came from me learning more about the Janet library and what it provides.

    opened by rushsteve1 0
  • CI can't find linked libraries

    CI can't find linked libraries

    The GitHub Action CI can't seem to find the symbols from the standard libraries that were linked in. The logs seem to indicate that the linker was able to find these libraries when building the static libraries, so it seems like there's an issue with our final flags in janet.go

    /*
    #cgo CFLAGS: -fPIC -O2
    #cgo CFLAGS: -I ${SRCDIR}/janet/build
    #cgo LDFLAGS: -lm -ldl -lpthread ${SRCDIR}/janet/build/libjanet.a ${SRCDIR}/libsqlite3.a
    #include "janet.h"
    */
    import "C"
    
    help wanted 
    opened by rushsteve1 0
  • Module Loader Improvements

    Module Loader Improvements

    The current module loader kinda works, but it needs a lot of work to get all the way there

    • [ ] Make sure imports in user files work correctly
    • [ ] Support relative paths in bundled modules better
    • [ ] Ensure environments aren't being trashed
    • [ ] Make sure user's can use JPM without issue
    • [ ] Improve performance
    opened by rushsteve1 0
  • Initial ToDo List

    Initial ToDo List

    The first list of things to do in the project

    • [x] Janet Bindings to Go
    • [x] Web Servers
      • [x] HTTP
      • [x] FastCGI
      • [x] CGI
    • [x] Converting Go's http.Request to Janet structures like Circlet's
    • [x] Static file serving
    • [ ] Templates
      • [ ] Go templates
      • [x] Janet Temple
    • [ ] Built in libraries (see #5)
      • [ ] Custom library for Spinnerette
      • [x] Spork (required for Temple)
      • [x] janet-html
      • [x] Janet SQLite (possibly reimplement in Go)
      • [x] Janet JSON (same as above)
    • [x] ~~"Managed" SQLite database~~
    • [ ] Dropping permissions to stay within webroot folder
      • Do we want to delegate this to the webserver itself? Or tell people to use containers?
    • [ ] Ensure the Janet bindings don't leak memory
    • [x] Some kind of cache system?
      • [x] Make sure stuff in the cache doesn't get GC'd

    Questions

    • How should Janet files be formatted? A main function?
      • A: Freeform, the script's return value is the response
    • What should the return value of Janet files be? Should we support multiple kinds? (strings, Janet-HTML arrays)
      • A: Strings or Circlet-style response objects. Nothing else. Thanks to @eccentric-j for the feedback!
    • How do we properly support shared hosts? Is FastCGI enough?
    • Should we allow it to run other CGI scripts? (Leaning towards no)
      • No, let the webserver itself do that
    help wanted 
    opened by rushsteve1 1
Owner
Steven vanZyl
Game Developer and FOSS Fan. I mostly use GitLab: https://gitlab.com/rushsteve1
Steven vanZyl
:zap: Go web framework benchmark

go-web-framework-benchmark This benchmark suite aims to compare the performance of Go web frameworks. It is inspired by Go HTTP Router Benchmark but t

smallnest 1.6k Oct 15, 2021
re:Web enables classic web applications to run on AWS Lambda.

re:Web re:Web enables classic web applications to run on AWS Lambda. re:Web interfaces with the Lambda Runtime API. It translates API Gateway requests

null 71 Jul 4, 2021
Rapid Web Development w/ Go

Buffalo A Go web development eco-system, designed to make your project easier. Buffalo helps you to generate a web project that already has everything

Buffalo - The Go Web Eco-System 6.4k Oct 18, 2021
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.

go-zero English | 简体中文 0. what is go-zero go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the

好未来技术 12k Oct 17, 2021
go-zero is a web and rpc framework that with lots of engineering practices builtin.

go-zero is a web and rpc framework that with lots of engineering practices builtin. It’s born to ensure the stability of the busy services with resilience design, and has been serving sites with tens of millions users for years.

null 157 Oct 13, 2021
⚡️ Express inspired web framework written in Go

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go. Designed to ease things up for fast development w

Fiber 16k Oct 23, 2021
Gerasimos (Makis) Maropoulos 21.3k Oct 20, 2021
弹弹play 资源搜索节点 API 实现,基于 Cloudflare Workers 或 Golang 的两种实现。 || API implementations for "dandanplay" resource search service.

dandanplay-resource-service API implementations for "dandanplay" resource search service. 弹弹play 资源搜索节点的 API 实现。 提供基于 Cloudflare Workers 和 Golang 的两种实

Lussac 26 Oct 11, 2021
Vektor - Build production-grade web services quickly

Vektor enables development of modern web services in Go. Vektor is designed to simplify the development of web APIs by eliminating boilerplate, using secure defaults, providing plug-in points, and offering common pieces needed for web apps. Vektor is fairly opinionated, but aims to provide flexibility in the right places.

Suborbital 53 Oct 8, 2021
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Flamingo 235 Oct 15, 2021
An opinionated productive web framework that helps scaling business easier.

appy An opinionated productive web framework that helps scaling business easier, i.e. focus on monolith first, only move to microservices with GRPC la

appist 109 Oct 1, 2021
Gin is a HTTP web framework written in Go (Golang).

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin-Gonic 52.4k Oct 23, 2021
beego is an open-source, high-performance web framework for the Go programming language.

Beego Beego is used for rapid development of enterprise application in Go, including RESTful APIs, web apps and backend services. It is inspired by To

astaxie 277 Oct 19, 2021
beego is an open-source, high-performance web framework for the Go programming language.

Beego Beego is used for rapid development of enterprise application in Go, including RESTful APIs, web apps and backend services. It is inspired by To

beego Framework 27.1k Oct 17, 2021
🍐 Elegant Golang REST API Framework

An Elegant Golang Web Framework Goyave is a progressive and accessible web application framework focused on REST APIs, aimed at making backend develop

Goyave 913 Oct 15, 2021
An ideally refined web framework for Go.

Air An ideally refined web framework for Go. High-performance? Fastest? Almost all web frameworks are using these words to tell people that they are t

Aofei Sheng 406 Sep 20, 2021
An ideally refined web framework for Go.

Air An ideally refined web framework for Go. High-performance? Fastest? Almost all web frameworks are using these words to tell people that they are t

Aofei Sheng 406 Sep 20, 2021
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.

GoFrame English | 简体中文 GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang. If you're a

GoFrame 6.2k Oct 23, 2021
GoFarm is an Application Development Framework for especially Backend Developer with Golang

What is GoFarm GoFarm is an Application Development Framework for especially Backend Developer with Golang. Our goal is to develop easier, standardize

Alvin Leonardo 1 Oct 22, 2021