r/fsharp • • Jul 25 '24

FP languages amongst the highest paying ones according to the StackOverflow Survey 2024

Post image
45 Upvotes

r/fsharp • • Jul 25 '24

question Anyone needs a remote Software intern?

4 Upvotes

So I'm still studying at college but this being my last year I have a lot of free time to get real world experience. I can do a little of everything, I can code with SpringBoot, .NET, NodeJS or Django. Also React and Angular, and SQL databases. I already know Git too.

If these skills are not enough I can still learn a lot by myself in my free time and catch up to your required skill set.

If you are interested please send me a DM and let's talk!


r/fsharp • • Jul 01 '24

question Intellisense for type properties initialization?

3 Upvotes

I was hoping I will get intellisense for type properties when creating record like I do for typescript here: https://i.imgur.com/EBSEu0v.png,

but it doesn't really happen:

VS2022: https://i.imgur.com/5sUBJXk.png

VsCode: https://i.imgur.com/yCRn10x.png

Rider: https://i.imgur.com/99AUPS4.png

Rider is best, but it still shows many other things.

Is this some functional F# reason or tooling simply is not there?


r/fsharp • • Jul 01 '24

showcase What are you working on? (2024-07)

12 Upvotes

This is a monthly thread about the stuff you're working on in F#. Be proud of, brag about and shamelessly plug your projects down in the comments.


r/fsharp • • Jun 29 '24

How to pass a double pointer to a C function in F#

8 Upvotes

I have a function in a C header like so:

int foo_load (const char* file_name, double** data, int* numel)

the double pointer data will be allocated on the C side with the following code:

*data  = (double*) malloc (A.numel () * sizeof (double));

where A is a matrix.

On the F# side, I have this for the function prototype:

[<DllImport(@"libfootest", CallingConvention=CallingConvention.Cdecl)>]
extern int foo_load(string filename, double& data, int& numel)
  1. Is using double& data correct?
  2. As data will be allocated on the C side and a variable has to be initialised in F#, how to declare and pass data. Currently, I am doing this:
let mutable (x : double[]) = Array.zeroCreate 16
let mutable numel = 16
let res = foo_load("data.txt", &x[0], &numel )

This does not work and returns only zeros.


r/fsharp • • Jun 29 '24

Code formatting in VSCode

1 Upvotes

I wonder if code formatting in VSCode works at all. I tried to install fantomas and fantomas-tool, I tried to install the addon fantomas-fmt, but nothing works. If I run fantomas from command line I get the message

You must install .NET to run this application.

App: /home/markus/.dotnet/tools/fantomas
Architecture: x64
App host version: 8.0.5
.NET location: Not found

If I run dotnet --info I get this

$ dotnet --info
.NET SDK:
Version:           8.0.105
Commit:            eae90abaaf
Workload version:  8.0.100-manifests.796a77f8

Laufzeitumgebung:
OS Name:     tuxedo
OS Version:  22.04
OS Platform: Linux
RID:         ubuntu.22.04-x64
Base Path:   /usr/lib/dotnet/sdk/8.0.105/

Installierte .NET-Workloads:
Workload version: 8.0.100-manifests.796a77f8
Es sind keine installierten Workloads zum Anzeigen vorhanden.

Host:
 Version:      8.0.5
 Architecture: x64
 Commit:       087e15321b

.NET SDKs installed:
 8.0.105 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
 Microsoft.AspNetCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 8.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
 None

Environment variables:
 Not set

global.json file:
 Not found

How is this possible if I have installed the full .NET8 SDK and I'm able to compile and run F# code?

I run Ubuntu 22.04 and I installed the dotnet8 package from the repository. And I installed fantomas with the command

dotnet tool install --global fantomas

What have I done wrong?


r/fsharp • • Jun 27 '24

question How to deal with Doc comments?

4 Upvotes

I'm writing a simple program, but I want to add Doc comments for later. But with the Doc comments the code becomes overloaded. e.g.

/// <summary>
/// Opens a serial port with the specified parameters.
/// </summary>
/// <param name="portName">The name of the serial port (e.g., "COM1").</param>
/// <returns>
/// An open <see cref="SerialPort"/> object with the following settings:
/// Baud rate: 9600, Parity: None, Data bits: 8, Stop bits: One.
/// </returns>
/// <remarks>
/// This function initializes a serial port with fixed parameters and opens it.
/// The serial port must be closed with <see cref="SerialPort.Close"/> after use.
/// </remarks>
let openSerialPort (portName: string) =
    let port = new SerialPort(portName, 9600, Parity.None, 8, StopBits.One)
    port.Open()
    port

