Skip to content

Instantly share code, notes, and snippets.

@aisk
Last active June 22, 2019 04:56
Show Gist options
  • Save aisk/5734797 to your computer and use it in GitHub Desktop.
Save aisk/5734797 to your computer and use it in GitHub Desktop.
berserker lang hello world example
using std;
using assert;
func main = ()=> int {
list<int> l = [0, 1, 2, 3, 4, 5];
dict<char*, int> d = {
"one": 1,
"two": 2,
"tree": 3,
};
assert(l[1] == 1);
assert(d[1] == 1);
}
using stdio;
import string;
// berserker lang hello world example
func main = ()=> int {
add(1, 2);
char* msg = "Hello World!";
string:strlen(msg);
prrintf(msg);
return 0;
}
func add = (int x, int y)=> int {
return x + y;
}
#include <stdio.h>
#include <string.h>
// berserker lang hello world example
int add(int x, int y);
int main () {
add(1, 2);
char* msg = "Hello World!";
strlen(msg);
prrintf(msg);
return 0;
}
int add (int x, int y) {
return x + y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment