


FAISS CGO throws 'undefined symbols for architecture arm64' when using libfaiss_c.a
php editor Zimo encountered a problem when using libfaiss_c.a, that is, FAISS CGO threw an "undefined symbol for architecture arm64" error. This error may be caused by missing some symbols when using libfaiss_c.a on 64-bit ARM architecture. To solve this problem, you can try to update or recompile libfaiss_c.a to make sure it is the version suitable for the arm64 architecture. Additionally, you can check that the correct compile and link options are used. I hope these solutions can help developers who encounter similar problems.
Question content
I'm trying to write a standalone go-faiss
wrapper to call FAISS's KMEANS function.
Warehouse: https://www.php.cn/link/4e4faae72b1c3cbd446a70e89e59d8fc
This approach is inspired by https://github.com/andyalm/faissmask/tree/master/FaissMask/runtimes
FAISS static librarylibfaiss_c.a
Build using -DBUILD_SHARED_LIBS=OFF
error log
# faiss-go/pkg/ivf.test /usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1 Undefined symbols for architecture arm64: "faiss::Clustering::Clustering(int, int)", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) "faiss::Clustering::Clustering(int, int, faiss::ClusteringParameters const&)", referenced from: _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) "faiss::kmeans_clustering(unsigned long, unsigned long, unsigned long, float const*, float*)", referenced from: _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "faiss::ClusteringParameters::ClusteringParameters()", referenced from: _faiss_ClusteringParameters_init in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) "std::exception_ptr::exception_ptr(std::exception_ptr const&)", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) "std::exception_ptr::~exception_ptr()", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) thread-local wrapper routine for faiss_last_exception in libfaiss_c.a(error_impl.cpp.o) _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering.cold.1 in libfaiss_c.a(Clustering_c.cpp.o) ... "std::exception_ptr::operator=(std::exception_ptr const&)", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering.cold.1 in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering.cold.2 in libfaiss_c.a(Clustering_c.cpp.o) "std::runtime_error::runtime_error(char const*)", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "std::runtime_error::runtime_error(std::runtime_error const&)", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "std::runtime_error::~runtime_error()", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering.cold.2 in libfaiss_c.a(Clustering_c.cpp.o) "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::FaissException(faiss::FaissException const&) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "std::exception::~exception()", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering.cold.1 in libfaiss_c.a(Clustering_c.cpp.o) "std::exception::~exception()", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::FaissException(faiss::FaissException const&) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::~FaissException() in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "std::current_exception()", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "std::rethrow_exception(std::exception_ptr)", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) "std::terminate()", referenced from: ___clang_call_terminate in libfaiss_c.a(Clustering_c.cpp.o) "typeinfo for faiss::FaissException", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table21 in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table28 in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table29 in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table31 in libfaiss_c.a(Clustering_c.cpp.o) ... "typeinfo for std::runtime_error", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "typeinfo for std::exception", referenced from: GCC_except_table0 in libfaiss_c.a(error_impl.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table21 in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table28 in libfaiss_c.a(Clustering_c.cpp.o) GCC_except_table29 in libfaiss_c.a(Clustering_c.cpp.o) ... "vtable for faiss::FaissException", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::FaissException(faiss::FaissException const&) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::~FaissException() in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for std::exception", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "operator delete(void*)", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::~FaissException() in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "operator new(unsigned long)", referenced from: _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) "___cxa_allocate_exception", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "___cxa_begin_catch", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) ___clang_call_terminate in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) ... "___cxa_end_catch", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) ... "___cxa_free_exception", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "___cxa_throw", referenced from: std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_train in libfaiss_c.a(Clustering_c.cpp.o) _faiss_kmeans_clustering in libfaiss_c.a(Clustering_c.cpp.o) "___gxx_personality_v0", referenced from: _faiss_get_last_error in libfaiss_c.a(error_impl.cpp.o) _faiss_Clustering_new in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::runtime_error>(std::runtime_error) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<std::exception>(std::exception) in libfaiss_c.a(Clustering_c.cpp.o) std::exception_ptr std::make_exception_ptr[abi:v15006]<faiss::FaissException>(faiss::FaissException) in libfaiss_c.a(Clustering_c.cpp.o) faiss::FaissException::FaissException(faiss::FaissException const&) in libfaiss_c.a(Clustering_c.cpp.o) _faiss_Clustering_new_with_params in libfaiss_c.a(Clustering_c.cpp.o) ... ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)I'm using these CGO headers
/* #cgo darwin LDFLAGS: -L${SRCDIR}/../../cgo/thirdparty/runtimes/osx-arm64/native -lfaiss_c #include <stdlib.h> #include <faiss/c_api/Clustering_c.h> #include <faiss/c_api/impl/AuxIndexStructures_c.h> #include <faiss/c_api/index_factory_c.h> #include <faiss/c_api/error_c.h> */However, when we build
libfaiss_c.dylib using
-DBUILD_SHARED_LIBS=ON and add
libfaiss_c.dylib to
/usr/local/lib This CGO code works fine. The CGO header now looks like this
/* #cgo LDFLAGS: -lfaiss_c #include <stdlib.h> #include <faiss/c_api/Clustering_c.h> #include <faiss/c_api/impl/AuxIndexStructures_c.h> #include <faiss/c_api/index_factory_c.h> #include <faiss/c_api/error_c.h> */Please help me link
*.a files with CGO from custom path.
When I have these files in
/usr/local/lib
These files written to
/usr/local/lib are created using the following make file
GIT_COMMAND ?= git FAISS_COMMIT ?= d87888b13e7eb339bb9c45825e9d20def6665171 all: faiss .PHONY: faiss faiss: if [ -e faiss ]; then \ cd faiss && ${GIT_COMMAND} fetch origin && git reset --hard $(FAISS_COMMIT); \ else \ ${GIT_COMMAND} clone https://github.com/facebookresearch/faiss.git && cd faiss && git reset --hard $(FAISS_COMMIT); \ fi cd faiss && \ export CMAKE_PREFIX_PATH=/opt/homebrew/opt/openblas:/opt/homebrew/opt/libomp:/opt/homebrew && \ cmake -B build -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DFAISS_ENABLE_PYTHON=OFF . && \ make -C build && \ sudo make -C build install && \ sudo cp build/c_api/libfaiss_c.dylib /usr/local/lib/libfaiss_c.dylibUpdate 2
For go-rocks database library, https://github.com/linxGnu/grocksdb#build
They also recommend installing/building the rocksdb library locally and linking it with the cgo interface.
Is this method of independently building the static library "*.a" and providing it as an independent library valid?
Update 3
Go version
$ go version
go version go1.20 darwin/arm64
Operating system and processor architecture?
<p>$ go env
GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/me/GolandProjects/0learning/faiss-cgo-kmeans/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
</p>
Update 4refer to: https://stackoverflow.com/a/63321095/1609570
<code>➜ native git:(master) otool -L libfaiss_c.a Archive : libfaiss_c.a libfaiss_c.a(AutoTune_c.cpp.o): libfaiss_c.a(Clustering_c.cpp.o): libfaiss_c.a(IndexFlat_c.cpp.o): libfaiss_c.a(IndexIVFFlat_c.cpp.o): libfaiss_c.a(IndexIVF_c.cpp.o): libfaiss_c.a(IndexLSH_c.cpp.o): libfaiss_c.a(IndexPreTransform_c.cpp.o): libfaiss_c.a(VectorTransform_c.cpp.o): libfaiss_c.a(IndexShards_c.cpp.o): libfaiss_c.a(IndexReplicas_c.cpp.o): libfaiss_c.a(Index_c.cpp.o): libfaiss_c.a(IndexBinary_c.cpp.o): libfaiss_c.a(IndexScalarQuantizer_c.cpp.o): libfaiss_c.a(MetaIndexes_c.cpp.o): libfaiss_c.a(clone_index_c.cpp.o): libfaiss_c.a(error_impl.cpp.o): libfaiss_c.a(index_factory_c.cpp.o): libfaiss_c.a(index_io_c.cpp.o): libfaiss_c.a(AuxIndexStructures_c.cpp.o): libfaiss_c.a(distances_c.cpp.o): ➜ native git:(master) </code>SolutionThanks to @HarishGanesan for pointing out that
FAISS c_api depends on FAISS and static linking needs to include it as well.
After studying thec-rocksdb implementation of
CockroachDB, I found some additional flags that can help resolve the architecture arm64 error undefined symbols
<pre class='brush:php;toolbar:false;'>/*
#cgo CPPFLAGS: -Ithirdparty/libfaiss-src/c_api
#cgo CFLAGS: -Ithirdparty/libfaiss-src/c_api
#cgo darwin LDFLAGS: -Lthirdparty/runtimes/osx-arm64/native -lfaiss_c -lfaiss -lomp
#cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all
#include <stdlib.h>
#include <Clustering_c.h>
#include <impl/AuxIndexStructures_c.h>
#include <index_factory_c.h>
#include <error_c.h>
*/</pre>
The complete code can be found
here.
Update 1https://www.php.cn/link/307eb8ee16198da891c521eca21464c1
https://www.php.cn/link/d585d095b00cd2f5b50acb64add23834
These projects are good reference points for static linking against external C libraries.The above is the detailed content of FAISS CGO throws 'undefined symbols for architecture arm64' when using libfaiss_c.a. For more information, please follow other related articles on the PHP Chinese website!

