HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
"Outperforming Imperative with Pure Functional Languages" by Richard Feldman

Strange Loop Conference · Youtube · 42 HN points · 5 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Strange Loop Conference's video ""Outperforming Imperative with Pure Functional Languages" by Richard Feldman".
Youtube Summary
Like many, I once thought that functional programming makes programs easier to maintain, but slower to run. After all, that had been my experience; when I wrote JavaScript in a functional style, my code got easier to maintain - but it no longer ran as fast.

Once I got deeper into functional languages, including pure functional ones, I was surprised to discover that they could actually outperform imperative languages - not just in tasks generally considered "well-suited" to functional programming, but sometimes even in cases considered well-suited for imperative programming!

This talk examines performance from the network level all the way down to individual CPU instructions to show how and when pure functional programming languages can outperform their imperative counterparts. Come see just how fast functional programming can be!

Richard Feldman
NoRedInk
@rtfeldman

Richard Feldman is a software engineer at NoRedInk and a well-known member of the Elm community.

Recorded at Strange Loop 2021
https://thestrangeloop.com
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
> Functional programming experts say that their code is efficient because the compiler translates it to an efficient representation on the CPU. They have TCO and other things. But they don't mutate data and hence every function call creates a new data in memory taking up space. How do they overcome that?

By letting the compiler make assumptions. For example, consecutive map calls can be converted into a single one. If the data isn't shared with something else, the compiler can mutate it. MUCH easier to paralellize maps.

As a starting point for those nitty grittys, this talk is probably as good as any https://www.youtube.com/watch?v=vzfy4EKwG_Y

Apr 11, 2022 · 1 points, 0 comments · submitted by tosh
Mar 25, 2022 · 2 points, 0 comments · submitted by latexr
Maybe https://www.roc-lang.org/ ? It's not production ready, I just saw nice talk by Richard Feldman [1] about it and it's inspired by Elm.

[1] https://www.youtube.com/watch?v=vzfy4EKwG_Y

So many new programming languages coming up with clever features that makes me wish I could mix and match their core features while using libraries from more popular languages.

Up and coming Languages I am excited about -

1. Roc - https://www.youtube.com/watch?v=vzfy4EKwG_Y

2. Zig - https://ziglang.org/

3. Scopes - https://sr.ht/~duangle/scopes/

4. Gleam - https://gleam.run/

5. Odin - https://github.com/odin-lang/Odin

6. Koka - https://github.com/koka-lang/koka

7. Unison - https://github.com/unisonweb/unison

sixbrx
Don't forget Kind (https://github.com/Kindelia/Kind) which is mentioned in the "How can I Help?" section as a potential language for targeting HVM.
arc776
Nim - https://nim-lang.org/

Lets you mix and match other libraries with their native ABI as it compiles to C, C++, ObjC and JS + has excellent FFI.

metadat
What about support for using Golang or C# packages? That'd be handy.

Interesting read about NIM-

https://www.quora.com/Why-hasnt-Nim-Nimrod-become-as-popular...

Key points:

- Nim lacks official support to multiple inheritance or interfaces (as that in Java) or mixin (as that in Ruby). It feels uneasy when implementing common design patterns, which is important for middle to large-sized projects.

- The error messages emitted from Nim compiler looks a bit obscure. Sometimes you have to guess or google to comprehend what really happens in your code.

These seem like pretty good problems compared to common annoyances and caveats in many other languages.

arc619
TBF the reply in that link was written 4 years ago, before the language went 1.0

> Nim lacks official support to multiple inheritance or interfaces

Multiple inheritance is a bit of a trainwreck IMO (see diamond problem).

The language isn't designed around OOP, and is instead procedural with metaprogramming for extension. You get more bang for your buck this way, but for people with their head in inheritance it’s probably a shock.

udbhavs
Not general purpose but has very interesting ideas nonetheless - https://imba.io/
laerus
there is also maybe Dada https://dada-lang.org/welcome.html
throwaway17_17
I have seen talks and/or papers on all of these except Scopes and Gleam. Out of the list the only one that does not provide something I am interested in is Unison. Given that your feelings for interesting language features seems to be at least marginally close to mine I am going to check out Scopes and Gleam just to see what they have that interested you.

Personally, from a conceptual level, I find that Koka and Roc provide some of the more interesting developments in PL design. For anyone wondering, as to Roc (which I don’t think has an implementation or even a full description yet) I am particularly interested in their concept and implementation of the ‘platform’/‘application’ layer idea. As to Koka, the papers the team has generated are almost all excellent. The paper describing Perseus, the GC/resource tracking system, and the compiler implementation review are stunning.

joaogui1
There is an initial version of Roc, though the repo is private and you need to ask Richard Feldman for access
the_duke
Unison is really quite interesting:

* Effect system

* Built in code distro distribution. As in: call a function on a different node that doesn't have that code yet

But most interesting: stops storing code as plain text files, but in a database instead. This breaks many workflows but could offer quite a few interesting properties.

throwaway17_17
I don’t really have any outstanding objections to the goals of Unison, it is just focused on paths through the PL design space I am not particular deep into. My hobby language is a multi-modal, multi-type system,‘concatenative’ language. So my tastes and interests are pretty far away from where Unison is experimenting. But varying paths travelled hopefully lead us to a more diverse and productive place for everyone.
Dec 16, 2021 · 2 points, 0 comments · submitted by dmmalam
Nov 30, 2021 · niels_bom on 4x Smaller, 50x Faster
This talk by Richard Feldman about Roc (a new language) goed into why immutable does not necessarily mean slow and given enough attention can mean higher performance in certain cases: https://youtu.be/vzfy4EKwG_Y
Nov 30, 2021 · memco on 4x Smaller, 50x Faster
> How would one optimize for immutability in this case, other than turning it back into mutability behind the scenes?

Roc-lang, which is a functional, systems language in development uses something called opportunistic in-place mutation to do just that. Here's a video where the creator talks about it: https://youtu.be/vzfy4EKwG_Y?t=1276

Nov 04, 2021 · 3 points, 0 comments · submitted by tosh
sharmin123
Facebook Safety Tips: Take Steps Now and Avoid Hacking: https://www.hackerslist.co/facebook-safety-tips-take-steps-n...
Oct 23, 2021 · 2 points, 0 comments · submitted by DeathArrow
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.