Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

When we write programs that "learn", it turns out we do and they don't.


devel / comp.lang.forth / Primitive External Library Interface for kForth-64

SubjectAuthor
* Primitive External Library Interface for kForth-64Krishna Myneni
`- Re: Primitive External Library Interface for kForth-64Krishna Myneni

1
Primitive External Library Interface for kForth-64

<umdk51$3cf0e$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25793&group=comp.lang.forth#25793

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: krishna.myneni@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Primitive External Library Interface for kForth-64
Date: Mon, 25 Dec 2023 22:17:31 -0600
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <umdk51$3cf0e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Dec 2023 04:17:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="55199bc62154f5a094917bc9d7a2d75b";
logging-data="3554318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fi3b4fBqbmX2As/RrkmeJ"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:uJnYhGw33xKYt0DadXtbgNvVKGQ=
Content-Language: en-US
 by: Krishna Myneni - Tue, 26 Dec 2023 04:17 UTC

Although I wanted to finish the 64-bit assembler for kForth-64 (a 64-bit
version of asm-x86.4th) prior to implementing the ability to set up a
library interface for mapping and calling C functions in external shared
object libraries to Forth words, my priority now is to go ahead and get
a library interface working for kForth-64 (the 64-bit assembler is still
in progress, though).

A primitive external library interface is now available for kForth-64
(using machine code). It is not yet full-featured enough to accomodate a
wide range of function argument cases, but the interface illustrates the
mechanics of calling external C library functions. Two complications
make the 64-bit interface a bit more complicated to implement, over the
simpler, but more advanced library interface found in kForth-32:

1. Function arguments are located in registers, rather than on the CPU
stack for the amd-64 calling convention.

2. The 64-bit version of kForth provides a separate fp stack, in line
with the Forth 200x standard.

An example of the use of the library interface for calling a portion of
the GNU GMP multiprecision library may be found at the link below.

https://github.com/mynenik/kForth-64/tree/master/forth-src/libs/gmp

Fair Warning: the library interface is in a state of development and may
change so that call methods in future versions may not be backwards
compatible with the (incomplete) existing call methods.

--
Krishna Myneni

Re: Primitive External Library Interface for kForth-64

<uo8q3i$21vd7$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25970&group=comp.lang.forth#25970

  copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: krishna.myneni@ccreweb.org (Krishna Myneni)
Newsgroups: comp.lang.forth
Subject: Re: Primitive External Library Interface for kForth-64
Date: Wed, 17 Jan 2024 09:01:06 -0600
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uo8q3i$21vd7$2@dont-email.me>
References: <umdk51$3cf0e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 17 Jan 2024 15:01:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="695e73cd369caca444baa6cab59613f4";
logging-data="2162087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195kL0/PlyhjdVtKnSUDJlY"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:nv6cgxQsLfTUjHGXl4j2H87zdwA=
Content-Language: en-US
In-Reply-To: <umdk51$3cf0e$1@dont-email.me>
 by: Krishna Myneni - Wed, 17 Jan 2024 15:01 UTC

On 12/25/23 22:17, Krishna Myneni wrote:
> Although I wanted to finish the 64-bit assembler for kForth-64 (a 64-bit
> version of asm-x86.4th) prior to implementing the ability to set up a
> library interface for mapping and calling C functions in external shared
> object libraries to Forth words, my priority now is to go ahead and get
> a library interface working for kForth-64 (the 64-bit assembler is still
> in progress, though).
>
> A primitive external library interface is now available for kForth-64
> (using machine code). It is not yet full-featured enough to accomodate a
> wide range of function argument cases, but the interface illustrates the
> mechanics of calling external C library functions. Two complications
> make the 64-bit interface a bit more complicated to implement, over the
> simpler, but more advanced library interface found in kForth-32:
>
> 1. Function arguments are located in registers, rather than on the CPU
> stack for the amd-64 calling convention.
>
> 2. The 64-bit version of kForth provides a separate fp stack, in line
> with the Forth 200x standard.
>
> An example of the use of the library interface for calling a portion of
> the GNU GMP multiprecision library may be found at the link below.
>
> https://github.com/mynenik/kForth-64/tree/master/forth-src/libs/gmp
>
> Fair Warning: the library interface is in a state of development and may
> change so that call methods in future versions may not be backwards
> compatible with the (incomplete) existing call methods.
>
....

The MPFR multiprecision library is now usable in kForth-64.

https://github.com/mynenik/kForth-64/tree/master/forth-src/libs/gmp

Again, the current library interface in kForth-64 is not set in stone
and may change.

--
KM

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor