guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attempt to create an inline assembler for Guile


From: Sjoerd van Leent
Subject: Re: Attempt to create an inline assembler for Guile
Date: Thu, 25 Jun 2015 18:10:34 +0200

Hi Nala

Ik actually use the underlying method in C at a number of other places. And I am uncertain that other posixen might use other numbers. So I considered exporting it directly.

In any case, the sysconf won't work on a handful of unfortunate operating systems.

But you are right. The less in C, the better.

Op 25 jun. 2015 05:27 schreef "Nala Ginrut" <address@hidden>:
nice work!
I may take look at it closely.
And I would recommend you use FFI if you just want to get pagesize, it's
easier than writing bunch of C code:
=============================code========================
(use-modules (system foreign))
(define ffi (dynamic-link))
(define sysconf
  (pointer->procedure int
                      (dynamic-func "sysconf" ffi)
                      (list int)))

(sysconf 30) ; 30 stands for _SC_PAGESIZE
==> 4096
==============================end=======================

Happy hacking!

On Wed, 2015-06-24 at 21:41 +0200, Sjoerd van Leent wrote:
> Hi All,
>
> In line with my will to create an assembler, I started first by being able
> to execute something in memory, using the memory-mapper strategy. I am
> aware not all platforms use the same mechanism, but this is a starting
> point.
>
> At a later point, an inline assembler can be used by a (more abstract) JIT
> engine
>
> I put my repository here:
>
> https://github.com/santidhammo/guile-assembler
>
> Met vriendelijke groet,
> Sjoerd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]