Giter VIP home page Giter VIP logo

rbrich / xcikit Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 1.0 4.47 MB

Collection of C++ libraries for drawing 2D graphics, rendering text, and more.

Home Page: http://xci.cz

License: Apache License 2.0

CMake 2.42% C++ 92.78% C 0.35% GLSL 1.34% Python 1.86% Shell 0.67% Dockerfile 0.33% HTML 0.02% JavaScript 0.22%
glsl freetype text-rendering vulkan text-layout 2d-graphics user-interface scripting-engine programming-language cpp

xcikit's People

Contributors

rbrich avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

linecode

xcikit's Issues

Scripting language

Make the scripting language actually usable for scripting:

  • implement sort - hard with the current functional logic
  • bindings - call custom C++ functions from the script (#6)
  • bytecode files - save compiled module to a file, load it back later (#53)
  • Interpreter object with ability to run arbitrary code, call back to C++ and return result
  • add to README

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • Update emscripten/emsdk Docker tag to v3.1.59
  • Update hendrikmuhs/ccache-action action to v1.2.13
  • Update dependency catch2 to v3.6.0
  • Update dependency webpack to v5.91.0
  • 🔐 Create all pending approval PRs at once 🔐

Detected dependencies

dockerfile
docker/clang_tidy.dockerfile
docker/debian_11.dockerfile
docker/debian_12.dockerfile
docker/emscripten.dockerfile
  • emscripten/emsdk 3.1.48
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-python v5
  • ilammy/msvc-dev-cmd v1
  • hendrikmuhs/ccache-action v1.2.12
  • actions/cache v4
  • actions/upload-artifact v4
  • actions/upload-artifact v4
.github/workflows/label.yml
  • actions/labeler v5
.github/workflows/linter.yml
  • actions/checkout v4
npm
extras/fire_script_js/package.json
  • xterm 5.3.0
  • xterm-addon-fit 0.8.0
  • xterm-addon-web-links 0.9.0
  • webpack 5.88.2
  • webpack-cli 5.1.4
regex
conandata.yml
  • fmt 10.2.1
  • range-v3 0.12.0
  • taocpp-pegtl 3.2.7
  • magic_enum 0.9.5
  • zlib 1.3.1
  • libzip 1.10.1
  • sdl 2.30.2
  • vulkan-loader 1.3.231
  • freetype 2.13.2
  • harfbuzz 8.3.0
  • pfr 2.2.0
  • catch2 3.5.4
  • benchmark 1.8.3

  • Check this box to trigger a request for Renovate to run again on this repository

[script] All functions are of type T -> R

I.e. all functions have exactly one parameter and one return value. Which makes a nice symmetry.

On the machine stack, multiple arguments are already compatible with a tuple. And empty tuple has zero size:

  • Void => no param or no return value
  • tuple => multiple params or multiple return values

This will simplify the compiler and add some elegance to the language.

It will be good for generic functions, e.g. fun<T,R> f:(T->R) { ... } takes a parameter which can bind to any possible function (and nothing else).

On the other hand, this is probably the end of partial functions. Instead of add 1, one will need to write fun a { a + 1}. Hopefully it's not much worse. Some syntax sugar could be added later, but it would require a special syntax or a keyword. Probably not worth it.

Regarding syntax of function definitions and applications, they should be unified, i.e. require tuple for multiple parameters:

// (emulate) no params
fun Void { ... } // (still? it currently crashes) OK
{ ... }  // same as fun Void

// 1 param
fun a { ... } // still OK
fun a:[Int] { ... } // still OK
fun a:(Int,Float) { ... } // still OK

// (emulate) multiple params
fun a b { ... }  // no longer allowed
fun (a,b) { ... }  // new syntax
fun a,b { ... } // same (parentheses are optional)

Function application:

afun    // still application for Void function, to allow variables-are-functions
afun ()  // same
afun 1   // one arg
afun [1]  // one list arg
afun (1, 2) // one tuple arg, stands for multiple args
afun 1,2,3  // same, parens and internal spaces are optional
afun(1,2,3)  // probably won't allow, as the space stands for the application operator
afun 1 2   // transitive application

The last one is now explicit transitive application.
It was implicit before, i.e. any arg that "overflowed" was applied to the returned function.
Now it's explicit: apply first arg to this function and second arg to some other function that is returned by the first one. It's a compile error if afun doesn't return a function.

[script] Functional syntax for casts and constructors

Replace syntax 1:Int by:

Int 1
Int(1)
1 .Int

The middle syntax is optional. The last one also, but will be nice as it mirrors the function calls.

In case of user-defined types, this can be used to construct them from underlying type.

The dot syntax requires a space to distinguish from float, but might be resolvable by parser.

problems when compile the xcikit project

Prepare build directory

mkdir build && cd build

Install dependencies using Conan.

conan install .. --build missing

Configure

cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=~/sdk/xcikit

all that is ok,but when i build use the cmd "cmake --build ." FAILED

D:\xcikit-master\build>cmake --build .
[1/168] Building CXX object src\xci\core\CMakeFiles\xci-core.dir\cmake_pch.cxx.obj
FAILED: src/xci/core/CMakeFiles/xci-core.dir/cmake_pch.cxx.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -I..\third_party\widechar_width.. /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /YcD:/xcikit-master/build/src/xci/core/CMakeFiles/xci-core.dir/cmake_pch.hxx /FpD:/xcikit-master/build/src/xci/core/CMakeFiles/xci-core.dir/./cmake_pch.cxx.pch /FID:/xcikit-master/build/src/xci/core/CMakeFiles/xci-core.dir/cmake_pch.hxx /showIncludes /Fosrc\xci\core\CMakeFiles\xci-core.dir\cmake_pch.cxx.obj /Fdsrc\xci\core\xci-core.dir\xci-core.pdb /FS -c src\xci\core\CMakeFiles\xci-core.dir\cmake_pch.cxx
D:/xcikit-master/build/src/xci/core/CMakeFiles/xci-core.dir/cmake_pch.hxx(5): fatal error C1083: 无法打开包括文件: “fmt/format.h”: No such file or directory
[2/168] Building CXX object src\xci\data\CMakeFiles\xci-data.dir\Crc32.cpp.obj
FAILED: src/xci/data/CMakeFiles/xci-data.dir/Crc32.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -ID:\boost_1_81_0 /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Fosrc\xci\data\CMakeFiles\xci-data.dir\Crc32.cpp.obj /Fdsrc\xci\data\CMakeFiles\xci-data.dir\xci-data.pdb /FS -c ..\src\xci\data\Crc32.cpp
..\src\xci\data\Crc32.cpp(8): fatal error C1083: 无法打开包括文件: “zlib.h”: No such file or directory
[3/168] Building CXX object examples\core\CMakeFiles\demo_termctl.dir\demo_termctl.cpp.obj
FAILED: examples/core/CMakeFiles/demo_termctl.dir/demo_termctl.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\examples -I..\src -Iinclude /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Foexamples\core\CMakeFiles\demo_termctl.dir\demo_termctl.cpp.obj /Fdexamples\core\CMakeFiles\demo_termctl.dir\ /FS -c ..\examples\core\demo_termctl.cpp
D:\xcikit-master\src\xci/core/TermCtl.h(10): fatal error C1083: 无法打开包括文件: “fmt/format.h”: No such file or directory
[4/168] Building CXX object src\xci\data\CMakeFiles\xci-data.dir\Schema.cpp.obj
FAILED: src/xci/data/CMakeFiles/xci-data.dir/Schema.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -ID:\boost_1_81_0 /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Fosrc\xci\data\CMakeFiles\xci-data.dir\Schema.cpp.obj /Fdsrc\xci\data\CMakeFiles\xci-data.dir\xci-data.pdb /FS -c ..\src\xci\data\Schema.cpp
D:\xcikit-master\src\xci\data\ArchiveBase.h(13): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
[5/168] Building CXX object src\xci\data\CMakeFiles\xci-data.dir\BinaryReader.cpp.obj
FAILED: src/xci/data/CMakeFiles/xci-data.dir/BinaryReader.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -ID:\boost_1_81_0 /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Fosrc\xci\data\CMakeFiles\xci-data.dir\BinaryReader.cpp.obj /Fdsrc\xci\data\CMakeFiles\xci-data.dir\xci-data.pdb /FS -c ..\src\xci\data\BinaryReader.cpp
D:\xcikit-master\src\xci\data\ArchiveBase.h(13): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
[6/168] Building CXX object src\xci\data\CMakeFiles\xci-data.dir\BinaryWriter.cpp.obj
FAILED: src/xci/data/CMakeFiles/xci-data.dir/BinaryWriter.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -ID:\boost_1_81_0 /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Fosrc\xci\data\CMakeFiles\xci-data.dir\BinaryWriter.cpp.obj /Fdsrc\xci\data\CMakeFiles\xci-data.dir\xci-data.pdb /FS -c ..\src\xci\data\BinaryWriter.cpp
D:\xcikit-master\src\xci\data\ArchiveBase.h(13): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
[7/168] Building CXX object src\xci\data\CMakeFiles\xci-data.dir\Dumper.cpp.obj
FAILED: src/xci/data/CMakeFiles/xci-data.dir/Dumper.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\src -Iinclude -ID:\boost_1_81_0 /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Fosrc\xci\data\CMakeFiles\xci-data.dir\Dumper.cpp.obj /Fdsrc\xci\data\CMakeFiles\xci-data.dir\xci-data.pdb /FS -c ..\src\xci\data\Dumper.cpp
D:\xcikit-master\src\xci\data\ArchiveBase.h(13): fatal error C1083: 无法打开包括文件: “fmt/core.h”: No such file or directory
[8/168] Building CXX object examples\core\CMakeFiles\demo_chunked_stack.dir\demo_chunked_stack.cpp.obj
FAILED: examples/core/CMakeFiles/demo_chunked_stack.dir/demo_chunked_stack.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\examples -I..\src -Iinclude /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Foexamples\core\CMakeFiles\demo_chunked_stack.dir\demo_chunked_stack.cpp.obj /Fdexamples\core\CMakeFiles\demo_chunked_stack.dir\ /FS -c ..\examples\core\demo_chunked_stack.cpp
D:\xcikit-master\src\xci/core/log.h(12): fatal error C1083: 无法打开包括文件: “fmt/format.h”: No such file or directory
[9/168] Building CXX object examples\core\CMakeFiles\demo_event.dir\demo_event.cpp.obj
FAILED: examples/core/CMakeFiles/demo_event.dir/demo_event.cpp.obj
C:\PROGRA2\MICROS2\2019\PROFES1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING -D_SILENCE_CXX17_STRSTREAM_DEPRECATION_WARNING -I..\examples -I..\src -Iinclude /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /W4 /wd4100 /wd4146 /wd4200 /wd4244 /wd4702 /wd5105 /permissive- /Zc:preprocessor /Zc:inline /Zc:__cplusplus /utf-8 /bigobj -std:c++latest /showIncludes /Foexamples\core\CMakeFiles\demo_event.dir\demo_event.cpp.obj /Fdexamples\core\CMakeFiles\demo_event.dir\ /FS -c ..\examples\core\demo_event.cpp
D:\xcikit-master\src\xci/core/log.h(12): fatal error C1083: 无法打开包括文件: “fmt/format.h”: No such file or directory

////////////////////////////////////////////////////////////////////////////////////
i don't know where the error occur, i use conan manage all packages, also fmt is installed in the directory of "C:\Users\rt.conan\data.."

sorry my poor english.

find_file: grep binary files

Detect binary files and handle them specially - either switch to quiet mode (similar to grep tool), or switch to HEX mode and print context around the match - not lines, but 16 byte spans. Similar to hexdump -C:

0013f800  05 e9 00 25 00 20 40 1d  00 03 05 01 01 03 01 64  |...%. @........d|
0013f810  00 00 00 02 5f 04 01 02  02 70 00 4c 23 22 27 23  |...._....p.L#"'#|
0013f820  23 24 06 0b 1a 2b 01 26  26 27 26 23 22 07 06 15  |#$...+.&&'&#"...|
0013f830  15 23 34 37 36 33 32 17  16 17 17 16 17 16 33 32  |.#47632.......32|
0013f840  36 35 35 33 06 07 06 23  22 27 26 27 02 2b 0d 13  |6553...#"'&'.+..|
0013f850  08 14 08 24 13 14 7d 34  33 55 21 22 20 2f 39 14  |...$..}43U!" /9.|
0013f860  14 10 10 1f 28 7d 02 33  33 54 1e 22 20 32 05 5a  |....(}.33T." 2.Z|

Preprocessor

Doesn't need to be really a separate preprocessor, can be part of parser. A "preprocess-only" option will emit source code with conditionals and includes applied, #syntax can be either kept untouched or removed.

To avoid emitting special markers for compiler (real/logical line numbers etc.), the directives can be consumed directly by compiler, inclusion will create new file context but keep same AST, conditional will skip part of source, etc.

  • #syntax fire 1.0 (<lang> <major>[.<minor>]) - optional declaration of language version, checked by compiler ( part only informative, <lang> <major> must be known to the compiler, otherwise it emits error or warning)
  • #include
  • #if

New idea: still textual preprocessor, but the language will be the xci-script, i.e. you can define compile-time function that can be called to generate code.

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.