chshersh, to programming

I published the May update for the Core Libraries Committee (CLC) ✍️

🆕 4 new proposals
✅ 3 approved
🚫1 declined
🔥 1 hot discussion
💎 5 featured discussions with a common theme

Check it out 👇

https://discourse.haskell.org/t/clc-update-may-2023/6248

The longest and the most exhausting discussion for me personally is around the 'base' split and GHC internal modules.

It feels (to me personally) that the discussion is just circling around the same topics with no progress, and it's becoming too difficult to steer it 😞

The most controversial discussion is about adding types like Int8, Int16, Int32, Int64, Word8, etc. to Prelude.

Many people want it but many also are tired.

https://github.com/haskell/core-libraries-committee/issues/156

DiazCarrete, to programming
@DiazCarrete@hachyderm.io avatar

Made a video about in which I give an example of the simplest possible Servant server.
🔗 📽️ https://youtu.be/YYmxAHWrFR4

RL_Dane, to rust
@RL_Dane@fosstodon.org avatar

Why is it that people's reaction to is either cult-level positive or Ted Cruz-level disgust?

I don't think I've heard more than a single person basically say, "Yeah, Rust is ok, but I like X better because Y." ;)

RL_Dane,
@RL_Dane@fosstodon.org avatar

@Deuchnord

I think the paradigm is pretty distant from Python and more traditional languages. I think someone comfortable with may be more comfortable with , but I've already said more than I know ;)

ParetoOptimalDev, to programming
@ParetoOptimalDev@mas.to avatar

Any users that store per-project history using ? Especially if it's for and . I don't expect there will be Haskell specific things... but who doesn't like a copy-paste solution 🙃 Any thoughts in general on per project histories with desktop-save-mode?

dgoldsmith, to programming
@dgoldsmith@mastodon.social avatar

One piece of advice I offer to younger software engineers (which means pretty much all software engineers, TBH) is to learn , even if you never write a line of production code in it. It will help you look at and attack problems in new ways.

https://haskellweekly.news/issue/366.html

rml, to random
@rml@functional.cafe avatar

"I tried , and something I noticed was that for any simple function, takes a moment to compile, which isn't acceptable for a "

Is this really the case?? Doesn't sound right at all.

and both feel faster than , for example.

https://www.youtube.com/watch?v=dCbTw9UOuS8

rml,
@rml@functional.cafe avatar

@nilmethod sbcl is generally faster than most schemes (but chez certainly gives it a run for its money), but and are incredibly fast in terms of start up and compile times. I read somewhere that chez bootstraps in about 2 minutes, for example (I think took over 20 minutes when it was the implementation language).

hungryjoe, to programming
@hungryjoe@functional.cafe avatar

Does anyone have a favourite intro to FFI in ? I've read the stuff on wiki.haskell.org, and the docs for the FFI language extension, but I think I'd benefit from something a bit more opinionated? Maybe a tutorial, ideally using Stack?

Also does the warning about using capi over ccall still agree with received wisdom?

haskman, to programming
@haskman@functional.cafe avatar

is almost the perfect replacement. Not only for the things it brings to the table, but also for the things it does not.

I mean actual features missing from PureScript and not gotchas like no historical baggage!

Some examples below. All of them are good for simplicity and newbie friendliness!

  1. No laziness.

Laziness makes it harder to reason about performance. There are easy workarounds for most common usecases for laziness, and employing clever laziness tricks is usually not worth the cost of complicating the codebase.