In Go, using mutexes and locks is the key to ensuring thread safety. 1) Use sync.Mutex for mutually exclusive access, 2) Use sync.RWMutex for read and write operations, 3) Use atomic operations for performance optimization. Mastering these tools and their usage skills is essential to writing efficient and reliable concurrent programs.

How to optimize the performance of concurrent Go code? Use Go's built-in tools such as getest, gobench, and pprof for benchmarking and performance analysis. 1) Use the testing package to write benchmarks to evaluate the execution speed of concurrent functions. 2) Use the pprof tool to perform performance analysis and identify bottlenecks in the program. 3) Adjust the garbage collection settings to reduce its impact on performance. 4) Optimize channel operation and limit the number of goroutines to improve efficiency. Through continuous benchmarking and performance analysis, the performance of concurrent Go code can be effectively improved.

The common pitfalls of error handling in concurrent Go programs include: 1. Ensure error propagation, 2. Processing timeout, 3. Aggregation errors, 4. Use context management, 5. Error wrapping, 6. Logging, 7. Testing. These strategies help to effectively handle errors in concurrent environments.

ImplicitinterfaceimplementationinGoembodiesducktypingbyallowingtypestosatisfyinterfaceswithoutexplicitdeclaration.1)Itpromotesflexibilityandmodularitybyfocusingonbehavior.2)Challengesincludeupdatingmethodsignaturesandtrackingimplementations.3)Toolsli

