I cannot even explain my colleague on my left’s work to the colleague on my right. I won’t blame the dad here.
I cannot even explain my colleague on my left’s work to the colleague on my right. I won’t blame the dad here.
my money is on vi or vi derivates.
In Maybe monadic, its monadic bind will automatically resolves any failed computation, and don’t need explicit checking.
for example, the code in Haskell looks something like the following:
fib: Int -> Int -> Maybe Int
fib max_depth idx =
do
guard (0 <= max_depth)
n1 <- fib (max_depth - 1) (idx - 1)
n2 <- fib (max_depth - 1) (idx - 2)
return (n1 + n2)
Haskell type class system automatically figures out this is a maybe monad, and check for error accordingly.
Notice, unlike the C code the author provide, this haskell code will exit immediately when n1
failed and never compute n2
, similar to the behavior of the exception code. Thus I believe his point about performance is at least unjustified, if not wrong.
Another interesting fact about this code is that there is nothing that is built into the compiler/interpretor (except the do
expression, which is just a minor syntactical sugar). For this code, the compiler designers don’t need to design special semantics for raise and catch. Everything here, guard
, return
, and the Maybe
monad (which is in charge of propagating errors) is defined by the user, using normal functions, no metaprogramming involved.
Wouldn’t effect systems still be considered exceptions, but handled differently?
Yes, unlike monad, the error in algebraic effect is propagated by the compiler/interpretor, instead of user defined. But unlike implicit effect, explicit effect (algebraic effect, throwable, etc.) makes it clear how the code can go wrong.
Although explicit error through monad or algebraic effect is more clear in general, there are special cases where explicit effect is undesirable. One such example is effect pollution: low-level effects that are unlikely to cause impure behaviors are unnecessarily propagated through the call stack. This problem can make the code more verbose and difficult to handle.
The more I read about these kind of article the more I am amazed that our digital future is at hand in utterly incompetent people.
This person clearly have no understanding of monadic error (AKA Maybe/option monad or slightly more advanced Either monad), which is the first monad we teach at a class targeting second year undergrad.
The performance comparison is just plain factual error. The functional error code will continue to compute n2
when computation of n1
failed; the same do not happen in the exception version. If you compare codes with completely different traces, of course they will have different performance…
A properly implemented monadic error will return as soon as compute for n1
failed, and never execute the rest of the code. This is the default and idiomatic behavior in Haskell, OCaml, F#, and rust. This performance problem doesn’t even happen in LINQ-style handling like in C# and Kotlin (maybe also Typescript?).
The point of monadic error is that its control flow is local, whereas exception is non-local. Specifically, the exception can be handled and occur anywhere in the code base, with no indication on the type level. So programmers will be constantly worrying about whether the exception in a function call is properly handled.
Even worse, when you try to catch a certain error, there is always the risk to accidentally catch similar exceptions in a library call or someone else’s code. Writing good code with try-catch requires a lot of principle and style guides. But unlike monads, these principle and rules cannot be enforced by the type system, adding extra burden to programmers.
In fact, we have known for a long time that non-local control flows (goto, break, contiune, exception, long jump) are the breeding ground for spaghetti code. As an evidence, many non-local control flows (goto, long jump) are baned in most languages.
That being said, there are certainly cases, with proper documentation, that exception style is easy to write and understand. But I think they are very specific scenarios, which have to be justified on a case-by-case basis.
There are support table on asahi wiki. For example, here is the support page of M2: https://github.com/AsahiLinux/docs/wiki/M2-Series-Feature-Support
It is missing thunderbolt, touch id, video decoder, video encoder, DP alt mode, pro res, PCIE etc.
Then if you care about the artists being compensated fairly, you can CD+rip; if not, streamrip/torrent will produce a lot less waste and much more convenient.
TBH most big names are millionaires anyway, I probably would care much more about my convenience than them getting paid 5 bucks for all my troubles.
If you can download music, you can either host your own using navidrome, or just use a local player like auxio.
The only downside to this approach is that the artists you like might not get compensated fairly, as most streaming service pay by stream times. This is also why I prefer buying music than streaming.
as far as I know, C# don’t have proper ergonomic monadic bind as in F# (computation expression), Haskell (do expression), and Ocaml (let*), but I could be wrong.
Honestly, it is much more code to use loop with non-local control like break, continue etc. (variable initialization, append, variable mutation in loops…) than just calling a collect function (which I assume just means to_list). In the above example, in most programming language I know, you don’t even need to collect the result into a list.
Not to mention, large loops with non-local control is a breeding ground for spegatti code. Because you no longer have a consistent exit point to the loop, thus making the semantics hard o reason about.
In many languages, there are type class / trait / interfaces (whatever you want to call them) that allows lazy structures to share the same API as strict ones.
bandcamp is great! you can just pay and download music in whatever format (flac, wav, mp3), no questions asked.
They don’t have the Taylor Swifts of the world, but most indy bands and artists are on there, which is good enough for me.
For classical music, there is presto music, but their download experience is not as straight forward as bandcamp IMO.
Shortly after publishing this article in her blog, she also published a gh repo collecting incidents of misogynism https://github.com/iyzhang/misogyny/ It would be great if people can give it a read or contribute incidents.
Glad to see this article is eventually published by the ACM.
I think there is no rule, but I like to mount them on /mnt
.
A good discussion can be found here: https://www.reddit.com/r/linuxquestions/comments/u0ri07/where_do_you_usually_mount_your_internal_drives/
/run is a temporary fs, so if the mount, filesystem or even the entire system crashed, all the mounted data will be cleaned up after a reboot.
On the contrary, if the mount crashed, it might leave a folder or data on /media, making subsequent mount problematic.
Here is a well-written comment about the rationale behind this mount point: https://www.reddit.com/r/linuxquestions/comments/tzo984/comment/i40e2za/
deleted by creator
except nowadays many distro mounts removable media under /run/media instead of /media (for good reason).
I think modern coffee is judged by how much the tastes reflect its distinct characteristics, which includes physical characteristic of the farm (altitude etc), fermentation process, and roasting process.
It takes a lot of work to produce good coffee, and the end result should let these efforts shine. Acidity, fragrance, and funk are great ways to communicate the life of the coffee to the taster. That is why they are typically the standard to determine good coffee, instead of generic and monotone"smoothness" that is shared across kirkland signature, peets, starbucks, and gas station coffees.
Please don’t, it is not only a product of colonialism injustice, it is also produced in extremely inhumane manner. To make the matter even worse, the industry consensus is that they tastes terrible.
Related video: https://www.youtube.com/watch?v=pkbuFwHnJQY
I have figured out the problem. Turns out although in ip a
, the MAC is the same, yet in the vm, the MAC is different.
As for being assigned the same IP, it is just my stupid router… Getting a new MAC (creating a new VM) fixes the issue.
fedora atomic desktops (silverblue, kinoite, and derivatives like bluefin etc) are really great. They are as up-to-date as fedora, with an additional layer of stability provided by its atomic and image based nature.