HNHacker News
TopNewBestAskShowJobs

pyjarrett

677 karma · joined August 29, 2021

submissionscomments
pyjarrett··on Ask HN: What are you reading?
Discourses by Epictetus
pyjarrett··on “It works better in the app”
When I was job hunting earlier this year, LinkedIn on my phone told me to install the app. Sure, why not? So I did. It refused to authenticate and never worked. One good point is that at least the mobile web version didn't lock me out with an impassable overlay like some websites are starting to do.
pyjarrett··on No more JetBrains products for me
> I tend to run older hardware,

> the tool is so fricken slow.

How old is "old hardware"? I've had no issues running CLion on a 2020 M1 Macbook Air and a i5-10400 (Linux). These projects are only in the hundreds of thousands of lines of code though.

> The install is gigantic on disk, leading me to avoid it on my older machines where space is limited.

I found that by default toolbox likes to keep old versions of the IDEs available for rollback. I disabled that and reclaimed tens of GB across all the products I use.

pyjarrett··on Ada, its design, and the language that built the languages
Ariane 5 became one of the most reliable rockets ever made and was used to launch the JWST.
pyjarrett··on Axios compromised on NPM – Malicious versions drop remote access trojan
I used to, but the knowledge of .NET seems mostly transferrable to C#. It's super useful to do `dotnet fsi` and then work out the appropriate .NET calls in the F# repl.
pyjarrett··on Axios compromised on NPM – Malicious versions drop remote access trojan
These are the big ones I use, specifically because of the standard libraries:

Python (decent standard library) - It's pretty much everywhere. There's so many hidden gems in that standard library (difflib, argparse, shlex, subprocess, cmd)

C#/F# (.NET)

C# feels so productive because of how much is available in .NET Core, and F# gets to tag along and get it all for free too. With C# you can compile executables down to bundle the runtime and strip it down so your executables are in the 15 MiB range. If you have dotnet installed, you can run F# as scripts.

pyjarrett··on If you don't opt out by Apr 24 GitHub will train on your private repos
It doesn't take much power or time to run your own local git server. My first one which lasted years was parts I mangled together from old computers from garage sales.

There's instructions on running a Git server in the git book: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protoco...

pyjarrett··on Ask HN: Share your personal website
https://pyjarrett.github.io/
pyjarrett··on Two and a Half Years in GameDev
I played an incredibly amount of SimCity 2000 and SimCity 3000, and Metropolis 1998 looks *amazing.*
pyjarrett··on An Introduction to Modern CMake
FASTBuild[0] is super fast for large projects and comes with distributed builds and caching out of the box. It requires a bit of effort to set up, but it supports globbing sources, there's no separate generate build step, and it can also make Visual Studio solutions.

[0]: https://www.fastbuild.org/docs/home.html

pyjarrett··on Vets Who Code
Another great resource for vets getting started in software development (and other fields) is American Corporate Partners[1]. I had a great mentor through that group.

[1]: https://www.acp-usa.org/

pyjarrett··on You Need Subtyping
> However, existing programming languages have little or no subtyping

Every "type" you use in Ada is actually a subtype.

In Ada, "A subtype of a given type is a combination of the type, a constraint on values of the type, and certain attributes specific to the subtype".

You don't ever refer to actual types in Ada, since creating a type with "type" actually creates an anonymous type and the name refers to the first subtype.[1]

    type Token_Kind is (
       Identifier,
       String_Literal,
       --  many more ...
    
       -- These are character symbols and will be part of Token_Character_Symbol.
       Ampersand,
       --  ...
       Vertical_Bar,
    );
    
    --  A subtype with a compile-time checked predicate.
    subtype Subprogram_Kind is Token_Kind
    with Static_Predicate => Subprogram_Kind in RW_Function | RW_Procedure;
    
    subtype Token_Character_Symbol is Token_Kind range Ampersand .. Vertical_Bar;
> If you have a pointer with more permissions, it should still be usable in a place that only requires a pointer with fewer permissions

This is exactly how "accessibility" of access types works in Ada[2]. If you have a pointer ("access type") to something on the heap, you can use it wherever an anonymous access type can be used. You can also create subtypes of access types which have the constraint of a "null exclusion".

[1]: https://ada-lang.io/docs/arm/AA-3/AA-3.2#p1_3.2.1

[2]: https://ada-lang.io/docs/arm/AA-3/AA-3.10

pyjarrett··on We're Still Not Done with Jesus
> no one cared back then if he was real,

This was directly addressed in 2 John 7

"I say this because many deceivers, who do not acknowledge Jesus Christ as coming in the flesh, have gone out into the world."

pyjarrett··on I stopped everything and started writing C again
> Plenty of ways to trigger undefined behavior

I'm curious about this list, because it definitely doesn't seem that way these days. It'd be interesting to see how many of these are still possible now.

pyjarrett··on Ask HN: What less-popular systems programming language are you using?
Ada

