
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
CrossLang is a Python library that allows developers to run code written in various programming languages directly from their Python scripts. This can be particularly useful for multi-language projects, testing, and automation.
Supports multiple programming languages including Rust, C, Java, Ruby, Lua, Go, JavaScript, PHP, Perl, Scala, Shell, and Kotlin. Automatically compiles and runs code snippets. Easy to integrate into existing Python projects.
To install CrossLang, you can use pip:
pip install python-crosslang
CrossLang relies on various external compilers and interpreters to execute code in different languages. You can use the provided installation scripts to set up the necessary dependencies.
For Unix-based Systems (Linux/macOS): Run the following script to install the required compilers and interpreters:
chmod +x debian.sh; ./debian.sh
For Arch Linux:
Run the following script to install the required compilers and interpreters:
chmod +x arch.sh; ./arch.sh
For Windows:
Run the following PowerShell script to install the required compilers and interpreters:
.\windows.ps1
Here's an example of how to use CrossLang in your Python script:
from CrossLang import Translator
# Running Rust code
code = """
fn main() {
println!("Hello, world!");
}
"""
output = Translator('rust', code)
print(output)
# Running C code
code = """
#include <stdio.h>
int main() {
printf("Hello, World!\\n");
return 0;
}
"""
output = Translator('c', code)
print(output)
# Running Java code
code = """
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
"""
output = Translator('java', code)
print(output)
FAQs
A Python library to run code from multiple programming languages.
We found that python-crosslang demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.