jayshua
jayshua on Hacker News
I think it's important to note a couple of things about this.
First, Casey offers refunds on the handmade website for anyone who purchased the pre-order. Second, the pre-orders were primarily purchased by people who wanted to get the in-progress source code of the project, not people who just wanted to get the finished game. I'm not aware of anyone who purchased the pre-order solely to get the finished game itself. (Though it's certainly possible that there were some people.) Whether that makes a difference is up to the reader I suppose, since the original versions of the site didn't say anything about how likely the project was to finish and did state that the pre-order was for both the source-code and the finished game.
Second, the ten-year timeline (I believe the live streams only spanned 8 years) should be taken with the the note that this is live streaming for just one hour per day on weekdays, or for two hours two or three times a week later in the project. There's roughly 1000 hours of video content not including the Q&As at the end of every video. The 1000 hours includes instructional content and white board explanations in addition to the actual coding which was done while explaining the code itself as it was written. (Also, he wrote literally everything from scratch, something which he stated multiple times probably doesn't make sense in a real project.)
Taking into account the non-coding content, and the slower rate of coding while explaining what is being written, I'd estimate somewhere between 2-4 months of actual (40hr/week) work was completed, which includes both a software and a hardware renderer. No idea how accurate that estimate is, but it's definitely far less than 10 years and doesn't seem very indicative that the coding style he was trying to teach is untenable for game projects. (To be clear, it might be untenable. I don't know. I just don't see how the results of the Handmade Hero project specifically are indicative either way.)
Could you expand a bit on 'immediate mode design purity'? I've done immediate mode stuff from scratch and my experience had been "just write whatever code you need to get it to work," there hasn't really been an overall architecture guiding it. Never worked with an im library before.
This is not actually that difficult if you just want the basics. I have a project that implements just the x11 key & mouse events, and the shared memory extension in 400 lines of Rust. Was worth it for me since it eliminated dependency on libx11 and libc, which removed a dependency on something like 800,000 lines of code across those two libraries. (Determined by a basic cloc on each library source. Actually compiled code for a specific architecture would probably be less than that, but still orders of magnitude more than 400.)
Let's say I'm sorting some information about an event occuring in Florida, USA next year. It will be on July 4th at 3:00pm. I store this as an ISO string: "2025-07-04T03:00:00Z-5".
Florida (and the USA as a whole) have been discussing getting rid of the daylight savings change on-and-off for several years.
If that law goes through in December of this year, the date I stored for my event will now be off by an hour because come July 2025 Florida will be on UTC offset -6, not -5.
On the other hand, if I store the date with a fully qualified tz database timezone like this: "2025-07-04 03:00:00 America/New_York" the time will continue to be displayed correctly because the tz database will be updated with the new offset information.
Not sure if it could be extended here, but I've seen a lock free hash map that supported lock free reallocation by allocating new space and moving each entry one by one, either when the entry is accessed or in a separate thread concurrently. Accessing an entry during the reallocation would check the new region first, and if not found check the old region. Entries in the old region would be marked as moved and once all entries were moved the old allocation could be freed.
I read this as mut1 and mut2 both being downgraded to shared references because they aren't used to mutate anymore. I'd imagine that's not what's actually happening though?
> anyone know of an IDE/tool that can spell check UI strings without tripping up on variable names
Sublime Text works pretty well for me. I think you need to turn on spell check in the settings (off by default?) Then you can choose which syntax highlighting scopes you want to spell check. I have mine configured to spell check comments and string literals.
What does a broken repo look like? What does broken mean here?
I use a similar technique for typing all the symbols. If I press f I get f, r gives me r, but if I press f and r at the same time with my left index finger positioned between the two keys I get $. w and s are {, e and d are }.
All the other symbols, parens, etc. are mapped to similar one-finger-two-key shortcuts.
Significantly cut down on finger stretching which used to cause me mild pain.
Custom input map with extensive radial menus and layers.
Is this just an issue with the way the editor is presenting the LSP feedback to you?
I use an android (and iOS I think) app called Xodo. The "reader mode" re-flows the PDF into a screen-width single column like an e-book. The latest update really buried the option in the menus, but it's there somewhere and works pretty well.
Most teachers I know vastly prefer to grade on paper rather than digitally. Easier to just circle sections and write comments with a pen than deal with the review features in a document editor. I suppose they could print them out themselves? Or require submission in both digital and paper? But why bother when you can just have the students submit in paper.
Usually it's done so that the teacher can tell how long the paper is without counting words. Times New Roman at x pt with 1 inch margins fits a well known average number of words per page. The assignment will usually be "write x number of pages on..."
Using a larger font size or a font that renders larger at the same font size means you can write less content in the same space.
I'm in the process of rearranging my keyboard due to occasional mild pain. Mind if I ask what layout you ended up with for the other keys? Any experience with the more esoteric arrangements like triggering modifiers when holding down the home row keys?
Posted by
jayshua on Friday March 24, 2023 @02:50PM
from the show-hn dept.
https://github.com/Jayshua/tg-daemon
I found there were a number of things that I wanted a personal telegram bot to do which would have been relatively difficult or annoying to implement in a full-blown programming language, but pretty easy to string together a shell script for. So I wrote this program that acts sort of like a classic CGI gateway for Telegram conversations, forwarding messages over stdin/stdout.
Yes, that's basically the rational that Jose Valim (or was it someone else?) gives when asked. I still document almost every defp function in exactly the same way I document regular public functions though. (Why is it here, how should it be used, any gotchas to be aware of, etc.) It's just weird that I can't mark the exact same type of information using the same @doc syntax everywhere.
Idk, I think I still want them to be private. One example from just a few days ago was an ecto schema module that had a number of changesets. admin_changeset, director_changeset, manager_changeset, normal_changeset. Each one only differed from the others a bit, so the common code was factored into three or four helper functions that they each used as needed. Any of the *_changeset functions in the public API would always produce a working changeset, but the helpers could produce an broken changeset if not used correctly. (i.e., a changeset that would never successfully validate.) The helper functions are private to prevent misuse of the schema's api, but they also need to be clearly documented in basically the same way I would document the public functions. It just bothered me a bit that I couldn't use @doc for, quite literally, documentation.
I can still document them with regular comments, just not with @doc documentation "comments" because the compiler gives a warning that @doc can't be used on private functions.
It just bothers me a bit that the stuff I'm putting in the comment is documentation that I would put inside a @doc on any non-private function, but I can't use @doc.
My only complaint is that I can't document defp functions. Yeah, they're not part of the public API. But in my non-library application the next developer coming along might need some info, and it would be nice to have it work the same way as all the other documentation.
Posted by
jayshua on Wednesday February 15, 2023 @10:11PM
from the sr.ht dept.
My experience has been due to the type system, I agree. (Also the compiler enforced semver.) I've never had the opportunity to use type script, so maybe it does offer similar benefits to Elm in that area.
That's extent my personal experience can push things as far as active production applications go, but it seems to me there's something a bit more in Elm beyond just the type system. Haskell and PureScript both have static typing, but I've had runtime errors in both those languages. Not as often as JS or C or even Rust, but they do happen. In Haskell because the 'error' function exists and so people use it. In PureScript because it has its version of Elm's native modules, permitting arbitrary functions to be implemented in JS. The JS can (and does) produce runtime exceptions.
It seems to me that the promise from TS, Haskell, PureScript, etc. is something like "with this language/type system runtime errors will rarely happen" whereas the promise from Elm is "with this language/type system runtime errors can never happen."
I think that transition from 'rarely' to 'never' has been a big part of the Elm project for a long time. It's been on their homepage for as long as I can remember. At least prior to the big 0.18 native modules controversy.
If the idea is "no runtime exceptions can ever happen" with the implicit addendum "no matter what you do" native modules have to go. They were a vector by which user code could crash the application, breaking the promise. In that sense the restrictions are not arbitrary, but instrumental in upholding a major design goal of the Elm project.
That said, I don't know how much value there is in the "can never crash" promise. It feels like a step in the right direction, but at the same time it seems all the benefits in production code that I've personally experienced and cited in my earlier comment don't fall under the edge cases Elm prevents with its stricter promise. The two or three exceptions I've encountered in PureScript as a result of its version of native modules existing were all in toy programs, so maybe it's just not a big deal in real production apps.
I maintain a 50,000 line elm app. It's not the most used app in the world - has between 50-100 users. But it has had a sum total of 2 bugs since launch - both logic bugs in some complex financial projections.
Contrast with an elixir app of similar size that I also maintain. I fix on average 1-2 bugs per week, almost all of them are things that the elm compiler would have prevented like calling a function that was removed or renamed last month or not handling a case where a database request returned 0 records instead of 1.
Honestly though the biggest draw for me is the refactoring experience. For various reasons I had to do a major refactor of both code-bases. Not adding new features or anything, just restructuring the code and module layout to line up with the way the code actually functioned. Paying the tech debt essentially. I'd say both refactors were of roughly similar complexity, touching probably 75% of the files in each project.
The elm refactor took about 5 hours and worked as soon as I fixed all the compiler errors. I never had to fix a bug from that refactor - it just worked. And the code was way easier to understand after paying all that tech debt back.
The elixir refactor took 4 days, full time. 25ish hours. It also required me to write about 150 tests that weren't there before because the compiler wasn't able to point out code that would always fail at runtime. After deployment I had to fix a handful of bugs that still made it into production, despite how careful I was to not break anything.
Idk, being able to completely restructure the code without worrying about breaking anything really appeals to me for some reason.
Outer Wilds (not to be confused with Outer Worlds) is the best game I've ever played. An extremely engaging discovery driven story game that's so well executed it puts most AAA titles to shame. It's one of those amazing experiences you'll only get to have once. Wish I could forget everything and play it over again. (If you're not convinced look at some of the reviews online. But try to avoid spoilers as much as possible. This game is best experienced as blind as possible.)
I had the same pain until I started using Firefox containers. Now I can persist cookies for just YouTube without keeping them for any other sites or making the Google cookies available to Google when I'm browsing other sites using the non-youtube container.
The latest version of Sublime Text works kind of like that. It know the tokens that most commonly appear together in the folders you currently have open in the sidebar and prioritizes the suggestions popup based on that. Seems to work pretty well for me.
It's a relatively new feature - within the last year I think.
Posted by
jayshua on Sunday May 15, 2022 @11:30AM
from the ask-hn dept.
I'm curious what price ranges are out there for getting a single server (with your own hardware) in a local data center.
I wonder if having only an IPv6 address would provide enough obscurity to be reasonably secure in this case? Or maybe those allocations are still to publicly guessable?
The type system can force you to handle both cases - the data being in the expected & typed form, and the data not being in the expected form.
You would have a function like this:
parseJsonString : String -> Result Error Person
Where Result is a value that is either an Error or a Person.
To get the Person value out, the type system forces you to also do something with the Error if it exists. Not handling both possibilities in some way is a type error.