grayrest
Joined 17 years ago
Joined 17 years ago
I did an interview process that was 6 hours, one hour per week, then flew me in for a 6 hour on-site. They decided not to take me at that point and provided no reason.
Yes. Essentially the idea was to find the source control root (or something configurable) and mount the real subtree into a VFS where everything interacts with the filesystem through the VFS. I can run wasm compiled versions of apps I don't really trust or run native patched versions that I do.
For background, I'm writing a UI platform in Roc [1] and using just [2] in order to script things. I had extra tokens so I decided to do an LLM port of just over to Roc to exercise the compiler (it's pre-0.1, pushing the compiler leads to crashes) and people won't have to install Rust to write apps. Like wasm, Roc code can't access the outside world without the host providing the access to the outside world so in the process of the port I thought "I don't have to make posix calls, I can put it in sandbox and lie about it" so that's how I got here. I'm fairly close to being able to do hermetic builds so that's a possibility but this is mostly an exploration of whether the idea works or not.
The some points of trouble I ran into were dead symlinks left behind on the FS pointing to real files and escape codes interacting with the terminal (e.g. escape codes reading from the clipboard).
Switched to a 36 key ergo split with a tweaked alpha-thumb layout (R is on my left thumb, Space is on the right, base layout is Hands Down Vibranium V). Started learning Pitman shorthand (again) then switched to Noory Simplex and stuck with it. Became fascinated with Zaner's Method of cursive where the writing is done entirely through arm movement and using the rhythm of the muscle movement instead of by conscious control over the pen position. At the moment I can write at about 100wpm on a keyboard, 70wpm in shorthand, and 26wpm longhand.
I believe that the improved ability to learn comes from the need to focus on a concept for longer while writing and not on the motion of the writing itself. My ability to retain is better in cursive than in shorthand and I don't notice a significant difference in retention between keyboard and shorthand.
There is plenty of room for a more interesting nuance once the ecosystem grows:
I'm pretty pleased with my server platform so I'm making a stab at UI with a platform that's Clay and Solid2 ported to Rust. The Solid 2 model has pervasively asynchronous signals so components are written as if they're permanently live and simply don't get run until the constituent signals are ready. My thought process is that this is technically a pure model and only the input changes and effects are impure so there's a pretty clear Roc/Rust split. The platform is still in the assembly process so no actual experience to report. I'll be trying to avoid it but I expect to be doing code generation/compiler hacking in the effort.
On the other side is Luke's roc-signals [1] which explores how the signals model works if all the signal engine code is in Roc with only a minimal backing platform for holding the mutation: "We may not add dataflow analysis passes, dependency-graph extraction, or any new compiler behavior. Everything is ordinary Roc plus a Zig host."
[1] https://github.com/lukewilliamboswell/roc-signals/blob/main/...
It's a general functional programming language that's interested in the constraints and state control properties but not really in the dogma/traditions. As a specific example, it has a for loop statement that doesn't return anything just because sometimes the algorithm is easier to express imperatively. That said, it really is functional, mutating functions/methods require a `!` suffix and `->` (pure) vs `=>` (not) is distinguished in the type system and enforced. The language is fully decidable so type annotations are optional with the arguable exception of the built-in Serde which needs a concrete type to encode/decode. It's also pretty fast, like in the Go range.
I think it has the best error handling of any language in the ~3 dozen I've tried. It's Rust style in general with `Result` renamed to `Try` but the error side of `Try` is an open tag set and can just aggregate so you get the nice parts of the Rust error experience without the downsides. As an example, a coeffect (effectful input) from an example on my server platform:
book! = |req| {
body : { id : I64 }
body = Req.json_body!(req)?
rows = Sql.query!(req.ctx, db_path, "SELECT id, title, author, year FROM books WHERE id = ?", [Integer(body.id)])?
row = Sql.first(rows) ? |_| NotFound("book ${body.id.to_str()} not found")
book = decode_book(row)?
Ok(book)
}
The full set of errors covers malformed utf8, missing/wrong type for id, db errors, the custom NotFound with message, and missing/changed db columns and these plus all the other errors across the app get rolled up and handled in one spot by the error mapping function which rolls the input errors to 400, a 404 for the NotFound, 500s in general in a big match. I have more compact ways to express this in the platform (sqlx) but those don't show off the error handling as nicely.All in all, it's pretty much just a nice hosted language for doing things.
> Do you see it competing with WASM for the plugin use case?
It's mostly competing with Lua and friends but the host is a platform and not an embedder so the Roc goes on the outside and produces the binary. Roc is particularly well suited for compiling to wasm because all the effects coming from the host is shared. This is actually one of my primary interests in Roc but I haven't really harassed the Roc team about it because they've been busy with the rewrite and wasm module specs have been WIP.
> Why would an app author prefer to expose a Roc layer to their app rather than a WASM layer?
No need for the relatively large WASM runtime would be one of the first ones but Roc isn't really designed to be embedded. I expect to mainly use Roc for app level code on top of Rust for systems level code. I could write app-level Rust but I like functional programming, GC (refcount) is convenient, the error handling is nice, no annotations are nice, super fast compiles are nice, etc.
> Do you see it competing with Gleam for server side http code? Do you see it competing with Elm for client side code?
Sure. As mentioned, I'm experimenting with a server platform that uses pure handlers plus an effect system. I have a RealWorld implementation and in casual benchmarking on my M1 laptop I get 69k req/s for the article endpoint (serialization bound) and 10k going through the article_list endpoint (sqlite bound, 4 table join). The framework also has full and automatic cache invalidation so if I turn on caching I hit 120-140k req/s on both endpoints with no other code changes.
As for GUI stuff, I'm working on a platform (Clay+Solid2) but I don't see any particular reason it wouldn't work.
I went through an extended project to make it faster and wound up with a loop handlebar for body position, replaced the wheelset to move from 355 to 406 for tire selection and did the drivetrain at the same time to accommodate a 9-32 cassette. Between the wheels and the sub-11 tooth sprockets I can pedal up to ~26mph instead of ~20mph on the stock setup (good enough) and the low end is about the same. It doesn't perform like a race bike but it's pretty close to an endurance road bike. I do 20 mile rides a couple times a week on it and I've done a couple centuries.
The Birdy is my main bike but I'm a folding and recumbent enthusiast in general. The addition of the fold or moving the cranks in front of the rider means the obvious solution diamond frame doesn't work and I like seeing the creativity of the solutions. I've also owned a Xootr Swift that I gave away to my nephews, a Bike Friday Sat-R-Day folding recumbent for riding slowly in the parks, and a Baron Optima lowracer recumbent that I prefer for rides over 90 minutes.
As for living with yourself:
Find some sort of exercise you don't mind doing and make it non-optional. The goal isn't to go all out, just get your heart rate up for half an hour. You won't want to do it sometimes but you still have to go. You can do a crappy job at it and slack off for a day or two but you have to go out. For me this is riding a bike.
Otherwise it's good to be absorbed in something. It's not the same feeling but there is intrinsic satisfaction in learning / building / experiencing things.