HNHacker News
TopNewBestAskShowJobs

pyjarrett

684 karma · joined August 29, 2021

submissionscomments
pyjarrett··on Self-teaching, spaced repetition, and why books don't work
The real problem is teaching children that "reading" is merely decoding words off a page, and "listening" is merely hearing the words someone says.

The book itself is a way to open the door to learning, not the end point. Reading subject titles first, cross-referencing, and working examples and doing projects help teach and cement ideas.

There's techniques like SQ4R [1] for reading, and hugely applicable to general technical and article reading is "How to read a paper" [2]. For lecturers, there's "How to Speak" [3], and for those attending a talk there's the Cornell Notes system. [4]

[1]: https://en.wikipedia.org/wiki/SQ3R

[2]: https://web.stanford.edu/class/ee384m/Handouts/HowtoReadPape...

[3]: https://www.youtube.com/watch?v=Unzc731iCUY

[4]: https://en.wikipedia.org/wiki/Cornell_Notes

pyjarrett··on Ask HN: What are some unpopular technologies you wish people knew more about?
> 2024 Carolina Code Conference (polyglot)

Thanks for mentioning this! I work remote in SC and its nice to hear about a nearby convention.

pyjarrett··on The worst thing about Jenkins is that it works (2019)
I don't mind Jenkins pipeline limitations because my philosophy is that CI should be as simple and contain as little build logic as possible.

Every job should be a few simple commands or a python script or something I can run locally. This simplifies reproducing and debugging issues caught by CI -- there's nothing worse than wasting time trying to reproduce what happened.

pyjarrett··on Need a PRNG? Use a CSPRNG
> You can try running this code yourself and see if you get the same answers. This experiment is repeatable.

OpenSUSE:

    483 0.305
    484 0.293
    485 0.283
    486 0.275
    487 0.3
    488 0.302
    489 0.304
    490 0.274
    491 0.274
    492 0
    493 0.285
    494 0
    495 0.271
    496 0
    497 0.289
    498 0
    499 0.294
    500 0
    501 0.306
    502 0
    503 0.31
    504 0
    505 0.275
    506 0
    507 0.285
    508 0
    509 0.289
    510 0
    511 0.282
    512 0
    513 0.301
    514 0
    515 0.266
    516 0
    517 0.289
    518 0
    519 0.291
    520 0
    521 0.309
    522 0
    523 0.325
    524 0
    525 0.358
    526 0
    527 1
    528 0
    529 0
    530 0
    531 0
    532 0
    533 0
    534 0
That's wild.

I don't see this with mt19937, but I did see these funny nuggets with unseeded `rand()` on Windows:

    255 0.3
    256 0
    257 0.289
    258 0.306
    ...
    511 0.262
    512 0
    513 0.275
pyjarrett··on ESA’s new Ariane 6 rocket passed a major full-scale rehearsal
I don't know about "most successful," but Ariane 5 flew 83 consecutive missions without a failure, and had a 95.7% success rate overall. It was used to launch the James Webb Space Telescope.
pyjarrett··on Can the language of proof assistants be used for general purpose programming?
Yes. SPARK is a verifiable subset of Ada and can be mixed with it in the same project. There are SPARK crates you can use via Alire [1]. There's a SPARK implementation of the TweetNaCl crypto library[2]

You can use it for general purpose programming, but it's very difficult and various degrees of verification you can achieve with it [3]. I made a verified version of Rob Pike's simple C regex matcher in SPARK -- proving an absence of runtime errors (e.g. never raise an exception or hit an out of bounds condition).

[1]: https://alire.ada.dev/crates.html

[2]: https://github.com/rod-chapman/SPARKNaCl

[3]: https://blog.adacore.com/from-ada-to-platinum-spark-a-case-s...

pyjarrett··on How can I get my engineers to accept being on call?
> this is an unreasonable standard

My phrasing could have been more clear, I'm not saying you need a 100% perfect system and no on-call.

It's weird they're instituting on-call for everyone now, and I'm curious about the reason behind the policy change. I've heard of "on call for everyone" being used as both a response to programmers shipping unreliable code, and also as a preventative measure to encourage programmers to ship more reliable code.

pyjarrett··on How can I get my engineers to accept being on call?
What's the rationale for setting up the on-call schedule? Is the system that unstable?

> on call at least once a week, including the work day and evening, once a month, including the weekend of that week.

> I should also note there is a required 15 min response time to pages. The person MUST be able to be online and fixing the problem within 15 mins of the page.

I've worked a position where I had extra duties on the weekend, so I effectively worked 12+ days in a row many times. I've also been on an on-call schedule like this with a short response time. Both of these severely impact your personal life.

You have to realize that the two most valuable things you can give engineers is their own time back and money.

This is how I would probably try to handle it: To start, it would be opt-in and not mandatory, as this type of responsibility is difficult for those with small children or other family members, such as elderly, needing care. The 15 minute response time also means you should be being paid an hourly rate (maybe even 1.5x or 2x) while being on-call, whether there's an incident or not. This is because it severely limits what you can do -- you're basically chained to your laptop and an internet connection. Anyone responding to an on-call event after hours should also be given a half or full day off the next work day. Weekend on-call should at a minimum be given a day off the following week, preferable two.

