An open API service indexing awesome lists of open source software.

https://github.com/ringabout/nimish

Make Nim language support C macro for fun. :-)
https://github.com/ringabout/nimish

Last synced: about 1 year ago
JSON representation

Make Nim language support C macro for fun. :-)

Awesome Lists containing this project

README

          

# nimish
Make Nim support C macro for fun!

## Usage

**translate single file**

```bash
nimish example.nish
```

**translate all files(must be with the extension ".nish")**
```bash
nimish --all
nimish -a
```

**Run as Nim file**

You can pass the same parameters as normal Nim's file, make
sure filename is at the end of the parameters list.

```bash
nimish c -r example.nish
```

## Example

**example.nish**

```nim
#define text 12
#define name "string"
#define Add(a, b) a + b

proc hello(a: int) =
echo "Hello, World!"
echo text
echo Add(3, 4)
echo name
```

Type `nimish example.nim.c` ->

**example.nim**
```nim

# 1 "example.nim.c"
# 1 ""
# 1 ""
# 1 "example.nim.c"

proc hello(a: int) =
echo "Hello, World!"
echo 12
echo 3 + 4
echo "string"
```