Learn physics with functional programming. ~ Esteban Marin. https://youtu.be/Zp5D_wMi97Q #Haskell #FunctionalProgramming #Physics
Learn physics with functional programming. ~ Esteban Marin. https://youtu.be/Zp5D_wMi97Q #Haskell #FunctionalProgramming #Physics
#Pocket is dying so it's appropriate to talk about the minimal #ReadLater service I wrote for myself: LinkFodder.
You can save links via an API, or a form, or a Telegram bot, and you get an HTML page (shown below) and an Atom #feed. That’s it.
Supports multiple users, written in #Haskell, deployable as a single binary (or a Docker image) behind the reverse-proxy server of your choice in your #SelfHosting setup.
It doesn't even need a database to run; it simply rewrites the HTML and Atom files when you save a new link.
@jenniferplusplus @lunarood Oh, I thought it was about #Haskell .
Isn't this mainly a problem from the (main) compiler(s) not having a stable ABI? Or is it deeper than that?
I can certainly understand not trying to match the "C ABI", but it would be nice if we didn't have to update (almost) every Haskell package in #Debian in lock-step.
@das_g True. It is certainly magical that there is a programming language which defines a state monad called “IO” (or sometimes “Effect”) which carries around with it a symbol of the entire Real World in order to model the idea that any evaluation of a function of that type of monad may (or may not) create a change somewhere out in the real world, as opposed to “pure” functions which can only ever manipulate the stack.
The Real World is deeply magical.
(Or at least type RealWorld is, according to #Haskell documentation.)
https://hackage.haskell.org/package/base/docs/Control-Monad-ST.html#t:RealWorld
@profoundlynerdy just because something has types doesn’t make it Haskell-like. Haskell’s type system is in the family of Lambda Calculii (the “Lambda Cube”) which is called “System-F”.
I don’t know much about Raku, but it seems to me to me to be a bit more similar to TypeScript. And what differentiates TypeScript from other languages: it takes a horrible programming language like JavaScript and makes it less bad by giving it a type system, likewise Raku makes Perl less bad in the exact same way. (Sorry, I’m not trying to be impolite, but JavaScript and Perl are objectively, truly awful, horrible programming languages.)
So I see both Raku and TypeScript only being useful to a company buried in the technical debt of a hugely profitable production application that was very unwisely written in a dynamically typed language (Perl or JavaScript), which then unfortunately grew to millions of lines of code, and now it can’t be maintained by anyone, and it could never possibly be rewritten from the ground-up in a good programming language like Haskell for any reasonable sum of money. So Raku and TypeScript both offer a half-measure solution to that problem: make the maintenance of horrible computer code a bit easier with a type system.
Haskell was never intended as a fix for horrible code, it took a really good experimental programming language called Miranda and turned it into something that you can use to do real, practical software engineering, and it does it better than any other language ever invented. You write a system in Haskell because you know up front that you want it to be stable and maintained in a cost-effective manner for decades.
Zig is not similar to Raku or Haskell. It is more analogous to what Scala does for Java. Java is already statically typed, but Scala’s type system is better, and it’s runtime is fully compatible with Java. Likewise, Zig is fully compatible with the C language runtime, but provides a slightly different, slightly better static type checking system than the C type system. Zig also solves a bunch of other problems that C has by providing it with modern features like namespaces and modules, which makes it much easier to use than C. Zig is the perfect way to replace old C code with something more modern, but only if you don’t need it to be as rigorously correct as Rust. I think Zig would be a nice language to use to replace non-safety-critical front-end libraries like Gtk, or maybe for things like game engines.
Why is #Rakulang seemingly so underappreciated?
#Ziglang and #Haskell seem to outpace Raku's adoption curve. I say that as a fan of all three languages, I'm not casting shade. One is new and the other is niche, but they both seem to me good comparisons to Raku. Just look at the sizes of each language's subreddit to get a sense of respective community size.
If those are bad comparisons, I'm open to alternatives and polite discussion.
A classic article that makes me wish Go had a proper type system
Made the mistake of reading HN comments about Firefox "moving" to GitHub, and remembered this sage advice -
> Vidrun, born of the sea-wind through the spruce
> Vidrun, green-tinged offshoot of my bough, joy and burden of my life
> Vidrun, fierce and clever, may our clan’s wisdom be yours:
> Never read Hacker News
From this hilarious post -
https://aphyr.com/posts/341-hexing-the-technical-interview
...of this hilarious "Technical Interview" series -
https://aphyr.com/tags/interviews
I've just done a couple of #haskell exercises where the solution needed the following compositions
(pure . pure)
(fmap . fmap)
(liftA2 . liftA2)
Apart from the first one, my brain finds it difficult to establish an intuitive understanding of them.
I can't say "oh of course I know what it does"
My question is - do most haskell / functional programmers find this difficult or is it just me?
I'm feeling really stupid re #haskell
my solution to the exercise passes the mooc tests but it is really ugly
is there a more elegant idiomatic way to do this?
in essence I'm finding it hard to 'pass values" through different contexts like Maybe, Either, Validation
(code is also alt text in image)
@mattgemmell that's what makes #elisp. you become more tolerant because everything is possible and ok. You're often just happy with an elisp-changed brain. You can only top it with #haskell as an addon. †hen you found #tao.
#haskell question
An exercise wants me to write a function(s) such that it is interactive in ghci eg
> inc, status <- myfunction
>
> inc
> inc
> status
2
so I'm thinking about what inc and status are
* state must be held in myfunction - there's nowhere else for it to go
* inc updates the state
* status reads it
* so my function acts like a State Monad, or is an IO Monad a better fit?
* inc and status are related to myfunction by means of instance declaration ? Not sure.
Malware is harder to find when written in obscure languages
Miscreants warming to Delphi, Haskell, and the like to evade detection. Malware authors looking to evade analysis are turning to less popular programming languages like Delphi or Haskell.
https://www.theregister.com/2025/03/29/malware_obscure_languages/
How to control #superintelligence ?
IIUC, the approach here is to use provable languages like #Haskell to ensure the model does only the things you want and provably cannot do Bad Things.
How to deal with the required insanely large logic proofs? OFC, use #AI for that!
I'm missing something. What exact program do you want the machine to prove? Programs that the LLM writes? Or the LLM itself? Surely the latter is computationally intractable...?
@easwatch #SevereWeather #OKwx #EAS #WEA for #Haskell, #OK; #Le Flore, #OK; #Sequoyah, #OK: National Weather Service: #TORNADO WARNING in this area until 1:45 PM CDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media. Source: NWS Tulsa OK ** DO NOT RELY ON THIS FEED FOR LIFE SAFETY, SEEK OUT OFFICIAL SOURCES ***
@easwatch #SevereWeather #OKwx #EAS #WEA for #Haskell, #OK; #Sequoyah, #OK: National Weather Service: #TORNADO WARNING in this area until 1:30 PM CDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media. Source: NWS Tulsa OK ** DO NOT RELY ON THIS FEED FOR LIFE SAFETY, SEEK OUT OFFICIAL SOURCES ***
@easwatch #SevereWeather #OKwx #EAS #WEA for #Haskell, #OK: National Weather Service: #TORNADO WARNING in this area until 12:45 PM CDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media. Source: NWS Tulsa OK ** DO NOT RELY ON THIS FEED FOR LIFE SAFETY, SEEK OUT OFFICIAL SOURCES ***