Giter Site home page Giter Site logo

foonathan / clauf Goto Github PK

View Code? Open in Web Editor NEW
48.0 6.0 2.0 611 KB

A C interpreter developed live on YouTube

Home Page: https://www.youtube.com/playlist?list=PLbxut1xyrkCZ-9d_03G0KBU4uh782J1eN

License: Boost Software License 1.0

CMake 0.96% C++ 96.16% C 2.88%
compiler livecoding interpreter

clauf's Issues

Question: which gcc/g++ version does it support?

Hi @foonathan ! Thank you for your streams, and work here.

I was trying to follow along with your stream, trying to write it myself, and couldn't compile. I cross-checked by directly cloning this repo, and trying to build it, and I get this error:

[ 17%] Building CXX object _deps/lauf-build/src/CMakeFiles/lauf_core.dir/lauf/vm.cpp.o
In file included from /tmp/clauf/_deps/lauf-src/src/../include/lauf/vm.h:7,
                 from /tmp/clauf/_deps/lauf-src/src/./lauf/vm.hpp:7,
                 from /tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:4:
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp: In function ‘bool lauf::execute(const lauf_asm_inst*, lauf_runtime_value*, lauf_runtime_stack_frame*, lauf_runtime_process*)’:
/tmp/clauf/_deps/lauf-src/src/../include/lauf/config.h:42:24: error: attributes at the beginning of statement are ignored [-Werror=attributes]
   42 | #define LAUF_TAIL_CALL [[clang::musttail]]
      |                        ^~~~~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:16:5: note: in expansion of macro ‘LAUF_TAIL_CALL’
   16 |     LAUF_TAIL_CALL return lauf::dispatch[std::size_t(ip->op())](ip, vstack_ptr, frame_ptr, process)
      |     ^~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:21:5: note: in expansion of macro ‘LAUF_VM_DISPATCH’
   21 |     LAUF_VM_DISPATCH;
      |     ^~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp: In function ‘bool lauf_runtime_builtin_dispatch(const lauf_asm_inst*, lauf_runtime_value*, lauf_runtime_stack_frame*, lauf_runtime_process*)’:
/tmp/clauf/_deps/lauf-src/src/../include/lauf/config.h:42:24: error: attributes at the beginning of statement are ignored [-Werror=attributes]
   42 | #define LAUF_TAIL_CALL [[clang::musttail]]
      |                        ^~~~~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:16:5: note: in expansion of macro ‘LAUF_TAIL_CALL’
   16 |     LAUF_TAIL_CALL return lauf::dispatch[std::size_t(ip->op())](ip, vstack_ptr, frame_ptr, process)
      |     ^~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/vm_execute.hpp:30:5: note: in expansion of macro ‘LAUF_VM_DISPATCH’
   30 |     LAUF_VM_DISPATCH;
      |     ^~~~~~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp: In function ‘bool lauf_vm_execute(lauf_vm*, lauf_asm_program*, const lauf_runtime_value*, lauf_runtime_value*)’:
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:185:17: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body]
  185 |                 ; // We don't know the starting address of the allocation.
      |                 ^
In file included from /tmp/clauf/_deps/lauf-src/src/./lauf/runtime/process.hpp:12,
                 from /tmp/clauf/_deps/lauf-src/src/./lauf/vm.hpp:10:
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp: In instantiation of ‘void lauf::array<T>::reserve(lauf::arena_base&, std::size_t) [with T = lauf::allocation; std::size_t = long unsigned int]’:
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:179:13:   required from ‘void lauf::array<T>::resize_uninitialized(lauf::arena_base&, std::size_t) [with T = lauf::allocation; std::size_t = long unsigned int]’
/tmp/clauf/_deps/lauf-src/src/lauf/vm.cpp:102:46:   required from here
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:126:25: error: conversion from ‘long unsigned int’ to ‘long unsigned int:63’ may change value [-Werror=conversion]
  126 |             _capacity = new_capacity;
      |                         ^~~~~~~~~~~~
/tmp/clauf/_deps/lauf-src/src/./lauf/support/array.hpp:136:25: error: conversion from ‘long unsigned int’ to ‘long unsigned int:63’ may change value [-Werror=conversion]
  136 |             _capacity = new_capacity;
      |                         ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [_deps/lauf-build/src/CMakeFiles/lauf_core.dir/build.make:104: _deps/lauf-build/src/CMakeFiles/lauf_core.dir/lauf/vm.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:299: _deps/lauf-build/src/CMakeFiles/lauf_core.dir/all] Error 2
make: *** [Makefile:101: all] Error 

I understand the project is in very initial stages, but I just wanted to understand if I'm using any wrong version of compiler since you mentioned C++ 23 in your README.

I'm using: g++ (GCC) 12.2.0.

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.