Live data from Hacker News

Borgo is a statically typed language that compiles to Go

github.com

131–140 of 559 posts

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

#131

Earlier quoted context omitted.

This is a terrible take. It's like one of those people who buys a massive over priced knife block with 48 knives in it that they never use. Most go devs have lived through bloated java/php/python/ruby/js projects that become a pile of dependencies. Go is to coding what brutalism is to architecture. Simple, functional, efficient. Dont build a massive dependency chain, dont build magic, repeating yourself is OK. Be an…

I'm not sure why you included php in your list of examples of things that become bloated with dependencies. I've never seen that be the case.

Look at your list of built-in modules though :)

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

#132

Earlier quoted context omitted.

They produce text, such as Golang source code.

Thanks for your response, but the Go spec asserts that Go source is represented as UTF-8. UTF-8 is a binary encoding. We're talking about compilers that produce something other than binary output.

Ah, my mistake, I thought you were making an earnest inquiry and not a joke. Carry on.

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

#133
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…

Sounds like JavaScript and typescript would be a good fit for you. Highly expressive, dynamic and strongly typed, and highly performant both on server side and within the browser.

perhaps rescript [https://rescript-lang.org/] even more than typescript

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

#134
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…

I like the idea but in all honesty I have difficulty imagining it working in practice. Once your python code is stable (i.e. You've worked out 99% of the bugs you might have caught earlier with strict type checking) would there be any incentive to go back and make the types more rigid or rigorous? Would there be a non-negligible chance of introducing bugs in that process?

by the time you have your code in its final state (i.e. you're done experimenting) and shaken out the bugs, your types are mostly static; they're just implicitly so. adding annotations and a typechecker helps you maintain that state and catch the few places where type errors might still have slipped through despite all your tests (e.g. lesser-used code paths that need some rare combination of conditions to hit them all but will pass an unexpected type through the call chain when you do). it is very unlikely that you will introduce bugs at this point.

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

#135

I like the graph at the top of the readme as a summary. The rest of the readme focuses on the delta between Go and Borgo. It doesn't say much about the delta between Borgo and Rust. I think the delta there is mainly no lifetimes/ownership?

No traits, const generics, probably no turbofish equivalent for when inference struggles.

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

#136

Would it be possible to make a Python (without C extensions) that compiles to Go?

I am not sure you can easily directly transpile to Golang from Python. Python is very, very dynamic and can have extremely complex types that are not representable with the Golang type system. Not impossible but I guess you might end up with an extra runtime layer and some more dynamic operations will not be very fast. Or you restrict it to a subset of Python like this project does: https://github.com/zanellia/prometeo

You could of course write a bytecode VM in Golang but I guess that defeats the purpose.

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

#137
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.

Go's semantic use of case is objectively bad because most of the worlds scripts do not have the concept of it. For example ideographs, as used in eastern countries, do not have capitalization. This means programmers in many parts of the world cannot express identifiers in their native tongue.

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

#138

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?

haxe is not quite "mainstream adoption" level but it has a decent amount of stuff done in it

clojurescript is fairly popular too.

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

#139
post #6

Earlier quoted context omitted.

It's a language known for having a great runtime and tooling but subpar language semantics. Makes sense to me, at least. Most of the benefits of go with fewer drawbacks.

I'm not trying to be argumentative, I'm genuinely curious: what is it about the go runtime and tooling that makes them great? I did not post your parent comment.

seamless cross compilation as a first-class citizen, for one
Post reply on HN