Gambit-C v4.6.3 is now available.
Changelog: http://www.iro.umontreal.ca/~gambit/repo/.cgit.cgi/Gambit/log/
The sources and prebuilt distributions can be obtained from the Gambit web site by visiting one of the following links.
sources: http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_3... (for typical users) http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_3... (for developers)
prebuilt: http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/prebuilt/gambc-v4_6... http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/prebuilt/gambc-v4_6... http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/prebuilt/gambc-v4_6... http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/prebuilt/gambc-v4_6...
Afficher les réponses par date
On 2012-01-18, at 10:19 PM, Logiciel Gambit wrote:
Gambit-C v4.6.3 is now available.
Changelog: http://www.iro.umontreal.ca/~gambit/repo/.cgit.cgi/Gambit/log/
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler. This is one of the important pieces of the X86 backend for Gambit that I have been working on recently. I also have an ARM assembler in the works, but it is not in this release.
Below is an example of dynamic X86 code generation and execution.
Marc
(include "~~lib/_asm#.scm") (include "~~lib/_x86#.scm") (include "~~lib/_codegen#.scm")
(define (u8vector->procedure code) (machine-code-block->procedure (u8vector->machine-code-block code)))
(define (u8vector->machine-code-block code) (let* ((len (u8vector-length code)) (mcb (##make-machine-code-block len))) (let loop ((i (fx- len 1))) (if (fx>= i 0) (begin (##machine-code-block-set! mcb i (u8vector-ref code i)) (loop (fx- i 1))) mcb))))
(define (machine-code-block->procedure mcb) (lambda (#!optional (arg1 0) (arg2 0) (arg3 0)) (##machine-code-block-exec mcb arg1 arg2 arg3)))
(define (create-procedure arch gen #!optional (show-listing? #t)) (let* ((cgc (make-codegen-context)) (endianness 'le))
(asm-init-code-block cgc 0 endianness) (codegen-context-listing-format-set! cgc 'nasm) (x86-arch-set! cgc arch)
(gen cgc)
(let ((code (asm-assemble-to-u8vector cgc))) (if show-listing? (asm-display-listing cgc (current-output-port) #t)) (u8vector->procedure code))))
(define f (create-procedure 'x86-64 (lambda (cgc) (x86-mov cgc (x86-rax) (x86-rdi)) ;; rdi = arg1 (on x86-64) (x86-imul cgc (x86-rax) (x86-rax) (x86-imm-int 7)) (x86-ret cgc))))
(pp (f 10))
;; Output : ;; ;; % gsc -i example.scm ;; 000000 bits 64 ;; 000000 4889f8 mov rax,rdi ;; 000003 486bc007 imul rax,rax,byte 7 ;; 000007 c3 ret ;; 70
On Jan 18, 2012, at 10:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler.
I take it that this mechanism could ultimately form the basis for an incremental compiler, right?
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
On 2012-01-19, at 10:36 AM, Raffael Cavallaro wrote:
On Jan 18, 2012, at 10:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler.
I take it that this mechanism could ultimately form the basis for an incremental compiler, right?
Absolutely. But it does not exclude a static compiler either.
Marc
On Jan 18, 2012, at 9:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler. This is one of the important pieces of the X86 backend for Gambit that I have been working on recently. I also have an ARM assembler in the works, but it is not in this release.
I look forward to using a Gambit that is capable of native, incremental, in-RAM compilation.
I hope you plan to retain the C backend indefinitely as well. We're using Gambit for some iOS products, and Apple will not allow an in-RAM compiler to work on iOS, so we will perforce have to depend upon the C backend for iOS products.
--me
On 2012-01-19, at 1:47 PM, mikel evins wrote:
On Jan 18, 2012, at 9:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler. This is one of the important pieces of the X86 backend for Gambit that I have been working on recently. I also have an ARM assembler in the works, but it is not in this release.
I look forward to using a Gambit that is capable of native, incremental, in-RAM compilation.
I hope you plan to retain the C backend indefinitely as well. We're using Gambit for some iOS products, and Apple will not allow an in-RAM compiler to work on iOS, so we will perforce have to depend upon the C backend for iOS products.
The C backend will definitely stay. I see it as the "portable" backend which works on just about any platform with a decent C compiler.
The infrastructure I am building will support native incremental compilation. It will also be possible to use the X86 and ARM backends to statically generate an executable (like the C backend). On iOS it will thus be possible to compile and application to ARM code and publish it like any other app on the App store.
At least that's the plan.
Marc
On Jan 19, 2012, at 1:34 PM, Marc Feeley wrote:
On 2012-01-19, at 1:47 PM, mikel evins wrote:
On Jan 18, 2012, at 9:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which allows generating machine code on the fly and executing it, without the need for an external assembler. This is one of the important pieces of the X86 backend for Gambit that I have been working on recently. I also have an ARM assembler in the works, but it is not in this release.
I look forward to using a Gambit that is capable of native, incremental, in-RAM compilation.
I hope you plan to retain the C backend indefinitely as well. We're using Gambit for some iOS products, and Apple will not allow an in-RAM compiler to work on iOS, so we will perforce have to depend upon the C backend for iOS products.
The C backend will definitely stay. I see it as the "portable" backend which works on just about any platform with a decent C compiler.
The infrastructure I am building will support native incremental compilation. It will also be possible to use the X86 and ARM backends to statically generate an executable (like the C backend). On iOS it will thus be possible to compile and application to ARM code and publish it like any other app on the App store.
At least that's the plan.
Wow; that's a really really appealing plan.
Would be nice if asm-generated code can be GC:d as other objects.
2012/1/19 Marc Feeley feeley@iro.umontreal.ca
On 2012-01-19, at 1:47 PM, mikel evins wrote:
On Jan 18, 2012, at 9:55 PM, Marc Feeley wrote:
One of the important new features of Gambit-C is an X86 assembler which
allows generating machine code on the fly and executing it, without the need for an external assembler. This is one of the important pieces of the X86 backend for Gambit that I have been working on recently. I also have an ARM assembler in the works, but it is not in this release.
I look forward to using a Gambit that is capable of native, incremental,
in-RAM compilation.
I hope you plan to retain the C backend indefinitely as well. We're
using Gambit for some iOS products, and Apple will not allow an in-RAM compiler to work on iOS, so we will perforce have to depend upon the C backend for iOS products.
The C backend will definitely stay. I see it as the "portable" backend which works on just about any platform with a decent C compiler.
The infrastructure I am building will support native incremental compilation. It will also be possible to use the X86 and ARM backends to statically generate an executable (like the C backend). On iOS it will thus be possible to compile and application to ARM code and publish it like any other app on the App store.
At least that's the plan.
Marc
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
On Wed, Jan 18, 2012 at 22:19, Logiciel Gambit gambit@iro.umontreal.ca wrote:
Gambit-C v4.6.3 is now available.
Great news! Thanks for all the work that's gone into this release; the native backends will be especially exciting.
I noticed today while packaging this for Arch Linux that the 'origin' remote for git in the devel tarball no longer seems accessible for external folks:
origin ssh://gambit@frontal07.iro.umontreal.ca/~/HTML/repo/gambit.git
This causes 'make update' to no longer work correctly. In my package I've gone to just using the remote that was defined in the 4.6.2 devel tarball, which was:
http://www.iro.umontreal.ca/~gambit/repo/gambit.git/
Is this still suitable for pulling new changes from Git, or is there a better way? Thanks!
On 2012-01-19, at 8:08 AM, Taylor Venable wrote:
On Wed, Jan 18, 2012 at 22:19, Logiciel Gambit gambit@iro.umontreal.ca wrote:
Gambit-C v4.6.3 is now available.
Great news! Thanks for all the work that's gone into this release; the native backends will be especially exciting.
I noticed today while packaging this for Arch Linux that the 'origin' remote for git in the devel tarball no longer seems accessible for external folks:
origin ssh://gambit@frontal07.iro.umontreal.ca/~/HTML/repo/gambit.git
This causes 'make update' to no longer work correctly. In my package I've gone to just using the remote that was defined in the 4.6.2 devel tarball, which was:
http://www.iro.umontreal.ca/~gambit/repo/gambit.git/
Is this still suitable for pulling new changes from Git, or is there a better way? Thanks!
The latter is the correct place for git updates. I'll remove the reference to frontal07.
Marc