Lev's Hacking Notes

Posts tagged: F#

Dropping Pakets and F# Bombs

2021-03-25 00:33:37 ][ Tags: F#

I tried to be clever with the title.

I spent the better part of the evening yesterday trying to get the LaunchDarkly .NET SDK to work in F#. This was a part of my current journey of trying to learn more F# so that I can continue to contribute to the dark porting effort.

My first problem was I was trying to use the Paket package manager which is in use in dark, but for some reason I could not get any of the installed dependencies to be recognized. I randomly got it working in one project when I saved and re-opened a file, but then when I started a new project the same trick didn't work.

Needless to say I have no idea what I am doing. After spending way too much time troubleshooting this, I just switched back to the built in package manager from the dotnet CLI which uses nuget. This got me to the point where I was able to at least load and recognize the dependency in my F# code.

Sadly, I was not able to get this to actually work. I think the main problems is that I don't really understand how to use .NET objects from within F# and all of my code, while syntactically correct, looks like object oriented F# (which I guess is kind of a thing, but not really).

The good news is that I am sure I will figure this out given enough time, so onwards for now.

Using Skills

2021-03-25 00:25:28 ][ Tags: F# dark

I've been feeling a little demotivated lately because I have not applied my Computer Science skills as much as I want to in a long time. I get a lot of satisfaction out of the work that I do but I don't always have the opportunity to grow my technical skills.

A few weeks ago I discovered the OSSU Computer Science curriculum and I started working my way through some of the courses because I seem to have forgotten half of the things that I learned in college. This exercise was worthwhile because I remember more that I expected and have been more inspired than ever to actually do something with the knowledge that I have.

Earlier this week I read Paul's blog post about porting dark from OCaml to F#. I forked the repo and started poking around to see if there was something I could do with my new found inspiration.

After a stumbling through a few things while getting started, I am really happy that I was able to make a small, but useful, contribution to the porting effort.

I went from not knowing OCaml, F#, or dark to shipping a PR in two days. I still don't know OCaml, F#, or dark but I am optimistic that I can continue to figure things out. :)