gregorni, to FunctionalProgramming
@gregorni@fosstodon.org avatar
abuseofnotation, to haskell
@abuseofnotation@mathstodon.xyz avatar

I haven't written any in years, so I decided to do one little shell script, just to see if I remember.

Some random thoughts:

  • The tooling and documentation still leaves you feeling stupid (unlike, PureScript, for example)
  • I hate this packing and unpacking of strings.

Oh, and here is the script, feedback and questions are welcome:

https://github.com/abuseofnotation/abuseofnotation.github.io/blob/master/build-jekyll-tags.hs

ramin_hal9001, to python
@ramin_hal9001@emacs.ch avatar

Yet another rant about Python and JavaScript:

I hate it when someone tells me, "well Python and JavaScript can be programmed in functional programming style, so they are just as good as any other functional programming language," and "something something objects are the same thing as closures."

Then my program crashes and I spend 20 minutes debugging only to find that for the 100th time I wrote a method like this:

def getThing(self): self.thing

instead of like this:

def getThing(self): return self.thing

...where basically the problem is most of my program is written in functional programming style, except you STILL have to write the fucking "return" statement as the last line of the function.

If your language has "return" as a built-in control flow, it is hopelessly imperative not functional, and there is not a single monad framework or higher-order-function library anywhere that will make your language functional.

Stop telling me imperative languages like Python and JavaScript are just as good as functional languages, they are objectively worse than functional languages.

ncrav, to nature
@ncrav@mas.to avatar

Time for a re- for newer mastodon souls!

Hello! I'm Nuno and this is Lua :DsaprvingLua: !

I do solution architecture, data processing, statistics, and machine learning for a living.

Lua is a master and a connoisseur of the best gourmet woods.

My interests are:






of ideas











Amirography, to rust

I'm trying to decide if the simplicity of just making every struct field public in , actually worth the risk of people/future me, not using the constructors and/or adding mut and changing the validity guarantees that come with using constructors or transformers that are accompanied by the struct.

What do you think?

dekkzz76, (edited ) to random
@dekkzz76@emacs.ch avatar
bblfish, to programming

2014 paper: "Inductive Representations of graphs" by @jelabra building on M. Erwig's 2001 paper on Inductive Graphs.
https://www.sciencedirect.com/science/article/pii/S0167642314000094
They wrote a implementation https://github.com/labra/wesin
and a one https://github.com/labra/haws
There is an interesting note on the Scala page regarding banana-rdf.

> Banana-RDF contains a more general library to work with RDF from Scala. It allows different underlying implementations like Jena and Sesame. A long term project will be to unify our work with that library.

I was actually just looking to see how I could update the pure Scala implementation to https://github.com/bblfish/banana-rdf
and after following links to Quiver a Scala library for Graphs based on Erwig's original paper very well described here
https://blog.higher-order.com/blog/2016/04/02/a-comonad-of-graph-decompositions/
See https://discord.com/channels/632277896739946517/839263668478672937/1123916208509571124

Amirography, to rust

It's so frustrating that whenever I ask about Functional Programming-style crates in Rust, the answer I get is mostly discouragement about doing full FP in rust.

Isn't rust supposed to have FP support?

Isn't FP supposed to help your programs be simpler, regardless of how purely functional your language is?

jakub_zalas, to FunctionalProgramming
@jakub_zalas@mastodon.social avatar

In the previous post, we looked at the benefits of a domain model implemented in a purely functional code.

This time, we’ll consider how it might work in practice by applying the event sourcing pattern to a functional domain model.

As it turns out the two go very well together.

Read more in my latest post “Functional event sourcing”: https://dev.to/jakub_zalas/functional-event-sourcing-1ea5

janriemer, to typescript

This looks wild! 🤯

civet - The Modern Way to Write

https://civet.dev/

abnv, to FunctionalProgramming
@abnv@fantastic.earth avatar
ramin_hal9001, to random
@ramin_hal9001@emacs.ch avatar

There is an old joke about the programming language, that it is the only language with more implementations than there are users.

It's funny because it is very nearly the truth. 81 different choices for implementations!? Are you fucking kidding me?

Crell, to php
@Crell@phpc.social avatar

I've just tagged the 1.0.0 stable of Crell/fp, a well-tested library for doing common functional programming tasks in your favorite web language.

https://github.com/Crell/fp

denzilferreira, to haskell
@denzilferreira@techhub.social avatar

Been learning Haskell, and I’m starting to see how inefficient OOP is. For example, taken from “Programming with Haskell” from Graham Hutton with Quick Sort. Something like this in many languages requires way more lines of code. I hear Rust follows same approach to things, so that’s next.

#haskell #functionalProgramming #programming

chemoelectric, to random
@chemoelectric@masto.ai avatar

The same program as before, but this time in or :

Euler method - Rosetta Code https://rosettacode.org/wiki/Euler_method#Ol

mdrslmr, to FunctionalProgramming

There was a post pointing to the beautiful more than 30 years old paper "Why Functional Programming Matters" John Hughes. I could not find the post again to reply,

