From 3fd26332e62db662e6e5c88e07aa25eb28598224 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 18 Jun 2020 10:53:42 +0530 Subject: spill straight fax --- docs/index.html | 2 +- docs/index.xml | 36 +++++++++++----------- docs/posts/turing_complete_type_systems/index.html | 6 ++-- posts/turing_complete_type_systems.md | 3 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/index.html b/docs/index.html index 003835c..68da119 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,7 +44,7 @@ - 0.8 + 0.9 min diff --git a/docs/index.xml b/docs/index.xml index 17d6bd8..9c2704b 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -12,7 +12,7 @@ en-us Creative Commons BY-NC-SA 4.0 -Turing Complete Type Systems +turing_complete_type_systems

Rust’s type system is Turing complete:

It is impossible to determine if a program written in a generally Turing complete system will ever stop. That is, it is impossible to write a program f that determines if a program g, where g is written in a Turing complete programming language, will ever halt. The Halting Problem is in fact, an undecidable problem.

How is any of this relevant?

-

Rust performs compile-time type inference. The type checker, in turn, compiles and infers types, I would describe it as a compiler inside a compiler. It is possible that rustc may never finish compiling your Rust program!

+

Rust performs compile-time type inference. The type checker, in turn, compiles and infers types, I would describe it as a compiler inside a compiler. It is possible that rustc may never finish compiling your Rust program! I lied, rustc stops after a while, after hitting the recursion limit.

I understand that this post lacks content.

https://peppe.rs/posts/turing_complete_type_systems/ -Thu, 18 Jun 2020 05:07:00 +0000 +Thu, 18 Jun 2020 05:18:00 +0000 https://peppe.rs/posts/turing_complete_type_systems/
-Auto-currying Rust Functions +auto-currying_rust_functions

This post contains a gentle introduction to procedural macros in Rust and a guide to writing a procedural macro to curry Rust functions. The source code for the entire library can be found here. It is also available on crates.io.

