Rustpkg is a revamp of Cargo that brings awesome new features such as a build system described in build scripts.
It's a purely functional package manager that has no central sources of any kind,
but rather installs via URLs. It's similar to how Go's go get
tool works, except
Rustpkg requires a central metadata file (pkg.rs
) in the repository, archive or folder
in order to figure out how to build the package. This is a side effect of Rustpkg
allowing multiple crates to be defined in a single package (i.e. a package is defined
as a set of crates rather than a package being exactly the same as one crate).
There's a plan to make it so the pkg.rs
is not needed for single-crate packages,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# libinput by default will disable the touchpad while a key is pressed. | |
# to disable this, run `xinput` to list the inputs. find the name of your | |
# touchpad (mine is 'Microsoft Surface Keyboard Touchpad'). | |
# | |
# Disable the setting 'Disable While Typing Enabled' | |
# `xinput --set-prop 'Microsoft Surface Keyboard Touchpad' \ | |
# 'libinput Disable While Typing Enabled' 0` | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_FRAGMENT_PRECISION_HIGH | |
precision highp float; | |
#else | |
precision mediump float; | |
#endif | |
uniform vec2 resolution; | |
#define FTIME_PERIOD 16.0 | |
uniform float ftime; | |
uniform float subsecond; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(unused)] | |
//#![feature(optin_builtin_traits)] | |
// Booleans | |
struct True; | |
struct False; | |
trait BoolOr<B> {type BoolOr;} | |
impl<B> BoolOr<B> for True {type BoolOr=True;} | |
impl BoolOr<True> for False {type BoolOr=True;} | |
impl BoolOr<False> for False {type BoolOr=False;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cretonne IL is tuned for codegen. You can see this in the use of EBBs, br_table | |
not taking arguments, the lack of builtin def-use lists, the lack of a | |
general-purpose switch statement, the precense of instructions specialized to | |
take an immediate argument, and other places. | |
I'm entertaining the idea that this works out well for Rustc. It'll make | |
"fast compile" use cases, both "debug" and "pretty good optimization" builds | |
faster. Compared to LLVM's 4 layers in a typical compile (LLVM IR, SelectionDAG, | |
MachineFunction, MC), Cretonne uses one IL throughout, and it's designed | |
to be very compact. |
This is my contribution to the call for Rust blog posts.
I've been using Rust for various personal projects for quite a while now, and I confess that I have a lot to say about it! In fact, I've already said quite a bit about it before.
My experience with Rust has been overwhelmingly positive, and most of the things I still want (e.g. NLL, const functions, const generic parameters, SIMD intrinsics, etc.) are already well known and being worked on, so it seems silly to repeat them. Therefore, in this post I'm just going to highlight three small-ish things that have been mildly frustrating to me over the last year, but which I haven't seen mentioned recently.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(arbitrary_self_types, specialization)] | |
use std::{ | |
mem::{self, ManuallyDrop}, | |
ptr::{self, NonNull}, | |
marker::PhantomData, | |
ops::{Deref, DerefMut}, | |
}; | |
struct Move<'a, T: 'a + ?Sized> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
import random |
OlderNewer