Do you really avoid pointers by making everything a pointer?
Moonbit: Fast, compact and user friendly language for WebAssembly
111–120 of 162 posts
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#112Earlier quoted context omitted.
Rust-like features and performance with Go-like usability are big selling points. Also we don't known how it will be licensed, but if it's proprietary that could also be a selling point with companies that won't touch Grain's LGPL license.
That's absolutely nuts. Would you risk building upon a stack that might be sold tomorrow to a competitor and killed instantly? Without software freedom and a community this is just a toy.
Prudent companies also require the source code to be kept in a holding that transfers ownership to them if the supplier goes bankrupt.
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#113That’s not how you’d implement fibonacci in Go
I guess its easier to just throw in some numbers than compare idiomatic implementations and then discuss tradeoffs with some nuance.
Even if its just a language teaser, I'd still add a note on TCO to avoid misleading people though.
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#114Earlier quoted context omitted.
Thanks for your interest. Note Moonbit is a language/platform for industrial usage(not an academic language), I contributed to OCaml so that I am familiar with the good/bad parts of a type system. Its aim is to build fast and run fast, and generate the tiny Wasm output. Type system is sound, you can take it as Rust(- some features hinder fast compilation) with GC and an emphasis on data oriented programming, so we ha…
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?
As it is now, though, regrettably Rust imposes on you the penalty of dealing with borrowing and ownership even when there is no reason to pay for that. Its not too bad in most cases but one can't help but imagine a Rust-but-with-GC world :)
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#115I tried clicking through to find some syntax and got to this page[0] which seems to show things but the text is illegible on a dark background (something to do with picking up a dark mode setting on my device maybe?) [0] https://moonbitlang.com/docs/syntax/
Thanks for your feedback, the back background should works now.
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#116Hi, I am the lead of this project, you can try it now with our online IDE, https://try.moonbitlang.com (F5 to run) The docs are available https://github.com/moonbitlang/moonbit-docs , the compiler would be publicly available when we reach the beta status (expected to be the end of Q2 in 2024). Feel free to ask me any question
* Is there a need to differentiate func and fn? * Part of the function signature is "->" to indicates what it returns. Is this arrow needed? * For new types, you use syntax "struct User". I think Go got it right in this case where types are created with "type User struct", which can also create function types for fn variables like "type AssignUser func(name: String, id: Int) -> Int". * Does it help the lexer/parser t…
The func/fn thing though with type inference of return values is especially annoying though because you won’t be able to hoist it to a package level function without changes to the signature. Subsequent readers have to perform their own mental return type analysis as well, and that’s just extra cognitive load. When reading code, I like when functions are extremely clear about their inputs and outputs.
I like that this exists though, and hope the project is successful.
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#117Earlier quoted context omitted.
> It clearly states: it targets web assembly. So, this should answer your question I think Not sure what you're implying. Here's an example of doing graphics using Rust and WASM - http://cliffle.com/blog/bare-metal-wasm/#making-some-pixels And another: https://blog.logrocket.com/implement-webassembly-webgl-viewe... Given that MoonBit is developing their own IDE and it is hosted on the web, I would think one could pro…
A WebAssembly runtime is a pure compute+memory sandbox. It can only interact with the host environment in three ways: 1. The host calls an exported WASM function 2. The WASM runtime runs code that calls an imported function 3. The host reads/writes the WASM runtime's memory/globals In your example, the WASM build process spits out two artifacts - a WASM module and a JS module. The JS module defines the actual JavaScr…
Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#118Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#119Re: Moonbit: Fast, compact and user friendly language for WebAssembly
#120Earlier 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…
Though Moonbit does look nice too.