Live data from Hacker News

Borgo is a statically typed language that compiles to Go

github.com

91–100 of 559 posts

Re: Borgo is a statically typed language that compiles to Go

#91

Earlier quoted context omitted.

> I want a language for writing applications that is more expressive than Go but less complex than Rust. > Go is simple and straightforward, but I often wish it offered more type safety. Rust is very nice to work with (at least for single threaded code) but it's too broad and complex, sometimes painfully so. It seems clear that the author really likes aspects of both Go and Rust and desires something between the two.…

Sure. I'm not knocking the design goal. The same thing could be achieved by having C++ as a target. So why choose go.

Because they like go, are making essentially a go extension, and so a lot of their features map directly to go features. No need to re-implement goroutines and channels etc.

The type system lets them reject the programs they want to reject, but if a program is valid in the type system it can, in large part, emit essentially the same go code sans the types. I mean, I'm making some assumptions here, but that's typically the reason.

Re: Borgo is a statically typed language that compiles to Go

#92
post #51

Great! Something I've always wanted. I'd love to be able to use a bit more type-y Go such as Borgo, and have a Pythonesque dynamic scripting language that latches onto it effortlessly. Dynamic typing is great for exploratory work, whether that's ML research or developing new features for a web app. But it would be great to be able to morph it over time into a more specified strongly typed language without having to r…

> Like building out of clay and firing the parts you are happy with. > Could even have a three step - Python-esque -> Go/Java-esque -> Rust/C++esque. We do exactly that with Common Lisp. It compiles to different languages/frameworks depending on what we require (usually sbcl is more than enough, but for instance for embedded or ML we need another step. All dev (with smaller data etc) is in sbcl so with all the advant…

Is there somewhere I could read more about this? I've always wanted to learn Lisp but lacked a specific need for it.

Re: Borgo is a statically typed language that compiles to Go

#93

The only language I can think of that has pulled off “compiles to another totaling language” and gained mainstream adoption is typescript, and I’m sure it wouldn’t have done so if it were possible to run in the browser otherwise. Can anyone think of another example?

Not exactly the same but a few languages compile to llir which then is compiled by llvm to machine code.

Re: Borgo is a statically typed language that compiles to Go

#94
This seems to achieve a similar type safetycomplexity tradeoff as Gleam [1] does. However, Gleam compiles to Erlang or JavaScript, which require a runtime and are not as performant as Go.

I wonder if Borgo's compiler messages are as nice as Rust's/Gleam's, though.

[1] https://gleam.run/

Re: Borgo is a statically typed language that compiles to Go

#96

Many people on HN “Rust syntax is so ugly” rustaceans “I love the Rust syntax so much I want it in Go too”

The author notes[0] that it keeps the Rust syntax to avoid having to write a parser.

I have no issue with the syntax but I think the chance of uptake would be considerably improved if the syntax were as close to Go's as reasonably possible. That's because I estimate Go programmers to be a better target for this than Rust programmers, but maybe I'm wrong.

[0] https://news.ycombinator.com/item?id=36847594

Re: Borgo is a statically typed language that compiles to Go

#97
post #90
post #60

This and pub/private modifiers for structs instead of letter casing is all I've ever wanted.

I love Go's letter casing. It's such a neat way to remove cruft.

Dislike it very much specially with codebases which have lots of acronyms, aka aviation. Having to change an acronym from upper to lowercase just suck.

Re: Borgo is a statically typed language that compiles to Go

#98
post #45

Earlier quoted context omitted.

Rust does not enforce error checking either. You can ignore errors in Rust.

Ignoring errors is a thing you can do whether you're checking them or not. Rust does enforce error checking, every Result is required to be checked before the value can be accessed. The only exception for this is if you don't need to access the Result's value, for which there's at least a built-in warning. And of course `unsafe`.

> Result is required to be checked before the value can be accessed.

Which is a flaw in Borgo, at least when interfacing with Go code, as in Go both T and E should independently valid states.

Re: Borgo is a statically typed language that compiles to Go

#99
post #90

Earlier quoted context omitted.

I love Go's letter casing. It's such a neat way to remove cruft.

Dislike it very much specially with codebases which have lots of acronyms, aka aviation. Having to change an acronym from upper to lowercase just suck.

In that case, maybe try: `_ACRNYM`

Re: Borgo is a statically typed language that compiles to Go

#100
post #90
post #60

This and pub/private modifiers for structs instead of letter casing is all I've ever wanted.

I love Go's letter casing. It's such a neat way to remove cruft.

It also adds cruft. Public struct members JSON usually needs to be converted to lowercase. Hence the stuct tags.
Post reply on HN