The paper gives a definition of "foldtree" on page 7:
"
foldtree f g a (Node label subtrees) =
f label (foldtree f g a subtrees)
foldtree f g a (Cons subtree rest) =
g (foldtree f g a subtree) (foldtree f g a rest)
foldtree f g a Nil = a
"

I wonder what the type of "foldtree" could be. Since the last argument
is "treeof ∗" in the first declaration but "(listof (treeof ∗)" in the second.

In I would implement it as:

data Tree a = Node a [Tree a]

foldtree :: (a -> b -> b) -> (b -> b -> b) -> b -> Tree a -> b
foldtree f g a (Node x []) = f x a
foldtree f g a (Node x (t:ts)) =
g (foldtree f g a t) (foldtree f g a (Node x ts))

But probably I'm miss something here, since it takes only two declarations.

vascorsd, to programming
@vascorsd@mastodon.social avatar

This language (that I only became aware today) seems the most similar to #scala syntax wise compared to the more recent new age langs that are targeting #wasm.

Also says it wants a "blend of fp" and bring it to more mainstream ppl.

Some obvious extras or improvements seem to come from #rust (at least on a quick look) which are nice.

But, the more the merrier, #FunctionalProgramming languages, static strong typed (it seems).

#grainlang #fp #ProgrammingLanguages

https://grain-lang.org/docs/guide/hello_world

__sharky__, to FunctionalProgramming
@__sharky__@mastodon.social avatar

First time I need to use destructuring in . Takes some time to get my head around the syntax , but it works !

ramin_hal9001, to opengl
@ramin_hal9001@emacs.ch avatar

Question:

Does anyone know of an APL compiler or transpiler that can generated Vulkan or OpenGL shader scripts? (Free/libre would be most appreciated.) I think Aaron Hsu might have engineered something like this at some point, but I can't find anything about it at all right now, probably thanks to our amazing new "AI-enhanced" search engines.

__sharky__, to FunctionalProgramming
@__sharky__@mastodon.social avatar

This chapter took me a while and I need to reimplement it again. I think translate-codon should use a map . Having to wrap codons with codon-strings does not feel right , but I don't understand what partition returns.

Not sure about throw-away maybe a recursion is too much for this ? Maybe there are other built-ins I can use.

Using map more than once does not feel right. I think processing one rna a time would make it more simple.

worldsendless, to FunctionalProgramming
@worldsendless@qoto.org avatar

I'm looking for recent books or up-to-date text on with PHP. is changing rapidly and all the books I see are nearly a decade old. Any good recommendations?

jbzfn, (edited ) to random
@jbzfn@mastodon.social avatar

"In a functional architecture, the basic unit is also a function, but a much larger business-oriented one that I like to call a workflow. Each workflow represents a unit of functionality—a feature, use case, scenario, story, or whatever you want to call it. Just as functions are “things” at the coding level, these workflows are things at the architectural level, and the basic building blocks of the architecture"
➥ Increment Magazine


https://increment.com/software-architecture/primer-on-functional-architecture/

chemoelectric, to random
@chemoelectric@masto.ai avatar

Alright, you many, many fanatics. I have a treat for you: four tasks at once!

https://rosettacode.org/wiki/Bresenham_tasks_in_ATS

Sure, one can use SDL2 or whatever to draw lines, and, sure, these figures have "aliasing", but the tasks call for aliased figures. (I already did antialiased lines in ATS for a different task.)

gregorni, to programming
@gregorni@fosstodon.org avatar

Somehow, I constantly experience a weird inner urge to learn OCaml 🐪 🤔

haskman, to javascript
@haskman@functional.cafe avatar

Since the #Moonbit #JavaScript backend post (https://www.moonbitlang.com/blog/js-support) is trending, I thought I'd compare #PureScript backend optimizer (https://github.com/aristanetworks/purescript-backend-optimizer) output to see how it fares. The results were pretty good!

With basically this PureScript code -

run = fromArray  
 >>> flatMapF (fromArray <<< _.members)  
 >>> filterF _.gender  
 >>> mapF (\x -> min 100 (x.score + 5))  
 >>> mapF grade  
 >>> filterF (_ == 'A')  
 >>> foldF (\_ x -> x+1) 0  

the benchmark results are as follows. PureScript is roughly 6x faster than plain JS, and 6x slower than Moonbit output ( -

┌─────────┬──────────────┬─────────────┬────────────────────┬──────────┬─────────┐  
│ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │  
├─────────┼──────────────┼─────────────┼────────────────────┼──────────┼─────────┤  
│ 0 │ 'Moonbit' │ '34,67,542' │ 288.38869989829305 │ '±0.06%' │ 1733772 │  
│ 1 │ 'Plain Js' │ '74,816' │ 13365.983827421464 │ '±0.54%' │ 37409 │  
│ 2 │ 'Kotlin Js' │ '1,90,241' │ 5256.474017304151 │ '±0.38%' │ 95121 │  
│ 3 │ 'PureScript' │ '4,99,456' │ 2002.1768597161156 │ '±0.70%' │ 249729 │  
└─────────┴──────────────┴─────────────┴────────────────────┴──────────┴─────────┘  

#FunctionalProgramming #Frontend #Benchmarks

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