
Mun Programming Language - doppp
https://mun-lang.org/
======
baszalmstra
One of the creators here. I appreciate the upvotes but its way too soon for
that. Mun is currently in the very very early stages of development. It
originated out of frustrations with Lua game development at Abbey Games. Lua
is a great language but lacks performance, refactoring functionality and
doesn't scale well with modern technology. However, there is no real
alternative when it comes to code iteration times.

I do understand some of the comments questioning the publication of a website
for a programming language that isn't even finished. Our goal was to have a
platform to share progress and gauge interest on the topic to further help us
develop Mun. We feel like there is no point in developing a programming
language in private. Instead we want to actively engage with the community
while developing Mun.

The website does state that its still in very early development. Should we
emphasize this more?

~~~
gravypod
What does mun plan to do that will improve performance over luajit?

~~~
baszalmstra
LuaJIT performance on PC is very fast when its using the JIT. However, on
consoles and some mobile platforms JITing is not allowed due to not being
allowed to write to executable memory for security reasons.

Mun compiles to machine code with LLVM so it should be very fast as well,
hotloading overhead can be completely removed in builds where hotloading is
not required (production builds for instance). Mun should therefor be able to
run as fast as native code on all platforms.

~~~
gravypod
Since Mun targets LLVM could it also be output to WASM to be using in-browser
for HTML5 builds?

~~~
baszalmstra
In theory yes, but we have to look into that some more. At this point we only
target Windows, MacOS and Linux but WASM is definitely on our list.

------
HelloNurse
After reading the web site, I looked at the sources (e.g.
mun/crates/mun_syntax/tests/data/parser/ok/) because my disbelief was
unusually stretched, and it seems that the examples and explanations in the
almost nonexistent documentation cover fairly well the almost nonexistent
features.

Why publish a project that, while already showing technical proficiency (the
Twitter timeline suggests only 2-3 months of work), is still a very long way
to do something useful, let alone compete with other programming languages?
The fashionable web site layout adds insult to injury instead of looking good.

~~~
gotodengo
I've been working on a game project over the past year. Everyone I had shown
videos to was supportive. I felt like I got a lot done in a short few months.
But no one other than myself had gotten their hands on the game proper.

I had planned on doing a single point of release when it was finished. I'd
done that with a game release before however. After months of work release day
came, the game flopped, and by a week later it was more or less lost to the
void. Not wanting the same to happen on this project I changed my mind and
released it as it was one random weekend.

It had very little documentation, and even worse known bugs and crashes. But a
couple people downloaded it and one guy liked the concept enough to kick me
$5. By the next week I had some more info on what those people liked and what
they could live without. I had motivation to fix some bugs that I had learned
to work around in my using of the game. My development rate on the game has
gone up significantly since releasing it in an unfinished state, and the
community is very small but two months later the game hasn't dropped into the
internet void.

I can sympathize with the mindset of "I've been working on this in a vacuum
and just want someone else to see it, warts (or lack of content) and all". In
my case it's worked out for the benefit of the project as well.

------
lasagnaphil
There's not that much work done to be able to comment something about this
language; maybe it would be interesting after about a year or two.

It is entirely possible to create a statically-typed language with C-like
performance and scripting-language-like interactivity (the most similar is
Julia, which also uses LLVM under the hood), but the details would be pretty
complex enough to make this quite a big project.

Still, it's good to see there are languages other than Jai trying to compete
in the rather niche gamedev programming space.

------
crudbug
Can we have a consistent function notation

fn name(a: int, b: int) -> void {}

This also helps with clean functional type arguments.

swift and rust support this.

A single consistent notation will be helpful for new polyglots.

~~~
13415
What's the purpose of the stylized ASCII arrow "->" / why is it needed?

~~~
lytedev
Looks like it denotes return type? Are you implying it can be omitted
syntactically because the closing paren implies the return type would follow?

~~~
leshow
Depends on the language but in Haskell, the (->) arrow is a function type
constructor (i.e. constructs function at type level) where a -> b constructs a
function type from a to b.

This is often chained to produce functions that 'take multiple arguments'.
i.e. a -> b -> b. I put that in quotations because in reality all functions
take only one argument, this is called currying. It gives functions
flexibility in that you can partially apply them at will.

In languages like Rust and Swift, the syntax is (a: A, b: B) -> B. Because
these languages are "uncurried", they use the syntax of uncurried functions.
Meaning, they cannot be readily partially applied.

