All Projects → wmww → Python Plus Plus

wmww / Python Plus Plus

Licence: wtfpl
A framework for creating Python/C++ polyglots, programs valid in both programming languages

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Python Plus Plus

Enso Archive
Looking for Enso, the visual programming language? ➡️ https://github.com/enso-org/enso
Stars: ✭ 305 (+121.01%)
Mutual labels:  polyglot
Konfig
Composable, observable and performant config handling for Go for the distributed processing era
Stars: ✭ 597 (+332.61%)
Mutual labels:  polyglot
Terrastack
This project is archived, but the idea of Terrastack lives on in the Terraform CDK. - https://github.com/hashicorp/terraform-cdk
Stars: ✭ 71 (-48.55%)
Mutual labels:  polyglot
Sample Programs
Sample Programs in Every Programming Language
Stars: ✭ 323 (+134.06%)
Mutual labels:  polyglot
Cosmopolitan
build-once run-anywhere c library
Stars: ✭ 6,324 (+4482.61%)
Mutual labels:  polyglot
Htshells
Self contained htaccess shells and attacks
Stars: ✭ 708 (+413.04%)
Mutual labels:  polyglot
ipolyglot
A polyglot kernel for Jupyter notebooks based on GraalVM.
Stars: ✭ 59 (-57.25%)
Mutual labels:  polyglot
Projecteuler
Polyglot solutions for www.projecteuler.net mathematical challenges
Stars: ✭ 137 (-0.72%)
Mutual labels:  polyglot
Vim Doge
(Do)cumentation (Ge)nerator 10+ languages 📚 Generate proper code documentation skeletons with a single keypress. ⚡️🔥
Stars: ✭ 533 (+286.23%)
Mutual labels:  polyglot
O
🌀 Text editor suitable for writing git commit messages and editing Markdown files. Can build executables and jump to errors at the press of `ctrl-space`, for several programming languages. Can format code with `ctrl-w`. Provides general syntax highlighting, rainbow parenthesis and cut/paste portals. o is intentionally limited to VT100.
Stars: ✭ 54 (-60.87%)
Mutual labels:  polyglot
Coherence
Oracle Coherence Community Edition
Stars: ✭ 328 (+137.68%)
Mutual labels:  polyglot
Enso
Hybrid visual and textual functional programming.
Stars: ✭ 5,238 (+3695.65%)
Mutual labels:  polyglot
Microservices
A microservices environment managed by Docker Compose.
Stars: ✭ 16 (-88.41%)
Mutual labels:  polyglot
Dexec
🐳 Command line interface for running code in many languages via Docker.
Stars: ✭ 314 (+127.54%)
Mutual labels:  polyglot
Tweetable Polyglot Png
Pack up to 3MB of data into a tweetable PNG polyglot file.
Stars: ✭ 299 (+116.67%)
Mutual labels:  polyglot
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: ✭ 302 (+118.84%)
Mutual labels:  polyglot
Core
MetaCall: The ultimate polyglot programming experience.
Stars: ✭ 596 (+331.88%)
Mutual labels:  polyglot
Hof
The High Code Framework (low-code for devs)
Stars: ✭ 138 (+0%)
Mutual labels:  polyglot
Python Chess
A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication
Stars: ✭ 1,341 (+871.74%)
Mutual labels:  polyglot
Kundera
A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
Stars: ✭ 892 (+546.38%)
Mutual labels:  polyglot

Python++

A framework for cross language development

About

Python++ is a framework for creating Python/C++ polyglots, programs valid in both programming languages. Specifically, it is a collection of guidelines and boilerplate that allows you to write a single program which will produce the same output when compiled with a C++14 compiler or run with a Python3 interpreter. It does this with heavy usage of C style macros and numerous hacks of the syntax of both languages. No external transpiler or preprocessor (aside from the standard C/C++ preprocessor) is needed. The exact same Python++ file can be fed in unmodified to a stock C++ compiler and a stock Python interpreter and you will get the same output. The first version of Python++ was developed by William W Wold for the Stupid Shit No One Needs and Terrible Ideas Hackathon 2017.

Overview

Python++ consists of 3 things:

  1. ppp.ppp: This is itself a polyglot that can be copied to the top of your Python++ source, or placed alongside it and imported.
  2. guide.md: A comprehensive guide to writing Python++ programs.
  3. examples: examples of programs written in Python++.

Running

With Python

Running Python++ programs with Python3 is easy. Simply enter

python3 your_source_file.ppp

With C++

It is a bit trickier to compile as C++ because the compiler doesn't recognize .ppp as a valid file extension by default. Also, you need support for C++14. With a recent version of GCC, the following command works:

g++ -x c++ -std=c++14 your_source_file.ppp -o output_binary

-std=c++14 seems to be default on my system, but better to make it explicit. If you want to use an IDE or a different compiler I'm sure you can figure it out. If you do, feel free to edit this readme with instructions and send in a pull request.

Test Script

test.sh is a BASH script that automatically tests the given source code with both Python and C++. You must have Python3 and gcc installed to use it. It reports if the program worked with Python, if it worked with C++ and if the outputs from the two languages match, as well as displaying the output and any error messages.

Contributing

If you want to add a feature or fix a bug/typo, please do so and send in a pull request.

License

Python++ is licensed under the permissive Do What The Fuck You Want To Public License (WTFPL). See COPYING for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].