pyjarrett··on Remote Work Is Here to Stay, and Employers Aren’t Happy About It
I've been remote for almost 7 years.

I live ~175 miles to the closest tech hub, so changing to in-office work isn't an option unless I move. If I was forced to move, an equivalent house to what I have now would cost about 3 times as much and I'd have at least an hour commute each way.

I save a lot of money not commuting and eating at home, and a lot of issues I'd otherwise have to miss work for if I went into an office (family illness, childcare issues) are super easy to adjust my schedule to work around.

pyjarrett··on Ask HN: (How much) do you get paid for being on call?
You are a hero among managers.
pyjarrett··on Effective Git as a solo developer (2021)
Perforce is used in game dev since it handles binary files super well, and is used by many people who aren't engineers. It's not perfect, but it's super easy to use and the GUI tooling is amazing.
pyjarrett··on Memory safety without borrow checking, reference counting, or garbage collection
> Having a raw pointer and having an index into an array are essentially equivalent

You can split the handle (index) into an upper "magic" and lower "index" part, with the handle being an opaque type, only being able to be accessed and modified by the container giving out handles. In C++, you'd likely see operator* and operator-> overloaded for usage. This technique is described in the original "Game Programming Gems" book.

Not 100%, but on usage, the handle checks the magic against what's currently in the data-structure to let you know if the handle has been freed and/or reused. Since handles are opaque, you can muck with the underlying objects as you want, e.g relocate them in memory, having multiple internal arrays, etc.

pyjarrett··on AI is going to eat itself: Experiment shows people training bots are using bots
Not only this, but also books.

There's a big difference between ghostwriting (biographies and fiction) and then the now fully GPT-generated books (non-fiction, especially technical) for sale on Amazon.

pyjarrett··on Lua: The Little Language That Could
Wow, I just integrated Lua into a C++ project for the first time last night.

Took <15 minutes to integrate it with the build system (FASTBuild), watched a tutorial video[1], and then in another 15 minutes I had it hooked up to configure my application.

[1]: https://www.youtube.com/watch?v=4l5HdmPoynw

pyjarrett··on My thoughts on OCaml
I was poking around https://forums.fsharp.org/ and https://www.reddit.com/r/fsharp/
pyjarrett··on My thoughts on OCaml
> F# is such a great language.

I very much feel this, I found it productive, but it feels like a complete ghost town. I'm considering swapping to Go over using .NET for tooling/scripting.

pyjarrett··on Ask HN: Why do you think F# is not more popular, even within the .NET ecosystem?
It's not promoted well. Relying on open source contributions to the ecosystem to keep it going also removes its "first-class" branding.

I've been using F# as a cross-platform Python/Bash/Powershell replacement. I've never heard or read about anyone else doing this, but it works super well in this use case for me.

People seem scared of functional programming languages, seeing them as difficult and impractical. I tried (and failed) learning Haskell three times, but F# makes writing very little code to accomplish a whole bunch easy, due to being able to use .NET libraries, and there's not really that much syntax to learn and the tooling (Ionide, Rider, VS) is great, e.g. run/debug works out of the box.

pyjarrett··on Understanding the .NET ecosystem: The evolution of .NET into .NET 7
True, but I only recently started learning .NET and I had to come up with a mnemonic to help filter out and through older docs and resources. It gave enough clarity to gain traction.
pyjarrett··on Understanding the .NET ecosystem: The evolution of .NET into .NET 7
> Still being updated and worked on

It is, hands down, my best experience working in a functional language. I do hobby work in it, and it seems super nice, but I'm not sure where everyone is.

> still very few people use it.

Looking at a chart of GitHub and StackOverflow usage[1], OCaml/F# seem almost steady compared to the other functional languages, my suspicion is that Rust absorbed a lot of programmers looking for functional concepts in programming languages.

[1]: https://tjpalmer.github.io/languish/#y=mean&weights=issues%3...

pyjarrett··on Understanding the .NET ecosystem: The evolution of .NET into .NET 7
"Mono is an open source implementation of Microsoft's .NET Framework." [1]

Unity looks like it uses its own fork of Mono, or IL2CPP, which is a fancy thing that converts the intermediate language produced by C# into C++ code, which it compiles. [2][3][4]

[1]: https://www.mono-project.com

[2]: https://docs.unity3d.com/2023.2/Documentation/Manual/overvie...

[3]: https://docs.unity3d.com/Manual/IL2CPP.html

[4]: https://docs.unity3d.com/Manual/Mono.html

pyjarrett··on Understanding the .NET ecosystem: The evolution of .NET into .NET 7
1. .NET "Core" ... I tell myself "C is for Cross platform." This is usually what people seem like they mean now when they talk about ".NET".