The open source tooling has significantly improved since I started using it in the last five years.

pyjarrett··on Ada's dependent types, and its types as a whole
About two years ago, I was able to dive into the Ada reference manual formatter which has initial commit of March 2000 and is about 45k lines of code, and add MDX output pretty easily.

Other languages focus on terseness and expressiveness. Ada expresses a bunch of constraints directly and forces you to do things in organized ways (e.g. use namespaces appropriately).

pyjarrett··on A Random Walk Through Ada (2014)
The big reason for `out` only is "I want to write here, but I don't care about the initial value." It's a more explicit version of the C++ `Foo& outFoo` output parameter paradigm.

> When "out" and "in out" parameters are distinguished, there is no need for the existence of constructors as a separate concept.

I don't agree with this. You can get I need to do things "post-init" with controlled types, or use a `return X : Thing do ... end return` block. Constructors help ensure invariants. You can make a type `is private` to prevent instantiation, only allowing creation via functions (sort of like Rust `new` associated functions), or initialization via an `out` param. It's OK but not perfect, but you can also tag on a `Type_Invariant` aspect if there are conditions which have to be met by a type. My big problem with Controlled types is that forces a type to be `tagged` (i.e. it has a vtable) which means it affects storage layout of values of that type, which isn't a problem in C++.

You can forbid copies by making something a `limited` type, but you'd have to write your own "Move" equivalent, and some of the containers have `Move` subprograms implemented to transfer contents. Limited types might elide the copy when returned from a function, but it's been a while since I looked at those rules.

pyjarrett··on A Random Walk Through Ada (2014)
I recently started writing Ada again, a couple of years after I did a bunch of projects with it. The amazing things is how easy it is to go back and update old code due to how much semantic information gets embedded in it and how few symbols it uses.
pyjarrett··on Four Months with Ada
That's because I took it down over two years ago and moved most of the content to ada-lang.io when I set that up. This was an anecdotal blog post so it didn't get moved over.
pyjarrett··on How to read C type declarations (2003)
Ada syntax is close to what you described:

    Foo : array (Positive range 1 .. 100) of access function return access Integer;
pyjarrett··on "No way to prevent this" say users of only language where this regularly happens
Ada is used quite often in embedded systems.

- https://blog.adacore.com/ada-on-any-arm-cortex-m-device-in-j...

- https://github.com/AdaCore/Ada_Drivers_Library

pyjarrett··on Ada 95: The Craft of Object-Oriented Programming
> you don't have to go full functional verification

The amazing thing to me is that Ada code can call SPARK code just fine, and there's crates of SPARK code in Alire that you can use. It's a huge boost of confidence in the quality of a library that you're using when it has some form of verification.

pyjarrett··on Ada 95: The Craft of Object-Oriented Programming
> the code to SPARK and proving the absence or runtime error

I wrote Rob Pike's simple regex from the "Practice of Programming" in Ada/SPARK and it blew my mind that I actually managed to prove an absence of runtime error (guaranteed no overflow or out of bounds).

pyjarrett··on Ada 95: The Craft of Object-Oriented Programming
This is an awesome feature, combined with appropriate type and bounds checking and prevents so many errors. It can also avoid resorting to a heavier-weight map type.

Ada has this as well, including using any arbitrary continuous range for array indexing which handles remapping indices for you. e.g. if the key range is 20-40 the language handles associating it with array indices for you.

pyjarrett··on Ada 95: The Craft of Object-Oriented Programming
Ada checks the ranges on types assigned to each other at compile time and then invariants on assignment and when passed as parameters. You can turn the runtime side of these checks on or off individually at the module level.
pyjarrett··on Ada 95: The Craft of Object-Oriented Programming
My favorite thing about Ada is how it uses modules ("packages") for encapsulation and not classes. This separates it from a lot of other languages with object-oriented programming by allowing you to split up and expose externally visible behavior in modules and submodules without making type internals visible, but allowing other elements in the implementation side of the module and submodules to look inside.
pyjarrett··on Go Enums Suck
Not only that, but when you define an enum you get 'Pred and 'Succ to move between values, range iteration over all values with 'Range and 'First and 'Last, string conversion with 'Image and parsing with 'Value.
pyjarrett··on Rust developers concerned about complexity, low usage
I tried out Swift on Windows and really enjoyed it. The experience was 100x better than I expected.
pyjarrett··on Development slowness in big and legacy applications
> laziness and corner cutting

My experience is that it just isn't prioritized, and you have to do it early to enforce good engineering solutions to keep it this way. It's much easier to keep something locally runnable than try to set it up that way six months into a project.

If you can't run the stack locally, it makes it harder to set up performance and acceptance testing later. Running locally also makes long build times more noticeable and it's easier to address these issues earlier.

Being able to run locally looks low value at first, but if you do it, and sustain it, you get extremely large project-wide benefits later.

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

Page 1 of 7Next →