In Go programming, ways to effectively manage errors include: 1) using error values instead of exceptions, 2) using error wrapping techniques, 3) defining custom error types, 4) reusing error values for performance, 5) using panic and recovery with caution, 6) ensuring that error messages are clear and consistent, 7) recording error handling strategies, 8) treating errors as first-class citizens, 9) using error channels to handle asynchronous errors. These practices and patterns help write more robust, maintainable and efficient code.

Implementing concurrency in Go can be achieved by using goroutines and channels. 1) Use goroutines to perform tasks in parallel, such as enjoying music and observing friends at the same time in the example. 2) Securely transfer data between goroutines through channels, such as producer and consumer models. 3) Avoid excessive use of goroutines and deadlocks, and design the system reasonably to optimize concurrent programs.

Gooffersmultipleapproachesforbuildingconcurrentdatastructures,includingmutexes,channels,andatomicoperations.1)Mutexesprovidesimplethreadsafetybutcancauseperformancebottlenecks.2)Channelsofferscalabilitybutmayblockiffullorempty.3)Atomicoperationsareef

Go'serrorhandlingisexplicit,treatingerrorsasreturnedvaluesratherthanexceptions,unlikePythonandJava.1)Go'sapproachensureserrorawarenessbutcanleadtoverbosecode.2)PythonandJavauseexceptionsforcleanercodebutmaymisserrors.3)Go'smethodpromotesrobustnessand


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