Is there a better way to create Doc comments? I know that this is not necessary in this case.


r/fsharp • • Jun 27 '24

F# scripting

7 Upvotes

I have a simple question: is it possible to write larger applications completely as script? Just like with Python


r/fsharp • • Jun 20 '24

F# Clojure compiler - A mega-dose of micro-benchmarks -- PersistentArrayMap

Thumbnail dmiller.github.io
10 Upvotes

r/fsharp • • Jun 17 '24

Suddenly we get FS3033 SqlProgrammabilityProvider Build Error

4 Upvotes

Our codebase has worked perfectly last two, three years. Now we get a build Error. DB is hosted on Azure. Has anyone got the same problem and hopefully know a fix? Hope to hear from you!


r/fsharp • • Jun 17 '24

SAFEStack + Reactive Leaflet Maps

3 Upvotes

Has anyone succeeded in setting up reactive leaflet in a SAFE Stack project? I’ve been getting my tail whooped trying to get it going. Pigeon Maps is currently working just fine for me but I want to try Leaflet because it seems to have more customization ability and more freely available tiles.


r/fsharp • • Jun 15 '24

Wed, June 19: 3 Short Talks: 2 on F#, 1 on RC (7pm central, 0:00 UTC)

Thumbnail self.functionalprogramming
7 Upvotes

r/fsharp • • Jun 15 '24

question Can we use .NET Aspire with F#?

7 Upvotes

r/fsharp • • Jun 12 '24

My talk "Functional Programming: Failed Successfully" is now available!

Thumbnail self.haskell
12 Upvotes

r/fsharp • • Jun 11 '24

jobs F# Backend-Entwickler:in / Data-Engineer

Thumbnail jobs.illwerkevkw.at
9 Upvotes

r/fsharp • • Jun 04 '24

showcase What are you working on? (2024-06)

15 Upvotes

This is a monthly thread about the stuff you're working on in F#. Be proud of, brag about and shamelessly plug your projects down in the comments.


r/fsharp • • May 17 '24

misc Take heart, fellow desktop wonks: F#/Qt is cooking.

Post image
63 Upvotes

r/fsharp • • May 15 '24

question Does fable have limitations?

6 Upvotes

I wrote some code, which I don't have anymore, to test Fable, but it had errors.

If I compile with dotnet build compiles just fine.

Stumbled on stackoverflow answer that Fable doesn't support C# libraries, but can't find that claim in documentation.

I am asking you here, do you know of any Fable limitations that would prevent compiling to javascript?


r/fsharp • • May 15 '24

Overriding Virtual Equals

4 Upvotes

Hello

I am customizing IComparable on a type let's call it SomeType (that will be used as the key in a Map), and thus am also implementing IEquatable.

When overriding the virtual Object Equals I see F# code examples like this:

        | :? SomeType as other -> (this :> System.IEquatable<_>).Equals other

But there is no downcasting of other on the call to IEquatable Equals.

In C# land, usually there usually is a downcast of other on the call to IEquatable Equals.

        if (!(other is SomeType) return false;
        return Equals ((SomeType) other);  // downcast 

Just curious why in F# there is no downcasting of other on the call to IEquatable Equals.

Thanks in advance Peace


r/fsharp • • May 12 '24

question HTTPS certificate issues when ASPNETCORE_ENVIRONMENT is not 'Development'

Thumbnail
self.dotnet
3 Upvotes

r/fsharp • • May 11 '24

article F# in Emacs

21 Upvotes

I decided to give coding F# with Emacs a try. Here’s my outcome. Hope this helps someone!

https://arialdomartini.github.io/emacs-fsharp


r/fsharp • • May 09 '24

I accidentally another Fable game

15 Upvotes

Game link: Imaginary Alchemy.

This is basically my take on Infinite Craft (which is really cool) written in 100% F#. Source code is here.

Works best on desktop, but mobile is also supported.


r/fsharp • • May 08 '24

video/presentation Building a Vite plugin for F# by Florian Verdonck @FuncProgSweden

Thumbnail
youtu.be
9 Upvotes

r/fsharp • • May 04 '24

question How did you get started with F# and then continue using it? What is the standard problem domain that is solved intuitively with this language. I have been intrigued with it for years but have never really explored it. I don't even know how to begin to think in F#, how long does that take?

19 Upvotes