r/functionalprogramming

Functional Programming in VBA
▲ 16 r/functionalprogramming+1 crossposts

Functional Programming in VBA

Hello There,

a feature i wish VBA had was a way to write in a functional programming paradigm.

Since this is not the case i tried to at least provide First Class Functions with the ability to bind arguments to it.

I know that someone already did something like that but i just cannot for the live of me find it.

So i made my own:

Almesi/VBFP: Visual Basic Functional Programming

Does anyone have Input on it?

Anything i should add or redo in a different, more robust way?

I would love to implement immutability after creation but i dont know how while still being able to create it with a constructor.

u/Almesii — 1 day ago
▲ 199 r/functionalprogramming+1 crossposts

A Preview of Roc 0.1.0 by Richard Feldman

Roc’s first numbered release, 0.1.0, is on the horizon. This talk previews what we’re aiming to include, the key language and tooling milestones needed to get there, and what the release will mean for people interested in trying, using, or contributing to Roc.

youtu.be
u/MagnusSedlacek — 7 days ago

leetcoding in python all day after writing mostly scala for years felt like writing assembly

& my brain hurts

i feel like i became 68% more like a mentat from the Dune series on a spiritual level

like the imperative style mental memory does come back, but at what cost

no wonder people want to automate code writing so much

i swear to god if i have to solve one more off by one error i will throw my laptop into the river

if this comes off as pretentious, i do not mean it

that is all, just wanted to document this experience

reddit.com
u/revivechristina — 9 days ago
▲ 22 r/functionalprogramming+1 crossposts

"How hard could it be?" - a younger me said that once. Here's my lang

I’ve been working on a dependently typed language called Yap for a while now, and I’m at the point where I’m happy enough with the direction to show it around, even though building a compiler can apparently consume years of your life and still find new ways of being utterly broken.

The playground is here: https://try-yap-next.fly.dev

And the code is here: https://github.com/tiansivive/yap

This behemoth currently has dependent types, structural row types, dependent records on those rows, implicits, liquid-style refinements, and shift/reset. A lot of that genuinely works and it's beautifully cathartic; it also just works insofar as I've conveniently ignored all the potential complications and am blissfully living in my own happy path.

The current pipeline is roughly:

parser -> bidir elaboration + NbE + first-order unification -> Core-> IVL + custom CDCL(T) verification -> GRAM -> MIR -> JS/C/Erlang

Over the past seven months I’ve spent a lot of time on GRAM: the Graph Rewriting Abstract Machine. It’s a property-graph IR for selective compilation, with a bit of MLIR inspiration. Rather than lowering once into one fixed representation, passes enrich the graph with semantic and operational structure. So far that includes eta reduction, saturation and partial applications, closure conversion, Maranget pattern compilation, and shift/reset lowering. Target code generators can then select the enrichments they need.
That graph is probably as far as I want the compiler proper to go; MIR (Mid-level IR) is a more SSA-ish bridge after it, currently very dumb and simple and just useful for experimenting and feeding three deliberately simple code generators.

I’m currently chasing meta-variable state through modules and lowering, working toward real type erasure, making verification verdicts less cryptic, and replacing “well, the snapshot changed” with meaningful tests

The next larger problems are QTT-style usage semantics, coinduction over rows and figuring out how shift/reset should actually be typed, which includes deciding whether effects will make this language cleaner or turn it into a big bog of doom.

Six months ago, before shift/reset and the current lowering path, it was probably easier to demo. I’m much happier with the design now, though. There is still a frankly unreasonable amount left to build, but that seems to be the job.

Just wanted to share!

Edit: typo and duplicate sentences

reddit.com
u/rantingpug — 13 days ago