Live data from Hacker News

Lisette a little language inspired by Rust that compiles to Go

lisette.run

31–40 of 168 posts

Re: Lisette a little language inspired by Rust that compiles to Go

#31

I'm wondering about the logistics of making this integrate with Go at the assembly/object file level rather than at source code level. What if it compiled to Go's assembly rather than to Go source code

Having explored that approach (†), I can tell that generating Go assembly is harder than it seems.

†: I've tried to transpile Rust code through WASM into Go assembly, and I've also explored how to inject trampolines into Go binaries (which involves generating Go assembly too).

Re: Lisette a little language inspired by Rust that compiles to Go

#32

Looks great. But I can't help wondering: If it is similar to Rust why not make it the the same as Rust where it feature-matches? Why import "foo.bar" instead of use foo::bar? Why Bar.Baz => instead of Bar::Baz =>? What are you achieving here? Why make it subtlety different so someone who knows Rust has to learn yet another language? And someone who doesn't know Rust learns a language that is different enough that the…

These are just syntax differences, which not only are easy to learn but I believe aren't the primary goal of the language, which is to bring the benefits of Rust's type system to Go.

As for int and float64, this comes from Go's number type names. There's int, int64, and float64, but no float. It's similar to how Rust has isize but no fsize.

Re: Lisette a little language inspired by Rust that compiles to Go

#33
post #6
post #5

For "classic" Rust what's actually nice is that no runtime is needed, so this looks like a step backwards. What would be actually nice is running async Rust on the Go green threads runtime.

In my experience, what's actually nice is the correctness. The low-levelness is not helpful for most of the software I write, and imposes a constant burden. Rust, of course superbly achieves its goals within its niche! But it is a niche, is my meaning here. What I actually want is code that's correct, but ergonomic to write. So my ideal language (as strange as it sounds) would be Rust with a GC. I don't want to worry…

MoonBit [0] is the best/future complete/active “rust with gc”.

[0] https://www.moonbitlang.com

Re: Lisette a little language inspired by Rust that compiles to Go

#34
post #22
post #17

Earlier quoted context omitted.

How do compile errors propagate back from the target language to the source language?

They are not supposed to produce code that doesn't compile, why would they?

Debugger positions on the other hand are a pain with these things.

Re: Lisette a little language inspired by Rust that compiles to Go

#35
post #5

For "classic" Rust what's actually nice is that no runtime is needed, so this looks like a step backwards. What would be actually nice is running async Rust on the Go green threads runtime.

It looks like more of a Rust-y way to write Go rather than a Go-ish way to run Rust. So I think the question is more about if you would choose it for something you're choosing Go for today, rather than for something you're choosing Rust for today.

Re: Lisette a little language inspired by Rust that compiles to Go

#36
Love the idea of bringing Rust ergonomics to the Go runtime. As someone currently building infra-automation tools (Dockit), the trade-off between Rust's safety and Go's simplicity is always a hot topic. This project addresses it in a very cool way. Will definitely follow the development

Re: Lisette a little language inspired by Rust that compiles to Go

#38
post #31

I'm wondering about the logistics of making this integrate with Go at the assembly/object file level rather than at source code level. What if it compiled to Go's assembly rather than to Go source code

Having explored that approach (†), I can tell that generating Go assembly is harder than it seems. †: I've tried to transpile Rust code through WASM into Go assembly, and I've also explored how to inject trampolines into Go binaries (which involves generating Go assembly too).

That is interesting, but I imagine Rust has features which can not be translated into Go's assembly. This language is specifically designed for Go interop; the logistics wouldn't be the same, though I still expect it to be difficult.

Re: Lisette a little language inspired by Rust that compiles to Go

#39
post #32

Looks great. But I can't help wondering: If it is similar to Rust why not make it the the same as Rust where it feature-matches? Why import "foo.bar" instead of use foo::bar? Why Bar.Baz => instead of Bar::Baz =>? What are you achieving here? Why make it subtlety different so someone who knows Rust has to learn yet another language? And someone who doesn't know Rust learns a language that is different enough that the…

These are just syntax differences, which not only are easy to learn but I believe aren't the primary goal of the language, which is to bring the benefits of Rust's type system to Go. As for int and float64, this comes from Go's number type names. There's int, int64, and float64, but no float. It's similar to how Rust has isize but no fsize.

> It's similar to how Rust has isize but no fsize.

isize is the type for signed memory offsets, fsize is completely nonsensical.

Re: Lisette a little language inspired by Rust that compiles to Go

#40
post #31

Earlier quoted context omitted.

Having explored that approach (†), I can tell that generating Go assembly is harder than it seems. †: I've tried to transpile Rust code through WASM into Go assembly, and I've also explored how to inject trampolines into Go binaries (which involves generating Go assembly too).

That is interesting, but I imagine Rust has features which can not be translated into Go's assembly. This language is specifically designed for Go interop; the logistics wouldn't be the same, though I still expect it to be difficult.

> I imagine Rust has features which can not be translated into Go's assembly

Why would there be? Go’s assembly might be lacking ways to make them optimally efficient, but that’s probably a given either way without an optimizing compiler backend.

Post reply on HN