lizabelos / guile18_androidmsvc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guile++

This project is fork of Guile 1.8.8 version, that aims to :

  • Be compatible with recent and newer systems. This includes MSVC 64 bits, and Android.
  • To be dependency free.
  • To be easily embeddable in other projects.

Status

Platform Build Status Test Pass
Ubuntu Latest Build Status

Building

This version of Guile use CMake as a build system. Autoconf was designed for Unix systems, and is difficult to use on MSVC. That is why we prefer to use CMake, which has a cross-platform easy syntax, can generate not only Makefile but also Visual Studio projects, Xcode projects, and many others, and can be easily integrated to Android and iOS project.

On any system, you can build Guile with the following commands :

mkdir build
cd build
cmake ..
cmake --build .

Embedding

This Guile version has been designed to be embeddable in other CMake projects.

1. Clone this repository in a subdirectory of your project (e.g. thirdparty/guile)

2. Add the following lines to your CMakeLists.txt file :

add_subdirectory(thirdparty/guile)

3. You can now use the guile target in your project :

add_executable(my_executable my_executable.c)
target_link_libraries(my_executable PUBLIC guile)

Using Guile with Qt

If you are building a Qt Application with Guile (for example for an Android application), enable the USE_GUILE_QT option when configuring Guile :

set(USE_GUILE_QT5 ON CACHE BOOL "Use Guile with Qt" FORCE)
# or
set(USE_GUILE_QT6 ON CACHE BOOL "Use Guile with Qt" FORCE)

Using Qt resources, Guile will automatically embed ice9 into your application. You can use te embedded ice9 by adding scm_use_embedded_ice9(); to your C++ code :

#include <libguile.hpp>

int main(int argc, char **argv) {
    scm_use_embedded_ice9();
    scm_boot_guile(argc, argv, inner_main, nullptr);
    return 0;
}

Note that scm_use_embedded_ice9(); has the priority to the GUILE_LOAD_PATH environment variable.

The new C++ callback API (experimental)

The new C++ callback API is a new way to call C++ code from Guile code. It is a replacement for the old scm_c_define_gsubr API. The new API allows to use member functions as callbacks, to use lambdas, and to capture variables in the lambdas.

register_callback("testfn8", [](SCM args) {
        printf("testfn8 called\n");
        return SCM_UNSPECIFIED;
    }, 8);
scm_c_eval_string("(testfn8 1 2 3 4 5 6 7 8)");

What is not working with this version of Guile ?

We do not plan to implement the following features :

  • Futures
  • i18n (gettext)
  • ioext
  • everything related to posix (exemple: filesys, regex)
  • net_db, socket
  • dynamic linking
  • extensions

We do not plan to re-active the following features :

  • threads

About

License:Other


Languages

Language:C 57.3%Language:Scheme 33.5%Language:Pascal 2.4%Language:Logos 1.8%Language:Emacs Lisp 1.7%Language:CMake 1.2%Language:Makefile 0.7%Language:Shell 0.5%Language:C++ 0.3%Language:RPC 0.2%Language:Python 0.2%Language:M4 0.1%Language:Lex 0.1%Language:Awk 0.0%Language:QMake 0.0%Language:Batchfile 0.0%