No ecossistema da Microsoft, F # toma o lugar de uma linguagem experimental, da qual conceitos bem-sucedidos são posteriormente transportados para o C #. Ao mesmo tempo, graças em grande parte à comunidade, a carne picada se tornou uma verdadeira alternativa para projetos aplicados. No corte, são descritos os ingredientes do back-end, front-end, testes, montagem e infraestrutura de um projeto escrito inteiramente em F #. O código-fonte está anexado.
Seguro
, , SAFe Stack. SAFe dotnet CLI, SPA . .
SAF . . , , , SAFe.
- ‘S’ - Saturn - Giraffe, , , Asp.net.
- ‘A’ - Azure. - SAFe, , , , Farmer, , SAFe.
- ‘F’ - Fable - F# JavaScript - .
API Fable.Remoting. Fable.Remoting -. , , ( ). API , ( , , , ) . JSON, .
, , Fable.Remoting, Saturn - Giraffe - Asp.Net. , , Giraffe.
OpenAPI, GiraffeGenerator.
, NoSql DynamoDB. DynamoDb.Ok. Reader. , , . . , , .
C F# . F# Entity Framework Dapper.
: 1, 2, 3. , Flexible Types, .
JWT.
AWS AWSSDK, HTTP, SDK .
F# - Fable, JS. JS. (binding) , .. React .
Elmish - Elm-. Fable.React Bulma.
.
let quizView (dispatch : Msg -> unit) (settings:Settings) (quiz:QuizRecord) l10n = [
br []
figure [ Class "image is-128x128"; Style [Display DisplayOptions.InlineBlock] ] [ img [ Src <| Infra.urlForMediaImgSafe settings.MediaHost quiz.ImgKey ] ]
br []
h3 [Class "title is-3"] [str quiz.Name]
div [Class "notification is-white"][
p [Class "subtitle is-5"][
match quiz.StartTime with
| Some dt -> str (dt.ToString("yyyy-MM-dd HH:mm"))
| None -> str "???"
if quiz.Status = Live then
str " "
span [Class "tag is-danger is-light"][str "live"]
br[]
]
p [] (splitByLines quiz.Description)
if quiz.EventPage <> "" then
a[Href quiz.EventPage][str l10n.Details]
]
]
, , Elmish + Fable.React + Boolma . 2021 , , Feliz + Fable.React.WebComponent + Material UI - Fable.Svetle. .
Aws, AppSync, Aws Amplify.
. ( JMeter ).
. , F#. . , . FsUnit expecto. , , , , .
, :
Paket. Fake. SAFe. , - , , . , .
AWS Cloud Development Kit. F# , , C#.
. SAFe . , -.
. , , C#. VSCode Ionide. , , - - . , , , . Ionide Rider. , , .
Ionide, ILSpy, , .
, F# . , . FSI.
Desde o início de 2021, F # é adequado para projetos de aplicativos de pequeno a médio porte. Para mim, as vantagens desse idioma são:
ecossistema de desenvolvimento de front-end,
sistema de tipo,
sintaxe compacta.
Até que esses recursos apareçam em C #, outras coisas sendo iguais, minha escolha será a favor do mince.