Code Monkey home page Code Monkey logo

cargo-html's Introduction

๐Ÿ’ฌ Contact

๐Ÿต Activity

โ— Website โ— Pull Requests โ— Notes โ—

โš™๏ธ Rust

โ— Reviews โ— Guide: C++ vs Rust โ—

authored desc
Subcommands
cargo-container Package rlibs in several containing frontends
cargo-html create self-contained HTML programs
cargo-local-install Wraps cargo install for better local, non-conflicting installation
cargo-vs Autogenerate visual studio solutions / projects
cargo-vsc Autogenerate .vscode folders
General
abibool C ABI compatible boolean types
abistr C ABI compatible string types
bugsalot Rust macros for bug wrangling, debugger interop.
firehazard ๐Ÿ”ฅ Safe, "sound", 1:1 windows security API wrappers
hwnd Windows HWND wrappers
mcom ๐Ÿ‘ฝ COM smart pointers and interop functions
minidl Extremely lean cross platform library for loading symbols
thindx ๐ŸŽฎ Safe, "sound", 1:1 DirectX wrappers
thindx-xinput ๐ŸŽฎ Safe, "sound", 1:1 XInput wrappers
thindx-xaudio2 ๐Ÿ”Š Safe, "sound", 1:1 XAudio2 wrappers
untokio Pretend tokio doesn't exist
vfs-clgit Virtual FileSystem abstraction around Command Line GIT
vfs-zip Virtual FileSystem abstraction around zip archives
winresult Windows HRESULT and error code wrappers
winstr Windows BSTR wrappers
Build Tooling
appx Manage appx packages
clgit Command Line GIT wrappers
json-spanned-value Track the origin of your json values for better error reporting!
lies LIcense Embedding System
mmrbi Rust Build Infrastructure
natvis-pdbs Embed .natvis files into your .pdbs, for ease of debugging.
wslapi Managing the Windows Subsystem for Linux
Binaries
mmuhttpd 0 deps 100% monkey HTTP server
rust_win32_sample Basic samples relying only on winapi
rust-opendingux-test OpenGL on RG350M demo
contributions desc
Major
nonmax NonMax* equivalents to NonZero*
Medium
crev Distributed Code Reviews
midir Cross-platform, realtime MIDI processing in Rust.
rust rustc itself!
wmi Windows Management Instrumentation
Minor
inventory typed distributed plugin registration
lokacore ???
num_cpus Count the number of CPUs on the current machine
quicksilver web+desktop 2d gamedev framework
rust-android-gradle Cross compile Rust Cargo projects for Android targets.
rusty-xinput Dynamically loads an xinput dll and lets you safely call the functions.
tempfile Temporary files management
xml XML reader/writers

cargo-html's People

Contributors

dependabot[bot] avatar maulingmonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cargo-html's Issues

Skip destructors for WASI apps that live beyond `main`

I can't seem to override _start, even with #![no_main] or rustflags = ["-C", "link-args=--no-entry"]. That said, I can define an alternative entry point (_start2 in the example bellow) which will show up as a module export that could be called instead of _start:

extern "C" {
    fn __wasm_call_ctors();
    fn __original_main() -> i32;
}

#[no_mangle]
pub extern "C" fn _start2() {
    unsafe { __wasm_call_ctors() };
    unsafe { __original_main() };
}

cargo-html could check for __cargo_html_start and call that instead of _start if present?

References of note for _start functions:
WebAssembly/wasi-libc/libc-bottom-half/crt/crt1.c
WebAssembly/wasi-libc/libc-bottom-half/crt/crt1-command.c
WebAssembly/wasi-libc/libc-bottom-half/crt/crt1-reactor.c

Multithreading / multi-process?

WASI currently lacks APIs for this, but there's nothing saying I can't roll my own as a proof of concept.

Questions:

  • Wait for stack manipulation functions, or double down on asyncify?
  • Should infinite loops be preempted? (rewrite WASM with walrus to insert yields? perhaps just insert call __wasi_sched_yields before asyncify pass? i32.const 12; call __increment_retired_instruction_counter?)
  • WebWorkers provide actual parallel execution, but require extra HTTP headers and prohibit DOM access
  • wasm_bindgen callbacks - treat as if executing in an implicit thread pool? APIs currently don't require Send/Sync, so probably unsound?
  • ...?

doesn't work in firefox

I've tried the examples, and they work fine in Chrome but not in Firefox 85 on Linux.

This is the error in the inspector console in Firefox.

Uncaught ReferenceError: SharedArrayBuffer is not defined
    SharedCircularBuffer SharedCircularBuffer.ts:64
    main_dom guess.html:350
    <anonymous> guess.html:600
SharedCircularBuffer.ts:64:17

