Live data from Hacker News

Moonbit: Fast, compact and user friendly language for WebAssembly

moonbitlang.com

121–130 of 162 posts

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#121
post #119

Looks quite nice, but you should add a banner to the load screen for https://try.moonbitlang.com that it will take quite a while to load and the page is not broken.

I'd assume that's not normal and is just due to being on the front page of HN.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#122

Do you really avoid pointers by making everything a pointer?

Yes, if the reference is immutable. The main problem with pointers is ad-hoc memory management anyway.

The references are not immutable in this case.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#123
post #114
post #82

Earlier quoted context omitted.

I thought the raison d’être for Rust was not having a GC. If this is a garbage collected language, and requires a runtime for such, isn’t this more like Go or any JVM language?

For situations where you can afford a GC, Rust but with GC would be an excellent language, due to the ways macros are done, traits work, how errors are handled, tools like cargo, docs.rs, testing and doctests, self-contained binaries with additional ability to compile extra assets into them, high quality language server (rust-analyzer), and the quality of the ecosystem. As it is now, though, regrettably Rust imposes…

> one can't help but imagine a Rust-but-with-GC world

Rust with reference counting gets you a long way there. I’ve leaned in Rc a ton in some projects and had a pretty great experience.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#124
post #10

Earlier quoted context omitted.

I think the Rust and Go comparisons are because they’re popular languages with first class WASM support but I agree

Why didn't they include Zig and AsssemblyScript, then?

Not OP, but although Zig is pretty good, it is arguably a relatively low-level language for application development. Thinking about pointers, for example, is tiring and unnecessary for most apps.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#125

Earlier quoted context omitted.

Because Moonbit is a modern language, while AssemblyScript is carrying forward the mistakes of the past. For example, Moonbit supports pattern matching and most language constructs are expressions. AS doesn't have pattern matching and consists primarily of statements. Moonbit has algebraic data types; it's not clear to me that AS does. There might be other differences at runtime, but it's difficult to tell from just…

> Because Moonbit is a modern language, while AssemblyScript is carrying forward the mistakes of the past. No language has "no mistakes". For instance, let's take a language like Scala, which appeared 20 years ago. Has it avoided mistakes of the past? Or lets take Rust, which appeared 8 years ago. Is it "perfect"? Same with Moonbit; it will make tradeoffs and mistakes and whatnot. Mistakes are not always technical in…

Modern doesn't imply perfect— just that it uses recent advancements.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#126
post #114

Earlier quoted context omitted.

For situations where you can afford a GC, Rust but with GC would be an excellent language, due to the ways macros are done, traits work, how errors are handled, tools like cargo, docs.rs, testing and doctests, self-contained binaries with additional ability to compile extra assets into them, high quality language server (rust-analyzer), and the quality of the ecosystem. As it is now, though, regrettably Rust imposes…

> one can't help but imagine a Rust-but-with-GC world Rust with reference counting gets you a long way there. I’ve leaned in Rc a ton in some projects and had a pretty great experience.

I built https://github.com/mmastrac/keepcalm/ to specifically give "permission" to use ref-counting to make your life easier. For a webserver, references don't make any sense and really don't add anything measurable from a performance perspective.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#127
post #62

in an era where there are too many choices for writing things, if you don't show how your language is different and/or better compared to other languages which almost definitely more popular, then you'll lost before you start. I mean, show some example and I'll decide if it's worth to try. for this language? sorry, I'm not sold in the slightest.

Halfway down the page is some (tiny) comparisons to Go and Rust, highlighting some differences and then elaborating (in prose) as to why that's better. We're both reading the same article, right? "A taste of MoonBit."

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#128
Well. I am very excited by this. We've built our front end in F# with Fable and our backend/engine is in Rust which compiles to WASM.

The WASM story came second, and it'd be really cool to eventually lean into something like this, particularly given the much faster compilation time.

Have followed your work on Rescript, and excited to see that this is where you've taken things.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#129
post #115
post #45

Earlier quoted context omitted.

Thanks for your feedback, the back background should works now.

The colored syntax highlighting is still hard to read in dark mode, too little contrast. You really need different colors for light vs. dark mode.

Fwiw I did also think this a little, but they were good enough to be legible so I didn't mention it.

The code examples actually looked fine to me on the page before the change due to the white background to them.

Re: Moonbit: Fast, compact and user friendly language for WebAssembly

#130

Earlier quoted context omitted.

> one can't help but imagine a Rust-but-with-GC world Rust with reference counting gets you a long way there. I’ve leaned in Rc a ton in some projects and had a pretty great experience.

I built https://github.com/mmastrac/keepcalm/ to specifically give "permission" to use ref-counting to make your life easier. For a webserver, references don't make any sense and really don't add anything measurable from a performance perspective.

That’s awesome. I do think someone smarter than me needs to write a “Pragmatic Rust” book, or something. The complexities around references and lifetimes put a lot of people off but really aren’t necessary a lot of the time.
Post reply on HN