Better HN
topnewbestaskshowjobs
Log inSign up

reverseblade2

366 karma · joined Aug 30, 2020 (6y ago) · 206 submissions

Submissions

comment 5y ago · link · parent

this 3d bin packer is fully coded in F# and I wouldn’t be able to do so without it.

https://bindrake.com/

comment 5y ago · link · parent

I agree. I am not FAANG but the second biggest tech company next to Apple:) I think pandemy affected this a lot. Companies looking for local people have less options now as immigration has become difficult.

But also remote options made highly paid devs more accessible.

I am currently in Norway and when I turn on "I am open" in LinkedIn, my phone just doesn't stop ringing.

comment 5y ago · link · parent

If you don't what fable is, you don't have any idea about how powerful f# can be.

comment 5y ago · link · parent

Just learn and use web components instead

comment 5y ago · link · parent

let (model', cmd') = state.update msg

In order to write that you have to pin a reference to the state. But state is something that has to flow. Sure you can pin it to a ref, make it mutable and change the state but then nothing prevents you to change the state arbitrarily e.g. from a command. I believe yes the answer is because we want to stay on the FP realm. FP imposes some restrictions to keep our sanity. So not having a reference to the state and making it immutable is one of those restrictions.

comment 5y ago · link · parent

OP here, it's a great question indeed! Now let's forget about elm/elmish but we are to write a stateful application. It doesn't have to be a web app, just any application needs to hold some state. And that state should be modifiable (Not to mention we will have side-effects as well.) in order to do something useful but we also want to stay on the Functional programming realm to get benefit from things like immutability and other functional goodies.

So you see these two goals are contradictory. How FP tackles this state problem? One solution is to use actors and agents. And that's precisely what elmish is. Unlike the conventional apps where you mutate the state directly, an agent in F# is a recursive call which can await for further messages.

So just like Flip Flop holds the state in memory, an agent hold the state in a recursive function. And how is this connected to elmish? Let's see how elmish v2 is implemented: https://github.com/elmish/elmish/blob/5330f52153d5181923bb3c... You can see an agent there and that's the core of elmish.

So basically elm and elmish is a way to handle state changes in a functional manner along with side effect support via commands.

I cannot emphasis importance of elmish, because not only it helps for isolating the state functionally but it helps you to keep your business logic separate from UI. So you don't end up messing your code like you use React hooks or context.

comment 5y ago · link · parent

I am the author of the post and author of this https://www.udemy.com/course/learning-functional-programming...

Don't be deceived by low rating. It's low because people expected a course on syntax.

Also other continuations are as below:

https://www.udemy.com/course/functional-application-designin...

https://www.udemy.com/course/end-to-end-real-world-applicati...

And if you have any questions find me from @OnurGumusDev on twitter and I will gladly help

comment 5y ago · link · parent

Sure, but functional programming requires some discipline and restrictions for a greater good. It's certainly a choice though.

comment 5y ago · link · parent

I guess they don't. It's my mistake and I have just fixed it.

comment 5y ago · link · parent

Firstly you can share code with .net and JS side. Secondly, you can do proper functional programming with F#. Third I find type system typescript as cryptic.

comment 5y ago · link · parent

This one does https://resoptima.com/

192.

Functional Programming: Enemy of the State(onurgumus.github.io ↗)

2 points · by reverseblade2 · 5y ago · discuss

193.

Domain driven project: Lean software development(onurgumus.github.io ↗)

1 points · by reverseblade2 · 5y ago · discuss

194.

How to start your domain driven project(onurgumus.github.io ↗)

2 points · by reverseblade2 · 5y ago · discuss

comment 6y ago · link · parent

here's a 3d bin packer written in Fable: http://bindrake.com/ and source: https://github.com/OnurGumus/BinDrake

comment 6y ago · link · parent

https://www.udemy.com/course/learning-functional-programming...

https://www.udemy.com/course/functional-application-designin...

https://www.udemy.com/course/end-to-end-real-world-applicati...

197.

Fable Web Components with F# (as a JavaScript alternative)(onurgumus.github.io ↗)

2 points · by reverseblade2 · 6y ago · discuss

comment 6y ago · link · parent

Hello HN, I have built a 3D bin Packer as a POC, perhaps will make it commercial. Play with it and any feedback is more than welcome.
1234567