Giter VIP home page Giter VIP logo

babble's People

Contributors

anderslanglands avatar davvid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

babble's Issues

Add support for constants

We need a mechanism for binding constants, both constexpr/static const globals and constexpr static const class members which will want to be converted to #defines on the C API.

add support for inheriting from C++ base classes in the C API

We'll need to use the same sort of infrastructure as for stdfunction wrapping, but:

  • we'll need to generate trampolines for each virtual method in the base class we're inheriting from
  • the user will need to pass a virtual function table in to the generated constructors

`bbl-translate` fails to `#include babble` when compiled on macOS

I'm trying to build babble on mac (#10 branch). I'm compiling with the homebrew-installed llvm and zig cc as a compiler as it uses its own toolchain and avoids some of the problems I've been having with native/homebrew clang. The full build script is
CC=zig-cc CXX=zig-c++ cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=install -DLLVM_DIR=/usr/local/Cellar/llvm/17.0.6_1/lib/cmake/llvm/ && cmake --build build

(zig-cc and zig-c++ are just files installed in ~/.local/bin containing zig c++ $@ etc.).

I'm getting this issue with the tests where bbl-translate is run:

[13/31] Linking CXX static library test/stdfunction/libstdfunction-bind-dummy.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: test/stdfunction/libstdfunction-bind-dummy.a(bind.cpp.o) has no symbols
[16/31] Generating smartptr-c.cpp
FAILED: test/smartptr/smartptr-c.cpp /Users/ashley/babble/build/test/smartptr/smartptr-c.cpp
cd /Users/ashley/babble/build/test/smartptr && /Users/ashley/babble/build/bbl/bbl-translate /Users/ashley/babble/test/smartptr/bind.cpp -- -std=c++17 -fsyntax-only -fno-spell-checking -I/usr/local/opt/llvm/lib/clang/17/include -I/Users/ashley/babble/bbl/include -I/Users/ashley/babble/test/smartptr -- smartptr -o /Users/ashley/babble/build/test/smartptr
/Users/ashley/babble/test/smartptr/bind.cpp:1:10: fatal error: cannot open file '/Users/ashley/babble/test/smartptr/babble': No such file or directory
    1 | #include "babble"
      |          ^
[2024-01-30 16:13:10.335] [info] [cpp_context.cpp:2872] ASTs built in 1.0951439109999999s
[2024-01-30 16:13:10.340] [error] [api_cpp_context.cpp:45] /Users/ashley/babble/bbl/src/cpp_context.cpp:2885 compilation generated 3045 errors. Cannot continue
[2024-01-30 16:13:10.341] [error] [bbl-translate.cpp:491] extraction failed after 1.1113919739999998s

I don't really know what to make of it.

Store location with each extracted object for error messages

Currently the translation layer has no access to the location of the original decls. Need to add a

struct Location {
    std::string filename;
    int line;
    int col;
};

or similar to each that would be filled during extraction in order to be able to point users to where a decl came from in case of error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.