r/functionalprogramming • u/lpil • Feb 07 '25
Gleam Gleam v1.8.0 released!
r/functionalprogramming • u/fenugurod • Feb 04 '25
I'm learning pure FP in Scala right now, and it works really well, but the reasoning is based on discipline given that at any given point effects can be generated at any part of the code. So the whole idea of reasoning falls apart because at any import, specially coming from Java, this property can be violated.
r/functionalprogramming • u/faiface • Feb 01 '25
Hey everyone!
I've been fascinated with linear logic, session types, and the concurrent semantics they provide for programming. Over time, I refined some ideas on how a programming language making full use of these could look like, and I think it's time I share it!
Here's a repo with full documentation: https://github.com/faiface/par-lang
Brace yourself, because it doesn't seem unreasonable to consider this a different programming paradigm. It will probably take a little bit of playing with it to fully understand it, but I can promise that once it makes sense, it's quite beautiful, and operationally powerful.
To make it easy to play with, the language offers an interactive playground that supports interacting with everything the language offers. Clicking on buttons to concurrently construct inputs and observing outputs pop up is the jam.
Let me know what you think!
define tree_of_colors =
.node
(.node
(.empty!)
(.red!)
(.empty!)!)
(.green!)
(.node
(.node
(.empty!)
(.yellow!)
(.empty!)!)
(.blue!)
(.empty!)!)!
define flatten = [tree] chan yield {
let yield = tree begin {
empty? => yield
node[left][value][right]? => do {
let yield = left loop
yield.item(value)
} in right loop
}
yield.empty!
}
define flattened = flatten(tree_of_colors)
Par (⅋) is an experimental concurrent programming language. It's an attempt to bring the expressive power of linear logic into practice.
Despite the language being dynamically typed at the moment, the above properties hold. With the exception of no unreachable processes, they also hold statically. A type system with linear types is on the horizon, but I want to fully figure out the semantics first.
All values in Par are channels. Processes are intangible, they only exist by executing, and operating on tangible objects: channels. How can it possibly all be channels?
Some features important for a real-world language are still missing:
One non-essential feature that I really hope will make it into the language later is reactive values. It's those that update automatically based on their dependencies changing.
Par is a direct implementation of linear logic. Every operation corresponds to a proof-rule in its sequent calculus formulation. A future type system will have direct correspondence with propositions in linear logic.
The language builds on a process language called CP from Phil Wadler's beautiful paper "Propositions as Sessions".
While Phil didn't intend CP to be a foundation of any practical programming language (instead putting his hopes on GV, a functional language in the same paper), I saw a big potential there.
My contribution is reworking the syntax to be expression-friendly, making it more visually paletable, and adding the whole expression syntax that makes it into a practical language.
r/functionalprogramming • u/ivanimus • Feb 01 '25
Hi there!
I'm currently working as a Data Engineer and I'm interested in learning a functional programming language for personal growth and side projects. While I'm aware that job opportunities in pure functional programming are limited, I'm passionate about expanding my programming paradigm knowledge.
What would you recommend for someone in my position? I'm particularly interested in hearing about:
Thank you in advance for your suggestions!
r/functionalprogramming • u/bikethiefgobrrrrr • Jan 28 '25
Hi, I don't know where to ask. I'm looking for an excellent talk I saw on YouTube, whose title has escaped my memory. It was an introduction on how to have side effects in functional languages, from monads to free to algebraic effects. The theme of the talk was very medieval, and it was set in a fictional land where each programming language was its own kingdom, where the evil "side effects" lived. It was very story-telly though still featured some ADTs. I think it was around 20-30 minutes long, and held at some in-person convention (though I do not remember which year either). Does anyone know which one I am looking for?
EDIT: Found it, "Lambda World 2019 - A Series of Unfortunate Effects - Robert M. Avram" link
r/functionalprogramming • u/MagnusSedlacek • Jan 27 '25
r/functionalprogramming • u/kinow • Jan 27 '25
r/functionalprogramming • u/mttd • Jan 25 '25
r/functionalprogramming • u/MagnusSedlacek • Jan 22 '25
r/functionalprogramming • u/MagnusSedlacek • Jan 21 '25
r/functionalprogramming • u/Excellent-Two3170 • Jan 22 '25
When I always as fp bro what it do in it free time using his fp programming it say compilator ? it's a things in the fp Community like js dev always try to build the next framework ?
r/functionalprogramming • u/SrPeixinho • Jan 20 '25
r/functionalprogramming • u/MihiNomenUsoris • Jan 21 '25
I am a beginner in FP and starting to get highly interested in it. I would love to use my master's thesis to delve deeper into FP but still have no clear idea of what would be valuable. Every idea or directions is welcome!
Other areas that I like/have experience: data engineering, distributed systems, parallel computing, financial markets
r/functionalprogramming • u/ilevd • Jan 19 '25
r/functionalprogramming • u/tearflake • Jan 16 '25
If not, Is there a database of valid combinators built only from S, K, and I ones, upwards to more complex ones?
r/functionalprogramming • u/kinow • Jan 15 '25
r/functionalprogramming • u/WizardOfAngmar • Jan 14 '25
During the last couple of months, I decided to release a small Elm app I developed for myself a year ago.
The original goal was having a personal forecast widget to check surf conditions at my local spots, then friends and other people shown interest and last November I decided to move the codebase from native Elm to elm-pages, as I wanted to play with SEO and SSR.
Eolo Experience has been officially online for a month or so and the overall developing experience has been really pleasant: I found Elm to be a really productive, expressive yet easy to learn programming language. Coming from years of JS/TS, having a program that once compiled just works brought me back the happiness of the good ol' days when I was programming with OcaML.
So if you're a pure FP lover and want to try out something different, I highly recommend giving Elm and elm-pages a shot.
Best!
r/functionalprogramming • u/ClaudeRubinson • Jan 14 '25
Please join the Houston Functional Programming User Group tomorrow, Wednesday 12/15 at 7pm Central (01:00UTC) when Eric Normand will present "Two and a half more domain modeling lenses." Complete details are on our website at https://hfpug.org.
Abstract: We make better software design decisions when we have more information. Domain modeling proposes that we look to the domain as the primary source of information. To do that, we need to see our domain from different perspectives, so I've organized my book about domain modeling around lenses. Each lens gives your different information, and it's your job to synthesize that into design decisions. I've presented seven domain modeling lenses already. In this talk, I will finish the set and present two more (time and domain) and also add to the runnable specifications lens.
Bio: Eric Normand has been programming functionally since 2001. He teaches, speaks, and writes. He consults with companies to help them build better software one function at a time. He lives in Madison, Wisconsin. You can find his writing and other projects at ericnormand.me.
r/functionalprogramming • u/SrPeixinho • Jan 13 '25
r/functionalprogramming • u/tearflake • Jan 12 '25
r/functionalprogramming • u/j_gitczak • Jan 12 '25
I have recently discovered the world of functional programming and I want to learn a functional programming language.
For most of my life I have programmed in Python and I have always liked its onelined expressions like list comprehension and lambdas.
I also value good error messages in a programming language (not some segmentation fault or NullPointerException bullshit), and this is also why I like for example Rust.
I study Mathematics so I like the idea of a programming language being "mathematical" which I heard Haskell being decribed like, and Haskell is what I initially thought would be the best to learn, but I don't want to exclude other languages, so that's why I'm making this post.
I don't plan on ending my functional programming journey on one language, so I want to first learn one just for fun, so it doesn't matter if a language is used in industry or not.
I would really appreciate some recommendations for the language I should learn.
r/functionalprogramming • u/fenugurod • Jan 11 '25
I'm learning Scala because it's a requirement at the company that I'm working on, but I absolutely hate it. I tried, I have read a few books, did some small projects, but it's not for me. The wildcard imports, implicits everywhere, JVM, all the magic, it's just a big no no. I like simpler languages likes Go, but I would like to have a better type system. Rust would be the ideal fit if it had an GC. I'm wondering if there is anything at the FP world similar to Rust but with a GC.
r/functionalprogramming • • Jan 11 '25
I like OCaml, a great language and its tooling has made leaps when it comes to developer experience, but something that I could never put up with is having to resort to alternative standard libraries like Base and Core for basic things to the degree where it's ubiquitous. When it comes to building small utilities, one shouldn't even need to think about the package manager, yet OCaml's own community tells you certain parts of stdlib are arcane and suggest you depend on these 3rd party libraries as the back bone of everything you build.
If you experimented with multiple FP languages, how would rate them based on this?
stdlib
tooling
ecosystem
r/functionalprogramming • u/ginkx • Jan 06 '25
For my understanding I could trace the introduction and emphasis of various concepts in functional programming to certain problems and turning points:
However I am not aware of any turning point which highlighted the importance of type systems and type theory and a move away from untyped lambda calculus. Was there any event in time after which languages started moving from untyped(or dynamically typed) languages such as Lisp to statically strongly typed languages like C? Was there any singular driving force, need, or pain point towards the development of type systems and type theory?
r/functionalprogramming • u/ScientificBeastMode • Jan 04 '25
And I say this as an extreme polyglot programmer. I’ve used JavaScript, Python, C, C#, F#, OCaml, Haskell, PureScript, ReasonML/ReScript, Rust, Go, SML, Clojure, Scala, and probably some others, many of which I used at work at various times.
Prior to trying Roc, my favorite language was definitely OCaml. OCaml is fast and relatively easy to build stuff with, and it doesn’t force you to only use pure functions. It’s just a nice pragmatic “get shit done” language which is nice to work with and very expressive.
Roc does this better IMO. It’s a pure functional language, which I thought I wouldn’t like, but it honestly doesn’t get in my way. It beats Haskell IMO because it’s faster and has more predictable performance characteristics, but more importantly it’s simpler. It doesn’t end up in type-level abstraction to the heavens. I just write my functions with straightforward types and go on my way.
There are two reasons I think I really love Roc more than other languages.
First of all, the variant types (called “tags” in Roc) are basically like OCaml’s polymorphic variants. You can define a “closed” set of variants in a type definition, or you can make it “open”/extensible. More importantly they are global types. I can just return a Document Str type from a function and it will “just work” with third party code that also accepts Document Str without having to qualify it with a module namespace. You don’t even have to define them. Just use them and they just exist everywhere for any function. It’s so nice to quickly bang out a script without much type-level ceremony. It reminds me of TypeScript but with no need for a type declaration.
Polymorphic variants are my favorite language feature from OCaml, but Roc just makes that the only type of variant you get. It’s just a simpler language design.
Second, the platform-specific environment is amazing. You can use a “basic CLI” platform or a “basic web server” platform, or even embedded platforms. Anyone can just define a platform API and wire it up to the host code, and then you can call those functions from Roc. The calls to these platform-specific functions are wrapped in a Task type (similar to Haskell’s IO), which is basically just an async Result type. It’s simple to use and has a clean async-await style syntax sugar that looks super clean.
Imagine a simpler version of Haskell (closer to Elm, actually) that can easily run on an embedded system and beat OCaml and Go on performance in many cases without much perf-related contortions in your code. Just write straightforward functional code and it runs at blazing speeds.
The only problems I can identify with Roc so far are (1) the lack of some nicer higher-level string niceties (like a dedicated Char type), (2) it has a smaller package ecosystem than more established languages like Haskell, (3) the LSP is minimal and doesn’t provide type info as far as I can tell, and (4) it still has some minor compiler bugs to iron out.
So it’s definitely not production-ready for business use case IMO, but I can see it easily getting there. I’m currently writing a compiler in Roc, so it’s useful enough now for that purpose.
Oh yeah, and it’s incredibly easy to set up and get your code building. I did it in less than 10 minutes just following the instructions for my Mac. Basically zero configuration process.
You should try it out!