Skip to content

Instantly share code, notes, and snippets.

View Verdagon's full-sized avatar

Evan Ovadia Verdagon

View GitHub Profile
@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
valerian@ubuntu:~/core/build$ cmake -DOPTION_BUILD_LOADERS_C=ON -DOPTION_BUILD_LOADERS_RS=ON ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++

Prototyping and Iterating

The borrow checker can be [slower](https://news.ycombinator.com/item?id=31063493 .anecdote) to prototype [with](https://news.ycombinator.com/item?id=26419670 .anecdote) when we just want to [solve](https://news.ycombinator.com/item?id=28804477 .anecdote) [the problem](https://news.ycombinator.com/item?id=23744577 .anecdote) rather than being [distracted by the language](https://blogs.dust3d.org/2019/03/13/why-i-rewrote-the-mesh-generator-of-dust3d-from-rust-to-cplusplus/ .anecdote), even for [more](https://lobste.rs/s/veinkw/comparison_rust_zig#c_nmf8jz .anecdote) [experienced](https://news.ycombinator.com/item?id=31568497 .anecdote) [rustaceans](https://www.reddit.com/r/rust/comments/iwij5i/blog_post_why_not_rust/g627nwx/ .anecdote).

[One user says,](https://www.reddit.com/r/rust/comments/iwij5i/comment/g62ytxa/?utm_source=share&amp;utm_medium=web2x&amp;context=3 .anecdote) "Rust’s complexity regularly slows things down when you’re work

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <setjmp.h>
_Thread_local void* current_coroutine_args = NULL;
size_t rotate_left(size_t x, int bits) {
return (x << bits) | (x >> ((sizeof(size_t) * 8) - bits));
}
// Make some accounts.
let accounts = [];
accounts.push({ name: "Bob", money: 100, labelView: null });
accounts.push({ name: "Cindy", money: 100, labelView: null });
accounts.push({ name: "Reginald", money: 100, labelView: null });
accounts.push({ name: "Jim Argalax", money: 100, labelView: null });
accounts.push({ name: "Valerian Vast", money: 100, labelView: null });
accounts.push({ name: "Archonicus Auriarch", money: 100, labelView: null });
// Add each account to the document. It will look like: