News for hackers. Stuff that matters.
Re:Mobius – .NET runtime running on .NET Core by lostmsu on Tuesday April 07, 2020 @12:35PM (#22804728)
I thought about doing something similar in university. But I used LLVM as the compiler backend: https://github.com/lostmsu/CodeBlock

Written in F# of course.

Re:Mobius – .NET runtime running on .NET Core by sdegutis on Tuesday April 07, 2020 @01:56PM (#22805666)
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?
Re:Mobius – .NET runtime running on .NET Core by bad_user on Tuesday April 07, 2020 @02:06PM (#22805753)
Rust 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

Re:Mobius – .NET runtime running on .NET Core by fceccon on Tuesday April 07, 2020 @03:12PM (#22806444)
If 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

Re:Mobius – .NET runtime running on .NET Core by lostmsu on Tuesday April 07, 2020 @02:24PM (#22805945)
F# is 85% OCaml. IDE is probably better though. Also you get all the .NET libraries.
Re:Mobius – .NET runtime running on .NET Core by mumblemumble on Tuesday April 07, 2020 @08:03PM (#22808828)
. . . 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.

Re:Mobius – .NET runtime running on .NET Core by lostmsu on Tuesday April 07, 2020 @02:35PM (#22806062)
Actually, for UI stuff you might want to just do C#. UI designers work better there.
Re:Mobius – .NET runtime running on .NET Core by wazanator on Tuesday April 07, 2020 @02:03PM (#22805732)
If all you are wanting to do is make desktop gui stuff for your family C# + Winforms is super easy to pick up.
Re:Mobius – .NET runtime running on .NET Core by moron4hire on Tuesday April 07, 2020 @06:36PM (#22808202)
Assuming the GP has equally zero knowledge of both, it would be better to start with WPF.
Re:Mobius – .NET runtime running on .NET Core by CuriousSkeptic on Tuesday April 07, 2020 @02:52PM (#22806243)
Or 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.

Re:Mobius – .NET runtime running on .NET Core by sdegutis on Tuesday April 07, 2020 @04:52PM (#22807350)
I'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.
Re:Mobius – .NET runtime running on .NET Core by DisownedWheat on Tuesday April 07, 2020 @06:49PM (#22808320)
So something like LÖVE2D with wrapped Win32 APIs? That would be super cool, I wonder if anyone has done something like that.
Re:Mobius – .NET runtime running on .NET Core by sdegutis on Tuesday April 07, 2020 @09:15PM (#22809195)
I 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?
Re:Mobius – .NET runtime running on .NET Core by CuriousSkeptic on Tuesday April 07, 2020 @06:31PM (#22808163)
The nerd in me just saw a great application of a futamura projection. ;)
Re:Mobius – .NET runtime running on .NET Core by int_19h on Tuesday April 07, 2020 @05:59PM (#22807936)
It 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/csh...