Hacker Timesnew | past | comments | ask | show | jobs | submit | wund's commentslogin

To be specific I think they used a transpiler, probably Russ Cox's c2go (https://github.com/rsc/c2go).


What's the point of doing that? I get that you want a language to bootstrap itself, but if you skip the experience of actually writing the compiler, and the code you have to maintain is a weird non-idiomatic machine-generated thing, what have you gained?


from https://talks.golang.org/2015/gogo.slide#4

  "Why move the compiler to Go?

  Not for validation; we have more pragmatic motives:
  Go is easier to write (correctly) than C.
  Go is easier to debug than C (even absent a debugger).
  Go is the only language you'd need to know; encourages contributions.
  Go has better modularity, tooling, testing, profiling, ...
  Go makes parallel execution trivial.
  Already seeing benefits, and it's early yet.
  Design document: golang.org/s/go13compiler"
and https://talks.golang.org/2015/gogo.slide#10

  "Why translate it, not write it from scratch? 
  Correctness, testing.
  Steps:
  Write a custom translator from C to Go.
  Run the translator, iterate until success.
  Measure success by bit-identical output.
  Clean up the code by hand and by machine.
  Turn it from C-in-Go to idiomatic Go (still happening)."


More developers (who don't know c (good enough), but are proficient in go) who can contribute to the compiler code long term (and improve the transpiled compiler). Other reasons would interest me as well.


Are there large numbers of people skilled in writing compilers, but don't know C? I doubt it.

That practical point aside, I do think it's good to lower the barrier of contributing.


Yes, I doubt it too. But are they interested in contributing to the go compiler if they don't already do that? I would guess go users are more interested in contributing to go. Plus the compiler people who are good at c and are already contributing can probably get up to speed with go quickly if they want to and don't know go yet. Or they already know go because they use it.


I think it is similar to what some people say that they will contribute to open source project only if it is on github. So it is not logical but nonetheless many want it.


Automatic translation for most of the code where it doesn't make a difference

Then you can get this base and start improving on it


> Just as an experiment I cleaned up the runtime function mapaccess1_fast64 by hand in assembly and made it 29% smaller and with a speed improvement too small to measure.

This doesn't sound very exciting.


Does this work on IE7?


It's very exciting to see inline plots in terminal but I doubt it will ever get mainstream popularity since it's not supported by most terminals.


If you only need to display a simple graph you could try Unicode's Braille characters: https://hackertimes.com/item?id=7776112

That should be supported by more terminals.


Who forgets to break in switch statements? I mean yea, there was a time when I started programming I did this once or twice but not for a quite long time. Seems to me more like a request for sloppy programmers than anything else.

Also don't forget [Duff's device](https://en.wikipedia.org/wiki/Duff's_device) for how it could actually be expressive.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: