Тёмный

F# for the C# Developer - F#, the .NET Runtime, and Aesthetics - Scott Arbeit - NDC Porto 2023 

NDC Conferences
Подписаться 195 тыс.
Просмотров 4,2 тыс.
50% 1

This talk was recorded at NDC Porto in Porto, Portugal. #ndcporto #ndcconferences #dotnet #developer #softwaredeveloper
Attend the next NDC conference near you:
ndcconferences.com
ndcporto.com/
Subscribe to our RU-vid channel and learn every day:
/‪@NDC‬
Follow our Social Media!
/ ndcconferences
/ ndc_conferences
/ ndc_conferences
F# is a beautiful programming language, but learning F# when you're already familiar with C# can seem like a big task. In this session, we'll take examples from real-world F# code, and see what that code decompiles to in C#, giving you an essential low-level bridge between the languages through the .NET Runtime and IL byte-code.
While some basic functional constructs will be shown, the goal of this session is not to teach category theory and monads; it's to show how functional constructs in F# get translated into C# constructs that you're already familiar with. We'll highlight the benefits of using F# to "say" those things in succinct, robust, beautiful ways that help you write clear, maintainable code, and show how to bring some of those constructs back into C#.
At the end, you'll have an appreciation of some of the ways F# lets you write beautiful, expressive code that takes full advantage of everything .NET has to offer. Even if you never write F# yourself, this session will give you tools and new perspectives on C# that you can start applying to your projects right away for better, cleaner, easier-to-test code.

Наука

Опубликовано:

 

15 мар 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@antyadev2876
@antyadev2876 4 месяца назад
Very good talk about F#. F# needs more love.
@obilykua
@obilykua 3 месяца назад
Hi Anton. Few years ago I wanted to work with you on F# and applied to trading company where you worked. Unfortunately some HR had some weird requirements that I decided to ignore. Couple years later I started working for Microsoft and had privilege to be consulted by Scott Arbeit to use F# with DAPR cloud agnostic microservices. However you, Anton also inspired me to use F#. I just exited how small world may be specially when you are fun of F# :)
@michielnass4836
@michielnass4836 3 месяца назад
F# is awesome, great talk!
@WillEhrendreich
@WillEhrendreich 4 месяца назад
Yeeeeeaaaaaahhh, moar #fsharp. Let's go. Keep it up, let's see the good stuff.
@obilykua
@obilykua 3 месяца назад
Great talk, Thanks Stott.
@JonasThente-ji5xx
@JonasThente-ji5xx 2 месяца назад
good talk!
@TheRedbeardster
@TheRedbeardster 4 месяца назад
Very nice to see a picture from Russian folk fairytales :)
@pierre9368
@pierre9368 4 месяца назад
So what for you need F# if C# is fine & cool?
@WillEhrendreich
@WillEhrendreich Месяц назад
Type Inference. It's a drum I will beat all day and all night, a hill i will die on. I think it's even less that it's functional first and all that, which is of course awesome, but not having to fight function signatures because everything can be inferred is a MASSIVE speed up, especially in the prototype/exploration/"lets just get the thing working" stage. The amount of time, as a csharp dev professionally, I spend trying to babysit the compiler for every little change is absoutely absurd, and completely unnecessary, if only they would change the type system to be able to infer more properly. fsharp allows you to think more generically, to look at the way data is flowing through and transforming a bit more clearly. functions and data preferably separated, so you build up composable behavior on immutable data, and it ends up being a force multiplier there too, because you write great little re-usable lego pieces of code, and stack em together in new combinations really easily with the pipe operator.
@GackFinder
@GackFinder Месяц назад
Ah yes, going from filet mignon to ground chuck is always a very enticing prospect.
@WillEhrendreich
@WillEhrendreich Месяц назад
I know. I hate going back to csharp after knowing better.
@stefano_schmidt
@stefano_schmidt 4 месяца назад
I wish I had this F# in my C# (would like to handle errors as values, rather than throwing exception left and right😅)
@chrisnuk
@chrisnuk 4 месяца назад
There are a few libraries that give you that functionality. If you don't want to add third-party libraries you could return a tuple or create data structures that do the wrapping. If you go the latter route you'll probably start writing Source Generators to avoid writing more code and if you do, look at the source code of the third-party libraries. There are some very good ideas 😀
@konstsh2240
@konstsh2240 4 месяца назад
In F# it is not that flawless actually, out of the box you will have to wrap everything in Result functions, which will quickly become annoying. Somebody will say that you should use computation expressions for that, but the amount of builtin CE's in F# is very limited, there is no ones for Result and Option types, and CE's do not compose, so if you find yourself in need to operate in async of result or result of async you will have to go and look for specific CE. Also there is no custom bindings like in OCaml or error propagation operator like in Rust to just stay on happy path without CE's. So my impression was that though it is an interesting approach and F# talks mention it all the time the actual state of language doesn't provide enough support for one to feel confident enough with that choice.
@FilipCordas
@FilipCordas 4 месяца назад
Good luck with living with unmaintainable mess. Biggest f# project used by Walmart is being rewritten to Java because one of the biggest companies in the world couldn't find people to fix bugs on it because it was such a mess.
@obinnaokafor6252
@obinnaokafor6252 4 месяца назад
f# errors are bunch of reference types wrapped in result. and f# is not really that good to be sincere
@michielnass4836
@michielnass4836 3 месяца назад
@@konstsh2240 Async is for IO, not for the domain. Scott Wlashin has a great video on that. Yes we have to wrap everything and that can feel tedious but when it's time to refactor, it's a bliss.
@FilipCordas
@FilipCordas 4 месяца назад
Didn't fast f# guy switch to Odin?
@WillEhrendreich
@WillEhrendreich 4 месяца назад
He did switch his fastest portions to Odin. He writes the glue code/shell in fsharp still. Odin, by it's nature, is just so much better at the low level hardware and memory control that it blows away anything dotnet can accomplish. But fsharp is just about the best development experience a dev can get, as far as I can tell.
@WillEhrendreich
@WillEhrendreich Месяц назад
@@TapetBart You've got me there! I have no first hand experience in haskell, scala, ocaml, or lisp. I just know that I personally hold as most valuable the experience of having an algebraic, hindly milner type system for inference, being immutable by default, it being expression oriented and functional first, etc... I would imagine other functional langs have a superb DX as well, but I think I would look at the ecosystem for fsharp as a pretty big advantage. Being on dotnet is pretty nice, lots of good, stable, mature libraries, lots of free perf upgrades because the work on dotnet in general give improvements across the board, etc..
@WillEhrendreich
@WillEhrendreich Месяц назад
@@TapetBart oh I didn't think you were! I was just saying, beats me! haha. admitting to my own lack of experience in this area, really.
Далее
What's next in C# - Mads Torgersen - NDC Sydney 2024
1:03:21
F# for C# programmers - Scott Wlaschin
1:00:01
Просмотров 68 тыс.
КАК Я ЭТО СДЕЛАЛА?
00:13
Просмотров 257 тыс.
F# for Performance-Critical Code, by Matthew Crews
1:03:23
Simple Code, High Performance
2:50:14
Просмотров 240 тыс.
Why you should use F# - Phillip Carter
57:56
Просмотров 25 тыс.
Don't throw exceptions in C#. Do this instead
18:13
Просмотров 255 тыс.
Копия iPhone с WildBerries
1:00
Просмотров 8 млн