We're already on it...

https://github.com/jeapostrophe/adqc

See an example here:

https://github.com/jeapostrophe/adqc/blob/master/t/fib.rkt

It'll be more than just C though, because we'll be generating
verification conditions and we'll allow you to enforce time and space
bounds.

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.

On Mon, Jun 3, 2019 at 11:53 AM zeRusski <vladilen.ko...@gmail.com> wrote:
>
> Oh wow! IIUC it is super awesome. Would a natural next step be #lang terra?
> Hey Jay McCarthy would you like to mentor that effort ;-)
>
>
> On Saturday, 1 June 2019 20:06:29 UTC+1, David Benoit wrote:
>>
>> Hi All,
>>
>> I've recently released a new library for dynamically generating FFI bindings 
>> to C by parsing header files.
>> It also allows users to create FFI libraries by writing C functions directly 
>> inline in Racket programs.
>>
>> The library works as a native extension to Racket by linking with Clang's 
>> parser libraries and converting AST declarations into FFI objects.
>> As a result, the package depends on Clang and LLVM headers and libraries.  
>> See the documentation for info on installing dependencies.
>>
>> I've only built the package on GNU/Linux so far.  If anyone is interested in 
>> building the library on other OSes, it should be a fairly trivial port.
>>
>> I'd like to give a special thanks to Jay McCarthy, who came up with the idea 
>> for this project and was my adviser during its implementation.
>> I hope its something the Racket community might find useful!
>>
>> More usage examples are available in the docs and the test directory in the 
>> source code.
>>
>> Thanks!
>> David B
>>
>> I'll sign off with a quick preview:
>>
>> #lang at-exp racket/base
>>
>> (require dynamic-ffi/unsafe)
>>
>> @define-inline-ffi[struct-test]{
>>   #include <stdlib.h>
>>   #include <stdio.h>
>>   #include <stdint.h>
>>
>>   typedef struct {
>>     char *name;
>>     uint64_t value;
>>   } number;
>>
>>   char* names[] = {"zero", "one", "two", "three", "four", "five", "six"
>>                  "seven", "eight", "nine", "ten", "eleven", "twelve"};
>>
>>   number add(number a, number b) {
>>     number c;
>>     c.value = a.value + b.value;
>>     if (c.value >12)  {
>>       fprintf(stderr, "error: this example can only count to twelve...\n");
>>       exit(1);
>>     }
>>     c.name = names[c.value];
>>     return c;
>>  }
>> }
>>
>> ;; _list-structs are created by default.  I hope to optimize this in the 
>> future.
>>
>> (define n2 (list "two" 2))
>>
>> (define n7 (list "seven" 7))
>>
>> (printf "add(n2, n2): ~a\n" (struct-test 'add n2 n2))  ;; output: add(n2, 
>> n2): (four 4)
>> (printf "add(n7, n7): ~a\n" (struct-test 'add n7 n7))  ;; output: error: 
>> this example can only count to twelve...
>>
>>
>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/628bf864-d261-481b-962c-2e54be297228%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJYbDa%3DVWBy6vc3C8Ag6JWtYsbEwGL_pyozzM5-DAuzexDo1tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to