------
sitkack
This is written in Rust, and the reloading mechanism looks like it aims to hot
reload Rust libraries. So this could be used as a development workbench to
glue together Rust libraries, think Python gluing a bunch of C++ libs
together.

Language wise, it looks like it is in the Swift/Julia/Haxe space but with
first class support for Rust. This looks interesting, I wish them luck and
would love to use this in the future.

Two other languages to check out are

Dyon,
[https://github.com/PistonDevelopers/dyon](https://github.com/PistonDevelopers/dyon)

Gluon, [https://github.com/gluon-lang/gluon](https://github.com/gluon-
lang/gluon)

------
skybrian
Dart, Java, and I assume other languages have some support for hot reloading.
It would be interesting to read how they plan to do it better.

~~~
cwyers
It looks like the intent of this language is something that can replace Lua as
an embedded language in games and other applications that require scripting,
without the overhead of requiring JIT compilation to be performant (which you
can't have on iOS). The JVM is a bad candidate for that. I believe Dart uses
JIT as well.

~~~
swsieber
Dart can do AOT compilation as well.

------
adamnemecek
[https://github.com/mun-lang/mun](https://github.com/mun-lang/mun)

------
dimitar
I think a modernized Lisp (the program is composed of many tiny expressions
that can be reevaluated) can shine when hot-reloads are highly desirable.

Isn't static typing kindof clashing with the hot reloading focus anyway? Maybe
make it possible to add the types later.

------
Phillips126
I just started learning and using Nim[0] (which recently hit release 1.0),
this language appears to be very similar - statically typed, can use llvm,
cross-compile, similar looking syntax. I'll be keeping an eye on this language
as it looks like it will pair well with Rust. Looking forward to seeing some
documentation. Keep up the good work!

[0] [https://nim-lang.org/](https://nim-lang.org/)

------
tom_mellior
Standard "new programming language" question(s): What's the memory management
aspect like? Is there garbage collection?

LLVM has some support for garbage collection, but I've never heard of any
language implementors actually being happy with what it offered in terms of
features, correctness, and performance. (Counterexamples would be welcome.)

------
hybrids
To me the most ideal form of hot-reloading and runtime compilation is probably
the approach found in Scopes. While it leverages the LLVM MCJIT, it takes the
approach of having compilation done when the programmer specifically wants it
to be done, making it less of a "JIT" and more of a "runtime AOT"

------
voldacar
From the goals and bits of code, this looks a lot like Zig. What about Mun
makes it distinct from Zig and the other little imperative LLVM languages that
have been coming out recently (Zig, V, and a couple others come to mind)?

~~~
baszalmstra
Mun is primarily focused on hotloading, the ability to change your code while
its running. Our goal is to enable hotloading of all constructs including
structs (similar to how Lua works) and without having to annotate anything.

~~~
childintime
So, why do we need yet another language to reap hot-reloading, instead of
adding it to say Rust, Zig or (blow me) Jai? Is there something about those
languages that complicates hot-reloading?

~~~
baszalmstra
Jai is actually closed source, so that was not an option. But in general there
are no predefined best practices for achieving hot reloading of both functions
and data. Experimenting with those while also fighting with complex compilers
makes the problem space exponentially more intractable.

------
aabbcc1241
The syntax of code snippet looks like go and typescript, they don't support
hot reload thought. Why do you choose to create a new language, instead adding
features you miss into existing language ?

------
ohazi
Too early for KSP jokes? Munshot language?

~~~
baszalmstra
Actually:

1\. Mun exists because of frustrations with Lua.

2\. Lua means "moon" in Portuguese.

3\. The "moon" in KSP is named: Mun.

Voila

~~~
cpeterso
How do you pronounce "Mun"? Does it rhyme with "sun" or "soon"?

~~~
baszalmstra
like sun and mundane

------
ajcodez
Off topic but it would be cool to have function types use just > for brevity,
such as “add: int>int>int” and have equality operators use two characters,
such as << >> >= <= ==.

------
marsrover
To be honest, I was fatigued the moment it looked like just another
programming language. After seeing there is absolutely no documentation, I
don't even understand why anyone would upvote this.

~~~
skrebbel
Why are you on site called "hacker news"?

~~~
dang
Please don't respond to a bad comment by breaking the site guidelines
yourself. That only makes this place even worse.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

~~~
skrebbel
Good point, thanks.

