败犬日报 2025-02-08
1. DeepSeek 支持多长上下文
DeepSeek-V3 支持 128k 长度不丢失精度。
2. rpc 怎么传递一个函数
本地定义了个 filter 函数,需要传到远端实施这个 filter,然后把过滤后的数据传回来。完整数据传回来再过滤太慢了。
(传递二进制过去执行是很危险的行为,这个二进制可以执行任意行为)
需要创造一个 DSL,在远端实现一个 parser 解释执行,类似 SQL。这样接口就是受控的。
3. 引用类型后面不能 ::
cpp
#include <type_traits>
struct A {
static int x;
};
int A::x;
using R = A&;
int main() {
A::x = 1;
R::x = 1; // 编译错误
std::decay_t<R>::x = 1; // ok
}
要加 std::decay_t
。
4. experimental simd 进展如何
进 C++26 了。
Parallelism TS 的进展:
- libc++ https://libcxx.llvm.org/Status/Parallelism.html
- libstdc++ https://libcxx.llvm.org/Status/Parallelism.html