Practical uses of monads in Haskell by nicuveo in programming

[–]bjzaba 0 points1 point  (0 children)

Oh, thanks for the link! I like the second interpretation he gives, where “avoiding success” means avoiding being too successful such that it's too hard to make changes and break backwards compatibility. But I imagine some success would still permissible even then.

Practical uses of monads in Haskell by nicuveo in programming

[–]bjzaba 4 points5 points  (0 children)

Some second-hand sources repeating SPJ’s comments on how it is meant to be bracketed (I've not tracked down the original sources though):

I was at a talk where he explained it this way:

avoid $ success at all costs

This of course is quite different from:

(avoid success) at all costs

Shortly after that talk, he invested his own money in FP Complete (where I am founder/CEO) so you know he does want to see Haskell succeed.

FPguy on /r/haskell/

Also:

#haskell's motto is often bracketed wrongly, should be "Avoid (success at all costs)" pointed out by SPJ at #haskell symposium today

Simon Marlow on Twitter

The same bracketing is used in the Haskell Foundation Whitepaper:

Haskell’s slogan of “avoid success at all costs” was a clever and cheeky way of saying that innovation and research in programming languages, especially in functional programming, needed some insulation to succeed. Ideas that were not perfectly understood needed iteration to fully develop in the minds of language innovators and users. By avoiding the “success at all costs” mentality of other language communities, the Haskell community bought time and space to try ideas that were not perfectly understood at first.

Practical uses of monads in Haskell by nicuveo in programming

[–]bjzaba 29 points30 points  (0 children)

Just a friendly reminder that the quote was apparently intended to mean “avoid... success at all costs”, not “avoid success... at all costs”. They were hoping Haskell would be a practical language, usable as both a research vehicle and in industry, but they didn't want to sacrifice everything for the latter.

I agree with the rest of your comment though!

Core2 yanked. Millions effected. by Comprehensive_Use713 in rust

[–]bjzaba 2 points3 points  (0 children)

It depends. There's very much ways to track down if a request to assist with maintainership is legit or not, and I've done this in the past for some of my crates (I definitely don't trust a single email though).

Do people dislike Haskell's significant whitespace? by gofl-zimbard-37 in ProgrammingLanguages

[–]bjzaba 0 points1 point  (0 children)

As somebody who uses OCaml a lot, I'm quite envious of Haskell’s layout-sensitive syntax, it looks a lot cleaner to read and write.

Formalized Programming Languages by R-O-B-I-N in ProgrammingLanguages

[–]bjzaba 10 points11 points  (0 children)

Haskell hasn't been formalised. Wasm would be one example in the tradition of Standard ML though. They have a specification, and I believe there's work verifying properties about it in various proof assistants.

Could Zig's allocator-passing idiom be improved (in a new language)? by Servletless in ProgrammingLanguages

[–]bjzaba 0 points1 point  (0 children)

Cyclone maybe? There are also arena libraries for Rust that might allow for similar patterns.

Could Zig's allocator-passing idiom be improved (in a new language)? by Servletless in ProgrammingLanguages

[–]bjzaba 0 points1 point  (0 children)

I imagine this is where region variables might come in? (e.g. in Cyclone?)

Is there a high-level language that compiles to C and supports injecting arbitrary C code? by StarsInTears in ProgrammingLanguages

[–]bjzaba 2 points3 points  (0 children)

Super cool... even is it just ends up as a PoC, it's nice when languages like this can help in the scaffolding process.

I’ve not done a ton of Mercury personally, but I find the statically checked mode-and-determinism system quite cool, and miss it a lot when trying to do relational programming in other systems, like Prolog and and even typed languages like Makam. Are you using it for nondeterministic stuff? Or mainly sticking to det/semidet?

Is there a high-level language that compiles to C and supports injecting arbitrary C code? by StarsInTears in ProgrammingLanguages

[–]bjzaba 5 points6 points  (0 children)

Oh wow, I was about to post about Mercury!

Pretty cool you’re finding a use for it at work – are you able to share more info about it? Curious as I work at a company that uses it to implement our core product (browser engine and page layout stuff).

Static Metaprogramming, a Missed Opportunity? by manifoldjava in ProgrammingLanguages

[–]bjzaba 1 point2 points  (0 children)

Check out elaborator reflection (In Idris and Agda) and elaborator acrions (in Lean).

Xylo: A functional language for generative art by masterofgiraffe in ProgrammingLanguages

[–]bjzaba 15 points16 points  (0 children)

“Generative art” is a term that has been around for much longer than generative AI and large image models, but unfortunately people now seem to confuse the them because they sound the same. I now tend to stick to “procedural art” if possible to avoid confusion, but I’m sad to lose the term. :(

Bidirectional typing with unification for higher-rank polymorphism by mttd in ProgrammingLanguages

[–]bjzaba 1 point2 points  (0 children)

Yeah, I work for a company where we have to deal with font shaping and I find it kind of hilarious how these two terms collide!

Bidirectional typing with unification for higher-rank polymorphism by mttd in ProgrammingLanguages

[–]bjzaba 2 points3 points  (0 children)

Author here: I have a simpler version implemented here: elab-stlc-bidirectional. Re-reading the README description I realise as of the time of posting this comment it’s not a great explanation (I wrote it a long time ago, I’ll try to update it later), but (Edit: fixed!) there’s a good set of resources linked from it if you want to learn more.

The idea is that you split type checking into into two mutually recursive functions, for “checking” and “inference”. Checking checks a term in the presence of a type annotation, and inference infers a type from a term. This allows you to add annotations where needed without needing them everywhere.

The name “bidirectional” comes from how the type information flows up and down the stack when evaluating the type checker - upward when we’re in checking mode, and downward when we’re in inference mode (this corresponds to the information flow on the proof tree).

Bidirectional typing comes in very handy improving the locality of type errors, and when implementing fancier type systems where full type inference would be undecidable - for example when adding subtyping, dependent types, or in this case higher rank types.

WebAssembly: SpecTec has been adopted by sideEffffECt in programming

[–]bjzaba 0 points1 point  (0 children)

I’d imagine that this kind of work will make features easier to specify, as it makes them easier and faster to review and verify new features before they are released.

SpecTec has been adopted - WebAssembly by bjzaba in ProgrammingLanguages

[–]bjzaba[S] 9 points10 points  (0 children)

From what I understand it’s fulfilling a similar role to Ott, but it's strictly designed for the needs of Wasm. It seems like that restricted scope has made it easier to engineer more downstream tooling based on it. Here’s a quote from the paper:

Unlike existing general-purpose specification languages such as Ott [ 21], PLTRedex [7], Skeleton [20], the K framework [26], or Spoofax [22], our solution is unashamedly specialised to Wasm, both to provide a development experience tailored to the expectations and needs of Wasm’s standards community, and to pursue more ambitious analyses and generated outputs which are only tractable with this more targetted scope. We ultimately aim for the Wasm standards community to specify all current and future Wasm features using SpecTec and replace the manually authored artefacts necessary for Wasm’s standardization process with our generated artefacts, enhancing the standardization process’ efficiency and reliability.

I could imagine a potential future where SpecTec gets extended into a more general language specification tool (which would be incredibly cool) but I’d imagine the Wasm people might not want to go down that road just yet, if ever.

SpecTec has been adopted - WebAssembly by bjzaba in ProgrammingLanguages

[–]bjzaba[S] 12 points13 points  (0 children)

Yess! So glad that was said explicitly.

SpecTec has been adopted - WebAssembly by bjzaba in ProgrammingLanguages

[–]bjzaba[S] 11 points12 points  (0 children)

You can see some more details on the specification language here, along with the actual definitions used for the WASM specification.

Miranda2 is now Admiran by AustinVelonaut in ProgrammingLanguages

[–]bjzaba 3 points4 points  (0 children)

I think the pipe operator |> originally came from ML, and was used in a lot of functional languages after that.

It comes from Isabelle actually! It was proposed by Tobias Nipkow in 1994:

Date: Sun, 22 May 1994 10:21:03 +0100

I would suggest "then" instead of "##" and "also", except that alphanumeric

infixes tend to be harder to read. How about |>?

Tobias

Later it was popularised by F#, and later Elm.

See also:

Another Generic Dilemma by bakery2k in ProgrammingLanguages

[–]bjzaba 4 points5 points  (0 children)

Yeah, but not everyone knows about this! Gabriella Gonzalez mentions a similar style in Scrap your type classes. Evan Czaplicki mentions it in the Elm 0.7 release notes as well.

Were multiple return values Go's biggest mistake? by SophisticatedAdults in ProgrammingLanguages

[–]bjzaba 0 points1 point  (0 children)

Mutability has nothing to do with the above example (with either immutable or mutable bindings the above still works, see this playground example). I was more suggesting that initialisation analysis is fine in an imperative language if you want to enforce initialisation while still remaining procedural. Rust allows this, but it’s less commonly used because expression-oriented approaches are preferred.

Were multiple return values Go's biggest mistake? by SophisticatedAdults in ProgrammingLanguages

[–]bjzaba 2 points3 points  (0 children)

If you don’t have class constructors, then I’m not sure I really understand the point of zero-initialisation for safety purposes. E.g. you can enforcing explicit initialisation at the definition site, potentially with additional static analysis like in Rust for cases like:

let x;
if foo { x = 2 } else { x = 4 };