Skip to content

Instantly share code, notes, and snippets.

View Verdagon's full-sized avatar

Evan Ovadia Verdagon

View GitHub Profile
% ./main -m ../mixtral/mixtral-8x7b-instruct-v0.1.Q5_K_M.gguf -t 8 -n 1 -p "<|system|>You are a helpful assistant that only ever answers Yes or No. You answer one word then immediately stop, with nothing else in the response, not even punctuation or space, just one word Yes or no.<|im_end|><|im_start|>Is 11134 an even number? Answer yes or no, nothing else.</s><|assistant|>"
Log start
main: build = 2392 (bb6d00bb)
main: built with Apple clang version 14.0.3 (clang-1403.0.22.14.1) for arm64-apple-darwin23.4.0
main: seed = 1713222923
llama_model_loader: loaded meta data with 26 key-value pairs and 995 tensors from ../mixtral/mixtral-8x7b-instruct-v0.1.Q5_K_M.gguf (version GGUF V3 (latest))
llama_model_loader: Dumping metadata keys/values. Note: KV overrides do not apply in this output.
llama_model_loader: - kv 0: general.architecture str = llama
llama_model_loader: - kv 1: general.name str = mistralai_mixtral-8x7b-instruct-v0.1
l

For example, if we have normal rust function:

pub fn kork(zork: u64) -> bool

We'd generate this Rust wrapper library code:

#[no_mangle]
pub extern "C" fn kork_extern(zork: u64) -> bool {
    inner_lib::kork(zork)

let's make a rust wrapper library and a C header for my normal "inner" rust library, so that my C program can take advantage of rust's standard library.

For example, if we have normal rust function:

pub fn kork(zork: u64) -> bool

Then we would generate this Rust wrapper library code:

#[no_mangle] pub extern "C" fn kork_extern(zork: u64) -> bool {

Greetings, Vale sponsors!
Because of some medical reasons*, I have to take an extended break from the coding side of Vale. I asked GitHub to pause the ValeLang sponsors account, which they unfortunately said is impossible. Given the unknown timeframe (and that I've been leaning toward switching to Patreon eventually anyway), I'll be closing the ValeLang sponsors account in a couple days.
Vale isn't going away! It's one of my favorite things to do (and blog about) but it could be some time before it's back in full swing. When the time comes, I plan on returning slowly, doing some light bug fixes, making some articles, and when I'm back at full-speed, finishing the long-awaited Vale 0.3 "Angband" release.
In case some of our paths don't cross again: thank you for sponsoring! Your support has been inspiring and uplifting, and it's amazing to see that so many of us share the excitement and hope for easier high-performance code. Your support has helped me get through some pretty tough challenges (especially reg
Greetings, Vale sponsors!
Because of some medical reasons*, I have to take an extended break from the coding side of Vale. I asked GitHub to pause the ValeLang sponsors account, which they unfortunately said is impossible. Given the unknown timeframe (and that I've been leaning toward switching to Patreon eventually anyway), I'll be closing the ValeLang sponsors account in a couple days.
Vale isn't going away! It's one of my favorite things to do (and blog about) but it could be some time before it's back in full swing. When the time comes, I plan on returning slowly, doing some light bug fixes, making some articles, and when I'm back at full-speed, finishing the long-awaited Vale 0.3 "Angband" release.
In case some of our paths don't cross again: thank you for sponsoring! Your support has been inspiring and uplifting, and it's amazing to see that so many of us share the excitement and hope for easier high-performance code. Your support has helped me get through some pretty tough challenges (especially reg
@Verdagon
Verdagon / gist:569271232a94495bc3b38cd8d7469634
Created December 19, 2023 02:48
Closing ValeLang sponsors account
Greetings, Vale sponsors!
Because of some medical reasons*, I have to take an extended break from the coding side of Vale. I asked GitHub to pause the ValeLang sponsors account, which they unfortunately said is impossible. Given the unknown timeframe (and that I've been leaning toward switching to Patreon eventually anyway), I'll be closing the ValeLang sponsors account in a couple days.
Vale isn't going away! It's one of my favorite things to do (and blog about) but it could be some time before it's back in full swing. When the time comes, I plan on returning slowly, doing some light bug fixes, making some articles, and when I'm back at full-speed, finishing the long-awaited Vale 0.3 "Angband" release.
In case some of our paths don't cross again: thank you for sponsoring! Your support has been inspiring and uplifting, and it's amazing to see that so many of us share the excitement and hope for easier high-performance code. Your support has helped me get through some pretty tough challenges (especially reg
use vale_rust_ffi_utils::ValeStr;
use vale_rust_ffi_utils::make_vale_str;
use vale_rust_ffi_utils::load_vale_str;
use std::ffi::OsString;
use std::fs;
#[repr(C)]
pub struct DirReader {
data: [u8; std::mem::size_of::<fs::ReadDir>()]
}
func MakeBoard(rand_seed int) [][]bool {
rows = [][]bool(20);
foreach row_i in 0..20 {
row = []bool(20);
foreach col_i in 0..20 {
random_bool = true;
// Implicit & causes a gen check in push. Inlining will fix.
row.push(random_bool);
}
valerian@ubuntu:~/core/build$ sudo make install
[sudo] password for valerian:
[ 1%] Built target version
[ 1%] Built target preprocessor
[ 2%] Built target environment
[ 2%] Built target format
[ 3%] Built target threading
[ 10%] Built target log
[ 12%] Built target memory
[ 13%] Built target portability
valerian@ubuntu:~/core$ tools/metacall-environment.sh
++ pwd
+ ROOT_DIR=/home/valerian/core
+ APT_CACHE=0
+ APT_CACHE_CMD=
+ INSTALL_APT=1
+ INSTALL_PYTHON=0
+ INSTALL_RUBY=0
+ INSTALL_RUST=0
+ INSTALL_RAPIDJSON=0