Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

brokenix, to Lisp

This is a machine for network protocols. Initially in pursuit of a social forum focused on link sharing.
as and free projects alike rush to implement some RFC adding only 'but on the web'. I aim to define a modular protocol server which can support an arbitrary number of network protocols as a network daemon. Our POC in this endeavour will be to build an -like protocol daemon which gateways to storage. The content held in this system can be consumed by arbitrary clients; a web application presenting -like services would be just one of many potential clients, although it is likely that Gnus for Emacs will be the first one.
https://codeberg.org/fade/callisto

brokenix, to haskell

quoting @prophet
mli files are mostly used to constrain the visibility of definitions whereas hs-boot files are about allowing mutual recursion between modules (which OCaml doesn't support, even with mli files!)
But the mechanism by which they achieve their goals is nearly identical even though the perception of it is so vastly different.

I guess the conclusion to draw from this is that both sides are wrong: IMO, mli files are not nearly as good as OCamlers think they are, but hs-boot files aren't as ugly as Haskellers think either.
-- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot
-- files. See Note [Definition of CallStack]

Backpack's design is primarily driven by compatibility considerations (“how do we build upon GHC's existing foundation?”), rather than elegance. In particular, Backpack doesn't eliminate those ugly .hs-boot files, it just automates and hides their generation and processing.

For all their faults, Standard ML and OCaml have pretty good support for modular programming. And, as the Modular Type Classes paper you linked shows, type classes can be built elegantly on top of a good modular foundation.

https://cohost.org/prophet/post/3251638-it-s-really-interest
https://haskell.fi.muni.cz/doc/base/src/GHC-Exception.html
https://twitter.com/lexi_lambda/status/1172629363730333697
https://news.ycombinator.com/item?id=11371130

sgraf,
@sgraf@mastodon.online avatar
brokenix, to random

Endlessh is an tarpit that very slowly sends an endless, random SSH banner. It keeps SSH clients locked up for hours or even days at a time. The purpose is to put your real SSH server on another port and then let the script kiddies get stuck in this tarpit instead of bothering a real server.
https://github.com/skeeto/endlessh

brokenix, to random

> you mostly model data with sum types, which in my mind are the best way to model data

True its quite strict in Haskell though
https://blog.darklang.com/leaving-ocaml/

boarders,
@boarders@mathstodon.xyz avatar

@oantolin @brokenix they are not meaning sum types as opposed to product types but just commenting on how most languages don’t have sum types so you have to use some other way to encode data with tags or class hierarchies or etc.

oantolin,
@oantolin@mathstodon.xyz avatar

@boarders @brokenix It does seem possible that's what was meant.

brokenix, to random

