RapydScript  by atsepkov

Pre-compiler for JavaScript with Python-inspired syntax

created 12 years ago
690 stars

Top 50.2% on sourcepulse

GitHubView on GitHub
Project Summary

RapydScript is a pre-compiler that allows developers to write JavaScript code using a syntax heavily inspired by Python. It aims to provide a cleaner, more readable alternative to CoffeeScript and other Python-to-JavaScript transpilers, offering Pythonic features like list comprehensions, decorators, and optional function arguments while maintaining performance parity with native JavaScript.

How It Works

RapydScript translates Python-like syntax into optimized JavaScript. Key features include intelligent scoping (reducing the need for var), type inference for hybrid-typing, and direct integration with existing JavaScript libraries and the DOM. It compiles to standard JavaScript, ensuring broad browser compatibility. The compiler itself is self-hosting, written in RapydScript.

Quick Start & Requirements

  • Install: npm install rapydscript -g (for CLI) or npm install rapydscript (for programmatic use).
  • Requirements: Node.js.
  • Compilation: rapydscript <input_file> [-o <output_file>]
  • Docs: https://github.com/atsepkov/RapydScript

Highlighted Details

  • Pythonic syntax: includes list/dict comprehensions, decorators, def for functions, and Python's import system.
  • Hybrid-typing: supports static typing with type inference for better error detection and optimization.
  • Deep equality operators (==, !=) with no performance overhead over native JavaScript.
  • Automatic new keyword insertion for classes and external classes.

Maintenance & Community

Licensing & Compatibility

  • The README does not explicitly state a license. This is a significant omission for an open-source project.

Limitations & Caveats

  • The project's maintenance status is unclear, with no recent activity mentioned.
  • The absence of a stated license is a critical blocker for adoption, especially for commercial use.
  • Support for older Internet Explorer versions is deprecated, though can be restored with tools like Babel.js.
Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Starred by Simon Willison Simon Willison(Author of Django), Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), and
1 more.

GPT-3-Encoder by latitudegames

0%
719
JS library for GPT-2/GPT-3 text tokenization
created 4 years ago
updated 2 years ago
Feedback? Help us improve.