Hacker News new | ask | show | jobs
by yokohummer7 2573 days ago
This is another language whose syntax is similar to Rust's. I wonder why the author chose it, in spite of its Go heritage.
2 comments

Also yet another language called 'Monkey'.

There's already Monkey C used to develop for Garmin devices, and the Monkey/MonkeyX/Monkey2 family by Mark Sibly (of Amiga Blitz Basic fame).

I originally thought this post was related to Mark Sibly's trans-compiler, which I used in the past and enjoyed quite a bit: http://monkeycoder.co.nz/
I'd say it's more similar to Javascript. In fact all of the examples are valid JS if you replace `fn` with `function`. (Although JS doesn't have implicit returns.)

At a guess, the author chose the syntax because it's familiar and easy to parse. Go's syntax is... eccentric where it differs from typical C-style languages.

Author here. Yes, that's exactly right. I wanted to show how to write a parser/interpreter for something that you encounter every day. JavaScript-like syntax, with curly braces and `if`/`else` is just that.