[Top][All Lists]

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

[ANN] nyacc 1.05.0 released

From: Matt Wette
Subject: [ANN] nyacc 1.05.0 released
Date: Sun, 5 Sep 2021 10:11:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

NYACC, for Not Yet Another Compiler Compiler, is set of guile modules for
generating parsers and lexical analyzers.  It also provides sample parsers
and pretty-printers using SXML trees as an intermediate representation.

It provides a decent C parser and a `FFI Helper' tool to help create
Guile Scheme bindings for C-based libraries.

It provides (partially implemented) compilers based on above mentioned
parsers to allow execution with Guile as extension languages.

NEWS for V1.05.0

        * remove dependence on srfi-43, vector operations; this was
          causing issues with some Guile versions 2.0.X
        * cleaned up c99-error exception messages in compile-ffi
        * examples/ffi/termios.ffi: added def-keepers
        * in following, $ENL = examples/nyacc/lang
        * removed $ENL/ecmascript
        * $ENL/javascript: merged body.scm into parser.scm
        * install/uninstall read-line-code now returns #<unspecified>
        * $ENL/tcl/parser.scm: fixed reading array index as number;
          (1,2,3) was read as number, now as string
        * scripts/compile-ffi: add option -s to show includes being read
        * c99 parser def-help now adds apple dependencies
        * worked on ffi-helper per-decl usage (i.e. C-decl syntax)
        * updated "make check" to provide overall sucess/fail message

Example using FFI helper w/o define-ffi-module:

mwette$ guile
scheme@(guile-user)> ,use (nyacc lang c99 ffi-help)
scheme@(guile-user)> ,pp (C-decl->scm "struct foo { int x; double y; };")
$1 = (bs:struct (list `(x ,int) `(y ,double)))
scheme@(guile-user)> ,use (bytestructures guile)
scheme@(guile-user)> ,use (system ffi-help-rt)
scheme@(guile-user)> (use-modules ((system foreign) #:prefix ffi:))
scheme@(guile-user)> (define struct-foo-desc
                         (C-decl "struct foo { int x; double y; };"))
scheme@(guile-user)> (define-fh-compound-type struct-foo
                         struct-foo-desc struct-foo? make-struct-foo)
scheme@(guile-user)> (make-struct-foo)
$2 = #<struct-foo 0x7f61394d7d40>
scheme@(guile-user)> (define my-sqrt (C-decl "double sqrt(double);"))
scheme@(guile-user)> (my-sqrt 4.0)
$3 = 2.0

mwette$ guile
scheme@(guile-user)> ,use (nyacc lang c99 ffi-help)
scheme@(guile-user)> ,d load-include-file
- Procedure: load-include-file filename [#:pkg-config pkg]
     This is the functionality that Ludo was asking for: to be at guile
     prompt and be able to issue
          (use-modules (nyacc lang c99 ffi-help))
          (load-include-file "cairo.h" #:pkg-config "cairo")

scheme@(guile-user)> (load-include-file "cairo.h" #:pkg-config "cairo")

NYACC maturity is production/stable level.

NYACC is free software; the full source distribution is available through

* the tarball repository:

* the git repository:

home page, project page and user's guides:

Report bugs:

Get support:

reply via email to

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