Giter Club home page Giter Club logo

rshim's Introduction

rshim

rshim is the shim program written in rust.

Why does this exist?

There are several versions of shim:

  • the official shim.cs was written in c# and required an instantiation of a .NET command line app every time it was started therefore is slower than directly executing. And it dose not handle Ctrl+C event correctly.

  • shim.c is ok with performance and Ctrl+C event handling,but sometimes suffer memory violation (randomly exited with return code 3221226356).

  • shim.cpp didn't work on my machine, calling it with any executable result in an infinite recursion of creating subprocess until eating all memory for unknown subtle reason.

Advantages of rshim

  • less probability with bug and undefined behavior.
  • properly handle variety errors.
  • friendly error message.
  • properly handle Ctrl+C events.
  • properly handle utf-8 with or without bom in shim file.

Differences from upstream rshim

  • relies heavily on Win32 API, moreso than the original
  • reduced binary size massively (134KB static compared to 300KB)
  • handle quoted strings
  • some slight speed improvements

Installation

First install rust

cargo build --release

Close any running process with existing shims, then

./repshims.bat

Roadmap

  • remove core::fmt entirely
  • make it run with #![no_std]

Executable Size

  • Without crt-static enabled: around 48KB
  • With crt-static enabled: around 134KB

rshim's People

Contributors

beer-psi avatar zoritle avatar

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.