4 ms·
I've been wanting to make some .NET apps for our family's use (like a timer etc.) but don't know C# so I figured maybe I should just start off learning F# since
by sdegutis 7y ago
I've been wanting to make some .NET apps for our family's use (like a timer etc.) but don't know C# so I figured maybe I should just start off learning F# since I have a FP background. So is F# pretty much Rust but with GC? Or is it more like TypeScript -- in the sense that it's based on OCaml which maps nicely to JS (i.e. ReasonML) -- but also with sum types?
- wazanator 7y agoIf all you are wanting to do is make desktop gui stuff for your family C# + Winforms is super easy to pick up.
- CuriousSkeptic 7y agoOr perhaps skip it altogether. Most of my “family” apps is just quick hacks in JavaScript. Simple to throw together, runs on everything with a browser, like the tv, and is easily published on anything serving static files, like github pages. Edit: For some more hobby like projects C# works out quite nicely though. I’d say it’s probably easier to stick with the beaten path here if not seeing a particular advantage from a functional language. I hear F# is quite nice as far as a functional languages go though.
- sdegutis 7y agoI've been wanting for a while a lightweight Electron alternative that doesn't use web views, just native APIs, and uses Lua instead. So it would be an .exe file that looks for a main.lua somewhere, and runs it, giving access to modules that wrap the Win32 API in high-level functionality. Then you could run a command that combines the .exe and the main.lua into a new .exe file that you can distribute. It would be super lightweight and wouldn't even need a compiler to be installed to be able to make tiny lightweight apps.
- CuriousSkeptic 7y agoThe nerd in me just saw a great application of a futamura projection. ;)
- DisownedWheat 7y agoSo something like LÖVE2D with wrapped Win32 APIs? That would be super cool, I wonder if anyone has done something like that.
- sdegutis 7y agoI know there are Win32 Lua APIs. Maybe this is a 10 line windows app that just loads those in a host that loads main.lua?
- moron4hire 7y agoAssuming the GP has equally zero knowledge of both, it would be better to start with WPF.
- bad_user 7y agoRust isn't very FP, even if working with a borrow checker limits sharing, thus approaching the problem from a different angle, but with similar results as referential transparency. And TypeScript doesn't have much in common with OCaml. F# is similar with OCaml, yes, but it's missing some OCaml features such as functors and row polymorphism. It also uses .NET's OOP and introduces a couple of nice features of its own like type providers. It's a cool language, especially if you want to target .NET
- lostmsu 7y agoF# is 85% OCaml. IDE is probably better though. Also you get all the .NET libraries.
- mumblemumble 7y ago. . . kind of. F# is OCaml minus the macro system, minus the higher-order module system, minus the OCaml object system, plus the .NET object system, plus a bunch of fun builtin features that nevertheless mostly just supply stuff that OCaml can do with macros, plus non-painful multithreading, plus a fairly different syntax. They are both members of the ML family, but that tells you about as much about what they have in common as pointing out that C# and Objective-C are both members of the Algol family.
- lostmsu 7y agoActually, for UI stuff you might want to just do C#. UI designers work better there.
- fceccon 7y agoIf you want to use F# to build GUIs, you should definitely check out Fabolous [1]. It uses Xamarin.Forms to render the widgets, and you get to write the application logic using the Elm architecture. [1] https://github.com/fsprojects/Fabulous https://github.com/fsprojects/Fabulous
- int_19h 7y agoIt might be better to try C# first, if only because tooling as better, especially once you get to UI. And C# has accumulated quite a few features that are traditionally considered "functional". For example, pattern matching: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#more-patterns-in-more-places https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csh...