Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

2018-03-10 Thread Christian Jullien
Hi Charles,

Your implementation using switch has a name, it’s called trampoline 
https://en.wikipedia.org/wiki/Trampoline_(computing).

This is what you have to do when backend does not support native goto, and it’s 
generally the case when you write a compiler having a high level language as 
target. Another solution may be CPS 
https://en.wikipedia.org/wiki/Continuation-passing_style 

 

Sure, tinycc->javascript looks interesting.

 

C.

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Charles Lohr
Sent: samedi 10 mars 2018 21:31
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

 

This really interests me as well.  I still am working on my 
tinycc-to-javascript environment, and to support "goto" was quite awkward and 
required wrapping all code in functions inside "switch" statements.  I was 
hoping webassembly would accept the request to have a "goto" but as far as I 
understand, there's basically no possible way to do any kind of setjmp but 
that's probably ok because so few applications use it.

This raises another question:  Anyone else interested in a tinycc javscript 
target?

 

On Sat, Mar 10, 2018 at 11:43 AM, Christian Jullien <eli...@orange.fr> wrote:

First link looks especially interesting. thanks

My question is if tinycc could generate JVM code which any java engine can use.

IMHO setjmp/longjmp is probably not very easy to compile to a JVM equivalent.

 

C.

 

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis 
<mailto:tinycc-devel-bounces%2Beligis> =orange...@nongnu.org] On Behalf Of Yakov
Sent: vendredi 9 mars 2018 11:56
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

 

Quick search gave me these links:

https://github.com/graalvm/sulong
https://www.infoworld.com/article/3193078/java/azul-introduces-llvm-compiler-to-java-runtime.html
https://stackoverflow.com/questions/4934707/is-it-possible-to-transform-llvm-bytecode-into-java-bytecode

I am not a Java guy, so not sure if that's what you imagine, but it seems close.

Yash

 

 

2017-12-31 12:13 GMT+05:45 Christian Jullien <eli...@orange.fr>:

