Skip to content

piravelha/GRP.c

Repository files navigation

GRP /grape/

This is an alternative implementation of GRP, that compiles to C.

What is GRP?

GRP is a dynamically-typed, stack-based programming language, with the goal of being approachable to begginers, but also satifsy more advanced needs.

Snippets

Printing Numbers

10 Print

Output:

10

Operators

All built-in functions in GRP have operator variants, here a a few intresting ones:

Plus        ; +
Minus       ; -
Times       ; *
Div         ; /
Print       ; <?
Show        ; ?
Map         ; <$>
Filter      ; <&>
Reduce      ; <.>
Sum         ; <+>
Product     ; <*>
Concat      ; ++
Head        ; <*
Tail        ; *>>
Length      ; #
Cons        ; :>

Custom Operators

You can define a custom variable/function/operator as follows:

MyNumber (@) :: 10 5 + ::

And then you can use as follows:

MyNumber <?
; or
@ <?
; (<? is the 'Print' operator)

Note that the operator form is optional, and you do not need to include it when defining a new variable

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published