The following links might prove to be useful before getting started:

    @@ -521,7 +521,7 @@ test tests::works ... ok https://peppe.rs/posts/auto-currying_rust_functions/ -Pixel Art In GIMP +pixel_art_in_GIMP

    I’ve always been an admirer of pixel art, because of it’s simplicity and it’s resemblance to bitmap font design. Recently, I decided to take the dive and make some art of my own.

    I used GIMP because I am fairly familiar with it. Aseprite seems to be the editor of choice for animated pixel art though.

    Setting up the canvas

    @@ -576,7 +576,7 @@ test tests::works ... ok https://peppe.rs/posts/pixel_art_in_GIMP/
    -Rapid Refactoring With Vim +rapid_refactoring_with_vim

    Last weekend, I was tasked with refactoring the 96 unit tests on ruma-events to use strictly typed json objects using serde_json::json! instead of raw strings. It was rather painless thanks to vim :)

    Here’s a small sample of what had to be done (note the lines prefixed with the arrow):

    use serde_json::{from_str};
    @@ -671,7 +671,7 @@ BUFFER:    json!( ... );
    https://peppe.rs/posts/rapid_refactoring_with_vim/ -Font Size Fallacies +font_size_fallacies

    I am not an expert with fonts, but I do have some experience 1, and common sense. This post aims to debunk some misconceptions about font sizes!

    11 px on your display is probably not 11 px on my display. Let’s do some quick math. I have two displays, 1366x768 @ 21" and another with 1920x1080 @ 13", call them A and B for now.

    Display A has 1,049,088 pixels. A pixel is a square, of side say, s cm. The total area covered by my 21" display is about 1,066 cm^2 (41x26). Thus,

    @@ -707,7 +707,7 @@ Dimensions: 1920x1080 @ 13" (29.5x16.5 sq. cm) https://peppe.rs/posts/font_size_fallacies/
    -Termux Tandem +termux_tandem

    I learnt about termux from a friend on IRC recently. It looked super gimmicky to me at first, but it eventually proved to be useful. Here’s what I use it for:

    rsync

    Ever since I degoogled my android device, syncing files between my phone and my PC has always been a pain. I’m looking at you MTP. But, with termux and sshd all set up, it’s as simple as:

    @@ -731,7 +731,7 @@ mtZabXG.jpg p8d5c584f2841.jpg vjUxGjq.jpg https://peppe.rs/posts/termux_tandem/
    -Call To ARMs +call_to_ARMs

    My 4th semester involves ARM programming. And proprietary tooling (Keil C). But we don’t do that here.

    Building

    Assembling and linking ARM binaries on non-ARM architecture devices is fairly trivial. I went along with the GNU cross bare metal toolchain binutils, which provides arm-as and arm-ld (among a bunch of other utils that I don’t care about for now).

    @@ -768,7 +768,7 @@ Reading symbols from main... # yay! https://peppe.rs/posts/call_to_ARMs/
    -Color Conundrum +color_conundrum

    This piece aims to highlight (pun intended) some of the reasons behind my color free editor setup.

    Imagine highlighting an entire book because all of it is important. That is exactly what (most) syntax highlighting does. It is difficult for the human eye to filter out noise in rainbow barf. Use color to draw attention, not diverge it.

    At the same time, a book devoid of color is boring! What is the takeaway from this 10 line paragraph? What are the technical terms used?

    @@ -782,7 +782,7 @@ Reading symbols from main... # yay! https://peppe.rs/posts/color_conundrum/
    -Static Sites With Bash +static_sites_with_bash

    After going through a bunch of static site generators (pelican, hugo, vite), I decided to roll my own. If you are more of the ‘show me the code’ kinda guy, here you go.

    Text formatting

    I chose to write in markdown, and convert to html with lowdown.

    @@ -815,7 +815,7 @@ Reading symbols from main... # yay! https://peppe.rs/posts/static_sites_with_bash/
    -My Setup +my_setup

    Decided to do one of these because everyone does one of these.

    My entire setup is managed with GNU stow, making it easier to replicate on fresh installations. You can find my configuration files on GitHub.

    @@ -827,7 +827,7 @@ Reading symbols from main... # yay! https://peppe.rs/posts/my_setup/
    -WPA Woes +WPA_woes

    I finally got around to installing Void GNU/Linux on my main computer. Rolling release, non-systemd, need I say more?

    As with all GNU/Linux distributions, wireless networks had me in a fix. If you can see this post, it means I’ve managed to get online. It turns out, wpa_supplicant was detecting the wrong interface by default (does it ever select the right one?). Let us fix that:

    $ sudo rm -r /var/service/wpa_supplicant
    @@ -857,7 +857,7 @@ $ sudo sv restart dhcpcd
    https://peppe.rs/posts/WPA_woes/
    -Bye Bye BDFs +bye_bye_BDFs

    Glyph Bitmap Distribution Format is no more, as the creators of Pango, one of the most widely used text rendering libraries, announced their plans for Pango 1.44.

    Until recently, Pango used FreeType to draw fonts. They will be moving over to Harfbuzz, an evolution of FreeType.

    Why?

    @@ -869,7 +869,7 @@ $ sudo sv restart dhcpcd
    https://peppe.rs/posts/bye_bye_BDFs/
    -Onivim Sucks +onivim_sucks

    Onivim is a ‘modern modal editor’, combining fancy interface and language features with vim-style modal editing. What’s wrong you ask?

    Apart from buggy syntax highlighting, broken scrolling and others, Onivim is proprietary software. It is licensed under a commercial end user agreement license, which prohibits redistribution in both object code and source code formats.

    Onivim’s core editor logic (bits that belong to vim), have been separated from the interface, into libvim. libvim is licensed under MIT, which means, this ‘extension’ of vim is perfectly in adherence to vim’s license text! Outrun Labs are exploiting this loophole (distributing vim as a library) to commercialize Onivim.

    @@ -880,7 +880,7 @@ $ sudo sv restart dhcpcd
    https://peppe.rs/posts/onivim_sucks/
    -Bash Harder With Vim +bash_harder_with_vim

    Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat additions you could make to your vimrc for a better shell programming experience.

    Man pages inside vim

    Source this script to get started:

    @@ -920,7 +920,7 @@ Press ENTER or type command to continue
    https://peppe.rs/posts/bash_harder_with_vim/
    -Hold Position! +hold_position!

    Often times, when I run a vim command that makes “big” changes to a file (a macro or a :vimgrep command) I lose my original position and feel disoriented.

    Save position with winsaveview()!

    The winsaveview() command returns a Dictionary that contains information about the view of the current window. This includes the cursor line number, cursor coloumn, the top most line in the window and a couple of other values, none of which concern us.

    @@ -934,7 +934,7 @@ winrestview(view) " restore our original view! https://peppe.rs/posts/hold_position!/
    -Get Better At Yanking And Putting In Vim +get_better_at_yanking_and_putting_in_vim

    a couple of nifty tricks to help you copy-paste better:

    1. reselecting previously selected text (i use this to fix botched selections):

      diff --git a/docs/posts/turing_complete_type_systems/index.html b/docs/posts/turing_complete_type_systems/index.html index 4a7e2b1..3e572e3 100644 --- a/docs/posts/turing_complete_type_systems/index.html +++ b/docs/posts/turing_complete_type_systems/index.html @@ -24,12 +24,12 @@ 18/06 — 2020
      - 8.78 + 9.18 cm   - 0.8 + 0.9 min
      @@ -45,7 +45,7 @@

It is impossible to determine if a program written in a generally Turing complete system will ever stop. That is, it is impossible to write a program f that determines if a program g, where g is written in a Turing complete programming language, will ever halt. The Halting Problem is in fact, an undecidable problem.

How is any of this relevant?

-

Rust performs compile-time type inference. The type checker, in turn, compiles and infers types, I would describe it as a compiler inside a compiler. It is possible that rustc may never finish compiling your Rust program!

+

Rust performs compile-time type inference. The type checker, in turn, compiles and infers types, I would describe it as a compiler inside a compiler. It is possible that rustc may never finish compiling your Rust program! I lied, rustc stops after a while, after hitting the recursion limit.

I understand that this post lacks content.

diff --git a/posts/turing_complete_type_systems.md b/posts/turing_complete_type_systems.md index b6ec7bc..70136c8 100644 --- a/posts/turing_complete_type_systems.md +++ b/posts/turing_complete_type_systems.md @@ -17,6 +17,7 @@ problem](https://en.wikipedia.org/wiki/Undecidable_problem). Rust performs compile-time type inference. The type checker, in turn, compiles and infers types, I would describe it as a compiler inside a compiler. It is possible that `rustc` may -never finish compiling your Rust program! +never finish compiling your Rust program! I lied, `rustc` +stops after a while, after hitting the recursion limit. I understand that this post lacks content. -- cgit v1.2.3