I think the lisp situation is peculiar, for 3 main reasons:
- most of them are dynamically typed (thus don't need sum types, as there are no types). The ones that do have gradual type systems likely either implement some form of them (off the top of my head I can only remember typed racket, and I think it implements them through union types)
- not all lisps lean functional: I believe that's mostly a prerogative of scheme and clojure (and their descendants); something like CL is a lot more procedural, iirc
- in most lisps, thanks to macros, you probably don't need the language to support some sort of match construct out of the box: just implement it as a macro [1]
In general the "proper sum types" side of functional programming is just the statically typed one, but even in dynamically typed FP languages you end up adopting sum type-esque patterns, like elixir's error handling (which closely resembles the usual Either/Result type, just built out of tuples and atoms rather than a predefined type), and I assume many lisps adopt similar patterns as well
but how would you do that otherwise? Genuinely curious cause I looked up both the go docs and source (disclaimer: not a go dev), and there doesn't seem a way to handle that specific kind of error through stuff like `errors.Is`, at least from what I can tell, at least in the os and fs packages
At least half of those languages (Elixir and OCaml) have some sort of mechanism for ad hoc polymorphism (elixir has behaviors and protocols, OCaml has higher order modules) so I feel like the comparison doesn't work that well personally
From how you describe it, it sounds like it's taken the same approach as Haskell's async exceptions + mask/uninterruptibleMask, which to me seems like one of the best solutions around, so props to them
Haskell also has something like this in Debug.Trace.trace: even though it's _technically_ impure (cause it outputs to stdout), it's typed as a pure function because it's just for debugging (I think internally it uses an escape hatch to just hide the IO)
Is there a way to emit WebAssembly with Uniffi? I looked for it before, but I couldn't find it (I'm using it in a project to share login between the backend and Kotlin/Swift apps. I wanted to share it with JS for a web frontend, but didn't find any docs mentioning it)
I think, from having it used recently, that supabase's TS library does this. I had to write a wrapper around it a few months ago at $dayjob and was really surprised when select/from parts of a "query" (not really a SQL query, because it's just a postgrest query) actually got parsed at compile time and spit out the right types. And since our code is pretty type heavy, I was gonna have to do that anyway, so I really appreciated it
I have no idea where you get that acceptance of same sex marriage arises from Christian ideas. Because in my personal experience it really doesn't. I live in Italy and a lot of discrimination against gay people (me included), and a big part of the reason why we don't get actual marriage, is catholic rhetoric. Most of the homophobia I've experienced in my life, anecdotally, has been from devout christians: the more devout, the worse the discriminantion. So although I have no data on hand, I have a very strong suspicion that Christianity has nothing to do with it. If anything, it seems like at least in Europe, the more secular countries tend to get better rights for queer people and they get them faster (I think the first European country to get gay marriage was the Netherlands, back in 2001. And they're one of the least religious countries in Europe)
Does it? I haven't used much ocaml and I haven't used Haskell in a while, but as I remember it all IO is already non blocking in Haskell, and the async library gives you the most painless async experience I've ever seen in any ecosystem. And for OCaml, you have explicit binds but recover neat do notation with let*?
At $dayjob right now I'm using remix+supabase (although the supabase part is going away, but we're keeping postgrest). I have to say I quite enjoy it. DevEx seems good (although we've added quite a bit of our own logic on top). Performance is too early for me to tell. For my personal stuff I tend to do more app-like things, so SSR/SSG is not that useful to me, and I tend to go with pure react+redux. But I might try svelte when the new version comes out, it solves a lot of my issues with it.
I've had many cases in the past (not in go) where I've had to make use of that exact same function (in typescript, in F#, and in C#). it is actually quite useful when doing any amount of data manipulation (map/filter/reduce chain that often ends up into a list of key-value pairs, which then get turned into a map/dictionary of sorts).
At least in my job(s over the years), turning a flat list of db records into a more complex, nested (potentially on multiple levels) data structure before handing it off to the front-end is a very common. I've seen it done with "simple, fast code" (although not in go specifically, but in other languages), but it very quickly turned into huge messes of of long nested for loops and was very difficult to read. LINQ, Lodash, java's streams... I sincerely can't understand how go developers live without them. They make me a lot more productive both at reading and writing the code.
To be honest I think the opinion was always generally divided. In my personal experience in the community, gen III and IV seemed to be the most popular, with significant but smaller sections of the community enjoying Gen I, V and II. I haven't met many people whose favourite is post Gen V though. (Mine is Gen IV, closely followed by Gen III and V)
- gen 1 pokemon are very basic and probably some of the worst in the series (subjective)
- the games are extremely unbalanced, and many types have only one evolution line while others have a lot, there's no uniformity (gen 1 has only 1 dragon and 1 ghost line)
- the lack of physical special split hits many types insanely hard and they never balanced for it (i.e.: Ghastly line is a special attacker but is the only ghost type, ghost type is physical for some reason)
- gen2 is basically non linear for most of Johto, which completely destroys the levels on the gym leaders and the wild pokemon. The Kanto section has similar issues. And red is only difficult because it's insanely overlevelled compared to everything else
- gen 2 gym leaders don't have Johto pokemon (lol)
- trainer AI, especially in some instances, is very weirdly programmed (Blaine for example uses healing items on full HP pokemon for no reason)
- lack of moves means even late game, trainers have start-of-game moves ( blue has a rhydon with tail whip and leer, but no ground or rock moves. And an Exeggutor with no grass or psychic damaging moves. And he's the final boss)
I think you don't even need to type out the whole option, just the first few letters most of the time? I haven't used PowerShell in a bit, but I think if you have a command with a -Force option, but just type -f, it will go through as -Force, if and only if the command doesn't have any other options starting in f
To be honest, not most of them. It took until GBA era to get some decent mainline games, and the series probably peaked around DS era, both mainline and spin offs. Gen 1 and 2 have so many flaws that make them age really badly
As someone who kept playing Pokemon (and who has casually played online matches since gen 4) the game did change... But not in good ways.
The mechanics and the balance got better (even if power creep is a very real thing). In fact, going back now, early pokemon titles are, mechanically, extremely weak (especially the ones before diamond/pearl).
The problem is that the single player experience is extremely lacking. The games were never hard, but as the player gained tools they became even easier. The story peaked at Black/White and then kept oscillating between forgettable and downright horrible.
The performance of the games has also steadily gotten worse, and Scarlet/Violet is the worst point in the series on that front. By a mile.
The problem for me, and for I assume many other players, is that it's sadly a one of a kind franchise. It's probably the one with the most content in its own sub-genre (there's very few catch-em-all type games that hold a candle to it), and it's also the only turn based rpg with a competitive scene on the market. I've probably collectively spent tens of thousands of hours on the franchise over a span of 16 years or so and unless something that can even get close to the experience pokemon gives me gets made, I'm kinda stuck.
For simple interactive usage aliases go a long way, and with tab completion it gets really fast to write. For example, Invoke-WebRequest is iwr, Select-Object I think is just select. Some others are ForEach-Object which is %, and Where-Object can be ? Or where. Also, since PowerShell is case insensitive, you don't really need to use all those capitals - the worst you'll get is a warning from your editor, if it has PowerShell integration (around 99% sure about this)
Re: the splitting the body part, that's usually what I do. When I have to review code that doesn't fit in my brain I just end up checking out the code locally and aggressively splitting it into different functions (sometimes even going down to each function having 1 to 2 lines of code at most) just to lower the cognitive burden enough to understand it. It works reasonably well, but takes a while. As for the repetitive error handling: for me it's more about the shape of the code than the actual code itself. I haven't worked much with go, but the few times I did it was as if my brain turned off the moment I saw the word err, I don't quite know how else to explain it (I have similar problems with try catch, but those are somewhat less common in the codebases I worked with, so the problem is less prevalent)
Genuine question, as someone who is approaching the 10 year anniversary of working in the industry: how do you deal with the inherent verbosity and bare-ness that come with that level of simplicity? To this day, loops that aren't of the standard "go through array in order" kind still take me longer to parse mentally than some map/filter/reduce calls ever did, and repetitive/uniform code (like error handling in go) makes it very difficult for me to catch the details. And that's the code I've read (and had to write) for most of my professional career (most of it was procedural legacy software), so I don't think experience is the problem (unless I need more, in which case fair enough). But I think I haven't been able to make the mental switch to be able to separate the important details from the noise, and I don't really know how to
I looked around to see if that was the case and couldn't find any indication of it, but if it's true I might just try it out again in the future (however distant that future may be) because apart from the lack of metaprogramming I really like everything else about it
Gleam looks really nice but unfortunately the complete lack of metaprogramming of any kind makes it a non-starter for me personally. I still hope it succeeds though, the BEAM is a really nice platform and maybe having a statically typed language can help increase adoption.
You can recover the ability to reorder effects by using MTL-style type classes, so you could write that as M<T> where M: MonadState<S> + MonadError<E>, in rust-ish syntax. But that makes the number of trait/typeclass implementation for each transformer explode (given a trait and a type for each transformer, it's O(N^2)), whereas algebraic effect systems don't really have that issue. I also have a hunch that algebraic effects(or, well, delimited continuations in general) are probably easier to optimize than monad transformers, too.
I always felt like it was kind of the other way around? Speaking from experience , most languages where immutability is the default and/or the only option can usually simulate mutability or have it as a stdlib-provided escape hatch (elixir and haskell come to mind), but most languages that are mutability-first really struggle to provide any sort of immutability that is reliable.
As someone who worked in a decently sized company working on a software product written with TS/HTML/SCSS (at least we had those) and jQuery: no, absolutely not.
as the apps get big, state becomes a mess, fully reusing code is very hard, making anything even slightly reactive becomes not only a lot of code, but a jumbled mess of mutability, usually copy pasted from somewhere else. I will take any other type of app over that - I don't care if it's angular, vue, react, next, whatever.
So i contend that not only is "managing a bit of state and writing sensible CSS to make it reusable" very hard, I haven't even seen it done ever, at least in my personal experience of the code I touched
I mean, Svelte/store is something completely different though, isn't it? it's more akin to Jotai/Zustand/Redux and friends than it is to hooks. If you had to compare Svelte with React, the thing "closest" (while stretching that word very much) to hooks would be the `$` reactivity things Svelte does? Because if you want a state management solution, react has that as well (many, in fact). Just not built in, and a lot of them work really well
Along the lines of what another user said, you can actually get this a lot shorter. given variables $haystack and $needle, this actually becomes
$haystack | lines | where $it =~ $needle
which, albeit maybe not as concise as the grep solution, to me feels good enough, especially when you have so many other tools to handle text (all of the str subcommands, splitting by row/column and then working on tables).
also, admittedly, if you want to drop down to "normal" ls, you are one character away: use a caret and you can drop down to the usual bash/sh/whatever.
I have used it quite a few times because I have a quite a low spec PC, and being able to limit the browser performance + watch a video with picture-in-picture while playing games is very nice.
I recently got back into it, downloaded it on my phone, and will probably switch over to it on my personal PC too (on phone I switched to it because built in adblocker + faster and less wonky than FF for me).
adblocker + performance control + nice aesthetics + integrations + easy sending stuff from phone to PC and back is kind of a sweet spot for me - though it might not be for everyone. Or at least it seems like it
As someone who worked with F# professionally for multiple years, I think I can quite confidently say that laziness is not ergonomic in F#, at all. I've tried making use of it many times, but because you have to explicitly delay and force values all over the place, it infects and dirties up code whenever you try to use it.
Idris(at least idris2) gets a bit closer with the implicit delaying and forcing, but changing a value from lazy to strict and viceversa still modifies the signature, which is kind of annoying in my opinion. Compared to Haskell, where I can just add bangpatterns and sprinkle `!` in a few places, it's still less ergonomic.
I feel like there isn't really a good implementation of strict-by-default but lazy-on-demand functional programming that is ergonomic and gets out of the way, quite yet.
This sounds really interesting (and also eerily similar to haskell's Coercible and roles), is there any material on the matter somewhere? I'd love to see what solution they're thinking of working towards, seeing as this is a pain point that I encounter somewhat frequently.