Programming Leftovers
-
GCC now includes Modula-2 and Rust. Do they work on OpenBSD?
Two new language frontends have been added to GCC: Modula-2 and Rust. I think this is great news on both accounts: having a Wirth language in GCC fills my childhood heart with joy (though I do wish GNU Pascal can one day be revived and mainlined, as Pascal was the first non-BASIC language I learned). And Rust appears here to stay, so having more than just the one official compiler seemed all but inevitable. I think both languages make sense for GCC and am glad to see that they will be making the upcoming GCC 13.1.
-
Implementing ‘strlen’ using SVE
With this in mind, a simple algorithm to compute the length of a C string is as follows: [...]
-
return "reflections on a batch";
There's a tradition at Recurse Center of writing a Return Statement after your batch. I'm not sure of the origin of the terminology, but it seems like it's a pun on the return statement in programming languages. It's a great tradition, and it gives me a good motivator to reflect on my batch and share those reflections.
This is going to be a ride, so buckle up. First I'll go through what was life-changing and formative about this period for me. This is going to be very personal and not so much about programming at first. Then I'll go through what I worked on during RC and what the batch was like.
-
2022 Hanukkah of Data • Puzzle 1
Visiting #2 and doing some $WORK-work, but intrigued with Hanukkah of Data since Puzzle 0 was solvable with a ZIP password cracker (the calendar date math seemed too trivial to bother with).
Decided to fall back to R for this (vs Observable for the Advent of Code which I’ll dedicate time to finishing next week).
-
Fundamentals of R Programming
Fundamentals of R programming, Here, we provide you with some programming in R multiple-choice problems and their corresponding answers.
-
Good Design, Pt. II
Contrary to a belief by some, a thing is not “designed” through the application of visual aesthetics (e.g. color, type, etc.), but rather by virtue of being assigned a functional role within an ordered system. Design is the act of giving names, assigning functions, dividing up roles, and refining aesthetics.
-
Async-Iterator Crate
Hey all, today was my first day back from PTO. While away, I was thinking what I often think: I should write more on here. With Twitter effectively defunct, and my Mastodon being set to ephemeral mode (posts auto-delete after 30 days), I should start keeping a better record of what I'm up to somewhere more permanent. And this blog seems as a good a place as any.
-
How to draw ugly lines really fast
Why this is important is hard to convery in a static picture, but in motion the quality difference is very obvious. And it turns out the speed difference is not actually significant, so why not go for the extra quality?
-
Meshlet sizing theory
When working with mesh shaders to draw meshes, you need to split your source geometry into individual units called meshlets. Each meshlet would be processed by one mesh shader workgroup, and when compiling this mesh shader you need to specify the maximum number of triangles and vertices that the meshlet contains.
-
Vector Search
Instead of keyword matching, vector search uses vector similarity to find relevant content. It uses a vector space model to represent the documents as points in an N-dimensional space. Words closer to each other in this space are more relevant, and documents with similar words are more relevant. This allows searching for concepts and phrases instead of exact words. Models like GPT-3 have large embeddings (12288 dimensions)!
-
Combining research and practice to evaluate and improve computing education in non-formal settings
In the final seminar in our series on cross-disciplinary computing, Dr Tracy Gardner and Rebecca Franks, who work here at the Foundation, described the framework underpinning the Foundation’s non-formal learning pathways. They also shared insights from our recently published literature review about the impact that non-formal computing education has on learners.
-
Boring Python: code quality
As with last time, that was a lot of words to cover what turns out to be not a particularly complex set of recommendations; it’s just explaining the “why” of everything that takes a while. And hopefully now you have an idea of a “boring” Python code-quality regimen; this won’t prevent every bug or problem you might introduce into your code, but it will help to catch a lot of potential issues.
And as before, even if you don’t adopt the recommendations I’ve given, I’d like to think that seeing them laid out and explained will at least be helpful to you, and that you’ll learn something you can take away and put to use in whatever setup you do choose to adopt.
-
Control-flow integrity
Control-flow integrity (CFI) refers to techniques which prevent control-flow hijacking attacks. This article describes some compiler/hardware features with a focus on llvm-project implementations.
CFI schemes are commonly divided into forward-edge (e.g. indirect calls) and backward-edge (mainly function returns). AIUI exception handling and symbol interposition are not categorized.
Let's start with backward-edge CFI. Fine-grained schemes check that a return address refers to a possible caller in the control-flow graph. This is a very difficult problem and the additional guarantee is possibly not that useful.