2. .NET "Framework" ... I tell myself "F is for Former." This is the older, Windows specific version.

3. .NET "Standard" ... I tell myself "S is for Specification." This is just the spec which defines what Core and Framework must implement.

pyjarrett··on Why use Rust on the back end?
F# is pretty close to "GC'd Rust with Python-esque indenting". In my head it feels like "Rust-lite".

I ported a program from C#, to F#, and then to Rust. The F# -> Rust conversion was a lot of "add curly braces and parentheses" and "replace |> with ." It's almost kind of ridiculous how similar the code can be. I've been going back and forth between F# and Rust on hobby work and it's very, very easy to do.

You get the equivalent of many crates of cross-platform stuff straight out of .NET Core: e.g serialize to/from JSON, network requests, tasking/async, etc. Either VS or Rider is great, the debugger also works out of the box. I also skip Python/Powershell/Bash and write any extra scripts I need in F# and run then with ``dotnet fsi``. This "Keep all the things in the same language" is very attractive to me. Using F# over Python for scripting is very enticing to me -- good implicit typing, enums, ``match``, etc. I'm not sure why this hasn't been pushed before.

The docs are great and most things "just work", but I've been trying to hold back my enthusiasm because I just haven't been able to find folks using it, and http://forums.fsharp.org seems empty. It is fun to write though :)

pyjarrett··on Building a new functional programming language
> IMHO a really underrated feature of Rust is how friendly its tooling is towards its users. I'd really like to see something like that for functional programming.

> abysmal tooling around them

F# has amazing tooling.

Debugging works out of the box in Visual Studio and Rider, and it's impure enough I was able to get comfortable quickly and .NET core has a crazy amount built in (e.g. no fuss JSON serialization). I ported a project from C# to F# and the old bash/powershell scripts to publish a standalone executable are now just F# scripts you run with `dotnet fsi`.

pyjarrett··on The Missing Semester of Your CS Education
Knowing a good bit of Rust helped me considerably, due to the commonalities of being expression-based, pattern matching and sum-types. F# almost feels like a more functional and GC'd Rust.
pyjarrett··on The Missing Semester of Your CS Education
I normally write C++, but I've also written in Rust, Python, Ruby and bunch of other languages. I've never had trouble with a programming language until Haskell, and had to accept that I'm just probably just not smart enough to do it.

However, I wrote my first thing a port of a small C# tool of a couple hundred lines, to F# in about an hour. It's been about a week now, and things are considerably smoothing out.

To be considered niche, the F# tooling has been great. Also, having the .NET libraries available adds a lot of built-in capability.

pyjarrett··on Named Booleans prevent C++ bugs and save you time
Ada calls these "if expression" and the switch-variant "case expressions". It's the same syntax as the control flow ones, just wrapped with parens.

    value := (if a then True
              else (
                 case b is
                    when 1 => False,
                    when others => Undefined
              ));
pyjarrett··on Returning to Nim from Python and Rust
I've thought about it, but I spent a lot of time going down the rabbit hole with functional languages with Haskell a few years ago and was just checking out the .NET ecosystem as a whole since I wasn't familiar with C#.

The experiment was "How productive and portable is .NET Core?" knowing that F# is there as a possibility. I dabbled in the tangentially similar OCaml a long time ago, but had wanted to just move fast to answer "Is .NET is a reasonable technical choice for cross-platform tooling I need?" So far it's been a pretty solid "Yes."

pyjarrett··on Returning to Nim from Python and Rust
I've been doing this a lot.

I am doing an experiment of trying out C# as a Python replacement for automation because of (1) the strength of the built-in libraries and (2) not requiring an interpreter. Bundling the C# runtime into application is doable, and the tools are super portable with no changes so far between Windows/Mac/Linux.

However, the smallest I've been able to get the standalone executables with bundled stripped down runtimes is ~9 MiB.

Even with this limitation, I've been super happy with this experiment so far. I'm not sure how committed I am yet to C# over Python, but it's pretty breathtaking what all you get out of the box with .NET

pyjarrett··on The C juggernaut illustrated (2012)
Despite enjoying the terseness of C, with curly braces and short notations, many "normalized" things in C used to trip up math students I would tutor in elementary programming classes. "Why is `=` assignment and not `==`? How can a function not produce a value? Why does `||` mean "or"?, etc.

Pascal family languages usually end up much more long winded, but can often be more easily explained to non-programmers than C solutions. I spent a couple years doing down the Ada rabbit hole in open source and was amazed how many elements of the problem domain you express directly with the language, and how you can constrain your program to catch domain-specific issues with the compiler.

With the rise of things like ChatGPT, I'm curious if the next revolution for programming languages is focusing on constraints to verify correctness rather than expression of what to do. This might help help an AI model develop code and provide validity checks on the generated solution.

pyjarrett··on Universal Summarizer
I signed up for Kagi last month, and haven't used another search engine since.

I've already gotten my money back in time savings from good search results, I didn't realize they were also working on other valuable things like this as well.

← PreviousPage 2 of 7Next →