summaryrefslogtreecommitdiffhomepage
path: root/doc/coding_conventions.md
blob: 646a052eb0bcf3404fd129b38665c7dc78f122e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Coding conventions

How to style your C and Ruby code which you want submit to mruby.

## C code

The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is written in the C programming language. Please note the following hints for your C code:

+ comply with C99 [ISO/IEC 9899:1999]
+ don't use C++ style comments, only use /* ... */
+ reduce library dependencies to a minimum
+ insert a break after the method return value:

    int
    main(void)
    {
      ...
    }

## Ruby code

Parts of the standard library of mruby is written in the Ruby programming language itself. Please note the following hints for your Ruby code:

+