đŸ Archived View for news.tuxmachines.org âș n âș 2023 âș 01 âș 28 âș Programming_Leftovers.gmi captured on 2023-01-29 at 15:29:21. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Tux Machines
Posted by Roy Schestowitz on Jan 28, 2023
Microsoft and Proprietary Software
=> https://austinhenley.com/blog/naturallanguageui.html âș Natural language is the lazy user interface
Expecting users to primarily interact with software in natural language is lazy.
It puts all the burden on the user to articulate good questions. What to ask, when to ask it, how to ask it, to make sense of the response, and then to repeat that many times.
=> https://las.rs/blog/all-you-need-is-hkt-s.html âș All you need is higher kinded types
Core theorem: (Roughly) any valid Haskell term (or of a similar language) typed with type families and GADTs, can be reformulated as a semantically equivalent term that can be typed without type families and GADTs.
What do I mean with semantically equivalent? When erasing types, the new term has the same structure, modulo technically unnecessary wrappings using constructors that ought to be newtype constructors. (You could in fact aleviate this by adding more language features, but that would ruin the point, unless there is a way of doing it in a minimal way.)
=> https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/ âș Unicode operators for semantically correct programming
Are there any modern programming languages which allow the use of semantically correct Unicode symbols as operators?
As far as I can tell, there's only one!
=> https://www.r-bloggers.com/2023/01/why-comment-your-code-as-little-and-as-well-as-possible/ âș Why comment your code as little (and as well) as possible
When I first started programming, I clearly remember feeling I had to add comments, that would repeat exactly what the code below was doing, as if it were the script for some sort of voice over. I want you to know like I now do that itâs not the way to comment oneâs code. đ
An important goal of good code is to be readable so that future contributors can build with and upon it as needed. Good commenting is part of the toolset for reaching that goal. In this post we shall first present principles of code commenting, and then a few tips.
=> https://rachelbythebay.com/w/2023/01/26/shadow/ âș Tonight's rabbit hole: time math and 32 bit longs
I find some funny rabbit holes sometimes. Tonight, it went like this. Ubiquiti released a new version of the software for their USG devices because they had this thing where their dhcpv6-pd implementation could be exploited to run arbitrary commands by someone sitting in the right spot on the network (i.e., out your "WAN" port).
=> https://www.mattkeeter.com/blog/2023-01-25-branch/ âș Do Not Taunt Happy Fun Branch Predictor
I've been writing a lot of AArch64 assembly, for reasons.
I recently came up with a "clever" idea to eliminate one jump from an inner loop, and was surprised to find that it slowed things down. Allow me to explain my terrible error, so that you don't fall victim in the future.
=> https://tratt.net/laurie/blog/2023/distinguishing_an_interpreter_from_a_compiler.html âș Distinguishing an Interpreter from a Compiler
In Compiled and Interpreted Languages: Two Ways of Saying Tomato, I showed how any language can be implemented as an interpreter or a compiler. However, I was deliberately vague when defining how one might distinguish an "interpreter" from a "compiler", in no small part because I couldn't think of a crisp definition of the two terms. Although I wasn't quite as vague as "I know it when I see it", I was uncomfortably close.
It was thus with great interest that I read a comment on the post from a good friend, and language implementation veteran, Mario Wolczko. In a sense, Mario gave two ways of distinguishing compilers from interpreters, but I'm going to quote the one that made my jaw drop: [...]
=> https://two-wrongs.com/three-customers-in-a-bank âș Three Customers In A Bank
Hereâs the setup to an interesting puzzle: assume the time it takes to serve customers at a bank is exponentially distributed with mean service time 15 minutes. When you come in to the bank, both bank employees are busy serving customers. There are no other customers in the bank, except you and the two customers already being serviced.
What is the probability you will be the last customer to leave the bank among the three of you?
=> https://earthly.dev/blog/build-and-deploy-pyapp-with-bazel/ âș Building and Deploying a Python App with Bazel
Bazel is an open source software tool released by Google to automate software build processes and testing. Itâs a scalable and reliable tool that allows developers to quickly build and test software applications. Because Bazel supports multiple programming languages, itâs ideal for projects with multilanguage dependencies.
In this article youâll learn about Bazel, what itâs used for, and what features make this build tool so special. Youâll also learn how to develop and run a basic application using Python with Bazel.
=> https://pythonspeed.com/articles/float64-float32-precision/ âș float64 to float32: Saving memory without losing precision
Libraries like NumPy and Pandas let you switch data types, which allows you to reduce memory usage. Switching from numpy.float64 (âdouble-precisionâ or 64-bit floats) to numpy.float32 (âsingle-precisionâ or 32-bit floats) cuts memory usage in half. But it does so at a cost: float32 can only store a much smaller range of numbers, with less precision.
So if you want to save memory, how do you use float32 without distorting your results? Letâs find out!