jbzfn, to python
@jbzfn@mastodon.social avatar
aeveltstra, (edited ) to javascript
@aeveltstra@mastodon.social avatar

Hey there, #javascript folks and #functionalprogramming people! Would you argue javascript is, or isn’t a functional programming language? And: why?

jbzfn, to FunctionalProgramming
@jbzfn@mastodon.social avatar
jbzfn, to typescript
@jbzfn@mastodon.social avatar

🦾 Functional TypeScript #1: Algebraic Data Types | Injuly

"In functional programming, algebraic types are so ubiquitous that you would be hard pressed to find a language that doesn't support them. Strangely though, nothing about them demands that a language be functional by paradigm. That imperative languages have avoided ADTs for decades seems almost an accident."

https://injuly.in/blog/ts-adt/

#TypeScript #FunctionalProgramming #ADT

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 26: Variable-arity functions. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/5wbgRlzJYUU #Haskell #FunctionalProgramming

leanpub, to php
@leanpub@mastodon.social avatar

Thinking Functionally in PHP by Larry Garfield is free with a Leanpub Reader membership! Or you can buy it for $25.00! http://leanpub.com/thinking-functionally-in-php #Php #FunctionalProgramming

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 25: from Java to Haskell. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/YwshlQXKO80 #Haskell #FunctionalProgramming

frankel, to FunctionalProgramming
@frankel@mastodon.top avatar
Jose_A_Alonso, to FunctionalProgramming
@Jose_A_Alonso@mathstodon.xyz avatar
haskell, to haskell
@haskell@fosstodon.org avatar

The GHC developers are very pleased to announce the release of GHC 9.10.1! 🎉

On the menu:
→ GHC2024 language edition
→ Linear let and where
bindings
→ Annotation of exceptions with backtraces
→ Required type arguments for functions
→ Javascript FFI support in the WebAssembly backend
… and many more!

https://discourse.haskell.org/t/ghc-9-10-1-is-now-available/9523

jbzfn, to FunctionalProgramming
@jbzfn@mastodon.social avatar

🐫 Pretty Printing in OCaml: A Format Primer
➥ Vladimir Keleshev

https://keleshev.com/pretty-printing-in-ocaml-a-format-primer

#ocaml #functionalprogramming

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 24: generic (un)folds. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/QTgRKWGDVr0 #Haskell #FunctionalProgramming

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

haskman,
@haskman@functional.cafe avatar
haskman,
@haskman@functional.cafe avatar

A great example of how cool PureScript backend optimizer is - The PureScript code makes multiple map and filter calls and also calls into two functions with complicated logic. The generated output shows that the PS code was aggressively inlined into a tiny bit of JS code -

on the left : on the right

The tiny bit of JS code that was generated for the above PS code

vascorsd, to FunctionalProgramming
@vascorsd@mastodon.social avatar

Flatmaps and do-notation, but different >.>


Functional Semantics in Imperative Clothing - https://rtfeldman.com/imperative-clothing

jbzfn, to FunctionalProgramming
@jbzfn@mastodon.social avatar

「 CakeML is a functional programming language and an ecosystem of proofs and tools built around the language. The ecosystem includes a proven-correct compiler that can bootstrap itself 」

https://cakeml.org

#CakeML #FunctionalProgramming #PLT #CompSci

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