Giter Club home page Giter Club logo

alloy's Introduction

Ardaku

Ardaku is a general-purpose WebAssembly application engine. It's intended to run in any userspace program or on bare metal as sandboxing for an OS (see the Quantii project).

Getting Started

To boot up Ardaku, you will need a startup application. The hello crate is provided in the root folder. To compile it, run:

cd hello/
./build.sh

This will create a hello.wasm file (~10kB). You can now run it locally with:

RUST_LOG=info cargo run --release --example demo hello/hello.wasm

Rust WebAssembly programs that use an allocator will always allocate at least 2 pages; this example is configured to allocate only 2:

  1. Stack (configured via rustc flags to only take up ½ page - default: 16), the remaining ½ page is used for the WebAssembly data section
  2. Heap allocated memory

Together this adds up to 128 kB (131_072 bytes) for the minimum runtime memory required by a WASM file in Ardaku.

API

Ardaku runs the daku API. You can build your own apps for Ardaku using the daku crate.

Usage

To use Ardaku on a custom target, all you need to do is implement the System trait, and Ardaku takes care of the rest!

Ardaku may be used to test Quantii apps and desktop environments without running Quantii itself. You may also use Ardaku as an alternative to Flatpak and other software similar to Electron (although not within a "web" context).

alloy's People

Contributors

ahkrr avatar aldaronlau avatar aloso avatar arturkovacs avatar benediktwerner avatar carrascomj avatar dependabot[bot] avatar douglau avatar heroickatora avatar kamadak avatar mcluck90 avatar paolobarbolini avatar vn971 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alloy's Issues

New logo suggestion

There should be a new logo to replace the one from Emulsion. I noticed that if you do an image search for alloy, the most common result is a shiny wheel rim. Maybe we could make a stylized version of that?

Zoom Limit

Image can be lost while scrolling, there should be an limit (in my opinion ofc.). Best limit is when we compare the image to window size and/or automatically zoom the image while resizing emulsion, that image can by default fit the entire window.

https://github.com/ArturKovacs/emulsion/issues/202

Cannot load AVIF

$ cargo install --path . --features=libavif-image

Request #34: Error occurred while loading file "file.avif"
    The image format Avif is not supported
Error occurred while loading image: Failed to load 34

Error occurred while loading image: Failed to load 34

Way to donate to project?

Hey, I just wanted to ask if there is a way to donate to the development of this project. I love this image viewer and I'm so happy with its continued development, I figured I should really chip in some money to keep it going. Is there any official way to do so? Thanks!

Replace Del: Trash With "Move To..."

I always found it frustrating that most image viewers map the delete key to trash, and there's no way to undo it from within the program. It's fairly easy to accidentally press delete, and not having a confirmation dialogue is poor UI design.

A more powerful feature is having a "Move To..." button and keyboard/shortcut that brings up a new screen that lets you select where to put it (including an option for trash).

Of course, this is more annoying for the use case when you are going through photos and deleting probably at least 75% of them, trying to keep the best ones. So, this should also go with an interface to select multiple pictures at once (therefore also providing mass move).

Panic On Start

Panic happened

--
called `Option::unwrap()` on a `None` value
--

Location src/image_cache/directory.rs:342:43

   0: alloy::handle_panic::handle_panic
   1: std::panicking::rust_panic_with_hook
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:702:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:586:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/sys_common/backtrace.rs:138:18
   4: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   5: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   6: core::panicking::panic
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:48:5
   7: alloy::image_cache::directory::Directory::check_filter_ready
   8: alloy::playback_manager::PlaybackManager::update_image
   9: <alloy::widgets::picture_widget::PictureWidget as gelatin::Widget>::before_draw
  10: <gelatin::line_layout_container::LineLayoutContainer<Dim> as gelatin::Widget>::before_draw
  11: <gelatin::line_layout_container::LineLayoutContainer<Dim> as gelatin::Widget>::before_draw
  12: gelatin::window::Window::main_events_cleared
  13: gelatin::application::Application::start_event_loop::{{closure}}
  14: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run
  15: winit::platform_impl::platform::EventLoop<T>::run
  16: winit::event_loop::EventLoop<T>::run
  17: gelatin::application::Application::start_event_loop
  18: alloy::main
  19: std::sys_common::backtrace::__rust_begin_short_backtrace
  20: std::rt::lang_start::{{closure}}
  21: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
      std::panicking::try
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
      std::panic::catch_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:128:48
      std::panicking::try::do_call
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:492:40
      std::panicking::try
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:456:19
      std::panic::catch_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panic.rs:137:14
      std::rt::lang_start_internal
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/rt.rs:128:20
  22: main
  23: __libc_start_main
  24: _start

