assembly
macosrec
assembly | macosrec | |
---|---|---|
4 | 8 | |
15 | 73 | |
- | - | |
9.5 | 6.1 | |
25 days ago | 8 months ago | |
C | Swift | |
- | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
assembly
-
Should you add screenshots to documentation?
When you're learning something for the first time, it can be hard to know what mental model you need to have to be effective with the tool.
Some documentation is reference material. With reference material you might navigate the reference material in a particular traversal to get what you need to do what you want.
But at the beginning of your journey, you need to be taught a "flow" an expected pattern of operation to build up the right mental model of how an average session with the tool works. For programming this might be the edit file, compile, run, debug loop, or TDD or IntelliJ's build and deploy. Or a CI system commit, push, deploy, promote cycle. Or kubernetes kubectl edit, apply.
I opened the "dining philosophers TLA+" example and ran it - this seemed to be an affordance of the TLA+ Toolbox GUI which was straightforward to understand.
But then I tried to use the tool with my own. I interpreted the existing code of the dining philosophers and tried to make my own ringbuffer model.
It took me a while that I needed to update this screen to put in the following details that I have filled in on the screenshot:
https://github.com/samsquire/assembly/blob/main/screenshots/...
You have to put your entrypoint in the "temporal formula" and then put your model arguments on the right hand side.
I was able to piece together the operation of this tool by piecing together various reference details together, it wasn't until I saw that screenshot I referenced in my OP that I realised I needed to do that step to get the PlusCal code to update the TLC code that follows it. I was wondering why it didn't work until I saw that screenshot.
-
Fiber in C++: Understanding the Basics
Thank you for this in-depth article.
I am a less than a C++ beginner but I asked Stack Overflow how to run C++ coroutines in a thread pool. It seems coroutines in C++20 are unfinalised but don't quote me on that but I did get some sourcecode for older versions of the C++20 standard.
I used Marce's Col's excellent blog post about how to create coroutines in assembly by adjusting the RSP pointer.
https://blog.dziban.net/posts/coroutines/
I extended Marce's code to run the coroutines in kernel threads:
https://github.com/samsquire/assembly (see threadedcoroutines.S)
I have been thinking of coroutines in terms of query compilation for database engines and the volcano query model and this article:
https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
Tying together two pieces of code that call eachother in push or pull driven style is really powerful. Or if you're running multiple independent tasks that need their own state. This as I understand it is the original intent of object orientation that Alan Kay wanted and is represented by Erlang and partly Go.
Specifically, I am thinking of compiler created coroutines where code can be interleaved at compile time rather than at runtime.
-
Philosophy of Coroutines
Thank you for your ideas and thoughts.
This might be relevant - I've been playing around with some assembly to unwind the stack, but it occurred to me I don't need to pop the stack to scan through it. So like C++ exception handling (I learned about it in the Itanium C++ ABI) or algebraic effects, you can scan memory if you have access to the stack start in memory (I do that by storing the rsp somewhere in .global main) in theory it's just data.
I need to generate sections of lookup data for range information for associating .text code section addresses with function names.
In theory this would also be useful for coroutines since a coroutine position/state is just a program counter position of code that you can JMP to in your yield function (that isn't a call but an offset)
To move a coroutine from one thread to another or another machine over the network or persist to disk, let me think. We could do what C++ coroutines does and have a promise struct object that is presumably on the stack when a coroutine resumes by jumping to that coroutines location.
I think the hard part is being stackless and persisting the current coroutine state. You could mov $COMPILER_DETERMINED_OFFSET into -10(%rbp) that promise object and then when the coroutine resumes it does a JMP -10(%rbp) in a label before the coroutine body.
I am a beginner to assembly programming but here is my program: https://github.com/samsquire/assembly/blob/main/stackunwind....
-
Let's write a setjmp
https://github.com/samsquire/assembly/blob/main/coroutines.S
This might be useful to someone who wants to port this to C. This uses the stack switching idea. So they are stackful coroutines.
There's also Tina a header only coroutine library
macosrec
-
Should you add screenshots to documentation?
I built a macOS commmand line util to take window screenshots or videos https://github.com/xenodium/macosrec Window screenshots are mostly covered by macOS built-in app, but videos are not.
Mostly grew out of a desire to post screenshots on my posts and projects.
I often wish I could see how some projects look before I install them (but they often don't have screenshots). I'm doing my bit with my projects, I hope.
-
Ask HN: What apps have you created for your own use?
- https://xenodium.com/an-ios-journaling-app-powered-by-org-pl... - Lately, I'm having a go at building a privacy-focused plain-text-based iOS journaling app. I starte building it for someone important in my life but now using it myself.
- https://flathabits.com - After reading Atomic Habits, I wanted a habit tracker but most had more friction than I wanted, required accounts, had distractions, lock-in etc. so I built a privacy-focused app, with little friction and no-lockin (saves to plain text).
- https://plainorg.com - There are a gazillion markdown apps on the App Store, but hardly any supporting org markup, so I built one.
- https://xenodium.com/scratch-a-minimal-scratch-area - I wanted a surface where I could just dump text with as few taps as possible.
- https://github.com/xenodium/macosrec - I wanted to take either screenshots or videos of macOS apps from the command line, so I could integrate anywhere.
- https://github.com/xenodium/chatgpt-shell - I'm far down the Emacs rabbit hole, so I prefer Emacs-integrated tools. Built a ChatGPT Emacs shell to see what the hype was all about ;) tl;dr it really does help.
- https://github.com/xenodium/dwim-shell-command - A way to manage and easily apply the gazillion one-liners (and more complex scripts) I've come across. I got close to 100 utils check-in now https://github.com/xenodium/dwim-shell-command#my-toolbox
- https://github.com/xenodium/ob-swiftui - Play around with SwiftUI layouts from the comfort of my preferd editor.
- https://github.com/xenodium/company-org-block - Org block completion.
- https://xenodium.com - I tend to scratch own itches and post my solutions here.
-
macOS Command-Line Tools You Might Not Know About
brew install duti
> screencapture - take screenshots
Big fan of screencapture. I wanted something similar but for capturing window videos, so I built https://github.com/xenodium/macosrec
I often wrap command line utilites with Emacs functions (don't need to remember invocation flags/structure but also enables batch invocations):
https://xenodium.com/recordscreenshot-windows-the-lazy-way
- macosrec: Take screenshots/videos from the command line
- macosrec: Take screenshots/videos of macOS windows from the command line
- Show HN: Macosrec – take videos/screenshots of macOS windows from commmand line
-
Taking screenshots or videos (gifs) of any macOS window
Will write it up at some point... tl;dr built macosrec (command-line utility) and hooked it up to Emacs via dwim-shell-command. I'm trialing the following bindings:
- Show HN: macosrec – take screenshots/videos of macOS windows from commmand line
What are some alternatives?
continuation - Delimited Continuations for JavasScript
dwim-shell-command - Emacs shell commands with DWIM behaviour
context
osc52pty - OSC 52 workaround for Terminal.app
starfx - A modern approach to side-effect and state management for web apps.
prefsniff - A utility to sniff preferences changes to macOS plist files
effection - Structured concurrency and effects for JavaScript
tutu - Zsh bookmark navigation utility
stack-switching - A repository for the stack switching proposal.
ripgrep - ripgrep recursively searches directories for a regex pattern while respecting your gitignore
cgreenlet - Coroutines for C/C++
exa - A modern replacement for ‘ls’.