Reason Town: Elm to , Technical Debt, and Escape Hatches with Paul Biggar
Speaking of which , now that @codyroux has related diagonalisation to p = np ( which either idk or I don't recall reading ), I got to follow up the whole series
Episode webpage: https://podcasters.spotify.com/pod/show/reason-town/episodes/Elm-to-OCaml--Technical-Debt--and-Escape-Hatches-with-Paul-Biggar-e52keq

Media file: https://anchor.fm/s/79070e8/podcast/play/4329370/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2019-7-23%2F21544635-44100-2-c1b9431e68ec7.mp3

brokenix, to haskell

pseq combinator is used for sequencing; informally, it eval-
uates its first argument to weak-head normal form, and then eval-
uates its second argument, returning the value of its second argu-
ment. Consider this definition of parMap:
parMap f [] = []
parMap f (x:xs) = y ‘par‘ (ys ‘pseq‘ y:ys)
where y = f x
ys = parMap f xs
The intention here is to spark the evaluation of f x, and then
evaluate parMap f xs, before returning the new list y:ys. The
programmer is hoping to express an ordering of the evaluation: first
spark y, then evaluate ys.
The obvious question is this: why not use ’s built-in seq
operator instead of pseq? The only guarantee made by seq is that
it is strict in both arguments; that is, seq a ⊥ = ⊥ and seq ⊥
a = ⊥. But this semantic property makes no operational guaran-
tee about order of evaluation. An implementation could impose this
operational guarantee on seq, but that turns out to limit the optimi-
sations that can be applied when the programmer only cares about
the semantic behaviour. Instead, we provide both pseq and seq
(with and without an order-of-evaluation guarantee), to allow the
programmer to say what she wants while leaving the compiler with
as much scope for optimisation as possible.
https://simonmar.github.io/bib/papers/multicore-ghc.pdf

sgraf,
@sgraf@mastodon.online avatar

@brokenix ironically, the implementation of pseq is broken today https://gitlab.haskell.org/ghc/ghc/-/issues/23233 and probably has been broken since inception

brokenix, to FunctionalProgramming

Implement web servers using lenses
dependent types
https://github.com/ska80/idris2-server?tab=readme-ov-file

brokenix, to haskell

fixpoint combinators like Y can't be well-typed in . Specifically, something of the form x x requires x to have two conflicting types simultaneously. In dynamic languages, this doesn't matter because you just don't care what the type is, only that you can use the value in some way. But a Haskell compiler does care. However there's no need for such combinators, because Haskell's solution fix f = let x = f x in x is more elegant anyway, and has no typing difficulties (but does require lazy evaluation).
is perhaps not the best launchpad to haskell , to their credit they make good fp presentations
https://stackoverflow.com/questions/68975627/translating-a-fixed-point-operator-to-haskell-language

joeyh,
@joeyh@hachyderm.io avatar

@brokenix No need for Y Combinator. Indeed.

brokenix, to random

A good strategy to go from a thesis to a typechecker #typetheory
https://spire-lang.org/blog/2014/01/05/an-unremarkable-type-checker/

brokenix, to random

ZFC includes an infinite axiom schema

boarders,
@boarders@mathstodon.xyz avatar

@brokenix how so?

brokenix, to microsoft

Even if you’re one of the “good devs,” and even if Copilot suddenly makes you twice as productive, as (dubiously) claims, your day didn’t just suddenly get half as long. You just suddenly got twice as many responsibilities
https://joshcollinsworth.com/blog/copilot

louis,
@louis@emacs.ch avatar

@brokenix Good post. We already see how GPTs are used to shrink down development teams leading to layoffs. Meaning, the remaining devs have much more work on their hand. Leading to a reduced quality of code, because GPTs still propose code full of errors and the mental load to fix these is much higher. Also, since our brains cannot be twice as fast, it will probably also lead to increased fatigue when I have to do double the work and constantly fight against an error-prone AI.

Where I found AI beneficial for my work as a solo contractor is that I have someone to "talk to" when I make design decisions and need some inspiration, or when I'm desperate in finding an algorithm that solves a problem which I did not encounter before. Or just to confirm that my solution is canonical.

So, as always with technology, it is a double-edged sword and it is up to management to understand the downsides to not overload their remaining devs. Microsoft's marketing is surely not helpful, but that is old news.

brokenix, to haskell

when you reverse a list in

aux_reverse [] out = out aux_reverse (x:xs) out = aux_reverse xs (x:out)<br></br>reverse l = aux_reverse l []<br></br>

does it keep the reference to the original list (using max space) ? ll do the same?

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@brokenix It will keep it until the next GC sweep, and that will keep it only if it is referenced elsewhere.

Of course laziness can complicate that a little bit -- but reducing reverse list to WHNF does release the closure's reference to list (and reverse).

brokenix, to haskell

What is beta reduced ( evaluated ) form of

(\1 - &gt; ( x- &gt; 1)) 2

where x is f abstraction and 1, 2 are literals

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@brokenix bottom :: Num b => a -> b, I think.

https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-260003.3 gives the result for a pattern-match failure on a lambda expression.

"I think" because your syntax is invalid, so I've given you the answer for (\1 -&gt; (\x -&gt; 1)) 2, which is, I think, the closest string (kpm edit distance) that is valid syntax.

brokenix, to random

This like testing for fp

brokenix,

@nil i cite my previous toot in my defense , also i didnt create this media :D
https://emacs.ch/@brokenix/111915508959693571

nil,
@nil@functional.cafe avatar

@brokenix afraid I can’t follow the arbitrary operator precedence rules. I kid, big Haskell fan, just a bigger lisp hierophant.

brokenix, to guix

the “Nix store” is independent of the “Nix language” (which we’ll define below). In other words, you could replace the front-end Nix programming language with another language (e.g. scheme, as does). This is because the Nix derivation format (the .drv files) and the nix-store command-line interface are both agnostic of the Nix expression language.

In isolation, the Nix language is “just” a purely functional programming language with simple language constructs.
Nixpkgs support for overrides is essentially an embedded domain-specific language, meaning that you still express everything in the Nix language (layer 1), but the ways in which you express things is fundamentally different than if you were simply using low-level Nix language features.
OS is based on the NixOS module system, which is yet another embedded domain-specific language. In other words, you configure with Nix code, but the idioms of that Nix code depart even more wildly from straightforward “layer 1” Nix code
https://www.haskellforall.com/2022/08/stop-calling-everything-nix.html?m=1

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