c2rust VS TypeScript

Compare c2rust vs TypeScript and see what are their differences.

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
c2rust TypeScript
46 1,305
3,673 97,944
2.7% 1.0%
9.5 9.9
5 days ago 2 days ago
Rust TypeScript
GNU General Public License v3.0 or later Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

c2rust

Posts with mentions or reviews of c2rust. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-10.
  • Converting the Kernel to C++
    3 projects | news.ycombinator.com | 10 Jan 2024
    A recent practical example of the former: the fish shell re-wrote incrementally from C++ to Rust, and is almost finished https://github.com/fish-shell/fish-shell/discussions/10123

    An example of the latter: c2rust, which is a work in progress but is very impressive https://github.com/immunant/c2rust

    It currently translates into unsafe Rust, but the strategy is to separate the "compile C to unsafe Rust" steps and the "compile unsafe Rust to safe Rust" steps. As I see it, as it makes the overall task simpler, allows for more user freedom, and makes the latter potentially useful even for non-transpiled code. https://immunant.com/blog/2023/03/lifting/

  • Best tools to convert code between languages?
    1 project | /r/learnprogramming | 11 Apr 2023
    But not all transpilers are between languages where at least one of them is designed to be transpiled. For example, c2rust can transpile, as the name suggests, C to (ugly, unsafe) Rust. A while ago there was a Java -> C compiler in GCC (GCJ), but it's pretty out of date now.
  • Translate C code to Rust working with libc
    1 project | /r/rust | 3 Apr 2023
    I do not know about your specific issue but you may be interested by https://github.com/immunant/c2rust
  • Rewrite in Rust or Use Rust-bindings
    1 project | /r/rust | 21 Mar 2023
    You should also consider using C2Rust (they're even working on C -> safe Rust translation)
  • Emitting Safer Rust with C2Rust
    3 projects | news.ycombinator.com | 15 Mar 2023
    > The date at the bottom of the article is 2022-06-13. Has there been further progress?

    The article links to their github repo:

    https://github.com/immunant/c2rust

    There's commits in the last hour, so at least some signal of life.

  • Writing an OS in Rust to run on RISC-V
    8 projects | news.ycombinator.com | 1 Mar 2023
    This is arguably already the state of things.

    Rust might get compiled down through MIR, down through LLVM IR, down to assembly or wasm... which then might be JIT or AOT (re)compiled into other bytecodes... which might perhaps be decompiled back up to C... and C might be retranslated back to horrific unsafe-spamming Rust by the likes of https://c2rust.com/. We've come full circle!

    The main issue is that retranslating high level languages into other high level languages isn't something that there's actually a lot of demand for, especially commercially, especially given the N x M translation matrix going on. So a lot of the projects "stabilize" (get abandoned). And automatically translating between the idioms of those languages gets even nastier in terms of matrix bloat.

    Well, you've got stuff like MSIL and JVM bytecodes which are higher level, and preserve more type information, and can be compiled to / decompiled from while still preserving more structure, but they still form competing incompatible ecosystems.

  • Will Carbon Replace C++?
    14 projects | news.ycombinator.com | 27 Feb 2023
    That's the wrong direction. What's needed are intelligent converters which convert less-strict languages to more-strict ones.

    Non-intelligent converters just make a mess. Here's c2rust.[1]

    Classic C++ to modern C++, plus a compiler flag to lock out all the old unsafe stuff, would be an achievement.

    [1] https://c2rust.com/

  • What would you rewrite in Rust?
    44 projects | /r/rust | 11 Feb 2023
  • Red Black Tree in Rust
    4 projects | /r/rust | 4 Jan 2023
    Well, technically, it's not hard to build such data structures. If you are willing to liberally use raw pointers, UnsafeCell, MaybeUninit and ManuallyDrop, then you can more-or-less write C-equivalent code in unsafe Rust. (there are even transpilers from C to Rust)
  • In Rust We Trust โ€“ A Transpiler from Unsafe C to Safer Rust
    1 project | /r/programmingcirclejerk | 5 Dec 2022
    /uj This transpiles from C to unsafe Rust using an existing tool, then strips the unsafe keyword from the generated function signatures

TypeScript

Posts with mentions or reviews of TypeScript. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-25.
  • JSR Is Not Another Package Manager
    2 projects | news.ycombinator.com | 25 Apr 2024
    Regular expressions are part of the language, so it's not so unreasonable that TypeScript should parse them and take their semantics into account. Indeed, TypeScript 5.5 will include [new support for syntax checking of regular expressions](https://github.com/microsoft/TypeScript/pull/55600), and presumably they'll eventually be able to solve the problem the GP highlighted on top of those foundations.
  • TypeScript Essentials: Distinguishing Types with Branding
    2 projects | news.ycombinator.com | 24 Apr 2024
    Dedicated syntax for creating unique subsets of a type that denote a particular refinement is a longstanding ask[2] - and very useful, we've experimented with implementations.[3]

    I don't think it has any relation to runtime type checking at all. It's refinement types, [4] or newtypes[5] depending on the details and how you shape it.

    [1] https://github.com/microsoft/TypeScript/blob/main/src/compil...

  • What is an Abstract Syntax Tree in Programming?
    13 projects | dev.to | 5 Apr 2024
    GitHub | Website
  • Smart Contract Programming Languages: sCrypt vs. Solidity
    2 projects | dev.to | 5 Apr 2024
    Learning Curve and Developer Tooling sCrypt is an embedded Domain Specific Language (eDSL) based on TypeScript. It is strictly a subset of TypeScript, so all sCrypt code is valid TypeScript. TypeScript is chosen as the host language because it provides an easy, familiar language (JavaScript), but with type safety. Thereโ€™s an abundance of learning materials available for TypeScript and thus sCrypt, including online tutorials, courses, documentation, and community support. This makes it relatively easy for beginners to start learning. It also has a vast ecosystem with numerous libraries and frameworks (e.g., React, Angular, Vue) that can simplify development and integration with Web2 applications.
  • Understanding the Difference Between Type and Interface in TypeScript
    1 project | dev.to | 2 Apr 2024
    As a JavaScript or TypeScript developer, you might have come across the terms type and interface when working with complex data structures or defining custom types. While both serve similar purposes, they have distinct characteristics that influence when to use them. In this blog post, we'll delve into the differences between types and interfaces in TypeScript, providing examples to aid your understanding.
  • Type-Safe Fetch with Next.js, Strapi, and OpenAPI
    8 projects | dev.to | 2 Apr 2024
    TypeScript helps you in many ways in the context of a JavaScript app. It makes it easier to consume interfaces of any type.
  • Proposal: Types as Configuration
    1 project | news.ycombinator.com | 1 Apr 2024
  • How to scrape Amazon products
    4 projects | dev.to | 1 Apr 2024
    In this guide, we'll be extracting information from Amazon product pages using the power of TypeScript in combination with the Cheerio and Crawlee libraries. We'll explore how to retrieve and extract detailed product data such as titles, prices, image URLs, and more from Amazon's vast marketplace. We'll also discuss handling potential blocking issues that may arise during the scraping process.
  • Shared Tailwind Setup For Micro Frontend Application with Nx Workspace
    6 projects | dev.to | 29 Mar 2024
    TypeScript
  • Building a Dynamic Job Board with Issues Github, Next.js, Tailwind CSS and MobX-State-Tree
    6 projects | dev.to | 28 Mar 2024
    Familiarity with TypeScript, React and Next.js

What are some alternatives?

When comparing c2rust and TypeScript you can also consider the following projects:

min-sized-rust - ๐Ÿฆ€ How to minimize Rust binary size ๐Ÿ“ฆ

zod - TypeScript-first schema validation with static type inference

subsurface - This is the official upstream of the Subsurface divelog program

Flutter - Flutter makes it easy and fast to build beautiful apps for mobile and beyond

librope - UTF-8 rope library for C

Tailwind CSS - A utility-first CSS framework for rapid UI development.

checkedc - Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors. Checked C does not address use-after-free errors. This repo has a wiki for Checked C, sample code, the specification, and test code.

zx - A tool for writing better scripts

zz - ๐Ÿบ๐Ÿ™ ZetZ a zymbolic verifier and tranzpiler to bare metal C [Moved to: https://github.com/zetzit/zz]

esbuild - An extremely fast bundler for the web

rtorrent - rTorrent BitTorrent client

gray-matter - Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert