Live data from Hacker News

Borgo is a statically typed language that compiles to Go

github.com

111–120 of 559 posts

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

#111
post #17

Earlier quoted context omitted.

The word "transpiler" propagates the misunderstanding that there is something special about a compiler that emits machine code, that requires some special "compiler" techniques for special "compiler" purposes that are not necessary for "transpiler" purposes because "transpiling" requires a completely different set of techniques. There aren't any such techniques. If one were to create an academic discipline to study "…

1. Transpilers output to another programming language that is typically written by hand by others (so not assembly). 2. Transpilers don’t typically optimize code, leaving those transformations to the compiler of the target language. 3. Compilers will typically have an internal representation (SSA) which they operate on to optimize. Transpilers typically operate on the AST (because they don’t need to do any but the mo…

> the majority of the reasons on why people make the distinction.

You have provided some defining properties that might allow for distinction, but you have not given any reasons for why people make a distinction.

But perhaps we can suss it out. Given the statement "Borgo compiles to Go", what important information is lost that would be saved if "Borgo transpiles to Go" was used instead?

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

#112

Earlier quoted context omitted.

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

JSON is just one tiny part of most programs, sitting on the edge where the program interacts with other programs; it doesn’t permeate the entire codebase. Structure privacy, OTOH, does. Count me in as someone who really enjoys the case-based approach. It’s not the only one which could work, but it does work.

The single most productive habit I picked up int the last few years is to always use exactly the same name for the same entity across source files, configs files, database entries, protocol fields, etc.

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

#113
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's such a neat way to remove cruft.

I don't disagree, the problem I have with it is, I have to pay for that up front and have to factor it into my design immediately. This also combines with the fact that the namespace is very flat with no heirarchy, so, choosing good public names is something I feel like I spend way too much time on.

Go is the only language that causes me to pull out a thesaurus when trying to name methods and struct members. It's kinda maddening. Although, after going through this exercise, I end up with code that reads like English. I just wish I could refactor my way into that state, rather than having to try to nail it up front.

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

#114
post #90

Earlier quoted context omitted.

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

I spent quite a few hours tracking down bugs due to miscased struct fields unfortunately. Strongly prefer explicitness over implicitness

The casing rules are quite explicit and enforced by the compiler. A build would have immediately failed on whatever mismatch you had. A few hours and you didn't even think to try compiling it?

I'm guessing you are talking about something else entirely, like, perhaps, decoding JSON into a struct using reflection and encountering a situation where the field names didn't match? Indeed, implicitness can bite you there. That's true in every language. But, then again, as you prefer explicitness why would you be using that approach in the first place?

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

#115

Why would you target Go?

Because a plethora of languages, some of which you don't personally like using, being part of a large and healthy ecosystem, benefits all languages and programmers.

There is no "one true" answer, and time spent bullying people over it, is entirely wasted.

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

#117

Rust is not as complicated as the opening graphic indicates. I usually see this meme from less experienced people but I'm frankly surprised to see it from somebody that's capable of writing a compiler in rust .

It's also not as type safe as the graphic implies.

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

#118
post #103

This seems to achieve a similar type safety complexity 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/

> are not as performant as Go. Ymmv, you might be surprised if you actually bothered to benchmark. Depending on the workload, either JS or erlang can ultimately turn out on top. They're all optimized to a degree that each has a niche it excells at and leaves the others in the dust. even with heavily scewed benchmark like techempower fortunes ( https://www.techempower.com/benchmarks/#hw=ph&test=fortune&s... ) you end…

I'd add Java to that list as well. JIT compilers have come a long way, and OpenJDK was on par with Rust for performance on the last project I tried porting.
Post reply on HN