Hi all, I don’t how much it could cost nor it’s even feasible, but it would be 
nice to have a JVM backend. (as other languages already use, see 
https://en.wikipedia.org/wiki/List_of_JVM_languages)

This could be a nice student project.

 

Main goal:

-  Have a portable C on top on JVM

 

Second goals

-  Smooth integration with JDK libs

-  Optional GC

-  Optimization done by JIT

 

Non goals:

-  Speed of compiled program

 

Any university there willing to make this port happen?

 

C.

 


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

 


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

2018-03-10 Thread Charles Lohr
This really interests me as well.  I still am working on my
tinycc-to-javascript environment, and to support "goto" was quite awkward
and required wrapping all code in functions inside "switch" statements.  I
was hoping webassembly would accept the request to have a "goto" but as far
as I understand, there's basically no possible way to do any kind of setjmp
but that's probably ok because so few applications use it.

This raises another question:  Anyone else interested in a tinycc javscript
target?

On Sat, Mar 10, 2018 at 11:43 AM, Christian Jullien <eli...@orange.fr>
wrote:

> First link looks especially interesting. thanks
>
> My question is if tinycc could generate JVM code which any java engine can
> use.
>
> IMHO setjmp/longjmp is probably not very easy to compile to a JVM
> equivalent.
>
>
>
> C.
>
>
>
>
>
>
>
> *From:* Tinycc-devel [mailto:tinycc-devel-bounces+eligis=
> orange...@nongnu.org] *On Behalf Of *Yakov
> *Sent:* vendredi 9 mars 2018 11:56
> *To:* tinycc-devel@nongnu.org
> *Subject:* Re: [Tinycc-devel] A wish for 2018? C->JVM compiler
>
>
>
> Quick search gave me these links:
>
> https://github.com/graalvm/sulong
> https://www.infoworld.com/article/3193078/java/azul-
> introduces-llvm-compiler-to-java-runtime.html
> https://stackoverflow.com/questions/4934707/is-it-
> possible-to-transform-llvm-bytecode-into-java-bytecode
>
> I am not a Java guy, so not sure if that's what you imagine, but it seems
> close.
>
> Yash
>
>
>
>
>
> 2017-12-31 12:13 GMT+05:45 Christian Jullien <eli...@orange.fr>:
>
> Hi all, I don’t how much it could cost nor it’s even feasible, but it
> would be nice to have a JVM backend. (as other languages already use, see
> https://en.wikipedia.org/wiki/List_of_JVM_languages)
>
> This could be a nice student project.
>
>
>
> Main goal:
>
> -  Have a portable C on top on JVM
>
>
>
> Second goals
>
> -  Smooth integration with JDK libs
>
> -  Optional GC
>
> -  Optimization done by JIT
>
>
>
> Non goals:
>
> -  Speed of compiled program
>
>
>
> Any university there willing to make this port happen?
>
>
>
> C.
>
>
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

2018-03-10 Thread Christian Jullien
First link looks especially interesting. thanks

My question is if tinycc could generate JVM code which any java engine can use.

IMHO setjmp/longjmp is probably not very easy to compile to a JVM equivalent.

 

C.

 

 

 

From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On 
Behalf Of Yakov
Sent: vendredi 9 mars 2018 11:56
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

 

Quick search gave me these links:

https://github.com/graalvm/sulong
https://www.infoworld.com/article/3193078/java/azul-introduces-llvm-compiler-to-java-runtime.html
https://stackoverflow.com/questions/4934707/is-it-possible-to-transform-llvm-bytecode-into-java-bytecode

I am not a Java guy, so not sure if that's what you imagine, but it seems close.

Yash

 

 

2017-12-31 12:13 GMT+05:45 Christian Jullien <eli...@orange.fr>:

Hi all, I don’t how much it could cost nor it’s even feasible, but it would be 
nice to have a JVM backend. (as other languages already use, see 
https://en.wikipedia.org/wiki/List_of_JVM_languages)

This could be a nice student project.

 

Main goal:

-  Have a portable C on top on JVM

 

Second goals

-  Smooth integration with JDK libs

-  Optional GC

-  Optimization done by JIT

 

Non goals:

-  Speed of compiled program

 

Any university there willing to make this port happen?

 

C.

 


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] A wish for 2018? C->JVM compiler

2018-03-09 Thread Yakov
Quick search gave me these links:

https://github.com/graalvm/sulong
https://www.infoworld.com/article/3193078/java/azul-introduces-llvm-compiler-to-java-runtime.html
https://stackoverflow.com/questions/4934707/is-it-possible-to-transform-llvm-bytecode-into-java-bytecode

I am not a Java guy, so not sure if that's what you imagine, but it seems
close.

Yash



2017-12-31 12:13 GMT+05:45 Christian Jullien :

> Hi all, I don’t how much it could cost nor it’s even feasible, but it
> would be nice to have a JVM backend. (as other languages already use, see
> https://en.wikipedia.org/wiki/List_of_JVM_languages)
>
> This could be a nice student project.
>
>
>
> Main goal:
>
> -  Have a portable C on top on JVM
>
>
>
> Second goals
>
> -  Smooth integration with JDK libs
>
> -  Optional GC
>
> -  Optimization done by JIT
>
>
>
> Non goals:
>
> -  Speed of compiled program
>
>
>
> Any university there willing to make this port happen?
>
>
>
> C.
>
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] A wish for 2018? C->JVM compiler

2017-12-30 Thread Christian Jullien
Hi all, I don't how much it could cost nor it's even feasible, but it would
be nice to have a JVM backend. (as other languages already use, see
https://en.wikipedia.org/wiki/List_of_JVM_languages)

This could be a nice student project.

 

Main goal:

-  Have a portable C on top on JVM

 

Second goals

-  Smooth integration with JDK libs

-  Optional GC

-  Optimization done by JIT

 

Non goals:

-  Speed of compiled program

 

Any university there willing to make this port happen?

 

C.

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel