Remix.run Logo
baranul 9 hours ago

There are several languages that compile to Go, trying to be a better a Go. Off the top of my head: XGo (https://github.com/goplus), Borgo (https://github.com/borgo-lang/borgo), Soppo (https://github.com/halcyonnouveau/soppo)...

kbolino 4 hours ago | parent | next [-]

Both Borgo and now Lisette seem to act as though (T, error) returns are equivalent to a Result<T, error> sum type, but this is not semantically valid in all cases. The io.Reader interface's Read method, for example, specifies not only that (n!=0, io.EOF) is a valid return pattern, but moreover that it is not even an error condition, just a terminal condition. If you treat the two return values as mutually exclusive, you either can't see that you're supposed to stop reading, or you can't see that some number of valid bytes were placed into the buffer. This is probably well known enough to be handled specifically, but other libraries have been known to make creative use of the non-exclusivity in multiple return values too.

pkilgore 20 minutes ago | parent | next [-]

To be fair, I feel like the language is widely criticized for this particular choice and it's not a pattern you tend to see with newer APIs.

It's a really valid FFI concern though! And I feel like superset languages like this live or die on their ability to be integrated smoothly side-by-side with the core language (F#, Scala, Kotlin, Typescript, Rescript)

ivov_dev 3 hours ago | parent | prev [-]

You are right, and thank you for pointing this out. I've opened an issue:

https://github.com/ivov/lisette/issues/12

I have a few approaches in mind and will be addressing this soon.

amelius 9 hours ago | parent | prev [-]

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

usrnm 8 hours ago | parent [-]

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

debugnik 8 hours ago | parent [-]

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

amelius 6 hours ago | parent [-]

Uh yes, that's what I meant ;)

In C/C++ you have the #line preprocessor directive. It would be nice if Go had something similar.

debugnik an hour ago | parent [-]

Go has apparently got //line directives, and this project uses them.