[go-nuts] Re: Compile to go languages?

2018-08-14 Thread 'David Chase' via golang-nuts
It's not a bad idea, except for the "idiomatic" part.  I guess it depends 
upon how idiomatic you want it to be.

Once upon a time, we compiled code to C (C++, Modula-3, and Cedar Mesa all 
had a compiler of that sort at one time or another).
Some people tried it for Java.

The advantage of targeting Go is that you get a low-latency GC and 
lightweight threads (Goroutines) "for free", as well as a decent bit of 
support for reflection, and the compiler will do a certain amount of escape 
analysis for you.
You might, for example, use goroutines to parallelize whole-array 
operations, if your source language had those (e.g.,m Fortran).

The disadvantage of targeting Go is that it's not that friendly to certain 
type systems, and you don't want to get into too much of a fight with the 
type system.
So Java would probably be a poor choice for a source language.  Smalltalk 
also might not work so well.


On Monday, August 13, 2018 at 6:48:59 PM UTC-4, Andrew Chambers wrote:
>
> Don't get me wrong, I love go, but also wonder if there are any languages 
> that compile to idiomatic go.
> I noticed reasonml compiles to javascript, and wondered to myself if there 
> is any value in such languages using go as a base for 
> interop to take advantage of the libraries and runtime.
>
> Any existing projects? Any thoughts about why its a good or bad idea, or 
> why it doesn't seem to exist already?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Compile to go languages?

2018-08-13 Thread Andrey Tcherepanov
There are projects by cznic on github to convert C code to Go in different 
stages of progress

https://github.com/cznic/ccgo
https://github.com/cznic/sqlite2go
https://github.com/cznic/crt

There are some other projects by him (parsing related projects) that you 
might find interesting.

A.


On Monday, August 13, 2018 at 4:48:59 PM UTC-6, Andrew Chambers wrote:
>
> Don't get me wrong, I love go, but also wonder if there are any languages 
> that compile to idiomatic go.
> I noticed reasonml compiles to javascript, and wondered to myself if there 
> is any value in such languages using go as a base for 
> interop to take advantage of the libraries and runtime.
>
> Any existing projects? Any thoughts about why its a good or bad idea, or 
> why it doesn't seem to exist already?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.