Im Microsoft-Ökosystem ersetzt F # eine experimentelle Sprache, aus der erfolgreiche Konzepte anschließend auf C # übertragen werden. Gleichzeitig ist Hackfleisch zum großen Teil dank der Gemeinschaft zu einer echten Alternative für angewandte Projekte geworden. Unter dem Schnitt werden die Bestandteile des Backends, des Frontends, der Tests, der Montage und der Infrastruktur eines Projekts beschrieben, das vollständig in F # geschrieben wurde. Der Quellcode ist beigefügt.
Sicher
, , 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.
Ab Anfang 2021 eignet sich F # für kleine bis mittlere Anwendungsprojekte. Für mich sind die Vorteile dieser Sprache:
Front-End-Entwicklungsökosystem,
Typ System,
kompakte Syntax.
Bis diese Funktionen in C # erscheinen, wenn andere Dinge gleich sind, werde ich mich für Hackfleisch entscheiden.