Normalize WASI doc links

  • Using a mixture of [WASI] and ### See Also hyperlinks, think I prefer the former.
  • Excessive multi-line docs
  • Decide upon a consistent enum doc style

Switch to class-based CSS color selection

monochrome-amber currently uses some text-shadow shenannigans to look better for bright-on-black colors, would be nice to make them conditional to avoid bluring "regular" text.

Unreliable `wasm-opt`

Building hello-world * chrome * release frequently crashes wasm-opt:

                            Building HTML pages
     Running `C:\Users\MaulingMonkey\AppData\Local\.wasm-pack\wasm-opt-171374efd61df962\wasm-opt.exe --asyncify C:\local\cargo-html\examples\target\wasm32-wasi\release\hello-world.wasm --output C:\local\cargo-html\examples\target\wasm32-wasi\release\hello-world.async.wasm`
error: `C:\Users\MaulingMonkey\AppData\Local\.wasm-pack\wasm-opt-171374efd61df962\wasm-opt.exe --asyncify C:\local\cargo-html\examples\target\wasm32-wasi\release\hello-world.wasm --output C:\local\cargo-html\examples\target\wasm32-wasi\release\hello-world.async.wasm` failed: exit code -1073741819
error: process didn't exit successfully: `target\debug\cargo-html.exe html --manifest-path examples/Cargo.toml -p hello-world --release` (exit code: 1)
error: process didn't exit successfully: `xtask\target\debug\xtask.exe run -p cargo-html -- html --manifest-path examples/Cargo.toml -p hello-world --release` (exit code: 1)
The terminal process "C:\Windows\System32\cmd.exe /d /c cargo html -p hello-world --release" terminated with exit code: 1.

-1073741819 == C0000005 == Access Violation

Clarify/correct iOS Safari entry

The browser support table in the README lists iOS Safari | โœ”๏ธ 14.4+ (copy-pasted from lib.rs because the emoji doesn't copy-paste from the GitHub rendering) but, in my tests, (using a minimal HTML file that just uses a control string, a <noscript> element, and document.write), iOS 14.4.2 Safari seems to insist on running with JavaScript disabled when loading an HTML file off the internal storage via the Files app.

(I think it's just insisting on using the embeddable WebKit view without a means to load local files in full-blown Safari and, in typical iOS fashion, using "simple" UIs to make things ambiguous and confusing.)

This makes the README either very misleading (if the single-file HTML is only useful on iOS when served from a remote server), or in need of clarification on how to enable the supported configuration.

Even if JavaScript is unavailable on iOS Safari, I'd still be interested in using cargo-html if HTML+CSS without JavaScript or WebAssembly support is a supported configuration, since it'd mean I could retire the Python-based analogue to cargo-html that I hacked together for translating CSV-format "books to watch for a the used book store" lists into expandable/collapsible/filterable HTML outlines to be copied onto a phone with no SIM. (The output of which does work on Firefox for Android, pre-"you get the six extensions we like and you'll be happy with it" version but not in iOS Safari.)

Streamline incremental builds

A lot of work is done even if the build is up to date.

  1. Rebuild typescript (cargo-html xtask / dev builds only)
    • npm install ... (300-400ms)
    • tsc ... (fast)
  2. Initial wasm builds
    • cargo build ... spam (commands internally skip rebuilding / are fast)
    • wasm-pack spam (???)
    • cargo web spam (???)
  3. Asyncification
    • wasm-opt spam (commands now explicitly skipped by 73494cb)
  4. HTMLification
    • HTML generation (skipped by 8246b3c)

Build perf: extra wasi builds

cargo html --manifest-path examples/Cargo.toml -p quicksilver-demo appears to be invoking cargo build --target=wasm32-wasi --manifest-path examples/Cargo.toml --bins.

  1. This isn't limited to the quicksilver-demo package
  2. quicksilver-demo's bin is getting built despite not being WASI compatible

Add xtask

  • Move use of +crt-static
  • Remove tsc ... from vscode / ci
  • More complicated integration testing?

Code cleanup

Waiting until wip/cursor is merged

  • asyncify_page_count
  • const [a-z] regexp

Mobile Keyboard Issues

There's currently no way to show a touchscreen keyboard to make console input usable.

Slim down `wasm-pack` dependency?

Currently the crate is only used to find/install wasm-opt. Either this should be slimmed down (it adds hundreds of dependencies!), or the crate should be used to replace the command line use of wasm-pack.

Determine next focus

I should use this for things.

  • Double down on console support. Make console games. Live a console life.
  • New ecosystem. Make a fake graphics device. /dev/webgl? non-wasi syscalls?
  • Hijack the wasm-bindgen ecosystem for fun and profit. fn main() { newcrate::run(async { ... }); } ?

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.