Also, you can approximate thunks with functions when needed. Typeclass trickery even allows call-by-name evaluation (see https://github.com/natefaubion/purescript-call-by-name).

  1. Manual recursion is discouraged.

PureScript's TCO only works in special cases. Normally you wouldn't even need to deal with this because existing implementations of functions like map, foldr etc. are already tail recursion safe. For the rare cases when you need to manually recurse, you can use tailRec and tailRecM to ensure stack safety.

  1. No special syntax or support for linked lists. Strings are not simply lists of chars.

This could potentially be put in the "no historical baggage" category. But I feel that a lot of people, especially newbies, view the special treatment of lists and strings as a plus for Haskell.

However, the focus on lists causes massive confusion for newbies when they are encouraged to use types like Vector and Text in production instead. The special inbuilt syntax also is an active impediment for learning (for example, how do you refer to the higher kinded List type when deriving an instance? It's a mental leap to get to [] in instance Foo [] where).

  1. No special syntax for Tuples.

Much of what was said for lists also applies to tuples. The special syntax is confusing to newbies and causes code complications. For example, each length of tuple is a separate type, and typeclasses in Haskell need to derive instances for each separately. They usually derive instances for tuples only up to length 7.

In addition, it's rarely needed. I am yet to find a usecase for tuples where PureScript's wonderful support for records doesn't suffice. I thought one such usecase was case matching on multiple values (case (v1, v2) of ...), but PureScript supports multi case match for this exact usecase and avoids unnecessary boxing (In PureScript you would write case v1, v2 of ...).

rml, to random
@rml@functional.cafe avatar

McCarthy is like the of , while Sussman & Ableson are his & Engels.

"Means of abstraction", "means of combination"... substitute the dialectical method with the substitution method...

...they were brewing up a revolution, and they knew good & well what they were scheming.

rml,
@rml@functional.cafe avatar

@mousebot but here, I'll give it a shot based on vibes

Plato: (the Idea of the Good, proto-Maoist non-conformists)
Aristotle: #C (arch reactionary)
Duns Scotus: (simple brittle concepts but with plenty of haecceity)
Spinoza: (OG that everyone thinks is fresh bcs its dynamic)
Descartes: (ghost in the machine)
Kant: (critique of Pure C)
Hegel: (the absolute Idea as self-reflective system)
Nietzsche: (the primacy of appearances)
Marx/Lenin: (self-explanatory)
Freud: (not phil, but rather the original debugger for all the problems of phil)
Heidegger: (the anti-technology technologist's lang of choice)
Wittgenstein: (all there is are the facts)
Stalin: (forces you to do things "correctly" even when its neither the best option for the situation nor the most performant; the extreme ML)
Lacan: (meta-debugging, non-linear retroactive causality of the signifier, on top of gdb)
Deleuze: (thinks programming should be art, thinks art is about infinite flows, elaboration of Nietzsche)
Federici: (super witchey)
Derrida: (theres nothing outside the text)
Malabou: (everything is neurobiological including language itself)
Badiou: (the generic is the Idea of the Good)
Butler: (the new generation of Kantians doing things right, performatively)

jbzfn, to programming
@jbzfn@mastodon.social avatar
6d03, to random
@6d03@mathstodon.xyz avatar

I feel like I shouldn't be this proud of it, but I just wrote a recursive descent parser from scratch in one go in C and debugged a small problem (off by one error of course) using gdb; all in under half an hour.

6d03,
@6d03@mathstodon.xyz avatar

@clementd They certainly are extremely handy. And apparently these people have even found a way to make them extremely performant, i.e., only about 50% slower than a bison generated parser: https://dl.acm.org/doi/epdf/10.1145/3409002

faassen, to programming
@faassen@fosstodon.org avatar

Programming language communities are interesting and affect your experience. A little thread.

1/6

faassen,
@faassen@fosstodon.org avatar

I didn't do with Haskell much but the attitude around tooling there reminds me a bit of Python about 15 years ago. Tooling existed but if it fails you get 3 different answers, some involving "just write your own solution". (And now with Python we do have too many solutions...)

Has very smart ideas though has trouble moving away from academia.
Its trajectory hasn't been that of Python.

4/6

xameer, to programming

The List Monoid
class Monoid m where
mempty :: m
mappend :: m -> m -> m
instance Monoid [a] where
mempty = []
mappend = (++)

https://people.cs.kuleuven.be/~tom.schrijvers/Research/talks/lhug4.pdf

haskman, to programming
@haskman@functional.cafe avatar

So I have a few thoughts on why Haskell is not more popular.

Haskell sort of dropped the ball by not being more user friendly. This is not about "keeping Haskell simple" - I like the fancy types and advanced features in Haskell and I wish it would get more such features - this is specifically about the community and the new user onboarding experience and how to fix it.

The problem is two fold -

1/n

https://functional.cafe/@haskman/110263531801953025

jbzfn, to programming
@jbzfn@mastodon.social avatar

「 It’s true that if you’re managing a software project the choice of tools does matter, but this choice pales in comparison to the following simpler ways to mitigate risk:

Offset the risk using as many legal and insurance instruments possible.

Having a highly liquid talent pool.

Factoring software failures into the expectations and economics of projects.

Ability to restart the project with different assumptions and team if it all goes awry 」
— Stephen Diehl https://www.stephendiehl.com/posts/marketing.html

Jose_A_Alonso, to programming
@Jose_A_Alonso@mathstodon.xyz avatar

Make invalid states representable. (We should model the state of a system using algebraic types and include states that are invalid). ~ Chris Martin (@chris__martin). https://typeclasses.substack.com/p/make-invalid-states-representable

nomeata, to programming
@nomeata@mastodon.online avatar

Thinking more about ways to get a build of the compiler GHC:
https://www.joachim-breitner.de/blog/802-More_thoughts_on_a_bootstrappable_GHC
(and hoping that someone else either has better ideas, or more stamina, to pull this through.)

chris__martin, to programming
@chris__martin@functional.cafe avatar

I've long thought that the popular wisdom here was a little backwards, finally wrote something about it: https://typeclasses.substack.com/p/make-invalid-states-representable

anderseknert, to programming
@anderseknert@hachyderm.io avatar

Learning a language that challenges your notion of what programming is might be one of the most rewarding things once it "clicks" and you start seeing the bigger picture. Whether that's , , , or whatnot — doesn't really matter. They're systematic, and when you see the system, that's empowering.

nomeata, to programming
@nomeata@mastodon.online avatar

I’m (experimentally) extending the hs-all-in-one tool to munge the whole GHC source code into a single module. I now have a 680k loc, 41MB file. Doesn’t work yet, still fighting the renamer.

Initial motivation is GHC, picking up thoughts from <https://www.joachim-breitner.de/blog/748-Thoughts_on_bootstrapping_GHC>.
The most viable boostrappable Haskell compiler is Hugs (written in C) but doesn’t support recursive modules. So maybe if all of GHC is one module it could handle it…

jbzfn, to programming
@jbzfn@mastodon.social avatar

「 As the name suggests, with purely functional programming, the developer can write only pure functions, which, by definition, cannot have side effects. With this one restriction, you increase stability, open the door to compiler optimizations, and end up with code that’s far easier to reason about 」
— IEEE Spectrum


https://spectrum.ieee.org/functional-programming

ramin_hal9001, to programming
@ramin_hal9001@emacs.ch avatar

Interview with Simon Peyton Jones, maintainer of the Glasgow Haskell Compiler (GHC), and has been hired recently by Epic Games to develop a new Haskell-inspired programming language called "Verse".
https://www.youtube.com/watch?v=fBFsxmJEk7M

racketlang, to programming

The Hackett Programming Language

by Alexis King

“Hackett is a statically typed, pure, lazy, functional programming language in the Racket language ecosystem. Despite significant differences from racket, Hackett shares its S-expression syntax and powerful, hygienic macro system. Unlike Typed Racket, Hackett is not gradually typed—it is designed with typed programs in mind, and it does not have any dynamically-typed counterpart.” - https://lexi-lambda.github.io/hackett/

redmp, to programming

@jmct challenge accepted

ramin_hal9001, to programming
@ramin_hal9001@emacs.ch avatar

I've been learning about Delimited Continuations lately, because I have recently learned that several programming language theory heavyweights, including Oleg Kiselyov, now believe the classic continuation control construct, e.g. "call/cc" in the language, were big mistake that make program optimization needlessly difficult, though I don't fully understand why this would be the case. Unfortunately, "call/cc" is encoded in the Scheme language standard, so compiler authors need to come up with work-arrounds -- who knew at the time of the first revision (1975) it would be a bad idea?

Delimited Continuations solve the problems inherent in continuations (again, I don't understand why), and are composable, meaning it is easy to write modular pieces of code using continuations in isolation that can all be made to fit nicely together with a few simple high-order functions.

So fortunately for me, there is already a good implementation, so I can probably figure it all out by just reading the code and studying the type definitions: https://hackage.haskell.org/package/CC-delcont

Here is the research paper by R. Kent Dybvig, Simon Peyton Jones, and Amr Sabry describing the implementation: https://legacy.cs.indiana.edu/~sabry/papers/monadicDC.pdf

Here is a primer on Delimited Continuations which I found helpful: https://gist.githubusercontent.com/sebfisch/2235780/raw/c1d9340e26fcf8b334d994c173d9c26fa8f4129f/gistfile1.md

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

@rml
> " actually implements delimited continuations as slices of the runtime stack now, similarly to

Yes, I know, GHC and Guile are both amazing! I had run across the delimited control primitives in the Guile manual not long ago: https://www.gnu.org/software/guile/manual/html_node/Prompt-Primitives.html

I had also heard Alexis King give a presentation, who if you don't know is a brilliant young computer scientists who implemented an S-Expression based embedded in called "Hackett" , who was talking about using delimited continuations to improve the performance of Free Monads and the "Monadic Effects" libraries built on top of them. She mentioned that the GHC runtime already provides delimited control primitives.
https://www.youtube.com/watch?v=0jI-AlWEwYI

Incidentally, here is Alexis King's StrangeLoop presentation on Hackett: https://thestrangeloop.com/2018/hackett-a-metaprogrammable-haskell.html

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • magazineikmin
  • modclub
  • khanakhh
  • Youngstown
  • rosin
  • mdbf
  • slotface
  • Durango
  • ngwrru68w68
  • thenastyranch
  • kavyap
  • DreamBathrooms
  • JUstTest
  • cubers
  • osvaldo12
  • Leos
  • anitta
  • everett
  • ethstaker
  • GTA5RPClips
  • tester
  • cisconetworking
  • megavids
  • tacticalgear
  • normalnudes
  • lostlight
  • All magazines