From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: Attempt to create an inline assembler for Guile Date: Thu, 25 Jun 2015 11:27:25 +0800 Organization: HFG Message-ID: <1435202845.12727.24.camel@Renee-desktop.suse> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435203775 15142 80.91.229.3 (25 Jun 2015 03:42:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 03:42:55 +0000 (UTC) Cc: guile-devel To: Sjoerd van Leent Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 25 05:42:35 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z7y3d-0001Wu-8a for guile-devel@m.gmane.org; Thu, 25 Jun 2015 05:42:33 +0200 Original-Received: from localhost ([::1]:53769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7xpC-0000LD-6W for guile-devel@m.gmane.org; Wed, 24 Jun 2015 23:27:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7xp9-0000L8-RF for guile-devel@gnu.org; Wed, 24 Jun 2015 23:27:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7xp3-0003EU-TE for guile-devel@gnu.org; Wed, 24 Jun 2015 23:27:35 -0400 Original-Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:33809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7xp3-0003EG-LX for guile-devel@gnu.org; Wed, 24 Jun 2015 23:27:29 -0400 Original-Received: by pabvl15 with SMTP id vl15so41155102pab.1 for ; Wed, 24 Jun 2015 20:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:mime-version:content-transfer-encoding; bh=slVsr+AF7ml9csgCGLlPp26XAo+jvP8W0gsGX23DP8U=; b=KcS0M+uBD83VMAP3AFOEDARrG7NpXMF9tqXseIBb5iQftGf/B6y1rkemknDyk7x+V7 Ipzi92+Bo00VCR5pKPE6cCfw/AhAhN+QzBs2yFuMe2346dfj6wa9a0SKYT8d+aIEhEMe aRy47eizDEJKOOKavM1fol1nqAd/lfGN0vGV69xNTHJG+cTR+ZX5ImRxRHUHqS4wgsw3 Po3HnU1YYOqX7P7z6KB+nP4K8wCE5TiB9nr0WdEQiF5VyCuMV8z+okIRYpvePgcp2K+A aLxYoGagm/Mh55JcrwIYUKncjNrnUG+Mwsb/NX95vV5gJ6KbjlBhEdvEX02vfONreI6f 2gnw== X-Received: by 10.68.223.165 with SMTP id qv5mr87501270pbc.82.1435202848848; Wed, 24 Jun 2015 20:27:28 -0700 (PDT) Original-Received: from [147.2.147.174] ([203.192.156.9]) by mx.google.com with ESMTPSA id da2sm28208307pbb.57.2015.06.24.20.27.27 (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 24 Jun 2015 20:27:28 -0700 (PDT) In-Reply-To: X-Mailer: Evolution 3.4.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22f X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17754 Archived-At: 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