===================================================================================================

Fails to launch on KDE wayland

Both using cargo install emulsion and building from source give the following error on running.

[wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
[1]    81565 IOT instruction (core dumped)  cargo run

No panic file is made

Error Printed In Console

Prints error:

[2022-05-20T00:48:11Z ERROR smithay_client_toolkit::window::concept_frame] No font could be found

Switch To Flat Workspace

Having a Cargo.toml that's both the workspace manifest and also for a crate is confusing to me, they should be separate Cargo.tomls.

Roadmap To 1.0.0

Something like this should/needs be done before a version is released (some more than others, and some might be removed from this list):

  • Set up Flatpak build - #23
  • Rename all cases of emulsion to alloy
  • Fix desktop file #13
  • Fix macOS opening files #12
  • Fix Windows position (#30 and #29)
  • Fix zooming (#15 and #17)
  • Fix CI #35
  • Flatten workspace #33
  • Fix freezing #24
  • Fix panic #36
  • Fix choppiness #71
  • Fix #208

strace alloy indicates constant invocations of getpid() and ioctl() in infinite loop

Having been curious as to why task switching from/to alloy and resizing of alloy windows seem so choppy, I instinctively did an »strace alloy 1.png« (1.png is one of the small images in alloy's resource directory making up its UI), which causes a constant flood of messages, seemingly without any intermittent delays.

All those rapid syscalls also explain the 1.5% CPU load with any open alloy window (emulsion too, both debug and release build). I did it on Linux (Kernel 5.18.1; on the same machine, gwenview, eog and feh use 0% CPU and radio silent on strace -- except when animating GIFs, which is fair).

Just 2 snippets of a typical alloy strace:

.
.
.
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
poll([{fd=3, events=0}], 1, 0)          = 0 (Timeout)
poll([{fd=16, events=POLLIN|POLLPRI}], 1, 1000) = 1 ([{fd=16, revents=POLLIN|POLLPRI}])
ioctl(16, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0x52, 0x10), 0x7ffe113bee30) = 0
sched_yield()                           = 0
ioctl(9, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0x2a, 0x20), 0x7ffe113bcf30) = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
epoll_pwait(4, [], 8, 0, NULL, 8)       = 0
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="\22\0\f\0\2\0\300\2'\0\0\0\37\0\0\0\10\0\0\0\27\0\0\0001.png : "..., iov_len=96}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 96
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="\16\0\2\0\2\0\300\2", iov_len=8}, {iov_base=NULL, iov_len=0}, {iov_base="", iov_len=0}], 3) = 8
poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\30b\1\0\0\0\0\315\1\0\0\0\0\0\0\314\4\26\4\0\0\0\0\0\0\0\0\0\0\0\0", iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
getpid()                                = 29005
.
.
.

...and other times, like this:

.
.
.
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
munmap(0x7fd5bf0b0000, 8192)            = 0
munmap(0x408b7000, 8192)                = 0
ioctl(9, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0x4f, 0x20), 0x7ffe113bf590) = 0
munmap(0x7fd5bef73000, 12288)           = 0
munmap(0x413db000, 716032)              = 0
ioctl(16, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0xcf, 0x10), 0x7ffe113bf5f0) = 0
close(16)                               = 0
ioctl(17, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0xcf, 0x10), 0x7ffe113bf5f0) = 0
close(17)                               = 0
ioctl(18, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0xcf, 0x10), 0x7ffe113bf5f0) = 0
close(18)                               = 0
ioctl(19, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0xcf, 0x10), 0x7ffe113bf5f0) = 0
close(19)                               = 0
ioctl(20, _IOC(_IOC_READ|_IOC_WRITE, 0x46, 0xcf, 0x10), 0x7ffe113bf5f0) = 0
close(20)       
.
.
.

Edited to add:
I like pure image viewers like alloy as well as the fact that alloy is written in Rust. I have been unable to localize those incessant syscalls above, though. They don't seem to reside in any of the alloy or emulsion source files but rather in one of those uncounted Cargo dependencies.

I wouldn't be surprised if a multithreading-nonblocking messaging-I/O library like Tokio was the cause.

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.