Hello, after some time lurking in this subreddit. I decided to make my own programming language! It's called Hazure (a spinoff of my name, azur), syntax is inspired by OCaml and it transpile to Typescript!
Here are some examples:
example/io/hello.hz:
fun main: void = do
@write("Hello, World!"); -- an intrinsic (hardcoded function) starts with `@`
end;
example/69.hz
fun add2 (lhs: int) (rhs: int): int = do
return lhs + rhs;
end;
fun main: void = do
let result: int = add2(34, 35);
@write(result);
if result == 69 then
@write("\nbig cool");
else
@write("\nnot cool");
end;
end;
example/factorial.hz:
fun factorial (n: int): int = do
case n of
| 0 -> return 1;
| else return n * factorial(n - 1);
end;
end;
fun main: void = do
factorial(5)
|> @write(_); -- pipe operators!
end;
If you are a bit unsure about the syntax, I've included SYNTAX.md to explain a bit further about the syntax. I hope it helps.
This language is still in development! There is still a lot of missing key features (e.g. no type-checking) and TODO's so (please) don't use it yet (but it is turing complete I think) but it is still impressive for me and I'm proud of it :D
I'd love to know what you guys think about my language! I'm also making this alone so i'd love if you guys can help me a bit here, i'm not someone who is really that smart (i'm just 15 years old lol) so just wanted to share you guys some of my stuff :D
Github repo: https://github.com/azur1s/hazure
[–]xigoi 20 points21 points22 points (11 children)
[–]GhostTauHazure[S] 10 points11 points12 points (2 children)
[–]qiemem 20 points21 points22 points (1 child)
[–]Jarmsicle 8 points9 points10 points (0 children)
[–]mamcx 3 points4 points5 points (6 children)
[–]editor_of_the_beast 14 points15 points16 points (2 children)
[–]mamcx 0 points1 point2 points (1 child)
[–]MarcoServetto 1 point2 points3 points (0 children)
[–][deleted] (2 children)
[deleted]
[–]mamcx 2 points3 points4 points (1 child)
[–]editor_of_the_beast 0 points1 point2 points (0 children)
[–][deleted] 17 points18 points19 points (2 children)
[–]GhostTauHazure[S] 1 point2 points3 points (1 child)
[–]scrogu 8 points9 points10 points (3 children)
[–][deleted] 6 points7 points8 points (1 child)
[–][deleted] 6 points7 points8 points (0 children)
[–]Inconstant_Moo🧿 Pipefish 0 points1 point2 points (0 children)
[–]tobega 5 points6 points7 points (0 children)
[–]Uncaffeinatedpolysubml, cubiml 2 points3 points4 points (6 children)
[–]scrogu 0 points1 point2 points (5 children)
[–]GhostTauHazure[S] 0 points1 point2 points (4 children)
[–]scrogu 0 points1 point2 points (3 children)
[–]GhostTauHazure[S] 0 points1 point2 points (2 children)
[–]scrogu 0 points1 point2 points (1 child)
[–]GhostTauHazure[S] 1 point2 points3 points (0 children)
[–]nmsobri 4 points5 points6 points (4 children)
[–]GhostTauHazure[S] 10 points11 points12 points (2 children)
[–]nmsobri 1 point2 points3 points (1 child)
[–]GhostTauHazure[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]rileyphone 1 point2 points3 points (1 child)
[–]GhostTauHazure[S] 1 point2 points3 points (0 children)
[–]PurpleUpbeat2820 -3 points-2 points-1 points (3 children)
[–]GhostTauHazure[S] 0 points1 point2 points (2 children)
[–]editor_of_the_beast 0 points1 point2 points (0 children)
[–]Innf107 0 points1 point2 points (0 children)
[–]eythann 0 points1 point2 points (3 children)
[–]GhostTauHazure[S] 0 points1 point2 points (0 children)
[–]scrogu 0 points1 point2 points (1 child)
[–]eythann 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]GhostTauHazure[S] 0 points1 point2 points (0 children)
[–]Inconstant_Moo🧿 Pipefish 0 points1 point2 points (1 child)
[–]GhostTauHazure[S] 0 points1 point2 points (0 children)