# writing c with indent-based syntax similar to coffeescript or python part of [c programming](/computer/guides/c.html) by combining [wisp](https://www.draketo.de/software/wisp) syntax with [sc](https://github.com/sph-mn/sph-sc#installation), which only depends on [guile](https://www.gnu.org/software/guile/), it is possible to write c with indent semantics, and fewer brackets, similar to [coffeescript](https://coffeescript.org/) or python. sc is a scheme-like notation for c. it can be used on its own to write c. wisp, whitespace to lisp, is a notation for scheme expressions that allows indentation in-place of round brackets. # how it looks ~~~ pre-include "stdio.h" define (main argc argv) : int int char** declare i int printf "the number of program arguments passed is %d\n" argc for : (set i 0) (< i argc) (set+ i 1) printf "argument %d is %s\n" (+ i 1) (array-get argv i) return 0 ~~~ # what you need * [gnu guile](https://www.gnu.org/software/guile/), which is usually available in package repositories or already installed * [sc](https://github.com/sph-mn/sph-sc#installation) # usage examples given a file with contents in wisp syntax with sc semantics, the following shell examples demonstrate usage via standard standard input/output. display c code ~~~ sc myfile.scw ~~~ write to file ~~~ sc myfile.scw > output.c ~~~ display formatted c using clang-format ~~~ sc myfile.scw | clang-format ~~~ # motivation as the author of sc, i use sc in several c projects and found that with the imperative style of c, most lines tend to be simple operations, in what is like a column of commands. translated to scheme-like syntax, many lines start with a round bracket and have a nesting scope that ends on the same line, which can appear syntactically noisy. # interesting links * [nobraces](https://blog.brush.co.nz/2007/09/nobraces/) had a similar idea