https://github.com/pyos/dg
A programming language for the CPython VM.
https://github.com/pyos/dg
language programming-language python
Last synced: 11 days ago
JSON representation
A programming language for the CPython VM.
- Host: GitHub
- URL: https://github.com/pyos/dg
- Owner: pyos
- License: mit
- Created: 2014-03-04T09:19:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-06-20T12:21:52.000Z (over 5 years ago)
- Last Synced: 2024-07-22T01:33:34.967Z (over 1 year ago)
- Topics: language, programming-language, python
- Language: Python
- Homepage: http://pyos.github.io/dg/
- Size: 5.46 MB
- Stars: 576
- Watchers: 24
- Forks: 20
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-functional-python - dg (aka dogelang) - "A programming language that compiles to CPython bytecode, much like Scala compiles to JVM's. That essentially means that dg is an alternative syntax for Python 3." (Awesome Functional Python / Languages)
README
## dg
A (technically) simple language that compiles to CPython bytecode. **DISCLAIMER**: this project is just for fun, please don't use it for anything serious, thanks.
### Requirements
CPython 3.4 or any other Python VM with equivalent bytecode (like PyPy3).
### Installation
```sh
pip3 install git+https://github.com/pyos/dg
```
### Usage
```sh
python -m dg
python -m dg file.dg argument1 argument2
python -m dg <<< 'print "Hello, World!"'
echo 'print "Hello, World!"' > dg_module.dg; python -c 'import dg, dg_module'
```
### More complex stuff
[http://pyos.github.io/dg/](http://pyos.github.io/dg/)
### Text editor support
* [Sublime Text and TextMate bundle](https://github.com/pyos/dg-textmate)
* [GEdit/GtkSourceView syntax definition](https://github.com/pyos/dg-gedit)
* [vim plugin](https://github.com/rubik/vim-dg) (courtesy of [Michele Lacchia](https://github.com/rubik))
* [Atom syntax](https://atom.io/packages/language-dg) (by [Ale](https://github.com/iamale))
### To-do
* String interpolation: `i"{expression #flags}"` == `"{:flags}".format expression`
* Tools for easy AST manipulation.
* Compiler extension API.
* Some of the more obscure Python features: exception causes, function annotations.