4 ms·
I was thinking as a conscious strategy that would impact the way all libraries are built. In my example I posted above, there are no dotnet APIs showing. Its al
by devmunchies 5y ago
I was thinking as a conscious strategy that would impact the way all libraries are built. In my example I posted above, there are no dotnet APIs showing. Its all abstracted. Libraries should create new APIs that are just wrappers around the dotnet library.
Whereas, if you look at the examples in the Giraffe framework, you need to do a bunch of dotnet boilerplate. https://github.com/giraffe-fsharp/Giraffe#doing-it-manually https://github.com/giraffe-fsharp/Giraffe#doing-it-manually
open System
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.Logging
open Microsoft.Extensions.DependencyInjection
open Giraffe
let webApp =
choose [
route "/ping" >=> text "pong"
route "/" >=> htmlFile "/pages/index.html" ]
type Startup() =
member __.ConfigureServices (services : IServiceCollection) =
// Register default Giraffe dependencies
services.AddGiraffe() |> ignore
member __.Configure (app : IApplicationBuilder)
(env : IHostEnvironment)
(loggerFactory : ILoggerFactory) =
// Add Giraffe to the ASP.NET Core pipeline
app.UseGiraffe webApp
[<EntryPoint>]
let main _ =
Host.CreateDefaultBuilder()
.ConfigureWebHostDefaults(
fun webHostBuilder ->
webHostBuilder
.UseStartup<Startup>()
|> ignore)
.Build()
.Run()
0
- DeathArrow 5y agoYou have to learn some of .NET framework if you plan to use its features like ASP .NET, but you do not have to learn C#. If you plan to use Python you have to learn some Python libraries.
- devmunchies 5y agoI get that you have to now. my point is that you shouldn't have to. lot of it could be abstracted. the more that is abstracted then the lower the barrier for newcomers.