https://github.com/returnstring/dogesharp
much language, so programming, very .NET
https://github.com/returnstring/dogesharp
Last synced: 5 months ago
JSON representation
much language, so programming, very .NET
- Host: GitHub
- URL: https://github.com/returnstring/dogesharp
- Owner: returnString
- License: mit
- Created: 2014-08-02T22:37:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-25T19:04:00.000Z (over 11 years ago)
- Last Synced: 2025-04-07T17:51:29.413Z (10 months ago)
- Language: C#
- Size: 557 KB
- Stars: 237
- Watchers: 19
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# D# (DogeSharp)
[](https://ci.appveyor.com/project/returnString/dogesharp)
D# is a programming language for Doge fans.
*Huge disclaimer: I have no idea what I'm doing, and definitely shouldn't write languages.*
You can shout ideas at me on Twitter: [@returnString](https://twitter.com/returnString)
People have asked for a Dogecoin donation address, so I set this up: DAvLTZVRz9zg3wWjU5BbkjRR5ojnLJsunG
```
many System
much MyClass
very MyClass many int x much public
data so x;
such data so int much readonly
much Program
very Main so void much static
such rand gimme Random;
such x plz rand.Next;
wow x;
such instance gimme MyClass many 1;
wow instance.data;
```
# Language
## Constructs
* `many ` - using statement for namespace
* `much ...` - declare a type
* `very so [many ] [much ]` - declare a method
* `very [much ]` - declare a constructor
* `such ;` - declare and assign a local variable
* `plz [many ]` - call a method
* `so maths ` - use mathematical operators
* `wow ;` - print to console
* `amaze ;` - return a value
# Usage
## Compiling .ds files
Files with a ds extension are considered D# files. We use the `dsc` command-line tool (D# compiler) to convert these to either a .NET executable or DLL.
`dsc.exe /target:exe /out:MyProgram.exe MyProgram.ds`
`dsc` currently uses a translation step to generate .NET code, by converting .ds files into .cs files for the C# compiler behind the scenes. To see the generated files, use the /PreserveTranslated command-line option.
# Building
## Dependencies
* ANTLR v4 (Nuget)
* Java v1.6+
## From source
`git clone https://github.com/returnString/DogeSharp.git`
Windows: Open the solution in VS and build, or use MSBuild from cmd.
Unix: Use build_grammar.sh to generate the necessary ANTLR files from the grammar, then build the project inside Xamarin Studio or use xbuild from a terminal.
The build process first takes DogeSharp.csproj and outputs the `dsc` tool. Then, we invoke `dsc` for the sample projects as specified in build.bat/sh. This way, we can test the entire process from inside VS.