HNHacker News
TopNewBestAskShowJobs

bPspGiJT8Y

38 karma · joined April 14, 2023

submissionscomments
bPspGiJT8Y··on Elixir – Why the dot when calling anonymous functions?
Clean also has WASM as the compile target via its IR, and its tooling is great. Unfortunately though I couldn't find any sort of a community when I was looking into it, but other than this the language looks quite mature and very industry-oriented. Then there's Lean which also can compile to WASM via some sort of a bridge, it has decent tooling but the ecosystem is still nonexistent.
bPspGiJT8Y··on Elixir – Why the dot when calling anonymous functions?
> It's more that how a lambda can only contain a single expression

That's exactly how lambdas (and all functions) work in actually functional languages like Haskell. And it's a good thing,lambdas shouldn't allow statements.

> how you can't pipe/chain things

Ironically after switching from Elixir to a language where I can have any operator I wish, I found myself using the equivalent of Elixir's |> only on a very rare occasion. IMO they're vastly overrated.

bPspGiJT8Y··on Elixir – Why the dot when calling anonymous functions?
Also worth mentioning Idris, although its tooling and ecosystem are still pretty much nonexistent.
bPspGiJT8Y··on Elixir – Why the dot when calling anonymous functions?
> Any high-level language that is afraid of map/reduce and other functional constructs is a waste of time to me

Elixir is afraid of most "functional concepts".

bPspGiJT8Y··on Error Handling in Zig
> no chance of forgetting to check the error

I remember a similar discussion here a couple months ago and some guy linking numerous open bug reports in Docker's repo with this very issue.

bPspGiJT8Y··on Ramda: A practical functional library for JavaScript programmers
From their page:

> Disclaimer. Teaching functional programming is out of scope of this project, so the documentation assumes you already know what FP is.

Personally, and some might disagree here, but I think you simply shouldn't use fp-ts before you have a solid experience with "real" FP languages, because any usage of this library is quite messy on its own (after all, JS simply wasn't created for this) and it's easy to create even more mess and get frustrated about it later on. It's also IMO a bit useless to try and teach it because in order to get a good grasp of the abstractions you'd have to practice them yourself and see how they help your real code, and it's something that's much harder to do in JS than in a language which has you covered. You'd rather start with Haskell or PureScript if you wish to learn more.

bPspGiJT8Y··on Why Python Is Terrible
The author of this article does highlight the cases where using Python didn't work out well for them, in fact multiple times.
bPspGiJT8Y··on Study finds billions of nanoplastics released when microwaving containers
Lab rats, I guess
bPspGiJT8Y··on Ten years of “Go: The good, the bad, and the meh”
> You really do want to specify types manually, at least at boundaries, e.g. in function definitions

I think PureScript has the best compromise here, top-level type signatures are not enforced but if you don't include one you'll get a warning with the inferred signature. On the one hand, this is very helpful because sometimes I have a grasp for what expression I want to use, but am not sure about its type, so I simply comment out the desired signature and let the compiler tell me which direction I'm moving in, i.e. what's the type of what I just wrote. On the other hand, it being a warning also basically ensures nobody writes their top-level functions without the type signatures. Really the best of the two worlds. I think simply disallowing top-level functions without type signatures would hurt my workflow a lot.

bPspGiJT8Y··on The Haskell job market has been growing steaily since 2008
Then why not just say that a monad (instance) is a type `t` which implements `bind :: t a -> (a -> t b) -> t b`? It's as down to earth and down to the point as it gets, and each time a new dev thinks out a code path which would lead to `t b` they'd remember `bind`. No need for containers metaphors at all.
bPspGiJT8Y··on Programming languages going above and beyond
That's because monads are way more general than promises. Explaining how to use Maybe to write total functions is just as easy as explaining promises, if not easier.
bPspGiJT8Y··on Writing prettier Haskell with Unicode syntax and Vim
I agree, in Kitty I'd have to hit C-S-u and then type fora... to get ∀. Good thing I can just type forall and the formatter replaces the keyword with the symbol for me :) Same for transforming othey symbols, like :: and =>, <=, ->, <- into single characters.
bPspGiJT8Y··on Google warns its own employees: Do not use code generated by Bard
> who are afraid of the legal risks to the monorepo

You're talking about a company which happily pays billions in fines because its just a fraction of what they otherwise manage to get away with. They're not at all afraid of doing a lot of illegal stuff, I find it highly unlikely they'd be afraid to step into a minor grey area.

bPspGiJT8Y··on From Stacks to Trees: A new aliasing model for Rust
It's definitely against the grain but also not really a lot of work. The currying function is ~3-4 lines. The macros are 5-10 lines each. As for examples of such things being used "in the wild", many use Witchcraft library which strives to give a Haskell-like experience to Elixir.

Yep, I have no dogs here either :^)

bPspGiJT8Y··on Why I'm Leaving Elm (2020)
Didn't really change anything. PureScript is in goood hands of the maintainers and contributors currently.
bPspGiJT8Y··on From Stacks to Trees: A new aliasing model for Rust
I do partial application in Elixir all the time. I have a function `curry/1` which takes any function and gives a curried version of it, and I have a `p` macro which introduces Scala-like "holes" (e.g. `(p Enum.map(list, _))`). The order of arguments still doesn't matter and nothing is broken or impossible because of it. I have also tweaked the (|>) macro (as well as some other operators) to support holes, so that I can "pipe" into whichever position of the call.

I think there are many more severe problems with Elixir which make it not even a remotely functional PL for me (rather, procedural + macros), but arguments order is not one of them.

bPspGiJT8Y··on From Stacks to Trees: A new aliasing model for Rust
It doesn't remove or break anything, it just changes the order of arguments to be compatible with Elixir's (|>) operator and consistent data-first design across the language.
bPspGiJT8Y··on Elixir and Rust is a good mix
Any errors these techniques could catch would have to happen during runtime, not at compile time, and this is a huge and key difference. In my experience having the type errors being caught at compile time is an incredible boost to productivity. I just write code then hit Ctrl+S and the compiler tells me what I got wrong, instead of all the hassle of having to write functions a line at a time, flip to IEx, run, inspect some intermediary value to make sure it works as intended, while trying to keep so many things in my head at once, which at times can be just overwhelming and highly frustrating.
← PreviousPage 2 of 2